@visulima/packem 1.0.0-alpha.2 → 1.0.0-alpha.21
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/CHANGELOG.md +163 -0
- package/README.md +16 -3
- package/dist/cli.cjs +7 -1
- package/dist/cli.mjs +15 -1
- package/dist/config.cjs +1 -1
- package/dist/config.d.cts +5 -2
- package/dist/config.d.mts +5 -2
- package/dist/config.d.ts +5 -2
- package/dist/config.mjs +9 -1
- package/dist/create-bundler.cjs +93 -1
- package/dist/create-bundler.d.cts +4 -1
- package/dist/create-bundler.d.mts +4 -1
- package/dist/create-bundler.d.ts +4 -1
- package/dist/create-bundler.mjs +101 -1
- package/dist/rollup/plugins/esbuild/index.cjs +1 -0
- package/dist/rollup/plugins/esbuild/index.d.cts +9 -0
- package/dist/rollup/plugins/esbuild/index.d.mts +9 -0
- package/dist/rollup/plugins/esbuild/index.d.ts +9 -0
- package/dist/rollup/plugins/esbuild/index.mjs +9 -0
- package/dist/rollup/plugins/sucrase/index.cjs +1 -0
- package/dist/rollup/plugins/sucrase/index.d.cts +8 -0
- package/dist/rollup/plugins/sucrase/index.d.mts +8 -0
- package/dist/rollup/plugins/sucrase/index.d.ts +8 -0
- package/dist/rollup/plugins/sucrase/index.mjs +9 -0
- package/dist/rollup/plugins/swc/index.cjs +1 -0
- package/dist/rollup/plugins/swc/index.d.cts +7 -0
- package/dist/rollup/plugins/swc/index.d.mts +7 -0
- package/dist/rollup/plugins/swc/index.d.ts +7 -0
- package/dist/rollup/plugins/swc/index.mjs +9 -0
- package/dist/shared/packem.BAcY88If.mjs +9 -0
- package/dist/shared/packem.BK03IQfP.d.ts +176 -0
- package/dist/shared/packem.BchP_OVQ.d.mts +176 -0
- package/dist/shared/{packem.eS2oNfLM.d.ts → packem.C44tLE3n.d.cts} +1 -193
- package/dist/shared/{packem.eS2oNfLM.d.cts → packem.C44tLE3n.d.mts} +1 -193
- package/dist/shared/{packem.eS2oNfLM.d.mts → packem.C44tLE3n.d.ts} +1 -193
- package/dist/shared/packem.CGAPjagQ.d.cts +176 -0
- package/dist/shared/packem.CKW9adaV.cjs +1 -0
- package/dist/shared/packem.CxExFSHU.mjs +9 -0
- package/dist/shared/packem.D09xRBAa.d.cts +25 -0
- package/dist/shared/packem.D09xRBAa.d.mts +25 -0
- package/dist/shared/packem.D09xRBAa.d.ts +25 -0
- package/dist/shared/packem.DvWhOdt5.d.cts +10 -0
- package/dist/shared/packem.DvWhOdt5.d.mts +10 -0
- package/dist/shared/packem.DvWhOdt5.d.ts +10 -0
- package/package.json +57 -17
- package/dist/chunks/index.cjs +0 -1
- package/dist/chunks/index.mjs +0 -1
- package/dist/chunks/index2.cjs +0 -1
- package/dist/chunks/index2.mjs +0 -9
- package/dist/chunks/sucrase.cjs +0 -1
- package/dist/chunks/sucrase.mjs +0 -1
- package/dist/shared/packem.BF9udlBc.mjs +0 -91
- package/dist/shared/packem.Bdmp1hC5.mjs +0 -1
- package/dist/shared/packem.e4bzQy8N.cjs +0 -91
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { RollupAliasOptions } from '@rollup/plugin-alias';
|
|
2
|
+
import { RollupCommonJSOptions } from '@rollup/plugin-commonjs';
|
|
3
|
+
import { RollupJsonOptions } from '@rollup/plugin-json';
|
|
4
|
+
import { RollupNodeResolveOptions } from '@rollup/plugin-node-resolve';
|
|
5
|
+
import { RollupReplaceOptions } from '@rollup/plugin-replace';
|
|
6
|
+
import { RollupWasmOptions } from '@rollup/plugin-wasm';
|
|
7
|
+
import { FilterPattern } from '@rollup/pluginutils';
|
|
8
|
+
import { PackageJson, TsConfigResult } from '@visulima/package';
|
|
9
|
+
import { Pail } from '@visulima/pail';
|
|
10
|
+
import { Hookable } from 'hookable';
|
|
11
|
+
import { JITIOptions } from 'jiti';
|
|
12
|
+
import { RollupBuild, RollupOptions, RollupWatcher, Plugin, OutputOptions } from 'rollup';
|
|
13
|
+
import { Options } from 'rollup-plugin-dts';
|
|
14
|
+
import { NodePolyfillsOptions } from 'rollup-plugin-polyfill-node';
|
|
15
|
+
import { PluginVisualizerOptions } from 'rollup-plugin-visualizer';
|
|
16
|
+
import { E as EsbuildPluginConfig, O as Options$1 } from './packem.D09xRBAa.mjs';
|
|
17
|
+
import { S as SucrasePluginConfig } from './packem.DvWhOdt5.mjs';
|
|
18
|
+
import { S as SwcPluginConfig } from './packem.C44tLE3n.mjs';
|
|
19
|
+
|
|
20
|
+
interface CJSInteropOptions {
|
|
21
|
+
addDefaultProperty?: boolean;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
type SingleTargetDesc = {
|
|
25
|
+
dest?: string;
|
|
26
|
+
exclude?: string[] | string;
|
|
27
|
+
src: string[] | string;
|
|
28
|
+
};
|
|
29
|
+
type MultipleTargetsDesc = SingleTargetDesc | SingleTargetDesc[] | string[] | string;
|
|
30
|
+
type CopyPluginOptions = {
|
|
31
|
+
copyOnce?: boolean;
|
|
32
|
+
exactFileNames?: boolean;
|
|
33
|
+
flatten?: boolean;
|
|
34
|
+
targets: MultipleTargetsDesc;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
type JSXRemoveAttributesPlugin = {
|
|
38
|
+
attributes: string[];
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
interface LicenseOptions {
|
|
42
|
+
dependenciesMarker?: string;
|
|
43
|
+
dependenciesTemplate?: (licenses: string[], dependencyLicenseTexts: string, packageName: string | undefined) => string;
|
|
44
|
+
dtsMarker?: string;
|
|
45
|
+
dtsTemplate?: (licenses: string[], dependencyLicenseTexts: string, packageName: string | undefined) => string;
|
|
46
|
+
path?: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
interface RawLoaderOptions {
|
|
50
|
+
exclude?: FilterPattern;
|
|
51
|
+
include?: FilterPattern;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
interface PatchTypesOptions {
|
|
55
|
+
identifierReplacements?: Record<string, Record<string, string>>;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
type DeepPartial<T> = {
|
|
59
|
+
[P in keyof T]?: DeepPartial<T[P]>;
|
|
60
|
+
};
|
|
61
|
+
interface RollupDynamicImportVariablesOptions {
|
|
62
|
+
errorWhenNoFilesFound?: boolean;
|
|
63
|
+
exclude?: FilterPattern;
|
|
64
|
+
include?: FilterPattern;
|
|
65
|
+
warnOnError?: boolean;
|
|
66
|
+
}
|
|
67
|
+
interface RollupBuildOptions {
|
|
68
|
+
alias: RollupAliasOptions | false;
|
|
69
|
+
cjsInterop?: CJSInteropOptions;
|
|
70
|
+
commonjs: RollupCommonJSOptions | false;
|
|
71
|
+
copy?: CopyPluginOptions | false;
|
|
72
|
+
dts: Options;
|
|
73
|
+
dynamicVars?: RollupDynamicImportVariablesOptions | false;
|
|
74
|
+
esbuild: Options$1 | false;
|
|
75
|
+
json: RollupJsonOptions | false;
|
|
76
|
+
jsxRemoveAttributes?: JSXRemoveAttributesPlugin | false;
|
|
77
|
+
license?: LicenseOptions | false;
|
|
78
|
+
metafile?: boolean;
|
|
79
|
+
output?: OutputOptions;
|
|
80
|
+
patchTypes: PatchTypesOptions | false;
|
|
81
|
+
polyfillNode?: NodePolyfillsOptions | false;
|
|
82
|
+
preserveDynamicImports?: boolean;
|
|
83
|
+
raw?: RawLoaderOptions | false;
|
|
84
|
+
replace: RollupReplaceOptions | false;
|
|
85
|
+
resolve: RollupNodeResolveOptions | false;
|
|
86
|
+
shim?: boolean;
|
|
87
|
+
sucrase?: SucrasePluginConfig | false;
|
|
88
|
+
swc?: SwcPluginConfig | false;
|
|
89
|
+
treeshake?: RollupOptions["treeshake"];
|
|
90
|
+
visualizer?: PluginVisualizerOptions | false;
|
|
91
|
+
watch?: RollupOptions["watch"];
|
|
92
|
+
wsam?: RollupWasmOptions | false;
|
|
93
|
+
}
|
|
94
|
+
type BuildEntry = {
|
|
95
|
+
declaration?: boolean | "compatible" | "node16";
|
|
96
|
+
input: string;
|
|
97
|
+
isExecutable?: boolean;
|
|
98
|
+
name?: string;
|
|
99
|
+
outDir?: string;
|
|
100
|
+
};
|
|
101
|
+
interface BuildOptions {
|
|
102
|
+
alias: Record<string, string>;
|
|
103
|
+
cjsInterop?: boolean;
|
|
104
|
+
clean: boolean;
|
|
105
|
+
declaration?: boolean | "compatible" | "node16";
|
|
106
|
+
dependencies: string[];
|
|
107
|
+
devDependencies: string[];
|
|
108
|
+
emitCJS?: boolean;
|
|
109
|
+
emitESM?: boolean;
|
|
110
|
+
entries: BuildEntry[];
|
|
111
|
+
externals: (RegExp | string)[];
|
|
112
|
+
failOnWarn?: boolean;
|
|
113
|
+
minify: boolean;
|
|
114
|
+
name: string;
|
|
115
|
+
optionalDependencies: string[];
|
|
116
|
+
outDir: string;
|
|
117
|
+
peerDependencies: string[];
|
|
118
|
+
replace: Record<string, string>;
|
|
119
|
+
rollup: RollupBuildOptions;
|
|
120
|
+
rootDir: string;
|
|
121
|
+
sourcemap: boolean;
|
|
122
|
+
stub: boolean;
|
|
123
|
+
stubOptions: {
|
|
124
|
+
jiti: Omit<JITIOptions, "onError" | "transform">;
|
|
125
|
+
};
|
|
126
|
+
transformer?: (config: SwcPluginConfig | SucrasePluginConfig | EsbuildPluginConfig) => Plugin;
|
|
127
|
+
}
|
|
128
|
+
interface BuildHooks {
|
|
129
|
+
"build:before": (context: BuildContext) => Promise<void> | void;
|
|
130
|
+
"build:done": (context: BuildContext) => Promise<void> | void;
|
|
131
|
+
"build:prepare": (context: BuildContext) => Promise<void> | void;
|
|
132
|
+
"rollup:build": (context: BuildContext, build: RollupBuild) => Promise<void> | void;
|
|
133
|
+
"rollup:done": (context: BuildContext) => Promise<void> | void;
|
|
134
|
+
"rollup:dts:build": (context: BuildContext, build: RollupBuild) => Promise<void> | void;
|
|
135
|
+
"rollup:dts:done": (context: BuildContext) => Promise<void> | void;
|
|
136
|
+
"rollup:dts:options": (context: BuildContext, options: RollupOptions) => Promise<void> | void;
|
|
137
|
+
"rollup:options": (context: BuildContext, options: RollupOptions) => Promise<void> | void;
|
|
138
|
+
"rollup:watch": (context: BuildContext, watcher: RollupWatcher) => Promise<void> | void;
|
|
139
|
+
}
|
|
140
|
+
type BuildContextBuildEntry = {
|
|
141
|
+
bytes?: number;
|
|
142
|
+
chunk?: boolean;
|
|
143
|
+
chunks?: string[];
|
|
144
|
+
exports?: string[];
|
|
145
|
+
modules?: {
|
|
146
|
+
bytes: number;
|
|
147
|
+
id: string;
|
|
148
|
+
}[];
|
|
149
|
+
path: string;
|
|
150
|
+
type?: "asset" | "chunk" | "entry";
|
|
151
|
+
};
|
|
152
|
+
interface InternalBuildOptions extends BuildOptions {
|
|
153
|
+
transformerName: "esbuild" | "sucrase" | "swc" | undefined;
|
|
154
|
+
}
|
|
155
|
+
interface BuildContext {
|
|
156
|
+
buildEntries: BuildContextBuildEntry[];
|
|
157
|
+
dependencyGraphMap: Map<string, Set<[string, string]>>;
|
|
158
|
+
hooks: Hookable<BuildHooks>;
|
|
159
|
+
logger: Pail<never, string>;
|
|
160
|
+
mode: Mode;
|
|
161
|
+
options: InternalBuildOptions;
|
|
162
|
+
pkg: PackageJson;
|
|
163
|
+
rootDir: string;
|
|
164
|
+
tsconfig?: TsConfigResult;
|
|
165
|
+
usedImports: Set<string>;
|
|
166
|
+
warnings: Set<string>;
|
|
167
|
+
}
|
|
168
|
+
type BuildPreset = BuildConfig | (() => BuildConfig);
|
|
169
|
+
interface BuildConfig extends DeepPartial<Omit<BuildOptions, "entries">> {
|
|
170
|
+
entries?: (BuildEntry | string)[];
|
|
171
|
+
hooks?: Partial<BuildHooks>;
|
|
172
|
+
preset?: BuildPreset | string;
|
|
173
|
+
}
|
|
174
|
+
type Mode = "build" | "jit" | "watch";
|
|
175
|
+
|
|
176
|
+
export type { BuildConfig as B, Mode as M, BuildPreset as a, BuildHooks as b };
|
|
@@ -1,77 +1,4 @@
|
|
|
1
|
-
import { RollupAliasOptions } from '@rollup/plugin-alias';
|
|
2
|
-
import { RollupCommonJSOptions } from '@rollup/plugin-commonjs';
|
|
3
|
-
import { RollupJsonOptions } from '@rollup/plugin-json';
|
|
4
|
-
import { RollupNodeResolveOptions } from '@rollup/plugin-node-resolve';
|
|
5
|
-
import { RollupReplaceOptions } from '@rollup/plugin-replace';
|
|
6
|
-
import { RollupWasmOptions } from '@rollup/plugin-wasm';
|
|
7
1
|
import { FilterPattern } from '@rollup/pluginutils';
|
|
8
|
-
import { PackageJson, TsConfigResult } from '@visulima/package';
|
|
9
|
-
import { Pail } from '@visulima/pail';
|
|
10
|
-
import { Hookable } from 'hookable';
|
|
11
|
-
import { JITIOptions } from 'jiti';
|
|
12
|
-
import { RollupBuild, RollupOptions, RollupWatcher, OutputOptions } from 'rollup';
|
|
13
|
-
import { Options as Options$3 } from 'rollup-plugin-dts';
|
|
14
|
-
import { NodePolyfillsOptions } from 'rollup-plugin-polyfill-node';
|
|
15
|
-
import { PluginVisualizerOptions } from 'rollup-plugin-visualizer';
|
|
16
|
-
import { Loader, TransformOptions, BuildOptions as BuildOptions$1 } from 'esbuild';
|
|
17
|
-
import { Options as Options$2 } from 'sucrase';
|
|
18
|
-
|
|
19
|
-
interface CJSInteropOptions {
|
|
20
|
-
addDefaultProperty?: boolean;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
type SingleTargetDesc = {
|
|
24
|
-
dest?: string;
|
|
25
|
-
exclude?: string[] | string;
|
|
26
|
-
src: string[] | string;
|
|
27
|
-
};
|
|
28
|
-
type MultipleTargetsDesc = SingleTargetDesc | SingleTargetDesc[] | string[] | string;
|
|
29
|
-
type CopyPluginOptions = {
|
|
30
|
-
copyOnce?: boolean;
|
|
31
|
-
exactFileNames?: boolean;
|
|
32
|
-
flatten?: boolean;
|
|
33
|
-
targets: MultipleTargetsDesc;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
type MarkOptional<Type, Keys extends keyof Type> = Type extends Type ? Omit<Type, Keys> & Partial<Pick<Type, Keys>> : never;
|
|
37
|
-
|
|
38
|
-
type Options$1 = {
|
|
39
|
-
exclude?: FilterPattern;
|
|
40
|
-
include?: FilterPattern;
|
|
41
|
-
loaders?: Record<string, Loader | false>;
|
|
42
|
-
optimizeDeps?: MarkOptional<OptimizeDepsOptions, "cwd" | "sourceMap">;
|
|
43
|
-
sourceMap?: boolean;
|
|
44
|
-
} & Omit<TransformOptions, "loader" | "sourcemap">;
|
|
45
|
-
type OptimizeDepsOptions = {
|
|
46
|
-
cwd: string;
|
|
47
|
-
esbuildOptions?: BuildOptions$1;
|
|
48
|
-
exclude?: string[];
|
|
49
|
-
include: string[];
|
|
50
|
-
sourceMap: boolean;
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
type JSXRemoveAttributesPlugin = {
|
|
54
|
-
attributes: string[];
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
interface LicenseOptions {
|
|
58
|
-
dtsMarker?: string;
|
|
59
|
-
dtsTemplate?: (licenses: string[], dependencyLicenseTexts: string, packageName: string | undefined) => string;
|
|
60
|
-
marker?: string;
|
|
61
|
-
path?: string;
|
|
62
|
-
template?: (licenses: string[], dependencyLicenseTexts: string, packageName: string | undefined) => string;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
interface RawLoaderOptions {
|
|
66
|
-
exclude?: FilterPattern;
|
|
67
|
-
include?: FilterPattern;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
interface SucrasePluginConfig extends Options$2 {
|
|
71
|
-
exclude?: FilterPattern;
|
|
72
|
-
extensions?: string[];
|
|
73
|
-
include?: FilterPattern;
|
|
74
|
-
}
|
|
75
2
|
|
|
76
3
|
interface Plugin {
|
|
77
4
|
(module: Program): Program;
|
|
@@ -1989,123 +1916,4 @@ type SwcPluginConfig = {
|
|
|
1989
1916
|
include?: FilterPattern;
|
|
1990
1917
|
} & Exclude<Options, "configFile" | "exclude" | "filename" | "sourceMaps" | "swcrc">;
|
|
1991
1918
|
|
|
1992
|
-
|
|
1993
|
-
identifierReplacements?: Record<string, Record<string, string>>;
|
|
1994
|
-
}
|
|
1995
|
-
|
|
1996
|
-
type DeepPartial<T> = {
|
|
1997
|
-
[P in keyof T]?: DeepPartial<T[P]>;
|
|
1998
|
-
};
|
|
1999
|
-
interface RollupDynamicImportVariablesOptions {
|
|
2000
|
-
errorWhenNoFilesFound?: boolean;
|
|
2001
|
-
exclude?: FilterPattern;
|
|
2002
|
-
include?: FilterPattern;
|
|
2003
|
-
warnOnError?: boolean;
|
|
2004
|
-
}
|
|
2005
|
-
interface RollupBuildOptions {
|
|
2006
|
-
alias: RollupAliasOptions | false;
|
|
2007
|
-
cjsInterop?: CJSInteropOptions;
|
|
2008
|
-
commonjs: RollupCommonJSOptions | false;
|
|
2009
|
-
copy?: CopyPluginOptions | false;
|
|
2010
|
-
dts: Options$3;
|
|
2011
|
-
dynamicVars?: RollupDynamicImportVariablesOptions | false;
|
|
2012
|
-
esbuild: Options$1 | false;
|
|
2013
|
-
json: RollupJsonOptions | false;
|
|
2014
|
-
jsxRemoveAttributes?: JSXRemoveAttributesPlugin | false;
|
|
2015
|
-
license?: LicenseOptions | false;
|
|
2016
|
-
metafile?: boolean;
|
|
2017
|
-
output?: OutputOptions;
|
|
2018
|
-
patchTypes: PatchTypesOptions | false;
|
|
2019
|
-
polyfillNode?: NodePolyfillsOptions | false;
|
|
2020
|
-
preserveDynamicImports?: boolean;
|
|
2021
|
-
raw?: RawLoaderOptions | false;
|
|
2022
|
-
replace: RollupReplaceOptions | false;
|
|
2023
|
-
resolve: RollupNodeResolveOptions | false;
|
|
2024
|
-
shim?: boolean;
|
|
2025
|
-
sucrase?: SucrasePluginConfig | false;
|
|
2026
|
-
swc?: SwcPluginConfig | false;
|
|
2027
|
-
treeshake?: RollupOptions["treeshake"];
|
|
2028
|
-
visualizer?: PluginVisualizerOptions | false;
|
|
2029
|
-
watch?: RollupOptions["watch"];
|
|
2030
|
-
wsam?: RollupWasmOptions | false;
|
|
2031
|
-
}
|
|
2032
|
-
type BuildEntry = {
|
|
2033
|
-
declaration?: boolean | "compatible" | "node16";
|
|
2034
|
-
input: string;
|
|
2035
|
-
isExecutable?: boolean;
|
|
2036
|
-
name?: string;
|
|
2037
|
-
outDir?: string;
|
|
2038
|
-
};
|
|
2039
|
-
interface BuildOptions {
|
|
2040
|
-
alias: Record<string, string>;
|
|
2041
|
-
cjsInterop?: boolean;
|
|
2042
|
-
clean: boolean;
|
|
2043
|
-
declaration?: boolean | "compatible" | "node16";
|
|
2044
|
-
dependencies: string[];
|
|
2045
|
-
devDependencies: string[];
|
|
2046
|
-
emitCJS?: boolean;
|
|
2047
|
-
emitESM?: boolean;
|
|
2048
|
-
entries: BuildEntry[];
|
|
2049
|
-
externals: (RegExp | string)[];
|
|
2050
|
-
failOnWarn?: boolean;
|
|
2051
|
-
name: string;
|
|
2052
|
-
optionalDependencies: string[];
|
|
2053
|
-
outDir: string;
|
|
2054
|
-
peerDependencies: string[];
|
|
2055
|
-
replace: Record<string, string>;
|
|
2056
|
-
rollup: RollupBuildOptions;
|
|
2057
|
-
rootDir: string;
|
|
2058
|
-
sourcemap: boolean;
|
|
2059
|
-
stub: boolean;
|
|
2060
|
-
stubOptions: {
|
|
2061
|
-
jiti: Omit<JITIOptions, "onError" | "transform">;
|
|
2062
|
-
};
|
|
2063
|
-
target: string;
|
|
2064
|
-
transformer: "esbuild" | "sucrase" | "swc" | undefined;
|
|
2065
|
-
}
|
|
2066
|
-
interface BuildHooks {
|
|
2067
|
-
"build:before": (context: BuildContext) => Promise<void> | void;
|
|
2068
|
-
"build:done": (context: BuildContext) => Promise<void> | void;
|
|
2069
|
-
"build:prepare": (context: BuildContext) => Promise<void> | void;
|
|
2070
|
-
"rollup:build": (context: BuildContext, build: RollupBuild) => Promise<void> | void;
|
|
2071
|
-
"rollup:done": (context: BuildContext) => Promise<void> | void;
|
|
2072
|
-
"rollup:dts:build": (context: BuildContext, build: RollupBuild) => Promise<void> | void;
|
|
2073
|
-
"rollup:dts:done": (context: BuildContext) => Promise<void> | void;
|
|
2074
|
-
"rollup:dts:options": (context: BuildContext, options: RollupOptions) => Promise<void> | void;
|
|
2075
|
-
"rollup:options": (context: BuildContext, options: RollupOptions) => Promise<void> | void;
|
|
2076
|
-
"rollup:watch": (context: BuildContext, watcher: RollupWatcher) => Promise<void> | void;
|
|
2077
|
-
}
|
|
2078
|
-
type BuildContextBuildEntry = {
|
|
2079
|
-
bytes?: number;
|
|
2080
|
-
chunk?: boolean;
|
|
2081
|
-
chunks?: string[];
|
|
2082
|
-
exports?: string[];
|
|
2083
|
-
modules?: {
|
|
2084
|
-
bytes: number;
|
|
2085
|
-
id: string;
|
|
2086
|
-
}[];
|
|
2087
|
-
path: string;
|
|
2088
|
-
type?: "asset" | "chunk" | "entry";
|
|
2089
|
-
};
|
|
2090
|
-
interface BuildContext {
|
|
2091
|
-
buildEntries: BuildContextBuildEntry[];
|
|
2092
|
-
dependencyGraphMap: Map<string, Set<[string, string]>>;
|
|
2093
|
-
hooks: Hookable<BuildHooks>;
|
|
2094
|
-
logger: Pail<never, string>;
|
|
2095
|
-
mode: Mode;
|
|
2096
|
-
options: BuildOptions;
|
|
2097
|
-
pkg: PackageJson;
|
|
2098
|
-
rootDir: string;
|
|
2099
|
-
tsconfig?: TsConfigResult;
|
|
2100
|
-
usedImports: Set<string>;
|
|
2101
|
-
warnings: Set<string>;
|
|
2102
|
-
}
|
|
2103
|
-
type BuildPreset = BuildConfig | (() => BuildConfig);
|
|
2104
|
-
interface BuildConfig extends DeepPartial<Omit<BuildOptions, "entries">> {
|
|
2105
|
-
entries?: (BuildEntry | string)[];
|
|
2106
|
-
hooks?: Partial<BuildHooks>;
|
|
2107
|
-
preset?: BuildPreset | string;
|
|
2108
|
-
}
|
|
2109
|
-
type Mode = "build" | "jit" | "watch";
|
|
2110
|
-
|
|
2111
|
-
export type { BuildConfig as B, Mode as M, BuildPreset as a, BuildHooks as b };
|
|
1919
|
+
export type { SwcPluginConfig as S };
|
|
@@ -1,77 +1,4 @@
|
|
|
1
|
-
import { RollupAliasOptions } from '@rollup/plugin-alias';
|
|
2
|
-
import { RollupCommonJSOptions } from '@rollup/plugin-commonjs';
|
|
3
|
-
import { RollupJsonOptions } from '@rollup/plugin-json';
|
|
4
|
-
import { RollupNodeResolveOptions } from '@rollup/plugin-node-resolve';
|
|
5
|
-
import { RollupReplaceOptions } from '@rollup/plugin-replace';
|
|
6
|
-
import { RollupWasmOptions } from '@rollup/plugin-wasm';
|
|
7
1
|
import { FilterPattern } from '@rollup/pluginutils';
|
|
8
|
-
import { PackageJson, TsConfigResult } from '@visulima/package';
|
|
9
|
-
import { Pail } from '@visulima/pail';
|
|
10
|
-
import { Hookable } from 'hookable';
|
|
11
|
-
import { JITIOptions } from 'jiti';
|
|
12
|
-
import { RollupBuild, RollupOptions, RollupWatcher, OutputOptions } from 'rollup';
|
|
13
|
-
import { Options as Options$3 } from 'rollup-plugin-dts';
|
|
14
|
-
import { NodePolyfillsOptions } from 'rollup-plugin-polyfill-node';
|
|
15
|
-
import { PluginVisualizerOptions } from 'rollup-plugin-visualizer';
|
|
16
|
-
import { Loader, TransformOptions, BuildOptions as BuildOptions$1 } from 'esbuild';
|
|
17
|
-
import { Options as Options$2 } from 'sucrase';
|
|
18
|
-
|
|
19
|
-
interface CJSInteropOptions {
|
|
20
|
-
addDefaultProperty?: boolean;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
type SingleTargetDesc = {
|
|
24
|
-
dest?: string;
|
|
25
|
-
exclude?: string[] | string;
|
|
26
|
-
src: string[] | string;
|
|
27
|
-
};
|
|
28
|
-
type MultipleTargetsDesc = SingleTargetDesc | SingleTargetDesc[] | string[] | string;
|
|
29
|
-
type CopyPluginOptions = {
|
|
30
|
-
copyOnce?: boolean;
|
|
31
|
-
exactFileNames?: boolean;
|
|
32
|
-
flatten?: boolean;
|
|
33
|
-
targets: MultipleTargetsDesc;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
type MarkOptional<Type, Keys extends keyof Type> = Type extends Type ? Omit<Type, Keys> & Partial<Pick<Type, Keys>> : never;
|
|
37
|
-
|
|
38
|
-
type Options$1 = {
|
|
39
|
-
exclude?: FilterPattern;
|
|
40
|
-
include?: FilterPattern;
|
|
41
|
-
loaders?: Record<string, Loader | false>;
|
|
42
|
-
optimizeDeps?: MarkOptional<OptimizeDepsOptions, "cwd" | "sourceMap">;
|
|
43
|
-
sourceMap?: boolean;
|
|
44
|
-
} & Omit<TransformOptions, "loader" | "sourcemap">;
|
|
45
|
-
type OptimizeDepsOptions = {
|
|
46
|
-
cwd: string;
|
|
47
|
-
esbuildOptions?: BuildOptions$1;
|
|
48
|
-
exclude?: string[];
|
|
49
|
-
include: string[];
|
|
50
|
-
sourceMap: boolean;
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
type JSXRemoveAttributesPlugin = {
|
|
54
|
-
attributes: string[];
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
interface LicenseOptions {
|
|
58
|
-
dtsMarker?: string;
|
|
59
|
-
dtsTemplate?: (licenses: string[], dependencyLicenseTexts: string, packageName: string | undefined) => string;
|
|
60
|
-
marker?: string;
|
|
61
|
-
path?: string;
|
|
62
|
-
template?: (licenses: string[], dependencyLicenseTexts: string, packageName: string | undefined) => string;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
interface RawLoaderOptions {
|
|
66
|
-
exclude?: FilterPattern;
|
|
67
|
-
include?: FilterPattern;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
interface SucrasePluginConfig extends Options$2 {
|
|
71
|
-
exclude?: FilterPattern;
|
|
72
|
-
extensions?: string[];
|
|
73
|
-
include?: FilterPattern;
|
|
74
|
-
}
|
|
75
2
|
|
|
76
3
|
interface Plugin {
|
|
77
4
|
(module: Program): Program;
|
|
@@ -1989,123 +1916,4 @@ type SwcPluginConfig = {
|
|
|
1989
1916
|
include?: FilterPattern;
|
|
1990
1917
|
} & Exclude<Options, "configFile" | "exclude" | "filename" | "sourceMaps" | "swcrc">;
|
|
1991
1918
|
|
|
1992
|
-
|
|
1993
|
-
identifierReplacements?: Record<string, Record<string, string>>;
|
|
1994
|
-
}
|
|
1995
|
-
|
|
1996
|
-
type DeepPartial<T> = {
|
|
1997
|
-
[P in keyof T]?: DeepPartial<T[P]>;
|
|
1998
|
-
};
|
|
1999
|
-
interface RollupDynamicImportVariablesOptions {
|
|
2000
|
-
errorWhenNoFilesFound?: boolean;
|
|
2001
|
-
exclude?: FilterPattern;
|
|
2002
|
-
include?: FilterPattern;
|
|
2003
|
-
warnOnError?: boolean;
|
|
2004
|
-
}
|
|
2005
|
-
interface RollupBuildOptions {
|
|
2006
|
-
alias: RollupAliasOptions | false;
|
|
2007
|
-
cjsInterop?: CJSInteropOptions;
|
|
2008
|
-
commonjs: RollupCommonJSOptions | false;
|
|
2009
|
-
copy?: CopyPluginOptions | false;
|
|
2010
|
-
dts: Options$3;
|
|
2011
|
-
dynamicVars?: RollupDynamicImportVariablesOptions | false;
|
|
2012
|
-
esbuild: Options$1 | false;
|
|
2013
|
-
json: RollupJsonOptions | false;
|
|
2014
|
-
jsxRemoveAttributes?: JSXRemoveAttributesPlugin | false;
|
|
2015
|
-
license?: LicenseOptions | false;
|
|
2016
|
-
metafile?: boolean;
|
|
2017
|
-
output?: OutputOptions;
|
|
2018
|
-
patchTypes: PatchTypesOptions | false;
|
|
2019
|
-
polyfillNode?: NodePolyfillsOptions | false;
|
|
2020
|
-
preserveDynamicImports?: boolean;
|
|
2021
|
-
raw?: RawLoaderOptions | false;
|
|
2022
|
-
replace: RollupReplaceOptions | false;
|
|
2023
|
-
resolve: RollupNodeResolveOptions | false;
|
|
2024
|
-
shim?: boolean;
|
|
2025
|
-
sucrase?: SucrasePluginConfig | false;
|
|
2026
|
-
swc?: SwcPluginConfig | false;
|
|
2027
|
-
treeshake?: RollupOptions["treeshake"];
|
|
2028
|
-
visualizer?: PluginVisualizerOptions | false;
|
|
2029
|
-
watch?: RollupOptions["watch"];
|
|
2030
|
-
wsam?: RollupWasmOptions | false;
|
|
2031
|
-
}
|
|
2032
|
-
type BuildEntry = {
|
|
2033
|
-
declaration?: boolean | "compatible" | "node16";
|
|
2034
|
-
input: string;
|
|
2035
|
-
isExecutable?: boolean;
|
|
2036
|
-
name?: string;
|
|
2037
|
-
outDir?: string;
|
|
2038
|
-
};
|
|
2039
|
-
interface BuildOptions {
|
|
2040
|
-
alias: Record<string, string>;
|
|
2041
|
-
cjsInterop?: boolean;
|
|
2042
|
-
clean: boolean;
|
|
2043
|
-
declaration?: boolean | "compatible" | "node16";
|
|
2044
|
-
dependencies: string[];
|
|
2045
|
-
devDependencies: string[];
|
|
2046
|
-
emitCJS?: boolean;
|
|
2047
|
-
emitESM?: boolean;
|
|
2048
|
-
entries: BuildEntry[];
|
|
2049
|
-
externals: (RegExp | string)[];
|
|
2050
|
-
failOnWarn?: boolean;
|
|
2051
|
-
name: string;
|
|
2052
|
-
optionalDependencies: string[];
|
|
2053
|
-
outDir: string;
|
|
2054
|
-
peerDependencies: string[];
|
|
2055
|
-
replace: Record<string, string>;
|
|
2056
|
-
rollup: RollupBuildOptions;
|
|
2057
|
-
rootDir: string;
|
|
2058
|
-
sourcemap: boolean;
|
|
2059
|
-
stub: boolean;
|
|
2060
|
-
stubOptions: {
|
|
2061
|
-
jiti: Omit<JITIOptions, "onError" | "transform">;
|
|
2062
|
-
};
|
|
2063
|
-
target: string;
|
|
2064
|
-
transformer: "esbuild" | "sucrase" | "swc" | undefined;
|
|
2065
|
-
}
|
|
2066
|
-
interface BuildHooks {
|
|
2067
|
-
"build:before": (context: BuildContext) => Promise<void> | void;
|
|
2068
|
-
"build:done": (context: BuildContext) => Promise<void> | void;
|
|
2069
|
-
"build:prepare": (context: BuildContext) => Promise<void> | void;
|
|
2070
|
-
"rollup:build": (context: BuildContext, build: RollupBuild) => Promise<void> | void;
|
|
2071
|
-
"rollup:done": (context: BuildContext) => Promise<void> | void;
|
|
2072
|
-
"rollup:dts:build": (context: BuildContext, build: RollupBuild) => Promise<void> | void;
|
|
2073
|
-
"rollup:dts:done": (context: BuildContext) => Promise<void> | void;
|
|
2074
|
-
"rollup:dts:options": (context: BuildContext, options: RollupOptions) => Promise<void> | void;
|
|
2075
|
-
"rollup:options": (context: BuildContext, options: RollupOptions) => Promise<void> | void;
|
|
2076
|
-
"rollup:watch": (context: BuildContext, watcher: RollupWatcher) => Promise<void> | void;
|
|
2077
|
-
}
|
|
2078
|
-
type BuildContextBuildEntry = {
|
|
2079
|
-
bytes?: number;
|
|
2080
|
-
chunk?: boolean;
|
|
2081
|
-
chunks?: string[];
|
|
2082
|
-
exports?: string[];
|
|
2083
|
-
modules?: {
|
|
2084
|
-
bytes: number;
|
|
2085
|
-
id: string;
|
|
2086
|
-
}[];
|
|
2087
|
-
path: string;
|
|
2088
|
-
type?: "asset" | "chunk" | "entry";
|
|
2089
|
-
};
|
|
2090
|
-
interface BuildContext {
|
|
2091
|
-
buildEntries: BuildContextBuildEntry[];
|
|
2092
|
-
dependencyGraphMap: Map<string, Set<[string, string]>>;
|
|
2093
|
-
hooks: Hookable<BuildHooks>;
|
|
2094
|
-
logger: Pail<never, string>;
|
|
2095
|
-
mode: Mode;
|
|
2096
|
-
options: BuildOptions;
|
|
2097
|
-
pkg: PackageJson;
|
|
2098
|
-
rootDir: string;
|
|
2099
|
-
tsconfig?: TsConfigResult;
|
|
2100
|
-
usedImports: Set<string>;
|
|
2101
|
-
warnings: Set<string>;
|
|
2102
|
-
}
|
|
2103
|
-
type BuildPreset = BuildConfig | (() => BuildConfig);
|
|
2104
|
-
interface BuildConfig extends DeepPartial<Omit<BuildOptions, "entries">> {
|
|
2105
|
-
entries?: (BuildEntry | string)[];
|
|
2106
|
-
hooks?: Partial<BuildHooks>;
|
|
2107
|
-
preset?: BuildPreset | string;
|
|
2108
|
-
}
|
|
2109
|
-
type Mode = "build" | "jit" | "watch";
|
|
2110
|
-
|
|
2111
|
-
export type { BuildConfig as B, Mode as M, BuildPreset as a, BuildHooks as b };
|
|
1919
|
+
export type { SwcPluginConfig as S };
|