rolldown 0.12.2 → 0.13.0
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 +1552 -584
- package/dist/cjs/experimental-index.cjs +40 -0
- package/dist/cjs/index.cjs +5 -22
- package/dist/cjs/parallel-plugin-worker.cjs +7 -7
- package/dist/cjs/parallel-plugin.cjs +1 -1
- package/dist/esm/cli.mjs +1549 -583
- package/dist/esm/experimental-index.mjs +23 -0
- package/dist/esm/index.mjs +5 -17
- package/dist/esm/parallel-plugin-worker.mjs +6 -6
- package/dist/esm/parallel-plugin.mjs +1 -1
- package/dist/shared/{chunk-1xb6WR3y.cjs → chunk-gQ4GMlVi.cjs} +3 -2
- package/dist/shared/{consola.36c0034f-N8xiTrv3.cjs → consola.36c0034f-eps_ogJv.cjs} +188 -188
- package/dist/shared/{consola.36c0034f-jtHhMkSX.mjs → consola.36c0034f-m5cABVv4.mjs} +187 -187
- package/dist/shared/package-3VR4tEG7.mjs +9 -0
- package/dist/shared/package-OJCNSbf0.cjs +11 -0
- package/dist/shared/plugin-context-data-dIOrw9yH.cjs +1436 -0
- package/dist/shared/plugin-context-data-nhjzqlNd.mjs +1444 -0
- package/dist/shared/{prompt-pjyLzLci.mjs → prompt-9VjtYvi_.mjs} +182 -182
- package/dist/shared/{prompt-1K6oCkIU.cjs → prompt-Ah5G71p-.cjs} +183 -183
- package/dist/shared/rolldown-KvxnG5lF.mjs +1107 -0
- package/dist/shared/rolldown-PHdfa5m8.cjs +1123 -0
- package/dist/shared/rolldown-binding.wasi.cjs +70 -51
- package/dist/types/binding.d.ts +329 -14
- package/dist/types/cli/arguments/alias.d.ts +8 -0
- package/dist/types/cli/arguments/index.d.ts +13 -0
- package/dist/types/cli/arguments/normalize.d.ts +15 -0
- package/dist/types/cli/arguments/schema.d.ts +161 -0
- package/dist/types/cli/arguments/utils.d.ts +6 -0
- package/dist/types/cli/commands/bundle.d.ts +3 -1
- package/dist/types/cli/commands/help.d.ts +1 -0
- package/dist/types/cli/utils.d.ts +1 -1
- package/dist/types/constants/plugin-context.d.ts +7 -0
- package/dist/types/constants/plugin.d.ts +36 -0
- package/dist/types/experimental-index.d.ts +5 -0
- package/dist/types/index.d.ts +8 -8
- package/dist/types/options/input-options.d.ts +139 -27
- package/dist/types/options/normalized-alias-plugin-config.d.ts +10 -0
- package/dist/types/options/normalized-ecma-transform-plugin-config.d.ts +8 -0
- package/dist/types/options/normalized-output-options.d.ts +8 -3
- package/dist/types/options/output-options.d.ts +102 -11
- package/dist/types/options/utils.d.ts +2 -0
- package/dist/types/plugin/bindingify-build-hooks.d.ts +9 -8
- package/dist/types/plugin/bindingify-hook-filter.d.ts +5 -0
- package/dist/types/plugin/bindingify-output-hooks.d.ts +11 -7
- package/dist/types/plugin/bindingify-plugin-hook-meta.d.ts +8 -0
- package/dist/types/plugin/bindingify-plugin.d.ts +2 -1
- package/dist/types/plugin/builtin-plugin.d.ts +75 -7
- package/dist/types/plugin/index.d.ts +68 -28
- package/dist/types/plugin/plugin-context-data.d.ts +6 -0
- package/dist/types/plugin/plugin-context.d.ts +18 -8
- package/dist/types/plugin/plugin-driver.d.ts +2 -2
- package/dist/types/rollup.d.ts +1 -0
- package/dist/types/types/rolldown-output.d.ts +1 -0
- package/dist/types/utils/compose-js-plugins.d.ts +2 -0
- package/dist/types/utils/misc.d.ts +1 -0
- package/dist/types/utils/normalize-hook.d.ts +7 -5
- package/dist/types/utils/plugin/index.d.ts +2 -0
- package/dist/types/utils/type-assert.d.ts +1 -0
- package/package.json +30 -22
- package/dist/shared/rolldown-SCF5NBN_.cjs +0 -49
- package/dist/shared/rolldown-kYz4BvAA.mjs +0 -48
- package/dist/shared/utils_index-_DFpKlu1.mjs +0 -1582
- package/dist/shared/utils_index-xb2NoRNm.cjs +0 -1557
- package/dist/types/cli/constants.d.ts +0 -1
- package/dist/types/utils/ensure-array.d.ts +0 -1
- package/dist/types/utils/index.d.ts +0 -9
- /package/dist/types/plugin/{transfrom-plugin-context.d.ts → transform-plugin-context.d.ts} +0 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description This file is used for normalize the options.
|
|
3
|
+
* In CLI, the input options and output options are mixed together. We need to tell them apart.
|
|
4
|
+
*/
|
|
5
|
+
import { InputOptions } from '../../options/input-options';
|
|
6
|
+
import { OutputOptions } from '../../options/output-options';
|
|
7
|
+
import { CliOptions } from './schema';
|
|
8
|
+
export interface NormalizedCliOptions {
|
|
9
|
+
input: InputOptions;
|
|
10
|
+
output: OutputOptions;
|
|
11
|
+
help: boolean;
|
|
12
|
+
config: string;
|
|
13
|
+
version: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare function normalizeCliOptions(cliOptions: CliOptions, positionals: string[]): NormalizedCliOptions;
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
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
|
+
}, Omit<z.objectUtil.extendShape<{
|
|
8
|
+
input: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodRecord<z.ZodString, z.ZodString>]>>;
|
|
9
|
+
plugins: z.ZodOptional<z.ZodArray<z.ZodType<import("../../plugin").RolldownPluginRec, z.ZodTypeDef, import("../../plugin").RolldownPluginRec>, "many">>;
|
|
10
|
+
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]>>]>>;
|
|
11
|
+
resolve: z.ZodOptional<z.ZodObject<{
|
|
12
|
+
alias: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
13
|
+
aliasFields: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString, "many">, "many">>;
|
|
14
|
+
conditionNames: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
15
|
+
exportsFields: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString, "many">, "many">>;
|
|
16
|
+
extensions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
17
|
+
mainFields: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
18
|
+
mainFiles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
19
|
+
modules: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
20
|
+
symlinks: z.ZodOptional<z.ZodBoolean>;
|
|
21
|
+
tsconfigFilename: z.ZodOptional<z.ZodString>;
|
|
22
|
+
}, "strict", z.ZodTypeAny, {
|
|
23
|
+
alias?: Record<string, string> | undefined;
|
|
24
|
+
aliasFields?: string[][] | undefined;
|
|
25
|
+
conditionNames?: string[] | undefined;
|
|
26
|
+
exportsFields?: string[][] | undefined;
|
|
27
|
+
extensions?: string[] | undefined;
|
|
28
|
+
mainFields?: string[] | undefined;
|
|
29
|
+
mainFiles?: string[] | undefined;
|
|
30
|
+
modules?: string[] | undefined;
|
|
31
|
+
symlinks?: boolean | undefined;
|
|
32
|
+
tsconfigFilename?: string | undefined;
|
|
33
|
+
}, {
|
|
34
|
+
alias?: Record<string, string> | undefined;
|
|
35
|
+
aliasFields?: string[][] | undefined;
|
|
36
|
+
conditionNames?: string[] | undefined;
|
|
37
|
+
exportsFields?: string[][] | undefined;
|
|
38
|
+
extensions?: string[] | undefined;
|
|
39
|
+
mainFields?: string[] | undefined;
|
|
40
|
+
mainFiles?: string[] | undefined;
|
|
41
|
+
modules?: string[] | undefined;
|
|
42
|
+
symlinks?: boolean | undefined;
|
|
43
|
+
tsconfigFilename?: string | undefined;
|
|
44
|
+
}>>;
|
|
45
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
46
|
+
platform: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"node">, z.ZodLiteral<"browser">]>, z.ZodLiteral<"neutral">]>>;
|
|
47
|
+
shimMissingExports: z.ZodOptional<z.ZodBoolean>;
|
|
48
|
+
treeshake: z.ZodOptional<z.ZodType<boolean | import("../../treeshake").TreeshakingOptions, z.ZodTypeDef, boolean | import("../../treeshake").TreeshakingOptions>>;
|
|
49
|
+
logLevel: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodLiteral<"silent">]>>;
|
|
50
|
+
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>>;
|
|
51
|
+
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>>;
|
|
52
|
+
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.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">]>>>;
|
|
53
|
+
experimental: z.ZodOptional<z.ZodObject<{
|
|
54
|
+
enableComposingJsPlugins: z.ZodOptional<z.ZodBoolean>;
|
|
55
|
+
}, "strict", z.ZodTypeAny, {
|
|
56
|
+
enableComposingJsPlugins?: boolean | undefined;
|
|
57
|
+
}, {
|
|
58
|
+
enableComposingJsPlugins?: boolean | undefined;
|
|
59
|
+
}>>;
|
|
60
|
+
define: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
61
|
+
inject: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodString], null>]>>>;
|
|
62
|
+
}, {
|
|
63
|
+
external: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
64
|
+
inject: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
65
|
+
treeshake: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
66
|
+
}>, "input" | "plugins" | "resolve" | "onLog" | "onwarn" | "experimental">>, Omit<z.objectUtil.extendShape<{
|
|
67
|
+
dir: z.ZodOptional<z.ZodString>;
|
|
68
|
+
exports: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodLiteral<"named">]>, z.ZodLiteral<"default">]>, z.ZodLiteral<"none">]>>;
|
|
69
|
+
format: z.ZodOptional<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">]>>;
|
|
70
|
+
sourcemap: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodLiteral<"inline">]>, z.ZodLiteral<"hidden">]>>;
|
|
71
|
+
sourcemapIgnoreList: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodType<import("../../options/output-options").SourcemapIgnoreListOption, z.ZodTypeDef, import("../../options/output-options").SourcemapIgnoreListOption>]>>;
|
|
72
|
+
sourcemapPathTransform: z.ZodOptional<z.ZodType<import("../../options/output-options").SourcemapPathTransformOption, z.ZodTypeDef, import("../../options/output-options").SourcemapPathTransformOption>>;
|
|
73
|
+
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>]>>]>>;
|
|
74
|
+
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>]>>]>>;
|
|
75
|
+
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>]>>]>>;
|
|
76
|
+
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>]>>]>>;
|
|
77
|
+
extend: z.ZodOptional<z.ZodBoolean>;
|
|
78
|
+
esModule: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"if-default-prop">, z.ZodBoolean]>>;
|
|
79
|
+
entryFileNames: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<import("../..").PreRenderedChunk, z.ZodTypeDef, import("../..").PreRenderedChunk>], z.ZodUnknown>, z.ZodString>]>>;
|
|
80
|
+
chunkFileNames: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<import("../..").PreRenderedChunk, z.ZodTypeDef, import("../..").PreRenderedChunk>], z.ZodUnknown>, z.ZodString>]>>;
|
|
81
|
+
assetFileNames: z.ZodOptional<z.ZodString>;
|
|
82
|
+
minify: z.ZodOptional<z.ZodBoolean>;
|
|
83
|
+
name: z.ZodOptional<z.ZodString>;
|
|
84
|
+
globals: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
85
|
+
externalLiveBindings: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
86
|
+
inlineDynamicImports: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
87
|
+
}, {
|
|
88
|
+
banner: z.ZodOptional<z.ZodString>;
|
|
89
|
+
footer: z.ZodOptional<z.ZodString>;
|
|
90
|
+
intro: z.ZodOptional<z.ZodString>;
|
|
91
|
+
outro: z.ZodOptional<z.ZodString>;
|
|
92
|
+
esModule: z.ZodOptional<z.ZodBoolean>;
|
|
93
|
+
sourcemapIgnoreList: z.ZodOptional<z.ZodBoolean>;
|
|
94
|
+
sourcemapPathTransform: z.ZodOptional<z.ZodUndefined>;
|
|
95
|
+
}>, "sourcemapPathTransform">>, "strict", z.ZodTypeAny, {
|
|
96
|
+
external?: string[] | undefined;
|
|
97
|
+
cwd?: string | undefined;
|
|
98
|
+
platform?: "node" | "browser" | "neutral" | undefined;
|
|
99
|
+
shimMissingExports?: boolean | undefined;
|
|
100
|
+
treeshake?: boolean | undefined;
|
|
101
|
+
logLevel?: "info" | "debug" | "warn" | "silent" | undefined;
|
|
102
|
+
moduleTypes?: Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty"> | undefined;
|
|
103
|
+
define?: Record<string, string> | undefined;
|
|
104
|
+
inject?: Record<string, string> | undefined;
|
|
105
|
+
footer?: string | undefined;
|
|
106
|
+
banner?: string | undefined;
|
|
107
|
+
intro?: string | undefined;
|
|
108
|
+
outro?: string | undefined;
|
|
109
|
+
name?: string | undefined;
|
|
110
|
+
exports?: "auto" | "named" | "default" | "none" | undefined;
|
|
111
|
+
dir?: string | undefined;
|
|
112
|
+
format?: "es" | "cjs" | "esm" | "module" | "commonjs" | "iife" | undefined;
|
|
113
|
+
sourcemap?: boolean | "inline" | "hidden" | undefined;
|
|
114
|
+
sourcemapIgnoreList?: boolean | undefined;
|
|
115
|
+
extend?: boolean | undefined;
|
|
116
|
+
esModule?: boolean | undefined;
|
|
117
|
+
entryFileNames?: string | ((args_0: import("../..").PreRenderedChunk, ...args_1: unknown[]) => string) | undefined;
|
|
118
|
+
chunkFileNames?: string | ((args_0: import("../..").PreRenderedChunk, ...args_1: unknown[]) => string) | undefined;
|
|
119
|
+
assetFileNames?: string | undefined;
|
|
120
|
+
minify?: boolean | undefined;
|
|
121
|
+
globals?: Record<string, string> | undefined;
|
|
122
|
+
externalLiveBindings?: boolean | undefined;
|
|
123
|
+
inlineDynamicImports?: boolean | undefined;
|
|
124
|
+
version?: boolean | undefined;
|
|
125
|
+
config?: string | boolean | undefined;
|
|
126
|
+
help?: boolean | undefined;
|
|
127
|
+
}, {
|
|
128
|
+
external?: string[] | undefined;
|
|
129
|
+
cwd?: string | undefined;
|
|
130
|
+
platform?: "node" | "browser" | "neutral" | undefined;
|
|
131
|
+
shimMissingExports?: boolean | undefined;
|
|
132
|
+
treeshake?: boolean | undefined;
|
|
133
|
+
logLevel?: "info" | "debug" | "warn" | "silent" | undefined;
|
|
134
|
+
moduleTypes?: Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty"> | undefined;
|
|
135
|
+
define?: Record<string, string> | undefined;
|
|
136
|
+
inject?: Record<string, string> | undefined;
|
|
137
|
+
footer?: string | undefined;
|
|
138
|
+
banner?: string | undefined;
|
|
139
|
+
intro?: string | undefined;
|
|
140
|
+
outro?: string | undefined;
|
|
141
|
+
name?: string | undefined;
|
|
142
|
+
exports?: "auto" | "named" | "default" | "none" | undefined;
|
|
143
|
+
dir?: string | undefined;
|
|
144
|
+
format?: "es" | "cjs" | "esm" | "module" | "commonjs" | "iife" | undefined;
|
|
145
|
+
sourcemap?: boolean | "inline" | "hidden" | undefined;
|
|
146
|
+
sourcemapIgnoreList?: boolean | undefined;
|
|
147
|
+
extend?: boolean | undefined;
|
|
148
|
+
esModule?: boolean | undefined;
|
|
149
|
+
entryFileNames?: string | ((args_0: import("../..").PreRenderedChunk, ...args_1: unknown[]) => string) | undefined;
|
|
150
|
+
chunkFileNames?: string | ((args_0: import("../..").PreRenderedChunk, ...args_1: unknown[]) => string) | undefined;
|
|
151
|
+
assetFileNames?: string | undefined;
|
|
152
|
+
minify?: boolean | undefined;
|
|
153
|
+
globals?: Record<string, string> | undefined;
|
|
154
|
+
externalLiveBindings?: boolean | undefined;
|
|
155
|
+
inlineDynamicImports?: boolean | undefined;
|
|
156
|
+
version?: boolean | undefined;
|
|
157
|
+
config?: string | boolean | undefined;
|
|
158
|
+
help?: boolean | undefined;
|
|
159
|
+
}>;
|
|
160
|
+
export type CliOptions = z.infer<typeof cliOptionsSchema>;
|
|
161
|
+
export declare const schema: ObjectSchema;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Schema } from './types';
|
|
2
|
+
export declare function getSchemaType(schema: Schema): 'string' | 'boolean' | 'object' | 'number' | 'array';
|
|
3
|
+
export declare function flattenSchema(schema: Record<string, Schema>, base?: Record<string, Schema>, parent?: string): Record<string, Schema>;
|
|
4
|
+
export declare function setNestedProperty<T extends object, K>(obj: T, path: string, value: K): void;
|
|
5
|
+
export declare function camelCaseToKebabCase(str: string): string;
|
|
6
|
+
export declare function kebabCaseToCamelCase(str: string): string;
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import { NormalizedCliOptions } from '../arguments/normalize';
|
|
2
|
+
export declare function bundleWithConfig(configPath: string, cliOptions: NormalizedCliOptions): Promise<void>;
|
|
3
|
+
export declare function bundleWithCliOptions(cliOptions: NormalizedCliOptions): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function showHelp(): void;
|
|
@@ -2,5 +2,5 @@ import type { ConfigExport } from '../types/config-export';
|
|
|
2
2
|
/**
|
|
3
3
|
* Console logger
|
|
4
4
|
*/
|
|
5
|
-
export declare const logger: import("consola").ConsolaInstance;
|
|
5
|
+
export declare const logger: Record<string, any> | import("consola").ConsolaInstance;
|
|
6
6
|
export declare function ensureConfig(configPath: string): Promise<ConfigExport>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* If Composed plugins call `this.resolve` with `skipSelf: true`, the composed plugins will be skipped as a whole.
|
|
3
|
+
* To prevent that, we use this symbol to store the actual caller of `this.resolve` with `skipSelf: true`. And we
|
|
4
|
+
* will modify the skipSelf option to `false` and use this symbol to skip the caller itself in the composed plugins
|
|
5
|
+
* internally.
|
|
6
|
+
*/
|
|
7
|
+
export declare const SYMBOL_FOR_RESOLVE_CALLER_THAT_SKIP_SELF: unique symbol;
|
|
@@ -0,0 +1,36 @@
|
|
|
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"];
|
|
3
|
+
/**
|
|
4
|
+
* Names of all properties in a `Plugin` object. Includes `name` and `api`.
|
|
5
|
+
*/
|
|
6
|
+
export type PluginProps = keyof Plugin;
|
|
7
|
+
type EnumeratedPluginHookNames = typeof ENUMERATED_PLUGIN_HOOK_NAMES;
|
|
8
|
+
/**
|
|
9
|
+
* Names of all hooks in a `Plugin` object. Does not include `name` and `api`, since they are not hooks.
|
|
10
|
+
*/
|
|
11
|
+
export type PluginHookNames = EnumeratedPluginHookNames[number];
|
|
12
|
+
/**
|
|
13
|
+
* Names of all defined hooks. It's like
|
|
14
|
+
* ```ts
|
|
15
|
+
* type DefinedHookNames = {
|
|
16
|
+
* options: 'options',
|
|
17
|
+
* buildStart: 'buildStart',
|
|
18
|
+
* ...
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export type DefinedHookNames = {
|
|
23
|
+
readonly [K in PluginHookNames]: K;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Names of all defined hooks. It's like
|
|
27
|
+
* ```js
|
|
28
|
+
* const DEFINED_HOOK_NAMES ={
|
|
29
|
+
* options: 'options',
|
|
30
|
+
* buildStart: 'buildStart',
|
|
31
|
+
* ...
|
|
32
|
+
* }
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export declare const DEFINED_HOOK_NAMES: DefinedHookNames;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { defineParallelPlugin } from './plugin/parallel-plugin';
|
|
2
|
+
export { experimental_scan as scan } from './rolldown';
|
|
3
|
+
export { transform } from './binding';
|
|
4
|
+
export { composeJsPlugins as composePlugins } from './utils/compose-js-plugins';
|
|
5
|
+
export { modulePreloadPolyfillPlugin, dynamicImportVarsPlugin, wasmHelperPlugin, wasmFallbackPlugin, importGlobPlugin, manifestPlugin, loadFallbackPlugin, transformPlugin, aliasPlugin, jsonPlugin, buildImportAnalysisPlugin, replacePlugin, } from './plugin/builtin-plugin';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -2,24 +2,24 @@ import { RolldownOutput, RolldownOutputAsset, RolldownOutputChunk, SourceMap } f
|
|
|
2
2
|
import type { ExternalOption, InputOption, InputOptions } from './options/input-options';
|
|
3
3
|
import type { ModuleFormat, OutputOptions } from './options/output-options';
|
|
4
4
|
import type { RolldownOptions } from './types/rolldown-options';
|
|
5
|
-
import type { AsyncPluginHooks, CustomPluginOptions, FunctionPluginHooks, ImportKind, LoadResult, ModuleOptions, ObjectHook, ParallelPluginHooks, PartialResolvedId, Plugin, ResolveIdResult, ResolvedId, SourceDescription, TransformResult } from './plugin';
|
|
6
|
-
import {
|
|
5
|
+
import type { AsyncPluginHooks, CustomPluginOptions, FunctionPluginHooks, ImportKind, LoadResult, ModuleOptions, ObjectHook, ParallelPluginHooks, PartialResolvedId, Plugin, RolldownPlugin, ResolveIdResult, ResolvedId, SourceDescription, TransformResult } from './plugin';
|
|
6
|
+
import { DefineParallelPluginResult } from './plugin/parallel-plugin';
|
|
7
7
|
import { defineConfig } from './utils/define-config';
|
|
8
|
-
import { rolldown
|
|
8
|
+
import { rolldown } from './rolldown';
|
|
9
9
|
import { ConfigExport } from './types/config-export';
|
|
10
|
-
import { BuiltinGlobImportPlugin, BuiltinWasmPlugin } from './plugin/builtin-plugin';
|
|
11
10
|
import { RolldownBuild } from './rolldown-build';
|
|
12
11
|
import { EmittedAsset, EmittedFile, PluginContext } from './plugin/plugin-context';
|
|
13
|
-
import { TransformPluginContext } from './plugin/
|
|
12
|
+
import { TransformPluginContext } from './plugin/transform-plugin-context';
|
|
14
13
|
import { InternalModuleFormat, NormalizedOutputOptions } from './options/normalized-output-options';
|
|
15
|
-
import { RenderedChunk,
|
|
14
|
+
import { RenderedChunk, PreRenderedChunk } from './binding';
|
|
16
15
|
import { PartialNull } from './types/utils';
|
|
17
16
|
import { NormalizedInputOptions } from './options/normalized-input-options';
|
|
18
17
|
import { ModuleInfo } from './types/module-info';
|
|
19
18
|
import { MinimalPluginContext } from './log/logger';
|
|
20
19
|
import { ExistingRawSourceMap, SourceMapInput } from './types/sourcemap';
|
|
21
20
|
import { OutputBundle } from './types/output-bundle';
|
|
22
|
-
export { defineConfig,
|
|
23
|
-
export
|
|
21
|
+
export { defineConfig, rolldown };
|
|
22
|
+
export declare const VERSION: string;
|
|
23
|
+
export type { RolldownOutputAsset, RolldownOutputChunk, RolldownOptions, RolldownOutput, RolldownBuild, InputOptions, NormalizedInputOptions, OutputOptions, NormalizedOutputOptions, Plugin, RolldownPlugin, DefineParallelPluginResult, ConfigExport, ImportKind, InputOption, ExternalOption, ModuleFormat, 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, };
|
|
24
24
|
export type { RolldownOutput as RollupOutput, RolldownOptions as RollupOptions, RolldownBuild as RollupBuild, RolldownOutputChunk as OutputChunk, RolldownOutputAsset as OutputAsset, };
|
|
25
25
|
export type { RollupError, RollupLog, LoggingFunction } from './rollup';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { RolldownPluginRec } from '../plugin';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { TreeshakingOptions } from '../treeshake';
|
|
4
4
|
declare const inputOptionSchema: z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodRecord<z.ZodString, z.ZodString>]>;
|
|
5
5
|
declare const externalSchema: 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]>>]>;
|
|
6
|
-
declare const inputOptionsSchema: z.ZodObject<{
|
|
6
|
+
export declare const inputOptionsSchema: z.ZodObject<{
|
|
7
7
|
input: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodRecord<z.ZodString, z.ZodString>]>>;
|
|
8
|
-
plugins: z.ZodOptional<z.ZodArray<z.ZodType<
|
|
8
|
+
plugins: z.ZodOptional<z.ZodArray<z.ZodType<RolldownPluginRec, z.ZodTypeDef, RolldownPluginRec>, "many">>;
|
|
9
9
|
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]>>]>>;
|
|
10
10
|
resolve: z.ZodOptional<z.ZodObject<{
|
|
11
11
|
alias: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
@@ -19,7 +19,6 @@ declare const inputOptionsSchema: z.ZodObject<{
|
|
|
19
19
|
symlinks: z.ZodOptional<z.ZodBoolean>;
|
|
20
20
|
tsconfigFilename: z.ZodOptional<z.ZodString>;
|
|
21
21
|
}, "strict", z.ZodTypeAny, {
|
|
22
|
-
modules?: string[] | undefined;
|
|
23
22
|
alias?: Record<string, string> | undefined;
|
|
24
23
|
aliasFields?: string[][] | undefined;
|
|
25
24
|
conditionNames?: string[] | undefined;
|
|
@@ -27,10 +26,10 @@ declare const inputOptionsSchema: z.ZodObject<{
|
|
|
27
26
|
extensions?: string[] | undefined;
|
|
28
27
|
mainFields?: string[] | undefined;
|
|
29
28
|
mainFiles?: string[] | undefined;
|
|
29
|
+
modules?: string[] | undefined;
|
|
30
30
|
symlinks?: boolean | undefined;
|
|
31
31
|
tsconfigFilename?: string | undefined;
|
|
32
32
|
}, {
|
|
33
|
-
modules?: string[] | undefined;
|
|
34
33
|
alias?: Record<string, string> | undefined;
|
|
35
34
|
aliasFields?: string[][] | undefined;
|
|
36
35
|
conditionNames?: string[] | undefined;
|
|
@@ -38,31 +37,32 @@ declare const inputOptionsSchema: z.ZodObject<{
|
|
|
38
37
|
extensions?: string[] | undefined;
|
|
39
38
|
mainFields?: string[] | undefined;
|
|
40
39
|
mainFiles?: string[] | undefined;
|
|
40
|
+
modules?: string[] | undefined;
|
|
41
41
|
symlinks?: boolean | undefined;
|
|
42
42
|
tsconfigFilename?: string | undefined;
|
|
43
43
|
}>>;
|
|
44
44
|
cwd: z.ZodOptional<z.ZodString>;
|
|
45
45
|
platform: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"node">, z.ZodLiteral<"browser">]>, z.ZodLiteral<"neutral">]>>;
|
|
46
46
|
shimMissingExports: z.ZodOptional<z.ZodBoolean>;
|
|
47
|
-
treeshake: z.ZodOptional<z.
|
|
48
|
-
moduleSideEffects: z.ZodUnion<[z.ZodBoolean, z.ZodString]>;
|
|
49
|
-
}, {
|
|
50
|
-
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodString]>>;
|
|
51
|
-
}>, "strict", z.ZodTypeAny, {
|
|
52
|
-
moduleSideEffects?: string | boolean | undefined;
|
|
53
|
-
}, {
|
|
54
|
-
moduleSideEffects?: string | boolean | undefined;
|
|
55
|
-
}>]>>;
|
|
47
|
+
treeshake: z.ZodOptional<z.ZodType<boolean | TreeshakingOptions, z.ZodTypeDef, boolean | TreeshakingOptions>>;
|
|
56
48
|
logLevel: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodLiteral<"silent">]>>;
|
|
57
49
|
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>>;
|
|
58
50
|
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>>;
|
|
59
51
|
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.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">]>>>;
|
|
52
|
+
experimental: z.ZodOptional<z.ZodObject<{
|
|
53
|
+
enableComposingJsPlugins: z.ZodOptional<z.ZodBoolean>;
|
|
54
|
+
}, "strict", z.ZodTypeAny, {
|
|
55
|
+
enableComposingJsPlugins?: boolean | undefined;
|
|
56
|
+
}, {
|
|
57
|
+
enableComposingJsPlugins?: boolean | undefined;
|
|
58
|
+
}>>;
|
|
59
|
+
define: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
60
|
+
inject: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodString], null>]>>>;
|
|
60
61
|
}, "strict", z.ZodTypeAny, {
|
|
61
62
|
input?: string | string[] | Record<string, string> | undefined;
|
|
62
|
-
plugins?:
|
|
63
|
+
plugins?: RolldownPluginRec[] | undefined;
|
|
63
64
|
external?: string | RegExp | (string | RegExp)[] | ((args_0: string, args_1: string | undefined, args_2: boolean, ...args_3: unknown[]) => boolean | void | null | undefined) | undefined;
|
|
64
65
|
resolve?: {
|
|
65
|
-
modules?: string[] | undefined;
|
|
66
66
|
alias?: Record<string, string> | undefined;
|
|
67
67
|
aliasFields?: string[][] | undefined;
|
|
68
68
|
conditionNames?: string[] | undefined;
|
|
@@ -70,25 +70,28 @@ declare const inputOptionsSchema: z.ZodObject<{
|
|
|
70
70
|
extensions?: string[] | undefined;
|
|
71
71
|
mainFields?: string[] | undefined;
|
|
72
72
|
mainFiles?: string[] | undefined;
|
|
73
|
+
modules?: string[] | undefined;
|
|
73
74
|
symlinks?: boolean | undefined;
|
|
74
75
|
tsconfigFilename?: string | undefined;
|
|
75
76
|
} | undefined;
|
|
76
77
|
cwd?: string | undefined;
|
|
77
78
|
platform?: "node" | "browser" | "neutral" | undefined;
|
|
78
79
|
shimMissingExports?: boolean | undefined;
|
|
79
|
-
treeshake?: boolean |
|
|
80
|
-
moduleSideEffects?: string | boolean | undefined;
|
|
81
|
-
} | undefined;
|
|
80
|
+
treeshake?: boolean | TreeshakingOptions | undefined;
|
|
82
81
|
logLevel?: "info" | "debug" | "warn" | "silent" | undefined;
|
|
83
82
|
onLog?: ((args_0: "info" | "debug" | "warn", args_1: any, args_2: (args_0: "info" | "debug" | "warn" | "error", args_1: any, ...args_2: unknown[]) => unknown, ...args_3: unknown[]) => unknown) | undefined;
|
|
84
83
|
onwarn?: ((args_0: any, args_1: (args_0: any, ...args_1: unknown[]) => unknown, ...args_2: unknown[]) => unknown) | undefined;
|
|
85
84
|
moduleTypes?: Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty"> | undefined;
|
|
85
|
+
experimental?: {
|
|
86
|
+
enableComposingJsPlugins?: boolean | undefined;
|
|
87
|
+
} | undefined;
|
|
88
|
+
define?: Record<string, string> | undefined;
|
|
89
|
+
inject?: Record<string, string | [string, string]> | undefined;
|
|
86
90
|
}, {
|
|
87
91
|
input?: string | string[] | Record<string, string> | undefined;
|
|
88
|
-
plugins?:
|
|
92
|
+
plugins?: RolldownPluginRec[] | undefined;
|
|
89
93
|
external?: string | RegExp | (string | RegExp)[] | ((args_0: string, args_1: string | undefined, args_2: boolean, ...args_3: unknown[]) => boolean | void | null | undefined) | undefined;
|
|
90
94
|
resolve?: {
|
|
91
|
-
modules?: string[] | undefined;
|
|
92
95
|
alias?: Record<string, string> | undefined;
|
|
93
96
|
aliasFields?: string[][] | undefined;
|
|
94
97
|
conditionNames?: string[] | undefined;
|
|
@@ -96,23 +99,132 @@ declare const inputOptionsSchema: z.ZodObject<{
|
|
|
96
99
|
extensions?: string[] | undefined;
|
|
97
100
|
mainFields?: string[] | undefined;
|
|
98
101
|
mainFiles?: string[] | undefined;
|
|
102
|
+
modules?: string[] | undefined;
|
|
99
103
|
symlinks?: boolean | undefined;
|
|
100
104
|
tsconfigFilename?: string | undefined;
|
|
101
105
|
} | undefined;
|
|
102
106
|
cwd?: string | undefined;
|
|
103
107
|
platform?: "node" | "browser" | "neutral" | undefined;
|
|
104
108
|
shimMissingExports?: boolean | undefined;
|
|
105
|
-
treeshake?: boolean |
|
|
106
|
-
moduleSideEffects?: string | boolean | undefined;
|
|
107
|
-
} | undefined;
|
|
109
|
+
treeshake?: boolean | TreeshakingOptions | undefined;
|
|
108
110
|
logLevel?: "info" | "debug" | "warn" | "silent" | undefined;
|
|
109
111
|
onLog?: ((args_0: "info" | "debug" | "warn", args_1: any, args_2: (args_0: "info" | "debug" | "warn" | "error", args_1: any, ...args_2: unknown[]) => unknown, ...args_3: unknown[]) => unknown) | undefined;
|
|
110
112
|
onwarn?: ((args_0: any, args_1: (args_0: any, ...args_1: unknown[]) => unknown, ...args_2: unknown[]) => unknown) | undefined;
|
|
111
113
|
moduleTypes?: Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty"> | undefined;
|
|
114
|
+
experimental?: {
|
|
115
|
+
enableComposingJsPlugins?: boolean | undefined;
|
|
116
|
+
} | undefined;
|
|
117
|
+
define?: Record<string, string> | undefined;
|
|
118
|
+
inject?: Record<string, string | [string, string]> | undefined;
|
|
119
|
+
}>;
|
|
120
|
+
export declare const inputCliOptionsSchema: z.ZodObject<Omit<z.objectUtil.extendShape<{
|
|
121
|
+
input: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodRecord<z.ZodString, z.ZodString>]>>;
|
|
122
|
+
plugins: z.ZodOptional<z.ZodArray<z.ZodType<RolldownPluginRec, z.ZodTypeDef, RolldownPluginRec>, "many">>;
|
|
123
|
+
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]>>]>>;
|
|
124
|
+
resolve: z.ZodOptional<z.ZodObject<{
|
|
125
|
+
alias: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
126
|
+
aliasFields: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString, "many">, "many">>;
|
|
127
|
+
conditionNames: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
128
|
+
exportsFields: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString, "many">, "many">>;
|
|
129
|
+
extensions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
130
|
+
mainFields: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
131
|
+
mainFiles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
132
|
+
modules: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
133
|
+
symlinks: z.ZodOptional<z.ZodBoolean>;
|
|
134
|
+
tsconfigFilename: z.ZodOptional<z.ZodString>;
|
|
135
|
+
}, "strict", z.ZodTypeAny, {
|
|
136
|
+
alias?: Record<string, string> | undefined;
|
|
137
|
+
aliasFields?: string[][] | undefined;
|
|
138
|
+
conditionNames?: string[] | undefined;
|
|
139
|
+
exportsFields?: string[][] | undefined;
|
|
140
|
+
extensions?: string[] | undefined;
|
|
141
|
+
mainFields?: string[] | undefined;
|
|
142
|
+
mainFiles?: string[] | undefined;
|
|
143
|
+
modules?: string[] | undefined;
|
|
144
|
+
symlinks?: boolean | undefined;
|
|
145
|
+
tsconfigFilename?: string | undefined;
|
|
146
|
+
}, {
|
|
147
|
+
alias?: Record<string, string> | undefined;
|
|
148
|
+
aliasFields?: string[][] | undefined;
|
|
149
|
+
conditionNames?: string[] | undefined;
|
|
150
|
+
exportsFields?: string[][] | undefined;
|
|
151
|
+
extensions?: string[] | undefined;
|
|
152
|
+
mainFields?: string[] | undefined;
|
|
153
|
+
mainFiles?: string[] | undefined;
|
|
154
|
+
modules?: string[] | undefined;
|
|
155
|
+
symlinks?: boolean | undefined;
|
|
156
|
+
tsconfigFilename?: string | undefined;
|
|
157
|
+
}>>;
|
|
158
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
159
|
+
platform: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"node">, z.ZodLiteral<"browser">]>, z.ZodLiteral<"neutral">]>>;
|
|
160
|
+
shimMissingExports: z.ZodOptional<z.ZodBoolean>;
|
|
161
|
+
treeshake: z.ZodOptional<z.ZodType<boolean | TreeshakingOptions, z.ZodTypeDef, boolean | TreeshakingOptions>>;
|
|
162
|
+
logLevel: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodLiteral<"silent">]>>;
|
|
163
|
+
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>>;
|
|
164
|
+
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>>;
|
|
165
|
+
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.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">]>>>;
|
|
166
|
+
experimental: z.ZodOptional<z.ZodObject<{
|
|
167
|
+
enableComposingJsPlugins: z.ZodOptional<z.ZodBoolean>;
|
|
168
|
+
}, "strict", z.ZodTypeAny, {
|
|
169
|
+
enableComposingJsPlugins?: boolean | undefined;
|
|
170
|
+
}, {
|
|
171
|
+
enableComposingJsPlugins?: boolean | undefined;
|
|
172
|
+
}>>;
|
|
173
|
+
define: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
174
|
+
inject: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodString], null>]>>>;
|
|
175
|
+
}, {
|
|
176
|
+
external: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
177
|
+
inject: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
178
|
+
treeshake: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
179
|
+
}>, "input" | "plugins" | "resolve" | "onLog" | "onwarn" | "experimental">, "strict", z.ZodTypeAny, {
|
|
180
|
+
external?: string[] | undefined;
|
|
181
|
+
cwd?: string | undefined;
|
|
182
|
+
platform?: "node" | "browser" | "neutral" | undefined;
|
|
183
|
+
shimMissingExports?: boolean | undefined;
|
|
184
|
+
treeshake?: boolean | undefined;
|
|
185
|
+
logLevel?: "info" | "debug" | "warn" | "silent" | undefined;
|
|
186
|
+
moduleTypes?: Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty"> | undefined;
|
|
187
|
+
define?: Record<string, string> | undefined;
|
|
188
|
+
inject?: Record<string, string> | undefined;
|
|
189
|
+
}, {
|
|
190
|
+
external?: string[] | undefined;
|
|
191
|
+
cwd?: string | undefined;
|
|
192
|
+
platform?: "node" | "browser" | "neutral" | undefined;
|
|
193
|
+
shimMissingExports?: boolean | undefined;
|
|
194
|
+
treeshake?: boolean | undefined;
|
|
195
|
+
logLevel?: "info" | "debug" | "warn" | "silent" | undefined;
|
|
196
|
+
moduleTypes?: Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty"> | undefined;
|
|
197
|
+
define?: Record<string, string> | undefined;
|
|
198
|
+
inject?: Record<string, string> | undefined;
|
|
112
199
|
}>;
|
|
200
|
+
type RawInputOptions = z.infer<typeof inputOptionsSchema>;
|
|
201
|
+
interface OverwriteInputOptionsWithDoc {
|
|
202
|
+
/**
|
|
203
|
+
* Inject import statements on demand.
|
|
204
|
+
*
|
|
205
|
+
* ## Supported patterns
|
|
206
|
+
* ```js
|
|
207
|
+
* {
|
|
208
|
+
* // import { Promise } from 'es6-promise'
|
|
209
|
+
* Promise: ['es6-promise', 'Promise'],
|
|
210
|
+
*
|
|
211
|
+
* // import { Promise as P } from 'es6-promise'
|
|
212
|
+
* P: ['es6-promise', 'Promise'],
|
|
213
|
+
*
|
|
214
|
+
* // import $ from 'jquery'
|
|
215
|
+
* $: 'jquery',
|
|
216
|
+
*
|
|
217
|
+
* // import * as fs from 'node:fs'
|
|
218
|
+
* fs: ['node:fs', '*'],
|
|
219
|
+
*
|
|
220
|
+
* // Inject shims for property access pattern
|
|
221
|
+
* 'Object.assign': path.resolve( 'src/helpers/object-assign.js' ),
|
|
222
|
+
* }
|
|
223
|
+
* ```
|
|
224
|
+
*/
|
|
225
|
+
inject?: RawInputOptions['inject'];
|
|
226
|
+
}
|
|
113
227
|
export type InputOption = z.infer<typeof inputOptionSchema>;
|
|
228
|
+
export type InputOptions = Omit<RawInputOptions, keyof OverwriteInputOptionsWithDoc> & OverwriteInputOptionsWithDoc;
|
|
114
229
|
export type ExternalOption = z.infer<typeof externalSchema>;
|
|
115
|
-
export type InputOptions = Omit<z.infer<typeof inputOptionsSchema>, 'treeshake'> & {
|
|
116
|
-
treeshake?: boolean | TreeshakingOptions;
|
|
117
|
-
};
|
|
118
230
|
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BindingAliasPluginConfig } from '../binding';
|
|
2
|
+
type AliasPluginAlias = {
|
|
3
|
+
find: string | RegExp;
|
|
4
|
+
replacement: string;
|
|
5
|
+
};
|
|
6
|
+
export type AliasPluginConfig = {
|
|
7
|
+
entries: AliasPluginAlias[];
|
|
8
|
+
};
|
|
9
|
+
export declare function normalizeAliasPluginConfig(config?: AliasPluginConfig): BindingAliasPluginConfig | undefined;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BindingTransformPluginConfig } from '../binding';
|
|
2
|
+
type TransformPattern = string | RegExp | RegExp[] | string[];
|
|
3
|
+
export type TransformPluginConfig = Omit<BindingTransformPluginConfig, 'include' | 'exclude'> & {
|
|
4
|
+
include?: TransformPattern;
|
|
5
|
+
exclude?: TransformPattern;
|
|
6
|
+
};
|
|
7
|
+
export declare function normalizeEcmaTransformPluginConfig(config?: TransformPluginConfig): BindingTransformPluginConfig | undefined;
|
|
8
|
+
export {};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { SourcemapIgnoreListOption, SourcemapPathTransformOption } from '../rollup';
|
|
2
2
|
import type { OutputOptions } from './output-options';
|
|
3
3
|
import type { RolldownPlugin } from '../plugin';
|
|
4
|
-
import type { RenderedChunk } from '../binding';
|
|
4
|
+
import type { PreRenderedChunk, RenderedChunk } from '../binding';
|
|
5
5
|
export type InternalModuleFormat = 'es' | 'cjs' | 'iife';
|
|
6
6
|
type AddonFunction = (chunk: RenderedChunk) => string | Promise<string>;
|
|
7
|
+
type ChunkFileNamesOption = string | ((chunk: PreRenderedChunk) => string) | undefined;
|
|
7
8
|
export interface NormalizedOutputOptions extends OutputOptions {
|
|
8
9
|
plugins: RolldownPlugin[];
|
|
9
10
|
dir: string | undefined;
|
|
@@ -14,9 +15,13 @@ export interface NormalizedOutputOptions extends OutputOptions {
|
|
|
14
15
|
sourcemapPathTransform: SourcemapPathTransformOption | undefined;
|
|
15
16
|
banner: AddonFunction;
|
|
16
17
|
footer: AddonFunction;
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
intro: AddonFunction;
|
|
19
|
+
outro: AddonFunction;
|
|
20
|
+
esModule: boolean | 'if-default-prop';
|
|
21
|
+
entryFileNames: ChunkFileNamesOption;
|
|
22
|
+
chunkFileNames: ChunkFileNamesOption;
|
|
19
23
|
assetFileNames: string;
|
|
20
24
|
name: string | undefined;
|
|
25
|
+
inlineDynamicImports: boolean;
|
|
21
26
|
}
|
|
22
27
|
export {};
|