Compare commits

..

8 Commits

Author SHA1 Message Date
fd8dc2021d v2.0.1
Some checks failed
Default (tags) / security (push) Failing after 0s
Default (tags) / test (push) Failing after 0s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2025-12-13 09:36:28 +00:00
bd28ec06c6 fix(cli): Align package scope to @git.zone, bump dependency versions and remove obsolete pnpm workspace setting 2025-12-13 09:36:28 +00:00
6227a3d184 v2.0.0
Some checks failed
Default (tags) / security (push) Failing after 0s
Default (tags) / test (push) Failing after 0s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2025-11-17 08:36:33 +00:00
13cc0d3014 BREAKING CHANGE(tsconfig): Remove experimentalDecorators and useDefineForClassFields from tsconfig.json 2025-11-17 08:36:33 +00:00
2896cc396f 1.6.2
Some checks failed
Default (tags) / security (push) Failing after 1s
Default (tags) / test (push) Failing after 1s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2025-10-17 06:43:36 +00:00
e76ad2fb58 fix(ts/index): Use cli.js as the spawned CLI entry point instead of cli.child.js 2025-10-17 06:43:36 +00:00
6b6ecee0ed 1.6.1
Some checks failed
Default (tags) / security (push) Failing after 1s
Default (tags) / test (push) Failing after 1s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2025-10-17 06:26:00 +00:00
e5b57c894b fix(plugins): Export child_process.spawn from plugins and use plugins.spawn in spawnPath to remove direct require and unify process spawning 2025-10-17 06:26:00 +00:00
10 changed files with 928 additions and 867 deletions

View File

@@ -1,5 +1,35 @@
# Changelog # Changelog
## 2025-12-13 - 2.0.1 - fix(cli)
Align package scope to @git.zone, bump dependency versions and remove obsolete pnpm workspace setting
- Update runtime import in cli.ts.js from @gitzone/tsrun to @git.zone/tsrun
- Change npm package name in npmextra.json to @git.zone/tsrun
- Bump devDependencies and dependencies in package.json (@git.zone/tsbuild -> ^3.1.2, @push.rocks/smartcli -> ^4.0.19, @types/node -> ^25.0.1, @push.rocks/smartfile -> ^13.1.0, tsx -> ^4.21.0)
- Remove onlyBuiltDependencies entry from pnpm-workspace.yaml
- Ensure commitinfo metadata (ts/00_commitinfo_data.ts) and package.json remain aligned with @git.zone/tsrun
## 2025-11-17 - 2.0.0 - BREAKING CHANGE(tsconfig)
Remove experimentalDecorators and useDefineForClassFields from tsconfig.json
- tsconfig.json: removed compilerOptions.experimentalDecorators — decorator support is no longer enabled by default. Projects using decorators must enable experimentalDecorators in their own tsconfig.
- tsconfig.json: removed compilerOptions.useDefineForClassFields — class field emit will follow TypeScript defaults, which may change runtime semantics for some classes.
- This may break consumers relying on the previous compiler options; bumping the major version to reflect the potential breaking change.
## 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
- Exported spawn from ts/plugins.ts so native child_process.spawn is available via the plugins module
- Removed require('child_process') from ts/index.ts and switched to plugins.spawn when spawning child processes in spawnPath
- No public API changes; this unifies internal imports and fixes inconsistent spawn usage that could cause runtime issues
## 2025-10-17 - 1.6.0 - feat(core) ## 2025-10-17 - 1.6.0 - feat(core)
Add spawnPath child-process API with timeout/abort/terminate support, export native types, and expand README Add spawnPath child-process API with timeout/abort/terminate support, export native types, and expand README

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env node #!/usr/bin/env node
process.env.CLI_CALL = 'true'; process.env.CLI_CALL = 'true';
import * as tsrun from '@gitzone/tsrun'; import * as tsrun from '@git.zone/tsrun';
tsrun.runPath('./cli.child.js', import.meta.url); tsrun.runPath('./cli.child.js', import.meta.url);

View File

@@ -11,7 +11,7 @@
"gitscope": "gitzone", "gitscope": "gitzone",
"gitrepo": "tsrun", "gitrepo": "tsrun",
"description": "run typescript programs efficiently", "description": "run typescript programs efficiently",
"npmPackagename": "@gitzone/tsrun", "npmPackagename": "@git.zone/tsrun",
"license": "MIT" "license": "MIT"
} }
} }

View File

@@ -1,6 +1,6 @@
{ {
"name": "@git.zone/tsrun", "name": "@git.zone/tsrun",
"version": "1.6.0", "version": "2.0.1",
"description": "run typescript programs efficiently", "description": "run typescript programs efficiently",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts", "typings": "dist_ts/index.d.ts",
@@ -17,15 +17,15 @@
"buildDocs": "tsdoc" "buildDocs": "tsdoc"
}, },
"devDependencies": { "devDependencies": {
"@git.zone/tsbuild": "^2.1.80", "@git.zone/tsbuild": "^3.1.2",
"@push.rocks/smartcli": "^4.0.11", "@push.rocks/smartcli": "^4.0.19",
"@types/node": "^20.14.8", "@types/node": "^25.0.1",
"node-fetch": "^3.3.2" "node-fetch": "^3.3.2"
}, },
"dependencies": { "dependencies": {
"@push.rocks/smartfile": "^11.0.21", "@push.rocks/smartfile": "^13.1.0",
"@push.rocks/smartshell": "^3.0.5", "@push.rocks/smartshell": "^3.0.5",
"tsx": "^4.19.2" "tsx": "^4.21.0"
}, },
"private": false, "private": false,
"files": [ "files": [

1726
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,2 +0,0 @@
onlyBuiltDependencies:
- esbuild

View File

@@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@git.zone/tsrun', name: '@git.zone/tsrun',
version: '1.6.0', version: '2.0.1',
description: 'run typescript programs efficiently' description: 'run typescript programs efficiently'
} }

View File

@@ -98,13 +98,13 @@ export const runCli = async (pathArg?: string, options?: IRunOptions) => {
const runInChildProcess = async (pathArg: string | undefined, cwd: string): Promise<void> => { const runInChildProcess = async (pathArg: string | undefined, cwd: string): Promise<void> => {
const { spawn } = await import('child_process'); const { spawn } = await import('child_process');
// Resolve cli.child.js relative to this file // Resolve cli.js relative to this file
const cliChildPath = plugins.path.join(__dirname, '../cli.child.js'); const cliPath = plugins.path.join(__dirname, '../cli.js');
// Build args: [Node flags, entry point, script path, script args] // Build args: [Node flags, entry point, script path, script args]
const args = [ const args = [
...process.execArgv, // Preserve --inspect, etc. ...process.execArgv, // Preserve --inspect, etc.
cliChildPath, cliPath,
...process.argv.slice(2) // Original CLI args (not spliced) ...process.argv.slice(2) // Original CLI args (not spliced)
]; ];
@@ -159,8 +159,6 @@ export const spawnPath = (
fromFileUrl?: string | URL, fromFileUrl?: string | URL,
options?: ISpawnOptions options?: ISpawnOptions
): ITsrunChildProcess => { ): ITsrunChildProcess => {
const { spawn } = require('child_process');
// 1. Resolve path (similar to runPath) // 1. Resolve path (similar to runPath)
const resolvedPath = fromFileUrl const resolvedPath = fromFileUrl
? plugins.path.join( ? plugins.path.join(
@@ -174,10 +172,10 @@ export const spawnPath = (
: filePath; : filePath;
// 2. Build spawn args // 2. Build spawn args
const cliChildPath = plugins.path.join(__dirname, '../cli.child.js'); const cliPath = plugins.path.join(__dirname, '../cli.js');
const args = [ const args = [
...process.execArgv, ...process.execArgv,
cliChildPath, cliPath,
resolvedPath, resolvedPath,
...(options?.args || []) ...(options?.args || [])
]; ];
@@ -192,7 +190,7 @@ export const spawnPath = (
}; };
// 4. Spawn child process // 4. Spawn child process
const child = spawn(process.execPath, args, spawnOptions); const child = plugins.spawn(process.execPath, args, spawnOptions);
// 5. Set up timeout if provided // 5. Set up timeout if provided
let timeoutId: NodeJS.Timeout | undefined; let timeoutId: NodeJS.Timeout | undefined;

View File

@@ -1,10 +1,11 @@
// node native // node native
import * as path from 'path'; import * as path from 'path';
import * as url from 'url'; import * as url from 'url';
import { spawn } from 'child_process';
import type { ChildProcess } from 'child_process'; import type { ChildProcess } from 'child_process';
import type { Readable } from 'stream'; import type { Readable } from 'stream';
export { path, url }; export { path, url, spawn };
export type { ChildProcess, Readable }; export type { ChildProcess, Readable };
// @pushrocks scope // @pushrocks scope

View File

@@ -1,7 +1,5 @@
{ {
"compilerOptions": { "compilerOptions": {
"experimentalDecorators": true,
"useDefineForClassFields": false,
"target": "ES2022", "target": "ES2022",
"module": "NodeNext", "module": "NodeNext",
"moduleResolution": "NodeNext", "moduleResolution": "NodeNext",