@kubb/agent 5.0.0-beta.75 → 5.0.0-beta.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/nitro.json +1 -1
- package/.output/server/chunks/nitro/nitro.mjs +353 -418
- package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
- package/.output/server/chunks/routes/api/health.get.mjs +1 -1
- package/.output/server/index.mjs +1 -1
- package/.output/server/node_modules/ajv/dist/2019.d.ts +1 -1
- package/.output/server/node_modules/ajv/dist/2019.js.map +1 -1
- package/.output/server/node_modules/ajv/dist/2020.d.ts +1 -1
- package/.output/server/node_modules/ajv/dist/2020.js.map +1 -1
- package/.output/server/node_modules/ajv/dist/ajv.d.ts +1 -1
- package/.output/server/node_modules/ajv/dist/ajv.js.map +1 -1
- package/.output/server/node_modules/ajv/dist/compile/index.d.ts +2 -1
- package/.output/server/node_modules/ajv/dist/compile/index.js +10 -3
- package/.output/server/node_modules/ajv/dist/compile/index.js.map +1 -1
- package/.output/server/node_modules/ajv/dist/compile/jtd/parse.js +1 -1
- package/.output/server/node_modules/ajv/dist/compile/jtd/parse.js.map +1 -1
- package/.output/server/node_modules/ajv/dist/compile/jtd/serialize.js +1 -1
- package/.output/server/node_modules/ajv/dist/compile/jtd/serialize.js.map +1 -1
- package/.output/server/node_modules/ajv/dist/compile/names.d.ts +1 -0
- package/.output/server/node_modules/ajv/dist/compile/names.js +1 -0
- package/.output/server/node_modules/ajv/dist/compile/names.js.map +1 -1
- package/.output/server/node_modules/ajv/dist/compile/validate/index.d.ts +1 -1
- package/.output/server/node_modules/ajv/dist/compile/validate/index.js +18 -4
- package/.output/server/node_modules/ajv/dist/compile/validate/index.js.map +1 -1
- package/.output/server/node_modules/ajv/dist/core.d.ts +4 -0
- package/.output/server/node_modules/ajv/dist/core.js +15 -1
- package/.output/server/node_modules/ajv/dist/core.js.map +1 -1
- package/.output/server/node_modules/ajv/dist/draft4.d.ts +19 -0
- package/.output/server/node_modules/ajv/dist/draft4.js +57 -0
- package/.output/server/node_modules/ajv/dist/draft4.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/refs/json-schema-draft-04.json +138 -0
- package/.output/server/node_modules/ajv/dist/types/index.d.ts +3 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +2 -1
- package/.output/server/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map +1 -1
- package/.output/server/node_modules/ajv/dist/vocabularies/applicator/allOf.js +1 -1
- package/.output/server/node_modules/ajv/dist/vocabularies/applicator/allOf.js.map +1 -1
- package/.output/server/node_modules/ajv/dist/vocabularies/applicator/properties.js +2 -1
- package/.output/server/node_modules/ajv/dist/vocabularies/applicator/properties.js.map +1 -1
- package/.output/server/node_modules/ajv/dist/vocabularies/code.d.ts +1 -1
- package/.output/server/node_modules/ajv/dist/vocabularies/code.js +10 -3
- package/.output/server/node_modules/ajv/dist/vocabularies/code.js.map +1 -1
- package/.output/server/node_modules/ajv/dist/vocabularies/core/ref.js +12 -2
- package/.output/server/node_modules/ajv/dist/vocabularies/core/ref.js.map +1 -1
- package/.output/server/node_modules/ajv/dist/vocabularies/discriminator/index.js +56 -21
- package/.output/server/node_modules/ajv/dist/vocabularies/discriminator/index.js.map +1 -1
- package/.output/server/node_modules/ajv/dist/vocabularies/draft4.d.ts +3 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/draft4.js +29 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/draft4.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/metadata.js +10 -2
- package/.output/server/node_modules/ajv/dist/vocabularies/metadata.js.map +1 -1
- package/.output/server/node_modules/ajv/dist/vocabularies/oasContext.d.ts +3 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/oasContext.js +26 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/oasContext.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js +22 -3
- package/.output/server/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js.map +1 -1
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/draft04/limitNumber.d.ts +12 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/draft04/limitNumber.js +43 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/draft04/limitNumber.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/draft04/limitNumberExclusive.d.ts +3 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/draft04/limitNumberExclusive.js +19 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/draft04/limitNumberExclusive.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/index.js +4 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/index.js.map +1 -1
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/readOnly.d.ts +3 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/readOnly.js +20 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/readOnly.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/required.js +8 -1
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/required.js.map +1 -1
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/writeOnly.d.ts +3 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/writeOnly.js +20 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/writeOnly.js.map +1 -0
- package/.output/server/node_modules/ajv/lib/2019.ts +1 -0
- package/.output/server/node_modules/ajv/lib/2020.ts +1 -0
- package/.output/server/node_modules/ajv/lib/ajv.ts +1 -0
- package/.output/server/node_modules/ajv/lib/compile/index.ts +16 -3
- package/.output/server/node_modules/ajv/lib/compile/jtd/parse.ts +3 -1
- package/.output/server/node_modules/ajv/lib/compile/jtd/serialize.ts +3 -1
- package/.output/server/node_modules/ajv/lib/compile/names.ts +1 -0
- package/.output/server/node_modules/ajv/lib/compile/validate/index.ts +21 -4
- package/.output/server/node_modules/ajv/lib/core.ts +20 -1
- package/.output/server/node_modules/ajv/lib/draft4.ts +79 -0
- package/.output/server/node_modules/ajv/lib/refs/json-schema-draft-04.json +138 -0
- package/.output/server/node_modules/ajv/lib/types/index.ts +4 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/applicator/additionalProperties.ts +2 -1
- package/.output/server/node_modules/ajv/lib/vocabularies/applicator/allOf.ts +1 -1
- package/.output/server/node_modules/ajv/lib/vocabularies/applicator/properties.ts +4 -1
- package/.output/server/node_modules/ajv/lib/vocabularies/code.ts +10 -3
- package/.output/server/node_modules/ajv/lib/vocabularies/core/ref.ts +21 -5
- package/.output/server/node_modules/ajv/lib/vocabularies/discriminator/index.ts +69 -19
- package/.output/server/node_modules/ajv/lib/vocabularies/draft4.ts +32 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/metadata.ts +10 -2
- package/.output/server/node_modules/ajv/lib/vocabularies/oasContext.ts +27 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedProperties.ts +29 -7
- package/.output/server/node_modules/ajv/lib/vocabularies/validation/draft04/limitNumber.ts +75 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/validation/draft04/limitNumberExclusive.ts +26 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/validation/index.ts +4 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/validation/readOnly.ts +23 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/validation/required.ts +7 -1
- package/.output/server/node_modules/ajv/lib/vocabularies/validation/writeOnly.ts +22 -0
- package/.output/server/node_modules/ajv/package.json +9 -6
- package/.output/server/node_modules/jiti/LICENSE +21 -0
- package/.output/server/node_modules/jiti/README.md +258 -0
- package/.output/server/node_modules/jiti/dist/babel.cjs +257 -0
- package/.output/server/node_modules/jiti/dist/jiti.cjs +1 -0
- package/.output/server/node_modules/jiti/lib/jiti-cli.mjs +34 -0
- package/.output/server/node_modules/jiti/lib/jiti-hooks.mjs +124 -0
- package/.output/server/node_modules/jiti/lib/jiti-native.mjs +121 -0
- package/.output/server/node_modules/jiti/lib/jiti-register.d.mts +1 -0
- package/.output/server/node_modules/jiti/lib/jiti-register.mjs +4 -0
- package/.output/server/node_modules/jiti/lib/jiti-static.mjs +23 -0
- package/.output/server/node_modules/jiti/lib/jiti.cjs +30 -0
- package/.output/server/node_modules/jiti/lib/jiti.d.cts +8 -0
- package/.output/server/node_modules/jiti/lib/jiti.d.mts +8 -0
- package/.output/server/node_modules/jiti/lib/jiti.mjs +29 -0
- package/.output/server/node_modules/jiti/lib/types.d.ts +420 -0
- package/.output/server/node_modules/jiti/package.json +146 -0
- package/.output/server/package.json +2 -5
- package/README.md +62 -27
- package/package.json +13 -12
- package/.output/server/node_modules/@rolldown/binding-linux-x64-gnu/package.json +0 -40
- package/.output/server/node_modules/@rolldown/binding-linux-x64-gnu/rolldown-binding.linux-x64-gnu.node +0 -0
- package/.output/server/node_modules/@rolldown/pluginutils/dist/filter/composable-filters.js +0 -256
- package/.output/server/node_modules/@rolldown/pluginutils/dist/filter/filter-vite-plugins.js +0 -75
- package/.output/server/node_modules/@rolldown/pluginutils/dist/filter/index.js +0 -3
- package/.output/server/node_modules/@rolldown/pluginutils/dist/filter/simple-filters.js +0 -70
- package/.output/server/node_modules/@rolldown/pluginutils/dist/index.js +0 -1
- package/.output/server/node_modules/@rolldown/pluginutils/dist/utils.js +0 -17
- package/.output/server/node_modules/@rolldown/pluginutils/package.json +0 -37
- package/.output/server/node_modules/rolldown/dist/index.mjs +0 -50
- package/.output/server/node_modules/rolldown/dist/parse-ast-index.mjs +0 -60
- package/.output/server/node_modules/rolldown/dist/shared/binding-BeU_1iEk.mjs +0 -582
- package/.output/server/node_modules/rolldown/dist/shared/bindingify-input-options-DbbBhzky.mjs +0 -2211
- package/.output/server/node_modules/rolldown/dist/shared/define-config-DJOr6Iwt.mjs +0 -6
- package/.output/server/node_modules/rolldown/dist/shared/error-DL-e8-oE.mjs +0 -85
- package/.output/server/node_modules/rolldown/dist/shared/logs-D80CXhvg.mjs +0 -180
- package/.output/server/node_modules/rolldown/dist/shared/misc-DJYbNKZX.mjs +0 -21
- package/.output/server/node_modules/rolldown/dist/shared/normalize-string-or-regex-CbQQ69gT.mjs +0 -66
- package/.output/server/node_modules/rolldown/dist/shared/parse-B_ZnWxLZ.mjs +0 -74
- package/.output/server/node_modules/rolldown/dist/shared/prompt-U5ajztzG.mjs +0 -847
- package/.output/server/node_modules/rolldown/dist/shared/rolldown-D3JZ9rMt.mjs +0 -40
- package/.output/server/node_modules/rolldown/dist/shared/rolldown-build-DSxL8qiP.mjs +0 -3325
- package/.output/server/node_modules/rolldown/dist/shared/watch-Bd8v9ewv.mjs +0 -374
- package/.output/server/node_modules/rolldown/package.json +0 -153
- package/.output/server/node_modules/unrun/dist/index.mjs +0 -2
- package/.output/server/node_modules/unrun/dist/src-GU5PtktT.mjs +0 -887
- package/.output/server/node_modules/unrun/package.json +0 -125
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
# jiti
|
|
2
|
+
|
|
3
|
+
<!-- automd:badges color=F0DB4F bundlephobia -->
|
|
4
|
+
|
|
5
|
+
[](https://npmjs.com/package/jiti)
|
|
6
|
+
[](https://npmjs.com/package/jiti)
|
|
7
|
+
[](https://bundlephobia.com/package/jiti)
|
|
8
|
+
|
|
9
|
+
<!-- /automd -->
|
|
10
|
+
|
|
11
|
+
> This is the active development branch. Check out [jiti/v1](https://github.com/unjs/jiti/tree/v1) for legacy v1 docs and code.
|
|
12
|
+
|
|
13
|
+
## 🌟 Used in
|
|
14
|
+
|
|
15
|
+
[Docusaurus](https://docusaurus.io/), [ESLint](https://github.com/eslint/eslint), [FormKit](https://formkit.com/), [Histoire](https://histoire.dev/), [Knip](https://knip.dev/), [Nitro](https://nitro.unjs.io/), [Nuxt](https://nuxt.com/), [PostCSS loader](https://github.com/webpack-contrib/postcss-loader), [Rsbuild](https://rsbuild.dev/), [Size Limit](https://github.com/ai/size-limit), [Slidev](https://sli.dev/), [Tailwindcss](https://tailwindcss.com/), [Tokenami](https://github.com/tokenami/tokenami), [UnoCSS](https://unocss.dev/), [WXT](https://wxt.dev/), [Winglang](https://www.winglang.io/), [Graphql code generator](https://the-guild.dev/graphql/codegen), [Lingui](https://lingui.dev/), [Scaffdog](https://scaff.dog/), [Storybook](https://storybook.js.org), [...UnJS ecosystem](https://unjs.io/), [...60M+ npm monthly downloads](https://npm.chart.dev/jiti), [...6M+ public repositories](https://github.com/unjs/jiti/network/dependents).
|
|
16
|
+
|
|
17
|
+
## ✅ Features
|
|
18
|
+
|
|
19
|
+
- Seamless TypeScript and ESM syntax support for Node.js
|
|
20
|
+
- Seamless interoperability between ESM and CommonJS
|
|
21
|
+
- Asynchronous API to replace `import()`
|
|
22
|
+
- Synchronous API to replace `require()` (deprecated)
|
|
23
|
+
- Super slim and zero dependency
|
|
24
|
+
- Custom resolve aliases
|
|
25
|
+
- Smart syntax detection to avoid extra transforms
|
|
26
|
+
- Node.js native `require.cache` integration
|
|
27
|
+
- Filesystem transpile with hard disk caches
|
|
28
|
+
- ESM Loader support
|
|
29
|
+
- JSX support (opt-in)
|
|
30
|
+
|
|
31
|
+
> [!IMPORTANT]
|
|
32
|
+
> To enhance compatibility, jiti `>=2.1` enabled [`interopDefault`](#interopdefault) using a new Proxy method. If you migrated to `2.0.0` earlier, this might have caused behavior changes. In case of any issues during the upgrade, please [report](https://github.com/unjs/jiti/issues) so we can investigate to solve them. 🙏🏼
|
|
33
|
+
|
|
34
|
+
## 💡 Usage
|
|
35
|
+
|
|
36
|
+
### CLI
|
|
37
|
+
|
|
38
|
+
You can use `jiti` CLI to quickly run any script with TypeScript and native ESM support!
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npx jiti ./index.ts
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Programmatic
|
|
45
|
+
|
|
46
|
+
Initialize a jiti instance:
|
|
47
|
+
|
|
48
|
+
```js
|
|
49
|
+
// ESM
|
|
50
|
+
import { createJiti } from "jiti";
|
|
51
|
+
const jiti = createJiti(import.meta.url);
|
|
52
|
+
|
|
53
|
+
// CommonJS (deprecated)
|
|
54
|
+
const { createJiti } = require("jiti");
|
|
55
|
+
const jiti = createJiti(__filename);
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Import (async) and resolve with ESM compatibility:
|
|
59
|
+
|
|
60
|
+
```js
|
|
61
|
+
// jiti.import(id) is similar to import(id)
|
|
62
|
+
const mod = await jiti.import("./path/to/file.ts");
|
|
63
|
+
|
|
64
|
+
// jiti.esmResolve(id) is similar to import.meta.resolve(id)
|
|
65
|
+
const resolvedPath = jiti.esmResolve("./src");
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
If you need the default export of module, you can use `jiti.import(id, { default: true })` as shortcut to `mod?.default ?? mod`.
|
|
69
|
+
|
|
70
|
+
```js
|
|
71
|
+
// shortcut to mod?.default ?? mod
|
|
72
|
+
const modDefault = await jiti.import("./path/to/file.ts", { default: true });
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
CommonJS (sync & deprecated):
|
|
76
|
+
|
|
77
|
+
```js
|
|
78
|
+
// jiti() is similar to require(id)
|
|
79
|
+
const mod = jiti("./path/to/file.ts");
|
|
80
|
+
|
|
81
|
+
// jiti.resolve() is similar to require.resolve(id)
|
|
82
|
+
const resolvedPath = jiti.resolve("./src");
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
You can also pass options as the second argument:
|
|
86
|
+
|
|
87
|
+
```js
|
|
88
|
+
const jiti = createJiti(import.meta.url, { debug: true });
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Register global ESM loader
|
|
92
|
+
|
|
93
|
+
You can globally register jiti using [global hooks](https://nodejs.org/api/module.html#initialize). (Important: Requires Node.js > 20)
|
|
94
|
+
|
|
95
|
+
```js
|
|
96
|
+
import "jiti/register";
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Or:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
node --import jiti/register index.ts
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## 🎈 `jiti/native`
|
|
106
|
+
|
|
107
|
+
You can alias `jiti` to `jiti/native` to directly depend on runtime's [`import.meta.resolve`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import.meta/resolve) and dynamic [`import()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import) support. This allows easing up the ecosystem transition to runtime native support by giving the same API of jiti.
|
|
108
|
+
|
|
109
|
+
## ⚙️ Options
|
|
110
|
+
|
|
111
|
+
### `debug`
|
|
112
|
+
|
|
113
|
+
- Type: Boolean
|
|
114
|
+
- Default: `false`
|
|
115
|
+
- Environment variable: `JITI_DEBUG`
|
|
116
|
+
|
|
117
|
+
Enable verbose logging. You can use `JITI_DEBUG=1 <your command>` to enable it.
|
|
118
|
+
|
|
119
|
+
### `fsCache`
|
|
120
|
+
|
|
121
|
+
- Type: Boolean | String
|
|
122
|
+
- Default: `true`
|
|
123
|
+
- Environment variable: `JITI_FS_CACHE`
|
|
124
|
+
|
|
125
|
+
Filesystem source cache (enabled by default)
|
|
126
|
+
|
|
127
|
+
By default (when is `true`), jiti uses `node_modules/.cache/jiti` (if exists) or `{TMP_DIR}/jiti`.
|
|
128
|
+
|
|
129
|
+
**Note:** It is recommended that this option be enabled for better performance.
|
|
130
|
+
|
|
131
|
+
### `rebuildFsCache`
|
|
132
|
+
|
|
133
|
+
- Type: Boolean
|
|
134
|
+
- Default: `false`
|
|
135
|
+
- Environment variable: `JITI_REBUILD_FS_CACHE`
|
|
136
|
+
|
|
137
|
+
Rebuild filesystem source cache created by `fsCache`.
|
|
138
|
+
|
|
139
|
+
### `moduleCache`
|
|
140
|
+
|
|
141
|
+
- Type: String
|
|
142
|
+
- Default: `true`
|
|
143
|
+
- Environment variable: `JITI_MODULE_CACHE`
|
|
144
|
+
|
|
145
|
+
Runtime module cache (enabled by default).
|
|
146
|
+
|
|
147
|
+
Disabling allows editing code and importing the same module multiple times.
|
|
148
|
+
|
|
149
|
+
When enabled, jiti integrates with Node.js native CommonJS cache-store.
|
|
150
|
+
|
|
151
|
+
### `transform`
|
|
152
|
+
|
|
153
|
+
- Type: Function
|
|
154
|
+
- Default: Babel (lazy loaded)
|
|
155
|
+
|
|
156
|
+
Transform function. See [src/babel](./src/babel.ts) for more details
|
|
157
|
+
|
|
158
|
+
### `sourceMaps`
|
|
159
|
+
|
|
160
|
+
- Type: Boolean
|
|
161
|
+
- Default `false`
|
|
162
|
+
- Environment variable: `JITI_SOURCE_MAPS`
|
|
163
|
+
|
|
164
|
+
Add inline source map to transformed source for better debugging.
|
|
165
|
+
|
|
166
|
+
### `interopDefault`
|
|
167
|
+
|
|
168
|
+
- Type: Boolean
|
|
169
|
+
- Default: `true`
|
|
170
|
+
- Environment variable: `JITI_INTEROP_DEFAULT`
|
|
171
|
+
|
|
172
|
+
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).
|
|
173
|
+
|
|
174
|
+
> [!WARNING]
|
|
175
|
+
> 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`.
|
|
176
|
+
|
|
177
|
+
### `alias`
|
|
178
|
+
|
|
179
|
+
- Type: Object
|
|
180
|
+
- Default: -
|
|
181
|
+
- Environment variable: `JITI_ALIAS`
|
|
182
|
+
|
|
183
|
+
You can also pass an object to the environment variable for inline config. Example: `JITI_ALIAS='{"~/*": "./src/*"}' jiti ...`.
|
|
184
|
+
|
|
185
|
+
Custom alias map used to resolve IDs.
|
|
186
|
+
|
|
187
|
+
### `tsconfigPaths`
|
|
188
|
+
|
|
189
|
+
- Type: Boolean | String
|
|
190
|
+
- Default: `false`
|
|
191
|
+
- Environment variable: `JITI_TSCONFIG_PATHS`
|
|
192
|
+
|
|
193
|
+
Enable TypeScript [`paths`](https://www.typescriptlang.org/tsconfig/#paths) resolution using [`get-tsconfig`](https://github.com/privatenumber/get-tsconfig).
|
|
194
|
+
|
|
195
|
+
- `true`: Auto-discover `tsconfig.json` by walking up from the jiti instance's parent path.
|
|
196
|
+
- `string`: Explicit path to a `tsconfig.json` file.
|
|
197
|
+
- `false` (default): Disabled.
|
|
198
|
+
|
|
199
|
+
### `nativeModules`
|
|
200
|
+
|
|
201
|
+
- Type: Array
|
|
202
|
+
- Default: ['typescript']
|
|
203
|
+
- Environment variable: `JITI_NATIVE_MODULES`
|
|
204
|
+
|
|
205
|
+
List of modules (within `node_modules`) to always use native `require()` for them.
|
|
206
|
+
|
|
207
|
+
### `transformModules`
|
|
208
|
+
|
|
209
|
+
- Type: Array
|
|
210
|
+
- Default: []
|
|
211
|
+
- Environment variable: `JITI_TRANSFORM_MODULES`
|
|
212
|
+
|
|
213
|
+
List of modules (within `node_modules`) to transform them regardless of syntax.
|
|
214
|
+
|
|
215
|
+
### `importMeta`
|
|
216
|
+
|
|
217
|
+
Parent module's [`import.meta`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import.meta) context to use for ESM resolution. (only used for `jiti/native` import).
|
|
218
|
+
|
|
219
|
+
### `tryNative`
|
|
220
|
+
|
|
221
|
+
- Type: Boolean
|
|
222
|
+
- Default: Enabled if bun is detected
|
|
223
|
+
- Environment variable: `JITI_TRY_NATIVE`
|
|
224
|
+
|
|
225
|
+
Try to use native require and import without jiti transformations first.
|
|
226
|
+
|
|
227
|
+
### `jsx`
|
|
228
|
+
|
|
229
|
+
- Type: Boolean | {options}
|
|
230
|
+
- Default: `false`
|
|
231
|
+
- Environment Variable: `JITI_JSX`
|
|
232
|
+
|
|
233
|
+
Enable JSX support using [`@babel/plugin-transform-react-jsx`](https://babeljs.io/docs/babel-plugin-transform-react-jsx).
|
|
234
|
+
|
|
235
|
+
See [`test/fixtures/jsx`](./test/fixtures/jsx) for framework integration examples.
|
|
236
|
+
|
|
237
|
+
## Development
|
|
238
|
+
|
|
239
|
+
- Clone this repository
|
|
240
|
+
- Enable [Corepack](https://github.com/nodejs/corepack) using `corepack enable`
|
|
241
|
+
- Install dependencies using `pnpm install`
|
|
242
|
+
- Run `pnpm dev`
|
|
243
|
+
- Run `pnpm jiti ./test/path/to/file.ts`
|
|
244
|
+
|
|
245
|
+
## License
|
|
246
|
+
|
|
247
|
+
<!-- automd:contributors license=MIT author="pi0" -->
|
|
248
|
+
|
|
249
|
+
Published under the [MIT](https://github.com/unjs/jiti/blob/main/LICENSE) license.
|
|
250
|
+
Made by [@pi0](https://github.com/pi0) and [community](https://github.com/unjs/jiti/graphs/contributors) 💛
|
|
251
|
+
<br><br>
|
|
252
|
+
<a href="https://github.com/unjs/jiti/graphs/contributors">
|
|
253
|
+
<img src="https://contrib.rocks/image?repo=unjs/jiti" />
|
|
254
|
+
</a>
|
|
255
|
+
|
|
256
|
+
<!-- /automd -->
|
|
257
|
+
|
|
258
|
+
<!-- automd:with-automd -->
|