cc-pipeline 0.6.1 → 0.6.3

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.
Files changed (2) hide show
  1. package/bin/cc-pipeline.js +24 -11
  2. package/package.json +1 -1
@@ -1,15 +1,28 @@
1
1
  #!/usr/bin/env node
2
- // Register tsx as an in-process ESM loader, then import and run the TypeScript CLI
3
- // directly in this process. This keeps everything single-process so signal handlers
4
- // registered by the engine work correctly (no subprocess forwarding needed).
5
- // Load tsx's programmatic ESM registration API
6
- // Use createRequire to resolve tsx relative to this package (handles hoisted deps)
2
+ // tsx v4+ requires --import, not the loader hooks API.
3
+ // Spawn node with --import tsx/esm, resolving tsx relative to this package
4
+ // so it works regardless of npm hoisting.
5
+ import { spawn } from 'node:child_process';
7
6
  import { createRequire } from 'node:module';
7
+ import { fileURLToPath, pathToFileURL } from 'node:url';
8
+ import { dirname, join } from 'node:path';
9
+
10
+ const __dirname = dirname(fileURLToPath(import.meta.url));
8
11
  const require = createRequire(import.meta.url);
9
- const tsxApiPath = require.resolve('tsx/dist/esm/api/index.mjs');
10
- const { register } = await import(tsxApiPath);
11
- register();
12
12
 
13
- // Now TypeScript imports resolve correctly in this process
14
- const { run } = await import('../src/cli.ts');
15
- await run(process.argv.slice(2));
13
+ const tsxEsm = pathToFileURL(require.resolve('tsx/esm')).href;
14
+ const cli = join(__dirname, '../src/cli.ts');
15
+
16
+ const child = spawn(
17
+ process.execPath,
18
+ ['--import', tsxEsm, cli, ...process.argv.slice(2)],
19
+ { stdio: 'inherit' }
20
+ );
21
+
22
+ // SIGINT is broadcast to the whole process group on Ctrl-C, but SIGTERM is not.
23
+ process.on('SIGTERM', () => child.kill('SIGTERM'));
24
+
25
+ child.on('exit', (code, signal) => {
26
+ if (signal) process.kill(process.pid, signal);
27
+ else process.exit(code ?? 0);
28
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc-pipeline",
3
- "version": "0.6.1",
3
+ "version": "0.6.3",
4
4
  "description": "Autonomous Claude Code pipeline engine. Install into any repo, write a BRIEF.md, and let Claude build your project phase by phase.",
5
5
  "type": "module",
6
6
  "bin": {