gitea push
This commit is contained in:
+15
@@ -171,6 +171,9 @@ Add inline source map to transformed source for better debugging.
|
||||
|
||||
Jiti combines module exports with the `default` export using an internal Proxy to improve compatibility with mixed CJS/ESM usage. You can check the current implementation [here](https://github.com/unjs/jiti/blob/main/src/utils.ts#L105).
|
||||
|
||||
> [!WARNING]
|
||||
> This option wraps **all imported modules** in a Proxy, which adds ~25-50ns overhead per property access. For performance-critical hot paths where you access module exports very frequently, consider setting `interopDefault: false` or `JITI_INTEROP_DEFAULT=false`.
|
||||
|
||||
### `alias`
|
||||
|
||||
- Type: Object
|
||||
@@ -181,6 +184,18 @@ You can also pass an object to the environment variable for inline config. Examp
|
||||
|
||||
Custom alias map used to resolve IDs.
|
||||
|
||||
### `tsconfigPaths`
|
||||
|
||||
- Type: Boolean | String
|
||||
- Default: `false`
|
||||
- Environment variable: `JITI_TSCONFIG_PATHS`
|
||||
|
||||
Enable TypeScript [`paths`](https://www.typescriptlang.org/tsconfig/#paths) resolution using [`get-tsconfig`](https://github.com/privatenumber/get-tsconfig).
|
||||
|
||||
- `true`: Auto-discover `tsconfig.json` by walking up from the jiti instance's parent path.
|
||||
- `string`: Explicit path to a `tsconfig.json` file.
|
||||
- `false` (default): Disabled.
|
||||
|
||||
### `nativeModules`
|
||||
|
||||
- Type: Array
|
||||
|
||||
+38
-27
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+57
@@ -236,6 +236,27 @@ export interface JitiOptions {
|
||||
*/
|
||||
tryNative?: boolean;
|
||||
|
||||
/**
|
||||
* Always use a temp file (instead of a `data:` URL) for the ESM
|
||||
* evaluation fallback path.
|
||||
*
|
||||
* jiti automatically falls back to a temp file when the `data:` URL
|
||||
* import fails with `ENAMETOOLONG` — which happens on filesystems with
|
||||
* a strict `NAME_MAX` limit (e.g. ecryptfs-encrypted home directories
|
||||
* on Linux, some macOS configurations) once the base64-encoded source
|
||||
* exceeds the limit. Setting this to `true` forces the temp-file path
|
||||
* up front, skipping the `data:` URL attempt.
|
||||
*
|
||||
* The temp file is written to `{TMP_DIR}/jiti-esm/` and cleaned up
|
||||
* after import.
|
||||
*
|
||||
* Can also be enabled using the `JITI_ESM_EVAL_TEMP_FILE=true`
|
||||
* environment variable.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
esmEvalTempFile?: boolean;
|
||||
|
||||
/**
|
||||
* Enable JSX support Enable JSX support using
|
||||
* {@link https://babeljs.io/docs/babel-plugin-transform-react-jsx | `@babel/plugin-transform-react-jsx`}.
|
||||
@@ -245,6 +266,42 @@ export interface JitiOptions {
|
||||
* @default false
|
||||
*/
|
||||
jsx?: boolean | JSXOptions;
|
||||
|
||||
/**
|
||||
* Virtual modules - pre-loaded module objects that bypass filesystem resolution.
|
||||
* Useful for bundled modules in compiled binaries (e.g., Bun).
|
||||
*
|
||||
* When a module ID matches a key in this map, the corresponding value is
|
||||
* returned directly without any filesystem resolution or transformation.
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* import * as typebox from "@sinclair/typebox";
|
||||
*
|
||||
* const jiti = createJiti(import.meta.url, {
|
||||
* virtualModules: {
|
||||
* "@sinclair/typebox": typebox,
|
||||
* },
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
virtualModules?: Record<string, unknown>;
|
||||
|
||||
/**
|
||||
* Enable tsconfig paths resolution.
|
||||
*
|
||||
* - `true`: auto-discover `tsconfig.json` by walking up from the
|
||||
* jiti instance's parent path
|
||||
* - `string`: explicit path to a `tsconfig.json` file
|
||||
* - `false` (default): disabled
|
||||
*
|
||||
* When enabled, jiti uses
|
||||
* {@link https://github.com/privatenumber/get-tsconfig | get-tsconfig}
|
||||
* to resolve TypeScript path aliases defined in `compilerOptions.paths`.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
tsconfigPaths?: boolean | string;
|
||||
}
|
||||
|
||||
interface NodeRequire {
|
||||
|
||||
+56
-43
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "jiti",
|
||||
"version": "2.6.1",
|
||||
"version": "2.7.0",
|
||||
"description": "Runtime typescript and ESM support for Node.js",
|
||||
"repository": "unjs/jiti",
|
||||
"license": "MIT",
|
||||
@@ -24,6 +24,10 @@
|
||||
"types": "./lib/jiti.d.mts",
|
||||
"import": "./lib/jiti-native.mjs"
|
||||
},
|
||||
"./static": {
|
||||
"types": "./lib/jiti.d.mts",
|
||||
"import": "./lib/jiti-static.mjs"
|
||||
},
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"main": "./lib/jiti.cjs",
|
||||
@@ -36,6 +40,9 @@
|
||||
],
|
||||
"native": [
|
||||
"./lib/jiti.d.mts"
|
||||
],
|
||||
"static": [
|
||||
"./lib/jiti.d.mts"
|
||||
]
|
||||
}
|
||||
},
|
||||
@@ -50,13 +57,14 @@
|
||||
"scripts": {
|
||||
"bench": "node test/bench.mjs && deno -A test/bench.mjs && bun --bun test/bench.mjs",
|
||||
"build": "pnpm clean && pnpm rspack",
|
||||
"build:rolldown": "pnpm clean && pnpm rolldown -c rolldown.config.mjs",
|
||||
"clean": "rm -rf dist",
|
||||
"dev": "pnpm clean && pnpm rspack --watch",
|
||||
"jiti": "JITI_DEBUG=1 JITI_JSX=1 lib/jiti-cli.mjs",
|
||||
"lint": "eslint . && prettier -c src lib test stubs",
|
||||
"lint:fix": "eslint --fix . && prettier -w src lib test stubs",
|
||||
"prepack": "pnpm build",
|
||||
"release": "pnpm build && pnpm test && changelogen --release --push --publish",
|
||||
"release": "pnpm build && pnpm test && changelogen --release --push && npm publish",
|
||||
"test": "pnpm lint && pnpm test:types && vitest run --coverage && pnpm test:node-register && pnpm test:bun && pnpm test:native",
|
||||
"test:bun": "bun --bun test test/bun",
|
||||
"test:native": "pnpm test:native:bun && pnpm test:native:node && pnpm test:native:deno",
|
||||
@@ -64,70 +72,75 @@
|
||||
"test:native:deno": "deno test -A --no-check test/native/deno.test.ts",
|
||||
"test:native:node": "node --test --experimental-strip-types test/native/node.test.ts",
|
||||
"test:node-register": "JITI_JSX=1 node --test test/node-register.test.mjs",
|
||||
"test:types": "tsc --noEmit"
|
||||
"test:types": "tsgo --noEmit"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.28.4",
|
||||
"@babel/helper-module-imports": "^7.27.1",
|
||||
"@babel/helper-module-transforms": "^7.28.3",
|
||||
"@babel/helper-plugin-utils": "^7.27.1",
|
||||
"@babel/core": "^7.29.0",
|
||||
"@babel/helper-module-imports": "^7.28.6",
|
||||
"@babel/helper-module-transforms": "^7.28.6",
|
||||
"@babel/helper-plugin-utils": "^7.28.6",
|
||||
"@babel/helper-simple-access": "^7.27.1",
|
||||
"@babel/plugin-proposal-decorators": "^7.28.0",
|
||||
"@babel/plugin-proposal-decorators": "^7.29.0",
|
||||
"@babel/plugin-syntax-class-properties": "^7.12.13",
|
||||
"@babel/plugin-syntax-import-assertions": "^7.27.1",
|
||||
"@babel/plugin-syntax-jsx": "^7.27.1",
|
||||
"@babel/plugin-syntax-import-assertions": "^7.28.6",
|
||||
"@babel/plugin-syntax-jsx": "^7.28.6",
|
||||
"@babel/plugin-transform-explicit-resource-management": "^7.28.6",
|
||||
"@babel/plugin-transform-export-namespace-from": "^7.27.1",
|
||||
"@babel/plugin-transform-react-jsx": "^7.27.1",
|
||||
"@babel/plugin-transform-typescript": "^7.28.0",
|
||||
"@babel/preset-typescript": "^7.27.1",
|
||||
"@babel/template": "^7.27.2",
|
||||
"@babel/traverse": "^7.28.4",
|
||||
"@babel/types": "^7.28.4",
|
||||
"@rspack/cli": "^1.5.8",
|
||||
"@rspack/core": "^1.5.8",
|
||||
"@babel/plugin-transform-react-jsx": "^7.28.6",
|
||||
"@babel/plugin-transform-typescript": "^7.28.6",
|
||||
"@babel/preset-typescript": "^7.28.5",
|
||||
"@babel/template": "^7.28.6",
|
||||
"@babel/traverse": "^7.29.0",
|
||||
"@babel/types": "^7.29.0",
|
||||
"@rspack/cli": "^2.0.1",
|
||||
"@rspack/core": "^2.0.1",
|
||||
"@types/babel__core": "^7.20.5",
|
||||
"@types/babel__helper-module-imports": "^7.18.3",
|
||||
"@types/babel__helper-plugin-utils": "^7.10.3",
|
||||
"@types/babel__template": "^7.4.4",
|
||||
"@types/babel__traverse": "^7.28.0",
|
||||
"@types/node": "^24.6.1",
|
||||
"@vitest/coverage-v8": "^3.2.4",
|
||||
"acorn": "^8.15.0",
|
||||
"@types/node": "^25.6.0",
|
||||
"@typescript/native-preview": "7.0.0-dev.20260505.1",
|
||||
"@vitest/coverage-v8": "^4.1.5",
|
||||
"acorn": "^8.16.0",
|
||||
"babel-plugin-parameter-decorator": "^1.0.16",
|
||||
"changelogen": "^0.6.2",
|
||||
"config": "^4.1.1",
|
||||
"config": "^4.4.1",
|
||||
"consola": "^3.4.2",
|
||||
"defu": "^6.1.4",
|
||||
"defu": "^6.1.7",
|
||||
"destr": "^2.0.5",
|
||||
"escape-string-regexp": "^5.0.0",
|
||||
"eslint": "^9.36.0",
|
||||
"eslint-config-unjs": "^0.5.0",
|
||||
"eslint": "^10.3.0",
|
||||
"eslint-config-unjs": "^0.6.2",
|
||||
"estree-walker": "^3.0.3",
|
||||
"etag": "^1.8.1",
|
||||
"fast-glob": "^3.3.3",
|
||||
"get-tsconfig": "^4.14.0",
|
||||
"is-installed-globally": "^1.0.0",
|
||||
"mime": "^4.1.0",
|
||||
"mlly": "^1.8.0",
|
||||
"moment-timezone": "^0.6.0",
|
||||
"nano-jsx": "^0.2.0",
|
||||
"mitata": "^1.0.34",
|
||||
"mlly": "^1.8.2",
|
||||
"moment-timezone": "^0.6.2",
|
||||
"nano-jsx": "^0.2.1",
|
||||
"pathe": "^2.0.3",
|
||||
"pkg-types": "^2.3.0",
|
||||
"preact": "^10.27.2",
|
||||
"preact-render-to-string": "^6.6.2",
|
||||
"prettier": "^3.6.2",
|
||||
"react": "^19.1.1",
|
||||
"react-dom": "^19.1.1",
|
||||
"pkg-types": "^2.3.1",
|
||||
"preact": "^10.29.1",
|
||||
"preact-render-to-string": "^6.6.7",
|
||||
"prettier": "^3.8.3",
|
||||
"react": "^19.2.5",
|
||||
"react-dom": "^19.2.5",
|
||||
"reflect-metadata": "^0.2.2",
|
||||
"solid-js": "^1.9.9",
|
||||
"std-env": "^3.9.0",
|
||||
"terser-webpack-plugin": "^5.3.14",
|
||||
"tinyexec": "^1.0.1",
|
||||
"ts-loader": "^9.5.4",
|
||||
"rolldown": "1.0.0-rc.18",
|
||||
"solid-js": "^1.9.12",
|
||||
"std-env": "^4.1.0",
|
||||
"terser-webpack-plugin": "^5.5.0",
|
||||
"tinyexec": "^1.1.2",
|
||||
"ts-loader": "^9.5.7",
|
||||
"typescript": "^5.9.3",
|
||||
"vitest": "^3.2.4",
|
||||
"vue": "^3.5.22",
|
||||
"vitest": "^4.1.5",
|
||||
"vue": "^3.5.33",
|
||||
"yoctocolors": "^2.1.2",
|
||||
"zod": "^4.1.11"
|
||||
"zod": "^4.4.3"
|
||||
},
|
||||
"packageManager": "pnpm@10.17.1"
|
||||
"packageManager": "pnpm@10.30.3"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user