Phase 4 of the CJS↔SDK hard-seam migration (parent #3524). Eliminates the `findProjectRoot` duplication that lived at bin/lib/core.cjs:74-140 and sdk/src/query/helpers.ts:497-590, the drift carrier behind historical bugs #1362 and #2561. - sdk/src/project-root/index.ts — source of truth (120 lines, pure-with-sync-fs). Exports findProjectRoot(startDir: string) and FIND_PROJECT_ROOT_MAX_DEPTH constant. - sdk/src/project-root/index.test.ts — 13 vitest pinning fixtures covering all four heuristics, the #1362 guard, malformed config fallback, empty sub_repos, deep nesting, and depth-limit enforcement. - sdk/scripts/gen-project-root.mjs — generator. Captures function body via Function.prototype.toString() from compiled sdk/dist/. Emits CJS preamble for destructured node:fs / node:path / node:os imports. - sdk/scripts/check-project-root-fresh.mjs — freshness check. Imports the generator function directly (Phase 3's cleaner pattern). - get-shit-done/bin/lib/project-root.generated.cjs — generator- emitted CJS mirror. - tests/project-root-generator.test.cjs — 11 parity assertions comparing SDK source and generated CJS for every fixture. - sdk/src/query/helpers.ts: -127 lines. The 94-line inline findProjectRoot plus the FIND_PROJECT_ROOT_MAX_DEPTH constant (originally at line 471) replaced by a single re-export: `export { findProjectRoot } from '../project-root/index.js';` Removed unused `parse as parsePath` import. - get-shit-done/bin/lib/core.cjs: -83 lines net. The 67-line inline findProjectRoot replaced by a single `require('./project-root.generated.cjs')`. The detectSubRepos helper at lines 40-56 stays (used by loadConfig migration). - sdk/package.json: gen:project-root + check:project-root-fresh scripts. - package.json: proxy for the freshness check. - .githooks/pre-commit: drift block. - .github/workflows/test.yml: drift check step after the state-document drift step. - CONTEXT.md: Project-Root Resolution Module entry. - docs/INVENTORY.md, docs/INVENTORY-MANIFEST.json: +1 module count, +1 row. - Full suite: 9226/9226 pass (baseline 9215 + 11 new parity fixtures). - SDK vitest: 1804/1804 pass. - Reader shrink: -127 SDK + -83 CJS = 210 lines of duplication deleted across the two Readers. New shared Module is 120 lines. 1. Depth limit canonicalization. CJS findProjectRoot previously had no explicit walk-up bound (walked until dir === root or homedir). The new Module uses FIND_PROJECT_ROOT_MAX_DEPTH = 10, matching the SDK's pre-existing value. Only affects paths nested more than 10 levels deep from a .planning/ root — a pathological case in practice. None of the existing 22 CJS findProjectRoot tests covered this; the new parity test does. 2. platformReadSync → readFileSync. The old CJS findProjectRoot used the platformReadSync wrapper from shell-command-projection.cjs for reading .planning/config.json, which returns null on read failure. The Module uses raw readFileSync, which throws — caught by the surrounding try/catch that already swallowed errors. Functionally equivalent for the existing code path; no test exercises the null-return semantic. Closes #3553.
81 lines
2.5 KiB
JSON
81 lines
2.5 KiB
JSON
{
|
|
"name": "get-shit-done-cc",
|
|
"version": "1.50.0-canary.0",
|
|
"description": "A meta-prompting, context engineering and spec-driven development system for Claude Code, OpenCode, Gemini and Codex by TÂCHES.",
|
|
"bin": {
|
|
"get-shit-done-cc": "bin/install.js",
|
|
"gsd-sdk": "bin/gsd-sdk.js",
|
|
"gsd-tools": "bin/gsd-sdk.js"
|
|
},
|
|
"files": [
|
|
"bin",
|
|
"commands",
|
|
"get-shit-done",
|
|
"agents",
|
|
"hooks",
|
|
"scripts",
|
|
"sdk/src",
|
|
"sdk/shared",
|
|
"sdk/prompts",
|
|
"sdk/dist",
|
|
"sdk/package.json",
|
|
"sdk/package-lock.json",
|
|
"sdk/tsconfig.json"
|
|
],
|
|
"keywords": [
|
|
"claude",
|
|
"claude-code",
|
|
"ai",
|
|
"meta-prompting",
|
|
"context-engineering",
|
|
"spec-driven-development",
|
|
"gemini",
|
|
"gemini-cli",
|
|
"codex",
|
|
"codex-cli"
|
|
],
|
|
"author": "TÂCHES",
|
|
"license": "MIT",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "git+https://github.com/gsd-build/get-shit-done.git"
|
|
},
|
|
"homepage": "https://github.com/gsd-build/get-shit-done",
|
|
"bugs": {
|
|
"url": "https://github.com/gsd-build/get-shit-done/issues"
|
|
},
|
|
"engines": {
|
|
"node": ">=22.0.0"
|
|
},
|
|
"dependencies": {
|
|
"@anthropic-ai/claude-agent-sdk": "^0.2.84",
|
|
"ws": "^8.20.0"
|
|
},
|
|
"devDependencies": {
|
|
"c8": "^11.0.0"
|
|
},
|
|
"optionalDependencies": {
|
|
"fallow": "^2.70.0"
|
|
},
|
|
"scripts": {
|
|
"build:hooks": "node scripts/build-hooks.js",
|
|
"build:sdk": "cd sdk && npm ci && npm run build",
|
|
"check:alias-drift": "cd sdk && npm run check:alias-drift",
|
|
"check:state-document-fresh": "cd sdk && npm run check:state-document-fresh",
|
|
"check:configuration-fresh": "cd sdk && npm run check:configuration-fresh",
|
|
"check:workstream-inventory-builder-fresh": "cd sdk && npm run check:workstream-inventory-builder-fresh",
|
|
"check:project-root-fresh": "cd sdk && npm run check:project-root-fresh",
|
|
"prepublishOnly": "npm run build:hooks && npm run build:sdk",
|
|
"pretest": "npm run build:sdk && npm run lint:skill-deps",
|
|
"pretest:coverage": "npm run build:sdk",
|
|
"lint:descriptions": "node scripts/lint-descriptions.cjs",
|
|
"lint:skill-deps": "node scripts/lint-skill-deps.cjs",
|
|
"lint:tests": "node scripts/lint-no-source-grep.cjs",
|
|
"lint:changeset": "node scripts/changeset/lint.cjs",
|
|
"changeset": "node scripts/changeset/new.cjs",
|
|
"changelog:render": "node scripts/changeset/cli.cjs render",
|
|
"test": "node scripts/run-tests.cjs",
|
|
"test:coverage": "c8 --check-coverage --lines 70 --reporter text --include 'get-shit-done/bin/lib/*.cjs' --exclude 'tests/**' --all node scripts/run-tests.cjs"
|
|
}
|
|
}
|