rhachet-roles-ehmpathy 1.17.15 → 1.17.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -30,20 +30,36 @@ the same rename via sedreplace = 2 tool calls (dry-run + execute) = minimal toke
30
30
  # dry-run first (default) - see what would change
31
31
  npx rhachet run --skill sedreplace --old "oldName" --new "newName"
32
32
 
33
- # filter to specific file types
34
- npx rhachet run --skill sedreplace --old "oldName" --new "newName" --glob "*.ts"
33
+ # filter to specific file types (recursive)
34
+ npx rhachet run --skill sedreplace --old "oldName" --new "newName" --glob "**/*.ts"
35
+
36
+ # filter to files in a specific directory
37
+ npx rhachet run --skill sedreplace --old "oldName" --new "newName" --glob "src/**/*.ts"
35
38
 
36
39
  # apply changes after review of dry-run
37
40
  npx rhachet run --skill sedreplace --old "oldName" --new "newName" --execute
38
41
  ```
39
42
 
43
+ ### glob pattern semantics
44
+
45
+ the `--glob` option uses shell glob semantics:
46
+
47
+ | pattern | matches |
48
+ |---------|---------|
49
+ | `*.ts` | `.ts` files in root directory only |
50
+ | `**/*.ts` | all `.ts` files recursively |
51
+ | `src/*.ts` | `.ts` files directly in `src/` |
52
+ | `src/**/*.ts` | `.ts` files recursively in `src/` |
53
+ | `*.{ts,tsx}` | `.ts` and `.tsx` files in root |
54
+ | `**/*.{ts,tsx}` | all `.ts` and `.tsx` files recursively |
55
+
40
56
  ## .examples
41
57
 
42
58
  ### rename a function
43
59
 
44
60
  ```sh
45
61
  # rename getUserById -> findUserByUuid across all .ts files
46
- npx rhachet run --skill sedreplace --old "getUserById" --new "findUserByUuid" --glob "*.ts" --execute
62
+ npx rhachet run --skill sedreplace --old "getUserById" --new "findUserByUuid" --glob "**/*.ts" --execute
47
63
  ```
48
64
 
49
65
  ### update an import path
@@ -81,8 +81,10 @@ if ! git rev-parse --git-dir > /dev/null 2>&1; then
81
81
  fi
82
82
 
83
83
  # get git-tracked files, optionally filtered by glob
84
+ # note: use :(glob) magic pathspec for proper shell-like glob behavior
85
+ # without this, git ls-files uses pathspec matching where * matches /
84
86
  if [[ -n "$GLOB_FILTER" ]]; then
85
- FILES=$(git ls-files "$GLOB_FILTER")
87
+ FILES=$(git ls-files ":(glob)$GLOB_FILTER")
86
88
  else
87
89
  FILES=$(git ls-files)
88
90
  fi
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "rhachet-roles-ehmpathy",
3
3
  "author": "ehmpathy",
4
4
  "description": "empathetic software construction roles and skills, via rhachet",
5
- "version": "1.17.15",
5
+ "version": "1.17.16",
6
6
  "repository": "ehmpathy/rhachet-roles-ehmpathy",
7
7
  "homepage": "https://github.com/ehmpathy/rhachet-roles-ehmpathy",
8
8
  "keywords": [