rolldown 0.14.0-snapshot-ab438c3-20241121003459 → 0.14.0-snapshot-db4090b-20241123003628

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 (31) hide show
  1. package/dist/cjs/cli.cjs +9 -5
  2. package/dist/cjs/experimental-index.cjs +1 -1
  3. package/dist/cjs/index.cjs +1 -1
  4. package/dist/cjs/parallel-plugin-worker.cjs +1 -1
  5. package/dist/esm/cli.mjs +9 -5
  6. package/dist/esm/experimental-index.mjs +1 -1
  7. package/dist/esm/index.mjs +1 -1
  8. package/dist/esm/parallel-plugin-worker.mjs +1 -1
  9. package/dist/shared/rolldown-binding.wasi.cjs +6 -8
  10. package/dist/shared/{src_index-Yt-qn7mE.cjs → src_index-WgTHG2Z9.cjs} +613 -649
  11. package/dist/shared/{src_index-k_6h6jvv.mjs → src_index-wJBYWP9G.mjs} +613 -649
  12. package/dist/types/binding.d.ts +10 -14
  13. package/dist/types/cli/arguments/schema.d.ts +60 -56
  14. package/dist/types/log/logger.d.ts +3 -3
  15. package/dist/types/options/bindingify-input-options.d.ts +3 -2
  16. package/dist/types/options/input-options.d.ts +128 -120
  17. package/dist/types/options/normalized-input-options.d.ts +1 -10
  18. package/dist/types/options/normalized-output-options.d.ts +1 -15
  19. package/dist/types/options/output-options.d.ts +12 -11
  20. package/dist/types/plugin/plugin-driver.d.ts +2 -3
  21. package/dist/types/treeshake/index.d.ts +0 -4
  22. package/dist/types/treeshake/module-side-effects.d.ts +23 -21
  23. package/dist/types/types/input-options.d.ts +8 -0
  24. package/dist/types/types/output-options.d.ts +12 -1
  25. package/dist/types/utils/error.d.ts +1 -0
  26. package/dist/types/utils/normalize-plugin-option.d.ts +2 -2
  27. package/dist/types/watcher.d.ts +2 -3
  28. package/package.json +15 -15
  29. package/dist/types/utils/normalize-input-options.d.ts +0 -3
  30. package/dist/types/utils/normalize-output-options.d.ts +0 -3
  31. package/dist/types/utils/normalize-tree-shake.d.ts +0 -3
@@ -6,42 +6,41 @@ export declare const ModuleSideEffectsRuleSchema: z.ZodEffects<z.ZodObject<{
6
6
  sideEffects: z.ZodBoolean;
7
7
  }, "strip", z.ZodTypeAny, {
8
8
  sideEffects: boolean;
9
- test?: RegExp | undefined;
10
9
  external?: boolean | undefined;
10
+ test?: RegExp | undefined;
11
11
  }, {
12
12
  sideEffects: boolean;
13
- test?: RegExp | undefined;
14
13
  external?: boolean | undefined;
14
+ test?: RegExp | undefined;
15
15
  }>, {
16
16
  sideEffects: boolean;
17
- test?: RegExp | undefined;
18
17
  external?: boolean | undefined;
18
+ test?: RegExp | undefined;
19
19
  }, {
20
20
  sideEffects: boolean;
21
- test?: RegExp | undefined;
22
21
  external?: boolean | undefined;
22
+ test?: RegExp | undefined;
23
23
  }>;
24
- export type ModuleSideEffectsRule = z.infer<typeof ModuleSideEffectsRuleSchema>;
25
24
  export declare const ModuleSideEffectsOptionSchema: z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
26
25
  test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>;
27
26
  external: z.ZodOptional<z.ZodBoolean>;
28
27
  sideEffects: z.ZodBoolean;
29
28
  }, "strip", z.ZodTypeAny, {
30
29
  sideEffects: boolean;
31
- test?: RegExp | undefined;
32
30
  external?: boolean | undefined;
31
+ test?: RegExp | undefined;
33
32
  }, {
34
33
  sideEffects: boolean;
35
- test?: RegExp | undefined;
36
34
  external?: boolean | undefined;
35
+ test?: RegExp | undefined;
37
36
  }>, {
38
37
  sideEffects: boolean;
39
- test?: RegExp | undefined;
40
38
  external?: boolean | undefined;
39
+ test?: RegExp | undefined;
41
40
  }, {
42
41
  sideEffects: boolean;
43
- test?: RegExp | undefined;
44
42
  external?: boolean | undefined;
43
+ test?: RegExp | undefined;
45
44
  }>, "many">]>, z.ZodLiteral<"no-external">]>;
46
45
  export declare const TreeshakingOptionsSchema: z.ZodUnion<[z.ZodObject<{
47
46
  moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
@@ -50,21 +49,22 @@ export declare const TreeshakingOptionsSchema: z.ZodUnion<[z.ZodObject<{
50
49
  sideEffects: z.ZodBoolean;
51
50
  }, "strip", z.ZodTypeAny, {
52
51
  sideEffects: boolean;
53
- test?: RegExp | undefined;
54
52
  external?: boolean | undefined;
53
+ test?: RegExp | undefined;
55
54
  }, {
56
55
  sideEffects: boolean;
57
- test?: RegExp | undefined;
58
56
  external?: boolean | undefined;
57
+ test?: RegExp | undefined;
59
58
  }>, {
60
59
  sideEffects: boolean;
61
- test?: RegExp | undefined;
62
60
  external?: boolean | undefined;
61
+ test?: RegExp | undefined;
63
62
  }, {
64
63
  sideEffects: boolean;
65
- test?: RegExp | undefined;
66
64
  external?: boolean | undefined;
65
+ test?: RegExp | undefined;
67
66
  }>, "many">]>, z.ZodLiteral<"no-external">]>>;
67
+ annotations: z.ZodOptional<z.ZodBoolean>;
68
68
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
69
69
  moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
70
70
  test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>;
@@ -72,21 +72,22 @@ export declare const TreeshakingOptionsSchema: z.ZodUnion<[z.ZodObject<{
72
72
  sideEffects: z.ZodBoolean;
73
73
  }, "strip", z.ZodTypeAny, {
74
74
  sideEffects: boolean;
75
- test?: RegExp | undefined;
76
75
  external?: boolean | undefined;
76
+ test?: RegExp | undefined;
77
77
  }, {
78
78
  sideEffects: boolean;
79
- test?: RegExp | undefined;
80
79
  external?: boolean | undefined;
80
+ test?: RegExp | undefined;
81
81
  }>, {
82
82
  sideEffects: boolean;
83
- test?: RegExp | undefined;
84
83
  external?: boolean | undefined;
84
+ test?: RegExp | undefined;
85
85
  }, {
86
86
  sideEffects: boolean;
87
- test?: RegExp | undefined;
88
87
  external?: boolean | undefined;
88
+ test?: RegExp | undefined;
89
89
  }>, "many">]>, z.ZodLiteral<"no-external">]>>;
90
+ annotations: z.ZodOptional<z.ZodBoolean>;
90
91
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
91
92
  moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
92
93
  test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>;
@@ -94,20 +95,21 @@ export declare const TreeshakingOptionsSchema: z.ZodUnion<[z.ZodObject<{
94
95
  sideEffects: z.ZodBoolean;
95
96
  }, "strip", z.ZodTypeAny, {
96
97
  sideEffects: boolean;
97
- test?: RegExp | undefined;
98
98
  external?: boolean | undefined;
99
+ test?: RegExp | undefined;
99
100
  }, {
100
101
  sideEffects: boolean;
101
- test?: RegExp | undefined;
102
102
  external?: boolean | undefined;
103
+ test?: RegExp | undefined;
103
104
  }>, {
104
105
  sideEffects: boolean;
105
- test?: RegExp | undefined;
106
106
  external?: boolean | undefined;
107
+ test?: RegExp | undefined;
107
108
  }, {
108
109
  sideEffects: boolean;
109
- test?: RegExp | undefined;
110
110
  external?: boolean | undefined;
111
+ test?: RegExp | undefined;
111
112
  }>, "many">]>, z.ZodLiteral<"no-external">]>>;
113
+ annotations: z.ZodOptional<z.ZodBoolean>;
112
114
  }, z.ZodTypeAny, "passthrough">>, z.ZodBoolean]>;
113
115
  export type TreeshakingOptions = z.infer<typeof TreeshakingOptionsSchema>;
@@ -42,6 +42,13 @@ export interface InputOptions {
42
42
  tsconfigFilename?: string;
43
43
  };
44
44
  cwd?: string;
45
+ /**
46
+ * Expected platform where the code run.
47
+ *
48
+ * @default
49
+ * - 'node' if the format is 'cjs'
50
+ * - 'browser' for other formats
51
+ */
45
52
  platform?: 'node' | 'browser' | 'neutral';
46
53
  shimMissingExports?: boolean;
47
54
  treeshake?: boolean | TreeshakingOptions;
@@ -53,6 +60,7 @@ export interface InputOptions {
53
60
  enableComposingJsPlugins?: boolean;
54
61
  strictExecutionOrder?: boolean;
55
62
  disableLiveBindings?: boolean;
63
+ viteMode?: boolean;
56
64
  };
57
65
  define?: Record<string, string>;
58
66
  /**
@@ -4,11 +4,21 @@ import { SourcemapIgnoreListOption, SourcemapPathTransformOption } from '../roll
4
4
  export type ModuleFormat = 'es' | 'cjs' | 'esm' | 'module' | 'commonjs' | 'iife' | 'umd';
5
5
  export type AddonFunction = (chunk: RenderedChunk) => string | Promise<string>;
6
6
  export type ChunkFileNamesFunction = (chunkInfo: PreRenderedChunk) => string;
7
+ export type GlobalsFunction = (name: string) => string;
7
8
  export interface OutputOptions {
8
9
  dir?: string;
9
10
  file?: string;
10
11
  exports?: 'auto' | 'named' | 'default' | 'none';
11
12
  hashCharacters?: 'base64' | 'base36' | 'hex';
13
+ /**
14
+ * Expected format of generated code.
15
+ * - `'es'`, `'esm'` and `'module'` are the same format, all stand for ES module.
16
+ * - `'cjs'` and `'commonjs'` are the same format, all stand for CommonJS module.
17
+ * - `'iife'` stands for [Immediately Invoked Function Expression](https://developer.mozilla.org/en-US/docs/Glossary/IIFE).
18
+ * - `'umd'` stands for [Universal Module Definition](https://github.com/umdjs/umd).
19
+ *
20
+ * @default 'esm'
21
+ */
12
22
  format?: ModuleFormat;
13
23
  sourcemap?: boolean | 'inline' | 'hidden';
14
24
  sourcemapIgnoreList?: boolean | SourcemapIgnoreListOption;
@@ -26,7 +36,7 @@ export interface OutputOptions {
26
36
  cssChunkFileNames?: string | ChunkFileNamesFunction;
27
37
  minify?: boolean;
28
38
  name?: string;
29
- globals?: Record<string, string>;
39
+ globals?: Record<string, string> | GlobalsFunction;
30
40
  externalLiveBindings?: boolean;
31
41
  inlineDynamicImports?: boolean;
32
42
  advancedChunks?: {
@@ -54,6 +64,7 @@ interface OverwriteOutputOptionsForCli {
54
64
  intro?: string;
55
65
  outro?: string;
56
66
  esModule?: boolean;
67
+ globals?: Record<string, string>;
57
68
  advancedChunks?: {
58
69
  minSize?: number;
59
70
  minShareCount?: number;
@@ -0,0 +1 @@
1
+ export declare function normalizeErrors(rawErrors: unknown[]): Error;
@@ -1,6 +1,6 @@
1
- import type { OutputOptions, OutputPlugin } from '../rollup-types';
2
- import type { InputOptions } from '../types/input-options';
3
1
  import type { RolldownPlugin } from '../plugin';
2
+ import type { InputOptions } from '../types/input-options';
3
+ import type { OutputOptions, OutputPlugin } from '../rollup-types';
4
4
  export declare const normalizePluginOption: {
5
5
  (plugins: InputOptions['plugins']): Promise<RolldownPlugin[]>;
6
6
  (plugins: OutputOptions['plugins']): Promise<OutputPlugin[]>;
@@ -5,6 +5,7 @@ export declare class Watcher {
5
5
  controller: AbortController;
6
6
  inner: BindingWatcher;
7
7
  stopWorkers?: () => Promise<void>;
8
+ listeners: Map<WatcherEvent, Array<(...parameters: any[]) => MaybePromise<void>>>;
8
9
  constructor(inner: BindingWatcher, stopWorkers?: () => Promise<void>);
9
10
  close(): Promise<void>;
10
11
  on(event: 'change', listener: (id: string, change: {
@@ -28,7 +29,5 @@ export type RollupWatcherEvent = {
28
29
  code: 'END';
29
30
  } | {
30
31
  code: 'ERROR';
31
- error: {
32
- message: string;
33
- };
32
+ error: Error;
34
33
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rolldown",
3
- "version": "0.14.0-snapshot-ab438c3-20241121003459",
3
+ "version": "0.14.0-snapshot-db4090b-20241123003628",
4
4
  "description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
5
5
  "homepage": "https://rolldown.rs/",
6
6
  "repository": {
@@ -104,22 +104,22 @@
104
104
  "vitest": "^2.0.0",
105
105
  "why-is-node-running": "^3.0.0",
106
106
  "zod-to-json-schema": "^3.23.2",
107
- "@rolldown/testing": "0.0.1",
108
- "rolldown": "0.14.0-snapshot-ab438c3-20241121003459"
107
+ "rolldown": "0.14.0-snapshot-db4090b-20241123003628",
108
+ "@rolldown/testing": "0.0.1"
109
109
  },
110
110
  "optionalDependencies": {
111
- "@rolldown/binding-darwin-arm64": "0.14.0-snapshot-ab438c3-20241121003459",
112
- "@rolldown/binding-darwin-x64": "0.14.0-snapshot-ab438c3-20241121003459",
113
- "@rolldown/binding-freebsd-x64": "0.14.0-snapshot-ab438c3-20241121003459",
114
- "@rolldown/binding-linux-arm-gnueabihf": "0.14.0-snapshot-ab438c3-20241121003459",
115
- "@rolldown/binding-linux-arm64-gnu": "0.14.0-snapshot-ab438c3-20241121003459",
116
- "@rolldown/binding-linux-arm64-musl": "0.14.0-snapshot-ab438c3-20241121003459",
117
- "@rolldown/binding-linux-x64-gnu": "0.14.0-snapshot-ab438c3-20241121003459",
118
- "@rolldown/binding-linux-x64-musl": "0.14.0-snapshot-ab438c3-20241121003459",
119
- "@rolldown/binding-wasm32-wasi": "0.14.0-snapshot-ab438c3-20241121003459",
120
- "@rolldown/binding-win32-x64-msvc": "0.14.0-snapshot-ab438c3-20241121003459",
121
- "@rolldown/binding-win32-ia32-msvc": "0.14.0-snapshot-ab438c3-20241121003459",
122
- "@rolldown/binding-win32-arm64-msvc": "0.14.0-snapshot-ab438c3-20241121003459"
111
+ "@rolldown/binding-darwin-arm64": "0.14.0-snapshot-db4090b-20241123003628",
112
+ "@rolldown/binding-darwin-x64": "0.14.0-snapshot-db4090b-20241123003628",
113
+ "@rolldown/binding-linux-arm64-gnu": "0.14.0-snapshot-db4090b-20241123003628",
114
+ "@rolldown/binding-linux-arm64-musl": "0.14.0-snapshot-db4090b-20241123003628",
115
+ "@rolldown/binding-freebsd-x64": "0.14.0-snapshot-db4090b-20241123003628",
116
+ "@rolldown/binding-linux-arm-gnueabihf": "0.14.0-snapshot-db4090b-20241123003628",
117
+ "@rolldown/binding-linux-x64-gnu": "0.14.0-snapshot-db4090b-20241123003628",
118
+ "@rolldown/binding-wasm32-wasi": "0.14.0-snapshot-db4090b-20241123003628",
119
+ "@rolldown/binding-win32-arm64-msvc": "0.14.0-snapshot-db4090b-20241123003628",
120
+ "@rolldown/binding-win32-ia32-msvc": "0.14.0-snapshot-db4090b-20241123003628",
121
+ "@rolldown/binding-win32-x64-msvc": "0.14.0-snapshot-db4090b-20241123003628",
122
+ "@rolldown/binding-linux-x64-musl": "0.14.0-snapshot-db4090b-20241123003628"
123
123
  },
124
124
  "scripts": {
125
125
  "# Scrips for binding #": "_",
@@ -1,3 +0,0 @@
1
- import type { InputOptions } from '../types/input-options';
2
- import type { NormalizedInputOptions } from '../options/normalized-input-options';
3
- export declare function normalizeInputOptions(config: InputOptions): Promise<NormalizedInputOptions>;
@@ -1,3 +0,0 @@
1
- import type { OutputOptions } from '../types/output-options';
2
- import type { NormalizedOutputOptions } from '../options/normalized-output-options';
3
- export declare function normalizeOutputOptions(opts: OutputOptions): NormalizedOutputOptions;
@@ -1,3 +0,0 @@
1
- import type { InputOptions } from '../types/input-options';
2
- import { NormalizedTreeshakingOptions } from '../treeshake';
3
- export declare function normalizeTreeshakeOptions(config: InputOptions['treeshake']): NormalizedTreeshakingOptions | undefined;