Skip to content

Commit

Permalink
feat(node): upgrade minimum version (#29)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: upgrade minimum version to 20
  • Loading branch information
MickVanDuijn committed Jan 3, 2024
1 parent 7ca7427 commit 005fe3d
Show file tree
Hide file tree
Showing 8 changed files with 2,704 additions and 3,372 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"typescript.inlayHints.parameterNames.suppressWhenArgumentMatchesName": true,
"typescript.referencesCodeLens.enabled": true,
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.preferences.autoImportFileExcludePatterns": ["**/index.ts"],
"debug.javascript.terminalOptions": {
"skipFiles": ["<node_internals>/**"],
"sourceMaps": true,
Expand Down
6 changes: 3 additions & 3 deletions bin/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url))
const project = path.join(__dirname, '../tsconfig.json')
const dev = fs.existsSync(project) && process.env.DEBUG != 'false'

if (!process.env.NODE_OPTIONS?.includes('--loader ts-node/esm')) {
if (!process.env.NODE_OPTIONS?.includes('--import tsx/esm')) {
await new Promise((resolve, reject) => {
const subprocess = spawn(process.argv[0], [...process.argv.slice(1)], {
cwd: process.cwd(),
env: { ...process.env, NODE_OPTIONS: `--loader ts-node/esm/transpile-only ${process.env.NODE_OPTIONS ?? ''}` },
env: { ...process.env, NODE_OPTIONS: `--import tsx/esm --enable-source-maps ${process.env.NODE_OPTIONS ?? ''}` },
stdio: 'inherit',
})

Expand All @@ -32,5 +32,5 @@ if (!process.env.NODE_OPTIONS?.includes('--loader ts-node/esm')) {
process.exit(0)
}

const { run } = dev ? await import('../src/index.js') : await import('../.dist/index.js')
const { run } = dev ? await import('../src/index.ts') : await import('../.dist/index.js')
await run().catch(console.error)
Loading

0 comments on commit 005fe3d

Please sign in to comment.