fix: rename gsd-tools.js to .cjs to prevent ESM conflicts (closes #495)
Projects with "type": "module" in package.json cause Node to treat gsd-tools.js as ESM, crashing on require(). The .cjs extension forces CommonJS regardless of the host project's module configuration. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -29,7 +29,7 @@ Exit.
|
||||
Load phase operation context:
|
||||
|
||||
```bash
|
||||
INIT=$(node ~/.claude/get-shit-done/bin/gsd-tools.js init phase-op "${target}")
|
||||
INIT=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs init phase-op "${target}")
|
||||
```
|
||||
|
||||
Extract: `phase_found`, `phase_dir`, `phase_number`, `commit_docs`, `roadmap_exists`.
|
||||
@@ -79,13 +79,13 @@ Wait for confirmation.
|
||||
**Delegate the entire removal operation to gsd-tools:**
|
||||
|
||||
```bash
|
||||
RESULT=$(node ~/.claude/get-shit-done/bin/gsd-tools.js phase remove "${target}")
|
||||
RESULT=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs phase remove "${target}")
|
||||
```
|
||||
|
||||
If the phase has executed plans (SUMMARY.md files), gsd-tools will error. Use `--force` only if the user confirms:
|
||||
|
||||
```bash
|
||||
RESULT=$(node ~/.claude/get-shit-done/bin/gsd-tools.js phase remove "${target}" --force)
|
||||
RESULT=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs phase remove "${target}" --force)
|
||||
```
|
||||
|
||||
The CLI handles:
|
||||
@@ -102,7 +102,7 @@ Extract from result: `removed`, `directory_deleted`, `renamed_directories`, `ren
|
||||
Stage and commit the removal:
|
||||
|
||||
```bash
|
||||
node ~/.claude/get-shit-done/bin/gsd-tools.js commit "chore: remove phase {target} ({original-phase-name})" --files .planning/
|
||||
node ~/.claude/get-shit-done/bin/gsd-tools.cjs commit "chore: remove phase {target} ({original-phase-name})" --files .planning/
|
||||
```
|
||||
|
||||
The commit message preserves the historical record of what was removed.
|
||||
|
||||
Reference in New Issue
Block a user