rolldown 0.15.0-snapshot-22747a3-20241206003640 → 0.15.0-snapshot-64a831c-20241207003504

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-BK2Ye-xa.cjs');
3
- const require_src = require('../shared/src-BIbmsUlX.cjs');
3
+ const require_src = require('../shared/src-BYmJViz6.cjs');
4
4
  const require_consola_36c0034f = require('../shared/consola_36c0034f-_8_dG1Nr.cjs');
5
5
  const zod = require_chunk.__toESM(require("zod"));
6
6
  const node_path = require_chunk.__toESM(require("node:path"));
@@ -1531,12 +1531,13 @@ const watchOptionsSchema = zod.z.strictObject({
1531
1531
  exclude: stringOrRegExpSchema.optional(),
1532
1532
  chokidar: zod.z.any().optional()
1533
1533
  });
1534
+ const checksOptionsSchema = zod.z.strictObject({ circularDependency: zod.z.boolean().describe("Wether to emit warnings when detecting circular dependencies").optional() });
1534
1535
  const inputOptionsSchema = zod.z.strictObject({
1535
1536
  input: inputOptionSchema.optional(),
1536
1537
  plugins: phantom().optional(),
1537
1538
  external: externalSchema.optional(),
1538
1539
  resolve: zod.z.strictObject({
1539
- alias: zod.z.record(zod.z.string()).optional(),
1540
+ alias: zod.z.record(zod.z.array(zod.z.string()).or(zod.z.string())).optional(),
1540
1541
  aliasFields: zod.z.array(zod.z.array(zod.z.string())).optional(),
1541
1542
  conditionNames: optionalStringArray(),
1542
1543
  extensionAlias: zod.z.record(zod.z.string(), zod.z.array(zod.z.string())).optional(),
@@ -1567,7 +1568,8 @@ const inputOptionsSchema = zod.z.strictObject({
1567
1568
  profilerNames: zod.z.boolean().optional(),
1568
1569
  jsx: jsxOptionsSchema.optional(),
1569
1570
  watch: watchOptionsSchema.or(zod.z.literal(false)).optional(),
1570
- dropLabels: zod.z.array(zod.z.string()).describe("Remove labeled statements with these label names").optional()
1571
+ dropLabels: zod.z.array(zod.z.string()).describe("Remove labeled statements with these label names").optional(),
1572
+ checks: checksOptionsSchema.optional()
1571
1573
  });
1572
1574
  const inputCliOptionsSchema = inputOptionsSchema.extend({
1573
1575
  external: zod.z.array(zod.z.string()).describe("Comma-separated list of module ids to exclude from the bundle `<module-id>,...`").optional(),
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  const require_chunk = require('../shared/chunk-BK2Ye-xa.cjs');
3
- const require_src = require('../shared/src-BIbmsUlX.cjs');
3
+ const require_src = require('../shared/src-BYmJViz6.cjs');
4
4
  const node_url = require_chunk.__toESM(require("node:url"));
5
5
 
6
6
  //#region src/plugin/parallel-plugin.ts
@@ -1,4 +1,4 @@
1
- const require_src = require('../shared/src-BIbmsUlX.cjs');
1
+ const require_src = require('../shared/src-BYmJViz6.cjs');
2
2
 
3
3
  exports.VERSION = require_src.VERSION
4
4
  exports.build = require_src.build
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  const require_chunk = require('../shared/chunk-BK2Ye-xa.cjs');
3
- const require_src = require('../shared/src-BIbmsUlX.cjs');
3
+ const require_src = require('../shared/src-BYmJViz6.cjs');
4
4
  const node_worker_threads = require_chunk.__toESM(require("node:worker_threads"));
5
5
 
6
6
  //#region src/parallel-plugin-worker.ts
package/dist/esm/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { LogLevelOptionSchema, LogLevelSchema, LogLevelWithErrorSchema, RollupLogSchema, RollupLogWithStringSchema, TreeshakingOptionsSchema, __export, arraify, description, rolldown, version, watch } from "../shared/src-qgo__dKA.mjs";
2
- import { createConsola } from "../shared/consola_36c0034f--bn5jvdH.mjs";
1
+ import { LogLevelOptionSchema, LogLevelSchema, LogLevelWithErrorSchema, RollupLogSchema, RollupLogWithStringSchema, TreeshakingOptionsSchema, __export, arraify, description, rolldown, version, watch } from "../shared/src-CKZ4-qVz.mjs";
2
+ import { createConsola } from "../shared/consola_36c0034f-B6fL2Jf_.mjs";
3
3
  import { ZodFirstPartyTypeKind, ZodFirstPartyTypeKind as ZodFirstPartyTypeKind$1, ZodFirstPartyTypeKind as ZodFirstPartyTypeKind$2, z, z as z$1, z as z$2, z as z$3 } from "zod";
4
4
  import nodePath, { default as path } from "node:path";
5
5
  import process$1, { env } from "node:process";
@@ -1528,12 +1528,13 @@ const watchOptionsSchema = z$2.strictObject({
1528
1528
  exclude: stringOrRegExpSchema.optional(),
1529
1529
  chokidar: z$2.any().optional()
1530
1530
  });
1531
+ const checksOptionsSchema = z$2.strictObject({ circularDependency: z$2.boolean().describe("Wether to emit warnings when detecting circular dependencies").optional() });
1531
1532
  const inputOptionsSchema = z$2.strictObject({
1532
1533
  input: inputOptionSchema.optional(),
1533
1534
  plugins: phantom().optional(),
1534
1535
  external: externalSchema.optional(),
1535
1536
  resolve: z$2.strictObject({
1536
- alias: z$2.record(z$2.string()).optional(),
1537
+ alias: z$2.record(z$2.array(z$2.string()).or(z$2.string())).optional(),
1537
1538
  aliasFields: z$2.array(z$2.array(z$2.string())).optional(),
1538
1539
  conditionNames: optionalStringArray(),
1539
1540
  extensionAlias: z$2.record(z$2.string(), z$2.array(z$2.string())).optional(),
@@ -1564,7 +1565,8 @@ const inputOptionsSchema = z$2.strictObject({
1564
1565
  profilerNames: z$2.boolean().optional(),
1565
1566
  jsx: jsxOptionsSchema.optional(),
1566
1567
  watch: watchOptionsSchema.or(z$2.literal(false)).optional(),
1567
- dropLabels: z$2.array(z$2.string()).describe("Remove labeled statements with these label names").optional()
1568
+ dropLabels: z$2.array(z$2.string()).describe("Remove labeled statements with these label names").optional(),
1569
+ checks: checksOptionsSchema.optional()
1568
1570
  });
1569
1571
  const inputCliOptionsSchema = inputOptionsSchema.extend({
1570
1572
  external: z$2.array(z$2.string()).describe("Comma-separated list of module ids to exclude from the bundle `<module-id>,...`").optional(),
@@ -1,4 +1,4 @@
1
- import { BuiltinPlugin, __toESM, buildImportAnalysisPlugin, composeJsPlugins, createBundler, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, require_binding, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "../shared/src-qgo__dKA.mjs";
1
+ import { BuiltinPlugin, __toESM, buildImportAnalysisPlugin, composeJsPlugins, createBundler, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, require_binding, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "../shared/src-CKZ4-qVz.mjs";
2
2
  import { pathToFileURL } from "node:url";
3
3
 
4
4
  //#region src/plugin/parallel-plugin.ts
@@ -1,3 +1,3 @@
1
- import { VERSION, build, defineConfig, rolldown, watch } from "../shared/src-qgo__dKA.mjs";
1
+ import { VERSION, build, defineConfig, rolldown, watch } from "../shared/src-CKZ4-qVz.mjs";
2
2
 
3
3
  export { VERSION, build, defineConfig, rolldown, watch };
@@ -1,4 +1,4 @@
1
- import { PluginContextData, __toESM, bindingifyPlugin, require_binding } from "../shared/src-qgo__dKA.mjs";
1
+ import { PluginContextData, __toESM, bindingifyPlugin, require_binding } from "../shared/src-CKZ4-qVz.mjs";
2
2
  import { parentPort, workerData } from "node:worker_threads";
3
3
 
4
4
  //#region src/parallel-plugin-worker.ts
@@ -815,7 +815,7 @@ function createConsola(options = {}) {
815
815
  defaults: { level },
816
816
  stdout: process.stdout,
817
817
  stderr: process.stderr,
818
- prompt: (...args) => import("./prompt-DHyJur3_.mjs").then((m) => m.prompt(...args)),
818
+ prompt: (...args) => import("./prompt-Bxbtwdyb.mjs").then((m) => m.prompt(...args)),
819
819
  reporters: options.reporters || [options.fancy ?? !(isCI || isTest) ? new FancyReporter() : new BasicReporter()],
820
820
  ...options
821
821
  });
@@ -1,4 +1,4 @@
1
- import { colors, getDefaultExportFromCjs, isUnicodeSupported } from "./consola_36c0034f--bn5jvdH.mjs";
1
+ import { colors, getDefaultExportFromCjs, isUnicodeSupported } from "./consola_36c0034f-B6fL2Jf_.mjs";
2
2
  import { stdin, stdout } from "node:process";
3
3
  import require$$0 from "tty";
4
4
  import { WriteStream } from "node:tty";
@@ -1,4 +1,5 @@
1
1
  const require_chunk = require('./chunk-BK2Ye-xa.cjs');
2
+ const node_buffer = require_chunk.__toESM(require("node:buffer"));
2
3
  const zod = require_chunk.__toESM(require("zod"));
3
4
  const node_path = require_chunk.__toESM(require("node:path"));
4
5
  const node_worker_threads = require_chunk.__toESM(require("node:worker_threads"));
@@ -107,6 +108,19 @@ function transformChunkModules(modules) {
107
108
 
108
109
  //#endregion
109
110
  //#region src/utils/transform-to-rollup-output.ts
111
+ function transformToRollupSourceMap(map) {
112
+ const parsed = JSON.parse(map);
113
+ const obj = {
114
+ ...parsed,
115
+ toString() {
116
+ return JSON.stringify(obj);
117
+ },
118
+ toUrl() {
119
+ return `data:application/json;charset=utf-8;base64,${node_buffer.Buffer.from(obj.toString(), "utf-8").toString("base64")}`;
120
+ }
121
+ };
122
+ return obj;
123
+ }
110
124
  function transformToRollupOutputChunk(bindingChunk, changed) {
111
125
  const chunk = {
112
126
  type: "chunk",
@@ -132,7 +146,7 @@ function transformToRollupOutputChunk(bindingChunk, changed) {
132
146
  return bindingChunk.moduleIds;
133
147
  },
134
148
  get map() {
135
- return bindingChunk.map ? JSON.parse(bindingChunk.map) : null;
149
+ return bindingChunk.map ? transformToRollupSourceMap(bindingChunk.map) : null;
136
150
  },
137
151
  sourcemapFileName: bindingChunk.sourcemapFileName || null,
138
152
  preliminaryFileName: bindingChunk.preliminaryFileName
@@ -1967,7 +1981,8 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, onLog,
1967
1981
  jsx: bindingifyJsx(inputOptions.jsx),
1968
1982
  watch: bindingifyWatch(inputOptions.watch),
1969
1983
  dropLabels: inputOptions.dropLabels,
1970
- keepNames: inputOptions.keepNames
1984
+ keepNames: inputOptions.keepNames,
1985
+ checks: inputOptions.checks
1971
1986
  };
1972
1987
  }
1973
1988
  function bindingifyExternal(external) {
@@ -1991,7 +2006,7 @@ function bindingifyResolve(resolve) {
1991
2006
  return {
1992
2007
  alias: alias ? Object.entries(alias).map(([name, replacement]) => ({
1993
2008
  find: name,
1994
- replacements: [replacement]
2009
+ replacements: arraify(replacement)
1995
2010
  })) : undefined,
1996
2011
  extensionAlias: extensionAlias ? Object.entries(extensionAlias).map(([name, value]) => ({
1997
2012
  target: name,
@@ -1,4 +1,5 @@
1
1
  import { createRequire as createRequire$1 } from "module";
2
+ import { Buffer as Buffer$1 } from "node:buffer";
2
3
  import { z, z as z$1 } from "zod";
3
4
  import path, { default as path$1 } from "node:path";
4
5
  import { Worker } from "node:worker_threads";
@@ -140,6 +141,19 @@ function transformChunkModules(modules) {
140
141
 
141
142
  //#endregion
142
143
  //#region src/utils/transform-to-rollup-output.ts
144
+ function transformToRollupSourceMap(map) {
145
+ const parsed = JSON.parse(map);
146
+ const obj = {
147
+ ...parsed,
148
+ toString() {
149
+ return JSON.stringify(obj);
150
+ },
151
+ toUrl() {
152
+ return `data:application/json;charset=utf-8;base64,${Buffer$1.from(obj.toString(), "utf-8").toString("base64")}`;
153
+ }
154
+ };
155
+ return obj;
156
+ }
143
157
  function transformToRollupOutputChunk(bindingChunk, changed) {
144
158
  const chunk = {
145
159
  type: "chunk",
@@ -165,7 +179,7 @@ function transformToRollupOutputChunk(bindingChunk, changed) {
165
179
  return bindingChunk.moduleIds;
166
180
  },
167
181
  get map() {
168
- return bindingChunk.map ? JSON.parse(bindingChunk.map) : null;
182
+ return bindingChunk.map ? transformToRollupSourceMap(bindingChunk.map) : null;
169
183
  },
170
184
  sourcemapFileName: bindingChunk.sourcemapFileName || null,
171
185
  preliminaryFileName: bindingChunk.preliminaryFileName
@@ -1999,7 +2013,8 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, onLog,
1999
2013
  jsx: bindingifyJsx(inputOptions.jsx),
2000
2014
  watch: bindingifyWatch(inputOptions.watch),
2001
2015
  dropLabels: inputOptions.dropLabels,
2002
- keepNames: inputOptions.keepNames
2016
+ keepNames: inputOptions.keepNames,
2017
+ checks: inputOptions.checks
2003
2018
  };
2004
2019
  }
2005
2020
  function bindingifyExternal(external) {
@@ -2023,7 +2038,7 @@ function bindingifyResolve(resolve) {
2023
2038
  return {
2024
2039
  alias: alias ? Object.entries(alias).map(([name, replacement]) => ({
2025
2040
  find: name,
2026
- replacements: [replacement]
2041
+ replacements: arraify(replacement)
2027
2042
  })) : undefined,
2028
2043
  extensionAlias: extensionAlias ? Object.entries(extensionAlias).map(([name, value]) => ({
2029
2044
  target: name,
@@ -213,6 +213,10 @@ export type BindingBuiltinPluginName = 'builtin:wasm-helper'|
213
213
  'builtin:replace'|
214
214
  'builtin:vite-resolve';
215
215
 
216
+ export interface BindingChecksOptions {
217
+ circularDependency?: boolean
218
+ }
219
+
216
220
  export interface BindingEmittedAsset {
217
221
  name?: string
218
222
  fileName?: string
@@ -328,6 +332,7 @@ export interface BindingInputOptions {
328
332
  jsx?: JsxOptions
329
333
  watch?: BindingWatchOption
330
334
  keepNames?: boolean
335
+ checks?: BindingChecksOptions
331
336
  }
332
337
 
333
338
  export interface BindingJsonPluginConfig {
@@ -542,6 +547,7 @@ export interface BindingViteResolvePluginConfig {
542
547
  environmentName: string
543
548
  external: true | string[]
544
549
  noExternal: true | Array<string | RegExp>
550
+ dedupe: Array<string>
545
551
  finalizeBareSpecifier?: (resolvedId: string, rawId: string, importer: string | null | undefined) => VoidNullable<string>
546
552
  finalizeOtherSpecifiers?: (resolvedId: string, rawId: string) => VoidNullable<string>
547
553
  runtime: string
@@ -10,7 +10,7 @@ export declare const cliOptionsSchema: z.ZodObject<z.objectUtil.extendShape<z.ob
10
10
  plugins: z.ZodOptional<z.ZodType<import("../../plugin").RolldownPluginOption, z.ZodTypeDef, import("../../plugin").RolldownPluginOption>>;
11
11
  external: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">]>, z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodOptional<z.ZodString>, z.ZodBoolean], z.ZodUnknown>, z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodVoid, z.ZodNull]>, z.ZodUndefined]>, z.ZodBoolean]>>]>>;
12
12
  resolve: z.ZodOptional<z.ZodObject<{
13
- alias: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
13
+ alias: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodString]>>>;
14
14
  aliasFields: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString, "many">, "many">>;
15
15
  conditionNames: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
16
16
  extensionAlias: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
@@ -23,7 +23,7 @@ export declare const cliOptionsSchema: z.ZodObject<z.objectUtil.extendShape<z.ob
23
23
  tsconfigFilename: z.ZodOptional<z.ZodString>;
24
24
  }, "strict", z.ZodTypeAny, {
25
25
  modules?: string[] | undefined;
26
- alias?: Record<string, string> | undefined;
26
+ alias?: Record<string, string | string[]> | undefined;
27
27
  extensionAlias?: Record<string, string[]> | undefined;
28
28
  aliasFields?: string[][] | undefined;
29
29
  conditionNames?: string[] | undefined;
@@ -35,7 +35,7 @@ export declare const cliOptionsSchema: z.ZodObject<z.objectUtil.extendShape<z.ob
35
35
  tsconfigFilename?: string | undefined;
36
36
  }, {
37
37
  modules?: string[] | undefined;
38
- alias?: Record<string, string> | undefined;
38
+ alias?: Record<string, string | string[]> | undefined;
39
39
  extensionAlias?: Record<string, string[]> | undefined;
40
40
  aliasFields?: string[][] | undefined;
41
41
  conditionNames?: string[] | undefined;
@@ -202,6 +202,13 @@ export declare const cliOptionsSchema: z.ZodObject<z.objectUtil.extendShape<z.ob
202
202
  chokidar?: any;
203
203
  }>, z.ZodLiteral<false>]>>;
204
204
  dropLabels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
205
+ checks: z.ZodOptional<z.ZodObject<{
206
+ circularDependency: z.ZodOptional<z.ZodBoolean>;
207
+ }, "strict", z.ZodTypeAny, {
208
+ circularDependency?: boolean | undefined;
209
+ }, {
210
+ circularDependency?: boolean | undefined;
211
+ }>>;
205
212
  }, {
206
213
  external: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
207
214
  inject: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
@@ -320,6 +327,7 @@ export declare const cliOptionsSchema: z.ZodObject<z.objectUtil.extendShape<z.ob
320
327
  externalLiveBindings?: boolean | undefined;
321
328
  inlineDynamicImports?: boolean | undefined;
322
329
  comments?: "none" | "preserve-legal" | undefined;
330
+ version?: boolean | undefined;
323
331
  external?: string[] | undefined;
324
332
  jsx?: {
325
333
  development?: boolean | undefined;
@@ -337,12 +345,14 @@ export declare const cliOptionsSchema: z.ZodObject<z.objectUtil.extendShape<z.ob
337
345
  watch?: boolean | undefined;
338
346
  cwd?: string | undefined;
339
347
  shimMissingExports?: boolean | undefined;
340
- moduleTypes?: Record<string, "base64" | "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "dataurl" | "binary" | "empty" | "css"> | undefined;
348
+ moduleTypes?: Record<string, "base64" | "binary" | "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "dataurl" | "empty" | "css"> | undefined;
341
349
  define?: Record<string, string> | undefined;
342
350
  dropLabels?: string[] | undefined;
351
+ checks?: {
352
+ circularDependency?: boolean | undefined;
353
+ } | undefined;
343
354
  config?: string | boolean | undefined;
344
355
  help?: boolean | undefined;
345
- version?: boolean | undefined;
346
356
  }, {
347
357
  name?: string | undefined;
348
358
  exports?: "auto" | "named" | "default" | "none" | undefined;
@@ -371,6 +381,7 @@ export declare const cliOptionsSchema: z.ZodObject<z.objectUtil.extendShape<z.ob
371
381
  externalLiveBindings?: boolean | undefined;
372
382
  inlineDynamicImports?: boolean | undefined;
373
383
  comments?: "none" | "preserve-legal" | undefined;
384
+ version?: boolean | undefined;
374
385
  external?: string[] | undefined;
375
386
  jsx?: {
376
387
  development?: boolean | undefined;
@@ -388,12 +399,14 @@ export declare const cliOptionsSchema: z.ZodObject<z.objectUtil.extendShape<z.ob
388
399
  watch?: boolean | undefined;
389
400
  cwd?: string | undefined;
390
401
  shimMissingExports?: boolean | undefined;
391
- moduleTypes?: Record<string, "base64" | "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "dataurl" | "binary" | "empty" | "css"> | undefined;
402
+ moduleTypes?: Record<string, "base64" | "binary" | "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "dataurl" | "empty" | "css"> | undefined;
392
403
  define?: Record<string, string> | undefined;
393
404
  dropLabels?: string[] | undefined;
405
+ checks?: {
406
+ circularDependency?: boolean | undefined;
407
+ } | undefined;
394
408
  config?: string | boolean | undefined;
395
409
  help?: boolean | undefined;
396
- version?: boolean | undefined;
397
410
  }>;
398
411
  export type CliOptions = z.infer<typeof cliOptionsSchema>;
399
412
  export declare const schema: ObjectSchema;
@@ -5,7 +5,7 @@ export declare const inputOptionsSchema: z.ZodObject<{
5
5
  plugins: z.ZodOptional<z.ZodType<RolldownPluginOption, z.ZodTypeDef, RolldownPluginOption>>;
6
6
  external: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">]>, z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodOptional<z.ZodString>, z.ZodBoolean], z.ZodUnknown>, z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodVoid, z.ZodNull]>, z.ZodUndefined]>, z.ZodBoolean]>>]>>;
7
7
  resolve: z.ZodOptional<z.ZodObject<{
8
- alias: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
8
+ alias: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodString]>>>;
9
9
  aliasFields: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString, "many">, "many">>;
10
10
  conditionNames: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
11
11
  extensionAlias: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
@@ -18,7 +18,7 @@ export declare const inputOptionsSchema: z.ZodObject<{
18
18
  tsconfigFilename: z.ZodOptional<z.ZodString>;
19
19
  }, "strict", z.ZodTypeAny, {
20
20
  modules?: string[] | undefined;
21
- alias?: Record<string, string> | undefined;
21
+ alias?: Record<string, string | string[]> | undefined;
22
22
  extensionAlias?: Record<string, string[]> | undefined;
23
23
  aliasFields?: string[][] | undefined;
24
24
  conditionNames?: string[] | undefined;
@@ -30,7 +30,7 @@ export declare const inputOptionsSchema: z.ZodObject<{
30
30
  tsconfigFilename?: string | undefined;
31
31
  }, {
32
32
  modules?: string[] | undefined;
33
- alias?: Record<string, string> | undefined;
33
+ alias?: Record<string, string | string[]> | undefined;
34
34
  extensionAlias?: Record<string, string[]> | undefined;
35
35
  aliasFields?: string[][] | undefined;
36
36
  conditionNames?: string[] | undefined;
@@ -197,6 +197,13 @@ export declare const inputOptionsSchema: z.ZodObject<{
197
197
  chokidar?: any;
198
198
  }>, z.ZodLiteral<false>]>>;
199
199
  dropLabels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
200
+ checks: z.ZodOptional<z.ZodObject<{
201
+ circularDependency: z.ZodOptional<z.ZodBoolean>;
202
+ }, "strict", z.ZodTypeAny, {
203
+ circularDependency?: boolean | undefined;
204
+ }, {
205
+ circularDependency?: boolean | undefined;
206
+ }>>;
200
207
  }, "strict", z.ZodTypeAny, {
201
208
  plugins?: RolldownPluginOption;
202
209
  onLog?: ((args_0: "info" | "debug" | "warn", args_1: any, args_2: (args_0: "info" | "debug" | "warn" | "error", args_1: any, ...args: unknown[]) => unknown, ...args: unknown[]) => unknown) | undefined;
@@ -215,7 +222,7 @@ export declare const inputOptionsSchema: z.ZodObject<{
215
222
  input?: string | string[] | Record<string, string> | undefined;
216
223
  resolve?: {
217
224
  modules?: string[] | undefined;
218
- alias?: Record<string, string> | undefined;
225
+ alias?: Record<string, string | string[]> | undefined;
219
226
  extensionAlias?: Record<string, string[]> | undefined;
220
227
  aliasFields?: string[][] | undefined;
221
228
  conditionNames?: string[] | undefined;
@@ -264,7 +271,7 @@ export declare const inputOptionsSchema: z.ZodObject<{
264
271
  } | undefined;
265
272
  cwd?: string | undefined;
266
273
  shimMissingExports?: boolean | undefined;
267
- moduleTypes?: Record<string, "base64" | "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "dataurl" | "binary" | "empty" | "css"> | undefined;
274
+ moduleTypes?: Record<string, "base64" | "binary" | "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "dataurl" | "empty" | "css"> | undefined;
268
275
  experimental?: {
269
276
  strictExecutionOrder?: boolean | undefined;
270
277
  disableLiveBindings?: boolean | undefined;
@@ -274,6 +281,9 @@ export declare const inputOptionsSchema: z.ZodObject<{
274
281
  define?: Record<string, string> | undefined;
275
282
  profilerNames?: boolean | undefined;
276
283
  dropLabels?: string[] | undefined;
284
+ checks?: {
285
+ circularDependency?: boolean | undefined;
286
+ } | undefined;
277
287
  }, {
278
288
  plugins?: RolldownPluginOption;
279
289
  onLog?: ((args_0: "info" | "debug" | "warn", args_1: any, args_2: (args_0: "info" | "debug" | "warn" | "error", args_1: any, ...args: unknown[]) => unknown, ...args: unknown[]) => unknown) | undefined;
@@ -292,7 +302,7 @@ export declare const inputOptionsSchema: z.ZodObject<{
292
302
  input?: string | string[] | Record<string, string> | undefined;
293
303
  resolve?: {
294
304
  modules?: string[] | undefined;
295
- alias?: Record<string, string> | undefined;
305
+ alias?: Record<string, string | string[]> | undefined;
296
306
  extensionAlias?: Record<string, string[]> | undefined;
297
307
  aliasFields?: string[][] | undefined;
298
308
  conditionNames?: string[] | undefined;
@@ -341,7 +351,7 @@ export declare const inputOptionsSchema: z.ZodObject<{
341
351
  } | undefined;
342
352
  cwd?: string | undefined;
343
353
  shimMissingExports?: boolean | undefined;
344
- moduleTypes?: Record<string, "base64" | "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "dataurl" | "binary" | "empty" | "css"> | undefined;
354
+ moduleTypes?: Record<string, "base64" | "binary" | "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "dataurl" | "empty" | "css"> | undefined;
345
355
  experimental?: {
346
356
  strictExecutionOrder?: boolean | undefined;
347
357
  disableLiveBindings?: boolean | undefined;
@@ -351,13 +361,16 @@ export declare const inputOptionsSchema: z.ZodObject<{
351
361
  define?: Record<string, string> | undefined;
352
362
  profilerNames?: boolean | undefined;
353
363
  dropLabels?: string[] | undefined;
364
+ checks?: {
365
+ circularDependency?: boolean | undefined;
366
+ } | undefined;
354
367
  }>;
355
368
  export declare const inputCliOptionsSchema: z.ZodObject<Omit<z.objectUtil.extendShape<{
356
369
  input: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodRecord<z.ZodString, z.ZodString>]>>;
357
370
  plugins: z.ZodOptional<z.ZodType<RolldownPluginOption, z.ZodTypeDef, RolldownPluginOption>>;
358
371
  external: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">]>, z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodOptional<z.ZodString>, z.ZodBoolean], z.ZodUnknown>, z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodVoid, z.ZodNull]>, z.ZodUndefined]>, z.ZodBoolean]>>]>>;
359
372
  resolve: z.ZodOptional<z.ZodObject<{
360
- alias: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
373
+ alias: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodString]>>>;
361
374
  aliasFields: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString, "many">, "many">>;
362
375
  conditionNames: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
363
376
  extensionAlias: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
@@ -370,7 +383,7 @@ export declare const inputCliOptionsSchema: z.ZodObject<Omit<z.objectUtil.extend
370
383
  tsconfigFilename: z.ZodOptional<z.ZodString>;
371
384
  }, "strict", z.ZodTypeAny, {
372
385
  modules?: string[] | undefined;
373
- alias?: Record<string, string> | undefined;
386
+ alias?: Record<string, string | string[]> | undefined;
374
387
  extensionAlias?: Record<string, string[]> | undefined;
375
388
  aliasFields?: string[][] | undefined;
376
389
  conditionNames?: string[] | undefined;
@@ -382,7 +395,7 @@ export declare const inputCliOptionsSchema: z.ZodObject<Omit<z.objectUtil.extend
382
395
  tsconfigFilename?: string | undefined;
383
396
  }, {
384
397
  modules?: string[] | undefined;
385
- alias?: Record<string, string> | undefined;
398
+ alias?: Record<string, string | string[]> | undefined;
386
399
  extensionAlias?: Record<string, string[]> | undefined;
387
400
  aliasFields?: string[][] | undefined;
388
401
  conditionNames?: string[] | undefined;
@@ -549,6 +562,13 @@ export declare const inputCliOptionsSchema: z.ZodObject<Omit<z.objectUtil.extend
549
562
  chokidar?: any;
550
563
  }>, z.ZodLiteral<false>]>>;
551
564
  dropLabels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
565
+ checks: z.ZodOptional<z.ZodObject<{
566
+ circularDependency: z.ZodOptional<z.ZodBoolean>;
567
+ }, "strict", z.ZodTypeAny, {
568
+ circularDependency?: boolean | undefined;
569
+ }, {
570
+ circularDependency?: boolean | undefined;
571
+ }>>;
552
572
  }, {
553
573
  external: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
554
574
  inject: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
@@ -570,9 +590,12 @@ export declare const inputCliOptionsSchema: z.ZodObject<Omit<z.objectUtil.extend
570
590
  inject?: Record<string, string> | undefined;
571
591
  cwd?: string | undefined;
572
592
  shimMissingExports?: boolean | undefined;
573
- moduleTypes?: Record<string, "base64" | "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "dataurl" | "binary" | "empty" | "css"> | undefined;
593
+ moduleTypes?: Record<string, "base64" | "binary" | "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "dataurl" | "empty" | "css"> | undefined;
574
594
  define?: Record<string, string> | undefined;
575
595
  dropLabels?: string[] | undefined;
596
+ checks?: {
597
+ circularDependency?: boolean | undefined;
598
+ } | undefined;
576
599
  }, {
577
600
  external?: string[] | undefined;
578
601
  jsx?: {
@@ -590,7 +613,10 @@ export declare const inputCliOptionsSchema: z.ZodObject<Omit<z.objectUtil.extend
590
613
  inject?: Record<string, string> | undefined;
591
614
  cwd?: string | undefined;
592
615
  shimMissingExports?: boolean | undefined;
593
- moduleTypes?: Record<string, "base64" | "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "dataurl" | "binary" | "empty" | "css"> | undefined;
616
+ moduleTypes?: Record<string, "base64" | "binary" | "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "dataurl" | "empty" | "css"> | undefined;
594
617
  define?: Record<string, string> | undefined;
595
618
  dropLabels?: string[] | undefined;
619
+ checks?: {
620
+ circularDependency?: boolean | undefined;
621
+ } | undefined;
596
622
  }>;
@@ -24,12 +24,19 @@ export interface WatchOptions {
24
24
  exclude?: StringOrRegExp | StringOrRegExp[];
25
25
  chokidar?: any;
26
26
  }
27
+ export interface ChecksOptions {
28
+ /**
29
+ * Wether to emit warnings when detecting circular dependencies.
30
+ * @default false
31
+ */
32
+ circularDependency?: boolean;
33
+ }
27
34
  export interface InputOptions {
28
35
  input?: InputOption;
29
36
  plugins?: RolldownPluginOption;
30
37
  external?: ExternalOption;
31
38
  resolve?: {
32
- alias?: Record<string, string>;
39
+ alias?: Record<string, string[] | string>;
33
40
  aliasFields?: string[][];
34
41
  conditionNames?: string[];
35
42
  extensionAlias?: Record<string, string[]>;
@@ -93,6 +100,7 @@ export interface InputOptions {
93
100
  watch?: WatchOptions | false;
94
101
  dropLabels?: string[];
95
102
  keepNames?: boolean;
103
+ checks?: ChecksOptions;
96
104
  }
97
105
  interface OverwriteInputOptionsForCli {
98
106
  external?: string[];
@@ -18,6 +18,8 @@ export interface SourceMap {
18
18
  sources: string[];
19
19
  sourcesContent: string[];
20
20
  version: number;
21
+ toString(): string;
22
+ toUrl(): string;
21
23
  }
22
24
  export interface RolldownRenderedModule {
23
25
  readonly code: string | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rolldown",
3
- "version": "0.15.0-snapshot-22747a3-20241206003640",
3
+ "version": "0.15.0-snapshot-64a831c-20241207003504",
4
4
  "description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
5
5
  "homepage": "https://rolldown.rs/",
6
6
  "repository": {
@@ -112,22 +112,22 @@
112
112
  "unbuild": "^2.0.0",
113
113
  "why-is-node-running": "^3.0.0",
114
114
  "zod-to-json-schema": "^3.23.2",
115
- "rolldown": "0.15.0-snapshot-22747a3-20241206003640",
116
- "@rolldown/testing": "0.0.1"
115
+ "@rolldown/testing": "0.0.1",
116
+ "rolldown": "0.15.0-snapshot-64a831c-20241207003504"
117
117
  },
118
118
  "optionalDependencies": {
119
- "@rolldown/binding-darwin-arm64": "0.15.0-snapshot-22747a3-20241206003640",
120
- "@rolldown/binding-freebsd-x64": "0.15.0-snapshot-22747a3-20241206003640",
121
- "@rolldown/binding-darwin-x64": "0.15.0-snapshot-22747a3-20241206003640",
122
- "@rolldown/binding-linux-arm-gnueabihf": "0.15.0-snapshot-22747a3-20241206003640",
123
- "@rolldown/binding-linux-arm64-gnu": "0.15.0-snapshot-22747a3-20241206003640",
124
- "@rolldown/binding-linux-arm64-musl": "0.15.0-snapshot-22747a3-20241206003640",
125
- "@rolldown/binding-linux-x64-gnu": "0.15.0-snapshot-22747a3-20241206003640",
126
- "@rolldown/binding-wasm32-wasi": "0.15.0-snapshot-22747a3-20241206003640",
127
- "@rolldown/binding-linux-x64-musl": "0.15.0-snapshot-22747a3-20241206003640",
128
- "@rolldown/binding-win32-arm64-msvc": "0.15.0-snapshot-22747a3-20241206003640",
129
- "@rolldown/binding-win32-ia32-msvc": "0.15.0-snapshot-22747a3-20241206003640",
130
- "@rolldown/binding-win32-x64-msvc": "0.15.0-snapshot-22747a3-20241206003640"
119
+ "@rolldown/binding-darwin-arm64": "0.15.0-snapshot-64a831c-20241207003504",
120
+ "@rolldown/binding-darwin-x64": "0.15.0-snapshot-64a831c-20241207003504",
121
+ "@rolldown/binding-freebsd-x64": "0.15.0-snapshot-64a831c-20241207003504",
122
+ "@rolldown/binding-linux-arm-gnueabihf": "0.15.0-snapshot-64a831c-20241207003504",
123
+ "@rolldown/binding-linux-arm64-gnu": "0.15.0-snapshot-64a831c-20241207003504",
124
+ "@rolldown/binding-linux-arm64-musl": "0.15.0-snapshot-64a831c-20241207003504",
125
+ "@rolldown/binding-linux-x64-musl": "0.15.0-snapshot-64a831c-20241207003504",
126
+ "@rolldown/binding-wasm32-wasi": "0.15.0-snapshot-64a831c-20241207003504",
127
+ "@rolldown/binding-win32-arm64-msvc": "0.15.0-snapshot-64a831c-20241207003504",
128
+ "@rolldown/binding-win32-ia32-msvc": "0.15.0-snapshot-64a831c-20241207003504",
129
+ "@rolldown/binding-win32-x64-msvc": "0.15.0-snapshot-64a831c-20241207003504",
130
+ "@rolldown/binding-linux-x64-gnu": "0.15.0-snapshot-64a831c-20241207003504"
131
131
  },
132
132
  "scripts": {
133
133
  "# Scrips for binding #": "_",