refactor(#181): migrate workstream inventory builder to sdk/src/workstream (#250)

This commit is contained in:
Tom Boucher
2026-05-24 21:32:53 -04:00
committed by GitHub
parent 59bcdf03b6
commit 22e9c1de62
13 changed files with 22 additions and 17 deletions

View File

@@ -2,7 +2,7 @@
/**
* Generator for the Workstream Inventory Builder CJS artifact.
*
* Reads the compiled ESM output from sdk/dist/workstream-inventory/builder.js,
* Reads the compiled ESM output from sdk/dist/workstream/builder.js,
* extracts function source via Function.prototype.toString() for exports
* and via source-text extraction for internal helpers, then emits
* get-shit-done/bin/lib/workstream-inventory-builder.generated.cjs.
@@ -15,14 +15,14 @@ import { readFile, writeFile } from 'node:fs/promises';
import { fileURLToPath } from 'node:url';
import { requireFreshDist } from './_gen-helpers.mjs';
requireFreshDist('sdk/dist/workstream-inventory/builder.js', 'sdk/src/workstream-inventory/builder.ts');
requireFreshDist('sdk/dist/workstream/builder.js', 'sdk/src/workstream/builder.ts');
export const BANNER = `'use strict';
/**
* GENERATED FILE — DO NOT EDIT.
*
* Source: sdk/src/workstream-inventory/builder.ts
* Source: sdk/src/workstream/builder.ts
* Regenerate: cd sdk && npm run gen:workstream-inventory-builder
*
* Workstream Inventory Builder — pure projection from pre-collected
@@ -66,7 +66,7 @@ export function extractFunctionFromSource(source, name) {
export async function buildWorkstreamInventoryBuilderCjs() {
// Load the compiled ESM module to get exports via Function.prototype.toString()
const distUrl = new URL('../dist/workstream-inventory/builder.js', import.meta.url);
const distUrl = new URL('../dist/workstream/builder.js', import.meta.url);
const {
buildWorkstreamInventory,
isCompletedInventory,

View File

@@ -5,7 +5,7 @@
* Query handlers should render outputs from this inventory instead of
* rescanning workstream directories directly.
*
* Pure projection logic lives in ../workstream-inventory/builder.ts.
* Pure projection logic lives in ../workstream/builder.ts.
* This module handles I/O orchestration only.
*/
@@ -14,16 +14,16 @@ import { join } from 'node:path';
import { scanPhasePlans } from './plan-scan.js';
import { stateExtractField } from '../state/index.js';
import { readActiveWorkstream } from './active-workstream-store.js';
import { buildWorkstreamInventory } from '../workstream-inventory/builder.js';
import { buildWorkstreamInventory } from '../workstream/builder.js';
// Re-export types from the builder so downstream consumers can import from here.
export type {
WorkstreamPhaseInventory,
WorkstreamInventory,
WorkstreamInventoryList,
} from '../workstream-inventory/builder.js';
} from '../workstream/builder.js';
import type { WorkstreamInventory, WorkstreamInventoryList } from '../workstream-inventory/builder.js';
import type { WorkstreamInventory, WorkstreamInventoryList } from '../workstream/builder.js';
export const planningRoot = (projectDir: string): string =>
join(projectDir, '.planning');