@visulima/packem-rollup 1.0.0-alpha.7 → 1.0.0-alpha.70

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.
Files changed (85) hide show
  1. package/CHANGELOG.md +693 -0
  2. package/LICENSE.md +8 -791
  3. package/README.md +89 -2
  4. package/dist/index.d.ts +731 -51
  5. package/dist/index.js +1 -0
  6. package/dist/packem_shared/browserslistToEsbuild-HD6SaWPt.js +1 -0
  7. package/dist/packem_shared/esbuildPlugin-BStpbA6S.js +1 -0
  8. package/dist/packem_shared/swcPlugin-DBBN5mct.js +1 -0
  9. package/dist/packem_shared/types.d-Dmpk2asd.d.ts +7 -0
  10. package/dist/packem_shared/types.d-DrgzeMBs.d-CG9J1x6q.d.ts +6 -0
  11. package/dist/packem_shared/types.d-KBgVO47q.d.ts +658 -0
  12. package/dist/plugins/chunk-splitter/index.d.ts +3 -0
  13. package/dist/plugins/chunk-splitter/index.js +1 -0
  14. package/dist/plugins/cjs-interop.d.ts +11 -0
  15. package/dist/plugins/cjs-interop.js +2 -0
  16. package/dist/plugins/esbuild/index.d.ts +9 -23
  17. package/dist/plugins/esbuild/index.js +1 -0
  18. package/dist/plugins/json.d.ts +5 -0
  19. package/dist/plugins/json.js +1 -0
  20. package/dist/plugins/jsx-remove-attributes.d.ts +11 -0
  21. package/dist/plugins/jsx-remove-attributes.js +1 -0
  22. package/dist/plugins/preserve-directives.d.ts +15 -0
  23. package/dist/plugins/preserve-directives.js +4 -0
  24. package/dist/plugins/pure-new-expression-plugin.d.ts +12 -0
  25. package/dist/plugins/pure-new-expression-plugin.js +1 -0
  26. package/dist/plugins/sucrase/index.d.ts +100 -17
  27. package/dist/plugins/sucrase/index.js +1 -0
  28. package/dist/plugins/swc/index.d.ts +9 -24
  29. package/dist/plugins/swc/index.js +1 -0
  30. package/package.json +53 -53
  31. package/dist/index.d.mts +0 -56
  32. package/dist/index.mjs +0 -1
  33. package/dist/packem_shared/browserslist-to-esbuild-DY9HwYtp.d.mts +0 -3
  34. package/dist/packem_shared/browserslist-to-esbuild-DY9HwYtp.d.ts +0 -3
  35. package/dist/packem_shared/browserslistToEsbuild-C0IWmbNe.mjs +0 -1
  36. package/dist/packem_shared/cachingPlugin-D0BBFJPD.mjs +0 -1
  37. package/dist/packem_shared/chunkSplitter-DWAy1JkE.mjs +0 -1
  38. package/dist/packem_shared/cjsInteropPlugin-D5wyoQ_B.mjs +0 -2
  39. package/dist/packem_shared/copyPlugin--6RITp1-.mjs +0 -1
  40. package/dist/packem_shared/createSplitChunks-CGDk55G3.mjs +0 -1
  41. package/dist/packem_shared/dataUriPlugin-BOjv6O2O.mjs +0 -1
  42. package/dist/packem_shared/esbuildPlugin-BAwyhG6L.mjs +0 -1
  43. package/dist/packem_shared/esmShimCjsSyntaxPlugin-DjKqX4DE.mjs +0 -11
  44. package/dist/packem_shared/fix-dts-default-cjs-exports-BQc0nwIG.mjs +0 -26
  45. package/dist/packem_shared/fixDtsDefaultCjsExportsPlugin-Dp1UcHVR.mjs +0 -1
  46. package/dist/packem_shared/fixDynamicImportExtension-BBGNRniz.mjs +0 -1
  47. package/dist/packem_shared/getCustomModuleLayer-d8i66lfh.mjs +0 -1
  48. package/dist/packem_shared/getModuleLayer-rF9RxnJ5.mjs +0 -1
  49. package/dist/packem_shared/index-Cj1Okk1t.mjs +0 -1
  50. package/dist/packem_shared/isolatedDeclarationsOxcTransformer-WbfE6cGu.mjs +0 -1
  51. package/dist/packem_shared/isolatedDeclarationsPlugin-A0wmmw3Y.mjs +0 -3
  52. package/dist/packem_shared/isolatedDeclarationsSwcTransformer-Ch2AgtWC.mjs +0 -1
  53. package/dist/packem_shared/isolatedDeclarationsTypescriptTransformer-DkuEkofo.mjs +0 -3
  54. package/dist/packem_shared/jsonPlugin-BAi3Da-h.mjs +0 -1
  55. package/dist/packem_shared/jsxRemoveAttributes-B1PLPffj.mjs +0 -1
  56. package/dist/packem_shared/licensePlugin-C5yzUqe-.mjs +0 -13
  57. package/dist/packem_shared/makeExecutable-6aOVHoJR.mjs +0 -4
  58. package/dist/packem_shared/metafilePlugin-ObS4J7mO.mjs +0 -1
  59. package/dist/packem_shared/oxcResolvePlugin-BJpi-eSG.mjs +0 -1
  60. package/dist/packem_shared/oxcTransformPlugin-DfVQouIB.mjs +0 -4
  61. package/dist/packem_shared/patchTypescriptTypes-BEdkvKxL.mjs +0 -6
  62. package/dist/packem_shared/preserveDirectivesPlugin-B49Cbykd.mjs +0 -4
  63. package/dist/packem_shared/rawPlugin-BqlR6ZOI.mjs +0 -1
  64. package/dist/packem_shared/resolveFileUrlPlugin-BkpjVHeK.mjs +0 -1
  65. package/dist/packem_shared/resolveTsconfigPathsPlugin-Crf4lzxq.mjs +0 -1
  66. package/dist/packem_shared/resolveTsconfigRootDirectoriesPlugin-_93afm2q.mjs +0 -1
  67. package/dist/packem_shared/resolveTypescriptMjsCtsPlugin-DcZrZTmM.mjs +0 -1
  68. package/dist/packem_shared/sourcemapsPlugin-B4W3J79w.mjs +0 -1
  69. package/dist/packem_shared/swcPlugin-Boip4lWG.mjs +0 -1
  70. package/dist/packem_shared/types-BKqesFEF.d.mts +0 -4548
  71. package/dist/packem_shared/types-BKqesFEF.d.ts +0 -4548
  72. package/dist/packem_shared/urlPlugin-Bm2IE00y.mjs +0 -1
  73. package/dist/plugins/esbuild/index.d.mts +0 -25
  74. package/dist/plugins/esbuild/index.mjs +0 -1
  75. package/dist/plugins/oxc/index.d.mts +0 -28
  76. package/dist/plugins/oxc/index.d.ts +0 -28
  77. package/dist/plugins/oxc/index.mjs +0 -1
  78. package/dist/plugins/sucrase/index.d.mts +0 -19
  79. package/dist/plugins/sucrase/index.mjs +0 -1
  80. package/dist/plugins/swc/index.d.mts +0 -26
  81. package/dist/plugins/swc/index.mjs +0 -1
  82. package/dist/plugins/typescript/index.d.mts +0 -29
  83. package/dist/plugins/typescript/index.d.ts +0 -29
  84. package/dist/plugins/typescript/index.mjs +0 -1
  85. /package/dist/packem_shared/{index-Dq8IUFTs.mjs → index-Dq8IUFTs.js} +0 -0
@@ -0,0 +1,658 @@
1
+ import { FilterPattern } from '@rollup/pluginutils';
2
+ declare const browserslistToEsbuild: (browserList: string[]) => string[];
3
+ type Platform = 'browser' | 'node' | 'neutral';
4
+ type Format = 'iife' | 'cjs' | 'esm';
5
+ type Loader = 'base64' | 'binary' | 'copy' | 'css' | 'dataurl' | 'default' | 'empty' | 'file' | 'js' | 'json' | 'jsx' | 'local-css' | 'text' | 'ts' | 'tsx';
6
+ type LogLevel = 'verbose' | 'debug' | 'info' | 'warning' | 'error' | 'silent';
7
+ type Charset = 'ascii' | 'utf8';
8
+ type Drop = 'console' | 'debugger';
9
+ type AbsPaths = 'code' | 'log' | 'metafile';
10
+ interface CommonOptions {
11
+ /** Documentation: https://esbuild.github.io/api/#sourcemap */
12
+ sourcemap?: boolean | 'linked' | 'inline' | 'external' | 'both';
13
+ /** Documentation: https://esbuild.github.io/api/#legal-comments */
14
+ legalComments?: 'none' | 'inline' | 'eof' | 'linked' | 'external';
15
+ /** Documentation: https://esbuild.github.io/api/#source-root */
16
+ sourceRoot?: string;
17
+ /** Documentation: https://esbuild.github.io/api/#sources-content */
18
+ sourcesContent?: boolean;
19
+
20
+ /** Documentation: https://esbuild.github.io/api/#format */
21
+ format?: Format;
22
+ /** Documentation: https://esbuild.github.io/api/#global-name */
23
+ globalName?: string;
24
+ /** Documentation: https://esbuild.github.io/api/#target */
25
+ target?: string | string[];
26
+ /** Documentation: https://esbuild.github.io/api/#supported */
27
+ supported?: Record<string, boolean>;
28
+ /** Documentation: https://esbuild.github.io/api/#platform */
29
+ platform?: Platform;
30
+
31
+ /** Documentation: https://esbuild.github.io/api/#mangle-props */
32
+ mangleProps?: RegExp;
33
+ /** Documentation: https://esbuild.github.io/api/#mangle-props */
34
+ reserveProps?: RegExp;
35
+ /** Documentation: https://esbuild.github.io/api/#mangle-props */
36
+ mangleQuoted?: boolean;
37
+ /** Documentation: https://esbuild.github.io/api/#mangle-props */
38
+ mangleCache?: Record<string, string | false>;
39
+ /** Documentation: https://esbuild.github.io/api/#drop */
40
+ drop?: Drop[];
41
+ /** Documentation: https://esbuild.github.io/api/#drop-labels */
42
+ dropLabels?: string[];
43
+ /** Documentation: https://esbuild.github.io/api/#minify */
44
+ minify?: boolean;
45
+ /** Documentation: https://esbuild.github.io/api/#minify */
46
+ minifyWhitespace?: boolean;
47
+ /** Documentation: https://esbuild.github.io/api/#minify */
48
+ minifyIdentifiers?: boolean;
49
+ /** Documentation: https://esbuild.github.io/api/#minify */
50
+ minifySyntax?: boolean;
51
+ /** Documentation: https://esbuild.github.io/api/#line-limit */
52
+ lineLimit?: number;
53
+ /** Documentation: https://esbuild.github.io/api/#charset */
54
+ charset?: Charset;
55
+ /** Documentation: https://esbuild.github.io/api/#tree-shaking */
56
+ treeShaking?: boolean;
57
+ /** Documentation: https://esbuild.github.io/api/#ignore-annotations */
58
+ ignoreAnnotations?: boolean;
59
+
60
+ /** Documentation: https://esbuild.github.io/api/#jsx */
61
+ jsx?: 'transform' | 'preserve' | 'automatic';
62
+ /** Documentation: https://esbuild.github.io/api/#jsx-factory */
63
+ jsxFactory?: string;
64
+ /** Documentation: https://esbuild.github.io/api/#jsx-fragment */
65
+ jsxFragment?: string;
66
+ /** Documentation: https://esbuild.github.io/api/#jsx-import-source */
67
+ jsxImportSource?: string;
68
+ /** Documentation: https://esbuild.github.io/api/#jsx-development */
69
+ jsxDev?: boolean;
70
+ /** Documentation: https://esbuild.github.io/api/#jsx-side-effects */
71
+ jsxSideEffects?: boolean;
72
+
73
+ /** Documentation: https://esbuild.github.io/api/#define */
74
+ define?: {
75
+ [key: string]: string;
76
+ };
77
+ /** Documentation: https://esbuild.github.io/api/#pure */
78
+ pure?: string[];
79
+ /** Documentation: https://esbuild.github.io/api/#keep-names */
80
+ keepNames?: boolean;
81
+
82
+ /** Documentation: https://esbuild.github.io/api/#abs-paths */
83
+ absPaths?: AbsPaths[];
84
+ /** Documentation: https://esbuild.github.io/api/#color */
85
+ color?: boolean;
86
+ /** Documentation: https://esbuild.github.io/api/#log-level */
87
+ logLevel?: LogLevel;
88
+ /** Documentation: https://esbuild.github.io/api/#log-limit */
89
+ logLimit?: number;
90
+ /** Documentation: https://esbuild.github.io/api/#log-override */
91
+ logOverride?: Record<string, LogLevel>;
92
+
93
+ /** Documentation: https://esbuild.github.io/api/#tsconfig-raw */
94
+ tsconfigRaw?: string | TsconfigRaw;
95
+ }
96
+ interface TsconfigRaw {
97
+ compilerOptions?: {
98
+ alwaysStrict?: boolean;
99
+ baseUrl?: string;
100
+ experimentalDecorators?: boolean;
101
+ importsNotUsedAsValues?: 'remove' | 'preserve' | 'error';
102
+ jsx?: 'preserve' | 'react-native' | 'react' | 'react-jsx' | 'react-jsxdev';
103
+ jsxFactory?: string;
104
+ jsxFragmentFactory?: string;
105
+ jsxImportSource?: string;
106
+ paths?: Record<string, string[]>;
107
+ preserveValueImports?: boolean;
108
+ strict?: boolean;
109
+ target?: string;
110
+ useDefineForClassFields?: boolean;
111
+ verbatimModuleSyntax?: boolean;
112
+ };
113
+ }
114
+ interface BuildOptions extends CommonOptions {
115
+ /** Documentation: https://esbuild.github.io/api/#bundle */
116
+ bundle?: boolean;
117
+ /** Documentation: https://esbuild.github.io/api/#splitting */
118
+ splitting?: boolean;
119
+ /** Documentation: https://esbuild.github.io/api/#preserve-symlinks */
120
+ preserveSymlinks?: boolean;
121
+ /** Documentation: https://esbuild.github.io/api/#outfile */
122
+ outfile?: string;
123
+ /** Documentation: https://esbuild.github.io/api/#metafile */
124
+ metafile?: boolean;
125
+ /** Documentation: https://esbuild.github.io/api/#outdir */
126
+ outdir?: string;
127
+ /** Documentation: https://esbuild.github.io/api/#outbase */
128
+ outbase?: string;
129
+ /** Documentation: https://esbuild.github.io/api/#external */
130
+ external?: string[];
131
+ /** Documentation: https://esbuild.github.io/api/#packages */
132
+ packages?: 'bundle' | 'external';
133
+ /** Documentation: https://esbuild.github.io/api/#alias */
134
+ alias?: Record<string, string>;
135
+ /** Documentation: https://esbuild.github.io/api/#loader */
136
+ loader?: {
137
+ [ext: string]: Loader;
138
+ };
139
+ /** Documentation: https://esbuild.github.io/api/#resolve-extensions */
140
+ resolveExtensions?: string[];
141
+ /** Documentation: https://esbuild.github.io/api/#main-fields */
142
+ mainFields?: string[];
143
+ /** Documentation: https://esbuild.github.io/api/#conditions */
144
+ conditions?: string[];
145
+ /** Documentation: https://esbuild.github.io/api/#write */
146
+ write?: boolean;
147
+ /** Documentation: https://esbuild.github.io/api/#allow-overwrite */
148
+ allowOverwrite?: boolean;
149
+ /** Documentation: https://esbuild.github.io/api/#tsconfig */
150
+ tsconfig?: string;
151
+ /** Documentation: https://esbuild.github.io/api/#out-extension */
152
+ outExtension?: {
153
+ [ext: string]: string;
154
+ };
155
+ /** Documentation: https://esbuild.github.io/api/#public-path */
156
+ publicPath?: string;
157
+ /** Documentation: https://esbuild.github.io/api/#entry-names */
158
+ entryNames?: string;
159
+ /** Documentation: https://esbuild.github.io/api/#chunk-names */
160
+ chunkNames?: string;
161
+ /** Documentation: https://esbuild.github.io/api/#asset-names */
162
+ assetNames?: string;
163
+ /** Documentation: https://esbuild.github.io/api/#inject */
164
+ inject?: string[];
165
+ /** Documentation: https://esbuild.github.io/api/#banner */
166
+ banner?: {
167
+ [type: string]: string;
168
+ };
169
+ /** Documentation: https://esbuild.github.io/api/#footer */
170
+ footer?: {
171
+ [type: string]: string;
172
+ };
173
+ /** Documentation: https://esbuild.github.io/api/#entry-points */
174
+ entryPoints?: (string | {
175
+ in: string;
176
+ out: string;
177
+ })[] | Record<string, string>;
178
+ /** Documentation: https://esbuild.github.io/api/#stdin */
179
+ stdin?: StdinOptions;
180
+ /** Documentation: https://esbuild.github.io/plugins/ */
181
+ plugins?: Plugin[];
182
+ /** Documentation: https://esbuild.github.io/api/#working-directory */
183
+ absWorkingDir?: string;
184
+ /** Documentation: https://esbuild.github.io/api/#node-paths */
185
+ nodePaths?: string[]; // The "NODE_PATH" variable from Node.js
186
+ }
187
+ interface StdinOptions {
188
+ contents: string | Uint8Array;
189
+ resolveDir?: string;
190
+ sourcefile?: string;
191
+ loader?: Loader;
192
+ }
193
+ interface Message {
194
+ id: string;
195
+ pluginName: string;
196
+ text: string;
197
+ location: Location | null;
198
+ notes: Note[];
199
+ /**
200
+ * Optional user-specified data that is passed through unmodified. You can
201
+ * use this to stash the original error, for example.
202
+ */
203
+ detail: any;
204
+ }
205
+ interface Note {
206
+ text: string;
207
+ location: Location | null;
208
+ }
209
+ interface Location {
210
+ file: string;
211
+ namespace: string;
212
+ /** 1-based */
213
+ line: number;
214
+ /** 0-based, in bytes */
215
+ column: number;
216
+ /** in bytes */
217
+ length: number;
218
+ lineText: string;
219
+ suggestion: string;
220
+ }
221
+ interface OutputFile {
222
+ path: string;
223
+ contents: Uint8Array;
224
+ hash: string;
225
+ /** "contents" as text (changes automatically with "contents") */
226
+ readonly text: string;
227
+ }
228
+ interface BuildResult<ProvidedOptions extends BuildOptions = BuildOptions> {
229
+ errors: Message[];
230
+ warnings: Message[];
231
+ /** Only when "write: false" */
232
+ outputFiles: OutputFile[] | (ProvidedOptions['write'] extends false ? never : undefined);
233
+ /** Only when "metafile: true" */
234
+ metafile: Metafile | (ProvidedOptions['metafile'] extends true ? never : undefined);
235
+ /** Only when "mangleCache" is present */
236
+ mangleCache: Record<string, string | false> | (ProvidedOptions['mangleCache'] extends Object ? never : undefined);
237
+ }
238
+ /** Documentation: https://esbuild.github.io/api/#serve-arguments */
239
+ interface ServeOptions {
240
+ port?: number;
241
+ host?: string;
242
+ servedir?: string;
243
+ keyfile?: string;
244
+ certfile?: string;
245
+ fallback?: string;
246
+ cors?: CORSOptions;
247
+ onRequest?: (args: ServeOnRequestArgs) => void;
248
+ }
249
+ /** Documentation: https://esbuild.github.io/api/#cors */
250
+ interface CORSOptions {
251
+ origin?: string | string[];
252
+ }
253
+ interface ServeOnRequestArgs {
254
+ remoteAddress: string;
255
+ method: string;
256
+ path: string;
257
+ status: number;
258
+ /** The time to generate the response, not to send it */
259
+ timeInMS: number;
260
+ }
261
+ /** Documentation: https://esbuild.github.io/api/#serve-return-values */
262
+ interface ServeResult {
263
+ port: number;
264
+ hosts: string[];
265
+ }
266
+ interface TransformOptions extends CommonOptions {
267
+ /** Documentation: https://esbuild.github.io/api/#sourcefile */
268
+ sourcefile?: string;
269
+ /** Documentation: https://esbuild.github.io/api/#loader */
270
+ loader?: Loader;
271
+ /** Documentation: https://esbuild.github.io/api/#banner */
272
+ banner?: string;
273
+ /** Documentation: https://esbuild.github.io/api/#footer */
274
+ footer?: string;
275
+ }
276
+ interface TransformResult<ProvidedOptions extends TransformOptions = TransformOptions> {
277
+ code: string;
278
+ map: string;
279
+ warnings: Message[];
280
+ /** Only when "mangleCache" is present */
281
+ mangleCache: Record<string, string | false> | (ProvidedOptions['mangleCache'] extends Object ? never : undefined);
282
+ /** Only when "legalComments" is "external" */
283
+ legalComments: string | (ProvidedOptions['legalComments'] extends 'external' ? never : undefined);
284
+ }
285
+ interface Plugin {
286
+ name: string;
287
+ setup: (build: PluginBuild) => (void | Promise<void>);
288
+ }
289
+ interface PluginBuild {
290
+ /** Documentation: https://esbuild.github.io/plugins/#build-options */
291
+ initialOptions: BuildOptions;
292
+
293
+ /** Documentation: https://esbuild.github.io/plugins/#resolve */
294
+ resolve(path: string, options?: ResolveOptions): Promise<ResolveResult>;
295
+
296
+ /** Documentation: https://esbuild.github.io/plugins/#on-start */
297
+ onStart(callback: () => (OnStartResult | null | void | Promise<OnStartResult | null | void>)): void;
298
+
299
+ /** Documentation: https://esbuild.github.io/plugins/#on-end */
300
+ onEnd(callback: (result: BuildResult) => (OnEndResult | null | void | Promise<OnEndResult | null | void>)): void;
301
+
302
+ /** Documentation: https://esbuild.github.io/plugins/#on-resolve */
303
+ onResolve(options: OnResolveOptions, callback: (args: OnResolveArgs) => (OnResolveResult | null | undefined | Promise<OnResolveResult | null | undefined>)): void;
304
+
305
+ /** Documentation: https://esbuild.github.io/plugins/#on-load */
306
+ onLoad(options: OnLoadOptions, callback: (args: OnLoadArgs) => (OnLoadResult | null | undefined | Promise<OnLoadResult | null | undefined>)): void;
307
+
308
+ /** Documentation: https://esbuild.github.io/plugins/#on-dispose */
309
+ onDispose(callback: () => void): void; // This is a full copy of the esbuild library in case you need it
310
+ esbuild: {
311
+ context: typeof context;
312
+ build: typeof build;
313
+ buildSync: typeof buildSync;
314
+ transform: typeof transform;
315
+ transformSync: typeof transformSync;
316
+ formatMessages: typeof formatMessages;
317
+ formatMessagesSync: typeof formatMessagesSync;
318
+ analyzeMetafile: typeof analyzeMetafile;
319
+ analyzeMetafileSync: typeof analyzeMetafileSync;
320
+ initialize: typeof initialize;
321
+ version: typeof version;
322
+ };
323
+ }
324
+ /** Documentation: https://esbuild.github.io/plugins/#resolve-options */
325
+ interface ResolveOptions {
326
+ pluginName?: string;
327
+ importer?: string;
328
+ namespace?: string;
329
+ resolveDir?: string;
330
+ kind?: ImportKind;
331
+ pluginData?: any;
332
+ with?: Record<string, string>;
333
+ }
334
+ /** Documentation: https://esbuild.github.io/plugins/#resolve-results */
335
+ interface ResolveResult {
336
+ errors: Message[];
337
+ warnings: Message[];
338
+ path: string;
339
+ external: boolean;
340
+ sideEffects: boolean;
341
+ namespace: string;
342
+ suffix: string;
343
+ pluginData: any;
344
+ }
345
+ interface OnStartResult {
346
+ errors?: PartialMessage[];
347
+ warnings?: PartialMessage[];
348
+ }
349
+ interface OnEndResult {
350
+ errors?: PartialMessage[];
351
+ warnings?: PartialMessage[];
352
+ }
353
+ /** Documentation: https://esbuild.github.io/plugins/#on-resolve-options */
354
+ interface OnResolveOptions {
355
+ filter: RegExp;
356
+ namespace?: string;
357
+ }
358
+ /** Documentation: https://esbuild.github.io/plugins/#on-resolve-arguments */
359
+ interface OnResolveArgs {
360
+ path: string;
361
+ importer: string;
362
+ namespace: string;
363
+ resolveDir: string;
364
+ kind: ImportKind;
365
+ pluginData: any;
366
+ with: Record<string, string>;
367
+ }
368
+ type ImportKind = 'entry-point' // JS
369
+ | 'import-statement' | 'require-call' | 'dynamic-import' | 'require-resolve' // CSS
370
+ | 'import-rule' | 'composes-from' | 'url-token';
371
+ /** Documentation: https://esbuild.github.io/plugins/#on-resolve-results */
372
+ interface OnResolveResult {
373
+ pluginName?: string;
374
+ errors?: PartialMessage[];
375
+ warnings?: PartialMessage[];
376
+ path?: string;
377
+ external?: boolean;
378
+ sideEffects?: boolean;
379
+ namespace?: string;
380
+ suffix?: string;
381
+ pluginData?: any;
382
+ watchFiles?: string[];
383
+ watchDirs?: string[];
384
+ }
385
+ /** Documentation: https://esbuild.github.io/plugins/#on-load-options */
386
+ interface OnLoadOptions {
387
+ filter: RegExp;
388
+ namespace?: string;
389
+ }
390
+ /** Documentation: https://esbuild.github.io/plugins/#on-load-arguments */
391
+ interface OnLoadArgs {
392
+ path: string;
393
+ namespace: string;
394
+ suffix: string;
395
+ pluginData: any;
396
+ with: Record<string, string>;
397
+ }
398
+ /** Documentation: https://esbuild.github.io/plugins/#on-load-results */
399
+ interface OnLoadResult {
400
+ pluginName?: string;
401
+ errors?: PartialMessage[];
402
+ warnings?: PartialMessage[];
403
+ contents?: string | Uint8Array;
404
+ resolveDir?: string;
405
+ loader?: Loader;
406
+ pluginData?: any;
407
+ watchFiles?: string[];
408
+ watchDirs?: string[];
409
+ }
410
+ interface PartialMessage {
411
+ id?: string;
412
+ pluginName?: string;
413
+ text?: string;
414
+ location?: Partial<Location> | null;
415
+ notes?: PartialNote[];
416
+ detail?: any;
417
+ }
418
+ interface PartialNote {
419
+ text?: string;
420
+ location?: Partial<Location> | null;
421
+ }
422
+ /** Documentation: https://esbuild.github.io/api/#metafile */
423
+ interface Metafile {
424
+ inputs: {
425
+ [path: string]: {
426
+ bytes: number;
427
+ imports: {
428
+ path: string;
429
+ kind: ImportKind;
430
+ external?: boolean;
431
+ original?: string;
432
+ with?: Record<string, string>;
433
+ }[];
434
+ format?: 'cjs' | 'esm';
435
+ with?: Record<string, string>;
436
+ };
437
+ };
438
+ outputs: {
439
+ [path: string]: {
440
+ bytes: number;
441
+ inputs: {
442
+ [path: string]: {
443
+ bytesInOutput: number;
444
+ };
445
+ };
446
+ imports: {
447
+ path: string;
448
+ kind: ImportKind | 'file-loader';
449
+ external?: boolean;
450
+ }[];
451
+ exports: string[];
452
+ entryPoint?: string;
453
+ cssBundle?: string;
454
+ };
455
+ };
456
+ }
457
+ interface FormatMessagesOptions {
458
+ kind: 'error' | 'warning';
459
+ color?: boolean;
460
+ terminalWidth?: number;
461
+ }
462
+ interface AnalyzeMetafileOptions {
463
+ color?: boolean;
464
+ verbose?: boolean;
465
+ }
466
+ /** Documentation: https://esbuild.github.io/api/#watch-arguments */
467
+ interface WatchOptions {
468
+ delay?: number; // In milliseconds
469
+ }
470
+ interface BuildContext<ProvidedOptions extends BuildOptions = BuildOptions> {
471
+ /** Documentation: https://esbuild.github.io/api/#rebuild */
472
+ rebuild(): Promise<BuildResult<ProvidedOptions>>;
473
+
474
+ /** Documentation: https://esbuild.github.io/api/#watch */
475
+ watch(options?: WatchOptions): Promise<void>;
476
+
477
+ /** Documentation: https://esbuild.github.io/api/#serve */
478
+ serve(options?: ServeOptions): Promise<ServeResult>;
479
+ cancel(): Promise<void>;
480
+ dispose(): Promise<void>;
481
+ }
482
+ // This is a TypeScript type-level function which replaces any keys in "In"
483
+ // that aren't in "Out" with "never". We use this to reject properties with
484
+ // typos in object literals. See: https://stackoverflow.com/questions/49580725
485
+ type SameShape<Out, In extends Out> = In & { [Key in Exclude<keyof In, keyof Out>]: never };
486
+
487
+ /**
488
+ * This function invokes the "esbuild" command-line tool for you. It returns a
489
+ * promise that either resolves with a "BuildResult" object or rejects with a
490
+ * "BuildFailure" object.
491
+ *
492
+ * - Works in node: yes
493
+ * - Works in browser: yes
494
+ *
495
+ * Documentation: https://esbuild.github.io/api/#build
496
+ */
497
+ declare function build<T extends BuildOptions>(options: SameShape<BuildOptions, T>): Promise<BuildResult<T>>;
498
+ /**
499
+ * This is the advanced long-running form of "build" that supports additional
500
+ * features such as watch mode and a local development server.
501
+ *
502
+ * - Works in node: yes
503
+ * - Works in browser: no
504
+ *
505
+ * Documentation: https://esbuild.github.io/api/#build
506
+ */
507
+ declare function context<T extends BuildOptions>(options: SameShape<BuildOptions, T>): Promise<BuildContext<T>>;
508
+ /**
509
+ * This function transforms a single JavaScript file. It can be used to minify
510
+ * JavaScript, convert TypeScript/JSX to JavaScript, or convert newer JavaScript
511
+ * to older JavaScript. It returns a promise that is either resolved with a
512
+ * "TransformResult" object or rejected with a "TransformFailure" object.
513
+ *
514
+ * - Works in node: yes
515
+ * - Works in browser: yes
516
+ *
517
+ * Documentation: https://esbuild.github.io/api/#transform
518
+ */
519
+ declare function transform<T extends TransformOptions>(input: string | Uint8Array, options?: SameShape<TransformOptions, T>): Promise<TransformResult<T>>;
520
+ /**
521
+ * Converts log messages to formatted message strings suitable for printing in
522
+ * the terminal. This allows you to reuse the built-in behavior of esbuild's
523
+ * log message formatter. This is a batch-oriented API for efficiency.
524
+ *
525
+ * - Works in node: yes
526
+ * - Works in browser: yes
527
+ */
528
+ declare function formatMessages(messages: PartialMessage[], options: FormatMessagesOptions): Promise<string[]>;
529
+ /**
530
+ * Pretty-prints an analysis of the metafile JSON to a string. This is just for
531
+ * convenience to be able to match esbuild's pretty-printing exactly. If you want
532
+ * to customize it, you can just inspect the data in the metafile yourself.
533
+ *
534
+ * - Works in node: yes
535
+ * - Works in browser: yes
536
+ *
537
+ * Documentation: https://esbuild.github.io/api/#analyze
538
+ */
539
+ declare function analyzeMetafile(metafile: Metafile | string, options?: AnalyzeMetafileOptions): Promise<string>;
540
+ /**
541
+ * A synchronous version of "build".
542
+ *
543
+ * - Works in node: yes
544
+ * - Works in browser: no
545
+ *
546
+ * Documentation: https://esbuild.github.io/api/#build
547
+ */
548
+ declare function buildSync<T extends BuildOptions>(options: SameShape<BuildOptions, T>): BuildResult<T>;
549
+ /**
550
+ * A synchronous version of "transform".
551
+ *
552
+ * - Works in node: yes
553
+ * - Works in browser: no
554
+ *
555
+ * Documentation: https://esbuild.github.io/api/#transform
556
+ */
557
+ declare function transformSync<T extends TransformOptions>(input: string | Uint8Array, options?: SameShape<TransformOptions, T>): TransformResult<T>;
558
+ /**
559
+ * A synchronous version of "formatMessages".
560
+ *
561
+ * - Works in node: yes
562
+ * - Works in browser: no
563
+ */
564
+ declare function formatMessagesSync(messages: PartialMessage[], options: FormatMessagesOptions): string[];
565
+ /**
566
+ * A synchronous version of "analyzeMetafile".
567
+ *
568
+ * - Works in node: yes
569
+ * - Works in browser: no
570
+ *
571
+ * Documentation: https://esbuild.github.io/api/#analyze
572
+ */
573
+ declare function analyzeMetafileSync(metafile: Metafile | string, options?: AnalyzeMetafileOptions): string;
574
+ /**
575
+ * This configures the browser-based version of esbuild. It is necessary to
576
+ * call this first and wait for the returned promise to be resolved before
577
+ * making other API calls when using esbuild in the browser.
578
+ *
579
+ * - Works in node: yes
580
+ * - Works in browser: yes ("options" is required)
581
+ *
582
+ * Documentation: https://esbuild.github.io/api/#browser
583
+ */
584
+ declare function initialize(options: InitializeOptions): Promise<void>;
585
+ interface InitializeOptions {
586
+ /**
587
+ * The URL of the "esbuild.wasm" file. This must be provided when running
588
+ * esbuild in the browser.
589
+ */
590
+ wasmURL?: string | URL;
591
+
592
+ /**
593
+ * The result of calling "new WebAssembly.Module(buffer)" where "buffer"
594
+ * is a typed array or ArrayBuffer containing the binary code of the
595
+ * "esbuild.wasm" file.
596
+ *
597
+ * You can use this as an alternative to "wasmURL" for environments where it's
598
+ * not possible to download the WebAssembly module.
599
+ */
600
+ wasmModule?: WebAssembly.Module;
601
+
602
+ /**
603
+ * By default esbuild runs the WebAssembly-based browser API in a web worker
604
+ * to avoid blocking the UI thread. This can be disabled by setting "worker"
605
+ * to false.
606
+ */
607
+ worker?: boolean;
608
+ }
609
+ declare let version: string;
610
+ // Note: These declarations exist to avoid type errors when you omit "dom" from
611
+ // "lib" in your "tsconfig.json" file. TypeScript confusingly declares the
612
+ // global "WebAssembly" type in "lib.dom.d.ts" even though it has nothing to do
613
+ // with the browser DOM and is present in many non-browser JavaScript runtimes
614
+ // (e.g. node and deno). Declaring it here allows esbuild's API to be used in
615
+ // these scenarios.
616
+ //
617
+ // There's an open issue about getting this problem corrected (although these
618
+ // declarations will need to remain even if this is fixed for backward
619
+ // compatibility with older TypeScript versions):
620
+ //
621
+ // https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/826
622
+ //
623
+ declare global {
624
+ namespace WebAssembly {
625
+ interface Module {}
626
+ }
627
+ interface URL {}
628
+ }
629
+ type MarkOptional<Type, Keys extends keyof Type> = Type extends Type ? Omit<Type, Keys> & Partial<Pick<Type, Keys>> : never;
630
+ type EsbuildPluginConfig = Options & {
631
+ logger: Console;
632
+ };
633
+ type Optimized = Map<string, {
634
+ file: string;
635
+ }>;
636
+ type OptimizeDepsOptions = {
637
+ cwd: string;
638
+ esbuildOptions?: BuildOptions;
639
+ exclude?: string[];
640
+ include: string[];
641
+ sourceMap: boolean;
642
+ };
643
+ type OptimizeDepsResult = {
644
+ cacheDir: string;
645
+ optimized: Optimized;
646
+ };
647
+ type Options = Omit<TransformOptions, "loader" | "sourcemap"> & {
648
+ exclude?: FilterPattern;
649
+ include?: FilterPattern;
650
+ /**
651
+ * Map extension to esbuild loader
652
+ * Note that each entry (the extension) needs to start with a dot
653
+ */
654
+ loaders?: Record<string, Loader | false>;
655
+ optimizeDeps?: MarkOptional<OptimizeDepsOptions, "cwd" | "sourceMap">;
656
+ sourceMap?: boolean;
657
+ };
658
+ export { EsbuildPluginConfig as E, OptimizeDepsOptions as O, OptimizeDepsResult as a, Optimized as b, Options as c, browserslistToEsbuild as d };
@@ -0,0 +1,3 @@
1
+ import { Plugin } from 'rollup';
2
+ declare const chunkSplitter: () => Plugin;
3
+ export { chunkSplitter as default };
@@ -0,0 +1 @@
1
+ var m=Object.defineProperty;var s=(e,a)=>m(e,"name",{value:a,configurable:!0});import c from"node:assert/strict";import{extractAssignedNames as u}from"@rollup/pluginutils";var y=Object.defineProperty,n=s((e,a)=>y(e,"name",{value:a,configurable:!0}),"r$1");const x=n(function*(e){switch(e.declaration?.type){case"ClassDeclaration":case"FunctionDeclaration":{const{id:a}=e.declaration;c.ok(a,"Expected class/function to have a name"),yield a.name;break}case"VariableDeclaration":{for(const a of e.declaration.declarations)for(const o of u(a.id))yield o;break}}},"exportName"),N=n(function*(e){if(e.declaration)for(const a of x(e))yield{exportedName:a,from:"self",type:"named"};else if(e.source)yield{bindings:e.specifiers.map(a=>({exportedName:a.exported.name,importedName:a.local.name})),from:"other",source:e.source.value,type:"named"};else for(const a of e.specifiers)yield{exportedName:a.exported.name,from:"self",type:"named"}},"parseExportNamed"),b=n(function*(e){e.exported?yield{exportedName:e.exported.name,from:"self",type:"named"}:yield{from:"other",source:e.source.value,type:"barrel"}},"parseExportAll"),h=n(function*(){yield{exportedName:"default",from:"self",type:"named"}},"parseExportDefault"),v=n(function*(e,a){c.ok(a.code!==null,`Module ${a.id} doesn't have associated code`);const o=e.parse(a.code);for(const r of o.body)switch(r.type){case"ExportAllDeclaration":{yield*b(r);break}case"ExportDefaultDeclaration":{yield*h();break}case"ExportNamedDeclaration":{yield*N(r);break}}},"parseExports");var g=Object.defineProperty,i=s((e,a)=>g(e,"name",{value:a,configurable:!0}),"n$1");const f=i(async function(e,a,o){const r=await e.resolve(a,o.id);if(c.ok(r,`Rollup can't resolve ${a} from ${o.id}`),r.external)return;const d=await e.load(r);return c.ok(d,`Rollup doesn't have a module for id ${r.id}`),d},"getImportedModule"),k=i(async function*(e,a,o){const r=await f(e,a.source,o);r&&(yield*l(e,r))},"gatherBarrelReExports"),E=i(async function*(e,a,o){const r=await f(e,a.source,o);if(!r)return;const d=new Map(a.bindings.map(t=>[t.importedName,t]));for await(const t of l(e,r)){const p=d.get(t.exportedName);p&&(yield{...t,exportedName:p.exportedName})}},"gatherNamedReExports"),$=i(function*(e,a){yield{exportedName:a.exportedName,id:e.id,sourceName:a.exportedName}},"gatherNamedSelfExports"),l=i(async function*(e,a){for(const o of v(e,a))o.from==="self"?yield*$(a,o):o.type==="barrel"?yield*k(e,o,a):yield*E(e,o,a)},"gatherExports");var w=Object.defineProperty,D=s((e,a)=>w(e,"name",{value:a,configurable:!0}),"r");const A=D(()=>({moduleParsed:{async handler(e){if(e.isEntry)for await(const a of l(this,e))a.id!==e.id&&this.emitFile({id:a.id,name:a.exportedName,preserveSignature:"exports-only",type:"chunk"})},order:"post"},name:"packem:chunk-splitter"}),"chunkSplitter");export{A as default};
@@ -0,0 +1,11 @@
1
+ import { Plugin } from 'rollup';
2
+ interface CJSInteropOptions {
3
+ addDefaultProperty?: boolean;
4
+ }
5
+ declare const cjsInteropPlugin: ({
6
+ addDefaultProperty,
7
+ logger
8
+ }: CJSInteropOptions & {
9
+ logger: Console;
10
+ }) => Plugin;
11
+ export { CJSInteropOptions, cjsInteropPlugin };
@@ -0,0 +1,2 @@
1
+ var d=Object.defineProperty;var u=(e,r)=>d(e,"name",{value:r,configurable:!0});import c from"magic-string";var i=Object.defineProperty,s=u((e,r)=>i(e,"name",{value:r,configurable:!0}),"p");const f=/(exports(?:\['default'\]|\.default)) = (.*);/i,m=/(?:module\.)?exports(?:\['default'\]|\.default)/i,j=s(({addDefaultProperty:e=!1,logger:r})=>({name:"packem:cjs-interop",renderChunk:s((p,l,a)=>{if(l.isEntry&&a.format==="cjs"&&a.exports==="auto"){const o=f.exec(p);if(o===null||o.length<3)return;const t=new c(p);t.replace("Object.defineProperty(exports, '__esModule', { value: true });",""),t.replaceAll(/exports\.(.*) = (.*);/g,"module.exports.$1 = $2;"),e&&t.append(`
2
+ module.exports.default = ${o[2]};`);let n=t.toString();return n=n.replace(m,"module.exports"),r.debug({message:`Applied CommonJS interop to entry chunk ${l.fileName}.`,prefix:"plugin:cjs-interop"}),{code:n,map:t.generateMap({hires:!0})}}},"renderChunk")}),"cjsInteropPlugin");export{j as cjsInteropPlugin};