nitro-nightly 3.0.1-20260121-183047-b2b37883 → 3.0.1-20260122-173608-d4f5eafd

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.
@@ -1,236 +1,236 @@
1
1
  import { Plugin } from "rollup";
2
2
 
3
- //#region node_modules/.pnpm/@rollup+pluginutils@5.3.0_rollup@4.55.2/node_modules/@rollup/pluginutils/types/index.d.ts
3
+ //#region node_modules/.pnpm/@rollup+pluginutils@5.3.0_rollup@4.55.3/node_modules/@rollup/pluginutils/types/index.d.ts
4
4
  /**
5
5
  * A valid `picomatch` glob pattern, or array of patterns.
6
6
  */
7
7
  type FilterPattern = ReadonlyArray<string | RegExp> | string | RegExp | null;
8
8
  //#endregion
9
- //#region node_modules/.pnpm/@rollup+plugin-commonjs@29.0.0_rollup@4.55.2/node_modules/@rollup/plugin-commonjs/types/index.d.ts
9
+ //#region node_modules/.pnpm/@rollup+plugin-commonjs@29.0.0_rollup@4.55.3/node_modules/@rollup/plugin-commonjs/types/index.d.ts
10
10
  type RequireReturnsDefaultOption = boolean | 'auto' | 'preferred' | 'namespace';
11
11
  type DefaultIsModuleExportsOption = boolean | 'auto';
12
12
  interface RollupCommonJSOptions {
13
13
  /**
14
- * A picomatch pattern, or array of patterns, which specifies the files in
15
- * the build the plugin should operate on. By default, all files with
16
- * extension `".cjs"` or those in `extensions` are included, but you can
17
- * narrow this list by only including specific files. These files will be
18
- * analyzed and transpiled if either the analysis does not find ES module
19
- * specific statements or `transformMixedEsModules` is `true`.
20
- * @default undefined
21
- */
14
+ * A picomatch pattern, or array of patterns, which specifies the files in
15
+ * the build the plugin should operate on. By default, all files with
16
+ * extension `".cjs"` or those in `extensions` are included, but you can
17
+ * narrow this list by only including specific files. These files will be
18
+ * analyzed and transpiled if either the analysis does not find ES module
19
+ * specific statements or `transformMixedEsModules` is `true`.
20
+ * @default undefined
21
+ */
22
22
  include?: FilterPattern;
23
23
  /**
24
- * A picomatch pattern, or array of patterns, which specifies the files in
25
- * the build the plugin should _ignore_. By default, all files with
26
- * extensions other than those in `extensions` or `".cjs"` are ignored, but you
27
- * can exclude additional files. See also the `include` option.
28
- * @default undefined
29
- */
24
+ * A picomatch pattern, or array of patterns, which specifies the files in
25
+ * the build the plugin should _ignore_. By default, all files with
26
+ * extensions other than those in `extensions` or `".cjs"` are ignored, but you
27
+ * can exclude additional files. See also the `include` option.
28
+ * @default undefined
29
+ */
30
30
  exclude?: FilterPattern;
31
31
  /**
32
- * For extensionless imports, search for extensions other than .js in the
33
- * order specified. Note that you need to make sure that non-JavaScript files
34
- * are transpiled by another plugin first.
35
- * @default [ '.js' ]
36
- */
32
+ * For extensionless imports, search for extensions other than .js in the
33
+ * order specified. Note that you need to make sure that non-JavaScript files
34
+ * are transpiled by another plugin first.
35
+ * @default [ '.js' ]
36
+ */
37
37
  extensions?: ReadonlyArray<string>;
38
38
  /**
39
- * If true then uses of `global` won't be dealt with by this plugin
40
- * @default false
41
- */
39
+ * If true then uses of `global` won't be dealt with by this plugin
40
+ * @default false
41
+ */
42
42
  ignoreGlobal?: boolean;
43
43
  /**
44
- * If false, skips source map generation for CommonJS modules. This will
45
- * improve performance.
46
- * @default true
47
- */
44
+ * If false, skips source map generation for CommonJS modules. This will
45
+ * improve performance.
46
+ * @default true
47
+ */
48
48
  sourceMap?: boolean;
49
49
  /**
50
- * Some `require` calls cannot be resolved statically to be translated to
51
- * imports.
52
- * When this option is set to `false`, the generated code will either
53
- * directly throw an error when such a call is encountered or, when
54
- * `dynamicRequireTargets` is used, when such a call cannot be resolved with a
55
- * configured dynamic require target.
56
- * Setting this option to `true` will instead leave the `require` call in the
57
- * code or use it as a fallback for `dynamicRequireTargets`.
58
- * @default false
59
- */
50
+ * Some `require` calls cannot be resolved statically to be translated to
51
+ * imports.
52
+ * When this option is set to `false`, the generated code will either
53
+ * directly throw an error when such a call is encountered or, when
54
+ * `dynamicRequireTargets` is used, when such a call cannot be resolved with a
55
+ * configured dynamic require target.
56
+ * Setting this option to `true` will instead leave the `require` call in the
57
+ * code or use it as a fallback for `dynamicRequireTargets`.
58
+ * @default false
59
+ */
60
60
  ignoreDynamicRequires?: boolean;
61
61
  /**
62
- * Instructs the plugin whether to enable mixed module transformations. This
63
- * is useful in scenarios with modules that contain a mix of ES `import`
64
- * statements and CommonJS `require` expressions. Set to `true` if `require`
65
- * calls should be transformed to imports in mixed modules, or `false` if the
66
- * `require` expressions should survive the transformation. The latter can be
67
- * important if the code contains environment detection, or you are coding
68
- * for an environment with special treatment for `require` calls such as
69
- * ElectronJS. See also the `ignore` option.
70
- * @default false
71
- */
62
+ * Instructs the plugin whether to enable mixed module transformations. This
63
+ * is useful in scenarios with modules that contain a mix of ES `import`
64
+ * statements and CommonJS `require` expressions. Set to `true` if `require`
65
+ * calls should be transformed to imports in mixed modules, or `false` if the
66
+ * `require` expressions should survive the transformation. The latter can be
67
+ * important if the code contains environment detection, or you are coding
68
+ * for an environment with special treatment for `require` calls such as
69
+ * ElectronJS. See also the `ignore` option.
70
+ * @default false
71
+ */
72
72
  transformMixedEsModules?: boolean;
73
73
  /**
74
- * By default, this plugin will try to hoist `require` statements as imports
75
- * to the top of each file. While this works well for many code bases and
76
- * allows for very efficient ESM output, it does not perfectly capture
77
- * CommonJS semantics as the order of side effects like log statements may
78
- * change. But it is especially problematic when there are circular `require`
79
- * calls between CommonJS modules as those often rely on the lazy execution of
80
- * nested `require` calls.
81
- *
82
- * Setting this option to `true` will wrap all CommonJS files in functions
83
- * which are executed when they are required for the first time, preserving
84
- * NodeJS semantics. Note that this can have an impact on the size and
85
- * performance of the generated code.
86
- *
87
- * The default value of `"auto"` will only wrap CommonJS files when they are
88
- * part of a CommonJS dependency cycle, e.g. an index file that is required by
89
- * many of its dependencies. All other CommonJS files are hoisted. This is the
90
- * recommended setting for most code bases.
91
- *
92
- * `false` will entirely prevent wrapping and hoist all files. This may still
93
- * work depending on the nature of cyclic dependencies but will often cause
94
- * problems.
95
- *
96
- * You can also provide a picomatch pattern, or array of patterns, to only
97
- * specify a subset of files which should be wrapped in functions for proper
98
- * `require` semantics.
99
- *
100
- * `"debug"` works like `"auto"` but after bundling, it will display a warning
101
- * containing a list of ids that have been wrapped which can be used as
102
- * picomatch pattern for fine-tuning.
103
- * @default "auto"
104
- */
74
+ * By default, this plugin will try to hoist `require` statements as imports
75
+ * to the top of each file. While this works well for many code bases and
76
+ * allows for very efficient ESM output, it does not perfectly capture
77
+ * CommonJS semantics as the order of side effects like log statements may
78
+ * change. But it is especially problematic when there are circular `require`
79
+ * calls between CommonJS modules as those often rely on the lazy execution of
80
+ * nested `require` calls.
81
+ *
82
+ * Setting this option to `true` will wrap all CommonJS files in functions
83
+ * which are executed when they are required for the first time, preserving
84
+ * NodeJS semantics. Note that this can have an impact on the size and
85
+ * performance of the generated code.
86
+ *
87
+ * The default value of `"auto"` will only wrap CommonJS files when they are
88
+ * part of a CommonJS dependency cycle, e.g. an index file that is required by
89
+ * many of its dependencies. All other CommonJS files are hoisted. This is the
90
+ * recommended setting for most code bases.
91
+ *
92
+ * `false` will entirely prevent wrapping and hoist all files. This may still
93
+ * work depending on the nature of cyclic dependencies but will often cause
94
+ * problems.
95
+ *
96
+ * You can also provide a picomatch pattern, or array of patterns, to only
97
+ * specify a subset of files which should be wrapped in functions for proper
98
+ * `require` semantics.
99
+ *
100
+ * `"debug"` works like `"auto"` but after bundling, it will display a warning
101
+ * containing a list of ids that have been wrapped which can be used as
102
+ * picomatch pattern for fine-tuning.
103
+ * @default "auto"
104
+ */
105
105
  strictRequires?: boolean | FilterPattern;
106
106
  /**
107
- * Sometimes you have to leave require statements unconverted. Pass an array
108
- * containing the IDs or a `id => boolean` function.
109
- * @default []
110
- */
107
+ * Sometimes you have to leave require statements unconverted. Pass an array
108
+ * containing the IDs or a `id => boolean` function.
109
+ * @default []
110
+ */
111
111
  ignore?: ReadonlyArray<string> | ((id: string) => boolean);
112
112
  /**
113
- * In most cases, where `require` calls are inside a `try-catch` clause,
114
- * they should be left unconverted as it requires an optional dependency
115
- * that may or may not be installed beside the rolled up package.
116
- * Due to the conversion of `require` to a static `import` - the call is
117
- * hoisted to the top of the file, outside the `try-catch` clause.
118
- *
119
- * - `true`: Default. All `require` calls inside a `try` will be left unconverted.
120
- * - `false`: All `require` calls inside a `try` will be converted as if the
121
- * `try-catch` clause is not there.
122
- * - `remove`: Remove all `require` calls from inside any `try` block.
123
- * - `string[]`: Pass an array containing the IDs to left unconverted.
124
- * - `((id: string) => boolean|'remove')`: Pass a function that controls
125
- * individual IDs.
126
- *
127
- * @default true
128
- */
113
+ * In most cases, where `require` calls are inside a `try-catch` clause,
114
+ * they should be left unconverted as it requires an optional dependency
115
+ * that may or may not be installed beside the rolled up package.
116
+ * Due to the conversion of `require` to a static `import` - the call is
117
+ * hoisted to the top of the file, outside the `try-catch` clause.
118
+ *
119
+ * - `true`: Default. All `require` calls inside a `try` will be left unconverted.
120
+ * - `false`: All `require` calls inside a `try` will be converted as if the
121
+ * `try-catch` clause is not there.
122
+ * - `remove`: Remove all `require` calls from inside any `try` block.
123
+ * - `string[]`: Pass an array containing the IDs to left unconverted.
124
+ * - `((id: string) => boolean|'remove')`: Pass a function that controls
125
+ * individual IDs.
126
+ *
127
+ * @default true
128
+ */
129
129
  ignoreTryCatch?: boolean | 'remove' | ReadonlyArray<string> | ((id: string) => boolean | 'remove');
130
130
  /**
131
- * Controls how to render imports from external dependencies. By default,
132
- * this plugin assumes that all external dependencies are CommonJS. This
133
- * means they are rendered as default imports to be compatible with e.g.
134
- * NodeJS where ES modules can only import a default export from a CommonJS
135
- * dependency.
136
- *
137
- * If you set `esmExternals` to `true`, this plugin assumes that all
138
- * external dependencies are ES modules and respect the
139
- * `requireReturnsDefault` option. If that option is not set, they will be
140
- * rendered as namespace imports.
141
- *
142
- * You can also supply an array of ids to be treated as ES modules, or a
143
- * function that will be passed each external id to determine whether it is
144
- * an ES module.
145
- * @default false
146
- */
131
+ * Controls how to render imports from external dependencies. By default,
132
+ * this plugin assumes that all external dependencies are CommonJS. This
133
+ * means they are rendered as default imports to be compatible with e.g.
134
+ * NodeJS where ES modules can only import a default export from a CommonJS
135
+ * dependency.
136
+ *
137
+ * If you set `esmExternals` to `true`, this plugin assumes that all
138
+ * external dependencies are ES modules and respect the
139
+ * `requireReturnsDefault` option. If that option is not set, they will be
140
+ * rendered as namespace imports.
141
+ *
142
+ * You can also supply an array of ids to be treated as ES modules, or a
143
+ * function that will be passed each external id to determine whether it is
144
+ * an ES module.
145
+ * @default false
146
+ */
147
147
  esmExternals?: boolean | ReadonlyArray<string> | ((id: string) => boolean);
148
148
  /**
149
- * Controls what is returned when requiring an ES module from a CommonJS file.
150
- * When using the `esmExternals` option, this will also apply to external
151
- * modules. By default, this plugin will render those imports as namespace
152
- * imports i.e.
153
- *
154
- * ```js
155
- * // input
156
- * const foo = require('foo');
157
- *
158
- * // output
159
- * import * as foo from 'foo';
160
- * ```
161
- *
162
- * However, there are some situations where this may not be desired.
163
- * For these situations, you can change Rollup's behaviour either globally or
164
- * per module. To change it globally, set the `requireReturnsDefault` option
165
- * to one of the following values:
166
- *
167
- * - `false`: This is the default, requiring an ES module returns its
168
- * namespace. This is the only option that will also add a marker
169
- * `__esModule: true` to the namespace to support interop patterns in
170
- * CommonJS modules that are transpiled ES modules.
171
- * - `"namespace"`: Like `false`, requiring an ES module returns its
172
- * namespace, but the plugin does not add the `__esModule` marker and thus
173
- * creates more efficient code. For external dependencies when using
174
- * `esmExternals: true`, no additional interop code is generated.
175
- * - `"auto"`: This is complementary to how `output.exports: "auto"` works in
176
- * Rollup: If a module has a default export and no named exports, requiring
177
- * that module returns the default export. In all other cases, the namespace
178
- * is returned. For external dependencies when using `esmExternals: true`, a
179
- * corresponding interop helper is added.
180
- * - `"preferred"`: If a module has a default export, requiring that module
181
- * always returns the default export, no matter whether additional named
182
- * exports exist. This is similar to how previous versions of this plugin
183
- * worked. Again for external dependencies when using `esmExternals: true`,
184
- * an interop helper is added.
185
- * - `true`: This will always try to return the default export on require
186
- * without checking if it actually exists. This can throw at build time if
187
- * there is no default export. This is how external dependencies are handled
188
- * when `esmExternals` is not used. The advantage over the other options is
189
- * that, like `false`, this does not add an interop helper for external
190
- * dependencies, keeping the code lean.
191
- *
192
- * To change this for individual modules, you can supply a function for
193
- * `requireReturnsDefault` instead. This function will then be called once for
194
- * each required ES module or external dependency with the corresponding id
195
- * and allows you to return different values for different modules.
196
- * @default false
197
- */
149
+ * Controls what is returned when requiring an ES module from a CommonJS file.
150
+ * When using the `esmExternals` option, this will also apply to external
151
+ * modules. By default, this plugin will render those imports as namespace
152
+ * imports i.e.
153
+ *
154
+ * ```js
155
+ * // input
156
+ * const foo = require('foo');
157
+ *
158
+ * // output
159
+ * import * as foo from 'foo';
160
+ * ```
161
+ *
162
+ * However, there are some situations where this may not be desired.
163
+ * For these situations, you can change Rollup's behaviour either globally or
164
+ * per module. To change it globally, set the `requireReturnsDefault` option
165
+ * to one of the following values:
166
+ *
167
+ * - `false`: This is the default, requiring an ES module returns its
168
+ * namespace. This is the only option that will also add a marker
169
+ * `__esModule: true` to the namespace to support interop patterns in
170
+ * CommonJS modules that are transpiled ES modules.
171
+ * - `"namespace"`: Like `false`, requiring an ES module returns its
172
+ * namespace, but the plugin does not add the `__esModule` marker and thus
173
+ * creates more efficient code. For external dependencies when using
174
+ * `esmExternals: true`, no additional interop code is generated.
175
+ * - `"auto"`: This is complementary to how `output.exports: "auto"` works in
176
+ * Rollup: If a module has a default export and no named exports, requiring
177
+ * that module returns the default export. In all other cases, the namespace
178
+ * is returned. For external dependencies when using `esmExternals: true`, a
179
+ * corresponding interop helper is added.
180
+ * - `"preferred"`: If a module has a default export, requiring that module
181
+ * always returns the default export, no matter whether additional named
182
+ * exports exist. This is similar to how previous versions of this plugin
183
+ * worked. Again for external dependencies when using `esmExternals: true`,
184
+ * an interop helper is added.
185
+ * - `true`: This will always try to return the default export on require
186
+ * without checking if it actually exists. This can throw at build time if
187
+ * there is no default export. This is how external dependencies are handled
188
+ * when `esmExternals` is not used. The advantage over the other options is
189
+ * that, like `false`, this does not add an interop helper for external
190
+ * dependencies, keeping the code lean.
191
+ *
192
+ * To change this for individual modules, you can supply a function for
193
+ * `requireReturnsDefault` instead. This function will then be called once for
194
+ * each required ES module or external dependency with the corresponding id
195
+ * and allows you to return different values for different modules.
196
+ * @default false
197
+ */
198
198
  requireReturnsDefault?: RequireReturnsDefaultOption | ((id: string) => RequireReturnsDefaultOption);
199
199
  /**
200
- * @default "auto"
201
- */
200
+ * @default "auto"
201
+ */
202
202
  defaultIsModuleExports?: DefaultIsModuleExportsOption | ((id: string) => DefaultIsModuleExportsOption);
203
203
  /**
204
- * Some modules contain dynamic `require` calls, or require modules that
205
- * contain circular dependencies, which are not handled well by static
206
- * imports. Including those modules as `dynamicRequireTargets` will simulate a
207
- * CommonJS (NodeJS-like) environment for them with support for dynamic
208
- * dependencies. It also enables `strictRequires` for those modules.
209
- *
210
- * Note: In extreme cases, this feature may result in some paths being
211
- * rendered as absolute in the final bundle. The plugin tries to avoid
212
- * exposing paths from the local machine, but if you are `dynamicRequirePaths`
213
- * with paths that are far away from your project's folder, that may require
214
- * replacing strings like `"/Users/John/Desktop/foo-project/"` -> `"/"`.
215
- */
204
+ * Some modules contain dynamic `require` calls, or require modules that
205
+ * contain circular dependencies, which are not handled well by static
206
+ * imports. Including those modules as `dynamicRequireTargets` will simulate a
207
+ * CommonJS (NodeJS-like) environment for them with support for dynamic
208
+ * dependencies. It also enables `strictRequires` for those modules.
209
+ *
210
+ * Note: In extreme cases, this feature may result in some paths being
211
+ * rendered as absolute in the final bundle. The plugin tries to avoid
212
+ * exposing paths from the local machine, but if you are `dynamicRequirePaths`
213
+ * with paths that are far away from your project's folder, that may require
214
+ * replacing strings like `"/Users/John/Desktop/foo-project/"` -> `"/"`.
215
+ */
216
216
  dynamicRequireTargets?: string | ReadonlyArray<string>;
217
217
  /**
218
- * To avoid long paths when using the `dynamicRequireTargets` option, you can use this option to specify a directory
219
- * that is a common parent for all files that use dynamic require statements. Using a directory higher up such as `/`
220
- * may lead to unnecessarily long paths in the generated code and may expose directory names on your machine like your
221
- * home directory name. By default, it uses the current working directory.
222
- */
218
+ * To avoid long paths when using the `dynamicRequireTargets` option, you can use this option to specify a directory
219
+ * that is a common parent for all files that use dynamic require statements. Using a directory higher up such as `/`
220
+ * may lead to unnecessarily long paths in the generated code and may expose directory names on your machine like your
221
+ * home directory name. By default, it uses the current working directory.
222
+ */
223
223
  dynamicRequireRoot?: string;
224
224
  /**
225
- * When enabled, external Node built-ins (e.g., `node:fs`) required from wrapped CommonJS modules
226
- * will use `createRequire(import.meta.url)` instead of being hoisted as ESM imports. This prevents
227
- * eager loading of Node built-ins at module initialization time.
228
- *
229
- * Note: This option adds a dependency on `node:module` in the output, which may not be available
230
- * in some environments like edge runtimes (Cloudflare Workers, Vercel Edge Runtime).
231
- *
232
- * @default false
233
- */
225
+ * When enabled, external Node built-ins (e.g., `node:fs`) required from wrapped CommonJS modules
226
+ * will use `createRequire(import.meta.url)` instead of being hoisted as ESM imports. This prevents
227
+ * eager loading of Node built-ins at module initialization time.
228
+ *
229
+ * Note: This option adds a dependency on `node:module` in the output, which may not be available
230
+ * in some environments like edge runtimes (Cloudflare Workers, Vercel Edge Runtime).
231
+ *
232
+ * @default false
233
+ */
234
234
  requireNodeBuiltins?: boolean;
235
235
  }
236
236
  /**