Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: Add globalPreload to ts-node/esm for node 20#2009

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
isaacs wants to merge14 commits intoTypeStrong:main
base:main
Choose a base branch
Loading
fromisaacs:isaacs/node-20-fix
Open
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
14 commits
Select commitHold shift + click to select a range
670d0ea
remove swc experimental options
isaacsSep 7, 2023
afbd4b6
fix: Add globalPreload to ts-node/esm for node 20
isaacsMay 6, 2023
71e319c
loader: return empty globalPreload when not using off-thread loader
isaacsMay 7, 2023
8b4be1d
fix: ts-node --esm on Node v20
isaacsMay 23, 2023
a7aa440
WIP fix tests for off-thread loader
cspotcodeJul 24, 2023
9346c54
Pushing my local changes
cspotcodeSep 1, 2023
db1fdf9
test: fix node defaultLoad error message check
isaacsSep 1, 2023
d68a150
loader: TSError that survives thread comms channel
isaacsSep 1, 2023
04d9419
loader: Set default 'pretty' option properly
isaacsSep 2, 2023
fba2006
use built-in source map support in node v20
isaacsSep 2, 2023
5c83838
test: line numbers in eval are not reliably source mapped
isaacsSep 5, 2023
49c74a0
add support for '--import ts-node/import'
isaacsSep 6, 2023
ed07dd9
test: allow windows line endings, node-version-specific path displays
isaacsSep 7, 2023
b614b1b
test: allow win32 line endings, path displays
isaacsSep 7, 2023
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
PrevPrevious commit
NextNext commit
Pushing my local changes
  • Loading branch information
@cspotcode@isaacs
cspotcode authored andisaacs committedSep 7, 2023
commit9346c54864c0dfc423fcb6e6b35cb248d451cd81
2 changes: 1 addition & 1 deletionpackage.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -113,7 +113,7 @@
"homepage": "https://typestrong.org/ts-node",
"devDependencies": {
"@TypeStrong/fs-fixture-builder": "https://github.com/Typestrong/fs-fixture-builder.git#3099e53621daf99db971af29c96145dc115693cd",
"@cspotcode/ava-lib": "https://github.com/cspotcode/ava-lib#bbbed83f393342b51dc6caf2ddf775a3e89371d8",
"@cspotcode/ava-lib": "https://github.com/cspotcode/ava-lib#805aab17b2b89c388596b6dc2b4eece403c5fb87",
"@cspotcode/expect-stream": "https://github.com/cspotcode/node-expect-stream#4e425ff1eef240003af8716291e80fbaf3e3ae8f",
"@microsoft/api-extractor": "^7.19.4",
"@swc/core": "1.3.32",
Expand Down
8 changes: 4 additions & 4 deletionssrc/esm.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -43,7 +43,7 @@ export namespace NodeLoaderHooksAPI1 {
export interface NodeLoaderHooksAPI2 {
resolve: NodeLoaderHooksAPI2.ResolveHook;
load: NodeLoaderHooksAPI2.LoadHook;
globalPreload?: NodeLoaderHooksAPI2.GlobalPreload;
globalPreload?: NodeLoaderHooksAPI2.GlobalPreloadHook;
}
export namespace NodeLoaderHooksAPI2 {
export type ResolveHook = (
Expand DownExpand Up@@ -75,7 +75,7 @@ export namespace NodeLoaderHooksAPI2 {
export interface NodeImportAssertions {
type?: 'json';
}
export typeGlobalPreload = () => string;
export typeGlobalPreloadHook = () => string;
}

export type NodeLoaderHooksFormat = 'builtin' | 'commonjs' | 'dynamic' | 'json' | 'module' | 'wasm';
Expand All@@ -92,10 +92,10 @@ const newHooksAPI = versionGteLt(process.versions.node, '16.12.0');
export function filterHooksByAPIVersion(
hooks: NodeLoaderHooksAPI1 & NodeLoaderHooksAPI2
): NodeLoaderHooksAPI1 | NodeLoaderHooksAPI2 {
const { getFormat, load, resolve, transformSource } = hooks;
const { getFormat, load, resolve, transformSource, globalPreload } = hooks;
// Explicit return type to avoid TS's non-ideal inferred type
const hooksAPI: NodeLoaderHooksAPI1 | NodeLoaderHooksAPI2 = newHooksAPI
? { resolve, load, getFormat: undefined, transformSource: undefined }
? { resolve, load,globalPreload,getFormat: undefined, transformSource: undefined }
: { resolve, getFormat, transformSource, load: undefined };
return hooksAPI;
}
Expand Down
29 changes: 15 additions & 14 deletionsyarn.lock
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -241,16 +241,17 @@ __metadata:
languageName: node
linkType: hard

"@cspotcode/ava-lib@https://github.com/cspotcode/ava-lib#bbbed83f393342b51dc6caf2ddf775a3e89371d8":
"@cspotcode/ava-lib@https://github.com/cspotcode/ava-lib#805aab17b2b89c388596b6dc2b4eece403c5fb87":
version: 0.0.1
resolution: "@cspotcode/ava-lib@https://github.com/cspotcode/ava-lib.git#commit=bbbed83f393342b51dc6caf2ddf775a3e89371d8"
resolution: "@cspotcode/ava-lib@https://github.com/cspotcode/ava-lib.git#commit=805aab17b2b89c388596b6dc2b4eece403c5fb87"
dependencies:
"@types/node": "*"
chalk: 4.1.2
throat: ^6.0.1
peerDependencies:
ava: "*"
expect: "*"
checksum:3ca30bbfe81abb537e1e96addd272b34daf19ecba56f13a5785115bc3433dc5309e733ab8440384531b7a74b88f58eb11c9151e62b75c5c219eccc7dd8b058ec
checksum:3b453c2f1dd64eeb531a8b6da4cd4d9b24364b31b6692aca5d646d40479e46db56acc4141d93871732f33ab86e91b4c6a08674d1bcf49fc8c8ff8dab9f005742
languageName: node
linkType: hard

Expand DownExpand Up@@ -1257,6 +1258,16 @@ __metadata:
languageName: node
linkType: hard

"chalk@npm:4.1.2, chalk@npm:^4.0.0":
version: 4.1.2
resolution: "chalk@npm:4.1.2"
dependencies:
ansi-styles: ^4.1.0
supports-color: ^7.1.0
checksum: fe75c9d5c76a7a98d45495b91b2172fa3b7a09e0cc9370e5c8feb1c567b85c4288e2b3fded7cfdd7359ac28d6b3844feb8b82b8686842e93d23c827c417e83fc
languageName: node
linkType: hard

"chalk@npm:^2.0.0":
version: 2.4.2
resolution: "chalk@npm:2.4.2"
Expand All@@ -1268,16 +1279,6 @@ __metadata:
languageName: node
linkType: hard

"chalk@npm:^4.0.0":
version: 4.1.2
resolution: "chalk@npm:4.1.2"
dependencies:
ansi-styles: ^4.1.0
supports-color: ^7.1.0
checksum: fe75c9d5c76a7a98d45495b91b2172fa3b7a09e0cc9370e5c8feb1c567b85c4288e2b3fded7cfdd7359ac28d6b3844feb8b82b8686842e93d23c827c417e83fc
languageName: node
linkType: hard

"chalk@npm:^5.2.0":
version: 5.2.0
resolution: "chalk@npm:5.2.0"
Expand DownExpand Up@@ -3810,7 +3811,7 @@ __metadata:
resolution: "ts-node@workspace:."
dependencies:
"@TypeStrong/fs-fixture-builder": "https://github.com/Typestrong/fs-fixture-builder.git#3099e53621daf99db971af29c96145dc115693cd"
"@cspotcode/ava-lib": "https://github.com/cspotcode/ava-lib#bbbed83f393342b51dc6caf2ddf775a3e89371d8"
"@cspotcode/ava-lib": "https://github.com/cspotcode/ava-lib#805aab17b2b89c388596b6dc2b4eece403c5fb87"
"@cspotcode/expect-stream": "https://github.com/cspotcode/node-expect-stream#4e425ff1eef240003af8716291e80fbaf3e3ae8f"
"@cspotcode/source-map-support": ^0.8.0
"@microsoft/api-extractor": ^7.19.4
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp