Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
212 changes: 70 additions & 142 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/build-info/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"@vitest/ui": "^3.0.0",
"execa": "^8.0.0",
"memfs": "^4.0.0",
"tsx": "^4.21.0",
"typescript": "^5.0.0",
"unionfs": "^4.4.0",
"vitest": "^3.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/build-info/tests/bin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const runBinary = (...args: string[]) => {
return execaNode(binary, args)
}
const binary = fileURLToPath(new URL('../src/node/bin.ts', import.meta.url))
return execa('node', ['--loader=ts-node/esm', '--no-warnings', binary, ...args])
return execa('tsx', ['--no-warnings', binary, ...args])
}

test('CLI --help flag', async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/build/docs/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ The parent process then
to
[`import()` the plugin's main file](https://github.com/netlify/build/blob/509efdfe5fd41bdbeb3b9e930b07ac984531b785/packages/build/src/plugins/child/logic.js#L10).
- If the plugin uses TypeScript and does not run `tsc` before `npm publish`,
[`ts-node` is registered first](https://github.com/netlify/build/blob/509efdfe5fd41bdbeb3b9e930b07ac984531b785/packages/build/src/plugins/child/typescript.js#L11)
[`tsx` is registered first](https://github.com/netlify/build/blob/509efdfe5fd41bdbeb3b9e930b07ac984531b785/packages/build/src/plugins/child/typescript.js#L11)
to transpile it on-the-fly. This is useful for TypeScript plugin authors to test their plugins in production.
- The plugin's shape
[is also validated](https://github.com/netlify/build/blob/509efdfe5fd41bdbeb3b9e930b07ac984531b785/packages/build/src/plugins/child/validate.js#L6).
Expand Down
2 changes: 1 addition & 1 deletion packages/build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
"string-width": "^7.0.0",
"supports-color": "^10.0.0",
"terminal-link": "^4.0.0",
"ts-node": "^10.9.1",
"tsx": "^4.21.0",
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't add any subdependencies, as we already use esbuild@0.27.2 just like tsx: https://node-modules.dev/grid/depth#install=esbuild@0.27.2+tsx@^4.21.0.
It does add ~600 KB for tsx itself.
But we save ~2 MB from removing ts-node: https://node-modules.dev/chart#selected=ts-node@10.9.2&install=ts-node (note: we won't save the 23 MB from typescript because we depend on it elsewhere).

"typescript": "^5.0.0",
"uuid": "^11.0.0",
"yaml": "^2.8.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/build/src/plugins/child/load.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import { validatePlugin } from './validate.js'
// Do it when parent requests it using the `load` event.
// Also figure out the list of plugin steps. This is also passed to the parent.
export const load = async function ({ pluginPath, inputs, packageJson, verbose, netlifyConfig }) {
const tsNodeService = registerTypeScript(pluginPath)
const logic = await getLogic({ pluginPath, inputs, tsNodeService, netlifyConfig })
registerTypeScript(pluginPath)
const logic = await getLogic({ pluginPath, inputs, netlifyConfig })

validatePlugin(logic)

Expand Down
Loading
Loading