diff --git a/.prettierignore b/.prettierignore index 20eddb1d..8dc2bc7a 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,4 +1,5 @@ fixtures/tsconfig/tsconfig_broken.json fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json +fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/malformed-json/tsconfig.json pnpm-lock.yaml -**/.pnp.cjs \ No newline at end of file +**/.pnp.cjs diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-invalid-package-target/a.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-invalid-package-target/a.js new file mode 100644 index 00000000..bd816eab --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/exports-field-invalid-package-target/a.js @@ -0,0 +1 @@ +module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-invalid-package-target/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-invalid-package-target/package.json new file mode 100644 index 00000000..ae6fb952 --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/exports-field-invalid-package-target/package.json @@ -0,0 +1,59 @@ +{ + "name": "@exports-field/bad-specifier", + "version": "1.0.0", + "exports": { + ".": [ + "", + "./a/../b/../../pack1/index.js", + "././-bad-specifier-", + "-bad-specifier-", + "file.js", + "./a.js?foo=../" + ], + "./foo/*": [ + "", + "./a/../b/../../pack1/index.js", + "././-bad-specifier-", + "-bad-specifier-", + "file.js", + "./a.js?foo=../#../" + ], + "./bar": "-bad-specifier-", + "./baz": ["-bad-specifier-"], + "./baz-multi": ["-bad-specifier-", "foo"], + "./pattern/*.js": { + "default": ["-bad-specifier-", "./*.js"] + }, + "./slash": ["/bar", "./a.js"], + "./no-slash": [".bar", "./a.js"], + "./utils/": { + "browser": "/a/", + "default": "/b/" + }, + "./utils1/": "/a/", + "./utils2/": { + "default": "../this/" + }, + "./utils3/*": { + "default": "../this/*" + }, + "./utils4/*": "../src/*", + "./utils5/": "../src/", + "./*": ".", + "./valid/*.js": { + "default": ["-bad-specifier-", "./*.js"] + }, + "./non-existent.js": ["-bad-specifier-", "./non-existent.js", "./a.js"], + "./bad-specifier.js": ["-bad-specifier-", "../../a.js", "./a.js"], + "./bad-specifier1.js": ["-bad-specifier-", "foo", "./a.js"], + "./dep/multi": ["../../test", "./a.js"], + "./dep/multi1": ["../../test", "../../test/foo"], + "./dep/multi2": ["../../test"], + "./dep/multi3": ["./a/../b/../../pack1/index.js", "./a.js"], + "./dep/multi4": [ + "./a/../b/../../pack1/index.js", + "./c/../b/../../pack1/index.js" + ], + "./dep/multi5": ["./a/../b/../../pack1/index.js"] + } +} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field-chain/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field-chain/package.json new file mode 100644 index 00000000..e10f5124 --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/imports-field-chain/package.json @@ -0,0 +1,7 @@ +{ + "name": "imports-field-chain", + "imports": { + "#a": "#b", + "#b": "./the.js" + } +} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field-chain/the.js b/fixtures/enhanced_resolve/test/fixtures/imports-field-chain/the.js new file mode 100644 index 00000000..03d0f8ec --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/imports-field-chain/the.js @@ -0,0 +1 @@ +module.exports = "the"; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field-different/a.js b/fixtures/enhanced_resolve/test/fixtures/imports-field-different/a.js new file mode 100644 index 00000000..bd816eab --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/imports-field-different/a.js @@ -0,0 +1 @@ +module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field-different/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field-different/package.json new file mode 100644 index 00000000..946d59dd --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/imports-field-different/package.json @@ -0,0 +1,42 @@ +{ + "name": "@exports-field/bad-specifier", + "version": "1.0.0", + "imports": { + "/utils/": "./a/", + "/utils1/": { + "browser": "./a/", + "default": "./b/" + }, + "a": "a.js", + "#": "a.js", + "#/dep": "a.js", + "#dep/": "a.js", + "#dep": [ + "./a/../b/../../pack1/index.js", + "././-bad-specifier-", + "./a.js?foo=../" + ], + + "#dep/foo/*": [ + "./a/../b/../../pack1/index.js", + "././-bad-specifier-", + "./a.js?foo=../#../" + ], + "#dep/bar": "-bad-specifier-", + "#dep/baz": ["-bad-specifier-"], + "#dep/baz-multi": ["-bad-specifier-", "not-found"], + "#dep/pattern/*.js": { + "default": ["-bad-specifier-", "./*.js"] + }, + "#dep/array": ["./a.js", "-bad-specifier-"], + "#dep/array2": ["-bad-specifier-", "./a.js"], + "#dep/array3": ["./a.js"], + "#dep/empty": "", + "#dep/with-bad": ["../foo", "./a.js"], + "#dep/with-bad2": ["./a.js", "../foo"], + "#timezones/": "./data/timezones", + "#dep/multi": ["../../test", "./a.js"], + "#dep/multi1": ["../../test", "../../test/foo"], + "#dep/multi2": ["../../test"] + } +} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-slash-pattern/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-slash-pattern/package.json new file mode 100644 index 00000000..4bad5afb --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/imports-slash-pattern/package.json @@ -0,0 +1,6 @@ +{ + "name": "imports-slash-pattern", + "imports": { + "#/*": "./src/*" + } +} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-slash-pattern/src/nested/deep.js b/fixtures/enhanced_resolve/test/fixtures/imports-slash-pattern/src/nested/deep.js new file mode 100644 index 00000000..239815a6 --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/imports-slash-pattern/src/nested/deep.js @@ -0,0 +1 @@ +module.exports = "deep"; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-slash-pattern/src/utils.js b/fixtures/enhanced_resolve/test/fixtures/imports-slash-pattern/src/utils.js new file mode 100644 index 00000000..638e9189 --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/imports-slash-pattern/src/utils.js @@ -0,0 +1 @@ +module.exports = "utils"; diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/components/button.ts b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/components/button.ts new file mode 100644 index 00000000..7abf78d7 --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/components/button.ts @@ -0,0 +1,3 @@ +export function button() { + return "button"; +} diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/components/new-file.ts b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/components/new-file.ts new file mode 100644 index 00000000..4d03b80f --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/components/new-file.ts @@ -0,0 +1 @@ +export const newFile = "new-file"; diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/index.ts b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/index.ts new file mode 100644 index 00000000..98e62d76 --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/index.ts @@ -0,0 +1,23 @@ +import * as foo from "foo"; +import * as file1 from "foo/file1"; + +import * as bar from "bar/file1"; +import * as myStar from "star-bar"; +import * as longest from "longest/bar"; +import * as packagedBrowser from "browser-field-package"; +import * as packagedMain from "main-field-package"; +import * as packagedIndex from "no-main-field-package"; +import * as newFile from "utils/old-file"; + +console.log( + "HELLO WORLD!", + foo.message, + bar.message, + file1, + longest, + myStar.message, + packagedBrowser.message, + packagedMain.message, + packagedIndex.message, + newFile +); diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/mapped/bar/file1.ts b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/mapped/bar/file1.ts new file mode 100644 index 00000000..6b9cedfb --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/mapped/bar/file1.ts @@ -0,0 +1 @@ +export const message = "bar"; diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/mapped/foo/index.ts b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/mapped/foo/index.ts new file mode 100644 index 00000000..9135bce1 --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/mapped/foo/index.ts @@ -0,0 +1 @@ +export const message = "HELLO!"; diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/mapped/longest/one.ts b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/mapped/longest/one.ts new file mode 100644 index 00000000..cc798ff5 --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/mapped/longest/one.ts @@ -0,0 +1 @@ +export const a = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/mapped/longest/three.ts b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/mapped/longest/three.ts new file mode 100644 index 00000000..cc798ff5 --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/mapped/longest/three.ts @@ -0,0 +1 @@ +export const a = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/mapped/longest/two.ts b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/mapped/longest/two.ts new file mode 100644 index 00000000..cc798ff5 --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/mapped/longest/two.ts @@ -0,0 +1 @@ +export const a = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/mapped/star/browser-field-package/browser.ts b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/mapped/star/browser-field-package/browser.ts new file mode 100644 index 00000000..411a3cc9 --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/mapped/star/browser-field-package/browser.ts @@ -0,0 +1 @@ +export const message = "browser"; diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/mapped/star/browser-field-package/node.ts b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/mapped/star/browser-field-package/node.ts new file mode 100644 index 00000000..f5354589 --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/mapped/star/browser-field-package/node.ts @@ -0,0 +1 @@ +export const message = "node"; diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/mapped/star/browser-field-package/package.json b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/mapped/star/browser-field-package/package.json new file mode 100644 index 00000000..f0166577 --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/mapped/star/browser-field-package/package.json @@ -0,0 +1,5 @@ +{ + "name": "browser-field", + "main": "node.ts", + "browser": "browser.ts" +} diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/mapped/star/main-field-package/node.ts b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/mapped/star/main-field-package/node.ts new file mode 100644 index 00000000..f5354589 --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/mapped/star/main-field-package/node.ts @@ -0,0 +1 @@ +export const message = "node"; diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/mapped/star/main-field-package/package.json b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/mapped/star/main-field-package/package.json new file mode 100644 index 00000000..6dea5949 --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/mapped/star/main-field-package/package.json @@ -0,0 +1,4 @@ +{ + "name": "main-field", + "main": "node.ts" +} diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/mapped/star/no-main-field-package/index.ts b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/mapped/star/no-main-field-package/index.ts new file mode 100644 index 00000000..f7bc95cd --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/mapped/star/no-main-field-package/index.ts @@ -0,0 +1 @@ +export const message = "index"; diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/mapped/star/no-main-field-package/package.json b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/mapped/star/no-main-field-package/package.json new file mode 100644 index 00000000..7077904c --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/mapped/star/no-main-field-package/package.json @@ -0,0 +1,3 @@ +{ + "name": "no-main-field" +} diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/mapped/star/star-bar/index.ts b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/mapped/star/star-bar/index.ts new file mode 100644 index 00000000..1a9c8b42 --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/mapped/star/star-bar/index.ts @@ -0,0 +1 @@ +export const message = "Hello Star!"; diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/refs/index.ts b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/refs/index.ts new file mode 100644 index 00000000..4f2facd0 --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/refs/index.ts @@ -0,0 +1 @@ +export const message = "HELLO WORLD!"; diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/utils/date.ts b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/utils/date.ts new file mode 100644 index 00000000..84b3e778 --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/src/utils/date.ts @@ -0,0 +1,3 @@ +export function date() { + return "date"; +} diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/tsconfig.json b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/tsconfig.json new file mode 100644 index 00000000..ac20000f --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/base/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "outDir": "./js_out", + "baseUrl": ".", + "paths": { + "@components/*": [ + "${configDir}/src/utils/*", + "${configDir}/src/components/*" + ], + "@utils/*": ["./src/utils/*"], + "foo": ["${configDir}/src/mapped/foo"], + "foo/*": ["${configDir}/src/mapped/bar/*"], + "bar/*": ["./src/mapped/bar/*"], + "refs/*": ["${configDir}/src/refs/*"], + "*/old-file": ["${configDir}/src/components/new-file"], + "longest/*": [ + "${configDir}/src/mapped/longest/four.ts", + "${configDir}/src/mapped/longest/two.ts" + ], + "longest/bar": ["${configDir}/src/mapped/longest/three.ts"], + "*": ["${configDir}/src/mapped/star/*"] + }, + "composite": true + } +} diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-base/src/components/button.ts b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-base/src/components/button.ts new file mode 100644 index 00000000..7abf78d7 --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-base/src/components/button.ts @@ -0,0 +1,3 @@ +export function button() { + return "button"; +} diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-base/src/index.ts b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-base/src/index.ts new file mode 100644 index 00000000..ac16c669 --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-base/src/index.ts @@ -0,0 +1,4 @@ +import * as button from "@components/button"; +import * as date from "@utils/date"; + +console.log("HELLO WORLD!", button, date); diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-base/src/utils/date.ts b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-base/src/utils/date.ts new file mode 100644 index 00000000..84b3e778 --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-base/src/utils/date.ts @@ -0,0 +1,3 @@ +export function date() { + return "date"; +} diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-base/tsconfig.json b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-base/tsconfig.json new file mode 100644 index 00000000..52202a6c --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-base/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "${configDir}/../base/tsconfig", + "compilerOptions": { + "baseUrl": "." + } +} diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-circular/a/src/lib/foo.ts b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-circular/a/src/lib/foo.ts new file mode 100644 index 00000000..61d366eb --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-circular/a/src/lib/foo.ts @@ -0,0 +1 @@ +export const foo = "foo"; diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-circular/a/tsconfig.json b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-circular/a/tsconfig.json new file mode 100644 index 00000000..d93a9e97 --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-circular/a/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "${configDir}/../b/tsconfig", + "compilerOptions": { + "baseUrl": ".", + "paths": { + "@lib/*": ["${configDir}/src/lib/*"] + } + } +} diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-circular/b/src/util/bar.ts b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-circular/b/src/util/bar.ts new file mode 100644 index 00000000..c399d568 --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-circular/b/src/util/bar.ts @@ -0,0 +1 @@ +export const bar = "bar"; diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-circular/b/tsconfig.json b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-circular/b/tsconfig.json new file mode 100644 index 00000000..f64d9ce6 --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-circular/b/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "${configDir}/../a/tsconfig", + "compilerOptions": { + "baseUrl": ".", + "paths": { + "@util/*": ["${configDir}/src/util/*"] + } + } +} diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-deep-baseurl/packages/app/tsconfig.json b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-deep-baseurl/packages/app/tsconfig.json new file mode 100644 index 00000000..b115a36a --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-deep-baseurl/packages/app/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../lib/tsconfig" +} diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-deep-baseurl/packages/lib/tsconfig.json b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-deep-baseurl/packages/lib/tsconfig.json new file mode 100644 index 00000000..cafaef31 --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-deep-baseurl/packages/lib/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../../tsconfig-base/tsconfig" +} diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-deep-baseurl/tsconfig-base/src/utils/format.ts b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-deep-baseurl/tsconfig-base/src/utils/format.ts new file mode 100644 index 00000000..bc388d86 --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-deep-baseurl/tsconfig-base/src/utils/format.ts @@ -0,0 +1 @@ +export const format = (s: string) => s; diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-deep-baseurl/tsconfig-base/tsconfig.json b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-deep-baseurl/tsconfig-base/tsconfig.json new file mode 100644 index 00000000..0393b0ea --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-deep-baseurl/tsconfig-base/tsconfig.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "baseUrl": ".", + "paths": { + "@base/*": ["./src/*"] + } + } +} diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-npm/node_modules/react/package.json b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-npm/node_modules/react/package.json new file mode 100644 index 00000000..2c573a9d --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-npm/node_modules/react/package.json @@ -0,0 +1,8 @@ +{ + "name": "react", + "version": "18.3.1", + "main": "index.js", + "scripts": { + "build": "tsc" + } +} \ No newline at end of file diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-npm/node_modules/react/tsconfig.json b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-npm/node_modules/react/tsconfig.json new file mode 100644 index 00000000..7b4690a2 --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-npm/node_modules/react/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "outDir": "./js_out", + "baseUrl": ".", + "paths": { + "@components/*": ["./src/utils/*", "./src/components/*"], + "@utils/*": ["./src/utils/*"], + "foo": ["./src/mapped/foo"], + "bar/*": ["./src/mapped/bar/*"], + "refs/*": ["./src/refs/*"], + "*/old-file": ["./src/components/new-file"], + "longest/*": ["./src/mapped/longest/four.ts", "./src/mapped/longest/two.ts"], + "longest/bar": ["./src/mapped/longest/three.ts"], + "*": ["./src/mapped/star/*"] + }, + "composite": true + } +} diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-npm/src/components/button.ts b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-npm/src/components/button.ts new file mode 100644 index 00000000..7abf78d7 --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-npm/src/components/button.ts @@ -0,0 +1,3 @@ +export function button() { + return "button"; +} diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-npm/src/index.ts b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-npm/src/index.ts new file mode 100644 index 00000000..ac16c669 --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-npm/src/index.ts @@ -0,0 +1,4 @@ +import * as button from "@components/button"; +import * as date from "@utils/date"; + +console.log("HELLO WORLD!", button, date); diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-npm/src/utils/date.ts b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-npm/src/utils/date.ts new file mode 100644 index 00000000..84b3e778 --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-npm/src/utils/date.ts @@ -0,0 +1,3 @@ +export function date() { + return "date"; +} diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-npm/tsconfig.json b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-npm/tsconfig.json new file mode 100644 index 00000000..5cb961c2 --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-npm/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": ["react/tsconfig"], + "compilerOptions": { + "baseUrl": "." + } +} diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-pkg-entry/node_modules/@my-tsconfig/base/package.json b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-pkg-entry/node_modules/@my-tsconfig/base/package.json new file mode 100644 index 00000000..5274c7be --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-pkg-entry/node_modules/@my-tsconfig/base/package.json @@ -0,0 +1,5 @@ +{ + "name": "@my-tsconfig/base", + "version": "1.0.0", + "main": "tsconfig.json" +} diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-pkg-entry/node_modules/@my-tsconfig/base/src/util.ts b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-pkg-entry/node_modules/@my-tsconfig/base/src/util.ts new file mode 100644 index 00000000..9037c3a9 --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-pkg-entry/node_modules/@my-tsconfig/base/src/util.ts @@ -0,0 +1 @@ +export const util = true; diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-pkg-entry/node_modules/@my-tsconfig/base/tsconfig.json b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-pkg-entry/node_modules/@my-tsconfig/base/tsconfig.json new file mode 100644 index 00000000..641a187a --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-pkg-entry/node_modules/@my-tsconfig/base/tsconfig.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "baseUrl": ".", + "paths": { + "@pkg/*": ["./src/*"] + } + } +} diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-pkg-entry/tsconfig.json b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-pkg-entry/tsconfig.json new file mode 100644 index 00000000..5ea4d7dc --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/extends-pkg-entry/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "@my-tsconfig/base" +} diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/jsonc-comments/src/components/button.ts b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/jsonc-comments/src/components/button.ts new file mode 100644 index 00000000..47893f15 --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/jsonc-comments/src/components/button.ts @@ -0,0 +1 @@ +export const Button = "button"; diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/jsonc-comments/src/mapped/bar/index.ts b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/jsonc-comments/src/mapped/bar/index.ts new file mode 100644 index 00000000..c399d568 --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/jsonc-comments/src/mapped/bar/index.ts @@ -0,0 +1 @@ +export const bar = "bar"; diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/jsonc-comments/src/mapped/foo/index.ts b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/jsonc-comments/src/mapped/foo/index.ts new file mode 100644 index 00000000..61d366eb --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/jsonc-comments/src/mapped/foo/index.ts @@ -0,0 +1 @@ +export const foo = "foo"; diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/jsonc-comments/tsconfig.json b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/jsonc-comments/tsconfig.json new file mode 100644 index 00000000..9a09fd71 --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/jsonc-comments/tsconfig.json @@ -0,0 +1,14 @@ +{ + // This is a line comment + "compilerOptions": { + /* This is a block comment */ + "baseUrl": ".", + "paths": { + // Another line comment + "@components/*": ["${configDir}/src/components/*"], + "foo": ["${configDir}/src/mapped/foo"], + /* Block comment in paths */ + "bar/*": ["${configDir}/src/mapped/bar/*"] + } + } +} diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/malformed-json/tsconfig.json b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/malformed-json/tsconfig.json new file mode 100644 index 00000000..fb2f3a4e --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/malformed-json/tsconfig.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "baseUrl": "./src", + "paths": { + "@components/*": ["components/*"], + // This is a comment which makes JSON invalid + "@utils/*": ["utils/*" + } + } +} diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/references-project/packages/app/src/components/Button.ts b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/references-project/packages/app/src/components/Button.ts new file mode 100644 index 00000000..979d5801 --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/references-project/packages/app/src/components/Button.ts @@ -0,0 +1,2 @@ +// Button component +export const Button = "Button"; diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/references-project/packages/app/src/index.ts b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/references-project/packages/app/src/index.ts new file mode 100644 index 00000000..dce5834a --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/references-project/packages/app/src/index.ts @@ -0,0 +1,3 @@ +export function appMain() { + return "app main"; +} diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/references-project/packages/app/tsconfig.json b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/references-project/packages/app/tsconfig.json new file mode 100644 index 00000000..cd5470a8 --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/references-project/packages/app/tsconfig.json @@ -0,0 +1,11 @@ +{ + "compilerOptions": { + "baseUrl": ".", + "paths": { + "@app/*": ["${configDir}/src/*"] + }, + "composite": true, + "outDir": "./dist" + }, + "references": [{ "path": "${configDir}/../shared" }] +} diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/references-project/packages/shared/index.ts b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/references-project/packages/shared/index.ts new file mode 100644 index 00000000..73c1d0e1 --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/references-project/packages/shared/index.ts @@ -0,0 +1,2 @@ +import { helper } from "utils/helper"; +export { helper }; diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/references-project/packages/shared/src/components/Input.ts b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/references-project/packages/shared/src/components/Input.ts new file mode 100644 index 00000000..a1e2994f --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/references-project/packages/shared/src/components/Input.ts @@ -0,0 +1,2 @@ +// Input component +export const Input = "Input"; diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/references-project/packages/shared/src/index.ts b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/references-project/packages/shared/src/index.ts new file mode 100644 index 00000000..d273b603 --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/references-project/packages/shared/src/index.ts @@ -0,0 +1,2 @@ +import { helper } from "@shared/helper"; +export { helper }; diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/references-project/packages/shared/src/utils/helper.ts b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/references-project/packages/shared/src/utils/helper.ts new file mode 100644 index 00000000..678acc48 --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/references-project/packages/shared/src/utils/helper.ts @@ -0,0 +1,3 @@ +export function helper() { + return "helper from shared package"; +} diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/references-project/packages/shared/tsconfig.json b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/references-project/packages/shared/tsconfig.json new file mode 100644 index 00000000..4218a7af --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/references-project/packages/shared/tsconfig.json @@ -0,0 +1,11 @@ +{ + "compilerOptions": { + "baseUrl": "./src", + "paths": { + "@shared/*": ["${configDir}/src/utils/*"] + }, + "composite": true, + "outDir": "./dist" + }, + "references": [{ "path": "${configDir}/../utils" }] +} diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/references-project/packages/utils/src/core/date.ts b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/references-project/packages/utils/src/core/date.ts new file mode 100644 index 00000000..358c7f5e --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/references-project/packages/utils/src/core/date.ts @@ -0,0 +1,3 @@ +export function formatDate(date: Date): string { + return date.toISOString(); +} diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/references-project/packages/utils/tsconfig.json b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/references-project/packages/utils/tsconfig.json new file mode 100644 index 00000000..3c88183c --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/references-project/packages/utils/tsconfig.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "baseUrl": "./src", + "paths": { + "@utils/*": ["${configDir}/src/core/*"] + }, + "composite": true, + "outDir": "./dist" + } +} diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/references-project/src/main.ts b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/references-project/src/main.ts new file mode 100644 index 00000000..228b449f --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/references-project/src/main.ts @@ -0,0 +1,3 @@ +export function rootMain() { + return "root main"; +} diff --git a/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/references-project/tsconfig.json b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/references-project/tsconfig.json new file mode 100644 index 00000000..b85d9c59 --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/references-project/tsconfig.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "baseUrl": ".", + "paths": { + "@root/*": ["${configDir}/src/*"] + } + }, + "references": [ + { "path": "${configDir}/packages/shared" }, + { "path": "./packages/app" } + ] +} diff --git a/fixtures/enhanced_resolve/test/fixtures/unsafe-cache-normalization/package.json b/fixtures/enhanced_resolve/test/fixtures/unsafe-cache-normalization/package.json new file mode 100644 index 00000000..64afe068 --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/unsafe-cache-normalization/package.json @@ -0,0 +1,3 @@ +{ + "name": "unsafe-cache-normalization" +} diff --git a/fixtures/enhanced_resolve/test/fixtures/unsafe-cache-normalization/packages/nested/package.json b/fixtures/enhanced_resolve/test/fixtures/unsafe-cache-normalization/packages/nested/package.json new file mode 100644 index 00000000..161bd016 --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/unsafe-cache-normalization/packages/nested/package.json @@ -0,0 +1,3 @@ +{ + "name": "unsafe-cache-normalization-nested" +} diff --git a/fixtures/enhanced_resolve/test/fixtures/unsafe-cache-normalization/packages/nested/src/index.js b/fixtures/enhanced_resolve/test/fixtures/unsafe-cache-normalization/packages/nested/src/index.js new file mode 100644 index 00000000..6b426317 --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/unsafe-cache-normalization/packages/nested/src/index.js @@ -0,0 +1 @@ +module.exports = "nested-src"; diff --git a/fixtures/enhanced_resolve/test/fixtures/unsafe-cache-normalization/src/a/b/index.js b/fixtures/enhanced_resolve/test/fixtures/unsafe-cache-normalization/src/a/b/index.js new file mode 100644 index 00000000..0b82eec6 --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/unsafe-cache-normalization/src/a/b/index.js @@ -0,0 +1 @@ +module.exports = "root-alpha"; diff --git a/fixtures/enhanced_resolve/test/fixtures/unsafe-cache-normalization/src/b/index.js b/fixtures/enhanced_resolve/test/fixtures/unsafe-cache-normalization/src/b/index.js new file mode 100644 index 00000000..7d78ddcf --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/unsafe-cache-normalization/src/b/index.js @@ -0,0 +1 @@ +module.exports = "root-beta"; diff --git a/fixtures/enhanced_resolve/test/fixtures/unsafe-cache-normalization/src/components/index.js b/fixtures/enhanced_resolve/test/fixtures/unsafe-cache-normalization/src/components/index.js new file mode 100644 index 00000000..e69de29b diff --git a/fixtures/enhanced_resolve/test/fixtures/unsafe-cache-normalization/src/shared/index.js b/fixtures/enhanced_resolve/test/fixtures/unsafe-cache-normalization/src/shared/index.js new file mode 100644 index 00000000..bd94d1c4 --- /dev/null +++ b/fixtures/enhanced_resolve/test/fixtures/unsafe-cache-normalization/src/shared/index.js @@ -0,0 +1 @@ +module.exports = "root-shared-file"; diff --git a/napi/__test__/resolver.spec.mjs b/napi/__test__/resolver.spec.mjs deleted file mode 100644 index c87bcae0..00000000 --- a/napi/__test__/resolver.spec.mjs +++ /dev/null @@ -1,293 +0,0 @@ -import { dirname, join, normalize } from "node:path"; -import { fileURLToPath } from "node:url"; - -import test from "ava"; - -let ResolverFactory; - -if (process.env.WASI_TEST) { - const wasi = await import("../resolver.wasi.cjs"); - ResolverFactory = wasi.ResolverFactory; -} else { - const napi = await import("../index.js"); - ResolverFactory = napi.ResolverFactory; -} - -const currentDir = join(fileURLToPath(import.meta.url), ".."); - -const enhancedResolveRoot = join( - currentDir, - "..", - "..", - "fixtures", - "enhanced_resolve", - "test", - "fixtures" -); - -// https://github.com/webpack/enhanced-resolve/blob/main/test/resolve.test.js - -for (const [title, context, request, expected] of [ - [ - "absolute path", - enhancedResolveRoot, - join(enhancedResolveRoot, "main1.js"), - join(enhancedResolveRoot, "main1.js") - ], - [ - "file with .js", - enhancedResolveRoot, - "./main1.js", - join(enhancedResolveRoot, "main1.js") - ], - [ - "file without extension", - enhancedResolveRoot, - "./main1", - join(enhancedResolveRoot, "main1.js") - ], - [ - "another file with .js", - enhancedResolveRoot, - "./a.js", - join(enhancedResolveRoot, "a.js") - ], - [ - "another file without extension", - enhancedResolveRoot, - "./a", - join(enhancedResolveRoot, "a.js") - ], - [ - "file in module with .js", - enhancedResolveRoot, - "m1/a.js", - join(enhancedResolveRoot, "node_modules/m1/a.js") - ], - [ - "file in module without extension", - enhancedResolveRoot, - "m1/a", - join(enhancedResolveRoot, "node_modules/m1/a.js") - ], - [ - "another file in module without extension", - enhancedResolveRoot, - "complexm/step1", - join(enhancedResolveRoot, "node_modules/complexm/step1.js") - ], - [ - "from submodule to file in sibling module", - join(enhancedResolveRoot, "node_modules/complexm"), - "m2/b.js", - join(enhancedResolveRoot, "node_modules/m2/b.js") - ], - [ - "from nested directory to overwritten file in module", - join(enhancedResolveRoot, "multiple_modules"), - "m1/a.js", - join(enhancedResolveRoot, "multiple_modules/node_modules/m1/a.js") - ], - [ - "from nested directory to not overwritten file in module", - join(enhancedResolveRoot, "multiple_modules"), - "m1/b.js", - join(enhancedResolveRoot, "node_modules/m1/b.js") - ], - [ - "file with query", - enhancedResolveRoot, - "./main1.js?query", - join(enhancedResolveRoot, "main1.js?query") - ], - [ - "file with fragment", - enhancedResolveRoot, - "./main1.js#fragment", - join(enhancedResolveRoot, "main1.js#fragment") - ], - [ - "file with fragment and query", - enhancedResolveRoot, - "./main1.js#fragment?query", - join(enhancedResolveRoot, "main1.js#fragment?query") - ], - [ - "file with query and fragment", - enhancedResolveRoot, - "./main1.js?#fragment", - join(enhancedResolveRoot, "main1.js?#fragment") - ], - - [ - "file with query (unicode)", - enhancedResolveRoot, - "./测试.js?query", - join(enhancedResolveRoot, "测试.js?query") - ], - [ - "file with fragment (unicode)", - enhancedResolveRoot, - "./测试.js#fragment", - join(enhancedResolveRoot, "测试.js#fragment") - ], - [ - "file with fragment and query (unicode)", - enhancedResolveRoot, - "./测试.js#fragment?query", - join(enhancedResolveRoot, "测试.js#fragment?query") - ], - [ - "file with query and fragment (unicode)", - enhancedResolveRoot, - "./测试.js?#fragment", - join(enhancedResolveRoot, "测试.js?#fragment") - ], - - [ - "file in module with query", - enhancedResolveRoot, - "m1/a?query", - join(enhancedResolveRoot, "node_modules/m1/a.js?query") - ], - [ - "file in module with fragment", - enhancedResolveRoot, - "m1/a#fragment", - join(enhancedResolveRoot, "node_modules/m1/a.js#fragment") - ], - [ - "file in module with fragment and query", - enhancedResolveRoot, - "m1/a#fragment?query", - join(enhancedResolveRoot, "node_modules/m1/a.js#fragment?query") - ], - [ - "file in module with query and fragment", - enhancedResolveRoot, - "m1/a?#fragment", - join(enhancedResolveRoot, "node_modules/m1/a.js?#fragment") - ], - [ - "differ between directory and file, resolve file", - enhancedResolveRoot, - "./dirOrFile", - join(enhancedResolveRoot, "dirOrFile.js") - ], - [ - "differ between directory and file, resolve directory", - enhancedResolveRoot, - "./dirOrFile/", - join(enhancedResolveRoot, "dirOrFile/index.js") - ], - [ - "find node_modules outside of node_modules", - join(enhancedResolveRoot, "browser-module/node_modules"), - "m1/a", - join(enhancedResolveRoot, "node_modules/m1/a.js") - ], - [ - "don't crash on main field pointing to self", - enhancedResolveRoot, - "./main-field-self", - join(enhancedResolveRoot, "./main-field-self/index.js") - ], - [ - "don't crash on main field pointing to self (2)", - enhancedResolveRoot, - "./main-field-self2", - join(enhancedResolveRoot, "./main-field-self2/index.js") - ], - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - [ - "handle fragment edge case (no fragment)", - enhancedResolveRoot, - "./no#fragment/#/#", - join(enhancedResolveRoot, "no#fragment", "#", "#.js") - ], - [ - "handle fragment edge case (fragment)", - enhancedResolveRoot, - "./no#fragment/#/", - join(enhancedResolveRoot, "no.js#fragment") + "/#/" - ], - [ - "handle fragment escaping", - enhancedResolveRoot, - "./no\0#fragment/\0#/\0##fragment", - join(enhancedResolveRoot, "no#fragment", "#", "#.js#fragment") - ] -]) { - test(title, t => { - const resolver = new ResolverFactory({ - modules: ["src/a", "src/b", "src/common", "node_modules"], - extensions: [".js", ".jsx", ".ts", ".tsx"] - }); - - t.is(resolver.sync(context, request).path, expected); - }); -} - -test("resolve pnpm package", t => { - const rootDir = join(currentDir, "..", ".."); - const pnpmProjectPath = join(rootDir, "fixtures", "pnpm"); - const resolver = new ResolverFactory({ - aliasFields: ["browser"] - }); - - let resolvedPath = resolver.sync(pnpmProjectPath, "styled-components").path; - - t.true( - resolvedPath.endsWith( - normalize( - "/node_modules/styled-components/dist/styled-components.browser.cjs.js" - ) - ) - ); - - let fromResolvedDir = dirname(resolvedPath); - - t.deepEqual(resolver.sync(fromResolvedDir, "react"), { - path: join( - rootDir, - "node_modules/.pnpm/react@18.3.1/node_modules/react/index.js" - ) - }); -}); - -test("resolve recursive symbol link", t => { - const rootDir = join(currentDir, "..", ".."); - const workspaceProjectPath = join(rootDir, "fixtures", "pnpm-workspace"); - const resolver = new ResolverFactory({}); - - t.deepEqual( - resolver.sync( - join(workspaceProjectPath, "./packages/app"), - "./node_modules/@monorepo/lib/node_modules/react/package.json" - ), - { - path: join( - rootDir, - "node_modules/.pnpm/react@18.3.1/node_modules/react/package.json" - ) - } - ); -}); - -// WASM doesn't support pnp -if (!process.env.WASI_TEST) { - test("resolve in pnp project", t => { - const rootDir = join(currentDir, "..", ".."); - const pnpProjectRoot = join(rootDir, "fixtures", "pnp"); - const resolver = new ResolverFactory({ enablePnp: true }); - - t.deepEqual(resolver.sync(pnpProjectRoot, "is-even"), { - path: join( - pnpProjectRoot, - ".yarn/cache/is-even-npm-1.0.0-9f726520dc-2728cc2f39.zip/node_modules/is-even/index.js" - ) - }); - }); -} diff --git a/napi/__test__/resolver.test.mjs b/napi/__test__/resolver.test.mjs new file mode 100644 index 00000000..9af880c1 --- /dev/null +++ b/napi/__test__/resolver.test.mjs @@ -0,0 +1,283 @@ +import { dirname, join, normalize } from "node:path"; +import { describe, it, expect } from "@rstest/core"; + +let ResolverFactory; + +if (process.env.WASI_TEST) { + const wasi = await import("../resolver.wasi.cjs"); + ResolverFactory = wasi.ResolverFactory; +} else { + const napi = await import("../index.js"); + ResolverFactory = napi.ResolverFactory; +} + +const rootDir = process.cwd(); + +const enhancedResolveRoot = join( + rootDir, + "fixtures", + "enhanced_resolve", + "test", + "fixtures" +); + +// https://github.com/webpack/enhanced-resolve/blob/main/test/resolve.test.js + +describe("resolver", () => { + const cases = [ + [ + "absolute path", + enhancedResolveRoot, + join(enhancedResolveRoot, "main1.js"), + join(enhancedResolveRoot, "main1.js") + ], + [ + "file with .js", + enhancedResolveRoot, + "./main1.js", + join(enhancedResolveRoot, "main1.js") + ], + [ + "file without extension", + enhancedResolveRoot, + "./main1", + join(enhancedResolveRoot, "main1.js") + ], + [ + "another file with .js", + enhancedResolveRoot, + "./a.js", + join(enhancedResolveRoot, "a.js") + ], + [ + "another file without extension", + enhancedResolveRoot, + "./a", + join(enhancedResolveRoot, "a.js") + ], + [ + "file in module with .js", + enhancedResolveRoot, + "m1/a.js", + join(enhancedResolveRoot, "node_modules/m1/a.js") + ], + [ + "file in module without extension", + enhancedResolveRoot, + "m1/a", + join(enhancedResolveRoot, "node_modules/m1/a.js") + ], + [ + "another file in module without extension", + enhancedResolveRoot, + "complexm/step1", + join(enhancedResolveRoot, "node_modules/complexm/step1.js") + ], + [ + "from submodule to file in sibling module", + join(enhancedResolveRoot, "node_modules/complexm"), + "m2/b.js", + join(enhancedResolveRoot, "node_modules/m2/b.js") + ], + [ + "from nested directory to overwritten file in module", + join(enhancedResolveRoot, "multiple_modules"), + "m1/a.js", + join(enhancedResolveRoot, "multiple_modules/node_modules/m1/a.js") + ], + [ + "from nested directory to not overwritten file in module", + join(enhancedResolveRoot, "multiple_modules"), + "m1/b.js", + join(enhancedResolveRoot, "node_modules/m1/b.js") + ], + [ + "file with query", + enhancedResolveRoot, + "./main1.js?query", + join(enhancedResolveRoot, "main1.js?query") + ], + [ + "file with fragment", + enhancedResolveRoot, + "./main1.js#fragment", + join(enhancedResolveRoot, "main1.js#fragment") + ], + [ + "file with fragment and query", + enhancedResolveRoot, + "./main1.js#fragment?query", + join(enhancedResolveRoot, "main1.js#fragment?query") + ], + [ + "file with query and fragment", + enhancedResolveRoot, + "./main1.js?#fragment", + join(enhancedResolveRoot, "main1.js?#fragment") + ], + [ + "file with query (unicode)", + enhancedResolveRoot, + "./测试.js?query", + join(enhancedResolveRoot, "测试.js?query") + ], + [ + "file with fragment (unicode)", + enhancedResolveRoot, + "./测试.js#fragment", + join(enhancedResolveRoot, "测试.js#fragment") + ], + [ + "file with fragment and query (unicode)", + enhancedResolveRoot, + "./测试.js#fragment?query", + join(enhancedResolveRoot, "测试.js#fragment?query") + ], + [ + "file with query and fragment (unicode)", + enhancedResolveRoot, + "./测试.js?#fragment", + join(enhancedResolveRoot, "测试.js?#fragment") + ], + [ + "file in module with query", + enhancedResolveRoot, + "m1/a?query", + join(enhancedResolveRoot, "node_modules/m1/a.js?query") + ], + [ + "file in module with fragment", + enhancedResolveRoot, + "m1/a#fragment", + join(enhancedResolveRoot, "node_modules/m1/a.js#fragment") + ], + [ + "file in module with fragment and query", + enhancedResolveRoot, + "m1/a#fragment?query", + join(enhancedResolveRoot, "node_modules/m1/a.js#fragment?query") + ], + [ + "file in module with query and fragment", + enhancedResolveRoot, + "m1/a?#fragment", + join(enhancedResolveRoot, "node_modules/m1/a.js?#fragment") + ], + [ + "differ between directory and file, resolve file", + enhancedResolveRoot, + "./dirOrFile", + join(enhancedResolveRoot, "dirOrFile.js") + ], + [ + "differ between directory and file, resolve directory", + enhancedResolveRoot, + "./dirOrFile/", + join(enhancedResolveRoot, "dirOrFile/index.js") + ], + [ + "find node_modules outside of node_modules", + join(enhancedResolveRoot, "browser-module/node_modules"), + "m1/a", + join(enhancedResolveRoot, "node_modules/m1/a.js") + ], + [ + "don't crash on main field pointing to self", + enhancedResolveRoot, + "./main-field-self", + join(enhancedResolveRoot, "./main-field-self/index.js") + ], + [ + "don't crash on main field pointing to self (2)", + enhancedResolveRoot, + "./main-field-self2", + join(enhancedResolveRoot, "./main-field-self2/index.js") + ], + // enhanced-resolve has `#` prepended with a `\0`, they are removed from the + // following 3 expected test results. + // See https://github.com/webpack/enhanced-resolve#escaping + [ + "handle fragment edge case (no fragment)", + enhancedResolveRoot, + "./no#fragment/#/#", + join(enhancedResolveRoot, "no#fragment", "#", "#.js") + ], + [ + "handle fragment edge case (fragment)", + enhancedResolveRoot, + "./no#fragment/#/", + join(enhancedResolveRoot, "no.js#fragment") + "/#/" + ], + [ + "handle fragment escaping", + enhancedResolveRoot, + "./no\0#fragment/\0#/\0##fragment", + join(enhancedResolveRoot, "no#fragment", "#", "#.js#fragment") + ] + ]; + + it.for(cases)("%s", ([, context, request, expected]) => { + const resolver = new ResolverFactory({ + modules: ["src/a", "src/b", "src/common", "node_modules"], + extensions: [".js", ".jsx", ".ts", ".tsx"] + }); + + expect(resolver.sync(context, request).path).toBe(expected); + }); + + it("resolve pnpm package", () => { + const pnpmProjectPath = join(rootDir, "fixtures", "pnpm"); + const resolver = new ResolverFactory({ + aliasFields: ["browser"] + }); + + let resolvedPath = resolver.sync(pnpmProjectPath, "styled-components").path; + + expect( + resolvedPath.endsWith( + normalize( + "/node_modules/styled-components/dist/styled-components.browser.cjs.js" + ) + ) + ).toBe(true); + + let fromResolvedDir = dirname(resolvedPath); + + expect(resolver.sync(fromResolvedDir, "react")).toEqual({ + path: join( + rootDir, + "node_modules/.pnpm/react@18.3.1/node_modules/react/index.js" + ) + }); + }); + + it("resolve recursive symbol link", () => { + const workspaceProjectPath = join(rootDir, "fixtures", "pnpm-workspace"); + const resolver = new ResolverFactory({}); + + expect( + resolver.sync( + join(workspaceProjectPath, "./packages/app"), + "./node_modules/@monorepo/lib/node_modules/react/package.json" + ) + ).toEqual({ + path: join( + rootDir, + "node_modules/.pnpm/react@18.3.1/node_modules/react/package.json" + ) + }); + }); + + // WASM doesn't support pnp + it.skipIf(!!process.env.WASI_TEST)("resolve in pnp project", () => { + const pnpProjectRoot = join(rootDir, "fixtures", "pnp"); + const resolver = new ResolverFactory({ enablePnp: true }); + + expect(resolver.sync(pnpProjectRoot, "is-even")).toEqual({ + path: join( + pnpProjectRoot, + ".yarn/cache/is-even-npm-1.0.0-9f726520dc-2728cc2f39.zip/node_modules/is-even/index.js" + ) + }); + }); +}); diff --git a/napi/tests/browserField.test.mjs b/napi/tests/browserField.test.mjs new file mode 100644 index 00000000..09d6aa43 --- /dev/null +++ b/napi/tests/browserField.test.mjs @@ -0,0 +1,76 @@ +import { describe, it, expect } from "@rstest/core"; +import { ResolverFactory } from "../index.js"; +import * as path from "node:path"; + +const fixtureDir = path.resolve("fixtures/enhanced_resolve/test/fixtures"); +const browserModule = path.join(fixtureDir, "browser-module"); + +function p(...args) { + return path.join(browserModule, ...args); +} + +describe("browserField", () => { + const resolver = new ResolverFactory({ + aliasFields: [ + "browser", + ["innerBrowser1", "field2", "browser"], + ["innerBrowser1", "field", "browser"], + ["innerBrowser2", "browser"] + ] + }); + + it("should ignore", () => { + const result = resolver.sync(p(), "./lib/ignore"); + expect(result.path).toBeUndefined(); + }); + + it("should ignore #2", () => { + expect(resolver.sync(p(), "./lib/ignore.js").path).toBeUndefined(); + expect(resolver.sync(p("lib"), "./ignore").path).toBeUndefined(); + expect(resolver.sync(p("lib"), "./ignore.js").path).toBeUndefined(); + }); + + it("should replace a file", () => { + expect(resolver.sync(p(), "./lib/replaced").path).toBe( + p("lib", "browser.js") + ); + expect(resolver.sync(p(), "./lib/replaced.js").path).toBe( + p("lib", "browser.js") + ); + expect(resolver.sync(p("lib"), "./replaced").path).toBe( + p("lib", "browser.js") + ); + expect(resolver.sync(p("lib"), "./replaced.js").path).toBe( + p("lib", "browser.js") + ); + }); + + it("should replace a module with a file", () => { + expect(resolver.sync(p(), "module-a").path).toBe( + p("browser", "module-a.js") + ); + expect(resolver.sync(p("lib"), "module-a").path).toBe( + p("browser", "module-a.js") + ); + }); + + it("should replace a module with a module", () => { + expect(resolver.sync(p(), "module-b").path).toBe( + p("node_modules", "module-c.js") + ); + expect(resolver.sync(p("lib"), "module-b").path).toBe( + p("node_modules", "module-c.js") + ); + }); + + it("should resolve in nested property", () => { + expect(resolver.sync(p(), "./lib/main1.js").path).toBe(p("lib", "main.js")); + expect(resolver.sync(p(), "./lib/main2.js").path).toBe( + p("lib", "browser.js") + ); + }); + + it("should check only alias field properties", () => { + expect(resolver.sync(p(), "./toString").path).toBe(p("lib", "toString.js")); + }); +}); diff --git a/napi/tests/exportsField.test.mjs b/napi/tests/exportsField.test.mjs new file mode 100644 index 00000000..38b2f3e8 --- /dev/null +++ b/napi/tests/exportsField.test.mjs @@ -0,0 +1,594 @@ +import { describe, it, expect } from "@rstest/core"; +import { ResolverFactory } from "../index.js"; +import * as path from "node:path"; + +const fixtureDir = path.resolve("fixtures/enhanced_resolve/test/fixtures"); + +const fixture = path.resolve(fixtureDir, "exports-field"); +const fixture2 = path.resolve(fixtureDir, "exports-field2"); +const fixture3 = path.resolve(fixtureDir, "exports-field3"); +const fixture4 = path.resolve(fixtureDir, "exports-field-error"); +const fixture5 = path.resolve( + fixtureDir, + "exports-field-invalid-package-target" +); +const fixture6 = path.resolve(fixtureDir, "exports-field-nested-version"); + +describe("exportsFieldPlugin", () => { + const resolver = new ResolverFactory({ + extensions: [".js"], + fullySpecified: true, + conditionNames: ["webpack"] + }); + + const commonjsResolver = new ResolverFactory({ + extensions: [".js"], + conditionNames: ["webpack"] + }); + + it("resolve root using exports field, not a main field", () => { + const result = resolver.sync(fixture, "exports-field"); + expect(result.path).toBe( + path.resolve(fixture, "node_modules/exports-field/x.js") + ); + }); + + // rspack fixture uses webpack condition with ["./lib/lib2/", "./lib/"] (lib2 first) + it("resolve using exports field, not a browser field #1", () => { + const r = new ResolverFactory({ + aliasFields: ["browser"], + conditionNames: ["webpack"], + extensions: [".js"] + }); + const result = r.sync(fixture, "exports-field/dist/main.js"); + expect(result.path).toBe( + path.resolve(fixture, "node_modules/exports-field/lib/lib2/main.js") + ); + }); + + it("resolve using exports field and a browser alias field #2", () => { + const r = new ResolverFactory({ + aliasFields: ["browser"], + conditionNames: ["node"], + extensions: [".js"] + }); + const result = r.sync(fixture2, "exports-field/dist/main.js"); + expect(result.path).toBe( + path.resolve(fixture2, "node_modules/exports-field/lib/browser.js") + ); + }); + + it("throw error if extension not provided", () => { + const result = resolver.sync(fixture2, "exports-field/dist/main"); + expect(result.error).toBeTruthy(); + }); + + it("should resolve extension without fullySpecified", () => { + const result = commonjsResolver.sync(fixture2, "exports-field/dist/main"); + expect(result.path).toBe( + path.resolve(fixture2, "node_modules/exports-field/lib/lib2/main.js") + ); + }); + + it("resolver should respect condition names", () => { + const result = resolver.sync(fixture, "exports-field/dist/main.js"); + expect(result.path).toBe( + path.resolve(fixture, "node_modules/exports-field/lib/lib2/main.js") + ); + }); + + // skip: array fallback in exports field directory mappings + it.skip("resolver should respect fallback", () => { + const result = resolver.sync(fixture2, "exports-field/dist/browser.js"); + expect(result.path).toBe( + path.resolve(fixture2, "node_modules/exports-field/lib/browser.js") + ); + }); + + // skip: array fallback in exports field directory mappings + it.skip("resolver should respect query parameters #1", () => { + const result = resolver.sync(fixture2, "exports-field/dist/browser.js?foo"); + expect(result.path).toBe( + path.resolve(fixture2, "node_modules/exports-field/lib/browser.js?foo") + ); + }); + + it("resolver should respect query parameters #2. Direct matching", () => { + const result = resolver.sync(fixture2, "exports-field?foo"); + expect(result.error).toBeTruthy(); + }); + + // skip: array fallback in exports field directory mappings + it.skip("resolver should respect fragment parameters #1", () => { + const result = resolver.sync(fixture2, "exports-field/dist/browser.js#foo"); + expect(result.path).toBe( + path.resolve(fixture2, "node_modules/exports-field/lib/browser.js#foo") + ); + }); + + it("resolver should respect fragment parameters #2. Direct matching", () => { + const result = resolver.sync(fixture2, "exports-field#foo"); + expect(result.error).toBeTruthy(); + }); + + it("relative path should work, if relative path as request is used", () => { + const result = resolver.sync( + fixture, + "./node_modules/exports-field/lib/main.js" + ); + expect(result.path).toBe( + path.resolve(fixture, "node_modules/exports-field/lib/main.js") + ); + }); + + it("relative path should not work with exports field", () => { + const result = resolver.sync( + fixture, + "./node_modules/exports-field/dist/main.js" + ); + expect(result.error).toBeTruthy(); + }); + + it("backtracking should not work for request", () => { + const result = resolver.sync(fixture, "exports-field/dist/../../../a.js"); + expect(result.error).toBeTruthy(); + }); + + it("backtracking should not work for exports field target", () => { + const result = resolver.sync(fixture, "exports-field/dist/a.js"); + expect(result.error).toBeTruthy(); + }); + + it("self-resolving root", () => { + const result = resolver.sync(fixture, "@exports-field/core"); + expect(result.path).toBe(path.resolve(fixture, "./a.js")); + }); + + it("not exported error", () => { + const result = resolver.sync(fixture, "exports-field/anything/else"); + expect(result.error).toBeTruthy(); + }); + + it("field name path #1", () => { + const r = new ResolverFactory({ + aliasFields: ["browser"], + exportsFields: [["exportsField", "exports"]], + extensions: [".js"] + }); + const result = r.sync(fixture3, "exports-field"); + expect(result.path).toBe( + path.resolve(fixture3, "node_modules/exports-field/main.js") + ); + }); + + it("field name path #2", () => { + const r = new ResolverFactory({ + aliasFields: ["browser"], + exportsFields: [["exportsField", "exports"], "exports"], + extensions: [".js"] + }); + const result = r.sync(fixture3, "exports-field"); + expect(result.path).toBe( + path.resolve(fixture3, "node_modules/exports-field/main.js") + ); + }); + + it("field name path #3", () => { + const r = new ResolverFactory({ + aliasFields: ["browser"], + exportsFields: ["exports", ["exportsField", "exports"]], + extensions: [".js"] + }); + const result = r.sync(fixture3, "exports-field"); + expect(result.path).toBe( + path.resolve(fixture3, "node_modules/exports-field/main.js") + ); + }); + + it("field name path #4", () => { + const r = new ResolverFactory({ + aliasFields: ["browser"], + exportsFields: [["exports"]], + extensions: [".js"] + }); + const result = r.sync(fixture2, "exports-field"); + expect(result.path).toBe( + path.resolve(fixture2, "node_modules/exports-field/index.js") + ); + }); + + it("field name path #5", () => { + const r = new ResolverFactory({ + aliasFields: ["browser"], + exportsFields: ["ex", ["exportsField", "exports"]], + extensions: [".js"] + }); + const result = r.sync(fixture3, "exports-field"); + expect(result.path).toBe( + path.resolve(fixture3, "node_modules/exports-field/index") + ); + }); + + it("request ending with slash #1", () => { + const result = resolver.sync(fixture, "exports-field/"); + expect(result.error).toBeTruthy(); + }); + + it("request ending with slash #2", () => { + const result = resolver.sync(fixture, "exports-field/dist/"); + expect(result.error).toBeTruthy(); + }); + + it("request ending with slash #3", () => { + const result = resolver.sync(fixture, "exports-field/lib/"); + expect(result.error).toBeTruthy(); + }); + + it("should throw error if target is invalid", () => { + const result = resolver.sync(fixture4, "exports-field"); + expect(result.error).toBeTruthy(); + }); + + it("throw error if exports field is invalid", () => { + const result = resolver.sync(fixture, "invalid-exports-field"); + expect(result.error).toBeTruthy(); + }); + + // Wildcard pattern tests + it("should resolve with wildcard pattern #1", () => { + const wcFixture = path.resolve(fixtureDir, "imports-exports-wildcard"); + const result = resolver.sync(wcFixture, "m/features/f.js"); + expect(result.path).toBe( + path.resolve(wcFixture, "./node_modules/m/src/features/f.js") + ); + }); + + it("should resolve with wildcard pattern #2", () => { + const wcFixture = path.resolve(fixtureDir, "imports-exports-wildcard"); + const result = resolver.sync(wcFixture, "m/features/y/y.js"); + expect(result.path).toBe( + path.resolve(wcFixture, "./node_modules/m/src/features/y/y.js") + ); + }); + + it("should resolve with wildcard pattern #4", () => { + const wcFixture = path.resolve(fixtureDir, "imports-exports-wildcard"); + const result = resolver.sync(wcFixture, "m/features-no-ext/y/y.js"); + expect(result.path).toBe( + path.resolve(wcFixture, "./node_modules/m/src/features/y/y.js") + ); + }); + + it("should resolve with wildcard pattern #5", () => { + const wcFixture = path.resolve(fixtureDir, "imports-exports-wildcard"); + const result = resolver.sync(wcFixture, "m/middle/nested/f.js"); + expect(result.path).toBe( + path.resolve(wcFixture, "./node_modules/m/src/middle/nested/f.js") + ); + }); + + it("should resolve with wildcard pattern #6", () => { + const wcFixture = path.resolve(fixtureDir, "imports-exports-wildcard"); + const result = resolver.sync(wcFixture, "m/middle-1/nested/f.js"); + expect(result.path).toBe( + path.resolve(wcFixture, "./node_modules/m/src/middle-1/nested/f.js") + ); + }); + + it("should resolve with wildcard pattern #7", () => { + const wcFixture = path.resolve(fixtureDir, "imports-exports-wildcard"); + const result = resolver.sync(wcFixture, "m/middle-2/nested/f.js"); + expect(result.path).toBe( + path.resolve(wcFixture, "./node_modules/m/src/middle-2/nested/f.js") + ); + }); + + it("should resolve with wildcard pattern #8", () => { + const wcFixture = path.resolve(fixtureDir, "imports-exports-wildcard"); + const result = resolver.sync(wcFixture, "m/middle-3/nested/f"); + expect(result.path).toBe( + path.resolve( + wcFixture, + "./node_modules/m/src/middle-3/nested/f/nested/f.js" + ) + ); + }); + + it("should resolve with wildcard pattern #9", () => { + const wcFixture = path.resolve(fixtureDir, "imports-exports-wildcard"); + const result = resolver.sync(wcFixture, "m/middle-4/f/nested"); + expect(result.path).toBe( + path.resolve(wcFixture, "./node_modules/m/src/middle-4/f/f.js") + ); + }); + + it("should resolve with wildcard pattern #10", () => { + const wcFixture = path.resolve(fixtureDir, "imports-exports-wildcard"); + const result = resolver.sync(wcFixture, "m/middle-5/f$/$"); + expect(result.path).toBe( + path.resolve(wcFixture, "./node_modules/m/src/middle-5/f$/$.js") + ); + }); + + it("should throw error if target is 'null'", () => { + const wcFixture = path.resolve(fixtureDir, "imports-exports-wildcard"); + const result = resolver.sync(wcFixture, "m/features/internal/file.js"); + expect(result.error).toBeTruthy(); + }); + + // extensionAlias with exports field + it("should resolve with the extensionAlias option", () => { + const r = new ResolverFactory({ + extensions: [".js"], + extensionAlias: { ".js": [".ts", ".js"] }, + fullySpecified: true, + conditionNames: ["webpack", "default"] + }); + const eaFixture = path.resolve( + fixtureDir, + "exports-field-and-extension-alias" + ); + const result = r.sync(eaFixture, "@org/pkg/string.js"); + expect(result.path).toBe( + path.resolve(eaFixture, "./node_modules/@org/pkg/dist/string.js") + ); + }); + + it("should resolve with the extensionAlias option #2", () => { + const r = new ResolverFactory({ + extensions: [".js"], + extensionAlias: { ".js": [".ts", ".js"] }, + fullySpecified: true, + conditionNames: ["webpack", "default"] + }); + const eaFixture = path.resolve( + fixtureDir, + "exports-field-and-extension-alias" + ); + const result = r.sync(eaFixture, "pkg/string.js"); + expect(result.path).toBe( + path.resolve(eaFixture, "./node_modules/pkg/dist/string.js") + ); + }); + + it("should resolve with the extensionAlias option #3", () => { + const r = new ResolverFactory({ + extensions: [".js"], + extensionAlias: { ".js": [".foo", ".baz", ".baz", ".ts", ".js"] }, + fullySpecified: true, + conditionNames: ["webpack", "default"] + }); + const eaFixture = path.resolve( + fixtureDir, + "exports-field-and-extension-alias" + ); + const result = r.sync(eaFixture, "pkg/string.js"); + expect(result.path).toBe( + path.resolve(eaFixture, "./node_modules/pkg/dist/string.js") + ); + }); + + it("should throw error with the extensionAlias option", () => { + const r = new ResolverFactory({ + extensions: [".js"], + extensionAlias: { ".js": [".ts"] }, + fullySpecified: true, + conditionNames: ["webpack", "default"] + }); + const eaFixture = path.resolve( + fixtureDir, + "exports-field-and-extension-alias" + ); + const result = r.sync(eaFixture, "pkg/string.js"); + expect(result.error).toBeTruthy(); + }); + + it("should throw error with the extensionAlias option #2", () => { + const r = new ResolverFactory({ + extensions: [".js"], + extensionAlias: { ".js": [".ts"] }, + fullySpecified: true, + conditionNames: ["webpack", "default"] + }); + const eaFixture = path.resolve( + fixtureDir, + "exports-field-and-extension-alias" + ); + const result = r.sync(eaFixture, "pkg/string.js"); + expect(result.error).toBeTruthy(); + }); + + // skip: query strings containing ../ treated as invalid targets + it.skip("invalid package target #1", () => { + const result = resolver.sync(fixture5, "@exports-field/bad-specifier"); + expect(result.path).toBe(`${path.resolve(fixture5, "./a.js")}?foo=../`); + }); + + // skip: query strings containing ../ treated as invalid targets + it.skip("invalid package target #2", () => { + const result = resolver.sync( + fixture5, + "@exports-field/bad-specifier/foo/file.js" + ); + expect(result.path).toBe(`${path.resolve(fixture5, "./a.js")}?foo=../#../`); + }); + + it("invalid package target #3", () => { + const result = resolver.sync(fixture5, "@exports-field/bad-specifier/bar"); + expect(result.error).toBeTruthy(); + }); + + it("invalid package target #4", () => { + const result = resolver.sync( + fixture5, + "@exports-field/bad-specifier/baz-multi" + ); + expect(result.error).toBeTruthy(); + }); + + it("invalid package target #5", () => { + const result = resolver.sync( + fixture5, + "@exports-field/bad-specifier/pattern/a.js" + ); + expect(result.path).toBe(path.resolve(fixture5, "./a.js")); + }); + + it("invalid package target #6", () => { + const result = resolver.sync( + fixture5, + "@exports-field/bad-specifier/slash" + ); + expect(result.path).toBe(path.resolve(fixture5, "./a.js")); + }); + + it("invalid package target #7", () => { + const result = resolver.sync( + fixture5, + "@exports-field/bad-specifier/no-slash" + ); + expect(result.path).toBe(path.resolve(fixture5, "./a.js")); + }); + + it("invalid package target #8", () => { + const result = resolver.sync( + fixture5, + "@exports-field/bad-specifier/utils/index.mjs" + ); + expect(result.error).toBeTruthy(); + }); + + it("invalid package target #9", () => { + const result = resolver.sync( + fixture5, + "@exports-field/bad-specifier/utils1/index.mjs" + ); + expect(result.error).toBeTruthy(); + }); + + it("invalid package target #10", () => { + const result = resolver.sync( + fixture5, + "@exports-field/bad-specifier/utils2/index" + ); + expect(result.error).toBeTruthy(); + }); + + it("invalid package target #11", () => { + const result = resolver.sync( + fixture5, + "@exports-field/bad-specifier/utils3/index" + ); + expect(result.error).toBeTruthy(); + }); + + it("invalid package target #12", () => { + const result = resolver.sync( + fixture5, + "@exports-field/bad-specifier/utils4/index" + ); + expect(result.error).toBeTruthy(); + }); + + it("invalid package target #13", () => { + const result = resolver.sync( + fixture5, + "@exports-field/bad-specifier/utils5/index" + ); + expect(result.error).toBeTruthy(); + }); + + it("invalid package target #14", () => { + const result = resolver.sync( + fixture5, + "@exports-field/bad-specifier/timezones/pdt.mjs" + ); + expect(result.error).toBeTruthy(); + }); + + // skip: array fallback in exports field when first valid target file not found + it.skip("invalid package target #15", () => { + const result = resolver.sync( + fixture5, + "@exports-field/bad-specifier/non-existent.js" + ); + expect(result.error).toBeTruthy(); + }); + + it("invalid package target #16", () => { + const result = resolver.sync( + fixture5, + "@exports-field/bad-specifier/dep/multi1" + ); + expect(result.error).toBeTruthy(); + }); + + it("invalid package target #17", () => { + const result = resolver.sync( + fixture5, + "@exports-field/bad-specifier/dep/multi2" + ); + expect(result.error).toBeTruthy(); + }); + + it("invalid package target #18", () => { + const result = resolver.sync( + fixture5, + "@exports-field/bad-specifier/dep/multi4" + ); + expect(result.error).toBeTruthy(); + }); + + it("invalid package target #19", () => { + const result = resolver.sync( + fixture5, + "@exports-field/bad-specifier/dep/multi5" + ); + expect(result.error).toBeTruthy(); + }); + + it("should resolve the valid thing in array of export #1", () => { + const result = resolver.sync( + fixture5, + "@exports-field/bad-specifier/bad-specifier.js" + ); + expect(result.path).toBe(path.resolve(fixture5, "./a.js")); + }); + + it("should resolve the valid thing in array of export #2", () => { + const result = resolver.sync( + fixture5, + "@exports-field/bad-specifier/bad-specifier1.js" + ); + expect(result.path).toBe(path.resolve(fixture5, "./a.js")); + }); + + it("should resolve the valid thing in array of export #3", () => { + const result = resolver.sync( + fixture5, + "@exports-field/bad-specifier/dep/multi" + ); + expect(result.path).toBe(path.resolve(fixture5, "./a.js")); + }); + + it("should resolve the valid thing in array of export #4", () => { + const result = resolver.sync( + fixture5, + "@exports-field/bad-specifier/dep/multi3" + ); + expect(result.path).toBe(path.resolve(fixture5, "./a.js")); + }); + + it("should not fall back to parent node_modules when exports field maps to a missing file (issue #399)", () => { + const r = new ResolverFactory({ + extensions: [".js"], + conditionNames: ["node"], + fullySpecified: true + }); + const result = r.sync( + path.resolve(fixture6, "workspace"), + "pkg/src/index.js" + ); + expect(result.error).toBeTruthy(); + }); +}); diff --git a/napi/tests/extension-alias.test.mjs b/napi/tests/extension-alias.test.mjs new file mode 100644 index 00000000..8628e43f --- /dev/null +++ b/napi/tests/extension-alias.test.mjs @@ -0,0 +1,62 @@ +import { describe, it, expect } from "@rstest/core"; +import { ResolverFactory } from "../index.js"; +import * as path from "node:path"; + +const fixtureDir = path.resolve("fixtures/enhanced_resolve/test/fixtures"); +const fixture = path.resolve(fixtureDir, "extension-alias"); + +describe("extension-alias", () => { + const resolver = new ResolverFactory({ + extensions: [".js"], + mainFiles: ["index.js"], + extensionAlias: { + ".js": [".ts", ".js"], + ".mjs": [".mts"] + } + }); + + it("should alias fully specified file", () => { + const result = resolver.sync(fixture, "./index.js"); + expect(result.path).toBe(path.resolve(fixture, "index.ts")); + }); + + it("should alias fully specified file when there are two alternatives", () => { + const result = resolver.sync(fixture, "./dir/index.js"); + expect(result.path).toBe(path.resolve(fixture, "dir", "index.ts")); + }); + + it("should also allow the second alternative", () => { + const result = resolver.sync(fixture, "./dir2/index.js"); + expect(result.path).toBe(path.resolve(fixture, "dir2", "index.js")); + }); + + it("should support alias option without an array", () => { + const result = resolver.sync(fixture, "./dir2/index.mjs"); + expect(result.path).toBe(path.resolve(fixture, "dir2", "index.mts")); + }); + + it("should not allow to fallback to the original extension or add extensions", () => { + const result = resolver.sync(fixture, "./index.mjs"); + expect(result.error).toBeTruthy(); + }); + + describe("should not apply extension alias to extensions or mainFiles field", () => { + const resolver2 = new ResolverFactory({ + extensions: [".js"], + mainFiles: ["index.js"], + extensionAlias: { + ".js": [] + } + }); + + it("directory", () => { + const result = resolver2.sync(fixture, "./dir2"); + expect(result.path).toBe(path.resolve(fixture, "dir2", "index.js")); + }); + + it("file", () => { + const result = resolver2.sync(fixture, "./dir2/index"); + expect(result.path).toBe(path.resolve(fixture, "dir2", "index.js")); + }); + }); +}); diff --git a/napi/tests/extensions.test.mjs b/napi/tests/extensions.test.mjs new file mode 100644 index 00000000..f6f5b90a --- /dev/null +++ b/napi/tests/extensions.test.mjs @@ -0,0 +1,49 @@ +import { describe, it, expect } from "@rstest/core"; +import { ResolverFactory } from "../index.js"; +import * as path from "node:path"; + +const fixtureDir = path.resolve("fixtures/enhanced_resolve/test/fixtures"); +const fixture = path.resolve(fixtureDir, "extensions"); + +describe("extensions", () => { + const resolver = new ResolverFactory({ + extensions: [".ts", ".js"] + }); + + it("should resolve according to order of provided extensions", () => { + const result = resolver.sync(fixture, "./foo"); + expect(result.path).toBe(path.resolve(fixture, "foo.ts")); + }); + + it("should resolve according to order of provided extensions (dir index)", () => { + const result = resolver.sync(fixture, "./dir"); + expect(result.path).toBe(path.resolve(fixture, "dir/index.ts")); + }); + + it("should resolve according to main field in module root", () => { + const result = resolver.sync(fixture, "."); + expect(result.path).toBe(path.resolve(fixture, "index.js")); + }); + + it("should resolve single file module before directory", () => { + const result = resolver.sync(fixture, "module"); + expect(result.path).toBe(path.resolve(fixture, "node_modules/module.js")); + }); + + it("should resolve trailing slash directory before single file", () => { + const result = resolver.sync(fixture, "module/"); + expect(result.path).toBe( + path.resolve(fixture, "node_modules/module/index.ts") + ); + }); + + it("should not resolve to file when request has a trailing slash (relative)", () => { + const result = resolver.sync(fixture, "./foo.js/"); + expect(result.error).toBeTruthy(); + }); + + it("should not resolve to file when request has a trailing slash (module)", () => { + const result = resolver.sync(fixture, "module.js/"); + expect(result.error).toBeTruthy(); + }); +}); diff --git a/napi/tests/importsField.test.mjs b/napi/tests/importsField.test.mjs new file mode 100644 index 00000000..0dfe0dbc --- /dev/null +++ b/napi/tests/importsField.test.mjs @@ -0,0 +1,183 @@ +import { describe, it, expect } from "@rstest/core"; +import { ResolverFactory } from "../index.js"; +import * as path from "node:path"; + +const fixtureDir = path.resolve("fixtures/enhanced_resolve/test/fixtures"); + +const fixture = path.resolve(fixtureDir, "imports-field"); +const fixture1 = path.resolve(fixtureDir, "imports-field-different"); + +describe("importsFieldPlugin", () => { + const resolver = new ResolverFactory({ + extensions: [".js"], + mainFiles: ["index.js"], + conditionNames: ["webpack"] + }); + + it("should resolve using imports field instead of self-referencing", () => { + const result = resolver.sync(fixture, "#imports-field"); + expect(result.path).toBe(path.resolve(fixture, "b.js")); + }); + + it("should resolve using imports field instead of self-referencing for a subpath", () => { + const result = resolver.sync( + path.resolve(fixture, "dir"), + "#imports-field" + ); + expect(result.path).toBe(path.resolve(fixture, "b.js")); + }); + + it("should disallow resolve out of package scope", () => { + const result = resolver.sync(fixture, "#b"); + expect(result.error).toBeTruthy(); + }); + + it("field name #1", () => { + const r = new ResolverFactory({ + extensions: [".js"], + mainFiles: ["index.js"], + importsFields: [["imports"]], + conditionNames: ["webpack"] + }); + const result = r.sync(fixture, "#imports-field"); + expect(result.path).toBe(path.resolve(fixture, "b.js")); + }); + + it("field name #2", () => { + const r = new ResolverFactory({ + extensions: [".js"], + mainFiles: ["index.js"], + importsFields: [["other", "imports"], "imports"], + conditionNames: ["webpack"] + }); + const result = r.sync(fixture, "#b"); + expect(result.path).toBe(path.resolve(fixture, "a.js")); + }); + + it("should resolve package #1", () => { + const result = resolver.sync(fixture, "#a/dist/main.js"); + expect(result.path).toBe( + path.resolve(fixture, "node_modules/a/lib/lib2/main.js") + ); + }); + + it("should resolve package #2", () => { + const result = resolver.sync(fixture, "#a"); + expect(result.error).toBeTruthy(); + }); + + it("should resolve package #3", () => { + const result = resolver.sync(fixture, "#ccc/index.js"); + expect(result.path).toBe(path.resolve(fixture, "node_modules/c/index.js")); + }); + + it("should resolve package #4", () => { + const result = resolver.sync(fixture, "#c"); + expect(result.path).toBe(path.resolve(fixture, "node_modules/c/index.js")); + }); + + it("should resolve with wildcard pattern", () => { + const wcFixture = path.resolve( + fixtureDir, + "imports-exports-wildcard/node_modules/m" + ); + const result = resolver.sync(wcFixture, "#internal/i.js"); + expect(result.path).toBe(path.resolve(wcFixture, "./src/internal/i.js")); + }); + + // skip: #/ slash pattern (node.js PR #60864) not yet supported + it.skip("should work and throw an error on invalid imports #1", () => { + const result = resolver.sync(fixture, "#/dep"); + expect(result.error).toBeTruthy(); + }); + + it("should work and throw an error on invalid imports #2", () => { + const result = resolver.sync(fixture, "#dep/"); + expect(result.error).toBeTruthy(); + }); + + // skip: query strings containing ../ treated as invalid targets + it.skip("should work with invalid imports #1", () => { + const result = resolver.sync(fixture1, "#dep"); + expect(result.path).toBe(`${path.resolve(fixture1, "./a.js")}?foo=../`); + }); + + // skip: query strings containing ../ treated as invalid targets + it.skip("should work with invalid imports #2", () => { + const result = resolver.sync(fixture1, "#dep/foo/a.js"); + expect(result.path).toBe(`${path.resolve(fixture1, "./a.js")}?foo=../#../`); + }); + + it("should work with invalid imports #3", () => { + const result = resolver.sync(fixture1, "#dep/bar"); + expect(result.error).toBeTruthy(); + }); + + it("should work with invalid imports #4", () => { + const result = resolver.sync(fixture1, "#dep/baz"); + expect(result.error).toBeTruthy(); + }); + + it("should work with invalid imports #5", () => { + const result = resolver.sync(fixture1, "#dep/baz-multi"); + expect(result.error).toBeTruthy(); + }); + + // skip: invalid specifier array handling differences + it.skip("should work with invalid imports #7", () => { + const result = resolver.sync(fixture1, "#dep/pattern/a.js"); + expect(result.error).toBeTruthy(); + }); + + // skip: invalid specifier array handling differences + it.skip("should work with invalid imports #8", () => { + const result = resolver.sync(fixture1, "#dep/array"); + expect(result.path).toBe(path.resolve(fixture1, "./a.js")); + }); + + // skip: invalid specifier array handling differences + it.skip("should work with invalid imports #9", () => { + const result = resolver.sync(fixture1, "#dep/array2"); + expect(result.error).toBeTruthy(); + }); + + it("should work with invalid imports #10", () => { + const result = resolver.sync(fixture1, "#dep/array3"); + expect(result.path).toBe(path.resolve(fixture1, "./a.js")); + }); + + it("should work with invalid imports #11", () => { + const result = resolver.sync(fixture1, "#dep/empty"); + expect(result.error).toBeTruthy(); + }); + + it("should work with invalid imports #12", () => { + const result = resolver.sync(fixture1, "#dep/with-bad"); + expect(result.path).toBe(path.resolve(fixture1, "./a.js")); + }); + + it("should work with invalid imports #13", () => { + const result = resolver.sync(fixture1, "#dep/with-bad2"); + expect(result.path).toBe(path.resolve(fixture1, "./a.js")); + }); + + it("should work with invalid imports #14", () => { + const result = resolver.sync(fixture1, "#timezones/pdt.mjs"); + expect(result.error).toBeTruthy(); + }); + + it("should work with invalid imports #15", () => { + const result = resolver.sync(fixture1, "#dep/multi1"); + expect(result.error).toBeTruthy(); + }); + + it("should work with invalid imports #16", () => { + const result = resolver.sync(fixture1, "#dep/multi2"); + expect(result.error).toBeTruthy(); + }); + + it("should work and resolve with array imports", () => { + const result = resolver.sync(fixture1, "#dep/multi"); + expect(result.path).toBe(path.resolve(fixture1, "./a.js")); + }); +}); diff --git a/napi/tests/incorrect-description-file.test.mjs b/napi/tests/incorrect-description-file.test.mjs new file mode 100644 index 00000000..51af8ece --- /dev/null +++ b/napi/tests/incorrect-description-file.test.mjs @@ -0,0 +1,24 @@ +import { describe, it, expect } from "@rstest/core"; +import { ResolverFactory } from "../index.js"; +import * as path from "node:path"; + +const fixtureDir = path.resolve("fixtures/enhanced_resolve/test/fixtures"); +const fixtures = path.join(fixtureDir, "incorrect-package"); + +function p(...args) { + return path.join(fixtures, ...args); +} + +describe("incorrect description file", () => { + const resolver = new ResolverFactory({}); + + it("should not resolve main in incorrect description file #1", () => { + const result = resolver.sync(p("pack1"), "."); + expect(result.error).toBeTruthy(); + }); + + it("should not resolve main in incorrect description file #2", () => { + const result = resolver.sync(p("pack2"), "."); + expect(result.error).toBeTruthy(); + }); +}); diff --git a/napi/tests/options.test.mjs b/napi/tests/options.test.mjs index bc4d7da1..d79dd462 100644 --- a/napi/tests/options.test.mjs +++ b/napi/tests/options.test.mjs @@ -1,12 +1,8 @@ -import { describe, it } from "node:test"; +import { describe, it, expect } from "@rstest/core"; import { ResolverFactory } from "../index.js"; -import * as assert from "node:assert"; import * as path from "node:path"; -import { fileURLToPath } from "url"; -const fixtureDir = fileURLToPath( - new URL("../../fixtures/enhanced_resolve/test/fixtures", import.meta.url) -); +const fixtureDir = path.resolve("fixtures/enhanced_resolve/test/fixtures"); describe("option", () => { describe("alias", () => { @@ -14,8 +10,7 @@ describe("option", () => { const resolver = new ResolverFactory({ alias: { strAlias: path.join(fixtureDir, "alias/files/a.js") } }); - assert.equal( - resolver.sync(fixtureDir, "strAlias").path, + expect(resolver.sync(fixtureDir, "strAlias").path).toBe( path.join(fixtureDir, "alias/files/a.js") ); }); @@ -24,8 +19,7 @@ describe("option", () => { const resolver = new ResolverFactory({ alias: { strAlias: false } }); - assert.match( - resolver.sync(fixtureDir, "strAlias").error, + expect(resolver.sync(fixtureDir, "strAlias").error).toMatch( /^Path is ignored/ ); }); @@ -34,8 +28,7 @@ describe("option", () => { const resolver = new ResolverFactory({ alias: { strAlias: [path.join(fixtureDir, "alias/files/a.js")] } }); - assert.equal( - resolver.sync(fixtureDir, "strAlias").path, + expect(resolver.sync(fixtureDir, "strAlias").path).toBe( path.join(fixtureDir, "alias/files/a.js") ); }); @@ -44,20 +37,18 @@ describe("option", () => { describe("aliasFields", () => { it("should allow field string ", () => { const resolver = new ResolverFactory({ aliasFields: ["browser"] }); - assert.equal( - resolver.sync(fixtureDir, "./browser-module/lib/replaced.js").path, - path.join(fixtureDir, "./browser-module/lib/browser.js") - ); + expect( + resolver.sync(fixtureDir, "./browser-module/lib/replaced.js").path + ).toBe(path.join(fixtureDir, "./browser-module/lib/browser.js")); }); it("should allow json path array", () => { const resolver = new ResolverFactory({ aliasFields: [["innerBrowser1", "field", "browser"]] }); - assert.equal( - resolver.sync(fixtureDir, "./browser-module/lib/main1.js").path, - path.join(fixtureDir, "./browser-module/lib/main.js") - ); + expect( + resolver.sync(fixtureDir, "./browser-module/lib/main1.js").path + ).toBe(path.join(fixtureDir, "./browser-module/lib/main.js")); }); }); @@ -65,11 +56,12 @@ describe("option", () => { const createTest = exportsFields => () => { const resolver = new ResolverFactory({ exportsFields }); - assert.equal( + expect( resolver.sync( path.resolve(fixtureDir, "./exports-field3"), "exports-field" - ).path, + ).path + ).toBe( path.join( fixtureDir, "exports-field3/node_modules/exports-field/src/index.js" @@ -83,8 +75,7 @@ describe("option", () => { describe("mainFields", () => { const createTest = mainFields => { const resolver = new ResolverFactory({ mainFields }); - assert.equal( - resolver.sync(fixtureDir, "../..").path, + expect(resolver.sync(fixtureDir, "../..").path).toBe( path.join(fixtureDir, "../../", "lib/index.js") ); }; diff --git a/napi/tests/resolve.test.mjs b/napi/tests/resolve.test.mjs new file mode 100644 index 00000000..03d8603b --- /dev/null +++ b/napi/tests/resolve.test.mjs @@ -0,0 +1,282 @@ +import { describe, it, expect } from "@rstest/core"; +import { ResolverFactory } from "../index.js"; +import * as path from "node:path"; + +const fixtures = path.resolve("fixtures/enhanced_resolve/test/fixtures"); + +function testResolve(resolver, name, context, moduleName, expected) { + it(name, () => { + const result = resolver.sync(context, moduleName); + expect(result.path).toBe(expected); + }); +} + +describe("resolve", () => { + const resolver = new ResolverFactory({ + extensions: [".js", ".json", ".node"] + }); + + const contextResolver = new ResolverFactory({ + extensions: [".js", ".json", ".node"], + resolveToContext: true + }); + + testResolve( + resolver, + "absolute path", + fixtures, + path.join(fixtures, "main1.js"), + path.join(fixtures, "main1.js") + ); + + testResolve( + resolver, + "file with .js", + fixtures, + "./main1.js", + path.join(fixtures, "main1.js") + ); + + testResolve( + resolver, + "file without extension", + fixtures, + "./main1", + path.join(fixtures, "main1.js") + ); + + testResolve( + resolver, + "another file with .js", + fixtures, + "./a.js", + path.join(fixtures, "a.js") + ); + + testResolve( + resolver, + "another file without extension", + fixtures, + "./a", + path.join(fixtures, "a.js") + ); + + testResolve( + resolver, + "file in module with .js", + fixtures, + "m1/a.js", + path.join(fixtures, "node_modules", "m1", "a.js") + ); + + testResolve( + resolver, + "file in module without extension", + fixtures, + "m1/a", + path.join(fixtures, "node_modules", "m1", "a.js") + ); + + testResolve( + resolver, + "another file in module without extension", + fixtures, + "complexm/step1", + path.join(fixtures, "node_modules", "complexm", "step1.js") + ); + + testResolve( + resolver, + "from submodule to file in sibling module", + path.join(fixtures, "node_modules", "complexm"), + "m2/b.js", + path.join(fixtures, "node_modules", "m2", "b.js") + ); + + testResolve( + resolver, + "from submodule to file in sibling of parent module", + path.join(fixtures, "node_modules", "complexm", "web_modules", "m1"), + "m2/b.js", + path.join(fixtures, "node_modules", "m2", "b.js") + ); + + testResolve( + resolver, + "from nested directory to overwritten file in module", + path.join(fixtures, "multiple_modules"), + "m1/a.js", + path.join(fixtures, "multiple_modules", "node_modules", "m1", "a.js") + ); + + testResolve( + resolver, + "from nested directory to not overwritten file in module", + path.join(fixtures, "multiple_modules"), + "m1/b.js", + path.join(fixtures, "node_modules", "m1", "b.js") + ); + + // query and fragment tests + testResolve( + resolver, + "file with query", + fixtures, + "./main1.js?query", + `${path.join(fixtures, "main1.js")}?query` + ); + + testResolve( + resolver, + "file with fragment", + fixtures, + "./main1.js#fragment", + `${path.join(fixtures, "main1.js")}#fragment` + ); + + testResolve( + resolver, + "file with fragment and query", + fixtures, + "./main1.js#fragment?query", + `${path.join(fixtures, "main1.js")}#fragment?query` + ); + + testResolve( + resolver, + "file with query and fragment", + fixtures, + "./main1.js?#fragment", + `${path.join(fixtures, "main1.js")}?#fragment` + ); + + testResolve( + resolver, + "file in module with query", + fixtures, + "m1/a?query", + `${path.join(fixtures, "node_modules", "m1", "a.js")}?query` + ); + + testResolve( + resolver, + "file in module with fragment", + fixtures, + "m1/a#fragment", + `${path.join(fixtures, "node_modules", "m1", "a.js")}#fragment` + ); + + testResolve( + resolver, + "file in module with fragment and query", + fixtures, + "m1/a#fragment?query", + `${path.join(fixtures, "node_modules", "m1", "a.js")}#fragment?query` + ); + + testResolve( + resolver, + "file in module with query and fragment", + fixtures, + "m1/a?#fragment", + `${path.join(fixtures, "node_modules", "m1", "a.js")}?#fragment` + ); + + // resolveToContext tests + it("context for fixtures", () => { + const result = contextResolver.sync(fixtures, "./"); + expect(result.path).toBe(fixtures); + }); + + it("context for fixtures/lib", () => { + const result = contextResolver.sync(fixtures, "./lib"); + expect(result.path).toBe(path.join(fixtures, "lib")); + }); + + it("context for fixtures with ..", () => { + const result = contextResolver.sync( + fixtures, + "./lib/../../fixtures/./lib/.." + ); + expect(result.path).toBe(fixtures); + }); + + it("context for fixtures with query", () => { + const result = contextResolver.sync(fixtures, "./?query"); + expect(result.path).toBe(`${fixtures}?query`); + }); + + // differ between directory and file + testResolve( + resolver, + "differ between directory and file, resolve file", + fixtures, + "./dirOrFile", + path.join(fixtures, "dirOrFile.js") + ); + + testResolve( + resolver, + "differ between directory and file, resolve directory", + fixtures, + "./dirOrFile/", + path.join(fixtures, "dirOrFile", "index.js") + ); + + testResolve( + resolver, + "find node_modules outside of node_modules", + path.join(fixtures, "browser-module", "node_modules"), + "m1/a", + path.join(fixtures, "node_modules", "m1", "a.js") + ); + + testResolve( + resolver, + "don't crash on main field pointing to self", + fixtures, + "./main-field-self", + path.join(fixtures, "main-field-self", "index.js") + ); + + testResolve( + resolver, + "don't crash on main field pointing to self #2", + fixtures, + "./main-field-self2", + path.join(fixtures, "main-field-self2", "index.js") + ); + + // issue-238 + it("should correctly resolve (issue-238)", () => { + const issue238 = path.resolve(fixtures, "issue-238"); + const issue238Resolver = new ResolverFactory({ + extensions: [".js", ".jsx", ".ts", ".tsx"], + modules: ["src/a", "src/b", "src/common", "node_modules"] + }); + const result = issue238Resolver.sync( + path.resolve(issue238, "./src/common"), + "config/myObjectFile" + ); + expect(result.path).toBe( + path.resolve(issue238, "./src/common/config/myObjectFile.js") + ); + }); + + // preferRelative + it("should correctly resolve with preferRelative", () => { + const preferRelativeResolver = new ResolverFactory({ + preferRelative: true + }); + const result = preferRelativeResolver.sync(fixtures, "main1.js"); + expect(result.path).toBe(path.join(fixtures, "main1.js")); + }); + + it("should correctly resolve with preferRelative #2", () => { + const preferRelativeResolver = new ResolverFactory({ + preferRelative: true + }); + const result = preferRelativeResolver.sync(fixtures, "m1/a.js"); + expect(result.path).toBe(path.join(fixtures, "node_modules", "m1", "a.js")); + }); +}); diff --git a/napi/tests/restrictions.test.mjs b/napi/tests/restrictions.test.mjs new file mode 100644 index 00000000..79866cea --- /dev/null +++ b/napi/tests/restrictions.test.mjs @@ -0,0 +1,51 @@ +import { describe, it, expect } from "@rstest/core"; +import { ResolverFactory } from "../index.js"; +import * as path from "node:path"; + +const fixtureDir = path.resolve("fixtures/enhanced_resolve/test/fixtures"); +const fixture = path.resolve(fixtureDir, "restrictions"); + +describe("restrictions", () => { + it("should respect RegExp restriction", () => { + const resolver = new ResolverFactory({ + extensions: [".js"], + restrictions: [{ regex: "\\.(sass|scss|css)$" }] + }); + const result = resolver.sync(fixture, "pck1"); + expect(result.error).toBeTruthy(); + }); + + it("should try to find alternative #1", () => { + const resolver = new ResolverFactory({ + extensions: [".js", ".css"], + mainFiles: ["index"], + restrictions: [{ regex: "\\.(sass|scss|css)$" }] + }); + const result = resolver.sync(fixture, "pck1"); + expect(result.path).toBe( + path.resolve(fixture, "node_modules/pck1/index.css") + ); + }); + + it("should respect string restriction", () => { + const resolver = new ResolverFactory({ + extensions: [".js"], + restrictions: [{ path: fixture }] + }); + const result = resolver.sync(fixture, "pck2"); + expect(result.error).toBeTruthy(); + }); + + // skip: restrictions with multiple mainFields + it.skip("should try to find alternative #2", () => { + const resolver = new ResolverFactory({ + extensions: [".js"], + mainFields: ["main", "style"], + restrictions: [{ path: fixture }, { regex: "\\.(sass|scss|css)$" }] + }); + const result = resolver.sync(fixture, "pck2"); + expect(result.path).toBe( + path.resolve(fixture, "node_modules/pck2/index.css") + ); + }); +}); diff --git a/napi/tests/roots.test.mjs b/napi/tests/roots.test.mjs new file mode 100644 index 00000000..5a41e7a0 --- /dev/null +++ b/napi/tests/roots.test.mjs @@ -0,0 +1,73 @@ +import { describe, it, expect } from "@rstest/core"; +import { ResolverFactory } from "../index.js"; +import * as path from "node:path"; + +const fixtureDir = path.resolve("fixtures/enhanced_resolve/test/fixtures"); +const testDir = path.resolve(fixtureDir, ".."); + +describe("roots", () => { + const resolver = new ResolverFactory({ + extensions: [".js"], + alias: { + foo: "/fixtures" + }, + roots: [testDir, fixtureDir] + }); + + it("should respect roots option", () => { + const result = resolver.sync(fixtureDir, "/fixtures/b.js"); + expect(result.path).toBe(path.resolve(fixtureDir, "b.js")); + }); + + it("should try another root option, if it exists", () => { + const result = resolver.sync(fixtureDir, "/b.js"); + expect(result.path).toBe(path.resolve(fixtureDir, "b.js")); + }); + + it("should respect extension", () => { + const result = resolver.sync(fixtureDir, "/fixtures/b"); + expect(result.path).toBe(path.resolve(fixtureDir, "b.js")); + }); + + it("should resolve in directory", () => { + const result = resolver.sync(fixtureDir, "/fixtures/extensions/dir"); + expect(result.path).toBe( + path.resolve(fixtureDir, "extensions/dir/index.js") + ); + }); + + it("should respect aliases", () => { + const result = resolver.sync(fixtureDir, "foo/b"); + expect(result.path).toBe(path.resolve(fixtureDir, "b.js")); + }); + + it("should support roots options with resolveToContext", () => { + const contextResolver = new ResolverFactory({ + roots: [testDir], + resolveToContext: true + }); + const result = contextResolver.sync(fixtureDir, "/fixtures/lib"); + expect(result.path).toBe(path.resolve(fixtureDir, "lib")); + }); + + it("should not work with relative path", () => { + const result = resolver.sync(fixtureDir, "fixtures/b.js"); + expect(result.error).toBeTruthy(); + }); + + it("should resolve an absolute path (prefer absolute)", () => { + const resolverPreferAbsolute = new ResolverFactory({ + extensions: [".js"], + alias: { + foo: "/fixtures" + }, + roots: [testDir, fixtureDir], + preferAbsolute: true + }); + const result = resolverPreferAbsolute.sync( + fixtureDir, + path.join(fixtureDir, "b.js") + ); + expect(result.path).toBe(path.resolve(fixtureDir, "b.js")); + }); +}); diff --git a/napi/tests/scoped-packages.test.mjs b/napi/tests/scoped-packages.test.mjs new file mode 100644 index 00000000..a0837ab5 --- /dev/null +++ b/napi/tests/scoped-packages.test.mjs @@ -0,0 +1,33 @@ +import { describe, it, expect } from "@rstest/core"; +import { ResolverFactory } from "../index.js"; +import * as path from "node:path"; + +const fixtureDir = path.resolve("fixtures/enhanced_resolve/test/fixtures"); +const fixture = path.join(fixtureDir, "scoped"); + +describe("scoped-packages", () => { + const resolver = new ResolverFactory({ + aliasFields: ["browser"] + }); + + it("main field should work", () => { + const result = resolver.sync(fixture, "@scope/pack1"); + expect(result.path).toBe( + path.resolve(fixture, "./node_modules/@scope/pack1/main.js") + ); + }); + + it("browser field should work", () => { + const result = resolver.sync(fixture, "@scope/pack2"); + expect(result.path).toBe( + path.resolve(fixture, "./node_modules/@scope/pack2/main.js") + ); + }); + + it("folder request should work", () => { + const result = resolver.sync(fixture, "@scope/pack2/lib"); + expect(result.path).toBe( + path.resolve(fixture, "./node_modules/@scope/pack2/lib/index.js") + ); + }); +}); diff --git a/napi/tests/tsconfig-paths.test.mjs b/napi/tests/tsconfig-paths.test.mjs new file mode 100644 index 00000000..268839ab --- /dev/null +++ b/napi/tests/tsconfig-paths.test.mjs @@ -0,0 +1,550 @@ +import { describe, it, expect } from "@rstest/core"; +import { ResolverFactory } from "../index.js"; +import * as path from "node:path"; + +const fixtureDir = path.resolve("fixtures/enhanced_resolve/test/fixtures"); + +const baseExampleDir = path.resolve(fixtureDir, "tsconfig-paths", "base"); +const extendsExampleDir = path.resolve( + fixtureDir, + "tsconfig-paths", + "extends-base" +); +const extendsNpmDir = path.resolve(fixtureDir, "tsconfig-paths", "extends-npm"); +const extendsCircularDir = path.resolve( + fixtureDir, + "tsconfig-paths", + "extends-circular" +); +const referencesProjectDir = path.resolve( + fixtureDir, + "tsconfig-paths", + "references-project" +); + +function makeTsconfigResolver(tsconfigPath, extra) { + return new ResolverFactory({ + extensions: [".ts", ".tsx"], + mainFields: ["browser", "main"], + mainFiles: ["index"], + tsconfig: { configFile: tsconfigPath }, + ...extra + }); +} + +describe("TsconfigPathsPlugin", () => { + it("resolves exact mapped path '@components/*' via tsconfig option", () => { + const resolver = makeTsconfigResolver( + path.join(baseExampleDir, "tsconfig.json") + ); + const result = resolver.sync(baseExampleDir, "@components/button"); + expect(result.path).toBe( + path.join(baseExampleDir, "src", "components", "button.ts") + ); + }); + + it("when multiple patterns match, the pattern with the longest matching prefix is used", () => { + const resolver = makeTsconfigResolver( + path.join(baseExampleDir, "tsconfig.json") + ); + const result = resolver.sync(baseExampleDir, "longest/bar"); + expect(result.path).toBe( + path.join(baseExampleDir, "src", "mapped", "longest", "three.ts") + ); + }); + + it("resolves exact mapped path 'foo' via tsconfig option", () => { + const resolver = makeTsconfigResolver( + path.join(baseExampleDir, "tsconfig.json") + ); + const result = resolver.sync(baseExampleDir, "foo"); + expect(result.path).toBe( + path.join(baseExampleDir, "src", "mapped", "foo", "index.ts") + ); + }); + + it("resolves wildcard mapped path 'bar/*' via tsconfig option", () => { + const resolver = makeTsconfigResolver( + path.join(baseExampleDir, "tsconfig.json") + ); + const result = resolver.sync(baseExampleDir, "bar/file1"); + expect(result.path).toBe( + path.join(baseExampleDir, "src", "mapped", "bar", "file1.ts") + ); + }); + + it("resolves wildcard mapped path '*/old-file' to specific file", () => { + const resolver = makeTsconfigResolver( + path.join(baseExampleDir, "tsconfig.json") + ); + const result = resolver.sync(baseExampleDir, "utils/old-file"); + expect(result.path).toBe( + path.join(baseExampleDir, "src", "components", "new-file.ts") + ); + }); + + it("falls through when no mapping exists", () => { + const resolver = makeTsconfigResolver( + path.join(baseExampleDir, "tsconfig.json") + ); + const result = resolver.sync(baseExampleDir, "does-not-exist"); + expect(result.error).toBeTruthy(); + }); + + // skip: ${configDir} in tsconfig extends + it.skip("resolves '@components/*' using extends", () => { + const resolver = makeTsconfigResolver( + path.join(extendsExampleDir, "tsconfig.json") + ); + const result = resolver.sync(extendsExampleDir, "@components/button"); + expect(result.path).toBe( + path.join(extendsExampleDir, "src", "components", "button.ts") + ); + }); + + describe("Path wildcard patterns", () => { + it("resolves 'foo/*' wildcard pattern", () => { + const resolver = makeTsconfigResolver( + path.join(baseExampleDir, "tsconfig.json") + ); + const result = resolver.sync(baseExampleDir, "foo/file1"); + expect(result.path).toBe( + path.join(baseExampleDir, "src", "mapped", "bar", "file1.ts") + ); + }); + + it("resolves '*' catch-all pattern to src/mapped/star/*", () => { + const resolver = makeTsconfigResolver( + path.join(baseExampleDir, "tsconfig.json") + ); + const result = resolver.sync(baseExampleDir, "star-bar/index"); + expect(result.path).toBe( + path.join( + baseExampleDir, + "src", + "mapped", + "star", + "star-bar", + "index.ts" + ) + ); + }); + + it("resolves package with mainFields", () => { + const resolver = makeTsconfigResolver( + path.join(baseExampleDir, "tsconfig.json") + ); + const result = resolver.sync(baseExampleDir, "main-field-package"); + expect(result.path).toBe( + path.join( + baseExampleDir, + "src", + "mapped", + "star", + "main-field-package", + "node.ts" + ) + ); + }); + + it("resolves package with browser field", () => { + const resolver = makeTsconfigResolver( + path.join(baseExampleDir, "tsconfig.json") + ); + const result = resolver.sync(baseExampleDir, "browser-field-package"); + expect(result.path).toBe( + path.join( + baseExampleDir, + "src", + "mapped", + "star", + "browser-field-package", + "browser.ts" + ) + ); + }); + + it("resolves package with default index.ts", () => { + const resolver = makeTsconfigResolver( + path.join(baseExampleDir, "tsconfig.json") + ); + const result = resolver.sync(baseExampleDir, "no-main-field-package"); + expect(result.path).toBe( + path.join( + baseExampleDir, + "src", + "mapped", + "star", + "no-main-field-package", + "index.ts" + ) + ); + }); + }); + + it("should resolve paths when extending from npm package", () => { + const resolver = makeTsconfigResolver( + path.join(extendsNpmDir, "tsconfig.json") + ); + const result = resolver.sync(extendsNpmDir, "@components/button"); + expect(result.path).toMatch(/src[\\/](utils|components)[\\/]button\.ts$/); + }); + + it("should handle malformed tsconfig.json gracefully", () => { + const malformedExampleDir = path.resolve( + fixtureDir, + "tsconfig-paths", + "malformed-json" + ); + const resolver = makeTsconfigResolver( + path.join(malformedExampleDir, "tsconfig.json") + ); + const result = resolver.sync(malformedExampleDir, "@components/button"); + expect(result.error).toBeTruthy(); + }); + + describe("${configDir} template variable support", () => { + it("should substitute ${configDir} in path mappings", () => { + const resolver = makeTsconfigResolver( + path.join(baseExampleDir, "tsconfig.json") + ); + const result = resolver.sync(baseExampleDir, "@components/button"); + expect(result.path).toBe( + path.join(baseExampleDir, "src", "components", "button.ts") + ); + }); + + it("should substitute ${configDir} in multiple path patterns", () => { + const resolver = makeTsconfigResolver( + path.join(baseExampleDir, "tsconfig.json") + ); + const result1 = resolver.sync(baseExampleDir, "@utils/date"); + expect(result1.path).toBe( + path.join(baseExampleDir, "src", "utils", "date.ts") + ); + const result2 = resolver.sync(baseExampleDir, "foo"); + expect(result2.path).toBe( + path.join(baseExampleDir, "src", "mapped", "foo", "index.ts") + ); + }); + + // skip: ${configDir} in tsconfig extends + it.skip("should handle circular extends without hanging", () => { + const aDir = path.join(extendsCircularDir, "a"); + const resolver = makeTsconfigResolver(path.join(aDir, "tsconfig.json")); + const result = resolver.sync(aDir, "@lib/foo"); + expect(result.path).toBe(path.join(aDir, "src", "lib", "foo.ts")); + }); + }); + + it("should use baseUrl from tsconfig", () => { + const resolver = new ResolverFactory({ + extensions: [".ts", ".tsx"], + mainFields: ["browser", "main"], + mainFiles: ["index"], + tsconfig: { + configFile: path.join(baseExampleDir, "tsconfig.json") + } + }); + const result = resolver.sync(baseExampleDir, "src/utils/date"); + expect(result.path).toBe( + path.join(baseExampleDir, "src", "utils", "date.ts") + ); + }); + + describe("TypeScript Project References", () => { + it("should support tsconfig object format with configFile", () => { + const resolver = new ResolverFactory({ + extensions: [".ts", ".tsx"], + mainFields: ["browser", "main"], + mainFiles: ["index"], + tsconfig: { + configFile: path.join(baseExampleDir, "tsconfig.json"), + references: "auto" + } + }); + const result = resolver.sync(baseExampleDir, "@components/button"); + expect(result.path).toBe( + path.join(baseExampleDir, "src", "components", "button.ts") + ); + }); + + // skip: ${configDir} in tsconfig references + it.skip("should resolve own paths (without cross-project references)", () => { + const appDir = path.join(referencesProjectDir, "packages", "app"); + const resolver = new ResolverFactory({ + extensions: [".ts", ".tsx"], + mainFields: ["browser", "main"], + mainFiles: ["index"], + tsconfig: { + configFile: path.join(appDir, "tsconfig.json"), + references: "auto" + } + }); + const result = resolver.sync(appDir, "@app/index"); + expect(result.path).toBe(path.join(appDir, "src", "index.ts")); + }); + + // skip: ${configDir} in tsconfig references + it.skip("should resolve self-references within a referenced project", () => { + const appDir = path.join(referencesProjectDir, "packages", "app"); + const sharedDir = path.join(referencesProjectDir, "packages", "shared"); + const resolver = new ResolverFactory({ + extensions: [".ts", ".tsx"], + mainFields: ["browser", "main"], + mainFiles: ["index"], + tsconfig: { + configFile: path.join(appDir, "tsconfig.json"), + references: "auto" + } + }); + const result = resolver.sync(sharedDir, "@shared/helper"); + expect(result.path).toBe( + path.join(sharedDir, "src", "utils", "helper.ts") + ); + }); + + // skip: ${configDir} in tsconfig references + it.skip("should support explicit references array", () => { + const appDir = path.join(referencesProjectDir, "packages", "app"); + const sharedSrcDir = path.join( + referencesProjectDir, + "packages", + "shared", + "src" + ); + const resolver = new ResolverFactory({ + extensions: [".ts", ".tsx"], + mainFields: ["browser", "main"], + mainFiles: ["index"], + tsconfig: { + configFile: path.join(appDir, "tsconfig.json"), + references: ["../shared"] + } + }); + const result = resolver.sync(sharedSrcDir, "@shared/helper"); + expect(result.path).toBe(path.join(sharedSrcDir, "utils", "helper.ts")); + }); + + // skip: ${configDir} in tsconfig references + it.skip("should not load references when references option is omitted", () => { + const appDir = path.join(referencesProjectDir, "packages", "app"); + const resolver = new ResolverFactory({ + extensions: [".ts", ".tsx"], + mainFields: ["browser", "main"], + mainFiles: ["index"], + tsconfig: { + configFile: path.join(appDir, "tsconfig.json") + } + }); + const result = resolver.sync(appDir, "@shared/utils/helper"); + expect(result.error).toBeTruthy(); + }); + + // skip: ${configDir} in tsconfig references + it.skip("should handle nested references", () => { + const appDir = path.join(referencesProjectDir, "packages", "app"); + const utilsSrcDir = path.join( + referencesProjectDir, + "packages", + "utils", + "src" + ); + const resolver = new ResolverFactory({ + extensions: [".ts", ".tsx"], + mainFields: ["browser", "main"], + mainFiles: ["index"], + tsconfig: { + configFile: path.join(appDir, "tsconfig.json"), + references: "auto" + } + }); + const result = resolver.sync(utilsSrcDir, "@utils/date"); + expect(result.path).toBe(path.join(utilsSrcDir, "core", "date.ts")); + }); + + describe("modules resolution with references", () => { + // skip: ${configDir} in tsconfig references + it.skip("should resolve modules from main project's baseUrl", () => { + const appDir = path.join(referencesProjectDir, "packages", "app"); + const resolver = new ResolverFactory({ + extensions: [".ts", ".tsx"], + mainFields: ["browser", "main"], + mainFiles: ["index"], + tsconfig: { + configFile: path.join(appDir, "tsconfig.json"), + references: "auto" + } + }); + const result = resolver.sync(appDir, "src/components/Button"); + expect(result.path).toBe( + path.join(appDir, "src", "components", "Button.ts") + ); + }); + + // skip: ${configDir} in tsconfig references + it.skip("should resolve modules from referenced project's baseUrl", () => { + const appDir = path.join(referencesProjectDir, "packages", "app"); + const sharedSrcDir = path.join( + referencesProjectDir, + "packages", + "shared", + "src" + ); + const resolver = new ResolverFactory({ + extensions: [".ts", ".tsx"], + mainFields: ["browser", "main"], + mainFiles: ["index"], + tsconfig: { + configFile: path.join(appDir, "tsconfig.json"), + references: "auto" + } + }); + const result = resolver.sync(sharedSrcDir, "utils/helper"); + expect(result.path).toBe(path.join(sharedSrcDir, "utils", "helper.ts")); + }); + + // skip: ${configDir} in tsconfig references + it.skip("should resolve components from referenced project's baseUrl", () => { + const appDir = path.join(referencesProjectDir, "packages", "app"); + const sharedSrcDir = path.join( + referencesProjectDir, + "packages", + "shared", + "src" + ); + const resolver = new ResolverFactory({ + extensions: [".ts", ".tsx"], + mainFields: ["browser", "main"], + mainFiles: ["index"], + tsconfig: { + configFile: path.join(appDir, "tsconfig.json"), + references: "auto" + } + }); + const result = resolver.sync(sharedSrcDir, "components/Input"); + expect(result.path).toBe( + path.join(sharedSrcDir, "components", "Input.ts") + ); + }); + + // skip: ${configDir} in tsconfig references + it.skip("should use correct baseUrl based on request context", () => { + const appDir = path.join(referencesProjectDir, "packages", "app"); + const resolver = new ResolverFactory({ + extensions: [".ts", ".tsx"], + mainFields: ["browser", "main"], + mainFiles: ["index"], + tsconfig: { + configFile: path.join(appDir, "tsconfig.json"), + references: "auto" + } + }); + const result1 = resolver.sync(appDir, "src/index"); + expect(result1.path).toBe(path.join(appDir, "src", "index.ts")); + }); + + // skip: ${configDir} in tsconfig references + it.skip("should support explicit references with modules resolution", () => { + const appDir = path.join(referencesProjectDir, "packages", "app"); + const sharedSrcDir = path.join( + referencesProjectDir, + "packages", + "shared", + "src" + ); + const resolver = new ResolverFactory({ + extensions: [".ts", ".tsx"], + mainFields: ["browser", "main"], + mainFiles: ["index"], + tsconfig: { + configFile: path.join(appDir, "tsconfig.json"), + references: ["../shared"] + } + }); + const result = resolver.sync(sharedSrcDir, "utils/helper"); + expect(result.path).toBe(path.join(sharedSrcDir, "utils", "helper.ts")); + }); + }); + }); + + describe("bug: baseUrl from deep extends chain", () => { + const deepBaseUrlDir = path.resolve( + fixtureDir, + "tsconfig-paths", + "extends-deep-baseurl" + ); + + it("should resolve paths whose baseUrl comes from a grandparent extends", () => { + const appDir = path.join(deepBaseUrlDir, "packages", "app"); + const resolver = makeTsconfigResolver(path.join(appDir, "tsconfig.json")); + const result = resolver.sync(appDir, "@base/utils/format"); + expect(result.path).toBe( + path.join(deepBaseUrlDir, "tsconfig-base", "src", "utils", "format.ts") + ); + }); + }); + + describe("bug: scoped npm package in extends field", () => { + const pkgEntryDir = path.resolve( + fixtureDir, + "tsconfig-paths", + "extends-pkg-entry" + ); + + it("should resolve paths inherited from a scoped npm package tsconfig", () => { + const resolver = makeTsconfigResolver( + path.join(pkgEntryDir, "tsconfig.json") + ); + const result = resolver.sync(pkgEntryDir, "@pkg/util"); + expect(result.path).toBe( + path.join( + pkgEntryDir, + "node_modules", + "@my-tsconfig", + "base", + "src", + "util.ts" + ) + ); + }); + }); + + describe("JSONC support (comments in tsconfig.json)", () => { + const jsoncExampleDir = path.resolve( + fixtureDir, + "tsconfig-paths", + "jsonc-comments" + ); + + it("should parse tsconfig.json with line comments", () => { + const resolver = makeTsconfigResolver( + path.join(jsoncExampleDir, "tsconfig.json") + ); + const result = resolver.sync(jsoncExampleDir, "@components/button"); + expect(result.path).toBe( + path.join(jsoncExampleDir, "src", "components", "button.ts") + ); + }); + + it("should parse tsconfig.json with block comments", () => { + const resolver = makeTsconfigResolver( + path.join(jsoncExampleDir, "tsconfig.json") + ); + const result = resolver.sync(jsoncExampleDir, "bar/index"); + expect(result.path).toBe( + path.join(jsoncExampleDir, "src", "mapped", "bar", "index.ts") + ); + }); + + it("should parse tsconfig.json with mixed comments", () => { + const resolver = makeTsconfigResolver( + path.join(jsoncExampleDir, "tsconfig.json") + ); + const result = resolver.sync(jsoncExampleDir, "foo"); + expect(result.path).toBe( + path.join(jsoncExampleDir, "src", "mapped", "foo", "index.ts") + ); + }); + }); +}); diff --git a/package.json b/package.json index 22a45398..aeac5258 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,9 @@ "build:binding:profiling": "napi build --platform --profile profiling --package-json-path npm/package.json --manifest-path napi/Cargo.toml", "build:binding:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", "prepublishOnly": "napi pre-publish -t npm --package-json-path npm/package.json --npm-dir bindings", - "test": "ava && node --test napi/tests/options.test.mjs", + "test": "npm run test:resolver && npm run test:enhanced-resolve-compatible", + "test:resolver": "rstest run -c rstest.config.resolver.mjs", + "test:enhanced-resolve-compatible": "rstest run -c rstest.config.mjs", "prettier": "prettier --check .", "prettier:ci": "prettier --list-different .", "format": "prettier --write .", @@ -16,12 +18,12 @@ }, "devDependencies": { "@actions/core": "^3.0.0", + "@rstest/core": "^0.8.1", "@continuous-auth/client": "^2.3.2", "@napi-rs/cli": "3.5.1", "@napi-rs/wasm-runtime": "^1.0.7", "@taplo/cli": "^0.7.0", "@types/node": "^24.0.0", - "ava": "^6.1.3", "commander": "^14.0.0", "emnapi": "^1.2.0", "enhanced-resolve": "^5.17.1", @@ -32,10 +34,6 @@ "typescript": "^5.5.3", "zx": "^8.8.5" }, - "ava": { - "files": ["napi/__test__/*.spec.mjs"], - "cache": false - }, "packageManager": "pnpm@10.28.2", "repository": { "type": "git", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 01280f15..62a715bb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -20,15 +20,15 @@ importers: '@napi-rs/wasm-runtime': specifier: ^1.0.7 version: 1.1.1 + '@rstest/core': + specifier: ^0.8.1 + version: 0.8.5 '@taplo/cli': specifier: ^0.7.0 version: 0.7.0 '@types/node': specifier: ^24.0.0 version: 24.10.1 - ava: - specifier: ^6.1.3 - version: 6.4.1 commander: specifier: ^14.0.0 version: 14.0.3 @@ -57,6 +57,30 @@ importers: specifier: ^8.8.5 version: 8.8.5 + bindings/darwin-arm64: {} + + bindings/darwin-x64: {} + + bindings/linux-arm64-gnu: {} + + bindings/linux-arm64-musl: {} + + bindings/linux-x64-gnu: {} + + bindings/linux-x64-musl: {} + + bindings/wasm32-wasi: + dependencies: + '@napi-rs/wasm-runtime': + specifier: ^1.1.1 + version: 1.1.1 + + bindings/win32-arm64-msvc: {} + + bindings/win32-ia32-msvc: {} + + bindings/win32-x64-msvc: {} + fixtures/pnpm: devDependencies: axios: @@ -271,18 +295,23 @@ packages: '@types/node': optional: true - '@isaacs/cliui@8.0.2': - resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} - engines: {node: '>=12'} + '@module-federation/error-codes@0.22.0': + resolution: {integrity: sha512-xF9SjnEy7vTdx+xekjPCV5cIHOGCkdn3pIxo9vU7gEZMIw0SvAEdsy6Uh17xaCpm8V0FWvR0SZoK9Ik6jGOaug==} - '@isaacs/fs-minipass@4.0.1': - resolution: {integrity: sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==} - engines: {node: '>=18.0.0'} + '@module-federation/runtime-core@0.22.0': + resolution: {integrity: sha512-GR1TcD6/s7zqItfhC87zAp30PqzvceoeDGYTgF3Vx2TXvsfDrhP6Qw9T4vudDQL3uJRne6t7CzdT29YyVxlgIA==} - '@mapbox/node-pre-gyp@2.0.0': - resolution: {integrity: sha512-llMXd39jtP0HpQLVI37Bf1m2ADlEb35GYSh1SDSLsBhR+5iCxiNGlT31yqbNtVHygHAtMy6dWFERpU2JgufhPg==} - engines: {node: '>=18'} - hasBin: true + '@module-federation/runtime-tools@0.22.0': + resolution: {integrity: sha512-4ScUJ/aUfEernb+4PbLdhM/c60VHl698Gn1gY21m9vyC1Ucn69fPCA1y2EwcCB7IItseRMoNhdcWQnzt/OPCNA==} + + '@module-federation/runtime@0.22.0': + resolution: {integrity: sha512-38g5iPju2tPC3KHMPxRKmy4k4onNp6ypFPS1eKGsNLUkXgHsPMBFqAjDw96iEcjri91BrahG4XcdyKi97xZzlA==} + + '@module-federation/sdk@0.22.0': + resolution: {integrity: sha512-x4aFNBKn2KVQRuNVC5A7SnrSCSqyfIWmm1DvubjbO9iKFe7ith5niw8dqSFBekYBg2Fwy+eMg4sEFNVvCAdo6g==} + + '@module-federation/webpack-bundler-runtime@0.22.0': + resolution: {integrity: sha512-aM8gCqXu+/4wBmJtVeMeeMN5guw3chf+2i6HajKtQv7SJfxV/f4IyNQJUeUQu9HfiAZHjqtMV5Lvq/Lvh8LdyA==} '@napi-rs/cli@3.5.1': resolution: {integrity: sha512-XBfLQRDcB3qhu6bazdMJsecWW55kR85l5/k0af9BIBELXQSsCFU0fzug7PX8eQp6vVdm7W/U3z6uP5WmITB2Gw==} @@ -546,6 +575,9 @@ packages: resolution: {integrity: sha512-7cmzIu+Vbupriudo7UudoMRH2OA3cTw67vva8MxeoAe5S7vPFI7z0vp0pMXiA25S8IUJefImQ90FeJjl8fjEaQ==} engines: {node: '>= 10'} + '@napi-rs/wasm-runtime@1.0.7': + resolution: {integrity: sha512-SeDnOO0Tk7Okiq6DbXmmBODgOAb9dp9gjlphokTUxmt8U3liIP1ZsozBahH69j/RJv+Rfs6IwUKHTgQYJ/HBAw==} + '@napi-rs/wasm-runtime@1.1.1': resolution: {integrity: sha512-p64ah1M1ld8xjWv3qbvFwHiFVWrq1yFvV4f7w+mzaqiR4IlSgkqhcRdHwsGgomwzBH51sRY4NEowLxnaBjcW/A==} @@ -634,18 +666,6 @@ packages: resolution: {integrity: sha512-enkZYyuCdo+9jneCPE/0fjIta4wWnvVN9hBo2HuiMpRF0q3lzv1J6b/cl7i0mxZUKhBrV3aCKDBQnCOhwKbPmQ==} engines: {node: '>= 10'} - '@nodelib/fs.scandir@2.1.5': - resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} - engines: {node: '>= 8'} - - '@nodelib/fs.stat@2.0.5': - resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} - engines: {node: '>= 8'} - - '@nodelib/fs.walk@1.2.8': - resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} - engines: {node: '>= 8'} - '@octokit/auth-token@6.0.0': resolution: {integrity: sha512-P4YJBPdPSpWTQ1NU4XYdvHvXJJDxM6YwpS0FZHRgP7YFkdVxsWcpWGy/NVqlAA7PcPCnMacXlRm1y2PFZRWL/w==} engines: {node: '>= 20'} @@ -698,22 +718,94 @@ packages: '@octokit/types@16.0.0': resolution: {integrity: sha512-sKq+9r1Mm4efXW1FCk7hFSeJo4QKreL/tTbR0rz/qx/r1Oa2VV83LTA/H/MuCOX7uCIJmQVRKBcbmWoySjAnSg==} - '@pkgjs/parseargs@0.11.0': - resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} - engines: {node: '>=14'} + '@rsbuild/core@1.7.3': + resolution: {integrity: sha512-kI1oQvCXbQYxUvQPnDLdjSX4gFsbrFNpuUj6jXEJ7IcJ74Q+n4oeFj74/8tKerhxhe0L90m/ZQfzLeN5ORGA9w==} + engines: {node: '>=18.12.0'} + hasBin: true - '@rollup/pluginutils@5.3.0': - resolution: {integrity: sha512-5EdhGZtnu3V88ces7s53hhfK5KSASnJZv8Lulpc04cWO3REESroJXg73DFsOmgbU2BhwV0E20bu2IDZb3VKW4Q==} - engines: {node: '>=14.0.0'} + '@rspack/binding-darwin-arm64@1.7.9': + resolution: {integrity: sha512-64dgstte0If5czi9bA/cpOe0ryY6wC9AIQRtyJ3DlOF6Tt+y9cKkmUoGu3V+WYaYIZRT7HNk8V7kL8amVjFTYw==} + cpu: [arm64] + os: [darwin] + + '@rspack/binding-darwin-x64@1.7.9': + resolution: {integrity: sha512-2QSLs3w4rLy4UUGVnIlkt6IlIKOzR1e0RPsq2FYQW6s3p9JrwRCtOeHohyh7EJSqF54dtfhe9UZSAwba3LqH1Q==} + cpu: [x64] + os: [darwin] + + '@rspack/binding-linux-arm64-gnu@1.7.9': + resolution: {integrity: sha512-qhUGI/uVfvLmKWts4QkVHGL8yfUyJkblZs+OFD5Upa2y676EOsbQgWsCwX4xGB6Tv+TOzFP0SLh/UfO8ZfdE+w==} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@rspack/binding-linux-arm64-musl@1.7.9': + resolution: {integrity: sha512-VjfmR1hgO9n3L6MaE5KG+DXSrrLVqHHOkVcOtS2LMq3bjMTwbBywY7ycymcLnX5KJsol8d3ZGYep6IfSOt3lFA==} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@rspack/binding-linux-x64-gnu@1.7.9': + resolution: {integrity: sha512-0kldV+3WTs/VYDWzxJ7K40hCW26IHtnk8xPK3whKoo1649rgeXXa0EdsU5P7hG8Ef5SWQjHHHZ/fuHYSO3Y6HA==} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@rspack/binding-linux-x64-musl@1.7.9': + resolution: {integrity: sha512-Gi4872cFtc2d83FKATR6Qcf2VBa/tFCqffI/IwRRl6Hx5FulEBqx+tH7gAuRVF693vrbXNxK+FQ+k4iEsEJxrw==} + cpu: [x64] + os: [linux] + libc: [musl] + + '@rspack/binding-wasm32-wasi@1.7.9': + resolution: {integrity: sha512-5QEzqo6EaolpuZmK6w/mgSueorgGnnzp7dJaAvBj6ECFIg/aLXhXXmWCWbxt7Ws2gKvG5/PgaxDqbUxYL51juA==} + cpu: [wasm32] + + '@rspack/binding-win32-arm64-msvc@1.7.9': + resolution: {integrity: sha512-MMqvcrIc8aOqTuHjWkjdzilvoZ3Hv07Od0Foogiyq3JMudsS3Wcmh7T1dFerGg19MOJcRUeEkrg2NQOMOQ6xDA==} + cpu: [arm64] + os: [win32] + + '@rspack/binding-win32-ia32-msvc@1.7.9': + resolution: {integrity: sha512-4kYYS+NZ2CuNbKjq40yB/UEyB51o1PHj5wpr+Y943oOJXpEKWU2Q4vkF8VEohPEcnA9cKVotYCnqStme+02suA==} + cpu: [ia32] + os: [win32] + + '@rspack/binding-win32-x64-msvc@1.7.9': + resolution: {integrity: sha512-1g+QyXXvs+838Un/4GaUvJfARDGHMCs15eXDYWBl5m/Skubyng8djWAgr6ag1+cVoJZXCPOvybTItcblWF3gbQ==} + cpu: [x64] + os: [win32] + + '@rspack/binding@1.7.9': + resolution: {integrity: sha512-A56e0NdfNwbOSJoilMkxzaPuVYaKCNn1shuiwWnCIBmhV9ix1n9S1XvquDjkGyv+gCdR1+zfJBOa5DMB7htLHw==} + + '@rspack/core@1.7.9': + resolution: {integrity: sha512-VHuSKvRkuv42Ya+TxEGO0LE0r9+8P4tKGokmomj4R1f/Nu2vtS3yoaIMfC4fR6VuHGd3MZ+KTI0cNNwHfFcskw==} + engines: {node: '>=18.12.0'} peerDependencies: - rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 + '@swc/helpers': '>=0.5.1' peerDependenciesMeta: - rollup: + '@swc/helpers': optional: true - '@sindresorhus/merge-streams@2.3.0': - resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==} - engines: {node: '>=18'} + '@rspack/lite-tapable@1.1.0': + resolution: {integrity: sha512-E2B0JhYFmVAwdDiG14+DW0Di4Ze4Jg10Pc4/lILUrd5DRCaklduz2OvJ5HYQ6G+hd+WTzqQb3QnDNfK4yvAFYw==} + + '@rstest/core@0.8.5': + resolution: {integrity: sha512-4E9pXpy2Jxy1+J4mqGnsVQn7gVnkIv2lA7AbwAY0Zy90jJo+YCchpTGosba/jhBJJhETRAr3GIkPUECxFoyQ9A==} + engines: {node: '>=18.12.0'} + hasBin: true + peerDependencies: + happy-dom: '*' + jsdom: '*' + peerDependenciesMeta: + happy-dom: + optional: true + jsdom: + optional: true + + '@swc/helpers@0.5.19': + resolution: {integrity: sha512-QamiFeIK3txNjgUTNppE6MiG3p7TdninpZu0E0PbqVh1a9FNLT2FRhisaa4NcaX52XVhA5l7Pk58Ft7Sqi/2sA==} '@taplo/cli@0.7.0': resolution: {integrity: sha512-Ck3zFhQhIhi02Hl6T4ZmJsXdnJE+wXcJz5f8klxd4keRYgenMnip3JDPMGDRLbnC/2iGd8P0sBIQqI3KxfVjBg==} @@ -722,8 +814,11 @@ packages: '@tybys/wasm-util@0.10.1': resolution: {integrity: sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==} - '@types/estree@1.0.8': - resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==} + '@types/chai@5.2.3': + resolution: {integrity: sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==} + + '@types/deep-eql@4.0.2': + resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==} '@types/node@24.10.1': resolution: {integrity: sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==} @@ -731,105 +826,34 @@ packages: '@types/stylis@4.2.7': resolution: {integrity: sha512-VgDNokpBoKF+wrdvhAAfS55OMQpL6QRglwTwNC3kIgBrzZxA4WsFj+2eLfEA/uMUDzBcEhYmjSbwQakn/i3ajA==} - '@vercel/nft@0.29.4': - resolution: {integrity: sha512-6lLqMNX3TuycBPABycx7A9F1bHQR7kiQln6abjFbPrf5C/05qHM9M5E4PeTE59c7z8g6vHnx1Ioihb2AQl7BTA==} - engines: {node: '>=18'} - hasBin: true - - abbrev@3.0.1: - resolution: {integrity: sha512-AO2ac6pjRB3SJmGJo+v5/aK6Omggp6fsLrs6wN9bd35ulu4cCwaAU9+7ZhXjeqHVkaHThLuzH0nZr0YpCDhygg==} - engines: {node: ^18.17.0 || >=20.5.0} - - acorn-import-attributes@1.9.5: - resolution: {integrity: sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==} - peerDependencies: - acorn: ^8 - - acorn-walk@8.3.4: - resolution: {integrity: sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==} - engines: {node: '>=0.4.0'} - - acorn@8.15.0: - resolution: {integrity: sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==} - engines: {node: '>=0.4.0'} - hasBin: true - - agent-base@7.1.4: - resolution: {integrity: sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==} - engines: {node: '>= 14'} - ansi-escapes@7.2.0: resolution: {integrity: sha512-g6LhBsl+GBPRWGWsBtutpzBYuIIdBkLEvad5C/va/74Db018+5TZiyA26cZJAr3Rft5lprVqOIPxf5Vid6tqAw==} engines: {node: '>=18'} - ansi-regex@5.0.1: - resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} - engines: {node: '>=8'} - ansi-regex@6.2.2: resolution: {integrity: sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==} engines: {node: '>=12'} - ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} - ansi-styles@6.2.3: resolution: {integrity: sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==} engines: {node: '>=12'} - argparse@1.0.10: - resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} - argparse@2.0.1: resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - array-find-index@1.0.2: - resolution: {integrity: sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==} - engines: {node: '>=0.10.0'} - - arrgv@1.0.2: - resolution: {integrity: sha512-a4eg4yhp7mmruZDQFqVMlxNRFGi/i1r87pt8SDHy0/I8PqSXoUTlWZRdAZo0VXgvEARcujbtTk8kiZRi1uDGRw==} - engines: {node: '>=8.0.0'} - - arrify@3.0.0: - resolution: {integrity: sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==} + assertion-error@2.0.1: + resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} engines: {node: '>=12'} - async-sema@3.1.1: - resolution: {integrity: sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==} - asynckit@0.4.0: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - ava@6.4.1: - resolution: {integrity: sha512-vxmPbi1gZx9zhAjHBgw81w/iEDKcrokeRk/fqDTyA2DQygZ0o+dUGRHFOtX8RA5N0heGJTTsIk7+xYxitDb61Q==} - engines: {node: ^18.18 || ^20.8 || ^22 || ^23 || >=24} - hasBin: true - peerDependencies: - '@ava/typescript': '*' - peerDependenciesMeta: - '@ava/typescript': - optional: true - axios@1.6.2: resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - before-after-hook@4.0.0: resolution: {integrity: sha512-q6tR3RPqIB1pMiTRMFcZwuG5T8vwp+vUvEG0vuI6B+Rikh5BfPp2fQ82c925FOs+b0lcFQ8CFrL+KbilfZFhOQ==} - bindings@1.5.0: - resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} - - blueimp-md5@2.19.0: - resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==} - - brace-expansion@2.0.2: - resolution: {integrity: sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==} - braces@3.0.3: resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} engines: {node: '>=8'} @@ -838,46 +862,16 @@ packages: resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==} engines: {node: '>= 0.4'} - callsites@4.2.0: - resolution: {integrity: sha512-kfzR4zzQtAE9PC7CzZsjl3aBNbXWuXiSeOCdLcPpBfGW8YuCqQHcRPFDbr/BPVmd3EEPVpuFzLyuT/cUhPr4OQ==} - engines: {node: '>=12.20'} - camelize@1.0.1: resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - cbor@10.0.11: - resolution: {integrity: sha512-vIwORDd/WyB8Nc23o2zNN5RrtFGlR6Fca61TtjkUXueI3Jf2DOZDl1zsshvBntZ3wZHBM9ztjnkXSmzQDaq3WA==} - engines: {node: '>=20'} - - chalk@5.6.2: - resolution: {integrity: sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - chardet@2.1.1: resolution: {integrity: sha512-PsezH1rqdV9VvyNhxxOW32/d75r01NY7TQCmOqomRo15ZSOKbpTFVsfjghxo6JloQUCGnH4k1LGu0R4yCLlWQQ==} - chownr@3.0.0: - resolution: {integrity: sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==} - engines: {node: '>=18'} - - chunkd@2.0.1: - resolution: {integrity: sha512-7d58XsFmOq0j6el67Ug9mHf9ELUXsQXYJBkyxhH/k+6Ke0qXRnv0kbemx+Twc6fRJ07C49lcbdgm9FL1Ei/6SQ==} - - ci-info@4.3.1: - resolution: {integrity: sha512-Wdy2Igu8OcBpI2pZePZ5oWjPC38tmDVx5WKUXKwlLYkA0ozo85sLsLvkBbBn/sZaSCMFOGZJ14fvW9t5/d7kdA==} - engines: {node: '>=8'} - - ci-parallel-vars@1.0.1: - resolution: {integrity: sha512-uvzpYrpmidaoxvIQHM+rKSrigjOe9feHYbw4uOI2gdfe1C3xIlxO+kVXq83WQWNniTf8bAxVpy+cQeFQsMERKg==} - cli-cursor@5.0.0: resolution: {integrity: sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==} engines: {node: '>=18'} - cli-truncate@4.0.0: - resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} - engines: {node: '>=18'} - cli-truncate@5.1.1: resolution: {integrity: sha512-SroPvNHxUnk+vIW/dOSfNqdy1sPEFkrTk6TUtqLCnBlo3N7TNYYkzzN7uSD6+jVjrdO4+p8nH7JzH6cIvUem6A==} engines: {node: '>=20'} @@ -891,21 +885,6 @@ packages: peerDependencies: typanion: '*' - cliui@8.0.1: - resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} - engines: {node: '>=12'} - - code-excerpt@4.0.0: - resolution: {integrity: sha512-xxodCmBen3iy2i0WtAK8FlFNrRzjUqjRsMfho58xT/wvZU1YTM3fCnRjcy1gJPMepaRlgm/0e6w8SpWHpn3/cA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} - - color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - colorette@2.0.20: resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} @@ -917,27 +896,11 @@ packages: resolution: {integrity: sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw==} engines: {node: '>=20'} - common-path-prefix@3.0.0: - resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} - complex.js@2.4.2: resolution: {integrity: sha512-qtx7HRhPGSCBtGiST4/WGHuW+zeaND/6Ld+db6PbrulIB1i2Ev/2UPiqcmpQNPSyfBKraC0EOvOKCB5dGZKt3g==} - concordance@5.0.4: - resolution: {integrity: sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==} - engines: {node: '>=10.18.0 <11 || >=12.14.0 <13 || >=14'} - - consola@3.4.2: - resolution: {integrity: sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==} - engines: {node: ^14.18.0 || >=16.10.0} - - convert-to-spaces@2.0.1: - resolution: {integrity: sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - cross-spawn@7.0.6: - resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} - engines: {node: '>= 8'} + core-js@3.47.0: + resolution: {integrity: sha512-c3Q2VVkGAUyupsjRnaNX6u8Dq2vAdzm9iuPj5FW0fRxzlxgq9Q39MDq10IvmQSpLgHQNyQzQmOo6bgGHmH3NNg==} css-color-keywords@1.0.0: resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} @@ -949,14 +912,6 @@ packages: csstype@3.1.3: resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} - currently-unhandled@0.4.1: - resolution: {integrity: sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng==} - engines: {node: '>=0.10.0'} - - date-time@3.1.0: - resolution: {integrity: sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==} - engines: {node: '>=6'} - debug@4.4.1: resolution: {integrity: sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==} engines: {node: '>=6.0'} @@ -973,21 +928,10 @@ packages: resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} engines: {node: '>=0.4.0'} - detect-libc@2.0.3: - resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} - engines: {node: '>=8'} - dunder-proto@1.0.1: resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==} engines: {node: '>= 0.4'} - eastasianwidth@0.2.0: - resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} - - emittery@1.2.0: - resolution: {integrity: sha512-KxdRyyFcS85pH3dnU8Y5yFUm2YJdaHwcBZWrfG8o89ZY9a13/f9itbN+YG3ELbBo9Pg5zvIozstmuV8bX13q6g==} - engines: {node: '>=14.16'} - emnapi@1.8.1: resolution: {integrity: sha512-34i2BbgHx1LnEO4JCGQYo6h6s4e4KrdWtdTHfllBNLbXSHPmdIHplxKejfabsRK+ukNciqVdalB+fxMibqHdaQ==} peerDependencies: @@ -999,12 +943,6 @@ packages: emoji-regex@10.3.0: resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==} - emoji-regex@8.0.0: - resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - - emoji-regex@9.2.2: - resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} - enhanced-resolve@5.19.0: resolution: {integrity: sha512-phv3E1Xl4tQOShqSte26C7Fl84EwUdZsyOuSSk9qtAGyyQs2s3jJzComh+Abf4g187lUUAvH+H26omrqia2aGg==} engines: {node: '>=10.13.0'} @@ -1032,64 +970,19 @@ packages: es-toolkit@1.42.0: resolution: {integrity: sha512-SLHIyY7VfDJBM8clz4+T2oquwTQxEzu263AyhVK4jREOAwJ+8eebaa4wM3nlvnAqhDrMm2EsA6hWHaQsMPQ1nA==} - escalade@3.1.2: - resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} - engines: {node: '>=6'} - escape-latex@1.2.0: resolution: {integrity: sha512-nV5aVWW1K0wEiUIEdZ4erkGGH8mDxGyxSeqPzRNtWP7ataw+/olFObw7hujFWlVjNsaDFw5VZ5NzVSIqRgfTiw==} - escape-string-regexp@2.0.0: - resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} - engines: {node: '>=8'} - - escape-string-regexp@5.0.0: - resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} - engines: {node: '>=12'} - - esprima@4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} - engines: {node: '>=4'} - hasBin: true - - estree-walker@2.0.2: - resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - - esutils@2.0.3: - resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} - engines: {node: '>=0.10.0'} - eventemitter3@5.0.1: resolution: {integrity: sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==} fast-content-type-parse@3.0.0: resolution: {integrity: sha512-ZvLdcY8P+N8mGQJahJV5G4U88CSvT1rP8ApL6uETe88MBXrBHAkZlSEySdUlyztF7ccb+Znos3TFqaepHxdhBg==} - fast-diff@1.3.0: - resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} - - fast-glob@3.3.3: - resolution: {integrity: sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==} - engines: {node: '>=8.6.0'} - - fastq@1.17.1: - resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} - - figures@6.1.0: - resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==} - engines: {node: '>=18'} - - file-uri-to-path@1.0.0: - resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} - fill-range@7.1.1: resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} engines: {node: '>=8'} - find-up-simple@1.0.0: - resolution: {integrity: sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==} - engines: {node: '>=18'} - follow-redirects@1.15.9: resolution: {integrity: sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==} engines: {node: '>=4.0'} @@ -1099,10 +992,6 @@ packages: debug: optional: true - foreground-child@3.3.1: - resolution: {integrity: sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==} - engines: {node: '>=14'} - form-data@4.0.2: resolution: {integrity: sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==} engines: {node: '>= 6'} @@ -1113,10 +1002,6 @@ packages: function-bind@1.1.2: resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} - get-caller-file@2.0.5: - resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} - engines: {node: 6.* || 8.* || >= 10.*} - get-east-asian-width@1.4.0: resolution: {integrity: sha512-QZjmEOC+IT1uk6Rx0sX22V6uHWVwbdbxf1faPqJ1QhLdGgsRGCZoyaQBm/piRdJy/D2um6hM1UP7ZEeQ4EkP+Q==} engines: {node: '>=18'} @@ -1129,19 +1014,6 @@ packages: resolution: {integrity: sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==} engines: {node: '>= 0.4'} - glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} - - glob@10.5.0: - resolution: {integrity: sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==} - deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me - hasBin: true - - globby@14.1.0: - resolution: {integrity: sha512-0Ia46fDOaT7k4og1PDW4YbodWWr3scS2vAr2lTbsplOt2WkKp0vQbkI9wKis/T5LV/dqPjO3bpS/z6GTJB82LA==} - engines: {node: '>=18'} - gopd@1.2.0: resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==} engines: {node: '>= 0.4'} @@ -1161,10 +1033,6 @@ packages: resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} engines: {node: '>= 0.4'} - https-proxy-agent@7.0.6: - resolution: {integrity: sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==} - engines: {node: '>= 14'} - husky@9.1.7: resolution: {integrity: sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==} engines: {node: '>=18'} @@ -1174,85 +1042,28 @@ packages: resolution: {integrity: sha512-cf6L2Ds3h57VVmkZe+Pn+5APsT7FpqJtEhhieDCvrE2MK5Qk9MyffgQyuxQTm6BChfeZNtcOLHp9IcWRVcIcBQ==} engines: {node: '>=0.10.0'} - ignore-by-default@2.1.0: - resolution: {integrity: sha512-yiWd4GVmJp0Q6ghmM2B/V3oZGRmjrKLXvHR3TE1nfoXsmoggllfZUQe74EN0fJdPFZu2NIvNdrMMLm3OsV7Ohw==} - engines: {node: '>=10 <11 || >=12 <13 || >=14'} - - ignore@7.0.5: - resolution: {integrity: sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==} - engines: {node: '>= 4'} - - imurmurhash@0.1.4: - resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} - engines: {node: '>=0.8.19'} - - indent-string@5.0.0: - resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==} - engines: {node: '>=12'} - ipaddr.js@2.2.0: resolution: {integrity: sha512-Ag3wB2o37wslZS19hZqorUnrnzSkpOVy+IiiDEiTqNubEYpYuHWIf6K4psgN2ZWKExS4xhVCrRVfb/wfW8fWJA==} engines: {node: '>= 10'} - irregular-plurals@3.5.0: - resolution: {integrity: sha512-1ANGLZ+Nkv1ptFb2pa8oG8Lem4krflKuX/gINiHJHjJUKaJHk/SXk5x6K3J+39/p0h1RQ2saROclJJ+QLvETCQ==} - engines: {node: '>=8'} - - is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} - - is-fullwidth-code-point@3.0.0: - resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} - engines: {node: '>=8'} - - is-fullwidth-code-point@4.0.0: - resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} - engines: {node: '>=12'} - is-fullwidth-code-point@5.1.0: resolution: {integrity: sha512-5XHYaSyiqADb4RnZ1Bdad6cPp8Toise4TzEjcOYDHZkTCbKgiUl7WTUCpNWHuxmDt91wnsZBc9xinNzopv3JMQ==} engines: {node: '>=18'} - is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} - is-number@7.0.0: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} - is-plain-object@5.0.0: - resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} - engines: {node: '>=0.10.0'} - - is-promise@4.0.0: - resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==} - - is-unicode-supported@2.0.0: - resolution: {integrity: sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==} - engines: {node: '>=18'} - - isexe@2.0.0: - resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} - - jackspeak@3.4.3: - resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==} - javascript-natural-sort@0.7.1: resolution: {integrity: sha512-nO6jcEfZWQXDhOiBtG2KvKyEptz7RVbpGP4vTD2hLBdmNQSsCiicO2Ioinv6UI4y9ukqnBpy+XZ9H6uLNgJTlw==} - js-string-escape@1.0.1: - resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==} - engines: {node: '>= 0.8'} + jiti@2.6.1: + resolution: {integrity: sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ==} + hasBin: true js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - js-yaml@3.14.1: - resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} - hasBin: true - js-yaml@4.1.0: resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} hasBin: true @@ -1266,13 +1077,6 @@ packages: resolution: {integrity: sha512-ME4Fb83LgEgwNw96RKNvKV4VTLuXfoKudAmm2lP8Kk87KaMK0/Xrx/aAkMWmT8mDb+3MlFDspfbCs7adjRxA2g==} engines: {node: '>=20.0.0'} - load-json-file@7.0.1: - resolution: {integrity: sha512-Gnxj3ev3mB5TkVBGad0JM6dmLiQL+o0t23JPBZ9sd+yvSLk05mFoqKBw5N8gbbkU4TNXyqCgIrl/VM17OgUIgQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - lodash@4.17.21: - resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - log-update@6.1.0: resolution: {integrity: sha512-9ie8ItPR6tjY5uYJh8K/Zrv/RMZ5VOlOWvtZdEHYSTFKZfIBPQa9tOAEeAWhd+AnIneLJ22w5fjOYtoutpWq5w==} engines: {node: '>=18'} @@ -1281,13 +1085,6 @@ packages: resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} hasBin: true - lru-cache@10.4.3: - resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} - - matcher@5.0.0: - resolution: {integrity: sha512-s2EMBOWtXFc8dgqvoAzKJXxNHibcdJMV0gwqKUaw9E2JBJuGUK7DrNKrA6g/i+v72TT16+6sVm5mS3thaMLQUw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - math-intrinsics@1.1.0: resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==} engines: {node: '>= 0.4'} @@ -1297,18 +1094,6 @@ packages: engines: {node: '>= 18'} hasBin: true - md5-hex@3.0.1: - resolution: {integrity: sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==} - engines: {node: '>=8'} - - memoize@10.2.0: - resolution: {integrity: sha512-DeC6b7QBrZsRs3Y02A6A7lQyzFbsQbqgjI6UW0GigGWV+u1s25TycMr0XHZE4cJce7rY/vyw2ctMQqfDkIhUEA==} - engines: {node: '>=18'} - - merge2@1.4.1: - resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} - engines: {node: '>= 8'} - micromatch@4.0.8: resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} engines: {node: '>=8.6'} @@ -1325,18 +1110,6 @@ packages: resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} engines: {node: '>=18'} - minimatch@9.0.5: - resolution: {integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==} - engines: {node: '>=16 || 14 >=14.17'} - - minipass@7.1.2: - resolution: {integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==} - engines: {node: '>=16 || 14 >=14.17'} - - minizlib@3.1.0: - resolution: {integrity: sha512-KZxYo1BUkWD2TVFLr0MQoM8vUUigWD3LlD83a/75BqC+4qE0Hb1Vo5v1FgcfaNXvfXzr+5EhQ6ing/CaBijTlw==} - engines: {node: '>= 18'} - ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} @@ -1353,28 +1126,6 @@ packages: engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true - node-fetch@2.7.0: - resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - - node-gyp-build@4.8.1: - resolution: {integrity: sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw==} - hasBin: true - - nofilter@3.1.0: - resolution: {integrity: sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==} - engines: {node: '>=12.19'} - - nopt@8.1.0: - resolution: {integrity: sha512-ieGu42u/Qsa4TFktmaKEwM6MQH0pOWnaB3htzh0JRtx84+Mebc0cbZYN5bC+6WTZ4+77xrL9Pn5m7CV6VIkV7A==} - engines: {node: ^18.17.0 || >=20.5.0} - hasBin: true - obug@2.1.1: resolution: {integrity: sha512-uTqF9MuPraAQ+IsnPf366RG4cP9RtUi7MLO1N3KEc+wb0a6yKpeL0lmk2IB1jY5KHPAlTc6T/JRdC/YqxHNwkQ==} @@ -1382,33 +1133,6 @@ packages: resolution: {integrity: sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==} engines: {node: '>=18'} - p-map@7.0.4: - resolution: {integrity: sha512-tkAQEw8ysMzmkhgw8k+1U/iPhWNhykKnSk4Rd5zLoPJCuJaGRPo6YposrZgaxHKzDHdDWWZvE/Sk7hsL2X/CpQ==} - engines: {node: '>=18'} - - package-config@5.0.0: - resolution: {integrity: sha512-GYTTew2slBcYdvRHqjhwaaydVMvn/qrGC323+nKclYioNSLTDUM/lGgtGTgyHVtYcozb+XkE8CNhwcraOmZ9Mg==} - engines: {node: '>=18'} - - package-json-from-dist@1.0.1: - resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==} - - parse-ms@4.0.0: - resolution: {integrity: sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==} - engines: {node: '>=18'} - - path-key@3.1.1: - resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} - engines: {node: '>=8'} - - path-scurry@1.11.1: - resolution: {integrity: sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==} - engines: {node: '>=16 || 14 >=14.18'} - - path-type@6.0.0: - resolution: {integrity: sha512-Vj7sf++t5pBD637NSfkxpHSMfWaeig5+DKWLhcqIYx6mWQz5hdJTGDVMQiJcw1ZYkhs7AazKDGpRVji1LJCZUQ==} - engines: {node: '>=18'} - picocolors@1.1.1: resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} @@ -1416,19 +1140,11 @@ packages: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} - picomatch@4.0.3: - resolution: {integrity: sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==} - engines: {node: '>=12'} - pidtree@0.6.0: resolution: {integrity: sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==} engines: {node: '>=0.10'} hasBin: true - plur@5.1.0: - resolution: {integrity: sha512-VP/72JeXqak2KiOzjgKtQen5y3IZHn+9GOuLDafPv0eXa47xq0At93XahYBs26MsifCQ4enGKwbjBTKgb9QJXg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - postcss-value-parser@4.2.0: resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} @@ -1441,16 +1157,9 @@ packages: engines: {node: '>=14'} hasBin: true - pretty-ms@9.3.0: - resolution: {integrity: sha512-gjVS5hOP+M3wMm5nmNOucbIrqudzs9v/57bWRHQWLYklXqoXKrVfYW2W9+glfGsqtPgpiz5WwyEEB+ksXIx3gQ==} - engines: {node: '>=18'} - proxy-from-env@1.1.0: resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - queue-microtask@1.2.3: - resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - react-dom@19.1.0: resolution: {integrity: sha512-Xs1hdnE+DyKgeHJeJznQmYMIBG3TKIHJJT95Q58nHLSrElKlGQqDTR2HQ9fx5CN/Gk6Vh/kupBTDLU11/nDk/g==} peerDependencies: @@ -1463,32 +1172,13 @@ packages: regenerator-runtime@0.14.1: resolution: {integrity: sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==} - require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} - - resolve-cwd@3.0.0: - resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} - engines: {node: '>=8'} - - resolve-from@5.0.0: - resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} - engines: {node: '>=8'} - restore-cursor@5.1.0: resolution: {integrity: sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==} engines: {node: '>=18'} - reusify@1.0.4: - resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - rfdc@1.4.1: resolution: {integrity: sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==} - run-parallel@1.2.0: - resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} - safer-buffer@2.1.2: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} @@ -1503,33 +1193,13 @@ packages: engines: {node: '>=10'} hasBin: true - serialize-error@7.0.1: - resolution: {integrity: sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==} - engines: {node: '>=10'} - shallowequal@1.1.0: resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - shebang-command@2.0.0: - resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} - engines: {node: '>=8'} - - shebang-regex@3.0.0: - resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} - engines: {node: '>=8'} - signal-exit@4.1.0: resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} engines: {node: '>=14'} - slash@5.1.0: - resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==} - engines: {node: '>=14.16'} - - slice-ansi@5.0.0: - resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} - engines: {node: '>=12'} - slice-ansi@7.1.2: resolution: {integrity: sha512-iOBWFgUX7caIZiuutICxVgX1SdxwAVFFKwt1EvMYYec/NWO5meOJ6K5uQxhrYBdQJne4KxiqZc+KptFOWFSI9w==} engines: {node: '>=18'} @@ -1538,25 +1208,10 @@ packages: resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} engines: {node: '>=0.10.0'} - sprintf-js@1.0.3: - resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - - stack-utils@2.0.6: - resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} - engines: {node: '>=10'} - string-argv@0.3.2: resolution: {integrity: sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==} engines: {node: '>=0.6.19'} - string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} - - string-width@5.1.2: - resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==} - engines: {node: '>=12'} - string-width@7.2.0: resolution: {integrity: sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==} engines: {node: '>=18'} @@ -1565,10 +1220,6 @@ packages: resolution: {integrity: sha512-Kxl3KJGb/gxkaUMOjRsQ8IrXiGW75O4E3RPjFIINOVH8AMl2SQ/yWdTzWwF3FevIX9LcMAjJW+GRwAlAbTSXdg==} engines: {node: '>=20'} - strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} - engines: {node: '>=8'} - strip-ansi@7.1.2: resolution: {integrity: sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==} engines: {node: '>=12'} @@ -1583,37 +1234,21 @@ packages: stylis@4.3.6: resolution: {integrity: sha512-yQ3rwFWRfwNUY7H5vpU0wfdkNSnvnJinhF9830Swlaxl03zsOjCfmX0ugac+3LtK0lYSgwL/KXc8oYL3mG4YFQ==} - supertap@3.0.1: - resolution: {integrity: sha512-u1ZpIBCawJnO+0QePsEiOknOfCRq0yERxiAchT0i4li0WHNUJbf0evXXSXOcCAR4M8iMDoajXYmstm/qO81Isw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - tapable@2.3.0: resolution: {integrity: sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg==} engines: {node: '>=6'} - tar@7.5.2: - resolution: {integrity: sha512-7NyxrTE4Anh8km8iEy7o0QYPs+0JKBTj5ZaqHg6B39erLg0qYXN3BijtShwbsNSvQ+LN75+KV+C4QR/f6Gwnpg==} - engines: {node: '>=18'} - deprecated: Old versions of tar are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me + tiny-emitter@2.1.0: + resolution: {integrity: sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==} - temp-dir@3.0.0: - resolution: {integrity: sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==} - engines: {node: '>=14.16'} - - time-zone@1.0.0: - resolution: {integrity: sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==} - engines: {node: '>=4'} - - tiny-emitter@2.1.0: - resolution: {integrity: sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==} + tinypool@1.1.1: + resolution: {integrity: sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==} + engines: {node: ^18.0.0 || >=20.0.0} to-regex-range@5.0.1: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} - tr46@0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - tslib@2.8.1: resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} @@ -1624,10 +1259,6 @@ packages: typanion@3.14.0: resolution: {integrity: sha512-ZW/lVMRabETuYCd9O9ZvMhAh8GslSqaUjxmK/JLPCh6l73CvLBiuXswj/+7LdnWOgYsQ130FqLzFz5aGT4I3Ug==} - type-fest@0.13.1: - resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} - engines: {node: '>=10'} - typed-function@4.2.1: resolution: {integrity: sha512-EGjWssW7Tsk4DGfE+5yluuljS1OGYWiI1J6e8puZz9nTMM51Oug8CD5Zo4gWMsOhq5BI+1bF+rWTm4Vbj3ivRA==} engines: {node: '>= 18'} @@ -1644,65 +1275,18 @@ packages: resolution: {integrity: sha512-VfQPToRA5FZs/qJxLIinmU59u0r7LXqoJkCzinq3ckNJp3vKEh7jTWN589YQ5+aoAC/TGRLyJLCPKcLQbM8r9g==} engines: {node: '>=18.17'} - unicorn-magic@0.3.0: - resolution: {integrity: sha512-+QBBXBCvifc56fsbuxZQ6Sic3wqqc3WWaqxs58gvJrcOuN83HGTCwz3oS5phzU9LthRNE9VrJCFCLUgHeeFnfA==} - engines: {node: '>=18'} - universal-user-agent@7.0.2: resolution: {integrity: sha512-0JCqzSKnStlRRQfCdowvqy3cy0Dvtlb8xecj/H8JFZuCze4rwjPZQOgvFvn0Ws/usCHQFGpyr+pB9adaGwXn4Q==} - webidl-conversions@3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - - well-known-symbols@2.0.0: - resolution: {integrity: sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==} - engines: {node: '>=6'} - - whatwg-url@5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - - which@2.0.2: - resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} - engines: {node: '>= 8'} - hasBin: true - - wrap-ansi@7.0.0: - resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} - engines: {node: '>=10'} - - wrap-ansi@8.1.0: - resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==} - engines: {node: '>=12'} - wrap-ansi@9.0.2: resolution: {integrity: sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==} engines: {node: '>=18'} - write-file-atomic@6.0.0: - resolution: {integrity: sha512-GmqrO8WJ1NuzJ2DrziEI2o57jKAVIQNf8a18W3nCYU3H7PNWqCCVTeH6/NQE93CIllIgQS98rrmVkYgTX9fFJQ==} - engines: {node: ^18.17.0 || >=20.5.0} - - y18n@5.0.8: - resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} - engines: {node: '>=10'} - - yallist@5.0.0: - resolution: {integrity: sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==} - engines: {node: '>=18'} - yaml@2.8.1: resolution: {integrity: sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw==} engines: {node: '>= 14.6'} hasBin: true - yargs-parser@21.1.1: - resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} - engines: {node: '>=12'} - - yargs@17.7.2: - resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} - engines: {node: '>=12'} - zx@8.8.5: resolution: {integrity: sha512-SNgDF5L0gfN7FwVOdEFguY3orU5AkfFZm9B5YSHog/UDHv+lvmd82ZAsOenOkQixigwH2+yyH198AwNdKhj+RA==} engines: {node: '>= 12.17.0'} @@ -1876,31 +1460,30 @@ snapshots: optionalDependencies: '@types/node': 24.10.1 - '@isaacs/cliui@8.0.2': + '@module-federation/error-codes@0.22.0': {} + + '@module-federation/runtime-core@0.22.0': dependencies: - string-width: 5.1.2 - string-width-cjs: string-width@4.2.3 - strip-ansi: 7.1.2 - strip-ansi-cjs: strip-ansi@6.0.1 - wrap-ansi: 8.1.0 - wrap-ansi-cjs: wrap-ansi@7.0.0 + '@module-federation/error-codes': 0.22.0 + '@module-federation/sdk': 0.22.0 - '@isaacs/fs-minipass@4.0.1': + '@module-federation/runtime-tools@0.22.0': dependencies: - minipass: 7.1.2 + '@module-federation/runtime': 0.22.0 + '@module-federation/webpack-bundler-runtime': 0.22.0 - '@mapbox/node-pre-gyp@2.0.0': + '@module-federation/runtime@0.22.0': dependencies: - consola: 3.4.2 - detect-libc: 2.0.3 - https-proxy-agent: 7.0.6 - node-fetch: 2.7.0 - nopt: 8.1.0 - semver: 7.7.4 - tar: 7.5.2 - transitivePeerDependencies: - - encoding - - supports-color + '@module-federation/error-codes': 0.22.0 + '@module-federation/runtime-core': 0.22.0 + '@module-federation/sdk': 0.22.0 + + '@module-federation/sdk@0.22.0': {} + + '@module-federation/webpack-bundler-runtime@0.22.0': + dependencies: + '@module-federation/runtime': 0.22.0 + '@module-federation/sdk': 0.22.0 '@napi-rs/cli@3.5.1(@emnapi/runtime@1.8.1)(@types/node@24.10.1)': dependencies: @@ -2083,6 +1666,13 @@ snapshots: '@napi-rs/tar-win32-ia32-msvc': 1.1.0 '@napi-rs/tar-win32-x64-msvc': 1.1.0 + '@napi-rs/wasm-runtime@1.0.7': + dependencies: + '@emnapi/core': 1.8.1 + '@emnapi/runtime': 1.8.1 + '@tybys/wasm-util': 0.10.1 + optional: true + '@napi-rs/wasm-runtime@1.1.1': dependencies: '@emnapi/core': 1.8.1 @@ -2146,18 +1736,6 @@ snapshots: '@napi-rs/wasm-tools-win32-ia32-msvc': 1.0.1 '@napi-rs/wasm-tools-win32-x64-msvc': 1.0.1 - '@nodelib/fs.scandir@2.1.5': - dependencies: - '@nodelib/fs.stat': 2.0.5 - run-parallel: 1.2.0 - - '@nodelib/fs.stat@2.0.5': {} - - '@nodelib/fs.walk@1.2.8': - dependencies: - '@nodelib/fs.scandir': 2.1.5 - fastq: 1.17.1 - '@octokit/auth-token@6.0.0': {} '@octokit/core@7.0.6': @@ -2220,141 +1798,112 @@ snapshots: dependencies: '@octokit/openapi-types': 27.0.0 - '@pkgjs/parseargs@0.11.0': + '@rsbuild/core@1.7.3': + dependencies: + '@rspack/core': 1.7.9(@swc/helpers@0.5.19) + '@rspack/lite-tapable': 1.1.0 + '@swc/helpers': 0.5.19 + core-js: 3.47.0 + jiti: 2.6.1 + + '@rspack/binding-darwin-arm64@1.7.9': optional: true - '@rollup/pluginutils@5.3.0': - dependencies: - '@types/estree': 1.0.8 - estree-walker: 2.0.2 - picomatch: 4.0.3 + '@rspack/binding-darwin-x64@1.7.9': + optional: true - '@sindresorhus/merge-streams@2.3.0': {} + '@rspack/binding-linux-arm64-gnu@1.7.9': + optional: true - '@taplo/cli@0.7.0': {} + '@rspack/binding-linux-arm64-musl@1.7.9': + optional: true - '@tybys/wasm-util@0.10.1': - dependencies: - tslib: 2.8.1 + '@rspack/binding-linux-x64-gnu@1.7.9': + optional: true - '@types/estree@1.0.8': {} + '@rspack/binding-linux-x64-musl@1.7.9': + optional: true - '@types/node@24.10.1': + '@rspack/binding-wasm32-wasi@1.7.9': dependencies: - undici-types: 7.16.0 + '@napi-rs/wasm-runtime': 1.0.7 + optional: true - '@types/stylis@4.2.7': {} + '@rspack/binding-win32-arm64-msvc@1.7.9': + optional: true - '@vercel/nft@0.29.4': - dependencies: - '@mapbox/node-pre-gyp': 2.0.0 - '@rollup/pluginutils': 5.3.0 - acorn: 8.15.0 - acorn-import-attributes: 1.9.5(acorn@8.15.0) - async-sema: 3.1.1 - bindings: 1.5.0 - estree-walker: 2.0.2 - glob: 10.5.0 - graceful-fs: 4.2.11 - node-gyp-build: 4.8.1 - picomatch: 4.0.3 - resolve-from: 5.0.0 - transitivePeerDependencies: - - encoding - - rollup - - supports-color + '@rspack/binding-win32-ia32-msvc@1.7.9': + optional: true - abbrev@3.0.1: {} + '@rspack/binding-win32-x64-msvc@1.7.9': + optional: true - acorn-import-attributes@1.9.5(acorn@8.15.0): - dependencies: - acorn: 8.15.0 + '@rspack/binding@1.7.9': + optionalDependencies: + '@rspack/binding-darwin-arm64': 1.7.9 + '@rspack/binding-darwin-x64': 1.7.9 + '@rspack/binding-linux-arm64-gnu': 1.7.9 + '@rspack/binding-linux-arm64-musl': 1.7.9 + '@rspack/binding-linux-x64-gnu': 1.7.9 + '@rspack/binding-linux-x64-musl': 1.7.9 + '@rspack/binding-wasm32-wasi': 1.7.9 + '@rspack/binding-win32-arm64-msvc': 1.7.9 + '@rspack/binding-win32-ia32-msvc': 1.7.9 + '@rspack/binding-win32-x64-msvc': 1.7.9 + + '@rspack/core@1.7.9(@swc/helpers@0.5.19)': + dependencies: + '@module-federation/runtime-tools': 0.22.0 + '@rspack/binding': 1.7.9 + '@rspack/lite-tapable': 1.1.0 + optionalDependencies: + '@swc/helpers': 0.5.19 + + '@rspack/lite-tapable@1.1.0': {} - acorn-walk@8.3.4: + '@rstest/core@0.8.5': dependencies: - acorn: 8.15.0 + '@rsbuild/core': 1.7.3 + '@types/chai': 5.2.3 + tinypool: 1.1.1 - acorn@8.15.0: {} + '@swc/helpers@0.5.19': + dependencies: + tslib: 2.8.1 - agent-base@7.1.4: {} + '@taplo/cli@0.7.0': {} - ansi-escapes@7.2.0: + '@tybys/wasm-util@0.10.1': dependencies: - environment: 1.1.0 + tslib: 2.8.1 - ansi-regex@5.0.1: {} + '@types/chai@5.2.3': + dependencies: + '@types/deep-eql': 4.0.2 + assertion-error: 2.0.1 - ansi-regex@6.2.2: {} + '@types/deep-eql@4.0.2': {} - ansi-styles@4.3.0: + '@types/node@24.10.1': dependencies: - color-convert: 2.0.1 + undici-types: 7.16.0 - ansi-styles@6.2.3: {} + '@types/stylis@4.2.7': {} - argparse@1.0.10: + ansi-escapes@7.2.0: dependencies: - sprintf-js: 1.0.3 - - argparse@2.0.1: {} + environment: 1.1.0 - array-find-index@1.0.2: {} + ansi-regex@6.2.2: {} - arrgv@1.0.2: {} + ansi-styles@6.2.3: {} - arrify@3.0.0: {} + argparse@2.0.1: {} - async-sema@3.1.1: {} + assertion-error@2.0.1: {} asynckit@0.4.0: {} - ava@6.4.1: - dependencies: - '@vercel/nft': 0.29.4 - acorn: 8.15.0 - acorn-walk: 8.3.4 - ansi-styles: 6.2.3 - arrgv: 1.0.2 - arrify: 3.0.0 - callsites: 4.2.0 - cbor: 10.0.11 - chalk: 5.6.2 - chunkd: 2.0.1 - ci-info: 4.3.1 - ci-parallel-vars: 1.0.1 - cli-truncate: 4.0.0 - code-excerpt: 4.0.0 - common-path-prefix: 3.0.0 - concordance: 5.0.4 - currently-unhandled: 0.4.1 - debug: 4.4.1 - emittery: 1.2.0 - figures: 6.1.0 - globby: 14.1.0 - ignore-by-default: 2.1.0 - indent-string: 5.0.0 - is-plain-object: 5.0.0 - is-promise: 4.0.0 - matcher: 5.0.0 - memoize: 10.2.0 - ms: 2.1.3 - p-map: 7.0.4 - package-config: 5.0.0 - picomatch: 4.0.3 - plur: 5.1.0 - pretty-ms: 9.3.0 - resolve-cwd: 3.0.0 - stack-utils: 2.0.6 - strip-ansi: 7.1.2 - supertap: 3.0.1 - temp-dir: 3.0.0 - write-file-atomic: 6.0.0 - yargs: 17.7.2 - transitivePeerDependencies: - - encoding - - rollup - - supports-color - axios@1.6.2: dependencies: follow-redirects: 1.15.9 @@ -2363,20 +1912,8 @@ snapshots: transitivePeerDependencies: - debug - balanced-match@1.0.2: {} - before-after-hook@4.0.0: {} - bindings@1.5.0: - dependencies: - file-uri-to-path: 1.0.0 - - blueimp-md5@2.19.0: {} - - brace-expansion@2.0.2: - dependencies: - balanced-match: 1.0.2 - braces@3.0.3: dependencies: fill-range: 7.1.1 @@ -2386,35 +1923,14 @@ snapshots: es-errors: 1.3.0 function-bind: 1.1.2 - callsites@4.2.0: {} - camelize@1.0.1: {} - cbor@10.0.11: - dependencies: - nofilter: 3.1.0 - - chalk@5.6.2: {} - chardet@2.1.1: {} - chownr@3.0.0: {} - - chunkd@2.0.1: {} - - ci-info@4.3.1: {} - - ci-parallel-vars@1.0.1: {} - cli-cursor@5.0.0: dependencies: restore-cursor: 5.1.0 - cli-truncate@4.0.0: - dependencies: - slice-ansi: 5.0.0 - string-width: 7.2.0 - cli-truncate@5.1.1: dependencies: slice-ansi: 7.1.2 @@ -2426,22 +1942,6 @@ snapshots: dependencies: typanion: 3.14.0 - cliui@8.0.1: - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - - code-excerpt@4.0.0: - dependencies: - convert-to-spaces: 2.0.1 - - color-convert@2.0.1: - dependencies: - color-name: 1.1.4 - - color-name@1.1.4: {} - colorette@2.0.20: {} combined-stream@1.0.8: @@ -2450,30 +1950,9 @@ snapshots: commander@14.0.3: {} - common-path-prefix@3.0.0: {} - complex.js@2.4.2: {} - concordance@5.0.4: - dependencies: - date-time: 3.1.0 - esutils: 2.0.3 - fast-diff: 1.3.0 - js-string-escape: 1.0.1 - lodash: 4.17.21 - md5-hex: 3.0.1 - semver: 7.7.4 - well-known-symbols: 2.0.0 - - consola@3.4.2: {} - - convert-to-spaces@2.0.1: {} - - cross-spawn@7.0.6: - dependencies: - path-key: 3.1.1 - shebang-command: 2.0.0 - which: 2.0.2 + core-js@3.47.0: {} css-color-keywords@1.0.0: {} @@ -2485,14 +1964,6 @@ snapshots: csstype@3.1.3: {} - currently-unhandled@0.4.1: - dependencies: - array-find-index: 1.0.2 - - date-time@3.1.0: - dependencies: - time-zone: 1.0.0 - debug@4.4.1: dependencies: ms: 2.1.3 @@ -2501,26 +1972,16 @@ snapshots: delayed-stream@1.0.0: {} - detect-libc@2.0.3: {} - dunder-proto@1.0.1: dependencies: call-bind-apply-helpers: 1.0.2 es-errors: 1.3.0 gopd: 1.2.0 - eastasianwidth@0.2.0: {} - - emittery@1.2.0: {} - emnapi@1.8.1: {} emoji-regex@10.3.0: {} - emoji-regex@8.0.0: {} - - emoji-regex@9.2.2: {} - enhanced-resolve@5.19.0: dependencies: graceful-fs: 4.2.11 @@ -2545,57 +2006,18 @@ snapshots: es-toolkit@1.42.0: {} - escalade@3.1.2: {} - escape-latex@1.2.0: {} - escape-string-regexp@2.0.0: {} - - escape-string-regexp@5.0.0: {} - - esprima@4.0.1: {} - - estree-walker@2.0.2: {} - - esutils@2.0.3: {} - eventemitter3@5.0.1: {} fast-content-type-parse@3.0.0: {} - fast-diff@1.3.0: {} - - fast-glob@3.3.3: - dependencies: - '@nodelib/fs.stat': 2.0.5 - '@nodelib/fs.walk': 1.2.8 - glob-parent: 5.1.2 - merge2: 1.4.1 - micromatch: 4.0.8 - - fastq@1.17.1: - dependencies: - reusify: 1.0.4 - - figures@6.1.0: - dependencies: - is-unicode-supported: 2.0.0 - - file-uri-to-path@1.0.0: {} - fill-range@7.1.1: dependencies: to-regex-range: 5.0.1 - find-up-simple@1.0.0: {} - follow-redirects@1.15.9: {} - foreground-child@3.3.1: - dependencies: - cross-spawn: 7.0.6 - signal-exit: 4.1.0 - form-data@4.0.2: dependencies: asynckit: 0.4.0 @@ -2607,8 +2029,6 @@ snapshots: function-bind@1.1.2: {} - get-caller-file@2.0.5: {} - get-east-asian-width@1.4.0: {} get-intrinsic@1.3.0: @@ -2629,28 +2049,6 @@ snapshots: dunder-proto: 1.0.1 es-object-atoms: 1.1.1 - glob-parent@5.1.2: - dependencies: - is-glob: 4.0.3 - - glob@10.5.0: - dependencies: - foreground-child: 3.3.1 - jackspeak: 3.4.3 - minimatch: 9.0.5 - minipass: 7.1.2 - package-json-from-dist: 1.0.1 - path-scurry: 1.11.1 - - globby@14.1.0: - dependencies: - '@sindresorhus/merge-streams': 2.3.0 - fast-glob: 3.3.3 - ignore: 7.0.5 - path-type: 6.0.0 - slash: 5.1.0 - unicorn-magic: 0.3.0 - gopd@1.2.0: {} graceful-fs@4.2.11: {} @@ -2665,72 +2063,26 @@ snapshots: dependencies: function-bind: 1.1.2 - https-proxy-agent@7.0.6: - dependencies: - agent-base: 7.1.4 - debug: 4.4.1 - transitivePeerDependencies: - - supports-color - husky@9.1.7: {} iconv-lite@0.7.0: dependencies: safer-buffer: 2.1.2 - ignore-by-default@2.1.0: {} - - ignore@7.0.5: {} - - imurmurhash@0.1.4: {} - - indent-string@5.0.0: {} - ipaddr.js@2.2.0: {} - irregular-plurals@3.5.0: {} - - is-extglob@2.1.1: {} - - is-fullwidth-code-point@3.0.0: {} - - is-fullwidth-code-point@4.0.0: {} - is-fullwidth-code-point@5.1.0: dependencies: get-east-asian-width: 1.4.0 - is-glob@4.0.3: - dependencies: - is-extglob: 2.1.1 - is-number@7.0.0: {} - is-plain-object@5.0.0: {} - - is-promise@4.0.0: {} - - is-unicode-supported@2.0.0: {} - - isexe@2.0.0: {} - - jackspeak@3.4.3: - dependencies: - '@isaacs/cliui': 8.0.2 - optionalDependencies: - '@pkgjs/parseargs': 0.11.0 - javascript-natural-sort@0.7.1: {} - js-string-escape@1.0.1: {} + jiti@2.6.1: {} js-tokens@4.0.0: {} - js-yaml@3.14.1: - dependencies: - argparse: 1.0.10 - esprima: 4.0.1 - js-yaml@4.1.0: dependencies: argparse: 2.0.1 @@ -2754,10 +2106,6 @@ snapshots: rfdc: 1.4.1 wrap-ansi: 9.0.2 - load-json-file@7.0.1: {} - - lodash@4.17.21: {} - log-update@6.1.0: dependencies: ansi-escapes: 7.2.0 @@ -2770,12 +2118,6 @@ snapshots: dependencies: js-tokens: 4.0.0 - lru-cache@10.4.3: {} - - matcher@5.0.0: - dependencies: - escape-string-regexp: 5.0.0 - math-intrinsics@1.1.0: {} mathjs@13.2.0: @@ -2790,16 +2132,6 @@ snapshots: tiny-emitter: 2.1.0 typed-function: 4.2.1 - md5-hex@3.0.1: - dependencies: - blueimp-md5: 2.19.0 - - memoize@10.2.0: - dependencies: - mimic-function: 5.0.1 - - merge2@1.4.1: {} - micromatch@4.0.8: dependencies: braces: 3.0.3 @@ -2813,16 +2145,6 @@ snapshots: mimic-function@5.0.1: {} - minimatch@9.0.5: - dependencies: - brace-expansion: 2.0.2 - - minipass@7.1.2: {} - - minizlib@3.1.0: - dependencies: - minipass: 7.1.2 - ms@2.1.3: {} mute-stream@3.0.0: {} @@ -2831,56 +2153,18 @@ snapshots: nanoid@3.3.11: {} - node-fetch@2.7.0: - dependencies: - whatwg-url: 5.0.0 - - node-gyp-build@4.8.1: {} - - nofilter@3.1.0: {} - - nopt@8.1.0: - dependencies: - abbrev: 3.0.1 - obug@2.1.1: {} onetime@7.0.0: dependencies: mimic-function: 5.0.1 - p-map@7.0.4: {} - - package-config@5.0.0: - dependencies: - find-up-simple: 1.0.0 - load-json-file: 7.0.1 - - package-json-from-dist@1.0.1: {} - - parse-ms@4.0.0: {} - - path-key@3.1.1: {} - - path-scurry@1.11.1: - dependencies: - lru-cache: 10.4.3 - minipass: 7.1.2 - - path-type@6.0.0: {} - picocolors@1.1.1: {} picomatch@2.3.1: {} - picomatch@4.0.3: {} - pidtree@0.6.0: {} - plur@5.1.0: - dependencies: - irregular-plurals: 3.5.0 - postcss-value-parser@4.2.0: {} postcss@8.4.33: @@ -2891,14 +2175,8 @@ snapshots: prettier@3.8.1: {} - pretty-ms@9.3.0: - dependencies: - parse-ms: 4.0.0 - proxy-from-env@1.1.0: {} - queue-microtask@1.2.3: {} - react-dom@19.1.0(react@18.3.1): dependencies: react: 18.3.1 @@ -2910,27 +2188,13 @@ snapshots: regenerator-runtime@0.14.1: {} - require-directory@2.1.1: {} - - resolve-cwd@3.0.0: - dependencies: - resolve-from: 5.0.0 - - resolve-from@5.0.0: {} - restore-cursor@5.1.0: dependencies: onetime: 7.0.0 signal-exit: 4.1.0 - reusify@1.0.4: {} - rfdc@1.4.1: {} - run-parallel@1.2.0: - dependencies: - queue-microtask: 1.2.3 - safer-buffer@2.1.2: {} scheduler@0.26.0: {} @@ -2939,27 +2203,10 @@ snapshots: semver@7.7.4: {} - serialize-error@7.0.1: - dependencies: - type-fest: 0.13.1 - shallowequal@1.1.0: {} - shebang-command@2.0.0: - dependencies: - shebang-regex: 3.0.0 - - shebang-regex@3.0.0: {} - signal-exit@4.1.0: {} - slash@5.1.0: {} - - slice-ansi@5.0.0: - dependencies: - ansi-styles: 6.2.3 - is-fullwidth-code-point: 4.0.0 - slice-ansi@7.1.2: dependencies: ansi-styles: 6.2.3 @@ -2967,26 +2214,8 @@ snapshots: source-map-js@1.2.1: {} - sprintf-js@1.0.3: {} - - stack-utils@2.0.6: - dependencies: - escape-string-regexp: 2.0.0 - string-argv@0.3.2: {} - string-width@4.2.3: - dependencies: - emoji-regex: 8.0.0 - is-fullwidth-code-point: 3.0.0 - strip-ansi: 6.0.1 - - string-width@5.1.2: - dependencies: - eastasianwidth: 0.2.0 - emoji-regex: 9.2.2 - strip-ansi: 7.1.2 - string-width@7.2.0: dependencies: emoji-regex: 10.3.0 @@ -2998,10 +2227,6 @@ snapshots: get-east-asian-width: 1.4.0 strip-ansi: 7.1.2 - strip-ansi@6.0.1: - dependencies: - ansi-regex: 5.0.1 - strip-ansi@7.1.2: dependencies: ansi-regex: 6.2.2 @@ -3022,43 +2247,22 @@ snapshots: stylis@4.3.6: {} - supertap@3.0.1: - dependencies: - indent-string: 5.0.0 - js-yaml: 3.14.1 - serialize-error: 7.0.1 - strip-ansi: 7.1.2 - tapable@2.3.0: {} - tar@7.5.2: - dependencies: - '@isaacs/fs-minipass': 4.0.1 - chownr: 3.0.0 - minipass: 7.1.2 - minizlib: 3.1.0 - yallist: 5.0.0 - - temp-dir@3.0.0: {} - - time-zone@1.0.0: {} - tiny-emitter@2.1.0: {} + tinypool@1.1.1: {} + to-regex-range@5.0.1: dependencies: is-number: 7.0.0 - tr46@0.0.3: {} - tslib@2.8.1: {} tunnel@0.0.6: {} typanion@3.14.0: {} - type-fest@0.13.1: {} - typed-function@4.2.1: {} typescript@5.9.3: {} @@ -3067,62 +2271,14 @@ snapshots: undici@6.23.0: {} - unicorn-magic@0.3.0: {} - universal-user-agent@7.0.2: {} - webidl-conversions@3.0.1: {} - - well-known-symbols@2.0.0: {} - - whatwg-url@5.0.0: - dependencies: - tr46: 0.0.3 - webidl-conversions: 3.0.1 - - which@2.0.2: - dependencies: - isexe: 2.0.0 - - wrap-ansi@7.0.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrap-ansi@8.1.0: - dependencies: - ansi-styles: 6.2.3 - string-width: 5.1.2 - strip-ansi: 7.1.2 - wrap-ansi@9.0.2: dependencies: ansi-styles: 6.2.3 string-width: 7.2.0 strip-ansi: 7.1.2 - write-file-atomic@6.0.0: - dependencies: - imurmurhash: 0.1.4 - signal-exit: 4.1.0 - - y18n@5.0.8: {} - - yallist@5.0.0: {} - yaml@2.8.1: {} - yargs-parser@21.1.1: {} - - yargs@17.7.2: - dependencies: - cliui: 8.0.1 - escalade: 3.1.2 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 21.1.1 - zx@8.8.5: {} diff --git a/rstest.config.mjs b/rstest.config.mjs new file mode 100644 index 00000000..73525992 --- /dev/null +++ b/rstest.config.mjs @@ -0,0 +1,19 @@ +import { defineConfig } from "@rstest/core"; +import path from "node:path"; + +export default defineConfig({ + testEnvironment: "node", + include: ["napi/tests/**/*.test.mjs"], + output: { + externals: [ + ({ request }, callback) => { + // Externalize the napi binding so native .node files load at runtime + if (request === "../index.js") { + callback(null, `node-commonjs ${path.resolve("napi/index.js")}`); + return; + } + callback(); + } + ] + } +}); diff --git a/rstest.config.resolver.mjs b/rstest.config.resolver.mjs new file mode 100644 index 00000000..f625836e --- /dev/null +++ b/rstest.config.resolver.mjs @@ -0,0 +1,21 @@ +import { defineConfig } from "@rstest/core"; +import path from "node:path"; + +export default defineConfig({ + testEnvironment: "node", + include: ["napi/__test__/**/*.test.mjs"], + output: { + externals: [ + ({ request }, callback) => { + if (request === "../index.js" || request === "../resolver.wasi.cjs") { + callback( + null, + `node-commonjs ${path.resolve("napi", path.basename(request))}` + ); + return; + } + callback(); + } + ] + } +});