rolldown 1.0.0-beta.4 → 1.0.0-beta.4-commit.251e281

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,6 +1,6 @@
1
1
  "use strict";
2
2
  const require_chunk = require('../shared/chunk-qZFfknuJ.cjs');
3
- const require_src = require('../shared/src-BoCo2q-B.cjs');
3
+ const require_src = require('../shared/src-ClOrJJEc.cjs');
4
4
  const require_parse_ast_index = require('../shared/parse-ast-index-Dh_sWnMa.cjs');
5
5
  const node_process = require_chunk.__toESM(require("node:process"));
6
6
  const node_path = require_chunk.__toESM(require("node:path"));
@@ -1535,7 +1535,7 @@ function normalizeCliOptions(cliOptions, positionals) {
1535
1535
  const [data, errors] = require_src.validateCliOptions(cliOptions);
1536
1536
  if (errors?.length) {
1537
1537
  errors.forEach((error) => {
1538
- logger.error(`Invalid value for option ${error}. You can use \`rolldown -h\` to see the help.`);
1538
+ logger.error(`${error}. You can use \`rolldown -h\` to see the help.`);
1539
1539
  });
1540
1540
  process.exit(1);
1541
1541
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  const require_chunk = require('../shared/chunk-qZFfknuJ.cjs');
3
- const require_src = require('../shared/src-BoCo2q-B.cjs');
3
+ const require_src = require('../shared/src-ClOrJJEc.cjs');
4
4
  const require_parse_ast_index = require('../shared/parse-ast-index-Dh_sWnMa.cjs');
5
5
  const node_url = require_chunk.__toESM(require("node:url"));
6
6
 
@@ -1,4 +1,4 @@
1
- const require_src = require('../shared/src-BoCo2q-B.cjs');
1
+ const require_src = require('../shared/src-ClOrJJEc.cjs');
2
2
  require('../shared/parse-ast-index-Dh_sWnMa.cjs');
3
3
 
4
4
  exports.VERSION = require_src.VERSION
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  const require_chunk = require('../shared/chunk-qZFfknuJ.cjs');
3
- const require_src = require('../shared/src-BoCo2q-B.cjs');
3
+ const require_src = require('../shared/src-ClOrJJEc.cjs');
4
4
  const require_parse_ast_index = require('../shared/parse-ast-index-Dh_sWnMa.cjs');
5
5
  const node_worker_threads = require_chunk.__toESM(require("node:worker_threads"));
6
6
 
package/dist/esm/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { colors } from "../shared/parse-ast-index-DIxeQDpE.mjs";
2
- import { arraify, description, getInputCliKeys, getJsonSchema, getOutputCliKeys, rolldown, validateCliOptions, version, watch } from "../shared/src-CVLOD8-r.mjs";
2
+ import { arraify, description, getInputCliKeys, getJsonSchema, getOutputCliKeys, rolldown, validateCliOptions, version, watch } from "../shared/src-Bp4ucDPp.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";
@@ -1531,7 +1531,7 @@ function normalizeCliOptions(cliOptions, positionals) {
1531
1531
  const [data, errors] = validateCliOptions(cliOptions);
1532
1532
  if (errors?.length) {
1533
1533
  errors.forEach((error) => {
1534
- logger.error(`Invalid value for option ${error}. You can use \`rolldown -h\` to see the help.`);
1534
+ logger.error(`${error}. You can use \`rolldown -h\` to see the help.`);
1535
1535
  });
1536
1536
  process.exit(1);
1537
1537
  }
@@ -1,5 +1,5 @@
1
1
  import { import_binding } from "../shared/parse-ast-index-DIxeQDpE.mjs";
2
- import { BuiltinPlugin, buildImportAnalysisPlugin, composeJsPlugins, createBundler, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "../shared/src-CVLOD8-r.mjs";
2
+ import { BuiltinPlugin, buildImportAnalysisPlugin, composeJsPlugins, createBundler, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "../shared/src-Bp4ucDPp.mjs";
3
3
  import { pathToFileURL } from "node:url";
4
4
 
5
5
  //#region src/plugin/parallel-plugin.ts
@@ -1,4 +1,4 @@
1
1
  import "../shared/parse-ast-index-DIxeQDpE.mjs";
2
- import { VERSION, build, defineConfig, rolldown, watch } from "../shared/src-CVLOD8-r.mjs";
2
+ import { VERSION, build, defineConfig, rolldown, watch } from "../shared/src-Bp4ucDPp.mjs";
3
3
 
4
4
  export { VERSION, build, defineConfig, rolldown, watch };
@@ -1,5 +1,5 @@
1
1
  import { import_binding } from "../shared/parse-ast-index-DIxeQDpE.mjs";
2
- import { PluginContextData, bindingifyPlugin } from "../shared/src-CVLOD8-r.mjs";
2
+ import { PluginContextData, bindingifyPlugin } from "../shared/src-Bp4ucDPp.mjs";
3
3
  import { parentPort, workerData } from "node:worker_threads";
4
4
 
5
5
  //#region src/parallel-plugin-worker.ts
@@ -727,7 +727,10 @@ const CliOptionsSchema = v.strictObject({
727
727
  });
728
728
  function validateCliOptions(options) {
729
729
  let parsed = v.safeParse(CliOptionsSchema, options);
730
- return [parsed.output, parsed.issues?.map((issue) => issue.path?.join(", ")).filter((v$1) => v$1 !== void 0)];
730
+ return [parsed.output, parsed.issues?.map((issue) => {
731
+ const option = issue.path?.map((pathItem) => pathItem.key).join(" ");
732
+ return `Invalid value for option ${option}: ${issue.message}`;
733
+ })];
731
734
  }
732
735
  const inputHelperMsgRecord = { output: { ignored: true } };
733
736
  const outputHelperMsgRecord = {};
@@ -1109,6 +1112,21 @@ function bindingifySideEffects(sideEffects) {
1109
1112
  }
1110
1113
  }
1111
1114
 
1115
+ //#endregion
1116
+ //#region src/utils/resolved-external.ts
1117
+ function transformResolvedExternal(bindingResolvedExternal$1) {
1118
+ switch (bindingResolvedExternal$1.type) {
1119
+ case "Bool": return bindingResolvedExternal$1.field0;
1120
+ default: unimplemented(`external ${bindingResolvedExternal$1.type}`);
1121
+ }
1122
+ }
1123
+ function bindingResolvedExternal(external) {
1124
+ if (typeof external === "boolean") return {
1125
+ type: "Bool",
1126
+ field0: external
1127
+ };
1128
+ }
1129
+
1112
1130
  //#endregion
1113
1131
  //#region src/plugin/plugin-context.ts
1114
1132
  var PluginContextImpl = class extends MinimalPluginContextImpl {
@@ -1163,6 +1181,7 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
1163
1181
  const info = this.data.getModuleOption(res.id) || {};
1164
1182
  return {
1165
1183
  ...res,
1184
+ external: transformResolvedExternal(res.external),
1166
1185
  ...info
1167
1186
  };
1168
1187
  }
@@ -1340,7 +1359,7 @@ function bindingifyResolveId(args) {
1340
1359
  if (ret == null) return;
1341
1360
  if (ret === false) return {
1342
1361
  id: specifier,
1343
- external: true
1362
+ external: bindingResolvedExternal(true)
1344
1363
  };
1345
1364
  if (typeof ret === "string") return { id: ret };
1346
1365
  let exist = args.pluginContextData.updateModuleOption(ret.id, {
@@ -1350,7 +1369,7 @@ function bindingifyResolveId(args) {
1350
1369
  });
1351
1370
  return {
1352
1371
  id: ret.id,
1353
- external: ret.external,
1372
+ external: bindingResolvedExternal(ret.external),
1354
1373
  sideEffects: bindingifySideEffects(exist.moduleSideEffects)
1355
1374
  };
1356
1375
  },
@@ -1368,12 +1387,12 @@ function bindingifyResolveDynamicImport(args) {
1368
1387
  if (ret == null) return;
1369
1388
  if (ret === false) return {
1370
1389
  id: specifier,
1371
- external: true
1390
+ external: bindingResolvedExternal(true)
1372
1391
  };
1373
1392
  if (typeof ret === "string") return { id: ret };
1374
1393
  const result = {
1375
1394
  id: ret.id,
1376
- external: ret.external
1395
+ external: bindingResolvedExternal(ret.external)
1377
1396
  };
1378
1397
  if (ret.moduleSideEffects !== null) result.sideEffects = bindingifySideEffects(ret.moduleSideEffects);
1379
1398
  args.pluginContextData.updateModuleOption(ret.id, {
@@ -2799,7 +2818,7 @@ const watch = (input) => {
2799
2818
 
2800
2819
  //#endregion
2801
2820
  //#region package.json
2802
- var version = "1.0.0-beta.4";
2821
+ var version = "1.0.0-beta.4-commit.251e281";
2803
2822
  var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
2804
2823
 
2805
2824
  //#endregion
@@ -729,7 +729,10 @@ const CliOptionsSchema = valibot.strictObject({
729
729
  });
730
730
  function validateCliOptions(options) {
731
731
  let parsed = valibot.safeParse(CliOptionsSchema, options);
732
- return [parsed.output, parsed.issues?.map((issue) => issue.path?.join(", ")).filter((v) => v !== void 0)];
732
+ return [parsed.output, parsed.issues?.map((issue) => {
733
+ const option = issue.path?.map((pathItem) => pathItem.key).join(" ");
734
+ return `Invalid value for option ${option}: ${issue.message}`;
735
+ })];
733
736
  }
734
737
  const inputHelperMsgRecord = { output: { ignored: true } };
735
738
  const outputHelperMsgRecord = {};
@@ -1111,6 +1114,21 @@ function bindingifySideEffects(sideEffects) {
1111
1114
  }
1112
1115
  }
1113
1116
 
1117
+ //#endregion
1118
+ //#region src/utils/resolved-external.ts
1119
+ function transformResolvedExternal(bindingResolvedExternal$1) {
1120
+ switch (bindingResolvedExternal$1.type) {
1121
+ case "Bool": return bindingResolvedExternal$1.field0;
1122
+ default: unimplemented(`external ${bindingResolvedExternal$1.type}`);
1123
+ }
1124
+ }
1125
+ function bindingResolvedExternal(external) {
1126
+ if (typeof external === "boolean") return {
1127
+ type: "Bool",
1128
+ field0: external
1129
+ };
1130
+ }
1131
+
1114
1132
  //#endregion
1115
1133
  //#region src/plugin/plugin-context.ts
1116
1134
  var PluginContextImpl = class extends MinimalPluginContextImpl {
@@ -1165,6 +1183,7 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
1165
1183
  const info = this.data.getModuleOption(res.id) || {};
1166
1184
  return {
1167
1185
  ...res,
1186
+ external: transformResolvedExternal(res.external),
1168
1187
  ...info
1169
1188
  };
1170
1189
  }
@@ -1342,7 +1361,7 @@ function bindingifyResolveId(args) {
1342
1361
  if (ret == null) return;
1343
1362
  if (ret === false) return {
1344
1363
  id: specifier,
1345
- external: true
1364
+ external: bindingResolvedExternal(true)
1346
1365
  };
1347
1366
  if (typeof ret === "string") return { id: ret };
1348
1367
  let exist = args.pluginContextData.updateModuleOption(ret.id, {
@@ -1352,7 +1371,7 @@ function bindingifyResolveId(args) {
1352
1371
  });
1353
1372
  return {
1354
1373
  id: ret.id,
1355
- external: ret.external,
1374
+ external: bindingResolvedExternal(ret.external),
1356
1375
  sideEffects: bindingifySideEffects(exist.moduleSideEffects)
1357
1376
  };
1358
1377
  },
@@ -1370,12 +1389,12 @@ function bindingifyResolveDynamicImport(args) {
1370
1389
  if (ret == null) return;
1371
1390
  if (ret === false) return {
1372
1391
  id: specifier,
1373
- external: true
1392
+ external: bindingResolvedExternal(true)
1374
1393
  };
1375
1394
  if (typeof ret === "string") return { id: ret };
1376
1395
  const result = {
1377
1396
  id: ret.id,
1378
- external: ret.external
1397
+ external: bindingResolvedExternal(ret.external)
1379
1398
  };
1380
1399
  if (ret.moduleSideEffects !== null) result.sideEffects = bindingifySideEffects(ret.moduleSideEffects);
1381
1400
  args.pluginContextData.updateModuleOption(ret.id, {
@@ -2801,7 +2820,7 @@ const watch = (input) => {
2801
2820
 
2802
2821
  //#endregion
2803
2822
  //#region package.json
2804
- var version = "1.0.0-beta.4";
2823
+ var version = "1.0.0-beta.4-commit.251e281";
2805
2824
  var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
2806
2825
 
2807
2826
  //#endregion
@@ -298,7 +298,7 @@ export interface BindingHookJsResolveIdOptions {
298
298
 
299
299
  export interface BindingHookJsResolveIdOutput {
300
300
  id: string
301
- external?: boolean
301
+ external?: BindingResolvedExternal
302
302
  sideEffects: boolean | 'no-treeshake'
303
303
  }
304
304
 
@@ -322,7 +322,7 @@ export interface BindingHookResolveIdExtraArgs {
322
322
 
323
323
  export interface BindingHookResolveIdOutput {
324
324
  id: string
325
- external?: boolean
325
+ external?: BindingResolvedExternal
326
326
  sideEffects?: BindingHookSideEffects
327
327
  }
328
328
 
@@ -523,7 +523,7 @@ export interface BindingOutputOptions {
523
523
 
524
524
  export interface BindingPluginContextResolvedId {
525
525
  id: string
526
- external: boolean
526
+ external: BindingResolvedExternal
527
527
  }
528
528
 
529
529
  export interface BindingPluginContextResolveOptions {
@@ -615,6 +615,11 @@ export interface BindingReplacePluginConfig {
615
615
  sourcemap?: boolean
616
616
  }
617
617
 
618
+ export type BindingResolvedExternal =
619
+ | { type: 'Bool', field0: boolean }
620
+ | { type: 'Absolute' }
621
+ | { type: 'Relative' }
622
+
618
623
  export interface BindingResolveOptions {
619
624
  alias?: Array<AliasItem>
620
625
  aliasFields?: Array<Array<string>>
@@ -1104,11 +1109,11 @@ export interface ParserOptions {
1104
1109
  */
1105
1110
  astType?: 'js' | 'ts'
1106
1111
  /**
1107
- * Emit `ParenthesizedExpression` in AST.
1112
+ * Emit `ParenthesizedExpression` and `TSParenthesizedType` in AST.
1108
1113
  *
1109
1114
  * If this option is true, parenthesized expressions are represented by
1110
- * (non-standard) `ParenthesizedExpression` nodes that have a single `expression` property
1111
- * containing the expression inside parentheses.
1115
+ * (non-standard) `ParenthesizedExpression` and `TSParenthesizedType` nodes that
1116
+ * have a single `expression` property containing the expression inside parentheses.
1112
1117
  *
1113
1118
  * @default true
1114
1119
  */
@@ -0,0 +1,4 @@
1
+ import { BindingResolvedExternal } from '../binding';
2
+ import { PartialResolvedId, ResolvedId } from '../plugin';
3
+ export declare function transformResolvedExternal(bindingResolvedExternal: BindingResolvedExternal): ResolvedId['external'];
4
+ export declare function bindingResolvedExternal(external: PartialResolvedId['external']): BindingResolvedExternal | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rolldown",
3
- "version": "1.0.0-beta.4",
3
+ "version": "1.0.0-beta.4-commit.251e281",
4
4
  "description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
5
5
  "homepage": "https://rolldown.rs/",
6
6
  "repository": {
@@ -84,12 +84,12 @@
84
84
  "dtsHeader": "type MaybePromise<T> = T | Promise<T>\ntype Nullable<T> = T | null | undefined\ntype VoidNullable<T = void> = T | null | undefined | void\nexport type BindingStringOrRegex = string | RegExp\n\n"
85
85
  },
86
86
  "dependencies": {
87
- "@oxc-project/types": "0.56.5",
87
+ "@oxc-project/types": "0.57.0",
88
88
  "@valibot/to-json-schema": "1.0.0-rc.0",
89
89
  "valibot": "1.0.0-rc.3"
90
90
  },
91
91
  "peerDependencies": {
92
- "@oxc-project/runtime": "0.56.5"
92
+ "@oxc-project/runtime": "0.57.0"
93
93
  },
94
94
  "peerDependenciesMeta": {
95
95
  "@oxc-project/runtime": {
@@ -122,21 +122,21 @@
122
122
  "unbuild": "^3.0.0",
123
123
  "why-is-node-running": "^3.0.0",
124
124
  "@rolldown/testing": "0.0.1",
125
- "rolldown": "1.0.0-beta.4"
125
+ "rolldown": "1.0.0-beta.4-commit.251e281"
126
126
  },
127
127
  "optionalDependencies": {
128
- "@rolldown/binding-darwin-arm64": "1.0.0-beta.4",
129
- "@rolldown/binding-darwin-x64": "1.0.0-beta.4",
130
- "@rolldown/binding-freebsd-x64": "1.0.0-beta.4",
131
- "@rolldown/binding-linux-arm-gnueabihf": "1.0.0-beta.4",
132
- "@rolldown/binding-linux-arm64-gnu": "1.0.0-beta.4",
133
- "@rolldown/binding-linux-arm64-musl": "1.0.0-beta.4",
134
- "@rolldown/binding-linux-x64-gnu": "1.0.0-beta.4",
135
- "@rolldown/binding-wasm32-wasi": "1.0.0-beta.4",
136
- "@rolldown/binding-linux-x64-musl": "1.0.0-beta.4",
137
- "@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.4",
138
- "@rolldown/binding-win32-x64-msvc": "1.0.0-beta.4",
139
- "@rolldown/binding-win32-ia32-msvc": "1.0.0-beta.4"
128
+ "@rolldown/binding-darwin-x64": "1.0.0-beta.4-commit.251e281",
129
+ "@rolldown/binding-freebsd-x64": "1.0.0-beta.4-commit.251e281",
130
+ "@rolldown/binding-linux-arm-gnueabihf": "1.0.0-beta.4-commit.251e281",
131
+ "@rolldown/binding-linux-arm64-gnu": "1.0.0-beta.4-commit.251e281",
132
+ "@rolldown/binding-linux-arm64-musl": "1.0.0-beta.4-commit.251e281",
133
+ "@rolldown/binding-darwin-arm64": "1.0.0-beta.4-commit.251e281",
134
+ "@rolldown/binding-linux-x64-gnu": "1.0.0-beta.4-commit.251e281",
135
+ "@rolldown/binding-linux-x64-musl": "1.0.0-beta.4-commit.251e281",
136
+ "@rolldown/binding-wasm32-wasi": "1.0.0-beta.4-commit.251e281",
137
+ "@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.4-commit.251e281",
138
+ "@rolldown/binding-win32-ia32-msvc": "1.0.0-beta.4-commit.251e281",
139
+ "@rolldown/binding-win32-x64-msvc": "1.0.0-beta.4-commit.251e281"
140
140
  },
141
141
  "scripts": {
142
142
  "# Scrips for binding #": "_",