@visulima/packem 2.0.0-alpha.92 → 2.0.0-alpha.94
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/CHANGELOG.md +17 -0
- package/LICENSE.md +1211 -186
- package/dist/babel-runtime/packem_shared/transform-code-DtqOY-lW.js +1 -0
- package/dist/babel-runtime/plugins/babel/worker.js +1 -1
- package/dist/builder/typedoc/index.d.ts +1 -1
- package/dist/builder/typedoc/index.js +2 -2
- package/dist/cli/index.js +17 -17
- package/dist/config/index.d.ts +42 -42
- package/dist/config/preset/preact.d.ts +8 -8
- package/dist/config/preset/react.d.ts +43 -43
- package/dist/config/preset/solid.d.ts +73 -73
- package/dist/config/preset/svelte.d.ts +46 -46
- package/dist/config/preset/vue.d.ts +33 -33
- package/dist/index.d.ts +35 -35
- package/dist/index.js +61 -39
- package/dist/packem_shared/create-or-update-key-storage-BFOAEuWX.js +26 -0
- package/dist/packem_shared/default-BSbw_3ev.js +1 -0
- package/dist/packem_shared/index-D_5MmI7f.js +301 -0
- package/dist/packem_shared/oxcTransformPlugin-Dwvbw2jE-CI_T_eTp.js +168 -0
- package/dist/packem_shared/{types.d-BkLP91NJ.d.ts → types.d-CA4tXIce.d.ts} +178 -178
- package/dist/packem_shared/utils-DqCpIxDx.js +1 -0
- package/dist/rollup/plugins/oxc/oxc-transformer.js +1 -1
- package/package.json +16 -16
- package/dist/babel-runtime/packem_shared/transform-code-KNtowoK1.js +0 -1
- package/dist/packem_shared/create-or-update-key-storage-DHOKZmnD.js +0 -28
- package/dist/packem_shared/default-mHB0zin0.js +0 -1
- package/dist/packem_shared/index-BXEUcumB.js +0 -249
- package/dist/packem_shared/oxcTransformPlugin-Dwvbw2jE-BsmmBg7q.js +0 -177
- package/dist/packem_shared/utils-Bsoe7qJG.js +0 -1
|
@@ -15,31 +15,31 @@ type ExeArch = "arm64" | "x64";
|
|
|
15
15
|
interface ExeTarget {
|
|
16
16
|
arch: ExeArch;
|
|
17
17
|
/**
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
* Node.js version to use for the executable.
|
|
19
|
+
*
|
|
20
|
+
* Accepts a valid semver string (e.g., `"25.7.0"`), or the special values
|
|
21
|
+
* `"latest"` / `"latest-lts"` which resolve the version automatically from
|
|
22
|
+
* {@link https://nodejs.org/dist/index.json}.
|
|
23
|
+
*
|
|
24
|
+
* The minimum required version is 25.7.0, which is when stable SEA support landed in Node.js.
|
|
25
|
+
*/
|
|
26
26
|
nodeVersion: "latest" | "latest-lts" | (string & {}) | `${string}.${string}.${string}`;
|
|
27
27
|
platform: ExePlatform;
|
|
28
28
|
}
|
|
29
29
|
interface ExeExtensionOptions {
|
|
30
30
|
/**
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
31
|
+
* Cross-platform targets for building executables.
|
|
32
|
+
* When specified, builds an executable for each target platform/arch combination
|
|
33
|
+
* by downloading and caching the corresponding Node.js binary from nodejs.org.
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* targets: [
|
|
37
|
+
* { platform: "linux", arch: "x64", nodeVersion: "25.7.0" },
|
|
38
|
+
* { platform: "darwin", arch: "arm64", nodeVersion: "25.7.0" },
|
|
39
|
+
* { platform: "win", arch: "x64", nodeVersion: "25.7.0" },
|
|
40
|
+
* ]
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
43
|
targets?: ExeTarget[];
|
|
44
44
|
}
|
|
45
45
|
interface ExeChunk {
|
|
@@ -67,63 +67,63 @@ interface SeaConfig {
|
|
|
67
67
|
}
|
|
68
68
|
interface ExeOptions extends ExeExtensionOptions {
|
|
69
69
|
/**
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
* Output file name without any suffix or extension.
|
|
71
|
+
* For example, do not include `.exe`, platform suffixes, or architecture suffixes.
|
|
72
|
+
*/
|
|
73
73
|
fileName?: ((chunk: ExeChunk) => string) | string;
|
|
74
74
|
/**
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
* Output directory for executables.
|
|
76
|
+
* @default "build"
|
|
77
|
+
*/
|
|
78
78
|
outDir?: string;
|
|
79
79
|
/**
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
* Node.js SEA configuration passthrough.
|
|
81
|
+
* @see https://nodejs.org/api/single-executable-applications.html#generating-single-executable-applications-with---build-sea
|
|
82
|
+
*/
|
|
83
83
|
seaConfig?: Omit<SeaConfig, "main" | "mainFormat" | "output">;
|
|
84
84
|
}
|
|
85
85
|
type Node10CompatibilityOptions = {
|
|
86
86
|
typeScriptVersion?: string;
|
|
87
87
|
writeToPackageJson?: boolean;
|
|
88
88
|
};
|
|
89
|
-
type DeepPartial<T> = { [P in keyof T]?: DeepPartial<T[P]
|
|
89
|
+
type DeepPartial<T> = { [P in keyof T]?: DeepPartial<T[P]>; };
|
|
90
90
|
interface AttwOptions extends CheckPackageOptions {
|
|
91
91
|
/**
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
* Ignore the scripts on pack
|
|
93
|
+
* @default false
|
|
94
|
+
*/
|
|
95
95
|
ignoreScripts?: boolean;
|
|
96
96
|
/**
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
97
|
+
* The level of the check.
|
|
98
|
+
*
|
|
99
|
+
* The available levels are:
|
|
100
|
+
* - `error`: fails the build
|
|
101
|
+
* - `warn`: warns the build
|
|
102
|
+
* @default 'warn'
|
|
103
|
+
*/
|
|
104
104
|
level?: "error" | "warn";
|
|
105
105
|
/**
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
106
|
+
* Specify the package manager to use for --pack
|
|
107
|
+
* Bun does not support --json option on the pack command, if you choose bun you will get a error.
|
|
108
|
+
* @default 'auto'
|
|
109
|
+
*/
|
|
110
110
|
pm?: "pnpm" | "yarn" | "npm" | "bun" | "auto";
|
|
111
111
|
/**
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
112
|
+
* Profiles select a set of resolution modes to require/ignore. All are evaluated but failures outside
|
|
113
|
+
* of those required are ignored.
|
|
114
|
+
*
|
|
115
|
+
* The available profiles are:
|
|
116
|
+
* - `strict`: requires all resolutions
|
|
117
|
+
* - `node16`: ignores node10 resolution failures
|
|
118
|
+
* - `esmOnly`: ignores CJS resolution failures
|
|
119
|
+
* @default 'strict'
|
|
120
|
+
*/
|
|
121
121
|
profile?: "strict" | "node16" | "esmOnly";
|
|
122
122
|
}
|
|
123
123
|
/**
|
|
124
|
-
* In addition to basic `entries`, `presets`, and `hooks`,
|
|
125
|
-
* there are also all the properties of `BuildOptions` except for BuildOption's `entries`.
|
|
126
|
-
*/
|
|
124
|
+
* In addition to basic `entries`, `presets`, and `hooks`,
|
|
125
|
+
* there are also all the properties of `BuildOptions` except for BuildOption's `entries`.
|
|
126
|
+
*/
|
|
127
127
|
interface BuildConfig extends DeepPartial<Omit<BuildOptions, "entries">> {
|
|
128
128
|
entries?: (BuildEntry | string)[];
|
|
129
129
|
envFile?: string;
|
|
@@ -133,13 +133,13 @@ interface BuildConfig extends DeepPartial<Omit<BuildOptions, "entries">> {
|
|
|
133
133
|
}
|
|
134
134
|
type BuildPreset = BuildConfig | (() => BuildConfig);
|
|
135
135
|
/**
|
|
136
|
-
* Function type for dynamic build configuration.
|
|
137
|
-
* Allows configuration to be generated based on environment and mode.
|
|
138
|
-
* @param environment The build environment (development/production)
|
|
139
|
-
* @param mode The build mode (build/watch)
|
|
140
|
-
* @returns Build configuration object or Promise resolving to one
|
|
141
|
-
* @public
|
|
142
|
-
*/
|
|
136
|
+
* Function type for dynamic build configuration.
|
|
137
|
+
* Allows configuration to be generated based on environment and mode.
|
|
138
|
+
* @param environment The build environment (development/production)
|
|
139
|
+
* @param mode The build mode (build/watch)
|
|
140
|
+
* @returns Build configuration object or Promise resolving to one
|
|
141
|
+
* @public
|
|
142
|
+
*/
|
|
143
143
|
type BuildConfigFunction = (environment: Environment, mode: Mode) => BuildConfig | Promise<BuildConfig>;
|
|
144
144
|
type BuildEntry = {
|
|
145
145
|
/** Whether to generate CommonJS output for this entry */
|
|
@@ -151,12 +151,12 @@ type BuildEntry = {
|
|
|
151
151
|
/** Whether to generate .d.mts declaration file without triggering ESM JS build */
|
|
152
152
|
declarationEsm?: boolean;
|
|
153
153
|
/**
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
154
|
+
* Set of declaration file extensions package.json's exports map references for
|
|
155
|
+
* this entry (e.g. `{ "d.mts", "d.cts" }`). Derived by infer-entries from the
|
|
156
|
+
* actual type file paths in exports; used by the DTS build to emit exactly the
|
|
157
|
+
* files package.json consumers will resolve. Takes precedence over the global
|
|
158
|
+
* `emitCJS`/`emitESM` + `declaration` flags when present.
|
|
159
|
+
*/
|
|
160
160
|
declarationExtensions?: Set<"d.cts" | "d.mts" | "d.ts">;
|
|
161
161
|
/** Build environment for this entry */
|
|
162
162
|
environment?: Environment;
|
|
@@ -180,22 +180,22 @@ type BuildEntry = {
|
|
|
180
180
|
runtime?: Runtime;
|
|
181
181
|
};
|
|
182
182
|
/**
|
|
183
|
-
* A banner/footer value. Either a static string or a function receiving the
|
|
184
|
-
* rendered chunk and returning the text to prepend/append. Passed straight
|
|
185
|
-
* through to Rollup/Rolldown `output.banner` / `output.footer`, so both
|
|
186
|
-
* bundler backends honour it.
|
|
187
|
-
*/
|
|
183
|
+
* A banner/footer value. Either a static string or a function receiving the
|
|
184
|
+
* rendered chunk and returning the text to prepend/append. Passed straight
|
|
185
|
+
* through to Rollup/Rolldown `output.banner` / `output.footer`, so both
|
|
186
|
+
* bundler backends honour it.
|
|
187
|
+
*/
|
|
188
188
|
type BannerFooterValue = string | ((chunk: RenderedChunk) => Promise<string> | string);
|
|
189
189
|
/**
|
|
190
|
-
* Banner/footer configuration. A bare string or function targets the JavaScript
|
|
191
|
-
* output only. Use the object form to target the JavaScript bundle (`js`) and/or
|
|
192
|
-
* the generated declaration files (`dts`) independently.
|
|
193
|
-
* @example
|
|
194
|
-
* ```ts
|
|
195
|
-
* banner: "/* @license MIT *\/", // js only
|
|
196
|
-
* banner: { js: "'use client';", dts: "// types" } // per output
|
|
197
|
-
* ```
|
|
198
|
-
*/
|
|
190
|
+
* Banner/footer configuration. A bare string or function targets the JavaScript
|
|
191
|
+
* output only. Use the object form to target the JavaScript bundle (`js`) and/or
|
|
192
|
+
* the generated declaration files (`dts`) independently.
|
|
193
|
+
* @example
|
|
194
|
+
* ```ts
|
|
195
|
+
* banner: "/* @license MIT *\/", // js only
|
|
196
|
+
* banner: { js: "'use client';", dts: "// types" } // per output
|
|
197
|
+
* ```
|
|
198
|
+
*/
|
|
199
199
|
type BannerFooterOption = BannerFooterValue | {
|
|
200
200
|
dts?: BannerFooterValue;
|
|
201
201
|
js?: BannerFooterValue;
|
|
@@ -206,24 +206,24 @@ interface BuildOptions {
|
|
|
206
206
|
/** Whether to analyze bundle size and dependencies */
|
|
207
207
|
analyze?: boolean;
|
|
208
208
|
/**
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
209
|
+
* Text to prepend to the build output. Maps to Rollup/Rolldown
|
|
210
|
+
* `output.banner` and is applied to both the CommonJS and ESM bundles.
|
|
211
|
+
* A bare string/function targets the JS output; use `{ js, dts }` to also
|
|
212
|
+
* prepend a header to the generated declaration files.
|
|
213
|
+
*/
|
|
214
214
|
banner?: BannerFooterOption;
|
|
215
215
|
/** Browser targets for transpilation (e.g., ['chrome 58', 'firefox 57']) */
|
|
216
216
|
browserTargets?: string[];
|
|
217
217
|
/** Custom builder functions for different build types */
|
|
218
218
|
builder?: Record<string, (context: BuildContext<BuildOptions>, cachePath: string | undefined, fileCache: FileCache, logged: boolean) => Promise<void>>;
|
|
219
219
|
/**
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
220
|
+
* Bundler to use for building source files.
|
|
221
|
+
*
|
|
222
|
+
* When set to `"rolldown"` the `transformer` option must be omitted —
|
|
223
|
+
* rolldown ships its own oxc-based transform and always uses it. The
|
|
224
|
+
* esbuild/swc/sucrase/oxc transformer adapters only apply under the default
|
|
225
|
+
* `"rollup"` bundler.
|
|
226
|
+
*/
|
|
227
227
|
bundler?: "rollup" | "rolldown";
|
|
228
228
|
/** Whether to enable CommonJS interop for ESM modules */
|
|
229
229
|
cjsInterop?: boolean;
|
|
@@ -232,24 +232,24 @@ interface BuildOptions {
|
|
|
232
232
|
/** Whether to enable debug mode with verbose logging */
|
|
233
233
|
debug: boolean;
|
|
234
234
|
/**
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
235
|
+
* `compatible` means "src/gather.ts" will generate "dist/index.d.mts", "dist/index.d.cts" and "dist/index.d.ts".
|
|
236
|
+
* `node16` means "src/gather.ts" will generate "dist/index.d.mts" and "dist/index.d.cts".
|
|
237
|
+
* `true` is equivalent to `compatible`.
|
|
238
|
+
* `false` will disable declaration generation.
|
|
239
|
+
* `undefined` will auto-detect based on "package.json". If "package.json" has "types" field, it will be `"compatible"`, otherwise `false`.
|
|
240
|
+
*/
|
|
241
241
|
declaration?: boolean | "compatible" | "node16";
|
|
242
242
|
/**
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
243
|
+
* Maximum number of DTS bundles to build in parallel. Each
|
|
244
|
+
* `@visulima/rollup-plugin-dts` instance keeps a TypeScript program in
|
|
245
|
+
* memory, so this is capped low by default to avoid OOM on large monorepos.
|
|
246
|
+
* @default 2
|
|
247
|
+
*/
|
|
248
248
|
dtsConcurrency?: number;
|
|
249
249
|
/**
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
250
|
+
* If `true`, only generate declaration files.
|
|
251
|
+
* If `false` or `undefined`, generate both declaration and source files.
|
|
252
|
+
*/
|
|
253
253
|
dtsOnly?: boolean;
|
|
254
254
|
/** Whether to emit CommonJS output */
|
|
255
255
|
emitCJS?: boolean;
|
|
@@ -258,13 +258,13 @@ interface BuildOptions {
|
|
|
258
258
|
/** Build entry points */
|
|
259
259
|
entries: BuildEntry[];
|
|
260
260
|
/**
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
261
|
+
* Bundle the build output into a single standalone executable via Node.js SEA.
|
|
262
|
+
* Set to `true` to build for the current platform, or pass an options object
|
|
263
|
+
* for fine-grained control (cross-platform targets, SEA config, custom output name).
|
|
264
|
+
*
|
|
265
|
+
* Requires Node.js >= 25.7.0 at build time. Not supported in Bun or Deno.
|
|
266
|
+
* Automatically enforces a single entry point.
|
|
267
|
+
*/
|
|
268
268
|
exe?: boolean | ExeOptions;
|
|
269
269
|
/** External dependencies that should not be bundled */
|
|
270
270
|
externals: (RegExp | string)[];
|
|
@@ -273,22 +273,22 @@ interface BuildOptions {
|
|
|
273
273
|
/** Whether to enable file caching for faster rebuilds */
|
|
274
274
|
fileCache?: boolean;
|
|
275
275
|
/**
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
276
|
+
* Text to append to the build output. Maps to Rollup/Rolldown
|
|
277
|
+
* `output.footer` and is applied to both the CommonJS and ESM bundles.
|
|
278
|
+
* A bare string/function targets the JS output; use `{ js, dts }` to also
|
|
279
|
+
* append text to the generated declaration files.
|
|
280
|
+
*/
|
|
281
281
|
footer?: BannerFooterOption;
|
|
282
282
|
/**
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
283
|
+
* Array of export keys to ignore during entry inference.
|
|
284
|
+
* Useful for excluding exports that only contain images or other non-JavaScript assets.
|
|
285
|
+
* @example ["images", "assets", "icons"]
|
|
286
|
+
*/
|
|
287
287
|
ignoreExportKeys?: string[];
|
|
288
288
|
/**
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
289
|
+
* Jiti options, where [jiti](https://github.com/unjs/jiti) is used to load the entry files.
|
|
290
|
+
* @default { alias: {}, debug: false, interopDefault: true }
|
|
291
|
+
*/
|
|
292
292
|
jiti: Omit<JitiOptions & {
|
|
293
293
|
absoluteJitiPath?: boolean;
|
|
294
294
|
}, "onError" | "transform">;
|
|
@@ -309,11 +309,11 @@ interface BuildOptions {
|
|
|
309
309
|
/** Custom file extensions for different output formats */
|
|
310
310
|
outputExtensionMap?: Record<Format, string>;
|
|
311
311
|
/**
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
312
|
+
* The resolved browserslist result, preserved even when the global runtime
|
|
313
|
+
* is "node" (where `browserTargets` is cleared). Per-group browser builds use
|
|
314
|
+
* this so that browser-runtime entries in an otherwise node package keep their
|
|
315
|
+
* intended browserslist targets.
|
|
316
|
+
*/
|
|
317
317
|
resolvedBrowserTargets?: string[];
|
|
318
318
|
/** Rollup-specific build options */
|
|
319
319
|
rollup: RollupBuildOptions;
|
|
@@ -326,28 +326,28 @@ interface BuildOptions {
|
|
|
326
326
|
/** Whether to generate source maps */
|
|
327
327
|
sourcemap: boolean;
|
|
328
328
|
/**
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
329
|
+
* Transformer function for processing source files.
|
|
330
|
+
*
|
|
331
|
+
* Required when `bundler` is `"rollup"` (the default). Must be omitted
|
|
332
|
+
* when `bundler` is `"rolldown"` — rolldown bundles its own oxc-based
|
|
333
|
+
* transform natively and never invokes packem's transformer adapter, so
|
|
334
|
+
* passing one is a configuration mistake and packem will refuse to build.
|
|
335
|
+
*/
|
|
336
336
|
transformer?: TransformerFn;
|
|
337
337
|
/** TypeDoc configuration for generating documentation */
|
|
338
338
|
typedoc: TypeDocumentOptions | false;
|
|
339
339
|
/**
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
340
|
+
* If `true`, enables unbundle mode which preserves the source file structure.
|
|
341
|
+
* Instead of bundling everything into a single file, each module is output as a separate file
|
|
342
|
+
* maintaining the original directory structure.
|
|
343
|
+
* @default false
|
|
344
|
+
* @example
|
|
345
|
+
* ```typescript
|
|
346
|
+
* // With unbundle: true
|
|
347
|
+
* // src/index.ts exports from './a/indexA', './b/indexB'
|
|
348
|
+
* // Output: dist/index.js, dist/a/indexA.js, dist/b/indexB.js
|
|
349
|
+
* ```
|
|
350
|
+
*/
|
|
351
351
|
unbundle?: boolean;
|
|
352
352
|
/** Validation options for the build */
|
|
353
353
|
validation?: ValidationOptions | false;
|
|
@@ -371,47 +371,47 @@ interface RollupBuildOptions extends PackemRollupOptions {
|
|
|
371
371
|
}
|
|
372
372
|
type TypeDocumentOptions = Partial<Omit<TypeDocOptions, "entryPoints" | "hideGenerator" | "out" | "preserveWatchOutput" | "watch">> & {
|
|
373
373
|
/**
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
374
|
+
* The format of the output.
|
|
375
|
+
* @default "html"
|
|
376
|
+
*/
|
|
377
377
|
format?: "html" | "inline" | "json" | "markdown";
|
|
378
378
|
/**
|
|
379
|
-
|
|
380
|
-
|
|
379
|
+
* The name of the JSON file.
|
|
380
|
+
*/
|
|
381
381
|
jsonFileName?: string;
|
|
382
382
|
/**
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
383
|
+
* A marker to replace the content within the file on the correct location.
|
|
384
|
+
* @default "TYPEDOC" This marker need to be placed in the readme <!-- TYPEDOC --><!-- TYPEDOC -->
|
|
385
|
+
*/
|
|
386
386
|
marker?: string;
|
|
387
387
|
/**
|
|
388
|
-
|
|
389
|
-
|
|
388
|
+
* The path of the output directory.
|
|
389
|
+
*/
|
|
390
390
|
output?: string;
|
|
391
391
|
/**
|
|
392
|
-
|
|
393
|
-
|
|
392
|
+
* The path of the README file.
|
|
393
|
+
*/
|
|
394
394
|
readmePath?: string;
|
|
395
395
|
};
|
|
396
396
|
type ValidationOptions = {
|
|
397
397
|
/**
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
398
|
+
* Run `arethetypeswrong` after bundling.
|
|
399
|
+
* Requires `@arethetypeswrong/core` to be installed.
|
|
400
|
+
* @default false
|
|
401
|
+
* @see https://github.com/arethetypeswrong/arethetypeswrong.github.io
|
|
402
|
+
*/
|
|
403
403
|
attw?: boolean | AttwOptions;
|
|
404
404
|
/** Bundle size validation options */
|
|
405
405
|
bundleLimit?: {
|
|
406
406
|
/** Allow the build to succeed even if limits are exceeded */
|
|
407
407
|
allowFail?: boolean;
|
|
408
408
|
/**
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
409
|
+
* Bundle size limit in bytes, or string with unit (e.g., "1MB", "500KB")
|
|
410
|
+
* @example
|
|
411
|
+
* - "1MB"
|
|
412
|
+
* - "500KB"
|
|
413
|
+
* - 1048576 // 1MB in bytes
|
|
414
|
+
*/
|
|
415
415
|
limit?: number | `${number}${"B" | "GB" | "KB" | "MB" | "TB"}`;
|
|
416
416
|
/** Size limits for specific files or globs */
|
|
417
417
|
limits?: Record<string, number | `${number}${"B" | "GB" | "KB" | "MB" | "TB"}`>;
|
|
@@ -440,10 +440,10 @@ type ValidationOptions = {
|
|
|
440
440
|
/** Whether to validate the exports field */
|
|
441
441
|
exports?: boolean;
|
|
442
442
|
/**
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
443
|
+
* Additional custom conditions to consider valid in exports field validation.
|
|
444
|
+
* These will be added to the standard and community conditions.
|
|
445
|
+
* @example ["custom", "my-bundler"]
|
|
446
|
+
*/
|
|
447
447
|
extraConditions?: string[];
|
|
448
448
|
/** Whether to validate the files field */
|
|
449
449
|
files?: boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as w}from"node:module";const z=/^[A-Z]:\//i,a=(e="")=>e&&e.replaceAll("\\","/").replace(z,n=>n.toUpperCase()),$=/^[/\\]{2}/,j=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,b=/^[A-Z]:$/i,m=/^\/([A-Z]:)?$/i,y=/.(\.[^./]+)$/,k=/^[/\\]|^[a-z]:[/\\]/i,A=/\/$/,O=()=>typeof process.cwd=="function"?process.cwd().replaceAll("\\","/"):"/",v=(e,n)=>{let t="",s=0,l=-1,r=0,p;for(let o=0;o<=e.length;++o){if(o<e.length)p=e[o];else{if(p==="/")break;p="/"}if(p==="/"){if(!(l===o-1||r===1))if(r===2){if(t.length<2||s!==2||!t.endsWith(".")||t.at(-2)!=="."){if(t.length>2){const i=t.lastIndexOf("/");i===-1?(t="",s=0):(t=t.slice(0,i),s=t.length-1-t.lastIndexOf("/")),l=o,r=0;continue}else if(t.length>0){t="",s=0,l=o,r=0;continue}}n&&(t+=t.length>0?"/..":"..",s=2)}else t.length>0?t+=`/${e.slice(l+1,o)}`:t=e.slice(l+1,o),s=o-l-1;l=o,r=0}else p==="."&&r!==-1?++r:r=-1}return t},f=e=>j.test(e),T=function(e){if(e.length===0)return".";e=a(e);const n=$.exec(e),t=f(e),s=e.at(-1)==="/";return e=v(e,!t),e.length===0?t?"/":s?"./":".":(s&&(e+="/"),b.test(e)&&(e+="/"),n?t?`//${e}`:`//./${e}`:t&&!f(e)?`/${e}`:e)},S=(...e)=>{let n="";for(const t of e)if(t)if(n.length>0){const s=n.at(-1)==="/",l=t[0]==="/";s&&l?n+=t.slice(1):n+=s||l?t:`/${t}`}else n+=t;return T(n)},u=function(...e){e=e.map(s=>a(s));let n="",t=!1;for(let s=e.length-1;s>=-1&&!t;s--){const l=s>=0?e[s]:O();!l||l.length===0||(n=`${l}/${n}`,t=f(l))}return n=v(n,!t),t&&!f(n)?`/${n}`:n.length>0?n:"."},J=function(e){return a(e)},W=function(e){return y.exec(a(e))?.[1]??""},N=function(e,n){const t=u(e).replace(m,"$1").split("/"),s=u(n).replace(m,"$1").split("/");if(s[0][1]===":"&&t[0][1]===":"&&t[0]!==s[0])return s.join("/");const l=Math.min(t.length,s.length);let r=0;for(;r<l&&t[r]===s[r];)r+=1;const p=t.length-r;return[...Array.from({length:p}).fill(".."),...s.slice(r)].join("/")},I=e=>{const n=a(e).replace(A,""),t=n.lastIndexOf("/");if(t===-1)return f(e)?"/":".";const s=n.slice(0,t);return b.test(s)?`${s}/`:s||(f(e)?"/":".")},P=(e,n)=>{const t=a(e),s=t.slice(t.lastIndexOf("/")+1);if(n&&s.endsWith(n)){if(n===t)return"";const l=s.slice(0,-n.length);if(l.length>0)return l}return s},X=function(e){const n=k.exec(e)?.[0]?.replaceAll("\\","/")??"",t=P(e),s=W(t);return{base:t,dir:I(e),ext:s,name:t.slice(0,t.length-s.length),root:n}},R=w(import.meta.url),c=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Z=e=>{if(typeof c<"u"&&c.versions&&c.versions.node){const[n,t]=c.versions.node.split(".").map(Number);if(n>22||n===22&&t>=3||n===20&&t>=16)return c.getBuiltinModule(e)}return R(e)},{fileURLToPath:B}=Z("node:url");function L(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var g,h;function M(){return h||(h=1,g=["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cr3","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),g}var U=M();const _=L(U);new Set(_);const q=new Set(["/","\\",void 0]),d=Symbol.for("pathe:normalizedAlias"),C=(e,n)=>n.split("/").length-e.split("/").length,x=(e="/")=>{const n=e.at(-1);return n==="/"||n==="\\"},D=e=>{if(e[d])return e;const n=Object.fromEntries(Object.entries(e).toSorted(([t],[s])=>C(t,s)));for(const t in n)for(const s in n)s===t||t.startsWith(s)||n[t].startsWith(s)&&q.has(n[t][s.length])&&(n[t]=n[s]+n[t].slice(s.length));return Object.defineProperty(n,d,{enumerable:!1,value:!0}),n},Y=(e,n)=>{e=a(e),n=D(n);for(const[t,s]of Object.entries(n)){if(!e.startsWith(t))continue;const l=x(t)?t.slice(0,-1):t;if(x(e[l.length]))return S(s,e.slice(t.length))}return e},E=/^(?:\.?\.[/\\]|\.\.\B)/,F=e=>E.test(e)||e==="..",G=e=>a(e instanceof URL?B(e):e);export{f as A,u as B,I as H,P as J,G as L,Y as O,W as T,T as W,F as a,X as j,S as m,J as w,N as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"../../../packem_shared/oxcTransformPlugin-Dwvbw2jE-
|
|
1
|
+
import{t as e}from"../../../packem_shared/oxcTransformPlugin-Dwvbw2jE-CI_T_eTp.js";export{e as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visulima/packem",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.94",
|
|
4
4
|
"description": "A fast and modern bundler for Node.js and TypeScript.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"anolilab",
|
|
@@ -171,44 +171,44 @@
|
|
|
171
171
|
],
|
|
172
172
|
"dependencies": {
|
|
173
173
|
"@antfu/install-pkg": "1.1.0",
|
|
174
|
-
"@clack/prompts": "1.
|
|
174
|
+
"@clack/prompts": "1.7.0",
|
|
175
175
|
"@rollup/pluginutils": "5.4.0",
|
|
176
|
-
"@visulima/cerebro": "3.0.0
|
|
177
|
-
"@visulima/packem-share": "1.0.0-alpha.
|
|
178
|
-
"@visulima/rollup-plugin-css": "1.0.0-alpha.
|
|
179
|
-
"@visulima/rollup-plugin-dts": "1.0.0-alpha.
|
|
180
|
-
"@visulima/tsconfig": "3.0.0
|
|
181
|
-
"browserslist": "4.28.
|
|
176
|
+
"@visulima/cerebro": "3.0.0",
|
|
177
|
+
"@visulima/packem-share": "1.0.0-alpha.51",
|
|
178
|
+
"@visulima/rollup-plugin-css": "1.0.0-alpha.55",
|
|
179
|
+
"@visulima/rollup-plugin-dts": "1.0.0-alpha.36",
|
|
180
|
+
"@visulima/tsconfig": "3.0.0",
|
|
181
|
+
"browserslist": "4.28.6",
|
|
182
182
|
"cjs-module-lexer": "2.2.0",
|
|
183
183
|
"clean-css": "^5.3.3",
|
|
184
184
|
"defu": "6.1.7",
|
|
185
185
|
"estree-walker": "^3.0.3",
|
|
186
186
|
"fastest-levenshtein": "1.0.16",
|
|
187
187
|
"hookable": "6.1.1",
|
|
188
|
-
"html-minifier-next": "
|
|
188
|
+
"html-minifier-next": "7.2.0",
|
|
189
189
|
"jiti": "2.7.0",
|
|
190
190
|
"magic-string": "0.30.21",
|
|
191
191
|
"mime": "^4.1.0",
|
|
192
192
|
"mlly": "1.8.2",
|
|
193
|
-
"oxc-parser": "0.
|
|
194
|
-
"oxc-resolver": "11.
|
|
193
|
+
"oxc-parser": "0.140.0",
|
|
194
|
+
"oxc-resolver": "11.24.2",
|
|
195
195
|
"rollup-plugin-license": "3.7.1",
|
|
196
196
|
"rs-module-lexer": "2.8.0",
|
|
197
197
|
"tinyexec": "1.2.4",
|
|
198
|
-
"workerpool": "10.0.
|
|
198
|
+
"workerpool": "10.0.3"
|
|
199
199
|
},
|
|
200
200
|
"peerDependencies": {
|
|
201
201
|
"@arethetypeswrong/core": ">=0.18.3",
|
|
202
202
|
"@swc/core": ">=1.15.40",
|
|
203
|
-
"@tailwindcss/node": "4.3.
|
|
204
|
-
"@tailwindcss/oxide": "4.3.
|
|
205
|
-
"@visulima/packem-rollup": "1.0.0-alpha.
|
|
203
|
+
"@tailwindcss/node": "4.3.2",
|
|
204
|
+
"@tailwindcss/oxide": "4.3.2",
|
|
205
|
+
"@visulima/packem-rollup": "1.0.0-alpha.76",
|
|
206
206
|
"cssnano": ">=8.0.1",
|
|
207
207
|
"esbuild": ">=0.28.0",
|
|
208
208
|
"icss-utils": ">=5.1.0",
|
|
209
209
|
"less": ">=4.6.4",
|
|
210
210
|
"lightningcss": ">=1.32.0",
|
|
211
|
-
"package-manager-detector": "^1.
|
|
211
|
+
"package-manager-detector": "^1.7.0",
|
|
212
212
|
"postcss": ">=8.5.15",
|
|
213
213
|
"postcss-load-config": ">=6.0.1",
|
|
214
214
|
"postcss-modules-extract-imports": ">=3.1.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var m=Object.defineProperty;var u=(r,e)=>m(r,"name",{value:e,configurable:!0});import{transformAsync as g}from"@babel/core";var d=Object.defineProperty,l=u((r,e)=>d(r,"name",{value:e,configurable:!0}),"o");const f=/\.tsx?$/,y=/['"]use memo['"]/,_="babel-options",w="__packem_babel_missing_options__",b=l(r=>r.find(e=>e==="babel-plugin-react-compiler"||Array.isArray(e)&&e[0]==="babel-plugin-react-compiler"),"getReactCompilerPlugin"),A=l((r,e)=>{if(r.length===0)return;const s=b(r);if(!(!s||!Array.isArray(s))&&s[1]?.compilationMode==="annotation"&&!y.test(e)){const o=r.indexOf(s);o!==-1&&r.splice(o,1)}},"filterReactCompilerByAnnotation"),v=l(async(r,e,{filename:s,generatorOpts:o,sourceFileName:h,...t})=>{let i=[];t.plugins&&Array.isArray(t.plugins)&&(i=[...t.plugins]),i.length>0&&A(i,r);const a=[];(e.endsWith(".jsx")||e.endsWith(".tsx"))&&a.push("jsx"),f.test(e)&&a.push("typescript");const n=t.parserOpts?.plugins;n&&Array.isArray(n)&&a.unshift(...n);const c=[...new Set(a)],p=await g(r,{...t,filename:e,generatorOpts:{...o,decoratorsBeforeExport:!0,importAttributesKeyword:"with"},parserOpts:{...t.parserOpts,allowAwaitOutsideFunction:!0,plugins:c.length>0?c:[],sourceType:"module"},plugins:i.length>0?i:[],sourceFileName:e});if(p?.code)return{code:p.code,map:p.map??void 0}},"transformCode");export{w as N,_ as O,v as t};
|