Skip to content

Commit

Permalink
Replace ts-node with tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
rekmarks committed Dec 2, 2023
1 parent 1a9824e commit 909aef0
Show file tree
Hide file tree
Showing 5 changed files with 294 additions and 144 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"rimraf": "^4.0.5",
"stdio-mock": "^1.2.0",
"ts-jest": "^29.1.0",
"ts-node": "^10.7.0",
"tsx": "4.6.1",
"typescript": "~5.1.6"
},
"packageManager": "[email protected]",
Expand All @@ -81,7 +81,8 @@
},
"lavamoat": {
"allowScripts": {
"@lavamoat/preinstall-always-fail": false
"@lavamoat/preinstall-always-fail": false,
"tsx>esbuild": false
}
}
}
8 changes: 2 additions & 6 deletions tests/functional/helpers/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,5 @@ import path from 'path';

const ROOT_DIR = path.resolve(__dirname, '../../..');
export const TOOL_EXECUTABLE_PATH = path.join(ROOT_DIR, 'src', 'cli.ts');
export const TS_NODE_PATH = path.join(
ROOT_DIR,
'node_modules',
'.bin',
'ts-node',
);

export const TSX_PATH = path.join(ROOT_DIR, 'node_modules', '.bin', 'tsx');
5 changes: 2 additions & 3 deletions tests/functional/helpers/monorepo-environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import fs from 'fs';
import path from 'path';
import { ExecaReturnValue } from 'execa';
import YAML from 'yaml';
import { TOOL_EXECUTABLE_PATH, TS_NODE_PATH } from './constants.js';
import { TOOL_EXECUTABLE_PATH, TSX_PATH } from './constants.js';
import Environment, {
EnvironmentOptions,
PackageSpecification,
Expand Down Expand Up @@ -126,7 +126,6 @@ cat "${releaseSpecificationPath}" > "$1"
await fs.promises.chmod(releaseSpecificationEditorPath, 0o777);

const args = [
'--transpileOnly',
TOOL_EXECUTABLE_PATH,
'--project-directory',
this.localRepo.getWorkingDirectoryPath(),
Expand All @@ -137,7 +136,7 @@ cat "${releaseSpecificationPath}" > "$1"
const env = {
EDITOR: releaseSpecificationEditorPath,
};
const result = await this.localRepo.runCommand(TS_NODE_PATH, args, { env });
const result = await this.localRepo.runCommand(TSX_PATH, args, { env });

debug(
['---- START OUTPUT -----', result.all, '---- END OUTPUT -----'].join(
Expand Down
3 changes: 1 addition & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@
"strict": true,
"target": "ES2022"
},
"exclude": ["./dist/**/*", "node_modules"],
"ts-node": { "esm": true }
"exclude": ["./dist/**/*", "node_modules"]
}
Loading

0 comments on commit 909aef0

Please sign in to comment.