rolldown 0.14.0 → 0.15.0
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/dist/cjs/cli.cjs +782 -854
- package/dist/cjs/experimental-index.cjs +68 -26
- package/dist/cjs/index.cjs +6 -8
- package/dist/cjs/parallel-plugin-worker.cjs +20 -14
- package/dist/cjs/parallel-plugin.cjs +1 -3
- package/dist/esm/cli.mjs +722 -796
- package/dist/esm/experimental-index.mjs +44 -7
- package/dist/esm/index.mjs +2 -4
- package/dist/esm/parallel-plugin-worker.mjs +15 -10
- package/dist/esm/parallel-plugin.mjs +1 -3
- package/dist/shared/{chunk-JoMxl5V2.cjs → chunk-BK2Ye-xa.cjs} +19 -6
- package/dist/shared/{consola.36c0034f-Xyw7SC_7.mjs → consola_36c0034f-DWsVjwtA.mjs} +218 -283
- package/dist/shared/{consola.36c0034f-HcmWcfPe.cjs → consola_36c0034f-_8_dG1Nr.cjs} +249 -295
- package/dist/shared/{prompt-hoPhcrA-.mjs → prompt-DGW8ZJmn.mjs} +125 -174
- package/dist/shared/{prompt-9Ij3R3TG.cjs → prompt-RFvZMmjc.cjs} +157 -204
- package/dist/shared/src-COU7qQBJ.cjs +2899 -0
- package/dist/shared/src-DEPa5yhI.mjs +2771 -0
- package/dist/types/api/build.d.ts +14 -0
- package/dist/types/api/experimental.d.ts +7 -0
- package/dist/types/api/rolldown/index.d.ts +3 -0
- package/dist/types/api/rolldown/rolldown-build.d.ts +12 -0
- package/dist/types/api/watch/index.d.ts +3 -0
- package/dist/types/{watcher.d.ts → api/watch/watcher.d.ts} +5 -3
- package/dist/types/binding.d.ts +175 -40
- package/dist/types/builtin-plugin/alias-plugin.d.ts +10 -0
- package/dist/types/builtin-plugin/constructors.d.ts +20 -0
- package/dist/types/builtin-plugin/replace-plugin.d.ts +28 -0
- package/dist/types/{options/normalized-ecma-transform-plugin-config.d.ts → builtin-plugin/transform-plugin.d.ts} +2 -1
- package/dist/types/builtin-plugin/utils.d.ts +8 -0
- package/dist/types/cli/arguments/normalize.d.ts +2 -6
- package/dist/types/cli/arguments/schema.d.ts +169 -81
- package/dist/types/constants/plugin.d.ts +3 -1
- package/dist/types/experimental-index.d.ts +5 -2
- package/dist/types/index.d.ts +13 -10
- package/dist/types/log/locate-character/index.d.ts +13 -0
- package/dist/types/log/logger.d.ts +2 -16
- package/dist/types/log/logging.d.ts +6 -3
- package/dist/types/log/logs.d.ts +2 -0
- package/dist/types/options/input-options-schema.d.ts +596 -0
- package/dist/types/options/input-options.d.ts +74 -430
- package/dist/types/options/normalized-input-options.d.ts +17 -11
- package/dist/types/options/normalized-output-options.d.ts +57 -21
- package/dist/types/options/output-options-schema.d.ts +147 -0
- package/dist/types/options/output-options.d.ts +72 -265
- package/dist/types/options/watch-options.d.ts +5 -0
- package/dist/types/plugin/bindingify-build-hooks.d.ts +9 -11
- package/dist/types/plugin/bindingify-hook-filter.d.ts +5 -5
- package/dist/types/plugin/bindingify-output-hooks.d.ts +13 -16
- package/dist/types/plugin/bindingify-plugin.d.ts +12 -3
- package/dist/types/plugin/bindingify-watch-hooks.d.ts +3 -5
- package/dist/types/plugin/hook-filter.d.ts +1 -1
- package/dist/types/plugin/index.d.ts +21 -18
- package/dist/types/plugin/minimal-plugin-context.d.ts +15 -0
- package/dist/types/plugin/plugin-context-data.d.ts +4 -5
- package/dist/types/plugin/plugin-context.d.ts +9 -4
- package/dist/types/plugin/plugin-driver.d.ts +4 -5
- package/dist/types/plugin/transform-plugin-context.d.ts +4 -3
- package/dist/types/rollup-types.d.ts +1 -1
- package/dist/types/treeshake/index.d.ts +0 -12
- package/dist/types/treeshake/module-side-effects.d.ts +111 -11
- package/dist/types/types/rolldown-output.d.ts +11 -2
- package/dist/types/types/utils.d.ts +1 -0
- package/dist/types/utils/bindingify-input-options.d.ts +7 -0
- package/dist/types/utils/bindingify-output-options.d.ts +3 -0
- package/dist/types/utils/define-config.d.ts +3 -0
- package/dist/types/utils/error.d.ts +1 -0
- package/dist/types/utils/normalize-hook.d.ts +1 -1
- package/dist/types/utils/normalize-plugin-option.d.ts +8 -3
- package/dist/types/{options/utils.d.ts → utils/normalize-string-or-regex.d.ts} +1 -1
- package/dist/types/utils/transform-rendered-chunk.d.ts +4 -0
- package/dist/types/utils/transform-rendered-module.d.ts +3 -0
- package/dist/types/utils/transform-sourcemap.d.ts +2 -0
- package/dist/types/utils/transform-to-rollup-output.d.ts +1 -0
- package/package.json +30 -22
- package/dist/shared/rolldown-binding.wasi.cjs +0 -187
- package/dist/shared/src_index-3pqhEViJ.cjs +0 -2785
- package/dist/shared/src_index-ywYMd4vB.mjs +0 -2786
- package/dist/shared/wasi-worker-browser.mjs +0 -39
- package/dist/shared/wasi-worker.mjs +0 -63
- package/dist/shared/watcher-worker.js +0 -1
- package/dist/types/constants/types.d.ts +0 -1
- package/dist/types/options/bindingify-input-options.d.ts +0 -4
- package/dist/types/options/bindingify-output-options.d.ts +0 -3
- package/dist/types/options/normalized-alias-plugin-config.d.ts +0 -8
- package/dist/types/options/watch-option.d.ts +0 -5
- package/dist/types/plugin/builtin-plugin.d.ts +0 -81
- package/dist/types/rolldown-build.d.ts +0 -10
- package/dist/types/rolldown.d.ts +0 -12
- package/dist/types/types/rendered-module.d.ts +0 -2
- package/dist/types/utils/normalize-input-options.d.ts +0 -3
- package/dist/types/utils/normalize-output-options.d.ts +0 -3
- package/dist/types/utils/normalize-tree-shake.d.ts +0 -3
- /package/dist/types/{utils/type-assert.d.ts → types/assert.d.ts} +0 -0
|
@@ -1,39 +1,81 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const { pathToFileURL } = __toESM(require("node:url"));
|
|
2
|
+
const require_chunk = require('../shared/chunk-BK2Ye-xa.cjs');
|
|
3
|
+
const require_src = require('../shared/src-COU7qQBJ.cjs');
|
|
4
|
+
const node_url = require_chunk.__toESM(require("node:url"));
|
|
6
5
|
|
|
7
6
|
//#region src/plugin/parallel-plugin.ts
|
|
8
7
|
function defineParallelPlugin(pluginPath) {
|
|
9
8
|
return (options) => {
|
|
10
|
-
return {_parallel: {
|
|
11
|
-
fileUrl: (pathToFileURL(pluginPath)
|
|
9
|
+
return { _parallel: {
|
|
10
|
+
fileUrl: (0, node_url.pathToFileURL)(pluginPath).href,
|
|
12
11
|
options
|
|
13
|
-
}};
|
|
12
|
+
} };
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/api/experimental.ts
|
|
18
|
+
const experimental_scan = async (input) => {
|
|
19
|
+
const { bundler, stopWorkers } = await require_src.createBundler(input, {});
|
|
20
|
+
const output = await bundler.scan();
|
|
21
|
+
require_src.handleOutputErrors(output);
|
|
22
|
+
await stopWorkers?.();
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region src/builtin-plugin/transform-plugin.ts
|
|
27
|
+
function normalizeEcmaTransformPluginConfig(config) {
|
|
28
|
+
if (!config) return undefined;
|
|
29
|
+
let normalizedConfig = {
|
|
30
|
+
...config,
|
|
31
|
+
exclude: require_src.normalizedStringOrRegex(config.exclude),
|
|
32
|
+
include: require_src.normalizedStringOrRegex(config.include)
|
|
14
33
|
};
|
|
34
|
+
return normalizedConfig;
|
|
35
|
+
}
|
|
36
|
+
function transformPlugin(config) {
|
|
37
|
+
return new require_src.BuiltinPlugin("builtin:transform", normalizeEcmaTransformPluginConfig(config));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
//#endregion
|
|
41
|
+
//#region src/builtin-plugin/replace-plugin.ts
|
|
42
|
+
function replacePlugin(values = {}, options = {}) {
|
|
43
|
+
return new require_src.BuiltinPlugin("builtin:replace", {
|
|
44
|
+
...options,
|
|
45
|
+
values
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region src/builtin-plugin/alias-plugin.ts
|
|
51
|
+
function aliasPlugin(config) {
|
|
52
|
+
return new require_src.BuiltinPlugin("builtin:alias", config);
|
|
15
53
|
}
|
|
16
54
|
|
|
17
55
|
//#endregion
|
|
18
56
|
//#region src/experimental-index.ts
|
|
19
|
-
var import_binding = __toESM(require_binding());
|
|
57
|
+
var import_binding = require_chunk.__toESM(require_binding());
|
|
20
58
|
|
|
21
59
|
//#endregion
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
exports.
|
|
25
|
-
exports.
|
|
26
|
-
exports.
|
|
27
|
-
exports.
|
|
28
|
-
exports.
|
|
29
|
-
exports.
|
|
30
|
-
exports.
|
|
31
|
-
exports.
|
|
32
|
-
exports.
|
|
33
|
-
exports.
|
|
34
|
-
exports
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
60
|
+
exports.aliasPlugin = aliasPlugin
|
|
61
|
+
exports.buildImportAnalysisPlugin = require_src.buildImportAnalysisPlugin
|
|
62
|
+
exports.composePlugins = require_src.composeJsPlugins
|
|
63
|
+
exports.defineParallelPlugin = defineParallelPlugin
|
|
64
|
+
exports.dynamicImportVarsPlugin = require_src.dynamicImportVarsPlugin
|
|
65
|
+
exports.importGlobPlugin = require_src.importGlobPlugin
|
|
66
|
+
exports.jsonPlugin = require_src.jsonPlugin
|
|
67
|
+
exports.loadFallbackPlugin = require_src.loadFallbackPlugin
|
|
68
|
+
exports.manifestPlugin = require_src.manifestPlugin
|
|
69
|
+
exports.modulePreloadPolyfillPlugin = require_src.modulePreloadPolyfillPlugin
|
|
70
|
+
exports.replacePlugin = replacePlugin
|
|
71
|
+
exports.scan = experimental_scan
|
|
72
|
+
Object.defineProperty(exports, 'transform', {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
get: function () {
|
|
75
|
+
return import_binding.transform;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
exports.transformPlugin = transformPlugin
|
|
79
|
+
exports.viteResolvePlugin = require_src.viteResolvePlugin
|
|
80
|
+
exports.wasmFallbackPlugin = require_src.wasmFallbackPlugin
|
|
81
|
+
exports.wasmHelperPlugin = require_src.wasmHelperPlugin
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
const require_src = require('../shared/src-COU7qQBJ.cjs');
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
exports.
|
|
7
|
-
exports.
|
|
8
|
-
exports.rolldown = rolldown;
|
|
9
|
-
exports.watch = watch;
|
|
3
|
+
exports.VERSION = require_src.VERSION
|
|
4
|
+
exports.build = require_src.build
|
|
5
|
+
exports.defineConfig = require_src.defineConfig
|
|
6
|
+
exports.rolldown = require_src.rolldown
|
|
7
|
+
exports.watch = require_src.watch
|
|
@@ -1,34 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const { parentPort, workerData } = __toESM(require("node:worker_threads"));
|
|
2
|
+
const require_chunk = require('../shared/chunk-BK2Ye-xa.cjs');
|
|
3
|
+
const require_src = require('../shared/src-COU7qQBJ.cjs');
|
|
4
|
+
const node_worker_threads = require_chunk.__toESM(require("node:worker_threads"));
|
|
6
5
|
|
|
7
6
|
//#region src/parallel-plugin-worker.ts
|
|
8
|
-
var import_binding = __toESM(require_binding());
|
|
9
|
-
const { registryId
|
|
7
|
+
var import_binding = require_chunk.__toESM(require_binding());
|
|
8
|
+
const { registryId, pluginInfos, threadNumber } = node_worker_threads.workerData;
|
|
10
9
|
(async () => {
|
|
11
10
|
try {
|
|
12
11
|
const plugins = await Promise.all(pluginInfos.map(async (pluginInfo) => {
|
|
13
12
|
const pluginModule = await import(pluginInfo.fileUrl);
|
|
14
13
|
const definePluginImpl = pluginModule.default;
|
|
15
|
-
const plugin = await definePluginImpl(pluginInfo.options, {threadNumber});
|
|
14
|
+
const plugin = await definePluginImpl(pluginInfo.options, { threadNumber });
|
|
16
15
|
return {
|
|
17
16
|
index: pluginInfo.index,
|
|
18
|
-
plugin: bindingifyPlugin(
|
|
17
|
+
plugin: require_src.bindingifyPlugin(
|
|
18
|
+
plugin,
|
|
19
|
+
{},
|
|
20
|
+
{},
|
|
21
|
+
// TODO need to find a way to share pluginContextData
|
|
22
|
+
new require_src.PluginContextData(),
|
|
23
|
+
() => {},
|
|
24
|
+
"info"
|
|
25
|
+
)
|
|
19
26
|
};
|
|
20
27
|
}));
|
|
21
28
|
(0, import_binding.registerPlugins)(registryId, plugins);
|
|
22
|
-
parentPort.postMessage({type: "success"});
|
|
29
|
+
node_worker_threads.parentPort.postMessage({ type: "success" });
|
|
23
30
|
} catch (error) {
|
|
24
|
-
parentPort.postMessage({
|
|
31
|
+
node_worker_threads.parentPort.postMessage({
|
|
25
32
|
type: "error",
|
|
26
33
|
error
|
|
27
34
|
});
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
parentPort.unref();
|
|
35
|
+
} finally {
|
|
36
|
+
node_worker_threads.parentPort.unref();
|
|
31
37
|
}
|
|
32
38
|
})();
|
|
33
39
|
|
|
34
|
-
//#endregion
|
|
40
|
+
//#endregion
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
3
|
//#region src/plugin/parallel-plugin-implementation.ts
|
|
5
4
|
function defineParallelPluginImplementation(plugin) {
|
|
6
5
|
return plugin;
|
|
7
6
|
}
|
|
8
7
|
|
|
9
8
|
//#endregion
|
|
10
|
-
|
|
11
|
-
exports.defineParallelPluginImplementation = defineParallelPluginImplementation;
|
|
9
|
+
exports.defineParallelPluginImplementation = defineParallelPluginImplementation
|