rolldown 1.0.0-beta.7-commit.d32b487 → 1.0.0-beta.7-commit.218ee9d

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  const require_chunk = require('../shared/chunk-qZFfknuJ.cjs');
3
- const require_src = require('../shared/src-X4D463Lq.cjs');
4
- const require_parse_ast_index = require('../shared/parse-ast-index-C8v5UEr2.cjs');
3
+ const require_src = require('../shared/src-B-DEVKvS.cjs');
4
+ const require_parse_ast_index = require('../shared/parse-ast-index-BzS9mPhQ.cjs');
5
5
  const node_process = require_chunk.__toESM(require("node:process"));
6
6
  const node_path = require_chunk.__toESM(require("node:path"));
7
7
  const node_fs = require_chunk.__toESM(require("node:fs"));
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  const require_chunk = require('../shared/chunk-qZFfknuJ.cjs');
3
- const require_src = require('../shared/src-X4D463Lq.cjs');
4
- const require_parse_ast_index = require('../shared/parse-ast-index-C8v5UEr2.cjs');
3
+ const require_src = require('../shared/src-B-DEVKvS.cjs');
4
+ const require_parse_ast_index = require('../shared/parse-ast-index-BzS9mPhQ.cjs');
5
5
  const node_url = require_chunk.__toESM(require("node:url"));
6
6
 
7
7
  //#region src/plugin/parallel-plugin.ts
@@ -1,5 +1,5 @@
1
- const require_src = require('../shared/src-X4D463Lq.cjs');
2
- require('../shared/parse-ast-index-C8v5UEr2.cjs');
1
+ const require_src = require('../shared/src-B-DEVKvS.cjs');
2
+ require('../shared/parse-ast-index-BzS9mPhQ.cjs');
3
3
 
4
4
  exports.VERSION = require_src.VERSION
5
5
  exports.build = require_src.build
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  const require_chunk = require('../shared/chunk-qZFfknuJ.cjs');
3
- const require_src = require('../shared/src-X4D463Lq.cjs');
4
- const require_parse_ast_index = require('../shared/parse-ast-index-C8v5UEr2.cjs');
3
+ const require_src = require('../shared/src-B-DEVKvS.cjs');
4
+ const require_parse_ast_index = require('../shared/parse-ast-index-BzS9mPhQ.cjs');
5
5
  const node_worker_threads = require_chunk.__toESM(require("node:worker_threads"));
6
6
 
7
7
  //#region src/parallel-plugin-worker.ts
@@ -1,4 +1,4 @@
1
- const require_parse_ast_index = require('../shared/parse-ast-index-C8v5UEr2.cjs');
1
+ const require_parse_ast_index = require('../shared/parse-ast-index-BzS9mPhQ.cjs');
2
2
 
3
3
  exports.parseAst = require_parse_ast_index.parseAst
4
4
  exports.parseAstAsync = require_parse_ast_index.parseAstAsync
package/dist/esm/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { colors } from "../shared/parse-ast-index-BN2JFoRu.mjs";
2
- import { arraify, description, getInputCliKeys, getJsonSchema, getOutputCliKeys, rolldown, validateCliOptions, version, watch } from "../shared/src-CjdNA0SQ.mjs";
1
+ import { colors } from "../shared/parse-ast-index-CVCVLNV5.mjs";
2
+ import { arraify, description, getInputCliKeys, getJsonSchema, getOutputCliKeys, rolldown, validateCliOptions, version, watch } from "../shared/src-Cg4lpWN7.mjs";
3
3
  import process$1, { cwd } from "node:process";
4
4
  import path, { sep } from "node:path";
5
5
  import fs from "node:fs";
@@ -1,5 +1,5 @@
1
- import { import_binding } from "../shared/parse-ast-index-BN2JFoRu.mjs";
2
- import { BuiltinPlugin, buildImportAnalysisPlugin, composeJsPlugins, createBundler, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "../shared/src-CjdNA0SQ.mjs";
1
+ import { import_binding } from "../shared/parse-ast-index-CVCVLNV5.mjs";
2
+ import { BuiltinPlugin, buildImportAnalysisPlugin, composeJsPlugins, createBundler, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "../shared/src-Cg4lpWN7.mjs";
3
3
  import { pathToFileURL } from "node:url";
4
4
 
5
5
  //#region src/plugin/parallel-plugin.ts
@@ -1,4 +1,4 @@
1
- import "../shared/parse-ast-index-BN2JFoRu.mjs";
2
- import { VERSION, build, defineConfig, rolldown, watch } from "../shared/src-CjdNA0SQ.mjs";
1
+ import "../shared/parse-ast-index-CVCVLNV5.mjs";
2
+ import { VERSION, build, defineConfig, rolldown, watch } from "../shared/src-Cg4lpWN7.mjs";
3
3
 
4
4
  export { VERSION, build, defineConfig, rolldown, watch };
@@ -1,5 +1,5 @@
1
- import { import_binding } from "../shared/parse-ast-index-BN2JFoRu.mjs";
2
- import { PluginContextData, bindingifyPlugin } from "../shared/src-CjdNA0SQ.mjs";
1
+ import { import_binding } from "../shared/parse-ast-index-CVCVLNV5.mjs";
2
+ import { PluginContextData, bindingifyPlugin } from "../shared/src-Cg4lpWN7.mjs";
3
3
  import { parentPort, workerData } from "node:worker_threads";
4
4
 
5
5
  //#region src/parallel-plugin-worker.ts
@@ -1,3 +1,3 @@
1
- import { parseAst, parseAstAsync } from "../shared/parse-ast-index-BN2JFoRu.mjs";
1
+ import { parseAst, parseAstAsync } from "../shared/parse-ast-index-CVCVLNV5.mjs";
2
2
 
3
3
  export { parseAst, parseAstAsync };
@@ -251,11 +251,47 @@ function augmentCodeLocation(properties, pos, source, id) {
251
251
  }
252
252
  }
253
253
 
254
+ //#endregion
255
+ //#region src/webcontainer-fallback.js
256
+ var require_webcontainer_fallback = require_chunk.__commonJS({ "src/webcontainer-fallback.js"(exports, module) {
257
+ const fs = require("node:fs");
258
+ const childProcess = require("node:child_process");
259
+ const rolldownPkg = JSON.parse(fs.readFileSync(require.resolve("rolldown/package.json"), "utf-8"));
260
+ const version = rolldownPkg.version;
261
+ const baseDir = `/tmp/rolldown-${version}`;
262
+ const bindingEntry = `${baseDir}/node_modules/@rolldown/binding-wasm32-wasi/rolldown-binding.wasi.cjs`;
263
+ if (!fs.existsSync(bindingEntry)) {
264
+ let bindingPkg = `@rolldown/binding-wasm32-wasi@${version}`;
265
+ try {
266
+ const info = JSON.parse(childProcess.execFileSync("npm", [
267
+ "why",
268
+ "--json",
269
+ "rolldown"
270
+ ], { encoding: "utf-8" }));
271
+ const spec = info[0].dependents[0].spec;
272
+ if (spec.startsWith("https://pkg.pr.new/")) {
273
+ const commit = spec.split("@").at(-1);
274
+ bindingPkg = `https://pkg.pr.new/@rolldown/binding-wasm32-wasi@${commit}`;
275
+ }
276
+ } catch {}
277
+ fs.rmSync(baseDir, {
278
+ recursive: true,
279
+ force: true
280
+ });
281
+ fs.mkdirSync(baseDir, { recursive: true });
282
+ console.log(`[rolldown] Downloading ${bindingPkg} on WebContainer...`);
283
+ childProcess.execFileSync("pnpm", ["i", bindingPkg], {
284
+ cwd: baseDir,
285
+ stdio: "inherit"
286
+ });
287
+ }
288
+ module.exports = require(bindingEntry);
289
+ } });
290
+
254
291
  //#endregion
255
292
  //#region src/binding.js
256
293
  var require_binding = require_chunk.__commonJS({ "src/binding.js"(exports, module) {
257
294
  const { createRequire } = require("node:module");
258
- require = createRequire(__filename);
259
295
  const { readFileSync } = require("node:fs");
260
296
  let nativeBinding = null;
261
297
  const loadErrors = [];
@@ -542,6 +578,11 @@ var require_binding = require_chunk.__commonJS({ "src/binding.js"(exports, modul
542
578
  if (process.env.NAPI_RS_FORCE_WASI) loadErrors.push(err);
543
579
  }
544
580
  }
581
+ if (!nativeBinding && globalThis.process?.versions?.["webcontainer"]) try {
582
+ nativeBinding = require_webcontainer_fallback();
583
+ } catch (err) {
584
+ loadErrors.push(err);
585
+ }
545
586
  if (!nativeBinding) {
546
587
  if (loadErrors.length > 0) throw new Error("Failed to load native binding", { cause: loadErrors });
547
588
  throw new Error(`Failed to load native binding`);
@@ -278,6 +278,43 @@ function augmentCodeLocation(properties, pos, source, id) {
278
278
  }
279
279
  }
280
280
 
281
+ //#endregion
282
+ //#region src/webcontainer-fallback.js
283
+ var require_webcontainer_fallback = __commonJS({ "src/webcontainer-fallback.js"(exports, module) {
284
+ const fs = __require("node:fs");
285
+ const childProcess = __require("node:child_process");
286
+ const rolldownPkg = JSON.parse(fs.readFileSync(__require.resolve("rolldown/package.json"), "utf-8"));
287
+ const version = rolldownPkg.version;
288
+ const baseDir = `/tmp/rolldown-${version}`;
289
+ const bindingEntry = `${baseDir}/node_modules/@rolldown/binding-wasm32-wasi/rolldown-binding.wasi.cjs`;
290
+ if (!fs.existsSync(bindingEntry)) {
291
+ let bindingPkg = `@rolldown/binding-wasm32-wasi@${version}`;
292
+ try {
293
+ const info = JSON.parse(childProcess.execFileSync("npm", [
294
+ "why",
295
+ "--json",
296
+ "rolldown"
297
+ ], { encoding: "utf-8" }));
298
+ const spec = info[0].dependents[0].spec;
299
+ if (spec.startsWith("https://pkg.pr.new/")) {
300
+ const commit = spec.split("@").at(-1);
301
+ bindingPkg = `https://pkg.pr.new/@rolldown/binding-wasm32-wasi@${commit}`;
302
+ }
303
+ } catch {}
304
+ fs.rmSync(baseDir, {
305
+ recursive: true,
306
+ force: true
307
+ });
308
+ fs.mkdirSync(baseDir, { recursive: true });
309
+ console.log(`[rolldown] Downloading ${bindingPkg} on WebContainer...`);
310
+ childProcess.execFileSync("pnpm", ["i", bindingPkg], {
311
+ cwd: baseDir,
312
+ stdio: "inherit"
313
+ });
314
+ }
315
+ module.exports = __require(bindingEntry);
316
+ } });
317
+
281
318
  //#endregion
282
319
  //#region src/binding.js
283
320
  var require_binding = __commonJS({ "src/binding.js"(exports, module) {
@@ -568,6 +605,11 @@ var require_binding = __commonJS({ "src/binding.js"(exports, module) {
568
605
  if (process.env.NAPI_RS_FORCE_WASI) loadErrors.push(err);
569
606
  }
570
607
  }
608
+ if (!nativeBinding && globalThis.process?.versions?.["webcontainer"]) try {
609
+ nativeBinding = require_webcontainer_fallback();
610
+ } catch (err) {
611
+ loadErrors.push(err);
612
+ }
571
613
  if (!nativeBinding) {
572
614
  if (loadErrors.length > 0) throw new Error("Failed to load native binding", { cause: loadErrors });
573
615
  throw new Error(`Failed to load native binding`);
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  const require_chunk = require('./chunk-qZFfknuJ.cjs');
3
- const require_parse_ast_index = require('./parse-ast-index-C8v5UEr2.cjs');
3
+ const require_parse_ast_index = require('./parse-ast-index-BzS9mPhQ.cjs');
4
4
  const node_path = require_chunk.__toESM(require("node:path"));
5
5
  const valibot = require_chunk.__toESM(require("valibot"));
6
6
  const __valibot_to_json_schema = require_chunk.__toESM(require("@valibot/to-json-schema"));
@@ -2861,7 +2861,7 @@ const watch = (input) => {
2861
2861
 
2862
2862
  //#endregion
2863
2863
  //#region package.json
2864
- var version = "1.0.0-beta.7-commit.d32b487";
2864
+ var version = "1.0.0-beta.7-commit.218ee9d";
2865
2865
  var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
2866
2866
 
2867
2867
  //#endregion
@@ -1,4 +1,4 @@
1
- import { augmentCodeLocation, colors, error, import_binding, logCycleLoading, logInputHookInOutputPlugin, logInvalidLogPosition, logMinifyWarning, logMultiplyNotifyOption, logPluginError, parseAst } from "./parse-ast-index-BN2JFoRu.mjs";
1
+ import { augmentCodeLocation, colors, error, import_binding, logCycleLoading, logInputHookInOutputPlugin, logInvalidLogPosition, logMinifyWarning, logMultiplyNotifyOption, logPluginError, parseAst } from "./parse-ast-index-CVCVLNV5.mjs";
2
2
  import path from "node:path";
3
3
  import * as v from "valibot";
4
4
  import { toJsonSchema } from "@valibot/to-json-schema";
@@ -2859,7 +2859,7 @@ const watch = (input) => {
2859
2859
 
2860
2860
  //#endregion
2861
2861
  //#region package.json
2862
- var version = "1.0.0-beta.7-commit.d32b487";
2862
+ var version = "1.0.0-beta.7-commit.218ee9d";
2863
2863
  var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
2864
2864
 
2865
2865
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rolldown",
3
- "version": "1.0.0-beta.7-commit.d32b487",
3
+ "version": "1.0.0-beta.7-commit.218ee9d",
4
4
  "description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
5
5
  "homepage": "https://rolldown.rs/",
6
6
  "repository": {
@@ -123,21 +123,21 @@
123
123
  "unbuild": "^3.0.0",
124
124
  "why-is-node-running": "^3.0.0",
125
125
  "@rolldown/testing": "0.0.1",
126
- "rolldown": "1.0.0-beta.7-commit.d32b487"
126
+ "rolldown": "1.0.0-beta.7-commit.218ee9d"
127
127
  },
128
128
  "optionalDependencies": {
129
- "@rolldown/binding-darwin-arm64": "1.0.0-beta.7-commit.d32b487",
130
- "@rolldown/binding-freebsd-x64": "1.0.0-beta.7-commit.d32b487",
131
- "@rolldown/binding-darwin-x64": "1.0.0-beta.7-commit.d32b487",
132
- "@rolldown/binding-linux-arm-gnueabihf": "1.0.0-beta.7-commit.d32b487",
133
- "@rolldown/binding-linux-arm64-gnu": "1.0.0-beta.7-commit.d32b487",
134
- "@rolldown/binding-linux-arm64-musl": "1.0.0-beta.7-commit.d32b487",
135
- "@rolldown/binding-linux-x64-gnu": "1.0.0-beta.7-commit.d32b487",
136
- "@rolldown/binding-linux-x64-musl": "1.0.0-beta.7-commit.d32b487",
137
- "@rolldown/binding-wasm32-wasi": "1.0.0-beta.7-commit.d32b487",
138
- "@rolldown/binding-win32-x64-msvc": "1.0.0-beta.7-commit.d32b487",
139
- "@rolldown/binding-win32-ia32-msvc": "1.0.0-beta.7-commit.d32b487",
140
- "@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.7-commit.d32b487"
129
+ "@rolldown/binding-darwin-arm64": "1.0.0-beta.7-commit.218ee9d",
130
+ "@rolldown/binding-freebsd-x64": "1.0.0-beta.7-commit.218ee9d",
131
+ "@rolldown/binding-linux-arm-gnueabihf": "1.0.0-beta.7-commit.218ee9d",
132
+ "@rolldown/binding-darwin-x64": "1.0.0-beta.7-commit.218ee9d",
133
+ "@rolldown/binding-linux-arm64-gnu": "1.0.0-beta.7-commit.218ee9d",
134
+ "@rolldown/binding-linux-arm64-musl": "1.0.0-beta.7-commit.218ee9d",
135
+ "@rolldown/binding-linux-x64-musl": "1.0.0-beta.7-commit.218ee9d",
136
+ "@rolldown/binding-wasm32-wasi": "1.0.0-beta.7-commit.218ee9d",
137
+ "@rolldown/binding-win32-ia32-msvc": "1.0.0-beta.7-commit.218ee9d",
138
+ "@rolldown/binding-linux-x64-gnu": "1.0.0-beta.7-commit.218ee9d",
139
+ "@rolldown/binding-win32-x64-msvc": "1.0.0-beta.7-commit.218ee9d",
140
+ "@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.7-commit.218ee9d"
141
141
  },
142
142
  "scripts": {
143
143
  "# Scrips for binding #": "_",