Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: convert small ts files in node_dependencies to ts (#710)
* chore: migrate a bunch of files to typescript * chore: tighten typescript rules * chore: package is a reserved keyword * Update src/runtimes/node/bundlers/esbuild/plugin_native_modules.js Co-authored-by: Eduardo Bouças <mail@eduardoboucas.com> * Update src/runtimes/node/bundlers/esbuild/plugin_native_modules.js Co-authored-by: Eduardo Bouças <mail@eduardoboucas.com> * Update src/runtimes/node/bundlers/esbuild/plugin_native_modules.js Co-authored-by: Eduardo Bouças <mail@eduardoboucas.com> * chore: add gypfile, files and binary fields to PackageJSON * chore: replace module.exports * chore: use export {} Co-authored-by: Netlify Team Account 1 <netlify-team-account-1@users.noreply.github.com> Co-authored-by: Eduardo Bouças <mail@eduardoboucas.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
- Loading branch information
1 parent
2fbb4f7
commit 1d31869
Showing
19 changed files
with
198 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
declare module 'require-package-name' { | ||
export default function requirePackageName(requireStatement: string): string | ||
} | ||
|
||
declare module 'is-builtin-module' { | ||
export default function isBuiltInModule(moduleName: string): boolean | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { getPublishedFiles } from './published' | ||
|
||
// Some modules generate source files on `postinstall` that are not located | ||
// inside the module's directory itself. | ||
const getSideFiles = async function (modulePath: string, moduleName: string): Promise<string[]> { | ||
const sideFiles = SIDE_FILES[moduleName] | ||
if (sideFiles === undefined) { | ||
return [] | ||
} | ||
|
||
return await getPublishedFiles(`${modulePath}/${sideFiles}`) | ||
} | ||
|
||
const SIDE_FILES: Record<string, string> = { | ||
'@prisma/client': '../../.prisma', | ||
} | ||
|
||
export { getSideFiles } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
1d31869
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⏱ Benchmark results
largeDepsEsbuild: 11.5s
largeDepsZisi: 1m 1.8s