rolldown 0.14.0 → 0.15.0-commit.1265c2c

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 (103) hide show
  1. package/dist/cjs/cli.cjs +960 -966
  2. package/dist/cjs/experimental-index.cjs +68 -26
  3. package/dist/cjs/index.cjs +6 -8
  4. package/dist/cjs/parallel-plugin-worker.cjs +20 -14
  5. package/dist/cjs/parallel-plugin.cjs +1 -3
  6. package/dist/esm/cli.mjs +914 -922
  7. package/dist/esm/experimental-index.mjs +44 -7
  8. package/dist/esm/index.mjs +2 -4
  9. package/dist/esm/parallel-plugin-worker.mjs +15 -10
  10. package/dist/esm/parallel-plugin.mjs +1 -3
  11. package/dist/shared/{chunk-JoMxl5V2.cjs → chunk-BFvIen8E.cjs} +13 -11
  12. package/dist/shared/{consola.36c0034f-HcmWcfPe.cjs → consola_36c0034f-B7L-radJ.cjs} +249 -295
  13. package/dist/shared/{consola.36c0034f-Xyw7SC_7.mjs → consola_36c0034f-D9ce-831.mjs} +221 -286
  14. package/dist/shared/{prompt-9Ij3R3TG.cjs → prompt-BiXtYIJ2.cjs} +157 -204
  15. package/dist/shared/{prompt-hoPhcrA-.mjs → prompt-DlQ-08lk.mjs} +125 -174
  16. package/dist/shared/src-BtX1cCkj.mjs +2851 -0
  17. package/dist/shared/src-Di4duR8G.cjs +2985 -0
  18. package/dist/tsconfig.dts.tsbuildinfo +1 -0
  19. package/dist/types/api/build.d.ts +16 -0
  20. package/dist/types/api/experimental.d.ts +7 -0
  21. package/dist/types/api/rolldown/index.d.ts +3 -0
  22. package/dist/types/api/rolldown/rolldown-build.d.ts +12 -0
  23. package/dist/types/api/watch/index.d.ts +3 -0
  24. package/dist/types/{watcher.d.ts → api/watch/watch-emitter.d.ts} +17 -17
  25. package/dist/types/api/watch/watcher.d.ts +13 -0
  26. package/dist/types/binding.d.ts +273 -49
  27. package/dist/types/builtin-plugin/alias-plugin.d.ts +10 -0
  28. package/dist/types/builtin-plugin/constructors.d.ts +16 -0
  29. package/dist/types/builtin-plugin/replace-plugin.d.ts +28 -0
  30. package/dist/types/{options/normalized-ecma-transform-plugin-config.d.ts → builtin-plugin/transform-plugin.d.ts} +2 -1
  31. package/dist/types/builtin-plugin/utils.d.ts +8 -0
  32. package/dist/types/cli/arguments/index.d.ts +5 -3
  33. package/dist/types/cli/arguments/normalize.d.ts +2 -6
  34. package/dist/types/cli/arguments/schema.d.ts +10 -309
  35. package/dist/types/cli/colors.d.ts +11 -1
  36. package/dist/types/cli/load-config.d.ts +3 -0
  37. package/dist/types/cli/logger.d.ts +5 -0
  38. package/dist/types/constants/plugin.d.ts +10 -1
  39. package/dist/types/experimental-index.d.ts +5 -2
  40. package/dist/types/index.d.ts +13 -10
  41. package/dist/types/log/logger.d.ts +2 -16
  42. package/dist/types/log/logging.d.ts +11 -8
  43. package/dist/types/log/logs.d.ts +3 -0
  44. package/dist/types/options/input-options-schema.d.ts +4 -0
  45. package/dist/types/options/input-options.d.ts +89 -430
  46. package/dist/types/options/normalized-input-options.d.ts +17 -11
  47. package/dist/types/options/normalized-output-options.d.ts +60 -21
  48. package/dist/types/options/output-options-schema.d.ts +3 -0
  49. package/dist/types/options/output-options.d.ts +73 -265
  50. package/dist/types/options/watch-options.d.ts +5 -0
  51. package/dist/types/plugin/bindingify-build-hooks.d.ts +9 -11
  52. package/dist/types/plugin/bindingify-hook-filter.d.ts +5 -5
  53. package/dist/types/plugin/bindingify-output-hooks.d.ts +13 -16
  54. package/dist/types/plugin/bindingify-plugin.d.ts +12 -3
  55. package/dist/types/plugin/bindingify-watch-hooks.d.ts +3 -5
  56. package/dist/types/plugin/hook-filter.d.ts +1 -1
  57. package/dist/types/plugin/index.d.ts +21 -18
  58. package/dist/types/plugin/minimal-plugin-context.d.ts +15 -0
  59. package/dist/types/plugin/plugin-context-data.d.ts +4 -4
  60. package/dist/types/plugin/plugin-context.d.ts +9 -4
  61. package/dist/types/plugin/plugin-driver.d.ts +4 -5
  62. package/dist/types/plugin/transform-plugin-context.d.ts +4 -3
  63. package/dist/types/rollup-types.d.ts +1 -1
  64. package/dist/types/rollup.d.ts +4 -0
  65. package/dist/types/treeshake/index.d.ts +0 -12
  66. package/dist/types/treeshake/module-side-effects.d.ts +14 -15
  67. package/dist/types/types/rolldown-output.d.ts +17 -2
  68. package/dist/types/types/utils.d.ts +1 -0
  69. package/dist/types/utils/bindingify-input-options.d.ts +7 -0
  70. package/dist/types/utils/bindingify-output-options.d.ts +3 -0
  71. package/dist/types/utils/create-bundler-option.d.ts +11 -0
  72. package/dist/types/utils/define-config.d.ts +3 -0
  73. package/dist/types/utils/error.d.ts +2 -0
  74. package/dist/types/utils/misc.d.ts +1 -0
  75. package/dist/types/utils/normalize-hook.d.ts +1 -1
  76. package/dist/types/utils/normalize-plugin-option.d.ts +8 -3
  77. package/dist/types/{options/utils.d.ts → utils/normalize-string-or-regex.d.ts} +1 -1
  78. package/dist/types/utils/transform-rendered-chunk.d.ts +4 -0
  79. package/dist/types/utils/transform-rendered-module.d.ts +3 -0
  80. package/dist/types/utils/transform-sourcemap.d.ts +2 -0
  81. package/dist/types/utils/transform-to-rollup-output.d.ts +1 -0
  82. package/dist/types/utils/zod-ext.d.ts +6 -5
  83. package/package.json +30 -22
  84. package/dist/shared/rolldown-binding.wasi.cjs +0 -187
  85. package/dist/shared/src_index-3pqhEViJ.cjs +0 -2785
  86. package/dist/shared/src_index-ywYMd4vB.mjs +0 -2786
  87. package/dist/shared/wasi-worker-browser.mjs +0 -39
  88. package/dist/shared/wasi-worker.mjs +0 -63
  89. package/dist/shared/watcher-worker.js +0 -1
  90. package/dist/types/cli/utils.d.ts +0 -6
  91. package/dist/types/constants/types.d.ts +0 -1
  92. package/dist/types/options/bindingify-input-options.d.ts +0 -4
  93. package/dist/types/options/bindingify-output-options.d.ts +0 -3
  94. package/dist/types/options/normalized-alias-plugin-config.d.ts +0 -8
  95. package/dist/types/options/watch-option.d.ts +0 -5
  96. package/dist/types/plugin/builtin-plugin.d.ts +0 -81
  97. package/dist/types/rolldown-build.d.ts +0 -10
  98. package/dist/types/rolldown.d.ts +0 -12
  99. package/dist/types/types/rendered-module.d.ts +0 -2
  100. package/dist/types/utils/normalize-input-options.d.ts +0 -3
  101. package/dist/types/utils/normalize-output-options.d.ts +0 -3
  102. package/dist/types/utils/normalize-tree-shake.d.ts +0 -3
  103. /package/dist/types/{utils/type-assert.d.ts → types/assert.d.ts} +0 -0
@@ -1,311 +1,12 @@
1
+ import { InputCliOptions } from '../../options/input-options';
2
+ import { OutputCliOptions } from '../../options/output-options';
1
3
  import type { ObjectSchema } from './types';
2
- import { z } from 'zod';
3
- export declare const cliOptionsSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
4
- config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
5
- help: z.ZodOptional<z.ZodBoolean>;
6
- version: z.ZodOptional<z.ZodBoolean>;
7
- watch: z.ZodOptional<z.ZodBoolean>;
8
- }, Omit<z.objectUtil.extendShape<{
9
- input: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodRecord<z.ZodString, z.ZodString>]>>;
10
- plugins: z.ZodOptional<z.ZodArray<z.ZodType<import("../../plugin").RolldownPluginRec, z.ZodTypeDef, import("../../plugin").RolldownPluginRec>, "many">>;
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
- resolve: z.ZodOptional<z.ZodObject<{
13
- alias: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
14
- aliasFields: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString, "many">, "many">>;
15
- conditionNames: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
16
- extensionAlias: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
17
- exportsFields: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString, "many">, "many">>;
18
- extensions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
19
- mainFields: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
20
- mainFiles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
21
- modules: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
22
- symlinks: z.ZodOptional<z.ZodBoolean>;
23
- tsconfigFilename: z.ZodOptional<z.ZodString>;
24
- }, "strict", z.ZodTypeAny, {
25
- alias?: Record<string, string> | undefined;
26
- aliasFields?: string[][] | undefined;
27
- conditionNames?: string[] | undefined;
28
- extensionAlias?: Record<string, string[]> | undefined;
29
- exportsFields?: string[][] | undefined;
30
- extensions?: string[] | undefined;
31
- mainFields?: string[] | undefined;
32
- mainFiles?: string[] | undefined;
33
- modules?: string[] | undefined;
34
- symlinks?: boolean | undefined;
35
- tsconfigFilename?: string | undefined;
36
- }, {
37
- alias?: Record<string, string> | undefined;
38
- aliasFields?: string[][] | undefined;
39
- conditionNames?: string[] | undefined;
40
- extensionAlias?: Record<string, string[]> | undefined;
41
- exportsFields?: string[][] | undefined;
42
- extensions?: string[] | undefined;
43
- mainFields?: string[] | undefined;
44
- mainFiles?: string[] | undefined;
45
- modules?: string[] | undefined;
46
- symlinks?: boolean | undefined;
47
- tsconfigFilename?: string | undefined;
48
- }>>;
49
- cwd: z.ZodOptional<z.ZodString>;
50
- platform: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"node">, z.ZodLiteral<"browser">]>, z.ZodLiteral<"neutral">]>>;
51
- shimMissingExports: z.ZodOptional<z.ZodBoolean>;
52
- treeshake: z.ZodOptional<z.ZodType<boolean | import("../../treeshake").TreeshakingOptions, z.ZodTypeDef, boolean | import("../../treeshake").TreeshakingOptions>>;
53
- logLevel: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodLiteral<"silent">]>>;
54
- onLog: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodAny, z.ZodFunction<z.ZodTuple<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodLiteral<"error">]>, z.ZodUnion<[z.ZodAny, z.ZodString]>], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>>;
55
- onwarn: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodAny, z.ZodFunction<z.ZodTuple<[z.ZodUnion<[z.ZodUnion<[z.ZodAny, z.ZodString]>, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnion<[z.ZodAny, z.ZodString]>>]>], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>>;
56
- moduleTypes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"js">, z.ZodLiteral<"jsx">]>, z.ZodLiteral<"ts">]>, z.ZodLiteral<"tsx">]>, z.ZodLiteral<"json">]>, z.ZodLiteral<"text">]>, z.ZodLiteral<"base64">]>, z.ZodLiteral<"dataurl">]>, z.ZodLiteral<"binary">]>, z.ZodLiteral<"empty">]>, z.ZodLiteral<"css">]>>>;
57
- experimental: z.ZodOptional<z.ZodObject<{
58
- enableComposingJsPlugins: z.ZodOptional<z.ZodBoolean>;
59
- strictExecutionOrder: z.ZodOptional<z.ZodBoolean>;
60
- disableLiveBindings: z.ZodOptional<z.ZodBoolean>;
61
- }, "strict", z.ZodTypeAny, {
62
- enableComposingJsPlugins?: boolean | undefined;
63
- strictExecutionOrder?: boolean | undefined;
64
- disableLiveBindings?: boolean | undefined;
65
- }, {
66
- enableComposingJsPlugins?: boolean | undefined;
67
- strictExecutionOrder?: boolean | undefined;
68
- disableLiveBindings?: boolean | undefined;
69
- }>>;
70
- define: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
71
- inject: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodString], null>]>>>;
72
- profilerNames: z.ZodOptional<z.ZodBoolean>;
73
- jsx: z.ZodOptional<z.ZodObject<{
74
- mode: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"classic">, z.ZodLiteral<"automatic">]>>;
75
- factory: z.ZodOptional<z.ZodString>;
76
- fragment: z.ZodOptional<z.ZodString>;
77
- importSource: z.ZodOptional<z.ZodString>;
78
- jsxImportSource: z.ZodOptional<z.ZodString>;
79
- refresh: z.ZodOptional<z.ZodBoolean>;
80
- development: z.ZodOptional<z.ZodBoolean>;
81
- }, "strict", z.ZodTypeAny, {
82
- mode?: "classic" | "automatic" | undefined;
83
- factory?: string | undefined;
84
- fragment?: string | undefined;
85
- importSource?: string | undefined;
86
- jsxImportSource?: string | undefined;
87
- refresh?: boolean | undefined;
88
- development?: boolean | undefined;
89
- }, {
90
- mode?: "classic" | "automatic" | undefined;
91
- factory?: string | undefined;
92
- fragment?: string | undefined;
93
- importSource?: string | undefined;
94
- jsxImportSource?: string | undefined;
95
- refresh?: boolean | undefined;
96
- development?: boolean | undefined;
97
- }>>;
98
- watch: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
99
- skipWrite: z.ZodOptional<z.ZodBoolean>;
100
- notify: z.ZodOptional<z.ZodObject<{
101
- pollInterval: z.ZodOptional<z.ZodNumber>;
102
- compareContents: z.ZodOptional<z.ZodBoolean>;
103
- }, "strict", z.ZodTypeAny, {
104
- pollInterval?: number | undefined;
105
- compareContents?: boolean | undefined;
106
- }, {
107
- pollInterval?: number | undefined;
108
- compareContents?: boolean | undefined;
109
- }>>;
110
- include: z.ZodOptional<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">]>>;
111
- exclude: z.ZodOptional<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">]>>;
112
- chokidar: z.ZodOptional<z.ZodAny>;
113
- }, "strict", z.ZodTypeAny, {
114
- skipWrite?: boolean | undefined;
115
- notify?: {
116
- pollInterval?: number | undefined;
117
- compareContents?: boolean | undefined;
118
- } | undefined;
119
- include?: string | RegExp | (string | RegExp)[] | undefined;
120
- exclude?: string | RegExp | (string | RegExp)[] | undefined;
121
- chokidar?: any;
122
- }, {
123
- skipWrite?: boolean | undefined;
124
- notify?: {
125
- pollInterval?: number | undefined;
126
- compareContents?: boolean | undefined;
127
- } | undefined;
128
- include?: string | RegExp | (string | RegExp)[] | undefined;
129
- exclude?: string | RegExp | (string | RegExp)[] | undefined;
130
- chokidar?: any;
131
- }>, z.ZodLiteral<false>]>>;
132
- }, {
133
- external: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
134
- inject: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
135
- treeshake: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
136
- }>, "input" | "plugins" | "resolve" | "onLog" | "onwarn" | "experimental" | "profilerNames" | "watch">>, Omit<z.objectUtil.extendShape<{
137
- dir: z.ZodOptional<z.ZodString>;
138
- file: z.ZodOptional<z.ZodString>;
139
- exports: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodLiteral<"named">]>, z.ZodLiteral<"default">]>, z.ZodLiteral<"none">]>>;
140
- format: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"es">, z.ZodLiteral<"cjs">]>, z.ZodLiteral<"esm">]>, z.ZodLiteral<"module">]>, z.ZodLiteral<"commonjs">]>, z.ZodLiteral<"iife">]>, z.ZodLiteral<"umd">]>>;
141
- sourcemap: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodLiteral<"inline">]>, z.ZodLiteral<"hidden">]>>;
142
- sourcemapIgnoreList: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodType<import("../../options/output-options").SourcemapIgnoreListOption, z.ZodTypeDef, import("../../options/output-options").SourcemapIgnoreListOption>]>>;
143
- sourcemapPathTransform: z.ZodOptional<z.ZodType<import("../../options/output-options").SourcemapPathTransformOption, z.ZodTypeDef, import("../../options/output-options").SourcemapPathTransformOption>>;
144
- banner: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<import("../..").RenderedChunk, z.ZodTypeDef, import("../..").RenderedChunk>], z.ZodUnknown>, z.ZodUnion<[z.ZodString, z.ZodPromise<z.ZodString>]>>]>>;
145
- footer: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<import("../..").RenderedChunk, z.ZodTypeDef, import("../..").RenderedChunk>], z.ZodUnknown>, z.ZodUnion<[z.ZodString, z.ZodPromise<z.ZodString>]>>]>>;
146
- intro: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<import("../..").RenderedChunk, z.ZodTypeDef, import("../..").RenderedChunk>], z.ZodUnknown>, z.ZodUnion<[z.ZodString, z.ZodPromise<z.ZodString>]>>]>>;
147
- outro: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<import("../..").RenderedChunk, z.ZodTypeDef, import("../..").RenderedChunk>], z.ZodUnknown>, z.ZodUnion<[z.ZodString, z.ZodPromise<z.ZodString>]>>]>>;
148
- extend: z.ZodOptional<z.ZodBoolean>;
149
- esModule: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"if-default-prop">, z.ZodBoolean]>>;
150
- entryFileNames: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<import("../..").PreRenderedChunk, z.ZodTypeDef, import("../..").PreRenderedChunk>], z.ZodUnknown>, z.ZodString>]>>;
151
- chunkFileNames: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<import("../..").PreRenderedChunk, z.ZodTypeDef, import("../..").PreRenderedChunk>], z.ZodUnknown>, z.ZodString>]>>;
152
- assetFileNames: z.ZodOptional<z.ZodString>;
153
- minify: z.ZodOptional<z.ZodBoolean>;
154
- name: z.ZodOptional<z.ZodString>;
155
- globals: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
156
- externalLiveBindings: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
157
- inlineDynamicImports: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
158
- advancedChunks: z.ZodOptional<z.ZodObject<{
159
- minSize: z.ZodOptional<z.ZodNumber>;
160
- minShareCount: z.ZodOptional<z.ZodNumber>;
161
- groups: z.ZodOptional<z.ZodArray<z.ZodObject<{
162
- name: z.ZodString;
163
- test: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>>;
164
- priority: z.ZodOptional<z.ZodNumber>;
165
- minSize: z.ZodOptional<z.ZodNumber>;
166
- minShareCount: z.ZodOptional<z.ZodNumber>;
167
- }, "strict", z.ZodTypeAny, {
168
- name: string;
169
- minSize?: number | undefined;
170
- minShareCount?: number | undefined;
171
- test?: string | RegExp | undefined;
172
- priority?: number | undefined;
173
- }, {
174
- name: string;
175
- minSize?: number | undefined;
176
- minShareCount?: number | undefined;
177
- test?: string | RegExp | undefined;
178
- priority?: number | undefined;
179
- }>, "many">>;
180
- }, "strict", z.ZodTypeAny, {
181
- minSize?: number | undefined;
182
- minShareCount?: number | undefined;
183
- groups?: {
184
- name: string;
185
- minSize?: number | undefined;
186
- minShareCount?: number | undefined;
187
- test?: string | RegExp | undefined;
188
- priority?: number | undefined;
189
- }[] | undefined;
190
- }, {
191
- minSize?: number | undefined;
192
- minShareCount?: number | undefined;
193
- groups?: {
194
- name: string;
195
- minSize?: number | undefined;
196
- minShareCount?: number | undefined;
197
- test?: string | RegExp | undefined;
198
- priority?: number | undefined;
199
- }[] | undefined;
200
- }>>;
201
- }, {
202
- banner: z.ZodOptional<z.ZodString>;
203
- footer: z.ZodOptional<z.ZodString>;
204
- intro: z.ZodOptional<z.ZodString>;
205
- outro: z.ZodOptional<z.ZodString>;
206
- esModule: z.ZodOptional<z.ZodBoolean>;
207
- advancedChunks: z.ZodOptional<z.ZodObject<{
208
- minSize: z.ZodOptional<z.ZodNumber>;
209
- minShareCount: z.ZodOptional<z.ZodNumber>;
210
- }, "strict", z.ZodTypeAny, {
211
- minSize?: number | undefined;
212
- minShareCount?: number | undefined;
213
- }, {
214
- minSize?: number | undefined;
215
- minShareCount?: number | undefined;
216
- }>>;
217
- }>, "sourcemapIgnoreList" | "sourcemapPathTransform">>, "strict", z.ZodTypeAny, {
218
- external?: string[] | undefined;
219
- cwd?: string | undefined;
220
- platform?: "node" | "browser" | "neutral" | undefined;
221
- shimMissingExports?: boolean | undefined;
222
- treeshake?: boolean | undefined;
223
- logLevel?: "info" | "debug" | "warn" | "silent" | undefined;
224
- jsx?: {
225
- mode?: "classic" | "automatic" | undefined;
226
- factory?: string | undefined;
227
- fragment?: string | undefined;
228
- importSource?: string | undefined;
229
- jsxImportSource?: string | undefined;
230
- refresh?: boolean | undefined;
231
- development?: boolean | undefined;
232
- } | undefined;
233
- moduleTypes?: Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty" | "css"> | undefined;
234
- define?: Record<string, string> | undefined;
235
- inject?: Record<string, string> | undefined;
236
- watch?: boolean | undefined;
237
- footer?: string | undefined;
238
- banner?: string | undefined;
239
- intro?: string | undefined;
240
- outro?: string | undefined;
241
- file?: string | undefined;
242
- name?: string | undefined;
243
- exports?: "auto" | "named" | "default" | "none" | undefined;
244
- dir?: string | undefined;
245
- format?: "es" | "cjs" | "esm" | "module" | "commonjs" | "iife" | "umd" | undefined;
246
- sourcemap?: boolean | "inline" | "hidden" | undefined;
247
- extend?: boolean | undefined;
248
- esModule?: boolean | undefined;
249
- entryFileNames?: string | ((args_0: import("../..").PreRenderedChunk, ...args: unknown[]) => string) | undefined;
250
- chunkFileNames?: string | ((args_0: import("../..").PreRenderedChunk, ...args: unknown[]) => string) | undefined;
251
- assetFileNames?: string | undefined;
252
- minify?: boolean | undefined;
253
- globals?: Record<string, string> | undefined;
254
- externalLiveBindings?: boolean | undefined;
255
- inlineDynamicImports?: boolean | undefined;
256
- advancedChunks?: {
257
- minSize?: number | undefined;
258
- minShareCount?: number | undefined;
259
- } | undefined;
260
- version?: boolean | undefined;
261
- config?: string | boolean | undefined;
262
- help?: boolean | undefined;
263
- }, {
264
- external?: string[] | undefined;
265
- cwd?: string | undefined;
266
- platform?: "node" | "browser" | "neutral" | undefined;
267
- shimMissingExports?: boolean | undefined;
268
- treeshake?: boolean | undefined;
269
- logLevel?: "info" | "debug" | "warn" | "silent" | undefined;
270
- jsx?: {
271
- mode?: "classic" | "automatic" | undefined;
272
- factory?: string | undefined;
273
- fragment?: string | undefined;
274
- importSource?: string | undefined;
275
- jsxImportSource?: string | undefined;
276
- refresh?: boolean | undefined;
277
- development?: boolean | undefined;
278
- } | undefined;
279
- moduleTypes?: Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty" | "css"> | undefined;
280
- define?: Record<string, string> | undefined;
281
- inject?: Record<string, string> | undefined;
282
- watch?: boolean | undefined;
283
- footer?: string | undefined;
284
- banner?: string | undefined;
285
- intro?: string | undefined;
286
- outro?: string | undefined;
287
- file?: string | undefined;
288
- name?: string | undefined;
289
- exports?: "auto" | "named" | "default" | "none" | undefined;
290
- dir?: string | undefined;
291
- format?: "es" | "cjs" | "esm" | "module" | "commonjs" | "iife" | "umd" | undefined;
292
- sourcemap?: boolean | "inline" | "hidden" | undefined;
293
- extend?: boolean | undefined;
294
- esModule?: boolean | undefined;
295
- entryFileNames?: string | ((args_0: import("../..").PreRenderedChunk, ...args: unknown[]) => string) | undefined;
296
- chunkFileNames?: string | ((args_0: import("../..").PreRenderedChunk, ...args: unknown[]) => string) | undefined;
297
- assetFileNames?: string | undefined;
298
- minify?: boolean | undefined;
299
- globals?: Record<string, string> | undefined;
300
- externalLiveBindings?: boolean | undefined;
301
- inlineDynamicImports?: boolean | undefined;
302
- advancedChunks?: {
303
- minSize?: number | undefined;
304
- minShareCount?: number | undefined;
305
- } | undefined;
306
- version?: boolean | undefined;
307
- config?: string | boolean | undefined;
308
- help?: boolean | undefined;
309
- }>;
310
- export type CliOptions = z.infer<typeof cliOptionsSchema>;
4
+ import type Z from 'zod';
5
+ export interface CliOptions extends InputCliOptions, OutputCliOptions {
6
+ config?: string | boolean;
7
+ help?: boolean;
8
+ version?: boolean;
9
+ watch?: boolean;
10
+ }
11
+ export declare const cliOptionsSchema: Z.ZodType<CliOptions>;
311
12
  export declare const schema: ObjectSchema;
@@ -1 +1,11 @@
1
- export declare const bold: import("colorette").Color, cyan: import("colorette").Color, dim: import("colorette").Color, gray: import("colorette").Color, green: import("colorette").Color, red: import("colorette").Color, underline: import("colorette").Color, yellow: import("colorette").Color;
1
+ import { Color } from 'colorette';
2
+ export declare const colors: {
3
+ bold: Color;
4
+ cyan: Color;
5
+ dim: Color;
6
+ gray: Color;
7
+ green: Color;
8
+ red: Color;
9
+ underline: Color;
10
+ yellow: Color;
11
+ };
@@ -0,0 +1,3 @@
1
+ import { ConfigExport } from '../types/config-export';
2
+ export declare function loadTsConfig(configFile: string): Promise<ConfigExport>;
3
+ export declare function loadConfig(configPath: string): Promise<ConfigExport>;
@@ -0,0 +1,5 @@
1
+ import { type ConsolaInstance } from 'consola';
2
+ /**
3
+ * Console logger
4
+ */
5
+ export declare const logger: Record<string, any> | ConsolaInstance;
@@ -1,5 +1,14 @@
1
1
  import { Plugin } from '../plugin';
2
- export declare const ENUMERATED_PLUGIN_HOOK_NAMES: readonly ["options", "buildStart", "resolveId", "load", "transform", "moduleParsed", "augmentChunkHash", "buildEnd", "onLog", "resolveDynamicImport", "generateBundle", "outputOptions", "renderChunk", "renderStart", "renderError", "writeBundle", "footer", "banner", "intro", "outro", "closeBundle", "watchChange", "closeWatcher"];
2
+ export declare const ENUMERATED_INPUT_PLUGIN_HOOK_NAMES: readonly ["options", "buildStart", "resolveId", "load", "transform", "moduleParsed", "buildEnd", "onLog", "resolveDynamicImport", "closeBundle", "closeWatcher", "watchChange"];
3
+ export declare const ENUMERATED_OUTPUT_PLUGIN_HOOK_NAMES: readonly ["augmentChunkHash", "outputOptions", "renderChunk", "renderStart", "renderError", "writeBundle", "generateBundle"];
4
+ export declare const ENUMERATED_PLUGIN_HOOK_NAMES: [
5
+ ...typeof ENUMERATED_INPUT_PLUGIN_HOOK_NAMES,
6
+ ...typeof ENUMERATED_OUTPUT_PLUGIN_HOOK_NAMES,
7
+ 'footer',
8
+ 'banner',
9
+ 'intro',
10
+ 'outro'
11
+ ];
3
12
  /**
4
13
  * Names of all properties in a `Plugin` object. Includes `name` and `api`.
5
14
  */
@@ -1,6 +1,9 @@
1
1
  export { defineParallelPlugin } from './plugin/parallel-plugin';
2
- export { experimental_scan as scan } from './rolldown';
2
+ export { experimental_scan as scan } from './api/experimental';
3
3
  export { transform } from './binding';
4
4
  export type { TransformOptions, TransformResult } from './binding';
5
5
  export { composeJsPlugins as composePlugins } from './utils/compose-js-plugins';
6
- export { modulePreloadPolyfillPlugin, dynamicImportVarsPlugin, wasmHelperPlugin, wasmFallbackPlugin, importGlobPlugin, manifestPlugin, loadFallbackPlugin, transformPlugin, aliasPlugin, jsonPlugin, buildImportAnalysisPlugin, replacePlugin, } from './plugin/builtin-plugin';
6
+ export { modulePreloadPolyfillPlugin, dynamicImportVarsPlugin, wasmHelperPlugin, wasmFallbackPlugin, importGlobPlugin, manifestPlugin, loadFallbackPlugin, jsonPlugin, buildImportAnalysisPlugin, viteResolvePlugin, } from './builtin-plugin/constructors';
7
+ export { transformPlugin } from './builtin-plugin/transform-plugin';
8
+ export { replacePlugin } from './builtin-plugin/replace-plugin';
9
+ export { aliasPlugin } from './builtin-plugin/alias-plugin';
@@ -1,26 +1,29 @@
1
- import { RolldownOutput, RolldownOutputAsset, RolldownOutputChunk, SourceMap } from './types/rolldown-output';
2
- import type { ExternalOption, InputOption, InputOptions, JsxOptions } from './options/input-options';
1
+ import { RolldownOutput, RolldownOutputAsset, RolldownOutputChunk, RolldownRenderedChunk, SourceMap } from './types/rolldown-output';
2
+ import type { InputOptions, InputOption, ExternalOption, JsxOptions } from './options/input-options';
3
3
  import type { ModuleFormat, OutputOptions } from './options/output-options';
4
4
  import type { RolldownOptions } from './types/rolldown-options';
5
5
  import type { AsyncPluginHooks, CustomPluginOptions, FunctionPluginHooks, ImportKind, LoadResult, ModuleOptions, ModuleType, ObjectHook, ParallelPluginHooks, PartialResolvedId, Plugin, RolldownPlugin, ResolveIdResult, ResolvedId, SourceDescription, TransformResult } from './plugin';
6
6
  import { DefineParallelPluginResult } from './plugin/parallel-plugin';
7
7
  import { defineConfig } from './utils/define-config';
8
- import { rolldown, watch } from './rolldown';
8
+ import { rolldown } from './api/rolldown';
9
+ import { watch } from './api/watch';
9
10
  import { ConfigExport } from './types/config-export';
10
- import { RolldownBuild } from './rolldown-build';
11
+ import { RolldownBuild } from './api/rolldown/rolldown-build';
11
12
  import { EmittedAsset, EmittedFile, PluginContext } from './plugin/plugin-context';
12
13
  import { TransformPluginContext } from './plugin/transform-plugin-context';
13
14
  import { InternalModuleFormat, NormalizedOutputOptions } from './options/normalized-output-options';
14
- import { RenderedChunk, PreRenderedChunk } from './binding';
15
+ import { PreRenderedChunk } from './binding';
15
16
  import { PartialNull } from './types/utils';
16
17
  import { NormalizedInputOptions } from './options/normalized-input-options';
17
18
  import { ModuleInfo } from './types/module-info';
18
- import { MinimalPluginContext } from './log/logger';
19
+ import { MinimalPluginContext } from './plugin/minimal-plugin-context';
19
20
  import { ExistingRawSourceMap, SourceMapInput } from './types/sourcemap';
20
21
  import { OutputBundle } from './types/output-bundle';
21
- import { WatchOptions } from './options/watch-option';
22
- export { defineConfig, rolldown, watch };
22
+ import { WatchOptions } from './options/watch-options';
23
+ import { RolldownWatcher } from './api/watch/watch-emitter';
24
+ import { build, type BuildOptions } from './api/build';
25
+ export { defineConfig, rolldown, watch, build };
23
26
  export declare const VERSION: string;
24
- export type { RolldownOutputAsset, RolldownOutputChunk, RolldownOptions, RolldownOutput, RolldownBuild, InputOptions, NormalizedInputOptions, OutputOptions, NormalizedOutputOptions, Plugin, RolldownPlugin, DefineParallelPluginResult, ConfigExport, ImportKind, InputOption, ExternalOption, ModuleFormat, ModuleType, InternalModuleFormat, LoadResult, TransformResult, ResolveIdResult, PluginContext, TransformPluginContext, ObjectHook, RenderedChunk, PreRenderedChunk, SourceMap, SourceDescription, PartialNull, PartialResolvedId, ResolvedId, ModuleOptions, ModuleInfo, MinimalPluginContext, EmittedFile, EmittedAsset, CustomPluginOptions, AsyncPluginHooks, ParallelPluginHooks, FunctionPluginHooks, ExistingRawSourceMap, SourceMapInput, OutputBundle, JsxOptions, WatchOptions, };
25
- export type { RolldownOutput as RollupOutput, RolldownOptions as RollupOptions, RolldownBuild as RollupBuild, RolldownOutputChunk as OutputChunk, RolldownOutputAsset as OutputAsset, };
27
+ export type { RolldownOutputAsset, RolldownOutputChunk, RolldownOptions, RolldownOutput, RolldownBuild, InputOptions, NormalizedInputOptions, OutputOptions, NormalizedOutputOptions, Plugin, RolldownPlugin, DefineParallelPluginResult, ConfigExport, ImportKind, InputOption, ExternalOption, ModuleFormat, ModuleType, InternalModuleFormat, LoadResult, TransformResult, ResolveIdResult, PluginContext, TransformPluginContext, ObjectHook, PreRenderedChunk, SourceMap, SourceDescription, PartialNull, PartialResolvedId, ResolvedId, ModuleOptions, ModuleInfo, MinimalPluginContext, EmittedFile, EmittedAsset, CustomPluginOptions, AsyncPluginHooks, ParallelPluginHooks, FunctionPluginHooks, ExistingRawSourceMap, SourceMapInput, OutputBundle, JsxOptions, WatchOptions, RolldownWatcher, BuildOptions, };
28
+ export type { RolldownOutput as RollupOutput, RolldownOptions as RollupOptions, RolldownBuild as RollupBuild, RolldownOutputChunk as OutputChunk, RolldownOutputAsset as OutputAsset, RolldownRenderedChunk as RenderedChunk, RolldownWatcher as RollupWatcher, };
26
29
  export type { RollupError, RollupLog, LoggingFunction } from './rollup';
@@ -1,20 +1,6 @@
1
- import type { LoggingFunction, LogHandler, RollupError } from '../rollup';
1
+ import type { LogHandler } from '../rollup';
2
2
  import type { Plugin } from '../plugin';
3
3
  import { type LogLevelOption } from './logging';
4
4
  import type { InputOptions } from '../options/input-options';
5
- import type { NormalizedInputOptions } from '../options/normalized-input-options';
6
- export interface PluginContextMeta {
7
- rollupVersion: string;
8
- rolldownVersion: string;
9
- watchMode: boolean;
10
- }
11
- export declare class MinimalPluginContext {
12
- debug: LoggingFunction;
13
- info: LoggingFunction;
14
- meta: PluginContextMeta;
15
- warn: LoggingFunction;
16
- readonly error: (error: RollupError | string) => never;
17
- constructor(options: NormalizedInputOptions, plugin: Plugin);
18
- }
19
5
  export declare function getLogger(plugins: Plugin[], onLog: LogHandler, logLevel: LogLevelOption): LogHandler;
20
- export declare const getOnLog: (config: InputOptions, logLevel: LogLevelOption, printLog?: LogHandler) => NormalizedInputOptions["onLog"];
6
+ export declare const getOnLog: (config: InputOptions, logLevel: LogLevelOption, printLog?: LogHandler) => LogHandler;
@@ -1,14 +1,17 @@
1
- import { z } from 'zod';
2
- export declare const LogLevelSchema: z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>;
3
- export declare const LogLevelWithErrorSchema: z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodLiteral<"error">]>;
4
- export type LogLevel = z.infer<typeof LogLevelSchema>;
5
- export declare const LogLevelOptionSchema: z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodLiteral<"silent">]>;
6
- export type LogLevelOption = z.infer<typeof LogLevelOptionSchema>;
1
+ import type Z from 'zod';
2
+ export type LogLevel = 'info' | 'debug' | 'warn';
3
+ export type LogLevelOption = LogLevel | 'silent';
4
+ export type LogLevelWithError = LogLevel | 'error';
5
+ export type RollupLog = any;
6
+ export type RollupLogWithString = RollupLog | string;
7
+ export declare const LogLevelSchema: Z.ZodType<LogLevel>;
8
+ export declare const LogLevelOptionSchema: Z.ZodType<LogLevelOption>;
9
+ export declare const LogLevelWithErrorSchema: Z.ZodType<LogLevelWithError>;
7
10
  export declare const LOG_LEVEL_SILENT: LogLevelOption;
8
11
  export declare const LOG_LEVEL_ERROR = "error";
9
12
  export declare const LOG_LEVEL_WARN: LogLevel;
10
13
  export declare const LOG_LEVEL_INFO: LogLevel;
11
14
  export declare const LOG_LEVEL_DEBUG: LogLevel;
12
15
  export declare const logLevelPriority: Record<LogLevelOption, number>;
13
- export declare const RollupLogSchema: z.ZodAny;
14
- export declare const RollupLogWithStringSchema: z.ZodUnion<[z.ZodAny, z.ZodString]>;
16
+ export declare const RollupLogSchema: Z.ZodAny;
17
+ export declare const RollupLogWithStringSchema: Z.ZodUnion<[Z.ZodAny, Z.ZodString]>;
@@ -1,5 +1,8 @@
1
1
  import type { RollupLog } from '../rollup';
2
2
  export declare function logInvalidLogPosition(pluginName: string): RollupLog;
3
+ export declare function logInputHookInOutputPlugin(pluginName: string, hookName: string): RollupLog;
4
+ export declare function logCycleLoading(pluginName: string, moduleId: string): RollupLog;
5
+ export declare function logMultiplyNotifyOption(): RollupLog;
3
6
  export declare function logPluginError(error: Omit<RollupLog, 'code'> & {
4
7
  code?: unknown;
5
8
  }, plugin: string, { hook, id }?: {
@@ -0,0 +1,4 @@
1
+ import { z } from 'zod';
2
+ import type { InputCliOptions, InputOptions } from '../options/input-options';
3
+ export declare const inputOptionsSchema: z.ZodType<InputOptions>;
4
+ export declare const inputCliOptionsSchema: z.ZodType<InputCliOptions>;