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.
- package/bin/cli.js +1 -1
- package/dist/cjs/cli.cjs +772 -0
- package/dist/cjs/index.cjs +26 -0
- package/dist/cjs/parallel-plugin-worker.cjs +32 -0
- package/dist/{parallel-plugin.cjs → cjs/parallel-plugin.cjs} +2 -3
- package/dist/esm/cli.mjs +773 -0
- package/dist/esm/index.mjs +24 -0
- package/dist/esm/parallel-plugin-worker.mjs +33 -0
- package/dist/esm/parallel-plugin.mjs +9 -0
- package/dist/shared/chunk-WMSF1LUG.cjs +37 -0
- package/dist/shared/consola_36c0034f-ED9jtJgC.mjs +942 -0
- package/dist/shared/consola_36c0034f-RVbq7gBJ.cjs +945 -0
- package/dist/shared/prompt-Q6AgPcFh.cjs +859 -0
- package/dist/shared/prompt-uoOfg_gh.mjs +860 -0
- package/dist/shared/rolldown-7z0huS4W.mjs +49 -0
- package/dist/shared/rolldown-binding.wasi.cjs +26 -13
- package/dist/shared/rolldown-pt4wPK1i.cjs +48 -0
- package/dist/shared/utils_index-0Q22WhZL.cjs +5331 -0
- package/dist/shared/utils_index-Wfcc8MjH.mjs +5361 -0
- package/dist/shared/wasi-worker-browser.mjs +6 -7
- package/dist/shared/wasi-worker.mjs +5 -2
- package/package.json +52 -37
- package/dist/chunks/prompt.cjs +0 -443
- package/dist/chunks/prompt.cjs.map +0 -1
- package/dist/chunks/prompt.mjs +0 -436
- package/dist/chunks/prompt.mjs.map +0 -1
- package/dist/cli.cjs +0 -1961
- package/dist/cli.cjs.map +0 -1
- package/dist/cli.d.cts +0 -2
- package/dist/cli.d.mts +0 -2
- package/dist/cli.d.ts +0 -2
- package/dist/cli.mjs +0 -1939
- package/dist/cli.mjs.map +0 -1
- package/dist/index.cjs +0 -26
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -66
- package/dist/index.d.mts +0 -66
- package/dist/index.d.ts +0 -66
- package/dist/index.mjs +0 -21
- package/dist/index.mjs.map +0 -1
- package/dist/parallel-plugin-worker.cjs +0 -34
- package/dist/parallel-plugin-worker.cjs.map +0 -1
- package/dist/parallel-plugin-worker.d.cts +0 -2
- package/dist/parallel-plugin-worker.d.mts +0 -2
- package/dist/parallel-plugin-worker.d.ts +0 -2
- package/dist/parallel-plugin-worker.mjs +0 -32
- package/dist/parallel-plugin-worker.mjs.map +0 -1
- package/dist/parallel-plugin.cjs.map +0 -1
- package/dist/parallel-plugin.d.cts +0 -12
- package/dist/parallel-plugin.d.mts +0 -12
- package/dist/parallel-plugin.d.ts +0 -12
- package/dist/parallel-plugin.mjs +0 -6
- package/dist/parallel-plugin.mjs.map +0 -1
- package/dist/shared/rolldown.1ea1dc1e.d.cts +0 -1160
- package/dist/shared/rolldown.1ea1dc1e.d.mts +0 -1160
- package/dist/shared/rolldown.1ea1dc1e.d.ts +0 -1160
- package/dist/shared/rolldown.4d4592d7.cjs +0 -348
- package/dist/shared/rolldown.4d4592d7.cjs.map +0 -1
- package/dist/shared/rolldown.65028ebe.cjs +0 -547
- package/dist/shared/rolldown.65028ebe.cjs.map +0 -1
- package/dist/shared/rolldown.7d1ce9fc.mjs +0 -546
- package/dist/shared/rolldown.7d1ce9fc.mjs.map +0 -1
- package/dist/shared/rolldown.b914368a.mjs +0 -340
- package/dist/shared/rolldown.b914368a.mjs.map +0 -1
package/dist/index.mjs
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { pathToFileURL } from 'node:url';
|
|
2
|
-
export { e as experimental_scan, r as rolldown } from './shared/rolldown.b914368a.mjs';
|
|
3
|
-
import './shared/rolldown.7d1ce9fc.mjs';
|
|
4
|
-
import 'fs';
|
|
5
|
-
import 'node:path';
|
|
6
|
-
import 'path';
|
|
7
|
-
import 'node:worker_threads';
|
|
8
|
-
import 'node:os';
|
|
9
|
-
|
|
10
|
-
function defineParallelPlugin(pluginPath) {
|
|
11
|
-
return (options) => {
|
|
12
|
-
return { _parallel: { fileUrl: pathToFileURL(pluginPath).href, options } };
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
function defineConfig(config) {
|
|
17
|
-
return config;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export { defineConfig, defineParallelPlugin };
|
|
21
|
-
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../src/plugin/index.ts","../src/utils/define-config.ts"],"sourcesContent":["import {\n BindingHookResolveIdExtraOptions,\n BindingPluginContext,\n RenderedChunk,\n BindingOutputs,\n BindingOutputOptions,\n BindingInputOptions,\n} from '../binding'\nimport { RolldownNormalizedInputOptions } from '../options/input-options'\nimport { AnyFn, AnyObj, NullValue, MaybePromise } from '../types/utils'\nimport { SourceMapInput } from '../types/sourcemap'\nimport { pathToFileURL } from 'node:url'\nimport { NormalizedOutputOptions } from '../options/output-options'\n\n// Use a type alias here, we might wrap `BindingPluginContext` in the future\ntype PluginContext = BindingPluginContext\n\ntype FormalHook<Handler extends AnyFn, HookOptions extends AnyObj = AnyObj> = {\n handler: Handler\n} & HookOptions\n\nexport type Hook<Handler extends AnyFn, HookOptions extends AnyObj = AnyObj> =\n | FormalHook<Handler, HookOptions>\n | Handler\n\nexport interface Plugin {\n name?: string\n\n // --- Build hooks ---\n\n buildStart?: Hook<\n (\n this: PluginContext,\n options: RolldownNormalizedInputOptions,\n ) => MaybePromise<NullValue>\n >\n\n resolveId?: Hook<\n (\n this: null,\n source: string,\n importer: string | undefined,\n extraOptions: BindingHookResolveIdExtraOptions,\n ) => MaybePromise<\n | string\n | NullValue\n | false\n | {\n id: string\n external?: boolean\n }\n >\n >\n\n load?: Hook<\n (\n this: null,\n id: string,\n ) => MaybePromise<\n NullValue | string | { code: string; map?: SourceMapInput }\n >\n >\n\n transform?: Hook<\n (\n this: null,\n code: string,\n id: string,\n ) => MaybePromise<\n | NullValue\n | string\n | {\n code: string\n map?: string | null | SourceMapInput\n }\n >\n >\n\n buildEnd?: Hook<(this: null, err?: Error) => MaybePromise<NullValue>>\n\n // --- Generate hooks ---\n\n renderStart?: Hook<\n (\n outputOptions: BindingOutputOptions,\n inputOptions: RolldownNormalizedInputOptions,\n ) => MaybePromise<NullValue>\n >\n\n renderChunk?: Hook<\n (\n this: null,\n code: string,\n chunk: RenderedChunk,\n outputOptions: NormalizedOutputOptions,\n ) => MaybePromise<\n | NullValue\n | string\n | {\n code: string\n map?: string | null | SourceMapInput\n }\n >\n >\n\n renderError?: Hook<(this: null, error: Error) => MaybePromise<NullValue>>\n\n generateBundle?: Hook<\n (bundle: BindingOutputs, isWrite: boolean) => MaybePromise<NullValue>\n >\n writeBundle?: Hook<(bundle: BindingOutputs) => MaybePromise<NullValue>>\n}\n\nexport type ParallelPlugin = {\n /** @internal */\n _parallel: {\n fileUrl: string\n options: unknown\n }\n}\n\nexport type DefineParallelPluginResult<Options> = (\n options: Options,\n) => ParallelPlugin\n\nexport function defineParallelPlugin<Options>(\n pluginPath: string,\n): DefineParallelPluginResult<Options> {\n return (options) => {\n return { _parallel: { fileUrl: pathToFileURL(pluginPath).href, options } }\n }\n}\n","import { RolldownConfigExport } from '../types/rolldown-config-export'\n\nexport function defineConfig(\n config: RolldownConfigExport,\n): RolldownConfigExport {\n return config\n}\n"],"names":[],"mappings":";;;;;;;;;AA6HO,SAAS,qBACd,UACqC,EAAA;AACrC,EAAA,OAAO,CAAC,OAAY,KAAA;AAClB,IAAO,OAAA,EAAE,WAAW,EAAE,OAAA,EAAS,cAAc,UAAU,CAAA,CAAE,IAAM,EAAA,OAAA,EAAU,EAAA,CAAA;AAAA,GAC3E,CAAA;AACF;;ACjIO,SAAS,aACd,MACsB,EAAA;AACtB,EAAO,OAAA,MAAA,CAAA;AACT;;;;"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const node_worker_threads = require('node:worker_threads');
|
|
4
|
-
const transformSourcemap = require('./shared/rolldown.65028ebe.cjs');
|
|
5
|
-
require('fs');
|
|
6
|
-
require('node:path');
|
|
7
|
-
require('path');
|
|
8
|
-
require('node:os');
|
|
9
|
-
|
|
10
|
-
const { registryId, pluginInfos, threadNumber } = node_worker_threads.workerData;
|
|
11
|
-
(async () => {
|
|
12
|
-
const plugins = await Promise.all(
|
|
13
|
-
pluginInfos.map(async (pluginInfo) => {
|
|
14
|
-
const pluginModule = await import(pluginInfo.fileUrl);
|
|
15
|
-
const definePluginImpl = pluginModule.default;
|
|
16
|
-
const plugin = await definePluginImpl(pluginInfo.options, {
|
|
17
|
-
threadNumber
|
|
18
|
-
});
|
|
19
|
-
return {
|
|
20
|
-
index: pluginInfo.index,
|
|
21
|
-
// TODO(sapphi-red): support inputOptions and outputOptions
|
|
22
|
-
plugin: transformSourcemap.bindingifyPlugin(
|
|
23
|
-
plugin,
|
|
24
|
-
{},
|
|
25
|
-
{}
|
|
26
|
-
)
|
|
27
|
-
};
|
|
28
|
-
})
|
|
29
|
-
);
|
|
30
|
-
transformSourcemap.registerPlugins(registryId, plugins);
|
|
31
|
-
node_worker_threads.parentPort.postMessage("");
|
|
32
|
-
node_worker_threads.parentPort.unref();
|
|
33
|
-
})();
|
|
34
|
-
//# sourceMappingURL=parallel-plugin-worker.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parallel-plugin-worker.cjs","sources":["../src/parallel-plugin-worker.ts"],"sourcesContent":["import { parentPort, workerData } from 'node:worker_threads'\nimport { BindingOutputOptions, registerPlugins } from './binding'\nimport type { WorkerData } from './utils/initialize-parallel-plugins'\nimport type { defineParallelPluginImplementation } from './parallel-plugin'\nimport { bindingifyPlugin } from './plugin/bindingify-plugin'\nimport { RolldownNormalizedInputOptions } from './options/input-options'\n\nconst { registryId, pluginInfos, threadNumber } = workerData as WorkerData\n\n;(async () => {\n // TODO(sapphi-red): handle error\n const plugins = await Promise.all(\n pluginInfos.map(async (pluginInfo) => {\n const pluginModule = await import(pluginInfo.fileUrl)\n const definePluginImpl = pluginModule.default as ReturnType<\n typeof defineParallelPluginImplementation\n >\n const plugin = await definePluginImpl(pluginInfo.options, {\n threadNumber,\n })\n return {\n index: pluginInfo.index,\n // TODO(sapphi-red): support inputOptions and outputOptions\n plugin: bindingifyPlugin(\n plugin,\n {} as RolldownNormalizedInputOptions,\n {} as BindingOutputOptions,\n ),\n }\n }),\n )\n\n registerPlugins(registryId, plugins)\n\n parentPort!.postMessage('')\n parentPort!.unref()\n})()\n"],"names":["workerData","bindingifyPlugin","registerPlugins","parentPort"],"mappings":";;;;;;;;;AAOA,MAAM,EAAE,UAAA,EAAY,WAAa,EAAA,YAAA,EAAiB,GAAAA,8BAAA,CAAA;AAAA,CAEhD,YAAY;AAEZ,EAAM,MAAA,OAAA,GAAU,MAAM,OAAQ,CAAA,GAAA;AAAA,IAC5B,WAAA,CAAY,GAAI,CAAA,OAAO,UAAe,KAAA;AACpC,MAAM,MAAA,YAAA,GAAe,MAAM,OAAO,UAAW,CAAA,OAAA,CAAA,CAAA;AAC7C,MAAA,MAAM,mBAAmB,YAAa,CAAA,OAAA,CAAA;AAGtC,MAAA,MAAM,MAAS,GAAA,MAAM,gBAAiB,CAAA,UAAA,CAAW,OAAS,EAAA;AAAA,QACxD,YAAA;AAAA,OACD,CAAA,CAAA;AACD,MAAO,OAAA;AAAA,QACL,OAAO,UAAW,CAAA,KAAA;AAAA;AAAA,QAElB,MAAQ,EAAAC,mCAAA;AAAA,UACN,MAAA;AAAA,UACA,EAAC;AAAA,UACD,EAAC;AAAA,SACH;AAAA,OACF,CAAA;AAAA,KACD,CAAA;AAAA,GACH,CAAA;AAEA,EAAAC,kCAAA,CAAgB,YAAY,OAAO,CAAA,CAAA;AAEnC,EAAAC,8BAAA,CAAY,YAAY,EAAE,CAAA,CAAA;AAC1B,EAAAA,8BAAA,CAAY,KAAM,EAAA,CAAA;AACpB,CAAG,GAAA;;"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { parentPort, workerData } from 'node:worker_threads';
|
|
2
|
-
import { b as bindingifyPlugin, r as registerPlugins } from './shared/rolldown.7d1ce9fc.mjs';
|
|
3
|
-
import 'fs';
|
|
4
|
-
import 'node:path';
|
|
5
|
-
import 'path';
|
|
6
|
-
import 'node:os';
|
|
7
|
-
|
|
8
|
-
const { registryId, pluginInfos, threadNumber } = workerData;
|
|
9
|
-
(async () => {
|
|
10
|
-
const plugins = await Promise.all(
|
|
11
|
-
pluginInfos.map(async (pluginInfo) => {
|
|
12
|
-
const pluginModule = await import(pluginInfo.fileUrl);
|
|
13
|
-
const definePluginImpl = pluginModule.default;
|
|
14
|
-
const plugin = await definePluginImpl(pluginInfo.options, {
|
|
15
|
-
threadNumber
|
|
16
|
-
});
|
|
17
|
-
return {
|
|
18
|
-
index: pluginInfo.index,
|
|
19
|
-
// TODO(sapphi-red): support inputOptions and outputOptions
|
|
20
|
-
plugin: bindingifyPlugin(
|
|
21
|
-
plugin,
|
|
22
|
-
{},
|
|
23
|
-
{}
|
|
24
|
-
)
|
|
25
|
-
};
|
|
26
|
-
})
|
|
27
|
-
);
|
|
28
|
-
registerPlugins(registryId, plugins);
|
|
29
|
-
parentPort.postMessage("");
|
|
30
|
-
parentPort.unref();
|
|
31
|
-
})();
|
|
32
|
-
//# sourceMappingURL=parallel-plugin-worker.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parallel-plugin-worker.mjs","sources":["../src/parallel-plugin-worker.ts"],"sourcesContent":["import { parentPort, workerData } from 'node:worker_threads'\nimport { BindingOutputOptions, registerPlugins } from './binding'\nimport type { WorkerData } from './utils/initialize-parallel-plugins'\nimport type { defineParallelPluginImplementation } from './parallel-plugin'\nimport { bindingifyPlugin } from './plugin/bindingify-plugin'\nimport { RolldownNormalizedInputOptions } from './options/input-options'\n\nconst { registryId, pluginInfos, threadNumber } = workerData as WorkerData\n\n;(async () => {\n // TODO(sapphi-red): handle error\n const plugins = await Promise.all(\n pluginInfos.map(async (pluginInfo) => {\n const pluginModule = await import(pluginInfo.fileUrl)\n const definePluginImpl = pluginModule.default as ReturnType<\n typeof defineParallelPluginImplementation\n >\n const plugin = await definePluginImpl(pluginInfo.options, {\n threadNumber,\n })\n return {\n index: pluginInfo.index,\n // TODO(sapphi-red): support inputOptions and outputOptions\n plugin: bindingifyPlugin(\n plugin,\n {} as RolldownNormalizedInputOptions,\n {} as BindingOutputOptions,\n ),\n }\n }),\n )\n\n registerPlugins(registryId, plugins)\n\n parentPort!.postMessage('')\n parentPort!.unref()\n})()\n"],"names":[],"mappings":";;;;;;;AAOA,MAAM,EAAE,UAAA,EAAY,WAAa,EAAA,YAAA,EAAiB,GAAA,UAAA,CAAA;AAAA,CAEhD,YAAY;AAEZ,EAAM,MAAA,OAAA,GAAU,MAAM,OAAQ,CAAA,GAAA;AAAA,IAC5B,WAAA,CAAY,GAAI,CAAA,OAAO,UAAe,KAAA;AACpC,MAAM,MAAA,YAAA,GAAe,MAAM,OAAO,UAAW,CAAA,OAAA,CAAA,CAAA;AAC7C,MAAA,MAAM,mBAAmB,YAAa,CAAA,OAAA,CAAA;AAGtC,MAAA,MAAM,MAAS,GAAA,MAAM,gBAAiB,CAAA,UAAA,CAAW,OAAS,EAAA;AAAA,QACxD,YAAA;AAAA,OACD,CAAA,CAAA;AACD,MAAO,OAAA;AAAA,QACL,OAAO,UAAW,CAAA,KAAA;AAAA;AAAA,QAElB,MAAQ,EAAA,gBAAA;AAAA,UACN,MAAA;AAAA,UACA,EAAC;AAAA,UACD,EAAC;AAAA,SACH;AAAA,OACF,CAAA;AAAA,KACD,CAAA;AAAA,GACH,CAAA;AAEA,EAAA,eAAA,CAAgB,YAAY,OAAO,CAAA,CAAA;AAEnC,EAAA,UAAA,CAAY,YAAY,EAAE,CAAA,CAAA;AAC1B,EAAA,UAAA,CAAY,KAAM,EAAA,CAAA;AACpB,CAAG,GAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parallel-plugin.cjs","sources":["../src/plugin/parallel-plugin-implementation.ts"],"sourcesContent":["import type { MaybePromise } from '../types/utils'\nimport type { Plugin } from './index'\n\nexport type ParallelPluginImplementation = Plugin\n\nexport type Context = {\n /**\n * Thread number\n */\n threadNumber: number\n}\n\nexport function defineParallelPluginImplementation<Options>(\n plugin: (\n Options: Options,\n context: Context,\n ) => MaybePromise<ParallelPluginImplementation>,\n) {\n return plugin\n}\n"],"names":[],"mappings":";;AAYO,SAAS,mCACd,MAIA,EAAA;AACA,EAAO,OAAA,MAAA,CAAA;AACT;;;;"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { P as Plugin, M as MaybePromise } from './shared/rolldown.1ea1dc1e.cjs';
|
|
2
|
-
|
|
3
|
-
type ParallelPluginImplementation = Plugin;
|
|
4
|
-
type Context = {
|
|
5
|
-
/**
|
|
6
|
-
* Thread number
|
|
7
|
-
*/
|
|
8
|
-
threadNumber: number;
|
|
9
|
-
};
|
|
10
|
-
declare function defineParallelPluginImplementation<Options>(plugin: (Options: Options, context: Context) => MaybePromise<ParallelPluginImplementation>): (Options: Options, context: Context) => MaybePromise<ParallelPluginImplementation>;
|
|
11
|
-
|
|
12
|
-
export { type Context, type ParallelPluginImplementation, defineParallelPluginImplementation };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { P as Plugin, M as MaybePromise } from './shared/rolldown.1ea1dc1e.mjs';
|
|
2
|
-
|
|
3
|
-
type ParallelPluginImplementation = Plugin;
|
|
4
|
-
type Context = {
|
|
5
|
-
/**
|
|
6
|
-
* Thread number
|
|
7
|
-
*/
|
|
8
|
-
threadNumber: number;
|
|
9
|
-
};
|
|
10
|
-
declare function defineParallelPluginImplementation<Options>(plugin: (Options: Options, context: Context) => MaybePromise<ParallelPluginImplementation>): (Options: Options, context: Context) => MaybePromise<ParallelPluginImplementation>;
|
|
11
|
-
|
|
12
|
-
export { type Context, type ParallelPluginImplementation, defineParallelPluginImplementation };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { P as Plugin, M as MaybePromise } from './shared/rolldown.1ea1dc1e.js';
|
|
2
|
-
|
|
3
|
-
type ParallelPluginImplementation = Plugin;
|
|
4
|
-
type Context = {
|
|
5
|
-
/**
|
|
6
|
-
* Thread number
|
|
7
|
-
*/
|
|
8
|
-
threadNumber: number;
|
|
9
|
-
};
|
|
10
|
-
declare function defineParallelPluginImplementation<Options>(plugin: (Options: Options, context: Context) => MaybePromise<ParallelPluginImplementation>): (Options: Options, context: Context) => MaybePromise<ParallelPluginImplementation>;
|
|
11
|
-
|
|
12
|
-
export { type Context, type ParallelPluginImplementation, defineParallelPluginImplementation };
|
package/dist/parallel-plugin.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parallel-plugin.mjs","sources":["../src/plugin/parallel-plugin-implementation.ts"],"sourcesContent":["import type { MaybePromise } from '../types/utils'\nimport type { Plugin } from './index'\n\nexport type ParallelPluginImplementation = Plugin\n\nexport type Context = {\n /**\n * Thread number\n */\n threadNumber: number\n}\n\nexport function defineParallelPluginImplementation<Options>(\n plugin: (\n Options: Options,\n context: Context,\n ) => MaybePromise<ParallelPluginImplementation>,\n) {\n return plugin\n}\n"],"names":[],"mappings":"AAYO,SAAS,mCACd,MAIA,EAAA;AACA,EAAO,OAAA,MAAA,CAAA;AACT;;;;"}
|