create-microact-app 1.0.1
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/index.js +95 -0
- package/package.json +21 -0
- package/templates/vanilla/.github/workflows/deploy.yml +38 -0
- package/templates/vanilla/index.html +13 -0
- package/templates/vanilla/node_modules/.package-lock.json +207 -0
- package/templates/vanilla/node_modules/@esbuild/darwin-x64/README.md +3 -0
- package/templates/vanilla/node_modules/@esbuild/darwin-x64/bin/esbuild +0 -0
- package/templates/vanilla/node_modules/@esbuild/darwin-x64/package.json +17 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/README.md +154 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/dist/microact.cjs.js +1749 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/dist/microact.cjs.js.map +1 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/dist/microact.esm.js +1743 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/dist/microact.esm.js.map +1 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/dist/microact.umd.js +2 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/dist/microact.umd.js.map +1 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/example/index.html +13 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/example/index.js +63 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/package.json +38 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/rollup.config.cjs +30 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/src/Component.js +831 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/src/DOMUpdater.js +320 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/src/EventBus.js +123 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/src/Router.js +253 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/src/UpdateScheduler.js +218 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/src/index.js +6 -0
- package/templates/vanilla/node_modules/esbuild/LICENSE.md +21 -0
- package/templates/vanilla/node_modules/esbuild/README.md +3 -0
- package/templates/vanilla/node_modules/esbuild/bin/esbuild +0 -0
- package/templates/vanilla/node_modules/esbuild/install.js +287 -0
- package/templates/vanilla/node_modules/esbuild/lib/main.d.ts +660 -0
- package/templates/vanilla/node_modules/esbuild/lib/main.js +2393 -0
- package/templates/vanilla/node_modules/esbuild/package.json +42 -0
- package/templates/vanilla/node_modules/nanoid/LICENSE +20 -0
- package/templates/vanilla/node_modules/nanoid/README.md +39 -0
- package/templates/vanilla/node_modules/nanoid/async/index.browser.cjs +69 -0
- package/templates/vanilla/node_modules/nanoid/async/index.browser.js +34 -0
- package/templates/vanilla/node_modules/nanoid/async/index.cjs +71 -0
- package/templates/vanilla/node_modules/nanoid/async/index.d.ts +56 -0
- package/templates/vanilla/node_modules/nanoid/async/index.js +35 -0
- package/templates/vanilla/node_modules/nanoid/async/index.native.js +26 -0
- package/templates/vanilla/node_modules/nanoid/async/package.json +12 -0
- package/templates/vanilla/node_modules/nanoid/bin/nanoid.cjs +55 -0
- package/templates/vanilla/node_modules/nanoid/index.browser.cjs +72 -0
- package/templates/vanilla/node_modules/nanoid/index.browser.js +34 -0
- package/templates/vanilla/node_modules/nanoid/index.cjs +85 -0
- package/templates/vanilla/node_modules/nanoid/index.d.cts +91 -0
- package/templates/vanilla/node_modules/nanoid/index.d.ts +91 -0
- package/templates/vanilla/node_modules/nanoid/index.js +45 -0
- package/templates/vanilla/node_modules/nanoid/nanoid.js +1 -0
- package/templates/vanilla/node_modules/nanoid/non-secure/index.cjs +34 -0
- package/templates/vanilla/node_modules/nanoid/non-secure/index.d.ts +33 -0
- package/templates/vanilla/node_modules/nanoid/non-secure/index.js +21 -0
- package/templates/vanilla/node_modules/nanoid/non-secure/package.json +6 -0
- package/templates/vanilla/node_modules/nanoid/package.json +89 -0
- package/templates/vanilla/node_modules/nanoid/url-alphabet/index.cjs +7 -0
- package/templates/vanilla/node_modules/nanoid/url-alphabet/index.js +3 -0
- package/templates/vanilla/node_modules/nanoid/url-alphabet/package.json +6 -0
- package/templates/vanilla/node_modules/picocolors/LICENSE +15 -0
- package/templates/vanilla/node_modules/picocolors/README.md +21 -0
- package/templates/vanilla/node_modules/picocolors/package.json +25 -0
- package/templates/vanilla/node_modules/picocolors/picocolors.browser.js +4 -0
- package/templates/vanilla/node_modules/picocolors/picocolors.d.ts +5 -0
- package/templates/vanilla/node_modules/picocolors/picocolors.js +75 -0
- package/templates/vanilla/node_modules/picocolors/types.d.ts +51 -0
- package/templates/vanilla/node_modules/postcss/LICENSE +20 -0
- package/templates/vanilla/node_modules/postcss/README.md +29 -0
- package/templates/vanilla/node_modules/postcss/lib/at-rule.d.ts +140 -0
- package/templates/vanilla/node_modules/postcss/lib/at-rule.js +25 -0
- package/templates/vanilla/node_modules/postcss/lib/comment.d.ts +68 -0
- package/templates/vanilla/node_modules/postcss/lib/comment.js +13 -0
- package/templates/vanilla/node_modules/postcss/lib/container.d.ts +483 -0
- package/templates/vanilla/node_modules/postcss/lib/container.js +447 -0
- package/templates/vanilla/node_modules/postcss/lib/css-syntax-error.d.ts +248 -0
- package/templates/vanilla/node_modules/postcss/lib/css-syntax-error.js +133 -0
- package/templates/vanilla/node_modules/postcss/lib/declaration.d.ts +151 -0
- package/templates/vanilla/node_modules/postcss/lib/declaration.js +24 -0
- package/templates/vanilla/node_modules/postcss/lib/document.d.ts +69 -0
- package/templates/vanilla/node_modules/postcss/lib/document.js +33 -0
- package/templates/vanilla/node_modules/postcss/lib/fromJSON.d.ts +9 -0
- package/templates/vanilla/node_modules/postcss/lib/fromJSON.js +54 -0
- package/templates/vanilla/node_modules/postcss/lib/input.d.ts +227 -0
- package/templates/vanilla/node_modules/postcss/lib/input.js +265 -0
- package/templates/vanilla/node_modules/postcss/lib/lazy-result.d.ts +190 -0
- package/templates/vanilla/node_modules/postcss/lib/lazy-result.js +550 -0
- package/templates/vanilla/node_modules/postcss/lib/list.d.ts +60 -0
- package/templates/vanilla/node_modules/postcss/lib/list.js +58 -0
- package/templates/vanilla/node_modules/postcss/lib/map-generator.js +368 -0
- package/templates/vanilla/node_modules/postcss/lib/no-work-result.d.ts +46 -0
- package/templates/vanilla/node_modules/postcss/lib/no-work-result.js +138 -0
- package/templates/vanilla/node_modules/postcss/lib/node.d.ts +556 -0
- package/templates/vanilla/node_modules/postcss/lib/node.js +449 -0
- package/templates/vanilla/node_modules/postcss/lib/parse.d.ts +9 -0
- package/templates/vanilla/node_modules/postcss/lib/parse.js +42 -0
- package/templates/vanilla/node_modules/postcss/lib/parser.js +611 -0
- package/templates/vanilla/node_modules/postcss/lib/postcss.d.mts +69 -0
- package/templates/vanilla/node_modules/postcss/lib/postcss.d.ts +458 -0
- package/templates/vanilla/node_modules/postcss/lib/postcss.js +101 -0
- package/templates/vanilla/node_modules/postcss/lib/postcss.mjs +30 -0
- package/templates/vanilla/node_modules/postcss/lib/previous-map.d.ts +81 -0
- package/templates/vanilla/node_modules/postcss/lib/previous-map.js +144 -0
- package/templates/vanilla/node_modules/postcss/lib/processor.d.ts +115 -0
- package/templates/vanilla/node_modules/postcss/lib/processor.js +67 -0
- package/templates/vanilla/node_modules/postcss/lib/result.d.ts +205 -0
- package/templates/vanilla/node_modules/postcss/lib/result.js +42 -0
- package/templates/vanilla/node_modules/postcss/lib/root.d.ts +87 -0
- package/templates/vanilla/node_modules/postcss/lib/root.js +61 -0
- package/templates/vanilla/node_modules/postcss/lib/rule.d.ts +126 -0
- package/templates/vanilla/node_modules/postcss/lib/rule.js +27 -0
- package/templates/vanilla/node_modules/postcss/lib/stringifier.d.ts +46 -0
- package/templates/vanilla/node_modules/postcss/lib/stringifier.js +353 -0
- package/templates/vanilla/node_modules/postcss/lib/stringify.d.ts +9 -0
- package/templates/vanilla/node_modules/postcss/lib/stringify.js +11 -0
- package/templates/vanilla/node_modules/postcss/lib/symbols.js +5 -0
- package/templates/vanilla/node_modules/postcss/lib/terminal-highlight.js +70 -0
- package/templates/vanilla/node_modules/postcss/lib/tokenize.js +266 -0
- package/templates/vanilla/node_modules/postcss/lib/warn-once.js +13 -0
- package/templates/vanilla/node_modules/postcss/lib/warning.d.ts +147 -0
- package/templates/vanilla/node_modules/postcss/lib/warning.js +37 -0
- package/templates/vanilla/node_modules/postcss/package.json +88 -0
- package/templates/vanilla/node_modules/rollup/LICENSE.md +695 -0
- package/templates/vanilla/node_modules/rollup/README.md +125 -0
- package/templates/vanilla/node_modules/rollup/dist/bin/rollup +1715 -0
- package/templates/vanilla/node_modules/rollup/dist/es/getLogFilter.js +64 -0
- package/templates/vanilla/node_modules/rollup/dist/es/package.json +1 -0
- package/templates/vanilla/node_modules/rollup/dist/es/rollup.js +17 -0
- package/templates/vanilla/node_modules/rollup/dist/es/shared/node-entry.js +27273 -0
- package/templates/vanilla/node_modules/rollup/dist/es/shared/watch.js +4857 -0
- package/templates/vanilla/node_modules/rollup/dist/getLogFilter.d.ts +5 -0
- package/templates/vanilla/node_modules/rollup/dist/getLogFilter.js +69 -0
- package/templates/vanilla/node_modules/rollup/dist/loadConfigFile.d.ts +20 -0
- package/templates/vanilla/node_modules/rollup/dist/loadConfigFile.js +29 -0
- package/templates/vanilla/node_modules/rollup/dist/rollup.d.ts +1012 -0
- package/templates/vanilla/node_modules/rollup/dist/rollup.js +31 -0
- package/templates/vanilla/node_modules/rollup/dist/shared/fsevents-importer.js +37 -0
- package/templates/vanilla/node_modules/rollup/dist/shared/index.js +4571 -0
- package/templates/vanilla/node_modules/rollup/dist/shared/loadConfigFile.js +546 -0
- package/templates/vanilla/node_modules/rollup/dist/shared/rollup.js +27351 -0
- package/templates/vanilla/node_modules/rollup/dist/shared/watch-cli.js +561 -0
- package/templates/vanilla/node_modules/rollup/dist/shared/watch-proxy.js +87 -0
- package/templates/vanilla/node_modules/rollup/dist/shared/watch.js +316 -0
- package/templates/vanilla/node_modules/rollup/package.json +181 -0
- package/templates/vanilla/node_modules/source-map-js/LICENSE +28 -0
- package/templates/vanilla/node_modules/source-map-js/README.md +765 -0
- package/templates/vanilla/node_modules/source-map-js/lib/array-set.js +121 -0
- package/templates/vanilla/node_modules/source-map-js/lib/base64-vlq.js +140 -0
- package/templates/vanilla/node_modules/source-map-js/lib/base64.js +67 -0
- package/templates/vanilla/node_modules/source-map-js/lib/binary-search.js +111 -0
- package/templates/vanilla/node_modules/source-map-js/lib/mapping-list.js +79 -0
- package/templates/vanilla/node_modules/source-map-js/lib/quick-sort.js +132 -0
- package/templates/vanilla/node_modules/source-map-js/lib/source-map-consumer.d.ts +1 -0
- package/templates/vanilla/node_modules/source-map-js/lib/source-map-consumer.js +1188 -0
- package/templates/vanilla/node_modules/source-map-js/lib/source-map-generator.d.ts +1 -0
- package/templates/vanilla/node_modules/source-map-js/lib/source-map-generator.js +444 -0
- package/templates/vanilla/node_modules/source-map-js/lib/source-node.d.ts +1 -0
- package/templates/vanilla/node_modules/source-map-js/lib/source-node.js +413 -0
- package/templates/vanilla/node_modules/source-map-js/lib/util.js +594 -0
- package/templates/vanilla/node_modules/source-map-js/package.json +71 -0
- package/templates/vanilla/node_modules/source-map-js/source-map.d.ts +104 -0
- package/templates/vanilla/node_modules/source-map-js/source-map.js +8 -0
- package/templates/vanilla/node_modules/vite/LICENSE.md +3396 -0
- package/templates/vanilla/node_modules/vite/README.md +20 -0
- package/templates/vanilla/node_modules/vite/bin/openChrome.applescript +95 -0
- package/templates/vanilla/node_modules/vite/bin/vite.js +61 -0
- package/templates/vanilla/node_modules/vite/client.d.ts +281 -0
- package/templates/vanilla/node_modules/vite/dist/client/client.mjs +725 -0
- package/templates/vanilla/node_modules/vite/dist/client/client.mjs.map +1 -0
- package/templates/vanilla/node_modules/vite/dist/client/env.mjs +30 -0
- package/templates/vanilla/node_modules/vite/dist/client/env.mjs.map +1 -0
- package/templates/vanilla/node_modules/vite/dist/node/chunks/dep-7ec6f216.js +914 -0
- package/templates/vanilla/node_modules/vite/dist/node/chunks/dep-827b23df.js +66713 -0
- package/templates/vanilla/node_modules/vite/dist/node/chunks/dep-c423598f.js +561 -0
- package/templates/vanilla/node_modules/vite/dist/node/chunks/dep-f0c7dae0.js +7930 -0
- package/templates/vanilla/node_modules/vite/dist/node/chunks/dep-f1e8587f.js +7646 -0
- package/templates/vanilla/node_modules/vite/dist/node/cli.js +929 -0
- package/templates/vanilla/node_modules/vite/dist/node/constants.js +130 -0
- package/templates/vanilla/node_modules/vite/dist/node/index.d.ts +3548 -0
- package/templates/vanilla/node_modules/vite/dist/node/index.js +158 -0
- package/templates/vanilla/node_modules/vite/dist/node-cjs/publicUtils.cjs +4555 -0
- package/templates/vanilla/node_modules/vite/index.cjs +34 -0
- package/templates/vanilla/node_modules/vite/package.json +173 -0
- package/templates/vanilla/node_modules/vite/types/customEvent.d.ts +35 -0
- package/templates/vanilla/node_modules/vite/types/hmrPayload.d.ts +61 -0
- package/templates/vanilla/node_modules/vite/types/hot.d.ts +32 -0
- package/templates/vanilla/node_modules/vite/types/importGlob.d.ts +97 -0
- package/templates/vanilla/node_modules/vite/types/importMeta.d.ts +26 -0
- package/templates/vanilla/node_modules/vite/types/metadata.d.ts +10 -0
- package/templates/vanilla/node_modules/vite/types/package.json +4 -0
- package/templates/vanilla/package-lock.json +589 -0
- package/templates/vanilla/package.json +17 -0
- package/templates/vanilla/src/components/App.js +60 -0
- package/templates/vanilla/src/components/Card.js +21 -0
- package/templates/vanilla/src/components/Hero.js +15 -0
- package/templates/vanilla/src/components/InteractiveDemo.js +59 -0
- package/templates/vanilla/src/main.js +9 -0
- package/templates/vanilla/src/style/main.css +172 -0
- package/templates/vanilla/vite.config.js +8 -0
- package/templates/web3/.env.example +15 -0
- package/templates/web3/.github/workflows/deploy.yml +38 -0
- package/templates/web3/README.md +33 -0
- package/templates/web3/contracts/foundry.toml +11 -0
- package/templates/web3/contracts/script/Deploy.s.sol +13 -0
- package/templates/web3/contracts/src/Counter.sol +21 -0
- package/templates/web3/index.html +13 -0
- package/templates/web3/package.json +25 -0
- package/templates/web3/scripts/chain-start.mjs +305 -0
- package/templates/web3/scripts/chain-stop.mjs +34 -0
- package/templates/web3/scripts/deploy.mjs +155 -0
- package/templates/web3/scripts/setup.mjs +42 -0
- package/templates/web3/src/components/App.js +49 -0
- package/templates/web3/src/components/CounterCard.js +111 -0
- package/templates/web3/src/main.js +54 -0
- package/templates/web3/src/style/main.css +345 -0
- package/templates/web3/vite.config.js +29 -0
|
@@ -0,0 +1,1012 @@
|
|
|
1
|
+
export const VERSION: string;
|
|
2
|
+
|
|
3
|
+
// utils
|
|
4
|
+
type NullValue = null | undefined | void;
|
|
5
|
+
type MaybeArray<T> = T | T[];
|
|
6
|
+
type MaybePromise<T> = T | Promise<T>;
|
|
7
|
+
|
|
8
|
+
type PartialNull<T> = {
|
|
9
|
+
[P in keyof T]: T[P] | null;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export interface RollupError extends RollupLog {
|
|
13
|
+
name?: string;
|
|
14
|
+
stack?: string;
|
|
15
|
+
watchFiles?: string[];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type RollupWarning = RollupLog;
|
|
19
|
+
|
|
20
|
+
export interface RollupLog {
|
|
21
|
+
binding?: string;
|
|
22
|
+
cause?: unknown;
|
|
23
|
+
code?: string;
|
|
24
|
+
exporter?: string;
|
|
25
|
+
frame?: string;
|
|
26
|
+
hook?: string;
|
|
27
|
+
id?: string;
|
|
28
|
+
ids?: string[];
|
|
29
|
+
loc?: {
|
|
30
|
+
column: number;
|
|
31
|
+
file?: string;
|
|
32
|
+
line: number;
|
|
33
|
+
};
|
|
34
|
+
message: string;
|
|
35
|
+
meta?: any;
|
|
36
|
+
names?: string[];
|
|
37
|
+
plugin?: string;
|
|
38
|
+
pluginCode?: unknown;
|
|
39
|
+
pos?: number;
|
|
40
|
+
reexporter?: string;
|
|
41
|
+
stack?: string;
|
|
42
|
+
url?: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export type LogLevel = 'warn' | 'info' | 'debug';
|
|
46
|
+
export type LogLevelOption = LogLevel | 'silent';
|
|
47
|
+
|
|
48
|
+
export type SourceMapSegment =
|
|
49
|
+
| [number]
|
|
50
|
+
| [number, number, number, number]
|
|
51
|
+
| [number, number, number, number, number];
|
|
52
|
+
|
|
53
|
+
export interface ExistingDecodedSourceMap {
|
|
54
|
+
file?: string;
|
|
55
|
+
readonly mappings: SourceMapSegment[][];
|
|
56
|
+
names: string[];
|
|
57
|
+
sourceRoot?: string;
|
|
58
|
+
sources: string[];
|
|
59
|
+
sourcesContent?: (string | null)[];
|
|
60
|
+
version: number;
|
|
61
|
+
x_google_ignoreList?: number[];
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface ExistingRawSourceMap {
|
|
65
|
+
file?: string;
|
|
66
|
+
mappings: string;
|
|
67
|
+
names: string[];
|
|
68
|
+
sourceRoot?: string;
|
|
69
|
+
sources: string[];
|
|
70
|
+
sourcesContent?: (string | null)[];
|
|
71
|
+
version: number;
|
|
72
|
+
x_google_ignoreList?: number[];
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export type DecodedSourceMapOrMissing =
|
|
76
|
+
| {
|
|
77
|
+
missing: true;
|
|
78
|
+
plugin: string;
|
|
79
|
+
}
|
|
80
|
+
| (ExistingDecodedSourceMap & { missing?: false });
|
|
81
|
+
|
|
82
|
+
export interface SourceMap {
|
|
83
|
+
file: string;
|
|
84
|
+
mappings: string;
|
|
85
|
+
names: string[];
|
|
86
|
+
sources: string[];
|
|
87
|
+
sourcesContent: (string | null)[];
|
|
88
|
+
version: number;
|
|
89
|
+
toString(): string;
|
|
90
|
+
toUrl(): string;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export type SourceMapInput = ExistingRawSourceMap | string | null | { mappings: '' };
|
|
94
|
+
|
|
95
|
+
interface ModuleOptions {
|
|
96
|
+
assertions: Record<string, string>;
|
|
97
|
+
meta: CustomPluginOptions;
|
|
98
|
+
moduleSideEffects: boolean | 'no-treeshake';
|
|
99
|
+
syntheticNamedExports: boolean | string;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface SourceDescription extends Partial<PartialNull<ModuleOptions>> {
|
|
103
|
+
ast?: AcornNode;
|
|
104
|
+
code: string;
|
|
105
|
+
map?: SourceMapInput;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export interface TransformModuleJSON {
|
|
109
|
+
ast?: AcornNode;
|
|
110
|
+
code: string;
|
|
111
|
+
// note if plugins use new this.cache to opt-out auto transform cache
|
|
112
|
+
customTransformCache: boolean;
|
|
113
|
+
originalCode: string;
|
|
114
|
+
originalSourcemap: ExistingDecodedSourceMap | null;
|
|
115
|
+
sourcemapChain: DecodedSourceMapOrMissing[];
|
|
116
|
+
transformDependencies: string[];
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export interface ModuleJSON extends TransformModuleJSON, ModuleOptions {
|
|
120
|
+
ast: AcornNode;
|
|
121
|
+
dependencies: string[];
|
|
122
|
+
id: string;
|
|
123
|
+
resolvedIds: ResolvedIdMap;
|
|
124
|
+
transformFiles: EmittedFile[] | undefined;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export interface PluginCache {
|
|
128
|
+
delete(id: string): boolean;
|
|
129
|
+
get<T = any>(id: string): T;
|
|
130
|
+
has(id: string): boolean;
|
|
131
|
+
set<T = any>(id: string, value: T): void;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export type LoggingFunction = (log: RollupLog | string | (() => RollupLog | string)) => void;
|
|
135
|
+
|
|
136
|
+
export interface MinimalPluginContext {
|
|
137
|
+
debug: LoggingFunction;
|
|
138
|
+
error: (error: RollupError | string) => never;
|
|
139
|
+
info: LoggingFunction;
|
|
140
|
+
meta: PluginContextMeta;
|
|
141
|
+
warn: LoggingFunction;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export interface EmittedAsset {
|
|
145
|
+
fileName?: string;
|
|
146
|
+
name?: string;
|
|
147
|
+
needsCodeReference?: boolean;
|
|
148
|
+
source?: string | Uint8Array;
|
|
149
|
+
type: 'asset';
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export interface EmittedChunk {
|
|
153
|
+
fileName?: string;
|
|
154
|
+
id: string;
|
|
155
|
+
implicitlyLoadedAfterOneOf?: string[];
|
|
156
|
+
importer?: string;
|
|
157
|
+
name?: string;
|
|
158
|
+
preserveSignature?: PreserveEntrySignaturesOption;
|
|
159
|
+
type: 'chunk';
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export interface EmittedPrebuiltChunk {
|
|
163
|
+
code: string;
|
|
164
|
+
exports?: string[];
|
|
165
|
+
fileName: string;
|
|
166
|
+
map?: SourceMap;
|
|
167
|
+
sourcemapFileName?: string;
|
|
168
|
+
type: 'prebuilt-chunk';
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export type EmittedFile = EmittedAsset | EmittedChunk | EmittedPrebuiltChunk;
|
|
172
|
+
|
|
173
|
+
export type EmitFile = (emittedFile: EmittedFile) => string;
|
|
174
|
+
|
|
175
|
+
interface ModuleInfo extends ModuleOptions {
|
|
176
|
+
ast: AcornNode | null;
|
|
177
|
+
code: string | null;
|
|
178
|
+
dynamicImporters: readonly string[];
|
|
179
|
+
dynamicallyImportedIdResolutions: readonly ResolvedId[];
|
|
180
|
+
dynamicallyImportedIds: readonly string[];
|
|
181
|
+
exportedBindings: Record<string, string[]> | null;
|
|
182
|
+
exports: string[] | null;
|
|
183
|
+
hasDefaultExport: boolean | null;
|
|
184
|
+
/** @deprecated Use `moduleSideEffects` instead */
|
|
185
|
+
hasModuleSideEffects: boolean | 'no-treeshake';
|
|
186
|
+
id: string;
|
|
187
|
+
implicitlyLoadedAfterOneOf: readonly string[];
|
|
188
|
+
implicitlyLoadedBefore: readonly string[];
|
|
189
|
+
importedIdResolutions: readonly ResolvedId[];
|
|
190
|
+
importedIds: readonly string[];
|
|
191
|
+
importers: readonly string[];
|
|
192
|
+
isEntry: boolean;
|
|
193
|
+
isExternal: boolean;
|
|
194
|
+
isIncluded: boolean | null;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export type GetModuleInfo = (moduleId: string) => ModuleInfo | null;
|
|
198
|
+
|
|
199
|
+
export interface CustomPluginOptions {
|
|
200
|
+
[plugin: string]: any;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
type LoggingFunctionWithPosition = (
|
|
204
|
+
log: RollupLog | string | (() => RollupLog | string),
|
|
205
|
+
pos?: number | { column: number; line: number }
|
|
206
|
+
) => void;
|
|
207
|
+
|
|
208
|
+
export interface PluginContext extends MinimalPluginContext {
|
|
209
|
+
addWatchFile: (id: string) => void;
|
|
210
|
+
cache: PluginCache;
|
|
211
|
+
debug: LoggingFunction;
|
|
212
|
+
emitFile: EmitFile;
|
|
213
|
+
error: (error: RollupError | string) => never;
|
|
214
|
+
getFileName: (fileReferenceId: string) => string;
|
|
215
|
+
getModuleIds: () => IterableIterator<string>;
|
|
216
|
+
getModuleInfo: GetModuleInfo;
|
|
217
|
+
getWatchFiles: () => string[];
|
|
218
|
+
info: LoggingFunction;
|
|
219
|
+
load: (
|
|
220
|
+
options: { id: string; resolveDependencies?: boolean } & Partial<PartialNull<ModuleOptions>>
|
|
221
|
+
) => Promise<ModuleInfo>;
|
|
222
|
+
/** @deprecated Use `this.getModuleIds` instead */
|
|
223
|
+
moduleIds: IterableIterator<string>;
|
|
224
|
+
parse: (input: string, options?: any) => AcornNode;
|
|
225
|
+
resolve: (
|
|
226
|
+
source: string,
|
|
227
|
+
importer?: string,
|
|
228
|
+
options?: {
|
|
229
|
+
assertions?: Record<string, string>;
|
|
230
|
+
custom?: CustomPluginOptions;
|
|
231
|
+
isEntry?: boolean;
|
|
232
|
+
skipSelf?: boolean;
|
|
233
|
+
}
|
|
234
|
+
) => Promise<ResolvedId | null>;
|
|
235
|
+
setAssetSource: (assetReferenceId: string, source: string | Uint8Array) => void;
|
|
236
|
+
warn: LoggingFunction;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export interface PluginContextMeta {
|
|
240
|
+
rollupVersion: string;
|
|
241
|
+
watchMode: boolean;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export interface ResolvedId extends ModuleOptions {
|
|
245
|
+
external: boolean | 'absolute';
|
|
246
|
+
id: string;
|
|
247
|
+
resolvedBy: string;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
export interface ResolvedIdMap {
|
|
251
|
+
[key: string]: ResolvedId;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
interface PartialResolvedId extends Partial<PartialNull<ModuleOptions>> {
|
|
255
|
+
external?: boolean | 'absolute' | 'relative';
|
|
256
|
+
id: string;
|
|
257
|
+
resolvedBy?: string;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
export type ResolveIdResult = string | NullValue | false | PartialResolvedId;
|
|
261
|
+
|
|
262
|
+
export type ResolveIdResultWithoutNullValue = string | false | PartialResolvedId;
|
|
263
|
+
|
|
264
|
+
export type ResolveIdHook = (
|
|
265
|
+
this: PluginContext,
|
|
266
|
+
source: string,
|
|
267
|
+
importer: string | undefined,
|
|
268
|
+
options: { assertions: Record<string, string>; custom?: CustomPluginOptions; isEntry: boolean }
|
|
269
|
+
) => ResolveIdResult;
|
|
270
|
+
|
|
271
|
+
export type ShouldTransformCachedModuleHook = (
|
|
272
|
+
this: PluginContext,
|
|
273
|
+
options: {
|
|
274
|
+
ast: AcornNode;
|
|
275
|
+
code: string;
|
|
276
|
+
id: string;
|
|
277
|
+
meta: CustomPluginOptions;
|
|
278
|
+
moduleSideEffects: boolean | 'no-treeshake';
|
|
279
|
+
resolvedSources: ResolvedIdMap;
|
|
280
|
+
syntheticNamedExports: boolean | string;
|
|
281
|
+
}
|
|
282
|
+
) => boolean | NullValue;
|
|
283
|
+
|
|
284
|
+
export type IsExternal = (
|
|
285
|
+
source: string,
|
|
286
|
+
importer: string | undefined,
|
|
287
|
+
isResolved: boolean
|
|
288
|
+
) => boolean;
|
|
289
|
+
|
|
290
|
+
export type IsPureModule = (id: string) => boolean | NullValue;
|
|
291
|
+
|
|
292
|
+
export type HasModuleSideEffects = (id: string, external: boolean) => boolean;
|
|
293
|
+
|
|
294
|
+
export type LoadResult = SourceDescription | string | NullValue;
|
|
295
|
+
|
|
296
|
+
export type LoadHook = (this: PluginContext, id: string) => LoadResult;
|
|
297
|
+
|
|
298
|
+
export interface TransformPluginContext extends PluginContext {
|
|
299
|
+
debug: LoggingFunctionWithPosition;
|
|
300
|
+
error: (error: RollupError | string, pos?: number | { column: number; line: number }) => never;
|
|
301
|
+
getCombinedSourcemap: () => SourceMap;
|
|
302
|
+
info: LoggingFunctionWithPosition;
|
|
303
|
+
warn: LoggingFunctionWithPosition;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
export type TransformResult = string | NullValue | Partial<SourceDescription>;
|
|
307
|
+
|
|
308
|
+
export type TransformHook = (
|
|
309
|
+
this: TransformPluginContext,
|
|
310
|
+
code: string,
|
|
311
|
+
id: string
|
|
312
|
+
) => TransformResult;
|
|
313
|
+
|
|
314
|
+
export type ModuleParsedHook = (this: PluginContext, info: ModuleInfo) => void;
|
|
315
|
+
|
|
316
|
+
export type RenderChunkHook = (
|
|
317
|
+
this: PluginContext,
|
|
318
|
+
code: string,
|
|
319
|
+
chunk: RenderedChunk,
|
|
320
|
+
options: NormalizedOutputOptions,
|
|
321
|
+
meta: { chunks: Record<string, RenderedChunk> }
|
|
322
|
+
) => { code: string; map?: SourceMapInput } | string | NullValue;
|
|
323
|
+
|
|
324
|
+
export type ResolveDynamicImportHook = (
|
|
325
|
+
this: PluginContext,
|
|
326
|
+
specifier: string | AcornNode,
|
|
327
|
+
importer: string,
|
|
328
|
+
options: { assertions: Record<string, string> }
|
|
329
|
+
) => ResolveIdResult;
|
|
330
|
+
|
|
331
|
+
export type ResolveImportMetaHook = (
|
|
332
|
+
this: PluginContext,
|
|
333
|
+
property: string | null,
|
|
334
|
+
options: { chunkId: string; format: InternalModuleFormat; moduleId: string }
|
|
335
|
+
) => string | NullValue;
|
|
336
|
+
|
|
337
|
+
export type ResolveFileUrlHook = (
|
|
338
|
+
this: PluginContext,
|
|
339
|
+
options: {
|
|
340
|
+
chunkId: string;
|
|
341
|
+
fileName: string;
|
|
342
|
+
format: InternalModuleFormat;
|
|
343
|
+
moduleId: string;
|
|
344
|
+
referenceId: string;
|
|
345
|
+
relativePath: string;
|
|
346
|
+
}
|
|
347
|
+
) => string | NullValue;
|
|
348
|
+
|
|
349
|
+
export type AddonHookFunction = (
|
|
350
|
+
this: PluginContext,
|
|
351
|
+
chunk: RenderedChunk
|
|
352
|
+
) => string | Promise<string>;
|
|
353
|
+
export type AddonHook = string | AddonHookFunction;
|
|
354
|
+
|
|
355
|
+
export type ChangeEvent = 'create' | 'update' | 'delete';
|
|
356
|
+
export type WatchChangeHook = (
|
|
357
|
+
this: PluginContext,
|
|
358
|
+
id: string,
|
|
359
|
+
change: { event: ChangeEvent }
|
|
360
|
+
) => void;
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* use this type for plugin annotation
|
|
364
|
+
* @example
|
|
365
|
+
* ```ts
|
|
366
|
+
* interface Options {
|
|
367
|
+
* ...
|
|
368
|
+
* }
|
|
369
|
+
* const myPlugin: PluginImpl<Options> = (options = {}) => { ... }
|
|
370
|
+
* ```
|
|
371
|
+
*/
|
|
372
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
373
|
+
export type PluginImpl<O extends object = object, A = any> = (options?: O) => Plugin<A>;
|
|
374
|
+
|
|
375
|
+
export interface OutputBundle {
|
|
376
|
+
[fileName: string]: OutputAsset | OutputChunk;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
export interface FunctionPluginHooks {
|
|
380
|
+
augmentChunkHash: (this: PluginContext, chunk: RenderedChunk) => string | void;
|
|
381
|
+
buildEnd: (this: PluginContext, error?: Error) => void;
|
|
382
|
+
buildStart: (this: PluginContext, options: NormalizedInputOptions) => void;
|
|
383
|
+
closeBundle: (this: PluginContext) => void;
|
|
384
|
+
closeWatcher: (this: PluginContext) => void;
|
|
385
|
+
generateBundle: (
|
|
386
|
+
this: PluginContext,
|
|
387
|
+
options: NormalizedOutputOptions,
|
|
388
|
+
bundle: OutputBundle,
|
|
389
|
+
isWrite: boolean
|
|
390
|
+
) => void;
|
|
391
|
+
load: LoadHook;
|
|
392
|
+
moduleParsed: ModuleParsedHook;
|
|
393
|
+
onLog: (this: MinimalPluginContext, level: LogLevel, log: RollupLog) => boolean | NullValue;
|
|
394
|
+
options: (this: MinimalPluginContext, options: InputOptions) => InputOptions | NullValue;
|
|
395
|
+
outputOptions: (this: PluginContext, options: OutputOptions) => OutputOptions | NullValue;
|
|
396
|
+
renderChunk: RenderChunkHook;
|
|
397
|
+
renderDynamicImport: (
|
|
398
|
+
this: PluginContext,
|
|
399
|
+
options: {
|
|
400
|
+
customResolution: string | null;
|
|
401
|
+
format: InternalModuleFormat;
|
|
402
|
+
moduleId: string;
|
|
403
|
+
targetModuleId: string | null;
|
|
404
|
+
}
|
|
405
|
+
) => { left: string; right: string } | NullValue;
|
|
406
|
+
renderError: (this: PluginContext, error?: Error) => void;
|
|
407
|
+
renderStart: (
|
|
408
|
+
this: PluginContext,
|
|
409
|
+
outputOptions: NormalizedOutputOptions,
|
|
410
|
+
inputOptions: NormalizedInputOptions
|
|
411
|
+
) => void;
|
|
412
|
+
resolveDynamicImport: ResolveDynamicImportHook;
|
|
413
|
+
resolveFileUrl: ResolveFileUrlHook;
|
|
414
|
+
resolveId: ResolveIdHook;
|
|
415
|
+
resolveImportMeta: ResolveImportMetaHook;
|
|
416
|
+
shouldTransformCachedModule: ShouldTransformCachedModuleHook;
|
|
417
|
+
transform: TransformHook;
|
|
418
|
+
watchChange: WatchChangeHook;
|
|
419
|
+
writeBundle: (
|
|
420
|
+
this: PluginContext,
|
|
421
|
+
options: NormalizedOutputOptions,
|
|
422
|
+
bundle: OutputBundle
|
|
423
|
+
) => void;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
export type OutputPluginHooks =
|
|
427
|
+
| 'augmentChunkHash'
|
|
428
|
+
| 'generateBundle'
|
|
429
|
+
| 'outputOptions'
|
|
430
|
+
| 'renderChunk'
|
|
431
|
+
| 'renderDynamicImport'
|
|
432
|
+
| 'renderError'
|
|
433
|
+
| 'renderStart'
|
|
434
|
+
| 'resolveFileUrl'
|
|
435
|
+
| 'resolveImportMeta'
|
|
436
|
+
| 'writeBundle';
|
|
437
|
+
|
|
438
|
+
export type InputPluginHooks = Exclude<keyof FunctionPluginHooks, OutputPluginHooks>;
|
|
439
|
+
|
|
440
|
+
export type SyncPluginHooks =
|
|
441
|
+
| 'augmentChunkHash'
|
|
442
|
+
| 'onLog'
|
|
443
|
+
| 'outputOptions'
|
|
444
|
+
| 'renderDynamicImport'
|
|
445
|
+
| 'resolveFileUrl'
|
|
446
|
+
| 'resolveImportMeta';
|
|
447
|
+
|
|
448
|
+
export type AsyncPluginHooks = Exclude<keyof FunctionPluginHooks, SyncPluginHooks>;
|
|
449
|
+
|
|
450
|
+
export type FirstPluginHooks =
|
|
451
|
+
| 'load'
|
|
452
|
+
| 'renderDynamicImport'
|
|
453
|
+
| 'resolveDynamicImport'
|
|
454
|
+
| 'resolveFileUrl'
|
|
455
|
+
| 'resolveId'
|
|
456
|
+
| 'resolveImportMeta'
|
|
457
|
+
| 'shouldTransformCachedModule';
|
|
458
|
+
|
|
459
|
+
export type SequentialPluginHooks =
|
|
460
|
+
| 'augmentChunkHash'
|
|
461
|
+
| 'generateBundle'
|
|
462
|
+
| 'onLog'
|
|
463
|
+
| 'options'
|
|
464
|
+
| 'outputOptions'
|
|
465
|
+
| 'renderChunk'
|
|
466
|
+
| 'transform';
|
|
467
|
+
|
|
468
|
+
export type ParallelPluginHooks = Exclude<
|
|
469
|
+
keyof FunctionPluginHooks | AddonHooks,
|
|
470
|
+
FirstPluginHooks | SequentialPluginHooks
|
|
471
|
+
>;
|
|
472
|
+
|
|
473
|
+
export type AddonHooks = 'banner' | 'footer' | 'intro' | 'outro';
|
|
474
|
+
|
|
475
|
+
type MakeAsync<Function_> = Function_ extends (
|
|
476
|
+
this: infer This,
|
|
477
|
+
...parameters: infer Arguments
|
|
478
|
+
) => infer Return
|
|
479
|
+
? (this: This, ...parameters: Arguments) => Return | Promise<Return>
|
|
480
|
+
: never;
|
|
481
|
+
|
|
482
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
483
|
+
type ObjectHook<T, O = {}> = T | ({ handler: T; order?: 'pre' | 'post' | null } & O);
|
|
484
|
+
|
|
485
|
+
export type PluginHooks = {
|
|
486
|
+
[K in keyof FunctionPluginHooks]: ObjectHook<
|
|
487
|
+
K extends AsyncPluginHooks ? MakeAsync<FunctionPluginHooks[K]> : FunctionPluginHooks[K],
|
|
488
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
489
|
+
K extends ParallelPluginHooks ? { sequential?: boolean } : {}
|
|
490
|
+
>;
|
|
491
|
+
};
|
|
492
|
+
|
|
493
|
+
export interface OutputPlugin
|
|
494
|
+
extends Partial<{ [K in OutputPluginHooks]: PluginHooks[K] }>,
|
|
495
|
+
Partial<{ [K in AddonHooks]: ObjectHook<AddonHook> }> {
|
|
496
|
+
cacheKey?: string;
|
|
497
|
+
name: string;
|
|
498
|
+
version?: string;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
export interface Plugin<A = any> extends OutputPlugin, Partial<PluginHooks> {
|
|
502
|
+
// for inter-plugin communication
|
|
503
|
+
api?: A;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
export type TreeshakingPreset = 'smallest' | 'safest' | 'recommended';
|
|
507
|
+
|
|
508
|
+
export interface NormalizedTreeshakingOptions {
|
|
509
|
+
annotations: boolean;
|
|
510
|
+
correctVarValueBeforeDeclaration: boolean;
|
|
511
|
+
manualPureFunctions: readonly string[];
|
|
512
|
+
moduleSideEffects: HasModuleSideEffects;
|
|
513
|
+
propertyReadSideEffects: boolean | 'always';
|
|
514
|
+
tryCatchDeoptimization: boolean;
|
|
515
|
+
unknownGlobalSideEffects: boolean;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
export interface TreeshakingOptions
|
|
519
|
+
extends Partial<Omit<NormalizedTreeshakingOptions, 'moduleSideEffects'>> {
|
|
520
|
+
moduleSideEffects?: ModuleSideEffectsOption;
|
|
521
|
+
preset?: TreeshakingPreset;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
interface ManualChunkMeta {
|
|
525
|
+
getModuleIds: () => IterableIterator<string>;
|
|
526
|
+
getModuleInfo: GetModuleInfo;
|
|
527
|
+
}
|
|
528
|
+
export type GetManualChunk = (id: string, meta: ManualChunkMeta) => string | NullValue;
|
|
529
|
+
|
|
530
|
+
export type ExternalOption =
|
|
531
|
+
| (string | RegExp)[]
|
|
532
|
+
| string
|
|
533
|
+
| RegExp
|
|
534
|
+
| ((source: string, importer: string | undefined, isResolved: boolean) => boolean | NullValue);
|
|
535
|
+
|
|
536
|
+
export type GlobalsOption = { [name: string]: string } | ((name: string) => string);
|
|
537
|
+
|
|
538
|
+
export type InputOption = string | string[] | { [entryAlias: string]: string };
|
|
539
|
+
|
|
540
|
+
export type ManualChunksOption = { [chunkAlias: string]: string[] } | GetManualChunk;
|
|
541
|
+
|
|
542
|
+
export type LogHandlerWithDefault = (
|
|
543
|
+
level: LogLevel,
|
|
544
|
+
log: RollupLog,
|
|
545
|
+
defaultHandler: LogOrStringHandler
|
|
546
|
+
) => void;
|
|
547
|
+
|
|
548
|
+
export type LogOrStringHandler = (level: LogLevel | 'error', log: RollupLog | string) => void;
|
|
549
|
+
|
|
550
|
+
export type LogHandler = (level: LogLevel, log: RollupLog) => void;
|
|
551
|
+
|
|
552
|
+
export type ModuleSideEffectsOption = boolean | 'no-external' | string[] | HasModuleSideEffects;
|
|
553
|
+
|
|
554
|
+
export type PreserveEntrySignaturesOption = false | 'strict' | 'allow-extension' | 'exports-only';
|
|
555
|
+
|
|
556
|
+
export type SourcemapPathTransformOption = (
|
|
557
|
+
relativeSourcePath: string,
|
|
558
|
+
sourcemapPath: string
|
|
559
|
+
) => string;
|
|
560
|
+
|
|
561
|
+
export type SourcemapIgnoreListOption = (
|
|
562
|
+
relativeSourcePath: string,
|
|
563
|
+
sourcemapPath: string
|
|
564
|
+
) => boolean;
|
|
565
|
+
|
|
566
|
+
export type InputPluginOption = MaybePromise<Plugin | NullValue | false | InputPluginOption[]>;
|
|
567
|
+
|
|
568
|
+
export interface InputOptions {
|
|
569
|
+
acorn?: Record<string, unknown>;
|
|
570
|
+
acornInjectPlugins?: ((...arguments_: any[]) => unknown)[] | ((...arguments_: any[]) => unknown);
|
|
571
|
+
cache?: boolean | RollupCache;
|
|
572
|
+
context?: string;
|
|
573
|
+
experimentalCacheExpiry?: number;
|
|
574
|
+
experimentalLogSideEffects?: boolean;
|
|
575
|
+
external?: ExternalOption;
|
|
576
|
+
/** @deprecated Use the "inlineDynamicImports" output option instead. */
|
|
577
|
+
inlineDynamicImports?: boolean;
|
|
578
|
+
input?: InputOption;
|
|
579
|
+
logLevel?: LogLevelOption;
|
|
580
|
+
makeAbsoluteExternalsRelative?: boolean | 'ifRelativeSource';
|
|
581
|
+
/** @deprecated Use the "manualChunks" output option instead. */
|
|
582
|
+
manualChunks?: ManualChunksOption;
|
|
583
|
+
maxParallelFileOps?: number;
|
|
584
|
+
/** @deprecated Use the "maxParallelFileOps" option instead. */
|
|
585
|
+
maxParallelFileReads?: number;
|
|
586
|
+
moduleContext?: ((id: string) => string | NullValue) | { [id: string]: string };
|
|
587
|
+
onLog?: LogHandlerWithDefault;
|
|
588
|
+
onwarn?: WarningHandlerWithDefault;
|
|
589
|
+
perf?: boolean;
|
|
590
|
+
plugins?: InputPluginOption;
|
|
591
|
+
preserveEntrySignatures?: PreserveEntrySignaturesOption;
|
|
592
|
+
/** @deprecated Use the "preserveModules" output option instead. */
|
|
593
|
+
preserveModules?: boolean;
|
|
594
|
+
preserveSymlinks?: boolean;
|
|
595
|
+
shimMissingExports?: boolean;
|
|
596
|
+
strictDeprecations?: boolean;
|
|
597
|
+
treeshake?: boolean | TreeshakingPreset | TreeshakingOptions;
|
|
598
|
+
watch?: WatcherOptions | false;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
export interface InputOptionsWithPlugins extends InputOptions {
|
|
602
|
+
plugins: Plugin[];
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
export interface NormalizedInputOptions {
|
|
606
|
+
acorn: Record<string, unknown>;
|
|
607
|
+
acornInjectPlugins: (() => unknown)[];
|
|
608
|
+
cache: false | undefined | RollupCache;
|
|
609
|
+
context: string;
|
|
610
|
+
experimentalCacheExpiry: number;
|
|
611
|
+
experimentalLogSideEffects: boolean;
|
|
612
|
+
external: IsExternal;
|
|
613
|
+
/** @deprecated Use the "inlineDynamicImports" output option instead. */
|
|
614
|
+
inlineDynamicImports: boolean | undefined;
|
|
615
|
+
input: string[] | { [entryAlias: string]: string };
|
|
616
|
+
logLevel: LogLevelOption;
|
|
617
|
+
makeAbsoluteExternalsRelative: boolean | 'ifRelativeSource';
|
|
618
|
+
/** @deprecated Use the "manualChunks" output option instead. */
|
|
619
|
+
manualChunks: ManualChunksOption | undefined;
|
|
620
|
+
maxParallelFileOps: number;
|
|
621
|
+
/** @deprecated Use the "maxParallelFileOps" option instead. */
|
|
622
|
+
maxParallelFileReads: number;
|
|
623
|
+
moduleContext: (id: string) => string;
|
|
624
|
+
onLog: LogHandler;
|
|
625
|
+
onwarn: (warning: RollupLog) => void;
|
|
626
|
+
perf: boolean;
|
|
627
|
+
plugins: Plugin[];
|
|
628
|
+
preserveEntrySignatures: PreserveEntrySignaturesOption;
|
|
629
|
+
/** @deprecated Use the "preserveModules" output option instead. */
|
|
630
|
+
preserveModules: boolean | undefined;
|
|
631
|
+
preserveSymlinks: boolean;
|
|
632
|
+
shimMissingExports: boolean;
|
|
633
|
+
strictDeprecations: boolean;
|
|
634
|
+
treeshake: false | NormalizedTreeshakingOptions;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
export type InternalModuleFormat = 'amd' | 'cjs' | 'es' | 'iife' | 'system' | 'umd';
|
|
638
|
+
|
|
639
|
+
export type ModuleFormat = InternalModuleFormat | 'commonjs' | 'esm' | 'module' | 'systemjs';
|
|
640
|
+
|
|
641
|
+
type GeneratedCodePreset = 'es5' | 'es2015';
|
|
642
|
+
|
|
643
|
+
interface NormalizedGeneratedCodeOptions {
|
|
644
|
+
arrowFunctions: boolean;
|
|
645
|
+
constBindings: boolean;
|
|
646
|
+
objectShorthand: boolean;
|
|
647
|
+
reservedNamesAsProps: boolean;
|
|
648
|
+
symbols: boolean;
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
interface GeneratedCodeOptions extends Partial<NormalizedGeneratedCodeOptions> {
|
|
652
|
+
preset?: GeneratedCodePreset;
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
export type OptionsPaths = Record<string, string> | ((id: string) => string);
|
|
656
|
+
|
|
657
|
+
export type InteropType = 'compat' | 'auto' | 'esModule' | 'default' | 'defaultOnly';
|
|
658
|
+
|
|
659
|
+
export type GetInterop = (id: string | null) => InteropType;
|
|
660
|
+
|
|
661
|
+
export type AmdOptions = (
|
|
662
|
+
| {
|
|
663
|
+
autoId?: false;
|
|
664
|
+
id: string;
|
|
665
|
+
}
|
|
666
|
+
| {
|
|
667
|
+
autoId: true;
|
|
668
|
+
basePath?: string;
|
|
669
|
+
id?: undefined;
|
|
670
|
+
}
|
|
671
|
+
| {
|
|
672
|
+
autoId?: false;
|
|
673
|
+
id?: undefined;
|
|
674
|
+
}
|
|
675
|
+
) & {
|
|
676
|
+
define?: string;
|
|
677
|
+
forceJsExtensionForImports?: boolean;
|
|
678
|
+
};
|
|
679
|
+
|
|
680
|
+
export type NormalizedAmdOptions = (
|
|
681
|
+
| {
|
|
682
|
+
autoId: false;
|
|
683
|
+
id?: string;
|
|
684
|
+
}
|
|
685
|
+
| {
|
|
686
|
+
autoId: true;
|
|
687
|
+
basePath: string;
|
|
688
|
+
}
|
|
689
|
+
) & {
|
|
690
|
+
define: string;
|
|
691
|
+
forceJsExtensionForImports: boolean;
|
|
692
|
+
};
|
|
693
|
+
|
|
694
|
+
type AddonFunction = (chunk: RenderedChunk) => string | Promise<string>;
|
|
695
|
+
|
|
696
|
+
type OutputPluginOption = MaybePromise<OutputPlugin | NullValue | false | OutputPluginOption[]>;
|
|
697
|
+
|
|
698
|
+
export interface OutputOptions {
|
|
699
|
+
amd?: AmdOptions;
|
|
700
|
+
assetFileNames?: string | ((chunkInfo: PreRenderedAsset) => string);
|
|
701
|
+
banner?: string | AddonFunction;
|
|
702
|
+
chunkFileNames?: string | ((chunkInfo: PreRenderedChunk) => string);
|
|
703
|
+
compact?: boolean;
|
|
704
|
+
// only required for bundle.write
|
|
705
|
+
dir?: string;
|
|
706
|
+
/** @deprecated Use the "renderDynamicImport" plugin hook instead. */
|
|
707
|
+
dynamicImportFunction?: string;
|
|
708
|
+
dynamicImportInCjs?: boolean;
|
|
709
|
+
entryFileNames?: string | ((chunkInfo: PreRenderedChunk) => string);
|
|
710
|
+
esModule?: boolean | 'if-default-prop';
|
|
711
|
+
/** @deprecated This option is no longer needed and ignored. */
|
|
712
|
+
experimentalDeepDynamicChunkOptimization?: boolean;
|
|
713
|
+
experimentalMinChunkSize?: number;
|
|
714
|
+
exports?: 'default' | 'named' | 'none' | 'auto';
|
|
715
|
+
extend?: boolean;
|
|
716
|
+
externalImportAssertions?: boolean;
|
|
717
|
+
externalLiveBindings?: boolean;
|
|
718
|
+
// only required for bundle.write
|
|
719
|
+
file?: string;
|
|
720
|
+
footer?: string | AddonFunction;
|
|
721
|
+
format?: ModuleFormat;
|
|
722
|
+
freeze?: boolean;
|
|
723
|
+
generatedCode?: GeneratedCodePreset | GeneratedCodeOptions;
|
|
724
|
+
globals?: GlobalsOption;
|
|
725
|
+
hoistTransitiveImports?: boolean;
|
|
726
|
+
indent?: string | boolean;
|
|
727
|
+
inlineDynamicImports?: boolean;
|
|
728
|
+
interop?: InteropType | GetInterop;
|
|
729
|
+
intro?: string | AddonFunction;
|
|
730
|
+
manualChunks?: ManualChunksOption;
|
|
731
|
+
minifyInternalExports?: boolean;
|
|
732
|
+
name?: string;
|
|
733
|
+
/** @deprecated Use "generatedCode.symbols" instead. */
|
|
734
|
+
namespaceToStringTag?: boolean;
|
|
735
|
+
noConflict?: boolean;
|
|
736
|
+
outro?: string | AddonFunction;
|
|
737
|
+
paths?: OptionsPaths;
|
|
738
|
+
plugins?: OutputPluginOption;
|
|
739
|
+
/** @deprecated Use "generatedCode.constBindings" instead. */
|
|
740
|
+
preferConst?: boolean;
|
|
741
|
+
preserveModules?: boolean;
|
|
742
|
+
preserveModulesRoot?: string;
|
|
743
|
+
sanitizeFileName?: boolean | ((fileName: string) => string);
|
|
744
|
+
sourcemap?: boolean | 'inline' | 'hidden';
|
|
745
|
+
sourcemapBaseUrl?: string;
|
|
746
|
+
sourcemapExcludeSources?: boolean;
|
|
747
|
+
sourcemapFile?: string;
|
|
748
|
+
sourcemapFileNames?: string | ((chunkInfo: PreRenderedChunk) => string);
|
|
749
|
+
sourcemapIgnoreList?: boolean | SourcemapIgnoreListOption;
|
|
750
|
+
sourcemapPathTransform?: SourcemapPathTransformOption;
|
|
751
|
+
strict?: boolean;
|
|
752
|
+
systemNullSetters?: boolean;
|
|
753
|
+
validate?: boolean;
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
export interface NormalizedOutputOptions {
|
|
757
|
+
amd: NormalizedAmdOptions;
|
|
758
|
+
assetFileNames: string | ((chunkInfo: PreRenderedAsset) => string);
|
|
759
|
+
banner: AddonFunction;
|
|
760
|
+
chunkFileNames: string | ((chunkInfo: PreRenderedChunk) => string);
|
|
761
|
+
compact: boolean;
|
|
762
|
+
dir: string | undefined;
|
|
763
|
+
/** @deprecated Use the "renderDynamicImport" plugin hook instead. */
|
|
764
|
+
dynamicImportFunction: string | undefined;
|
|
765
|
+
dynamicImportInCjs: boolean;
|
|
766
|
+
entryFileNames: string | ((chunkInfo: PreRenderedChunk) => string);
|
|
767
|
+
esModule: boolean | 'if-default-prop';
|
|
768
|
+
/** @deprecated This option is no longer needed and ignored. */
|
|
769
|
+
experimentalDeepDynamicChunkOptimization: boolean;
|
|
770
|
+
experimentalMinChunkSize: number;
|
|
771
|
+
exports: 'default' | 'named' | 'none' | 'auto';
|
|
772
|
+
extend: boolean;
|
|
773
|
+
externalImportAssertions: boolean;
|
|
774
|
+
externalLiveBindings: boolean;
|
|
775
|
+
file: string | undefined;
|
|
776
|
+
footer: AddonFunction;
|
|
777
|
+
format: InternalModuleFormat;
|
|
778
|
+
freeze: boolean;
|
|
779
|
+
generatedCode: NormalizedGeneratedCodeOptions;
|
|
780
|
+
globals: GlobalsOption;
|
|
781
|
+
hoistTransitiveImports: boolean;
|
|
782
|
+
indent: true | string;
|
|
783
|
+
inlineDynamicImports: boolean;
|
|
784
|
+
interop: GetInterop;
|
|
785
|
+
intro: AddonFunction;
|
|
786
|
+
manualChunks: ManualChunksOption;
|
|
787
|
+
minifyInternalExports: boolean;
|
|
788
|
+
name: string | undefined;
|
|
789
|
+
/** @deprecated Use "generatedCode.symbols" instead. */
|
|
790
|
+
namespaceToStringTag: boolean;
|
|
791
|
+
noConflict: boolean;
|
|
792
|
+
outro: AddonFunction;
|
|
793
|
+
paths: OptionsPaths;
|
|
794
|
+
plugins: OutputPlugin[];
|
|
795
|
+
/** @deprecated Use "generatedCode.constBindings" instead. */
|
|
796
|
+
preferConst: boolean;
|
|
797
|
+
preserveModules: boolean;
|
|
798
|
+
preserveModulesRoot: string | undefined;
|
|
799
|
+
sanitizeFileName: (fileName: string) => string;
|
|
800
|
+
sourcemap: boolean | 'inline' | 'hidden';
|
|
801
|
+
sourcemapBaseUrl: string | undefined;
|
|
802
|
+
sourcemapExcludeSources: boolean;
|
|
803
|
+
sourcemapFile: string | undefined;
|
|
804
|
+
sourcemapFileNames: string | ((chunkInfo: PreRenderedChunk) => string) | undefined;
|
|
805
|
+
sourcemapIgnoreList: SourcemapIgnoreListOption;
|
|
806
|
+
sourcemapPathTransform: SourcemapPathTransformOption | undefined;
|
|
807
|
+
strict: boolean;
|
|
808
|
+
systemNullSetters: boolean;
|
|
809
|
+
validate: boolean;
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
export type WarningHandlerWithDefault = (
|
|
813
|
+
warning: RollupLog,
|
|
814
|
+
defaultHandler: LoggingFunction
|
|
815
|
+
) => void;
|
|
816
|
+
|
|
817
|
+
export interface SerializedTimings {
|
|
818
|
+
[label: string]: [number, number, number];
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
export interface PreRenderedAsset {
|
|
822
|
+
name: string | undefined;
|
|
823
|
+
source: string | Uint8Array;
|
|
824
|
+
type: 'asset';
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
export interface OutputAsset extends PreRenderedAsset {
|
|
828
|
+
fileName: string;
|
|
829
|
+
needsCodeReference: boolean;
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
export interface RenderedModule {
|
|
833
|
+
readonly code: string | null;
|
|
834
|
+
originalLength: number;
|
|
835
|
+
removedExports: string[];
|
|
836
|
+
renderedExports: string[];
|
|
837
|
+
renderedLength: number;
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
export interface PreRenderedChunk {
|
|
841
|
+
exports: string[];
|
|
842
|
+
facadeModuleId: string | null;
|
|
843
|
+
isDynamicEntry: boolean;
|
|
844
|
+
isEntry: boolean;
|
|
845
|
+
isImplicitEntry: boolean;
|
|
846
|
+
moduleIds: string[];
|
|
847
|
+
name: string;
|
|
848
|
+
type: 'chunk';
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
export interface RenderedChunk extends PreRenderedChunk {
|
|
852
|
+
dynamicImports: string[];
|
|
853
|
+
fileName: string;
|
|
854
|
+
implicitlyLoadedBefore: string[];
|
|
855
|
+
importedBindings: {
|
|
856
|
+
[imported: string]: string[];
|
|
857
|
+
};
|
|
858
|
+
imports: string[];
|
|
859
|
+
modules: {
|
|
860
|
+
[id: string]: RenderedModule;
|
|
861
|
+
};
|
|
862
|
+
referencedFiles: string[];
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
export interface OutputChunk extends RenderedChunk {
|
|
866
|
+
code: string;
|
|
867
|
+
map: SourceMap | null;
|
|
868
|
+
sourcemapFileName: string | null;
|
|
869
|
+
preliminaryFileName: string;
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
export interface SerializablePluginCache {
|
|
873
|
+
[key: string]: [number, any];
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
export interface RollupCache {
|
|
877
|
+
modules: ModuleJSON[];
|
|
878
|
+
plugins?: Record<string, SerializablePluginCache>;
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
export interface RollupOutput {
|
|
882
|
+
output: [OutputChunk, ...(OutputChunk | OutputAsset)[]];
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
export interface RollupBuild {
|
|
886
|
+
cache: RollupCache | undefined;
|
|
887
|
+
close: () => Promise<void>;
|
|
888
|
+
closed: boolean;
|
|
889
|
+
generate: (outputOptions: OutputOptions) => Promise<RollupOutput>;
|
|
890
|
+
getTimings?: () => SerializedTimings;
|
|
891
|
+
watchFiles: string[];
|
|
892
|
+
write: (options: OutputOptions) => Promise<RollupOutput>;
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
export interface RollupOptions extends InputOptions {
|
|
896
|
+
// This is included for compatibility with config files but ignored by rollup.rollup
|
|
897
|
+
output?: OutputOptions | OutputOptions[];
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
export interface MergedRollupOptions extends InputOptionsWithPlugins {
|
|
901
|
+
output: OutputOptions[];
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
export function rollup(options: RollupOptions): Promise<RollupBuild>;
|
|
905
|
+
|
|
906
|
+
export interface ChokidarOptions {
|
|
907
|
+
alwaysStat?: boolean;
|
|
908
|
+
atomic?: boolean | number;
|
|
909
|
+
awaitWriteFinish?:
|
|
910
|
+
| {
|
|
911
|
+
pollInterval?: number;
|
|
912
|
+
stabilityThreshold?: number;
|
|
913
|
+
}
|
|
914
|
+
| boolean;
|
|
915
|
+
binaryInterval?: number;
|
|
916
|
+
cwd?: string;
|
|
917
|
+
depth?: number;
|
|
918
|
+
disableGlobbing?: boolean;
|
|
919
|
+
followSymlinks?: boolean;
|
|
920
|
+
ignoreInitial?: boolean;
|
|
921
|
+
ignorePermissionErrors?: boolean;
|
|
922
|
+
ignored?: any;
|
|
923
|
+
interval?: number;
|
|
924
|
+
persistent?: boolean;
|
|
925
|
+
useFsEvents?: boolean;
|
|
926
|
+
usePolling?: boolean;
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
export type RollupWatchHooks = 'onError' | 'onStart' | 'onBundleStart' | 'onBundleEnd' | 'onEnd';
|
|
930
|
+
|
|
931
|
+
export interface WatcherOptions {
|
|
932
|
+
buildDelay?: number;
|
|
933
|
+
chokidar?: ChokidarOptions;
|
|
934
|
+
clearScreen?: boolean;
|
|
935
|
+
exclude?: string | RegExp | (string | RegExp)[];
|
|
936
|
+
include?: string | RegExp | (string | RegExp)[];
|
|
937
|
+
skipWrite?: boolean;
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
export interface RollupWatchOptions extends InputOptions {
|
|
941
|
+
output?: OutputOptions | OutputOptions[];
|
|
942
|
+
watch?: WatcherOptions | false;
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
export type AwaitedEventListener<
|
|
946
|
+
T extends { [event: string]: (...parameters: any) => any },
|
|
947
|
+
K extends keyof T
|
|
948
|
+
> = (...parameters: Parameters<T[K]>) => void | Promise<void>;
|
|
949
|
+
|
|
950
|
+
export interface AwaitingEventEmitter<T extends { [event: string]: (...parameters: any) => any }> {
|
|
951
|
+
close(): Promise<void>;
|
|
952
|
+
emit<K extends keyof T>(event: K, ...parameters: Parameters<T[K]>): Promise<unknown>;
|
|
953
|
+
/**
|
|
954
|
+
* Removes an event listener.
|
|
955
|
+
*/
|
|
956
|
+
off<K extends keyof T>(event: K, listener: AwaitedEventListener<T, K>): this;
|
|
957
|
+
/**
|
|
958
|
+
* Registers an event listener that will be awaited before Rollup continues.
|
|
959
|
+
* All listeners will be awaited in parallel while rejections are tracked via
|
|
960
|
+
* Promise.all.
|
|
961
|
+
*/
|
|
962
|
+
on<K extends keyof T>(event: K, listener: AwaitedEventListener<T, K>): this;
|
|
963
|
+
/**
|
|
964
|
+
* Registers an event listener that will be awaited before Rollup continues.
|
|
965
|
+
* All listeners will be awaited in parallel while rejections are tracked via
|
|
966
|
+
* Promise.all.
|
|
967
|
+
* Listeners are removed automatically when removeListenersForCurrentRun is
|
|
968
|
+
* called, which happens automatically after each run.
|
|
969
|
+
*/
|
|
970
|
+
onCurrentRun<K extends keyof T>(
|
|
971
|
+
event: K,
|
|
972
|
+
listener: (...parameters: Parameters<T[K]>) => Promise<ReturnType<T[K]>>
|
|
973
|
+
): this;
|
|
974
|
+
removeAllListeners(): this;
|
|
975
|
+
removeListenersForCurrentRun(): this;
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
export type RollupWatcherEvent =
|
|
979
|
+
| { code: 'START' }
|
|
980
|
+
| { code: 'BUNDLE_START'; input?: InputOption; output: readonly string[] }
|
|
981
|
+
| {
|
|
982
|
+
code: 'BUNDLE_END';
|
|
983
|
+
duration: number;
|
|
984
|
+
input?: InputOption;
|
|
985
|
+
output: readonly string[];
|
|
986
|
+
result: RollupBuild;
|
|
987
|
+
}
|
|
988
|
+
| { code: 'END' }
|
|
989
|
+
| { code: 'ERROR'; error: RollupError; result: RollupBuild | null };
|
|
990
|
+
|
|
991
|
+
export type RollupWatcher = AwaitingEventEmitter<{
|
|
992
|
+
change: (id: string, change: { event: ChangeEvent }) => void;
|
|
993
|
+
close: () => void;
|
|
994
|
+
event: (event: RollupWatcherEvent) => void;
|
|
995
|
+
restart: () => void;
|
|
996
|
+
}>;
|
|
997
|
+
|
|
998
|
+
export function watch(config: RollupWatchOptions | RollupWatchOptions[]): RollupWatcher;
|
|
999
|
+
|
|
1000
|
+
interface AcornNode {
|
|
1001
|
+
end: number;
|
|
1002
|
+
start: number;
|
|
1003
|
+
type: string;
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
export function defineConfig(options: RollupOptions): RollupOptions;
|
|
1007
|
+
export function defineConfig(options: RollupOptions[]): RollupOptions[];
|
|
1008
|
+
export function defineConfig(optionsFunction: RollupOptionsFunction): RollupOptionsFunction;
|
|
1009
|
+
|
|
1010
|
+
export type RollupOptionsFunction = (
|
|
1011
|
+
commandLineArguments: Record<string, any>
|
|
1012
|
+
) => MaybePromise<RollupOptions | RollupOptions[]>;
|