rolldown 0.10.2 → 0.10.3

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 (64) hide show
  1. package/bin/cli.js +1 -1
  2. package/dist/cjs/cli.cjs +772 -0
  3. package/dist/cjs/index.cjs +26 -0
  4. package/dist/cjs/parallel-plugin-worker.cjs +32 -0
  5. package/dist/{parallel-plugin.cjs → cjs/parallel-plugin.cjs} +2 -3
  6. package/dist/esm/cli.mjs +773 -0
  7. package/dist/esm/index.mjs +24 -0
  8. package/dist/esm/parallel-plugin-worker.mjs +33 -0
  9. package/dist/esm/parallel-plugin.mjs +9 -0
  10. package/dist/shared/chunk-WMSF1LUG.cjs +37 -0
  11. package/dist/shared/consola_36c0034f-ED9jtJgC.mjs +942 -0
  12. package/dist/shared/consola_36c0034f-RVbq7gBJ.cjs +945 -0
  13. package/dist/shared/prompt-Q6AgPcFh.cjs +859 -0
  14. package/dist/shared/prompt-uoOfg_gh.mjs +860 -0
  15. package/dist/shared/rolldown-7z0huS4W.mjs +49 -0
  16. package/dist/shared/rolldown-binding.wasi.cjs +26 -13
  17. package/dist/shared/rolldown-pt4wPK1i.cjs +48 -0
  18. package/dist/shared/utils_index-0Q22WhZL.cjs +5331 -0
  19. package/dist/shared/utils_index-Wfcc8MjH.mjs +5361 -0
  20. package/dist/shared/wasi-worker-browser.mjs +6 -7
  21. package/dist/shared/wasi-worker.mjs +5 -2
  22. package/package.json +52 -37
  23. package/dist/chunks/prompt.cjs +0 -443
  24. package/dist/chunks/prompt.cjs.map +0 -1
  25. package/dist/chunks/prompt.mjs +0 -436
  26. package/dist/chunks/prompt.mjs.map +0 -1
  27. package/dist/cli.cjs +0 -1961
  28. package/dist/cli.cjs.map +0 -1
  29. package/dist/cli.d.cts +0 -2
  30. package/dist/cli.d.mts +0 -2
  31. package/dist/cli.d.ts +0 -2
  32. package/dist/cli.mjs +0 -1939
  33. package/dist/cli.mjs.map +0 -1
  34. package/dist/index.cjs +0 -26
  35. package/dist/index.cjs.map +0 -1
  36. package/dist/index.d.cts +0 -66
  37. package/dist/index.d.mts +0 -66
  38. package/dist/index.d.ts +0 -66
  39. package/dist/index.mjs +0 -21
  40. package/dist/index.mjs.map +0 -1
  41. package/dist/parallel-plugin-worker.cjs +0 -34
  42. package/dist/parallel-plugin-worker.cjs.map +0 -1
  43. package/dist/parallel-plugin-worker.d.cts +0 -2
  44. package/dist/parallel-plugin-worker.d.mts +0 -2
  45. package/dist/parallel-plugin-worker.d.ts +0 -2
  46. package/dist/parallel-plugin-worker.mjs +0 -32
  47. package/dist/parallel-plugin-worker.mjs.map +0 -1
  48. package/dist/parallel-plugin.cjs.map +0 -1
  49. package/dist/parallel-plugin.d.cts +0 -12
  50. package/dist/parallel-plugin.d.mts +0 -12
  51. package/dist/parallel-plugin.d.ts +0 -12
  52. package/dist/parallel-plugin.mjs +0 -6
  53. package/dist/parallel-plugin.mjs.map +0 -1
  54. package/dist/shared/rolldown.1ea1dc1e.d.cts +0 -1160
  55. package/dist/shared/rolldown.1ea1dc1e.d.mts +0 -1160
  56. package/dist/shared/rolldown.1ea1dc1e.d.ts +0 -1160
  57. package/dist/shared/rolldown.4d4592d7.cjs +0 -348
  58. package/dist/shared/rolldown.4d4592d7.cjs.map +0 -1
  59. package/dist/shared/rolldown.65028ebe.cjs +0 -547
  60. package/dist/shared/rolldown.65028ebe.cjs.map +0 -1
  61. package/dist/shared/rolldown.7d1ce9fc.mjs +0 -546
  62. package/dist/shared/rolldown.7d1ce9fc.mjs.map +0 -1
  63. package/dist/shared/rolldown.b914368a.mjs +0 -340
  64. package/dist/shared/rolldown.b914368a.mjs.map +0 -1
@@ -1,348 +0,0 @@
1
- 'use strict';
2
-
3
- const transformSourcemap = require('./rolldown.65028ebe.cjs');
4
- const nodePath = require('node:path');
5
- require('path');
6
- const node_worker_threads = require('node:worker_threads');
7
- const node_os = require('node:os');
8
-
9
- function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
10
-
11
- const nodePath__default = /*#__PURE__*/_interopDefaultCompat(nodePath);
12
-
13
- async function asyncFlatten(array) {
14
- do {
15
- array = (await Promise.all(array)).flat(Infinity);
16
- } while (array.some((v) => v?.then));
17
- return array;
18
- }
19
-
20
- function transformToRollupOutputChunk(chunk) {
21
- return {
22
- type: "chunk",
23
- get code() {
24
- return chunk.code;
25
- },
26
- fileName: chunk.fileName,
27
- get modules() {
28
- return Object.fromEntries(
29
- Object.entries(chunk.modules).map(([key, _]) => [key, {}])
30
- );
31
- },
32
- exports: chunk.exports,
33
- isEntry: chunk.isEntry,
34
- facadeModuleId: chunk.facadeModuleId || null,
35
- isDynamicEntry: chunk.isDynamicEntry,
36
- get moduleIds() {
37
- return chunk.moduleIds;
38
- },
39
- get map() {
40
- return chunk.map ? JSON.parse(chunk.map) : null;
41
- },
42
- sourcemapFileName: chunk.sourcemapFileName || null
43
- };
44
- }
45
- function transformToRollupOutputAsset(asset) {
46
- return {
47
- type: "asset",
48
- fileName: asset.fileName,
49
- get source() {
50
- return asset.source;
51
- }
52
- };
53
- }
54
- function transformToRollupOutput(output) {
55
- const { chunks, assets } = output;
56
- const [firstChunk, ...restChunks] = chunks;
57
- return {
58
- output: [
59
- transformToRollupOutputChunk(firstChunk),
60
- ...restChunks.map(transformToRollupOutputChunk),
61
- ...assets.map(transformToRollupOutputAsset)
62
- ]
63
- };
64
- }
65
-
66
- const normalizePluginOption = async (plugins) => (await asyncFlatten([plugins])).filter(Boolean);
67
-
68
- function ensureArray(items) {
69
- if (Array.isArray(items)) {
70
- return items.filter(Boolean);
71
- }
72
- if (items) {
73
- return [items];
74
- }
75
- return [];
76
- }
77
-
78
- async function normalizeInputOptions(config) {
79
- return {
80
- input: getInput(config),
81
- plugins: await normalizePluginOption(config.plugins),
82
- external: getIdMatcher(config.external),
83
- resolve: getResolve(config.resolve),
84
- platform: config.platform,
85
- shimMissingExports: config.shimMissingExports ?? false
86
- };
87
- }
88
- function getInput(config) {
89
- const configInput = config.input;
90
- return configInput == null ? [] : typeof configInput === "string" ? [configInput] : configInput;
91
- }
92
- const getIdMatcher = (option) => {
93
- if (typeof option === "function") {
94
- return (id, ...parameters) => !id.startsWith("\0") && option(id, ...parameters) || false;
95
- }
96
- if (option) {
97
- const ids = /* @__PURE__ */ new Set();
98
- const matchers = [];
99
- for (const value of ensureArray(option)) {
100
- if (value instanceof RegExp) {
101
- matchers.push(value);
102
- } else {
103
- ids.add(value);
104
- }
105
- }
106
- return (id, ..._arguments) => ids.has(id) || matchers.some((matcher) => matcher.test(id));
107
- }
108
- return () => false;
109
- };
110
- function getResolve(resolve) {
111
- if (resolve) {
112
- return {
113
- ...resolve,
114
- alias: resolve.alias ? Object.entries(resolve.alias).map(([find, replacement]) => ({
115
- find,
116
- replacements: [replacement]
117
- })) : void 0
118
- };
119
- }
120
- }
121
-
122
- function createInputOptionsAdapter(options, inputOptions, outputOptions) {
123
- return {
124
- input: normalizeInput(options.input),
125
- plugins: options.plugins.map((plugin) => {
126
- if ("_parallel" in plugin) {
127
- return void 0;
128
- }
129
- return transformSourcemap.bindingifyPlugin(plugin, options, outputOptions);
130
- }),
131
- cwd: inputOptions.cwd ?? process.cwd(),
132
- external: inputOptions.external ? options.external : void 0,
133
- resolve: options.resolve,
134
- platform: options.platform,
135
- shimMissingExports: options.shimMissingExports,
136
- logLevel: inputOptions.logLevel
137
- };
138
- }
139
- function normalizeInput(input) {
140
- if (Array.isArray(input)) {
141
- return input.map((src) => {
142
- const name = nodePath__default.parse(src).name;
143
- return {
144
- name,
145
- import: src
146
- };
147
- });
148
- } else {
149
- return Object.entries(input).map((value) => {
150
- return { name: value[0], import: value[1] };
151
- });
152
- }
153
- }
154
-
155
- function normalizeFormat(format) {
156
- if (format == null || format === "es" || format === "cjs") {
157
- return format;
158
- } else {
159
- return unimplemented(`output.format: ${format}`);
160
- }
161
- }
162
- function normalizeSourcemap(sourcemap) {
163
- switch (sourcemap) {
164
- case true:
165
- return "file";
166
- case "inline":
167
- return "inline";
168
- case false:
169
- case void 0:
170
- case "hidden":
171
- return "hidden";
172
- default:
173
- throw new Error(`unknown sourcemap: ${sourcemap}`);
174
- }
175
- }
176
- const getAddon = (config, name) => {
177
- const configAddon = config[name];
178
- if (configAddon === void 0)
179
- return void 0;
180
- if (typeof configAddon === "function") {
181
- return configAddon;
182
- }
183
- return () => configAddon || "";
184
- };
185
- function normalizeOutputOptions(opts) {
186
- const { dir, format, exports, sourcemap, entryFileNames, chunkFileNames } = opts;
187
- return {
188
- dir,
189
- format: normalizeFormat(format),
190
- exports,
191
- sourcemap: normalizeSourcemap(sourcemap),
192
- // TODO(sapphi-red): support parallel plugins
193
- plugins: [],
194
- banner: getAddon(opts, "banner"),
195
- footer: getAddon(opts, "footer"),
196
- entryFileNames,
197
- chunkFileNames
198
- };
199
- }
200
-
201
- async function initializeParallelPlugins(plugins) {
202
- const pluginInfos = [];
203
- for (const [index, plugin] of plugins.entries()) {
204
- if ("_parallel" in plugin) {
205
- const { fileUrl, options } = plugin._parallel;
206
- pluginInfos.push({ index, fileUrl, options });
207
- }
208
- }
209
- if (pluginInfos.length <= 0) {
210
- return void 0;
211
- }
212
- const count = Math.min(node_os.availableParallelism(), 8);
213
- const parallelJsPluginRegistry = new transformSourcemap.ParallelJsPluginRegistry(count);
214
- const registryId = parallelJsPluginRegistry.id;
215
- const workers = await initializeWorkers(registryId, count, pluginInfos);
216
- const stopWorkers = async () => {
217
- await Promise.all(workers.map((worker) => worker.terminate()));
218
- };
219
- return { registry: parallelJsPluginRegistry, stopWorkers };
220
- }
221
- function initializeWorkers(registryId, count, pluginInfos) {
222
- return Promise.all(
223
- Array.from(
224
- { length: count },
225
- (_, i) => initializeWorker(registryId, pluginInfos, i)
226
- )
227
- );
228
- }
229
- async function initializeWorker(registryId, pluginInfos, threadNumber) {
230
- const urlString = undefined("#parallel-plugin-worker");
231
- const worker = new node_worker_threads.Worker(new URL(urlString), {
232
- workerData: { registryId, pluginInfos, threadNumber }
233
- });
234
- worker.unref();
235
- await new Promise((resolve) => {
236
- worker.once("message", async () => {
237
- resolve();
238
- });
239
- });
240
- return worker;
241
- }
242
-
243
- async function createBundler(inputOptions, outputOptions) {
244
- const normalizedInputOptions = await normalizeInputOptions(inputOptions);
245
- const parallelPluginInitResult = await initializeParallelPlugins(
246
- normalizedInputOptions.plugins
247
- );
248
- const normalizedOutputOptions = normalizeOutputOptions(outputOptions);
249
- const bindingInputOptions = createInputOptionsAdapter(
250
- normalizedInputOptions,
251
- inputOptions,
252
- normalizedOutputOptions
253
- );
254
- return {
255
- bundler: new transformSourcemap.Bundler(
256
- bindingInputOptions,
257
- normalizedOutputOptions,
258
- parallelPluginInitResult?.registry
259
- ),
260
- stopWorkers: parallelPluginInitResult?.stopWorkers
261
- };
262
- }
263
-
264
- function arraify(value) {
265
- return Array.isArray(value) ? value : [value];
266
- }
267
- function unimplemented(info) {
268
- if (info) {
269
- throw new Error(`unimplemented: ${info}`);
270
- }
271
- throw new Error("unimplemented");
272
- }
273
-
274
- var __accessCheck = (obj, member, msg) => {
275
- if (!member.has(obj))
276
- throw TypeError("Cannot " + msg);
277
- };
278
- var __privateGet = (obj, member, getter) => {
279
- __accessCheck(obj, member, "read from private field");
280
- return getter ? getter.call(obj) : member.get(obj);
281
- };
282
- var __privateAdd = (obj, member, value) => {
283
- if (member.has(obj))
284
- throw TypeError("Cannot add the same private member more than once");
285
- member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
286
- };
287
- var __privateSet = (obj, member, value, setter) => {
288
- __accessCheck(obj, member, "write to private field");
289
- setter ? setter.call(obj, value) : member.set(obj, value);
290
- return value;
291
- };
292
- var __privateMethod = (obj, member, method) => {
293
- __accessCheck(obj, member, "access private method");
294
- return method;
295
- };
296
- var _inputOptions, _bundler, _stopWorkers, _getBundler, getBundler_fn;
297
- class RolldownBuild {
298
- constructor(inputOptions) {
299
- __privateAdd(this, _getBundler);
300
- __privateAdd(this, _inputOptions, void 0);
301
- __privateAdd(this, _bundler, void 0);
302
- __privateAdd(this, _stopWorkers, void 0);
303
- __privateSet(this, _inputOptions, inputOptions);
304
- }
305
- async generate(outputOptions = {}) {
306
- const bundler = await __privateMethod(this, _getBundler, getBundler_fn).call(this, outputOptions);
307
- const output = await bundler.generate();
308
- return transformToRollupOutput(output);
309
- }
310
- async write(outputOptions = {}) {
311
- const bundler = await __privateMethod(this, _getBundler, getBundler_fn).call(this, outputOptions);
312
- const output = await bundler.write();
313
- return transformToRollupOutput(output);
314
- }
315
- async destroy() {
316
- var _a;
317
- await ((_a = __privateGet(this, _stopWorkers)) == null ? void 0 : _a.call(this));
318
- }
319
- }
320
- _inputOptions = new WeakMap();
321
- _bundler = new WeakMap();
322
- _stopWorkers = new WeakMap();
323
- _getBundler = new WeakSet();
324
- getBundler_fn = async function(outputOptions) {
325
- if (typeof __privateGet(this, _bundler) === "undefined") {
326
- const { bundler, stopWorkers } = await createBundler(
327
- __privateGet(this, _inputOptions),
328
- outputOptions
329
- );
330
- __privateSet(this, _bundler, bundler);
331
- __privateSet(this, _stopWorkers, stopWorkers);
332
- }
333
- return __privateGet(this, _bundler);
334
- };
335
-
336
- const rolldown = async (input) => {
337
- return new RolldownBuild(input);
338
- };
339
- const experimental_scan = async (input) => {
340
- const { bundler, stopWorkers } = await createBundler(input, {});
341
- await bundler.scan();
342
- await stopWorkers?.();
343
- };
344
-
345
- exports.arraify = arraify;
346
- exports.experimental_scan = experimental_scan;
347
- exports.rolldown = rolldown;
348
- //# sourceMappingURL=rolldown.4d4592d7.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rolldown.4d4592d7.cjs","sources":["../../src/utils/async-flatten.ts","../../src/utils/transform-to-rollup-output.ts","../../src/utils/normalize-plugin-option.ts","../../src/utils/ensure-array.ts","../../src/options/input-options.ts","../../src/options/input-options-adapter.ts","../../src/options/output-options.ts","../../src/utils/initialize-parallel-plugins.ts","../../src/utils/create-bundler.ts","../../src/utils/index.ts","../../src/rolldown-build.ts","../../src/rolldown.ts"],"sourcesContent":["// Copied from https://github.com/rollup/rollup/blob/3b560f7c889a63968dabc9b6970aabf52a77d3fd/src/utils/asyncFlatten.ts\n\nexport async function asyncFlatten<T>(array: T[]): Promise<T[]> {\n do {\n array = (await Promise.all(array)).flat(Infinity) as any\n } while (array.some((v: any) => v?.then))\n return array\n}\n","import {\n RolldownOutput,\n RolldownOutputAsset,\n RolldownOutputChunk,\n} from '../types/rolldown-output'\nimport { OutputBundle } from '../types/output-bundle'\nimport {\n BindingOutputAsset,\n BindingOutputChunk,\n BindingOutputs,\n} from '../binding'\n\nfunction transformToRollupOutputChunk(\n chunk: BindingOutputChunk,\n): RolldownOutputChunk {\n return {\n type: 'chunk',\n get code() {\n return chunk.code\n },\n fileName: chunk.fileName,\n get modules() {\n return Object.fromEntries(\n Object.entries(chunk.modules).map(([key, _]) => [key, {}]),\n )\n },\n exports: chunk.exports,\n isEntry: chunk.isEntry,\n facadeModuleId: chunk.facadeModuleId || null,\n isDynamicEntry: chunk.isDynamicEntry,\n get moduleIds() {\n return chunk.moduleIds\n },\n get map() {\n return chunk.map ? JSON.parse(chunk.map) : null\n },\n sourcemapFileName: chunk.sourcemapFileName || null,\n }\n}\n\nfunction transformToRollupOutputAsset(\n asset: BindingOutputAsset,\n): RolldownOutputAsset {\n return {\n type: 'asset',\n fileName: asset.fileName,\n get source() {\n return asset.source\n },\n }\n}\n\nexport function transformToRollupOutput(\n output: BindingOutputs,\n): RolldownOutput {\n const { chunks, assets } = output\n const [firstChunk, ...restChunks] = chunks\n return {\n output: [\n transformToRollupOutputChunk(firstChunk),\n ...restChunks.map(transformToRollupOutputChunk),\n ...assets.map(transformToRollupOutputAsset),\n ],\n }\n}\n\nexport function transformToOutputBundle(output: BindingOutputs): OutputBundle {\n return Object.fromEntries(\n transformToRollupOutput(output).output.map((item) => [item.fileName, item]),\n )\n}\n","import type { OutputOptions, OutputPlugin } from '../rollup-types'\nimport type { InputOptions } from '../options/input-options'\nimport { asyncFlatten } from './async-flatten'\nimport { ParallelPlugin, Plugin } from '../plugin'\n\nexport const normalizePluginOption: {\n (plugins: InputOptions['plugins']): Promise<(ParallelPlugin | Plugin)[]>\n (plugins: OutputOptions['plugins']): Promise<OutputPlugin[]>\n (plugins: unknown): Promise<any[]>\n} = async (plugins: any) => (await asyncFlatten([plugins])).filter(Boolean)\n","export function ensureArray<T>(\n items: (T | false | null | undefined)[] | T | false | null | undefined,\n): T[] {\n if (Array.isArray(items)) {\n return items.filter(Boolean) as T[]\n }\n if (items) {\n return [items]\n }\n return []\n}\n","import {\n NormalizedInputOptions,\n InputOptions as RollupInputOptions,\n} from '../rollup-types'\nimport { ensureArray, normalizePluginOption } from '../utils'\nimport { BindingInputOptions, BindingResolveOptions } from '../binding'\nimport { Plugin, ParallelPlugin } from '../plugin'\n\n// TODO export compat plugin type\nexport interface InputOptions {\n input?: RollupInputOptions['input']\n plugins?: (Plugin | ParallelPlugin)[]\n external?: RollupInputOptions['external']\n resolve?: RolldownResolveOptions\n cwd?: string\n platform?: BindingInputOptions['platform']\n shimMissingExports?: BindingInputOptions['shimMissingExports']\n logLevel?: BindingInputOptions['logLevel']\n}\n\nexport type RolldownResolveOptions = Omit<BindingResolveOptions, 'alias'> & {\n alias?: Record<string, string>\n}\n\nexport type RolldownNormalizedInputOptions = Omit<\n NormalizedInputOptions,\n 'plugins'\n> & {\n plugins: (Plugin | ParallelPlugin)[]\n resolve?: BindingResolveOptions\n platform?: BindingInputOptions['platform']\n}\n\nexport async function normalizeInputOptions(\n config: InputOptions,\n): Promise<RolldownNormalizedInputOptions> {\n // @ts-expect-error\n return {\n input: getInput(config),\n plugins: await normalizePluginOption(config.plugins),\n external: getIdMatcher(config.external),\n resolve: getResolve(config.resolve),\n platform: config.platform,\n shimMissingExports: config.shimMissingExports ?? false,\n }\n}\n\nfunction getInput(config: InputOptions): NormalizedInputOptions['input'] {\n const configInput = config.input\n return configInput == null\n ? []\n : typeof configInput === 'string'\n ? [configInput]\n : configInput\n}\n\nconst getIdMatcher = <T extends Array<any>>(\n option:\n | undefined\n // | boolean\n | string\n | RegExp\n | (string | RegExp)[]\n | ((id: string, ...parameters: T) => boolean | null | void),\n): ((id: string, ...parameters: T) => boolean) => {\n // if (option === true) {\n // \treturn () => true;\n // }\n if (typeof option === 'function') {\n return (id, ...parameters) =>\n (!id.startsWith('\\0') && option(id, ...parameters)) || false\n }\n if (option) {\n const ids = new Set<string>()\n const matchers: RegExp[] = []\n for (const value of ensureArray(option)) {\n if (value instanceof RegExp) {\n matchers.push(value)\n } else {\n ids.add(value)\n }\n }\n return (id: string, ..._arguments) =>\n ids.has(id) || matchers.some((matcher) => matcher.test(id))\n }\n // Rollup here convert `undefined` to function, it is bad for performance. So it will convert to `undefined` at adapter.\n return () => false\n}\n\nfunction getResolve(\n resolve?: RolldownResolveOptions,\n): RolldownNormalizedInputOptions['resolve'] {\n if (resolve) {\n return {\n ...resolve,\n alias: resolve.alias\n ? Object.entries(resolve.alias).map(([find, replacement]) => ({\n find,\n replacements: [replacement],\n }))\n : undefined,\n }\n }\n}\n","import { NormalizedInputOptions } from '../rollup-types'\nimport { BindingInputOptions } from '../binding'\nimport nodePath from 'node:path'\nimport { bindingifyPlugin } from '../plugin/bindingify-plugin'\nimport { InputOptions, RolldownNormalizedInputOptions } from './input-options'\nimport { NormalizedOutputOptions } from './output-options'\n\nexport function createInputOptionsAdapter(\n options: RolldownNormalizedInputOptions,\n inputOptions: InputOptions,\n outputOptions: NormalizedOutputOptions,\n): BindingInputOptions {\n return {\n input: normalizeInput(options.input),\n plugins: options.plugins.map((plugin) => {\n if ('_parallel' in plugin) {\n return undefined\n }\n return bindingifyPlugin(plugin, options, outputOptions)\n }),\n cwd: inputOptions.cwd ?? process.cwd(),\n external: inputOptions.external ? options.external : undefined,\n resolve: options.resolve,\n platform: options.platform,\n shimMissingExports: options.shimMissingExports,\n logLevel: inputOptions.logLevel,\n }\n}\n\nfunction normalizeInput(\n input: NormalizedInputOptions['input'],\n): BindingInputOptions['input'] {\n if (Array.isArray(input)) {\n return input.map((src) => {\n const name = nodePath.parse(src).name\n return {\n name,\n import: src,\n }\n })\n } else {\n return Object.entries(input).map((value) => {\n return { name: value[0], import: value[1] }\n })\n }\n}\n","import { OutputOptions as RollupOutputOptions } from '../rollup-types'\nimport { BindingOutputOptions } from '../binding'\nimport { unimplemented } from '../utils'\n\nexport interface OutputOptions {\n dir?: RollupOutputOptions['dir']\n format?: 'es'\n exports?: RollupOutputOptions['exports']\n sourcemap?: RollupOutputOptions['sourcemap']\n banner?: RollupOutputOptions['banner']\n footer?: RollupOutputOptions['footer']\n entryFileNames?: string\n chunkFileNames?: string\n}\n\nexport type NormalizedOutputOptions = BindingOutputOptions\n\nfunction normalizeFormat(\n format: OutputOptions['format'],\n): BindingOutputOptions['format'] {\n if (format == null || format === 'es' || format === 'cjs') {\n return format\n } else {\n return unimplemented(`output.format: ${format}`)\n }\n}\n\nfunction normalizeSourcemap(\n sourcemap: OutputOptions['sourcemap'],\n): BindingOutputOptions['sourcemap'] {\n switch (sourcemap) {\n case true:\n return 'file'\n\n case 'inline':\n return 'inline'\n\n case false:\n case undefined:\n case 'hidden':\n return 'hidden'\n\n default:\n throw new Error(`unknown sourcemap: ${sourcemap}`)\n }\n}\n\nconst getAddon = <T extends 'banner' | 'footer'>(\n config: OutputOptions,\n name: T,\n): BindingOutputOptions[T] => {\n const configAddon = config[name]\n if (configAddon === undefined) return undefined\n if (typeof configAddon === 'function') {\n return configAddon as BindingOutputOptions[T]\n }\n return () => configAddon || ''\n}\n\nexport function normalizeOutputOptions(\n opts: OutputOptions,\n): BindingOutputOptions {\n const { dir, format, exports, sourcemap, entryFileNames, chunkFileNames } =\n opts\n return {\n dir: dir,\n format: normalizeFormat(format),\n exports,\n sourcemap: normalizeSourcemap(sourcemap),\n // TODO(sapphi-red): support parallel plugins\n plugins: [],\n banner: getAddon(opts, 'banner'),\n footer: getAddon(opts, 'footer'),\n entryFileNames,\n chunkFileNames,\n }\n}\n","import { Worker } from 'node:worker_threads'\nimport { availableParallelism } from 'node:os'\nimport { ParallelPlugin, Plugin } from '../plugin'\nimport { ParallelJsPluginRegistry } from '../binding'\n\nexport type WorkerData = {\n registryId: number\n pluginInfos: ParallelPluginInfo[]\n threadNumber: number\n}\n\ntype ParallelPluginInfo = {\n index: number\n fileUrl: string\n options: unknown\n}\n\nexport async function initializeParallelPlugins(\n plugins: (Plugin | ParallelPlugin)[],\n) {\n const pluginInfos: ParallelPluginInfo[] = []\n for (const [index, plugin] of plugins.entries()) {\n if ('_parallel' in plugin) {\n const { fileUrl, options } = plugin._parallel\n pluginInfos.push({ index, fileUrl, options })\n }\n }\n if (pluginInfos.length <= 0) {\n return undefined\n }\n\n const count = Math.min(availableParallelism(), 8)\n const parallelJsPluginRegistry = new ParallelJsPluginRegistry(count)\n const registryId = parallelJsPluginRegistry.id\n\n const workers = await initializeWorkers(registryId, count, pluginInfos)\n const stopWorkers = async () => {\n await Promise.all(workers.map((worker) => worker.terminate()))\n }\n\n return { registry: parallelJsPluginRegistry, stopWorkers }\n}\n\nexport function initializeWorkers(\n registryId: number,\n count: number,\n pluginInfos: ParallelPluginInfo[],\n) {\n return Promise.all(\n Array.from({ length: count }, (_, i) =>\n initializeWorker(registryId, pluginInfos, i),\n ),\n )\n}\n\nasync function initializeWorker(\n registryId: number,\n pluginInfos: ParallelPluginInfo[],\n threadNumber: number,\n) {\n const urlString = import.meta.resolve('#parallel-plugin-worker')\n const worker = new Worker(new URL(urlString), {\n workerData: { registryId, pluginInfos, threadNumber } satisfies WorkerData,\n })\n worker.unref()\n await new Promise<void>((resolve) => {\n worker.once('message', async () => {\n resolve()\n })\n })\n return worker\n}\n","import { Bundler } from '../binding'\nimport {\n normalizeInputOptions,\n type InputOptions,\n} from '../options/input-options'\nimport { createInputOptionsAdapter } from '../options/input-options-adapter'\nimport {\n OutputOptions,\n normalizeOutputOptions,\n} from '../options/output-options'\nimport { initializeParallelPlugins } from './initialize-parallel-plugins'\n\nexport async function createBundler(\n inputOptions: InputOptions,\n outputOptions: OutputOptions,\n): Promise<{ bundler: Bundler; stopWorkers?: () => Promise<void> }> {\n // Convert `InputOptions` to `NormalizedInputOptions`.\n const normalizedInputOptions = await normalizeInputOptions(inputOptions)\n\n const parallelPluginInitResult = await initializeParallelPlugins(\n normalizedInputOptions.plugins,\n )\n\n const normalizedOutputOptions = normalizeOutputOptions(outputOptions)\n // Convert `NormalizedInputOptions` to `BindingInputOptions`\n const bindingInputOptions = createInputOptionsAdapter(\n normalizedInputOptions,\n inputOptions,\n normalizedOutputOptions,\n )\n\n // TODO(sapphi-red): call stopWorkers when an error happened\n return {\n bundler: new Bundler(\n bindingInputOptions,\n normalizedOutputOptions,\n parallelPluginInitResult?.registry,\n ),\n stopWorkers: parallelPluginInitResult?.stopWorkers,\n }\n}\n","export * from './async-flatten'\nexport * from './transform-to-rollup-output'\nexport * from './normalize-plugin-option'\nexport * from './ensure-array'\nexport * from './create-bundler'\nexport * from './transform-sourcemap'\n\nexport function arraify<T>(value: T | T[]): T[] {\n return Array.isArray(value) ? value : [value]\n}\n\nexport function unimplemented(info?: string): never {\n if (info) {\n throw new Error(`unimplemented: ${info}`)\n }\n throw new Error('unimplemented')\n}\n\nexport function unreachable(info?: string): never {\n if (info) {\n throw new Error(`unreachable: ${info}`)\n }\n throw new Error('unreachable')\n}\n\nexport function noop(..._args: any[]) {}\n","import { Bundler } from './binding'\nimport { normalizeOutputOptions, OutputOptions } from './options/output-options'\nimport { createBundler, transformToRollupOutput, unimplemented } from './utils'\nimport { RolldownOutput } from './types/rolldown-output'\nimport { HasProperty, TypeAssert } from './utils/type-assert'\nimport { InputOptions } from './options/input-options'\n\nexport class RolldownBuild {\n #inputOptions: InputOptions\n #bundler?: Bundler\n #stopWorkers?: () => Promise<void>\n\n constructor(inputOptions: InputOptions) {\n // TODO: Check if `inputOptions.output` is set. If so, throw an warning that it is ignored.\n this.#inputOptions = inputOptions\n }\n\n async #getBundler(outputOptions: OutputOptions): Promise<Bundler> {\n if (typeof this.#bundler === 'undefined') {\n const { bundler, stopWorkers } = await createBundler(\n this.#inputOptions,\n outputOptions,\n )\n this.#bundler = bundler\n this.#stopWorkers = stopWorkers\n }\n return this.#bundler\n }\n\n async generate(outputOptions: OutputOptions = {}): Promise<RolldownOutput> {\n const bundler = await this.#getBundler(outputOptions)\n const output = await bundler.generate()\n return transformToRollupOutput(output)\n }\n\n async write(outputOptions: OutputOptions = {}): Promise<RolldownOutput> {\n const bundler = await this.#getBundler(outputOptions)\n const output = await bundler.write()\n return transformToRollupOutput(output)\n }\n\n async destroy(): Promise<void> {\n await this.#stopWorkers?.()\n }\n}\n\nfunction _assert() {\n type _ = TypeAssert<HasProperty<RolldownBuild, 'generate' | 'write'>>\n}\n","import { InputOptions } from './options/input-options'\nimport { RolldownBuild } from './rolldown-build'\nimport { createBundler } from './utils'\n\n// Compat to `rollup.rollup`, it is included scan module graph and linker.\nexport const rolldown = async (input: InputOptions): Promise<RolldownBuild> => {\n return new RolldownBuild(input)\n}\n\n/**\n * @description\n * This is an experimental API. It's behavior may change in the future.\n * Calling this API will only execute the scan stage of rolldown.\n */\nexport const experimental_scan = async (input: InputOptions): Promise<void> => {\n const { bundler, stopWorkers } = await createBundler(input, {})\n await bundler.scan()\n await stopWorkers?.()\n}\n"],"names":["bindingifyPlugin","nodePath","availableParallelism","ParallelJsPluginRegistry","Worker","Bundler"],"mappings":";;;;;;;;;;;;AAEA,eAAsB,aAAgB,KAA0B,EAAA;AAC9D,EAAG,GAAA;AACD,IAAA,KAAA,GAAA,CAAS,MAAM,OAAQ,CAAA,GAAA,CAAI,KAAK,CAAA,EAAG,KAAK,QAAQ,CAAA,CAAA;AAAA,WACzC,KAAM,CAAA,IAAA,CAAK,CAAC,CAAA,KAAW,GAAG,IAAI,CAAA,EAAA;AACvC,EAAO,OAAA,KAAA,CAAA;AACT;;ACKA,SAAS,6BACP,KACqB,EAAA;AACrB,EAAO,OAAA;AAAA,IACL,IAAM,EAAA,OAAA;AAAA,IACN,IAAI,IAA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