From e76ad2fb58a6e1e608db5f37006b53a91c14e5aa Mon Sep 17 00:00:00 2001 From: Juergen Kunz Date: Fri, 17 Oct 2025 06:43:36 +0000 Subject: [PATCH] fix(ts/index): Use cli.js as the spawned CLI entry point instead of cli.child.js --- changelog.md | 7 +++++++ ts/00_commitinfo_data.ts | 2 +- ts/index.ts | 10 +++++----- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/changelog.md b/changelog.md index 500b140..89af5b5 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,12 @@ # Changelog +## 2025-10-17 - 1.6.2 - fix(ts/index) +Use cli.js as the spawned CLI entry point instead of cli.child.js + +- Replace references to ../cli.child.js with ../cli.js in ts/index.ts (runInChildProcess and spawnPath) to ensure child processes spawn the correct CLI entry point. +- This change fixes child process spawning failures caused by referencing a non-existent cli.child.js file. +- Add local .claude/settings.local.json (local runner/editor permissions configuration). + ## 2025-10-17 - 1.6.1 - fix(plugins) Export child_process.spawn from plugins and use plugins.spawn in spawnPath to remove direct require and unify process spawning diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index bff22e5..63d7e9a 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@git.zone/tsrun', - version: '1.6.1', + version: '1.6.2', description: 'run typescript programs efficiently' } diff --git a/ts/index.ts b/ts/index.ts index 15e901e..292fa37 100644 --- a/ts/index.ts +++ b/ts/index.ts @@ -98,13 +98,13 @@ export const runCli = async (pathArg?: string, options?: IRunOptions) => { const runInChildProcess = async (pathArg: string | undefined, cwd: string): Promise => { const { spawn } = await import('child_process'); - // Resolve cli.child.js relative to this file - const cliChildPath = plugins.path.join(__dirname, '../cli.child.js'); + // Resolve cli.js relative to this file + const cliPath = plugins.path.join(__dirname, '../cli.js'); // Build args: [Node flags, entry point, script path, script args] const args = [ ...process.execArgv, // Preserve --inspect, etc. - cliChildPath, + cliPath, ...process.argv.slice(2) // Original CLI args (not spliced) ]; @@ -172,10 +172,10 @@ export const spawnPath = ( : filePath; // 2. Build spawn args - const cliChildPath = plugins.path.join(__dirname, '../cli.child.js'); + const cliPath = plugins.path.join(__dirname, '../cli.js'); const args = [ ...process.execArgv, - cliChildPath, + cliPath, resolvedPath, ...(options?.args || []) ];