diff --git a/get-shit-done/bin/lib/project-root.generated.cjs b/get-shit-done/bin/lib/project-root.generated.cjs index bb85c50d3..4f3c45d2c 100644 --- a/get-shit-done/bin/lib/project-root.generated.cjs +++ b/get-shit-done/bin/lib/project-root.generated.cjs @@ -3,7 +3,7 @@ /** * GENERATED FILE — DO NOT EDIT. * - * Source: sdk/src/project-root/index.ts + * Source: sdk/src/runtime/project-root.ts * Regenerate: cd sdk && npm run gen:project-root * * Project-Root Resolution Module — resolves a project root from a starting diff --git a/sdk/scripts/gen-project-root.mjs b/sdk/scripts/gen-project-root.mjs index 660ca3de9..7c781c729 100644 --- a/sdk/scripts/gen-project-root.mjs +++ b/sdk/scripts/gen-project-root.mjs @@ -2,7 +2,7 @@ /** * Generator for the Project-Root Resolution Module CJS artifact. * - * Imports the compiled ESM output from sdk/dist/project-root/index.js, + * Imports the compiled ESM output from sdk/dist/runtime/project-root.js, * captures findProjectRoot via Function.prototype.toString(), then emits * get-shit-done/bin/lib/project-root.generated.cjs. * @@ -14,14 +14,14 @@ import { writeFile } from 'node:fs/promises'; import { fileURLToPath } from 'node:url'; import { requireFreshDist } from './_gen-helpers.mjs'; -requireFreshDist('sdk/dist/project-root/index.js', 'sdk/src/project-root/index.ts'); +requireFreshDist('sdk/dist/runtime/project-root.js', 'sdk/src/runtime/project-root.ts'); const BANNER = `'use strict'; /** * GENERATED FILE — DO NOT EDIT. * - * Source: sdk/src/project-root/index.ts + * Source: sdk/src/runtime/project-root.ts * Regenerate: cd sdk && npm run gen:project-root * * Project-Root Resolution Module — resolves a project root from a starting @@ -41,7 +41,7 @@ const BANNER = `'use strict'; * duplicating the logic. */ export async function buildProjectRootCjs() { - const distUrl = new URL('../dist/project-root/index.js', import.meta.url); + const distUrl = new URL('../dist/runtime/project-root.js', import.meta.url); const { findProjectRoot, FIND_PROJECT_ROOT_MAX_DEPTH } = await import(distUrl.href); const findProjectRootBody = findProjectRoot.toString(); diff --git a/sdk/src/query/helpers.ts b/sdk/src/query/helpers.ts index f1d3526c5..a8db4b0ec 100644 --- a/sdk/src/query/helpers.ts +++ b/sdk/src/query/helpers.ts @@ -502,9 +502,9 @@ export function planningPaths(projectDir: string, workstream?: string): Planning } // ─── findProjectRoot (multi-repo .planning resolution) ───────────────────── -// Implementation lives in sdk/src/project-root/index.ts — re-exported here +// Implementation lives in sdk/src/runtime/project-root.ts — re-exported here // so that existing consumers of helpers.ts continue to work unchanged. -export { findProjectRoot } from '../project-root/index.js'; +export { findProjectRoot } from '../runtime/project-root.js'; // ─── resolvePathUnderProject ─────────────────────────────────────────────── diff --git a/sdk/src/project-root/index.test.ts b/sdk/src/runtime/project-root.test.ts similarity index 98% rename from sdk/src/project-root/index.test.ts rename to sdk/src/runtime/project-root.test.ts index 01b8cce60..3a8bf2687 100644 --- a/sdk/src/project-root/index.test.ts +++ b/sdk/src/runtime/project-root.test.ts @@ -1,5 +1,5 @@ /** - * Pinning tests for sdk/src/project-root/index.ts + * Pinning tests for sdk/src/runtime/project-root.ts * * These tests pin the behaviour of findProjectRoot before the CJS refactor * in Cycle 2. They must remain GREEN throughout (never bend the implementation @@ -14,7 +14,7 @@ import { describe, it, expect, beforeEach, afterEach } from 'vitest'; import { mkdtemp, rm, writeFile, mkdir } from 'node:fs/promises'; import { join } from 'node:path'; import { tmpdir } from 'node:os'; -import { findProjectRoot } from './index.js'; +import { findProjectRoot } from './project-root.js'; describe('findProjectRoot (project-root module)', () => { let workspace: string; diff --git a/sdk/src/project-root/index.ts b/sdk/src/runtime/project-root.ts similarity index 99% rename from sdk/src/project-root/index.ts rename to sdk/src/runtime/project-root.ts index 5291ce92e..5e86cdcdb 100644 --- a/sdk/src/project-root/index.ts +++ b/sdk/src/runtime/project-root.ts @@ -10,7 +10,8 @@ * Bounded by FIND_PROJECT_ROOT_MAX_DEPTH ancestors. Sync I/O. * * Source of truth for `findProjectRoot` — the CJS artifact at - * get-shit-done/bin/lib/project-root.generated.cjs is generated from this file. + * get-shit-done/bin/lib/project-root.generated.cjs is generated from + * sdk/src/runtime/project-root.ts. */ import { dirname, resolve, sep, relative, parse as parsePath } from 'node:path'; diff --git a/tests/gen-staleness-check.test.cjs b/tests/gen-staleness-check.test.cjs index bd9c7094b..1afca8361 100644 --- a/tests/gen-staleness-check.test.cjs +++ b/tests/gen-staleness-check.test.cjs @@ -53,8 +53,8 @@ const GENERATORS = [ }, { script: 'gen-project-root.mjs', - dist: 'sdk/dist/project-root/index.js', - ts: 'sdk/src/project-root/index.ts', + dist: 'sdk/dist/runtime/project-root.js', + ts: 'sdk/src/runtime/project-root.ts', }, { script: 'gen-workstream-inventory-builder.mjs', diff --git a/tests/project-root-generator.test.cjs b/tests/project-root-generator.test.cjs index 46302767b..a44bdd826 100644 --- a/tests/project-root-generator.test.cjs +++ b/tests/project-root-generator.test.cjs @@ -2,7 +2,7 @@ /** * CJS parity test — project-root module * - * For every fixture from sdk/src/project-root/index.test.ts, asserts that + * For every fixture from sdk/src/runtime/project-root.test.ts, asserts that * both the SDK (ESM, via dynamic import) and the generated CJS artifact * return identical paths. This confirms that the generator correctly * captures the function body and that all dependencies (sep, dirname, @@ -21,7 +21,7 @@ const { findProjectRoot: findProjectRootCjs } = require('../get-shit-done/bin/li // SDK ESM — loaded once before all tests via dynamic import let findProjectRootSdk; before(async () => { - const mod = await import('../sdk/dist/project-root/index.js'); + const mod = await import('../sdk/dist/runtime/project-root.js'); findProjectRootSdk = mod.findProjectRoot; });