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.
Files changed (93) hide show
  1. package/dist/cjs/cli.cjs +782 -854
  2. package/dist/cjs/experimental-index.cjs +68 -26
  3. package/dist/cjs/index.cjs +6 -8
  4. package/dist/cjs/parallel-plugin-worker.cjs +20 -14
  5. package/dist/cjs/parallel-plugin.cjs +1 -3
  6. package/dist/esm/cli.mjs +722 -796
  7. package/dist/esm/experimental-index.mjs +44 -7
  8. package/dist/esm/index.mjs +2 -4
  9. package/dist/esm/parallel-plugin-worker.mjs +15 -10
  10. package/dist/esm/parallel-plugin.mjs +1 -3
  11. package/dist/shared/{chunk-JoMxl5V2.cjs → chunk-BK2Ye-xa.cjs} +19 -6
  12. package/dist/shared/{consola.36c0034f-Xyw7SC_7.mjs → consola_36c0034f-DWsVjwtA.mjs} +218 -283
  13. package/dist/shared/{consola.36c0034f-HcmWcfPe.cjs → consola_36c0034f-_8_dG1Nr.cjs} +249 -295
  14. package/dist/shared/{prompt-hoPhcrA-.mjs → prompt-DGW8ZJmn.mjs} +125 -174
  15. package/dist/shared/{prompt-9Ij3R3TG.cjs → prompt-RFvZMmjc.cjs} +157 -204
  16. package/dist/shared/src-COU7qQBJ.cjs +2899 -0
  17. package/dist/shared/src-DEPa5yhI.mjs +2771 -0
  18. package/dist/types/api/build.d.ts +14 -0
  19. package/dist/types/api/experimental.d.ts +7 -0
  20. package/dist/types/api/rolldown/index.d.ts +3 -0
  21. package/dist/types/api/rolldown/rolldown-build.d.ts +12 -0
  22. package/dist/types/api/watch/index.d.ts +3 -0
  23. package/dist/types/{watcher.d.ts → api/watch/watcher.d.ts} +5 -3
  24. package/dist/types/binding.d.ts +175 -40
  25. package/dist/types/builtin-plugin/alias-plugin.d.ts +10 -0
  26. package/dist/types/builtin-plugin/constructors.d.ts +20 -0
  27. package/dist/types/builtin-plugin/replace-plugin.d.ts +28 -0
  28. package/dist/types/{options/normalized-ecma-transform-plugin-config.d.ts → builtin-plugin/transform-plugin.d.ts} +2 -1
  29. package/dist/types/builtin-plugin/utils.d.ts +8 -0
  30. package/dist/types/cli/arguments/normalize.d.ts +2 -6
  31. package/dist/types/cli/arguments/schema.d.ts +169 -81
  32. package/dist/types/constants/plugin.d.ts +3 -1
  33. package/dist/types/experimental-index.d.ts +5 -2
  34. package/dist/types/index.d.ts +13 -10
  35. package/dist/types/log/locate-character/index.d.ts +13 -0
  36. package/dist/types/log/logger.d.ts +2 -16
  37. package/dist/types/log/logging.d.ts +6 -3
  38. package/dist/types/log/logs.d.ts +2 -0
  39. package/dist/types/options/input-options-schema.d.ts +596 -0
  40. package/dist/types/options/input-options.d.ts +74 -430
  41. package/dist/types/options/normalized-input-options.d.ts +17 -11
  42. package/dist/types/options/normalized-output-options.d.ts +57 -21
  43. package/dist/types/options/output-options-schema.d.ts +147 -0
  44. package/dist/types/options/output-options.d.ts +72 -265
  45. package/dist/types/options/watch-options.d.ts +5 -0
  46. package/dist/types/plugin/bindingify-build-hooks.d.ts +9 -11
  47. package/dist/types/plugin/bindingify-hook-filter.d.ts +5 -5
  48. package/dist/types/plugin/bindingify-output-hooks.d.ts +13 -16
  49. package/dist/types/plugin/bindingify-plugin.d.ts +12 -3
  50. package/dist/types/plugin/bindingify-watch-hooks.d.ts +3 -5
  51. package/dist/types/plugin/hook-filter.d.ts +1 -1
  52. package/dist/types/plugin/index.d.ts +21 -18
  53. package/dist/types/plugin/minimal-plugin-context.d.ts +15 -0
  54. package/dist/types/plugin/plugin-context-data.d.ts +4 -5
  55. package/dist/types/plugin/plugin-context.d.ts +9 -4
  56. package/dist/types/plugin/plugin-driver.d.ts +4 -5
  57. package/dist/types/plugin/transform-plugin-context.d.ts +4 -3
  58. package/dist/types/rollup-types.d.ts +1 -1
  59. package/dist/types/treeshake/index.d.ts +0 -12
  60. package/dist/types/treeshake/module-side-effects.d.ts +111 -11
  61. package/dist/types/types/rolldown-output.d.ts +11 -2
  62. package/dist/types/types/utils.d.ts +1 -0
  63. package/dist/types/utils/bindingify-input-options.d.ts +7 -0
  64. package/dist/types/utils/bindingify-output-options.d.ts +3 -0
  65. package/dist/types/utils/define-config.d.ts +3 -0
  66. package/dist/types/utils/error.d.ts +1 -0
  67. package/dist/types/utils/normalize-hook.d.ts +1 -1
  68. package/dist/types/utils/normalize-plugin-option.d.ts +8 -3
  69. package/dist/types/{options/utils.d.ts → utils/normalize-string-or-regex.d.ts} +1 -1
  70. package/dist/types/utils/transform-rendered-chunk.d.ts +4 -0
  71. package/dist/types/utils/transform-rendered-module.d.ts +3 -0
  72. package/dist/types/utils/transform-sourcemap.d.ts +2 -0
  73. package/dist/types/utils/transform-to-rollup-output.d.ts +1 -0
  74. package/package.json +30 -22
  75. package/dist/shared/rolldown-binding.wasi.cjs +0 -187
  76. package/dist/shared/src_index-3pqhEViJ.cjs +0 -2785
  77. package/dist/shared/src_index-ywYMd4vB.mjs +0 -2786
  78. package/dist/shared/wasi-worker-browser.mjs +0 -39
  79. package/dist/shared/wasi-worker.mjs +0 -63
  80. package/dist/shared/watcher-worker.js +0 -1
  81. package/dist/types/constants/types.d.ts +0 -1
  82. package/dist/types/options/bindingify-input-options.d.ts +0 -4
  83. package/dist/types/options/bindingify-output-options.d.ts +0 -3
  84. package/dist/types/options/normalized-alias-plugin-config.d.ts +0 -8
  85. package/dist/types/options/watch-option.d.ts +0 -5
  86. package/dist/types/plugin/builtin-plugin.d.ts +0 -81
  87. package/dist/types/rolldown-build.d.ts +0 -10
  88. package/dist/types/rolldown.d.ts +0 -12
  89. package/dist/types/types/rendered-module.d.ts +0 -2
  90. package/dist/types/utils/normalize-input-options.d.ts +0 -3
  91. package/dist/types/utils/normalize-output-options.d.ts +0 -3
  92. package/dist/types/utils/normalize-tree-shake.d.ts +0 -3
  93. /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 { __toESM } = require("../shared/chunk-JoMxl5V2.cjs");
4
- const { aliasPlugin, buildImportAnalysisPlugin, composeJsPlugins, dynamicImportVarsPlugin, experimental_scan, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, replacePlugin, require_binding, transformPlugin, wasmFallbackPlugin, wasmHelperPlugin } = require("../shared/src_index-3pqhEViJ.cjs");
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)).href,
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
- Object.defineProperty(exports, '__esModule', { value: true });
23
- var transform = import_binding.transform;
24
- exports.aliasPlugin = aliasPlugin;
25
- exports.buildImportAnalysisPlugin = buildImportAnalysisPlugin;
26
- exports.composePlugins = composeJsPlugins;
27
- exports.defineParallelPlugin = defineParallelPlugin;
28
- exports.dynamicImportVarsPlugin = dynamicImportVarsPlugin;
29
- exports.importGlobPlugin = importGlobPlugin;
30
- exports.jsonPlugin = jsonPlugin;
31
- exports.loadFallbackPlugin = loadFallbackPlugin;
32
- exports.manifestPlugin = manifestPlugin;
33
- exports.modulePreloadPolyfillPlugin = modulePreloadPolyfillPlugin;
34
- exports.replacePlugin = replacePlugin;
35
- exports.scan = experimental_scan;
36
- exports.transform = transform;
37
- exports.transformPlugin = transformPlugin;
38
- exports.wasmFallbackPlugin = wasmFallbackPlugin;
39
- exports.wasmHelperPlugin = wasmHelperPlugin;
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
@@ -1,9 +1,7 @@
1
- "use strict";
1
+ const require_src = require('../shared/src-COU7qQBJ.cjs');
2
2
 
3
- const { VERSION, defineConfig, rolldown, watch } = require("../shared/src_index-3pqhEViJ.cjs");
4
-
5
- Object.defineProperty(exports, '__esModule', { value: true });
6
- exports.VERSION = VERSION;
7
- exports.defineConfig = defineConfig;
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 { __toESM } = require("../shared/chunk-JoMxl5V2.cjs");
4
- const { PluginContextData, bindingifyPlugin, require_binding } = require("../shared/src_index-3pqhEViJ.cjs");
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: registryId, pluginInfos: pluginInfos, threadNumber: threadNumber } = workerData;
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(plugin, {}, {}, new PluginContextData())
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
- finally {
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
- Object.defineProperty(exports, '__esModule', { value: true });
11
- exports.defineParallelPluginImplementation = defineParallelPluginImplementation;
9
+ exports.defineParallelPluginImplementation = defineParallelPluginImplementation