rolldown 1.0.0-beta.1-commit.2fe52d4 → 1.0.0-beta.1-commit.298dd8b

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.
@@ -1,13 +1,11 @@
1
1
  "use strict";
2
2
  const require_chunk = require('./chunk-qZFfknuJ.cjs');
3
- const require_binding$1 = require('./binding-Cw1COxB5.cjs');
3
+ const require_binding$1 = require('./binding-D5MBYAdC.cjs');
4
4
  const node_path = require_chunk.__toESM(require("node:path"));
5
5
  const node_buffer = require_chunk.__toESM(require("node:buffer"));
6
6
  const node_worker_threads = require_chunk.__toESM(require("node:worker_threads"));
7
7
  const node_os = require_chunk.__toESM(require("node:os"));
8
8
  const valibot = require_chunk.__toESM(require("valibot"));
9
- const node_process = require_chunk.__toESM(require("node:process"));
10
- const tty = require_chunk.__toESM(require("tty"));
11
9
  const __valibot_to_json_schema = require_chunk.__toESM(require("@valibot/to-json-schema"));
12
10
 
13
11
  //#region src/utils/define-config.ts
@@ -222,6 +220,15 @@ function viteResolvePlugin(config) {
222
220
  });
223
221
  return makeBuiltinPluginCallable(builtinPlugin);
224
222
  }
223
+ function moduleFederationPlugin(config) {
224
+ return new BuiltinPlugin("builtin:module-federation", {
225
+ ...config,
226
+ remotes: config.remotes && Object.values(config.remotes).map((entry) => {
227
+ if (typeof entry === "string") return { entry };
228
+ return entry;
229
+ })
230
+ });
231
+ }
225
232
 
226
233
  //#endregion
227
234
  //#region src/utils/async-flatten.ts
@@ -780,16 +787,14 @@ var PluginContext = class extends MinimalPluginContext {
780
787
  };
781
788
  }
782
789
  emitFile(file) {
783
- if (file.type !== "asset") return unimplemented("PluginContext.emitFile: only asset type is supported");
790
+ if (file.type === "prebuilt-chunk") return unimplemented("PluginContext.emitFile with type prebuilt-chunk");
791
+ if (file.type === "chunk") return this.context.emitChunk(file);
784
792
  return this.context.emitFile({
785
793
  ...file,
786
794
  originalFileName: file.originalFileName || undefined,
787
795
  source: bindingAssetSource(file.source)
788
796
  });
789
797
  }
790
- async emitChunk(chunk) {
791
- return this.context.emitChunk(chunk);
792
- }
793
798
  getFileName(referenceId) {
794
799
  return this.context.getFileName(referenceId);
795
800
  }
@@ -2136,83 +2141,6 @@ async function initializeWorker(registryId, pluginInfos, threadNumber) {
2136
2141
  }
2137
2142
  }
2138
2143
 
2139
- //#endregion
2140
- //#region ../../node_modules/.pnpm/colorette@2.0.20/node_modules/colorette/index.js
2141
- const { env: env$1 = {}, argv = [], platform = "" } = typeof process === "undefined" ? {} : process;
2142
- const isDisabled = "NO_COLOR" in env$1 || argv.includes("--no-color");
2143
- const isForced = "FORCE_COLOR" in env$1 || argv.includes("--color");
2144
- const isWindows = platform === "win32";
2145
- const isDumbTerminal = env$1.TERM === "dumb";
2146
- const isCompatibleTerminal = tty && tty.isatty && tty.isatty(1) && env$1.TERM && !isDumbTerminal;
2147
- const isCI = "CI" in env$1 && ("GITHUB_ACTIONS" in env$1 || "GITLAB_CI" in env$1 || "CIRCLECI" in env$1);
2148
- const isColorSupported = !isDisabled && (isForced || isWindows && !isDumbTerminal || isCompatibleTerminal || isCI);
2149
- const replaceClose = (index, string, close, replace, head = string.substring(0, index) + replace, tail = string.substring(index + close.length), next = tail.indexOf(close)) => head + (next < 0 ? tail : replaceClose(next, tail, close, replace));
2150
- const clearBleed = (index, string, open, close, replace) => index < 0 ? open + string + close : open + replaceClose(index, string, close, replace) + close;
2151
- const filterEmpty = (open, close, replace = open, at = open.length + 1) => (string) => string || !(string === "" || string === undefined) ? clearBleed(("" + string).indexOf(close, at), string, open, close, replace) : "";
2152
- const init = (open, close, replace) => filterEmpty(`\x1b[${open}m`, `\x1b[${close}m`, replace);
2153
- const colors$1 = {
2154
- reset: init(0, 0),
2155
- bold: init(1, 22, "\x1B[22m\x1B[1m"),
2156
- dim: init(2, 22, "\x1B[22m\x1B[2m"),
2157
- italic: init(3, 23),
2158
- underline: init(4, 24),
2159
- inverse: init(7, 27),
2160
- hidden: init(8, 28),
2161
- strikethrough: init(9, 29),
2162
- black: init(30, 39),
2163
- red: init(31, 39),
2164
- green: init(32, 39),
2165
- yellow: init(33, 39),
2166
- blue: init(34, 39),
2167
- magenta: init(35, 39),
2168
- cyan: init(36, 39),
2169
- white: init(37, 39),
2170
- gray: init(90, 39),
2171
- bgBlack: init(40, 49),
2172
- bgRed: init(41, 49),
2173
- bgGreen: init(42, 49),
2174
- bgYellow: init(43, 49),
2175
- bgBlue: init(44, 49),
2176
- bgMagenta: init(45, 49),
2177
- bgCyan: init(46, 49),
2178
- bgWhite: init(47, 49),
2179
- blackBright: init(90, 39),
2180
- redBright: init(91, 39),
2181
- greenBright: init(92, 39),
2182
- yellowBright: init(93, 39),
2183
- blueBright: init(94, 39),
2184
- magentaBright: init(95, 39),
2185
- cyanBright: init(96, 39),
2186
- whiteBright: init(97, 39),
2187
- bgBlackBright: init(100, 49),
2188
- bgRedBright: init(101, 49),
2189
- bgGreenBright: init(102, 49),
2190
- bgYellowBright: init(103, 49),
2191
- bgBlueBright: init(104, 49),
2192
- bgMagentaBright: init(105, 49),
2193
- bgCyanBright: init(106, 49),
2194
- bgWhiteBright: init(107, 49)
2195
- };
2196
- const createColors = ({ useColor = isColorSupported } = {}) => useColor ? colors$1 : Object.keys(colors$1).reduce((colors$2, key) => ({
2197
- ...colors$2,
2198
- [key]: String
2199
- }), {});
2200
- const { reset, bold: bold$1, dim: dim$1, italic, underline: underline$1, inverse, hidden, strikethrough, black, red: red$1, green: green$1, yellow: yellow$1, blue, magenta, cyan: cyan$1, white, gray: gray$1, bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite, blackBright, redBright, greenBright, yellowBright, blueBright, magentaBright, cyanBright, whiteBright, bgBlackBright, bgRedBright, bgGreenBright, bgYellowBright, bgBlueBright, bgMagentaBright, bgCyanBright, bgWhiteBright } = createColors();
2201
-
2202
- //#endregion
2203
- //#region src/cli/colors.ts
2204
- const { bold, cyan, dim, gray, green, red, underline, yellow } = createColors({ useColor: node_process.env.FORCE_COLOR !== "0" && !node_process.env.NO_COLOR });
2205
- const colors = {
2206
- bold,
2207
- cyan,
2208
- dim,
2209
- gray,
2210
- green,
2211
- red,
2212
- underline,
2213
- yellow
2214
- };
2215
-
2216
2144
  //#endregion
2217
2145
  //#region src/utils/validator.ts
2218
2146
  const StringOrRegExpSchema = valibot.union([valibot.string(), valibot.instance(RegExp)]);
@@ -2302,10 +2230,10 @@ const InputOptionsSchema = valibot.strictObject({
2302
2230
  valibot.literal("browser"),
2303
2231
  valibot.literal("neutral"),
2304
2232
  valibot.literal("node")
2305
- ])), valibot.description(`Platform for which the code should be generated (node, ${colors.underline("browser")}, neutral)`)),
2233
+ ])), valibot.description(`Platform for which the code should be generated (node, ${require_binding$1.colors.underline("browser")}, neutral)`)),
2306
2234
  shimMissingExports: valibot.pipe(valibot.optional(valibot.boolean()), valibot.description("Create shim variables for missing exports")),
2307
2235
  treeshake: valibot.optional(TreeshakingOptionsSchema),
2308
- logLevel: valibot.pipe(valibot.optional(LogLevelOptionSchema), valibot.description(`Log level (${colors.dim("silent")}, ${colors.underline(colors.gray("info"))}, debug, ${colors.yellow("warn")})`)),
2236
+ logLevel: valibot.pipe(valibot.optional(LogLevelOptionSchema), valibot.description(`Log level (${require_binding$1.colors.dim("silent")}, ${require_binding$1.colors.underline(require_binding$1.colors.gray("info"))}, debug, ${require_binding$1.colors.yellow("warn")})`)),
2309
2237
  onLog: valibot.optional(OnLogSchema),
2310
2238
  onwarn: valibot.optional(OnwarnSchema),
2311
2239
  moduleTypes: valibot.pipe(valibot.optional(ModuleTypesSchema), valibot.description("Module types for customized extensions")),
@@ -2387,18 +2315,18 @@ const OutputOptionsSchema = valibot.strictObject({
2387
2315
  valibot.literal("named"),
2388
2316
  valibot.literal("default"),
2389
2317
  valibot.literal("none")
2390
- ])), valibot.description(`Specify a export mode (${colors.underline("auto")}, named, default, none)`)),
2318
+ ])), valibot.description(`Specify a export mode (${require_binding$1.colors.underline("auto")}, named, default, none)`)),
2391
2319
  hashCharacters: valibot.pipe(valibot.optional(valibot.union([
2392
2320
  valibot.literal("base64"),
2393
2321
  valibot.literal("base36"),
2394
2322
  valibot.literal("hex")
2395
2323
  ])), valibot.description("Use the specified character set for file hashes")),
2396
- format: valibot.pipe(valibot.optional(ModuleFormatSchema), valibot.description(`Output format of the generated bundle (supports ${colors.underline("esm")}, cjs, and iife)`)),
2324
+ format: valibot.pipe(valibot.optional(ModuleFormatSchema), valibot.description(`Output format of the generated bundle (supports ${require_binding$1.colors.underline("esm")}, cjs, and iife)`)),
2397
2325
  sourcemap: valibot.pipe(valibot.optional(valibot.union([
2398
2326
  valibot.boolean(),
2399
2327
  valibot.literal("inline"),
2400
2328
  valibot.literal("hidden")
2401
- ])), valibot.description(`Generate sourcemap (\`-s inline\` for inline, or ${colors.bold("pass the `-s` on the last argument if you want to generate `.map` file")})`)),
2329
+ ])), valibot.description(`Generate sourcemap (\`-s inline\` for inline, or ${require_binding$1.colors.bold("pass the `-s` on the last argument if you want to generate `.map` file")})`)),
2402
2330
  sourcemapIgnoreList: valibot.optional(valibot.union([valibot.boolean(), valibot.custom(() => true)])),
2403
2331
  sourcemapPathTransform: valibot.optional(valibot.custom(() => true)),
2404
2332
  banner: valibot.optional(valibot.union([valibot.string(), AddonFunctionSchema])),
@@ -2422,7 +2350,7 @@ const OutputOptionsSchema = valibot.strictObject({
2422
2350
  target: valibot.pipe(valibot.optional(valibot.enum(ESTarget)), valibot.description("The JavaScript target environment"))
2423
2351
  });
2424
2352
  const getAddonDescription = (placement, wrapper) => {
2425
- return `Code to insert the ${colors.bold(placement)} of the bundled file (${colors.bold(wrapper)} the wrapper function)`;
2353
+ return `Code to insert the ${require_binding$1.colors.bold(placement)} of the bundled file (${require_binding$1.colors.bold(wrapper)} the wrapper function)`;
2426
2354
  };
2427
2355
  const OutputCliOverrideSchema = valibot.strictObject({
2428
2356
  entryFileNames: valibot.pipe(valibot.optional(valibot.string()), valibot.description("Name pattern for emitted entry chunks")),
@@ -2685,7 +2613,7 @@ const watch = (input) => {
2685
2613
 
2686
2614
  //#endregion
2687
2615
  //#region package.json
2688
- var version = "1.0.0-beta.1-commit.2fe52d4";
2616
+ var version = "1.0.0-beta.1-commit.298dd8b";
2689
2617
  var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
2690
2618
 
2691
2619
  //#endregion
@@ -2751,12 +2679,6 @@ Object.defineProperty(exports, 'buildImportAnalysisPlugin', {
2751
2679
  return buildImportAnalysisPlugin;
2752
2680
  }
2753
2681
  });
2754
- Object.defineProperty(exports, 'colors', {
2755
- enumerable: true,
2756
- get: function () {
2757
- return colors;
2758
- }
2759
- });
2760
2682
  Object.defineProperty(exports, 'composeJsPlugins', {
2761
2683
  enumerable: true,
2762
2684
  get: function () {
@@ -2835,6 +2757,12 @@ Object.defineProperty(exports, 'manifestPlugin', {
2835
2757
  return manifestPlugin;
2836
2758
  }
2837
2759
  });
2760
+ Object.defineProperty(exports, 'moduleFederationPlugin', {
2761
+ enumerable: true,
2762
+ get: function () {
2763
+ return moduleFederationPlugin;
2764
+ }
2765
+ });
2838
2766
  Object.defineProperty(exports, 'modulePreloadPolyfillPlugin', {
2839
2767
  enumerable: true,
2840
2768
  get: function () {
@@ -1,11 +1,9 @@
1
- import { __toESM, augmentCodeLocation, error, logCycleLoading, logInputHookInOutputPlugin, logInvalidLogPosition, logMinifyWarning, logMultiplyNotifyOption, logPluginError, require_binding } from "./binding-BMSG-hw7.mjs";
1
+ import { __toESM, augmentCodeLocation, colors, error, logCycleLoading, logInputHookInOutputPlugin, logInvalidLogPosition, logMinifyWarning, logMultiplyNotifyOption, logPluginError, require_binding } from "./binding-DLjQWzkm.mjs";
2
2
  import path from "node:path";
3
3
  import { Buffer } from "node:buffer";
4
4
  import { Worker } from "node:worker_threads";
5
5
  import { availableParallelism } from "node:os";
6
6
  import * as v from "valibot";
7
- import { env } from "node:process";
8
- import * as tty from "tty";
9
7
  import { toJsonSchema } from "@valibot/to-json-schema";
10
8
 
11
9
  //#region src/utils/define-config.ts
@@ -220,6 +218,15 @@ function viteResolvePlugin(config) {
220
218
  });
221
219
  return makeBuiltinPluginCallable(builtinPlugin);
222
220
  }
221
+ function moduleFederationPlugin(config) {
222
+ return new BuiltinPlugin("builtin:module-federation", {
223
+ ...config,
224
+ remotes: config.remotes && Object.values(config.remotes).map((entry) => {
225
+ if (typeof entry === "string") return { entry };
226
+ return entry;
227
+ })
228
+ });
229
+ }
223
230
 
224
231
  //#endregion
225
232
  //#region src/utils/async-flatten.ts
@@ -778,16 +785,14 @@ var PluginContext = class extends MinimalPluginContext {
778
785
  };
779
786
  }
780
787
  emitFile(file) {
781
- if (file.type !== "asset") return unimplemented("PluginContext.emitFile: only asset type is supported");
788
+ if (file.type === "prebuilt-chunk") return unimplemented("PluginContext.emitFile with type prebuilt-chunk");
789
+ if (file.type === "chunk") return this.context.emitChunk(file);
782
790
  return this.context.emitFile({
783
791
  ...file,
784
792
  originalFileName: file.originalFileName || undefined,
785
793
  source: bindingAssetSource(file.source)
786
794
  });
787
795
  }
788
- async emitChunk(chunk) {
789
- return this.context.emitChunk(chunk);
790
- }
791
796
  getFileName(referenceId) {
792
797
  return this.context.getFileName(referenceId);
793
798
  }
@@ -2134,83 +2139,6 @@ async function initializeWorker(registryId, pluginInfos, threadNumber) {
2134
2139
  }
2135
2140
  }
2136
2141
 
2137
- //#endregion
2138
- //#region ../../node_modules/.pnpm/colorette@2.0.20/node_modules/colorette/index.js
2139
- const { env: env$1 = {}, argv = [], platform = "" } = typeof process === "undefined" ? {} : process;
2140
- const isDisabled = "NO_COLOR" in env$1 || argv.includes("--no-color");
2141
- const isForced = "FORCE_COLOR" in env$1 || argv.includes("--color");
2142
- const isWindows = platform === "win32";
2143
- const isDumbTerminal = env$1.TERM === "dumb";
2144
- const isCompatibleTerminal = tty && tty.isatty && tty.isatty(1) && env$1.TERM && !isDumbTerminal;
2145
- const isCI = "CI" in env$1 && ("GITHUB_ACTIONS" in env$1 || "GITLAB_CI" in env$1 || "CIRCLECI" in env$1);
2146
- const isColorSupported = !isDisabled && (isForced || isWindows && !isDumbTerminal || isCompatibleTerminal || isCI);
2147
- const replaceClose = (index, string, close, replace, head = string.substring(0, index) + replace, tail = string.substring(index + close.length), next = tail.indexOf(close)) => head + (next < 0 ? tail : replaceClose(next, tail, close, replace));
2148
- const clearBleed = (index, string, open, close, replace) => index < 0 ? open + string + close : open + replaceClose(index, string, close, replace) + close;
2149
- const filterEmpty = (open, close, replace = open, at = open.length + 1) => (string) => string || !(string === "" || string === undefined) ? clearBleed(("" + string).indexOf(close, at), string, open, close, replace) : "";
2150
- const init = (open, close, replace) => filterEmpty(`\x1b[${open}m`, `\x1b[${close}m`, replace);
2151
- const colors$1 = {
2152
- reset: init(0, 0),
2153
- bold: init(1, 22, "\x1B[22m\x1B[1m"),
2154
- dim: init(2, 22, "\x1B[22m\x1B[2m"),
2155
- italic: init(3, 23),
2156
- underline: init(4, 24),
2157
- inverse: init(7, 27),
2158
- hidden: init(8, 28),
2159
- strikethrough: init(9, 29),
2160
- black: init(30, 39),
2161
- red: init(31, 39),
2162
- green: init(32, 39),
2163
- yellow: init(33, 39),
2164
- blue: init(34, 39),
2165
- magenta: init(35, 39),
2166
- cyan: init(36, 39),
2167
- white: init(37, 39),
2168
- gray: init(90, 39),
2169
- bgBlack: init(40, 49),
2170
- bgRed: init(41, 49),
2171
- bgGreen: init(42, 49),
2172
- bgYellow: init(43, 49),
2173
- bgBlue: init(44, 49),
2174
- bgMagenta: init(45, 49),
2175
- bgCyan: init(46, 49),
2176
- bgWhite: init(47, 49),
2177
- blackBright: init(90, 39),
2178
- redBright: init(91, 39),
2179
- greenBright: init(92, 39),
2180
- yellowBright: init(93, 39),
2181
- blueBright: init(94, 39),
2182
- magentaBright: init(95, 39),
2183
- cyanBright: init(96, 39),
2184
- whiteBright: init(97, 39),
2185
- bgBlackBright: init(100, 49),
2186
- bgRedBright: init(101, 49),
2187
- bgGreenBright: init(102, 49),
2188
- bgYellowBright: init(103, 49),
2189
- bgBlueBright: init(104, 49),
2190
- bgMagentaBright: init(105, 49),
2191
- bgCyanBright: init(106, 49),
2192
- bgWhiteBright: init(107, 49)
2193
- };
2194
- const createColors = ({ useColor = isColorSupported } = {}) => useColor ? colors$1 : Object.keys(colors$1).reduce((colors$2, key) => ({
2195
- ...colors$2,
2196
- [key]: String
2197
- }), {});
2198
- const { reset, bold: bold$1, dim: dim$1, italic, underline: underline$1, inverse, hidden, strikethrough, black, red: red$1, green: green$1, yellow: yellow$1, blue, magenta, cyan: cyan$1, white, gray: gray$1, bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite, blackBright, redBright, greenBright, yellowBright, blueBright, magentaBright, cyanBright, whiteBright, bgBlackBright, bgRedBright, bgGreenBright, bgYellowBright, bgBlueBright, bgMagentaBright, bgCyanBright, bgWhiteBright } = createColors();
2199
-
2200
- //#endregion
2201
- //#region src/cli/colors.ts
2202
- const { bold, cyan, dim, gray, green, red, underline, yellow } = createColors({ useColor: env.FORCE_COLOR !== "0" && !env.NO_COLOR });
2203
- const colors = {
2204
- bold,
2205
- cyan,
2206
- dim,
2207
- gray,
2208
- green,
2209
- red,
2210
- underline,
2211
- yellow
2212
- };
2213
-
2214
2142
  //#endregion
2215
2143
  //#region src/utils/validator.ts
2216
2144
  const StringOrRegExpSchema = v.union([v.string(), v.instance(RegExp)]);
@@ -2683,7 +2611,7 @@ const watch = (input) => {
2683
2611
 
2684
2612
  //#endregion
2685
2613
  //#region package.json
2686
- var version = "1.0.0-beta.1-commit.2fe52d4";
2614
+ var version = "1.0.0-beta.1-commit.298dd8b";
2687
2615
  var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
2688
2616
 
2689
2617
  //#endregion
@@ -2707,4 +2635,4 @@ async function build(options) {
2707
2635
  const VERSION = version;
2708
2636
 
2709
2637
  //#endregion
2710
- export { BuiltinPlugin, PluginContextData, VERSION, arraify, bindingifyPlugin, build, buildImportAnalysisPlugin, colors, composeJsPlugins, createBundler, defineConfig, description, dynamicImportVarsPlugin, getInputCliKeys, getJsonSchema, getOutputCliKeys, handleOutputErrors, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, rolldown, validateCliOptions, version, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, watch };
2638
+ export { BuiltinPlugin, PluginContextData, VERSION, arraify, bindingifyPlugin, build, buildImportAnalysisPlugin, composeJsPlugins, createBundler, defineConfig, description, dynamicImportVarsPlugin, getInputCliKeys, getJsonSchema, getOutputCliKeys, handleOutputErrors, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, rolldown, validateCliOptions, version, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, watch };