@visulima/packem 1.0.0-alpha.6 → 1.0.0-alpha.60
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 +395 -0
- package/LICENSE.md +1 -1
- package/README.md +16 -3
- package/dist/cli.mjs +114 -1
- package/dist/config.cjs +1 -1
- package/dist/config.d.cts +6 -5
- package/dist/config.d.mts +6 -5
- package/dist/config.d.ts +6 -5
- package/dist/config.mjs +9 -1
- package/dist/create-bundler.cjs +65 -56
- package/dist/create-bundler.d.cts +6 -5
- package/dist/create-bundler.d.mts +6 -5
- package/dist/create-bundler.d.ts +6 -5
- package/dist/create-bundler.mjs +74 -57
- package/dist/rollup/plugins/esbuild/index.cjs +1 -1
- package/dist/rollup/plugins/esbuild/index.d.cts +1 -1
- package/dist/rollup/plugins/esbuild/index.d.mts +1 -1
- package/dist/rollup/plugins/esbuild/index.d.ts +1 -1
- package/dist/rollup/plugins/esbuild/index.mjs +2 -2
- package/dist/rollup/plugins/oxc/isolated-declarations-oxc-transformer.cjs +1 -0
- package/dist/rollup/plugins/oxc/isolated-declarations-oxc-transformer.d.cts +26 -0
- package/dist/rollup/plugins/oxc/isolated-declarations-oxc-transformer.d.mts +26 -0
- package/dist/rollup/plugins/oxc/isolated-declarations-oxc-transformer.d.ts +26 -0
- package/dist/rollup/plugins/oxc/isolated-declarations-oxc-transformer.mjs +9 -0
- package/dist/rollup/plugins/sucrase/index.cjs +1 -1
- package/dist/rollup/plugins/sucrase/index.mjs +9 -1
- package/dist/rollup/plugins/swc/isolated-declarations-swc-transformer.cjs +1 -0
- package/dist/rollup/plugins/swc/isolated-declarations-swc-transformer.d.cts +26 -0
- package/dist/rollup/plugins/swc/isolated-declarations-swc-transformer.d.mts +26 -0
- package/dist/rollup/plugins/swc/isolated-declarations-swc-transformer.d.ts +26 -0
- package/dist/rollup/plugins/swc/isolated-declarations-swc-transformer.mjs +9 -0
- package/dist/rollup/plugins/swc/{index.cjs → swc-plugin.cjs} +1 -1
- package/dist/rollup/plugins/swc/{index.d.cts → swc-plugin.d.cts} +1 -1
- package/dist/rollup/plugins/swc/{index.d.mts → swc-plugin.d.mts} +1 -1
- package/dist/rollup/plugins/swc/{index.d.ts → swc-plugin.d.ts} +1 -1
- package/dist/rollup/plugins/swc/swc-plugin.mjs +9 -0
- package/dist/rollup/plugins/typescript/isolated-declarations-typescript-transformer.cjs +1 -0
- package/dist/rollup/plugins/typescript/isolated-declarations-typescript-transformer.d.cts +27 -0
- package/dist/rollup/plugins/typescript/isolated-declarations-typescript-transformer.d.mts +27 -0
- package/dist/rollup/plugins/typescript/isolated-declarations-typescript-transformer.d.ts +27 -0
- package/dist/rollup/plugins/typescript/isolated-declarations-typescript-transformer.mjs +9 -0
- package/dist/shared/packem.0q8RrsjT.mjs +9 -0
- package/dist/shared/{packem.C44tLE3n.d.cts → packem.99scXwHP.d.cts} +34 -2
- package/dist/shared/{packem.C44tLE3n.d.mts → packem.99scXwHP.d.mts} +34 -2
- package/dist/shared/{packem.C44tLE3n.d.ts → packem.99scXwHP.d.ts} +34 -2
- package/dist/shared/{packem.D1XYCEcD.d.ts → packem.BQE1Mwim.d.ts} +30 -16
- package/dist/shared/{packem.B6x1BqsW.d.cts → packem.BmkzemMv.d.cts} +30 -16
- package/dist/shared/{packem.DbDxKBpP.d.mts → packem.CtbO2Mkx.d.mts} +30 -16
- package/dist/shared/packem.DUZi_m4G.cjs +1 -0
- package/dist/shared/{packem.D09xRBAa.d.cts → packem.Db-Z_7e-.d.cts} +1 -1
- package/dist/shared/{packem.D09xRBAa.d.mts → packem.Db-Z_7e-.d.mts} +1 -1
- package/dist/shared/{packem.D09xRBAa.d.ts → packem.Db-Z_7e-.d.ts} +1 -1
- package/dist/shared/packem.DpOIkJEJ.mjs +9 -0
- package/dist/shared/packem.NVRVuzg1.cjs +1 -0
- package/package.json +127 -81
- package/dist/cli.cjs +0 -2
- package/dist/cli.d.cts +0 -2
- package/dist/cli.d.mts +0 -2
- package/dist/cli.d.ts +0 -2
- package/dist/rollup/plugins/swc/index.mjs +0 -1
- package/dist/shared/packem.Bdmp1hC5.mjs +0 -1
- package/dist/shared/packem.Bj4QPFg7.mjs +0 -1
- package/dist/shared/packem.CEXB7aOL.cjs +0 -1
- package/dist/shared/packem.uvB0cQX0.cjs +0 -1
|
@@ -11,7 +11,7 @@ interface JsMinifyOptions {
|
|
|
11
11
|
ecma?: TerserEcmaVersion;
|
|
12
12
|
keep_classnames?: boolean;
|
|
13
13
|
keep_fnames?: boolean;
|
|
14
|
-
module?: boolean;
|
|
14
|
+
module?: boolean | "unknown";
|
|
15
15
|
safari10?: boolean;
|
|
16
16
|
toplevel?: boolean;
|
|
17
17
|
sourceMap?: boolean;
|
|
@@ -198,9 +198,37 @@ interface TerserCompressOptions {
|
|
|
198
198
|
}
|
|
199
199
|
interface TerserMangleOptions {
|
|
200
200
|
props?: TerserManglePropertiesOptions;
|
|
201
|
+
/**
|
|
202
|
+
* Pass `true` to mangle names declared in the top level scope.
|
|
203
|
+
*/
|
|
204
|
+
topLevel?: boolean;
|
|
205
|
+
/**
|
|
206
|
+
* @deprecated An alias for compatibility with terser.
|
|
207
|
+
*/
|
|
201
208
|
toplevel?: boolean;
|
|
209
|
+
/**
|
|
210
|
+
* Pass `true` to not mangle class names.
|
|
211
|
+
*/
|
|
212
|
+
keepClassNames?: boolean;
|
|
213
|
+
/**
|
|
214
|
+
* @deprecated An alias for compatibility with terser.
|
|
215
|
+
*/
|
|
202
216
|
keep_classnames?: boolean;
|
|
217
|
+
/**
|
|
218
|
+
* Pass `true` to not mangle function names.
|
|
219
|
+
*/
|
|
220
|
+
keepFnNames?: boolean;
|
|
221
|
+
/**
|
|
222
|
+
* @deprecated An alias for compatibility with terser.
|
|
223
|
+
*/
|
|
203
224
|
keep_fnames?: boolean;
|
|
225
|
+
/**
|
|
226
|
+
* Pass `true` to not mangle private props.
|
|
227
|
+
*/
|
|
228
|
+
keepPrivateProps?: boolean;
|
|
229
|
+
/**
|
|
230
|
+
* @deprecated An alias for compatibility with terser.
|
|
231
|
+
*/
|
|
204
232
|
keep_private_props?: boolean;
|
|
205
233
|
ie8?: boolean;
|
|
206
234
|
safari10?: boolean;
|
|
@@ -287,7 +315,7 @@ interface Options extends Config {
|
|
|
287
315
|
* and is also available inside configuration functions, plugins,
|
|
288
316
|
* and presets, via the api.env() function.
|
|
289
317
|
*
|
|
290
|
-
* Defaults to `process.env.SWC_ENV ||
|
|
318
|
+
* Defaults to `process.env.SWC_ENV || production || "development"`
|
|
291
319
|
*/
|
|
292
320
|
envName?: string;
|
|
293
321
|
/**
|
|
@@ -480,6 +508,10 @@ interface JscConfig {
|
|
|
480
508
|
* Disable builtin transforms. If enabled, only Wasm plugins are used.
|
|
481
509
|
*/
|
|
482
510
|
disableBuiltinTransformsForInternalTesting?: boolean;
|
|
511
|
+
/**
|
|
512
|
+
* Emit isolated dts files for each module.
|
|
513
|
+
*/
|
|
514
|
+
emitIsolatedDts?: boolean;
|
|
483
515
|
};
|
|
484
516
|
baseUrl?: string;
|
|
485
517
|
paths?: {
|
|
@@ -5,17 +5,18 @@ import { RollupNodeResolveOptions } from '@rollup/plugin-node-resolve';
|
|
|
5
5
|
import { RollupReplaceOptions } from '@rollup/plugin-replace';
|
|
6
6
|
import { RollupWasmOptions } from '@rollup/plugin-wasm';
|
|
7
7
|
import { FilterPattern } from '@rollup/pluginutils';
|
|
8
|
-
import { PackageJson
|
|
8
|
+
import { PackageJson } from '@visulima/package';
|
|
9
9
|
import { Pail } from '@visulima/pail';
|
|
10
|
+
import { TsConfigResult } from '@visulima/tsconfig';
|
|
10
11
|
import { Hookable } from 'hookable';
|
|
11
12
|
import { JITIOptions } from 'jiti';
|
|
12
13
|
import { RollupBuild, RollupOptions, RollupWatcher, Plugin, OutputOptions } from 'rollup';
|
|
13
14
|
import { Options } from 'rollup-plugin-dts';
|
|
14
15
|
import { NodePolyfillsOptions } from 'rollup-plugin-polyfill-node';
|
|
15
16
|
import { PluginVisualizerOptions } from 'rollup-plugin-visualizer';
|
|
16
|
-
import { E as EsbuildPluginConfig, O as Options$1 } from './packem.
|
|
17
|
+
import { E as EsbuildPluginConfig, O as Options$1 } from './packem.Db-Z_7e-.js';
|
|
17
18
|
import { S as SucrasePluginConfig } from './packem.DvWhOdt5.js';
|
|
18
|
-
import { S as SwcPluginConfig } from './packem.
|
|
19
|
+
import { S as SwcPluginConfig } from './packem.99scXwHP.js';
|
|
19
20
|
|
|
20
21
|
interface CJSInteropOptions {
|
|
21
22
|
addDefaultProperty?: boolean;
|
|
@@ -34,16 +35,22 @@ type CopyPluginOptions = {
|
|
|
34
35
|
targets: MultipleTargetsDesc;
|
|
35
36
|
};
|
|
36
37
|
|
|
38
|
+
type IsolatedDeclarationsOptions = {
|
|
39
|
+
exclude?: FilterPattern;
|
|
40
|
+
ignoreErrors?: boolean;
|
|
41
|
+
include?: FilterPattern;
|
|
42
|
+
};
|
|
43
|
+
|
|
37
44
|
type JSXRemoveAttributesPlugin = {
|
|
38
45
|
attributes: string[];
|
|
39
46
|
};
|
|
40
47
|
|
|
41
48
|
interface LicenseOptions {
|
|
49
|
+
dependenciesMarker?: string;
|
|
50
|
+
dependenciesTemplate?: (licenses: string[], dependencyLicenseTexts: string, packageName: string | undefined) => string;
|
|
42
51
|
dtsMarker?: string;
|
|
43
52
|
dtsTemplate?: (licenses: string[], dependencyLicenseTexts: string, packageName: string | undefined) => string;
|
|
44
|
-
marker?: string;
|
|
45
53
|
path?: string;
|
|
46
|
-
template?: (licenses: string[], dependencyLicenseTexts: string, packageName: string | undefined) => string;
|
|
47
54
|
}
|
|
48
55
|
|
|
49
56
|
interface RawLoaderOptions {
|
|
@@ -72,6 +79,7 @@ interface RollupBuildOptions {
|
|
|
72
79
|
dts: Options;
|
|
73
80
|
dynamicVars?: RollupDynamicImportVariablesOptions | false;
|
|
74
81
|
esbuild: Options$1 | false;
|
|
82
|
+
isolatedDeclarations?: IsolatedDeclarationsOptions;
|
|
75
83
|
json: RollupJsonOptions | false;
|
|
76
84
|
jsxRemoveAttributes?: JSXRemoveAttributesPlugin | false;
|
|
77
85
|
license?: LicenseOptions | false;
|
|
@@ -91,40 +99,43 @@ interface RollupBuildOptions {
|
|
|
91
99
|
watch?: RollupOptions["watch"];
|
|
92
100
|
wsam?: RollupWasmOptions | false;
|
|
93
101
|
}
|
|
102
|
+
type Runtime = "react-server" | "react-native" | "edge-light" | "node";
|
|
94
103
|
type BuildEntry = {
|
|
104
|
+
cjs?: boolean;
|
|
95
105
|
declaration?: boolean | "compatible" | "node16";
|
|
106
|
+
environment?: "production" | "development";
|
|
107
|
+
esm?: boolean;
|
|
108
|
+
executable?: boolean;
|
|
96
109
|
input: string;
|
|
97
|
-
isExecutable?: boolean;
|
|
98
110
|
name?: string;
|
|
99
111
|
outDir?: string;
|
|
112
|
+
runtime?: Runtime;
|
|
100
113
|
};
|
|
101
|
-
type Target = "chrome" | "deno" | "edge" | "firefox" | "hermes" | "ie" | "ios" | "node" | "opera" | "rhino" | "safari" | "esnext" | "es5" | "es6" | "es2015" | "es2016" | "es2017" | "es2018" | "es2019" | "es2020" | "es2021" | "es2022" | "es2023";
|
|
102
114
|
interface BuildOptions {
|
|
103
115
|
alias: Record<string, string>;
|
|
104
116
|
cjsInterop?: boolean;
|
|
105
117
|
clean: boolean;
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
devDependencies: string[];
|
|
118
|
+
debug: boolean;
|
|
119
|
+
declaration?: boolean | "compatible" | "node16" | undefined;
|
|
109
120
|
emitCJS?: boolean;
|
|
110
121
|
emitESM?: boolean;
|
|
111
122
|
entries: BuildEntry[];
|
|
112
123
|
externals: (RegExp | string)[];
|
|
113
124
|
failOnWarn?: boolean;
|
|
125
|
+
fileCache?: boolean;
|
|
126
|
+
isolatedDeclarationTransformer?: (code: string, id: string) => Promise<IsolatedDeclarationsResult>;
|
|
114
127
|
minify: boolean;
|
|
115
128
|
name: string;
|
|
116
|
-
optionalDependencies: string[];
|
|
117
129
|
outDir: string;
|
|
118
|
-
peerDependencies: string[];
|
|
119
130
|
replace: Record<string, string>;
|
|
120
131
|
rollup: RollupBuildOptions;
|
|
121
132
|
rootDir: string;
|
|
133
|
+
sourceDir: string;
|
|
122
134
|
sourcemap: boolean;
|
|
123
135
|
stub: boolean;
|
|
124
136
|
stubOptions: {
|
|
125
137
|
jiti: Omit<JITIOptions, "onError" | "transform">;
|
|
126
138
|
};
|
|
127
|
-
target: Target | Target[];
|
|
128
139
|
transformer?: (config: SwcPluginConfig | SucrasePluginConfig | EsbuildPluginConfig) => Plugin;
|
|
129
140
|
}
|
|
130
141
|
interface BuildHooks {
|
|
@@ -158,11 +169,10 @@ interface BuildContext {
|
|
|
158
169
|
buildEntries: BuildContextBuildEntry[];
|
|
159
170
|
dependencyGraphMap: Map<string, Set<[string, string]>>;
|
|
160
171
|
hooks: Hookable<BuildHooks>;
|
|
161
|
-
logger: Pail
|
|
172
|
+
logger: Pail;
|
|
162
173
|
mode: Mode;
|
|
163
174
|
options: InternalBuildOptions;
|
|
164
175
|
pkg: PackageJson;
|
|
165
|
-
rootDir: string;
|
|
166
176
|
tsconfig?: TsConfigResult;
|
|
167
177
|
usedImports: Set<string>;
|
|
168
178
|
warnings: Set<string>;
|
|
@@ -174,5 +184,9 @@ interface BuildConfig extends DeepPartial<Omit<BuildOptions, "entries">> {
|
|
|
174
184
|
preset?: BuildPreset | string;
|
|
175
185
|
}
|
|
176
186
|
type Mode = "build" | "jit" | "watch";
|
|
187
|
+
interface IsolatedDeclarationsResult {
|
|
188
|
+
errors: string[];
|
|
189
|
+
sourceText: string;
|
|
190
|
+
}
|
|
177
191
|
|
|
178
|
-
export type { BuildConfig as B, Mode as M, BuildPreset as a, BuildHooks as b };
|
|
192
|
+
export type { BuildConfig as B, IsolatedDeclarationsResult as I, Mode as M, BuildPreset as a, BuildHooks as b };
|
|
@@ -5,17 +5,18 @@ import { RollupNodeResolveOptions } from '@rollup/plugin-node-resolve';
|
|
|
5
5
|
import { RollupReplaceOptions } from '@rollup/plugin-replace';
|
|
6
6
|
import { RollupWasmOptions } from '@rollup/plugin-wasm';
|
|
7
7
|
import { FilterPattern } from '@rollup/pluginutils';
|
|
8
|
-
import { PackageJson
|
|
8
|
+
import { PackageJson } from '@visulima/package';
|
|
9
9
|
import { Pail } from '@visulima/pail';
|
|
10
|
+
import { TsConfigResult } from '@visulima/tsconfig';
|
|
10
11
|
import { Hookable } from 'hookable';
|
|
11
12
|
import { JITIOptions } from 'jiti';
|
|
12
13
|
import { RollupBuild, RollupOptions, RollupWatcher, Plugin, OutputOptions } from 'rollup';
|
|
13
14
|
import { Options } from 'rollup-plugin-dts';
|
|
14
15
|
import { NodePolyfillsOptions } from 'rollup-plugin-polyfill-node';
|
|
15
16
|
import { PluginVisualizerOptions } from 'rollup-plugin-visualizer';
|
|
16
|
-
import { E as EsbuildPluginConfig, O as Options$1 } from './packem.
|
|
17
|
+
import { E as EsbuildPluginConfig, O as Options$1 } from './packem.Db-Z_7e-.cjs';
|
|
17
18
|
import { S as SucrasePluginConfig } from './packem.DvWhOdt5.cjs';
|
|
18
|
-
import { S as SwcPluginConfig } from './packem.
|
|
19
|
+
import { S as SwcPluginConfig } from './packem.99scXwHP.cjs';
|
|
19
20
|
|
|
20
21
|
interface CJSInteropOptions {
|
|
21
22
|
addDefaultProperty?: boolean;
|
|
@@ -34,16 +35,22 @@ type CopyPluginOptions = {
|
|
|
34
35
|
targets: MultipleTargetsDesc;
|
|
35
36
|
};
|
|
36
37
|
|
|
38
|
+
type IsolatedDeclarationsOptions = {
|
|
39
|
+
exclude?: FilterPattern;
|
|
40
|
+
ignoreErrors?: boolean;
|
|
41
|
+
include?: FilterPattern;
|
|
42
|
+
};
|
|
43
|
+
|
|
37
44
|
type JSXRemoveAttributesPlugin = {
|
|
38
45
|
attributes: string[];
|
|
39
46
|
};
|
|
40
47
|
|
|
41
48
|
interface LicenseOptions {
|
|
49
|
+
dependenciesMarker?: string;
|
|
50
|
+
dependenciesTemplate?: (licenses: string[], dependencyLicenseTexts: string, packageName: string | undefined) => string;
|
|
42
51
|
dtsMarker?: string;
|
|
43
52
|
dtsTemplate?: (licenses: string[], dependencyLicenseTexts: string, packageName: string | undefined) => string;
|
|
44
|
-
marker?: string;
|
|
45
53
|
path?: string;
|
|
46
|
-
template?: (licenses: string[], dependencyLicenseTexts: string, packageName: string | undefined) => string;
|
|
47
54
|
}
|
|
48
55
|
|
|
49
56
|
interface RawLoaderOptions {
|
|
@@ -72,6 +79,7 @@ interface RollupBuildOptions {
|
|
|
72
79
|
dts: Options;
|
|
73
80
|
dynamicVars?: RollupDynamicImportVariablesOptions | false;
|
|
74
81
|
esbuild: Options$1 | false;
|
|
82
|
+
isolatedDeclarations?: IsolatedDeclarationsOptions;
|
|
75
83
|
json: RollupJsonOptions | false;
|
|
76
84
|
jsxRemoveAttributes?: JSXRemoveAttributesPlugin | false;
|
|
77
85
|
license?: LicenseOptions | false;
|
|
@@ -91,40 +99,43 @@ interface RollupBuildOptions {
|
|
|
91
99
|
watch?: RollupOptions["watch"];
|
|
92
100
|
wsam?: RollupWasmOptions | false;
|
|
93
101
|
}
|
|
102
|
+
type Runtime = "react-server" | "react-native" | "edge-light" | "node";
|
|
94
103
|
type BuildEntry = {
|
|
104
|
+
cjs?: boolean;
|
|
95
105
|
declaration?: boolean | "compatible" | "node16";
|
|
106
|
+
environment?: "production" | "development";
|
|
107
|
+
esm?: boolean;
|
|
108
|
+
executable?: boolean;
|
|
96
109
|
input: string;
|
|
97
|
-
isExecutable?: boolean;
|
|
98
110
|
name?: string;
|
|
99
111
|
outDir?: string;
|
|
112
|
+
runtime?: Runtime;
|
|
100
113
|
};
|
|
101
|
-
type Target = "chrome" | "deno" | "edge" | "firefox" | "hermes" | "ie" | "ios" | "node" | "opera" | "rhino" | "safari" | "esnext" | "es5" | "es6" | "es2015" | "es2016" | "es2017" | "es2018" | "es2019" | "es2020" | "es2021" | "es2022" | "es2023";
|
|
102
114
|
interface BuildOptions {
|
|
103
115
|
alias: Record<string, string>;
|
|
104
116
|
cjsInterop?: boolean;
|
|
105
117
|
clean: boolean;
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
devDependencies: string[];
|
|
118
|
+
debug: boolean;
|
|
119
|
+
declaration?: boolean | "compatible" | "node16" | undefined;
|
|
109
120
|
emitCJS?: boolean;
|
|
110
121
|
emitESM?: boolean;
|
|
111
122
|
entries: BuildEntry[];
|
|
112
123
|
externals: (RegExp | string)[];
|
|
113
124
|
failOnWarn?: boolean;
|
|
125
|
+
fileCache?: boolean;
|
|
126
|
+
isolatedDeclarationTransformer?: (code: string, id: string) => Promise<IsolatedDeclarationsResult>;
|
|
114
127
|
minify: boolean;
|
|
115
128
|
name: string;
|
|
116
|
-
optionalDependencies: string[];
|
|
117
129
|
outDir: string;
|
|
118
|
-
peerDependencies: string[];
|
|
119
130
|
replace: Record<string, string>;
|
|
120
131
|
rollup: RollupBuildOptions;
|
|
121
132
|
rootDir: string;
|
|
133
|
+
sourceDir: string;
|
|
122
134
|
sourcemap: boolean;
|
|
123
135
|
stub: boolean;
|
|
124
136
|
stubOptions: {
|
|
125
137
|
jiti: Omit<JITIOptions, "onError" | "transform">;
|
|
126
138
|
};
|
|
127
|
-
target: Target | Target[];
|
|
128
139
|
transformer?: (config: SwcPluginConfig | SucrasePluginConfig | EsbuildPluginConfig) => Plugin;
|
|
129
140
|
}
|
|
130
141
|
interface BuildHooks {
|
|
@@ -158,11 +169,10 @@ interface BuildContext {
|
|
|
158
169
|
buildEntries: BuildContextBuildEntry[];
|
|
159
170
|
dependencyGraphMap: Map<string, Set<[string, string]>>;
|
|
160
171
|
hooks: Hookable<BuildHooks>;
|
|
161
|
-
logger: Pail
|
|
172
|
+
logger: Pail;
|
|
162
173
|
mode: Mode;
|
|
163
174
|
options: InternalBuildOptions;
|
|
164
175
|
pkg: PackageJson;
|
|
165
|
-
rootDir: string;
|
|
166
176
|
tsconfig?: TsConfigResult;
|
|
167
177
|
usedImports: Set<string>;
|
|
168
178
|
warnings: Set<string>;
|
|
@@ -174,5 +184,9 @@ interface BuildConfig extends DeepPartial<Omit<BuildOptions, "entries">> {
|
|
|
174
184
|
preset?: BuildPreset | string;
|
|
175
185
|
}
|
|
176
186
|
type Mode = "build" | "jit" | "watch";
|
|
187
|
+
interface IsolatedDeclarationsResult {
|
|
188
|
+
errors: string[];
|
|
189
|
+
sourceText: string;
|
|
190
|
+
}
|
|
177
191
|
|
|
178
|
-
export type { BuildConfig as B, Mode as M, BuildPreset as a, BuildHooks as b };
|
|
192
|
+
export type { BuildConfig as B, IsolatedDeclarationsResult as I, Mode as M, BuildPreset as a, BuildHooks as b };
|
|
@@ -5,17 +5,18 @@ import { RollupNodeResolveOptions } from '@rollup/plugin-node-resolve';
|
|
|
5
5
|
import { RollupReplaceOptions } from '@rollup/plugin-replace';
|
|
6
6
|
import { RollupWasmOptions } from '@rollup/plugin-wasm';
|
|
7
7
|
import { FilterPattern } from '@rollup/pluginutils';
|
|
8
|
-
import { PackageJson
|
|
8
|
+
import { PackageJson } from '@visulima/package';
|
|
9
9
|
import { Pail } from '@visulima/pail';
|
|
10
|
+
import { TsConfigResult } from '@visulima/tsconfig';
|
|
10
11
|
import { Hookable } from 'hookable';
|
|
11
12
|
import { JITIOptions } from 'jiti';
|
|
12
13
|
import { RollupBuild, RollupOptions, RollupWatcher, Plugin, OutputOptions } from 'rollup';
|
|
13
14
|
import { Options } from 'rollup-plugin-dts';
|
|
14
15
|
import { NodePolyfillsOptions } from 'rollup-plugin-polyfill-node';
|
|
15
16
|
import { PluginVisualizerOptions } from 'rollup-plugin-visualizer';
|
|
16
|
-
import { E as EsbuildPluginConfig, O as Options$1 } from './packem.
|
|
17
|
+
import { E as EsbuildPluginConfig, O as Options$1 } from './packem.Db-Z_7e-.mjs';
|
|
17
18
|
import { S as SucrasePluginConfig } from './packem.DvWhOdt5.mjs';
|
|
18
|
-
import { S as SwcPluginConfig } from './packem.
|
|
19
|
+
import { S as SwcPluginConfig } from './packem.99scXwHP.mjs';
|
|
19
20
|
|
|
20
21
|
interface CJSInteropOptions {
|
|
21
22
|
addDefaultProperty?: boolean;
|
|
@@ -34,16 +35,22 @@ type CopyPluginOptions = {
|
|
|
34
35
|
targets: MultipleTargetsDesc;
|
|
35
36
|
};
|
|
36
37
|
|
|
38
|
+
type IsolatedDeclarationsOptions = {
|
|
39
|
+
exclude?: FilterPattern;
|
|
40
|
+
ignoreErrors?: boolean;
|
|
41
|
+
include?: FilterPattern;
|
|
42
|
+
};
|
|
43
|
+
|
|
37
44
|
type JSXRemoveAttributesPlugin = {
|
|
38
45
|
attributes: string[];
|
|
39
46
|
};
|
|
40
47
|
|
|
41
48
|
interface LicenseOptions {
|
|
49
|
+
dependenciesMarker?: string;
|
|
50
|
+
dependenciesTemplate?: (licenses: string[], dependencyLicenseTexts: string, packageName: string | undefined) => string;
|
|
42
51
|
dtsMarker?: string;
|
|
43
52
|
dtsTemplate?: (licenses: string[], dependencyLicenseTexts: string, packageName: string | undefined) => string;
|
|
44
|
-
marker?: string;
|
|
45
53
|
path?: string;
|
|
46
|
-
template?: (licenses: string[], dependencyLicenseTexts: string, packageName: string | undefined) => string;
|
|
47
54
|
}
|
|
48
55
|
|
|
49
56
|
interface RawLoaderOptions {
|
|
@@ -72,6 +79,7 @@ interface RollupBuildOptions {
|
|
|
72
79
|
dts: Options;
|
|
73
80
|
dynamicVars?: RollupDynamicImportVariablesOptions | false;
|
|
74
81
|
esbuild: Options$1 | false;
|
|
82
|
+
isolatedDeclarations?: IsolatedDeclarationsOptions;
|
|
75
83
|
json: RollupJsonOptions | false;
|
|
76
84
|
jsxRemoveAttributes?: JSXRemoveAttributesPlugin | false;
|
|
77
85
|
license?: LicenseOptions | false;
|
|
@@ -91,40 +99,43 @@ interface RollupBuildOptions {
|
|
|
91
99
|
watch?: RollupOptions["watch"];
|
|
92
100
|
wsam?: RollupWasmOptions | false;
|
|
93
101
|
}
|
|
102
|
+
type Runtime = "react-server" | "react-native" | "edge-light" | "node";
|
|
94
103
|
type BuildEntry = {
|
|
104
|
+
cjs?: boolean;
|
|
95
105
|
declaration?: boolean | "compatible" | "node16";
|
|
106
|
+
environment?: "production" | "development";
|
|
107
|
+
esm?: boolean;
|
|
108
|
+
executable?: boolean;
|
|
96
109
|
input: string;
|
|
97
|
-
isExecutable?: boolean;
|
|
98
110
|
name?: string;
|
|
99
111
|
outDir?: string;
|
|
112
|
+
runtime?: Runtime;
|
|
100
113
|
};
|
|
101
|
-
type Target = "chrome" | "deno" | "edge" | "firefox" | "hermes" | "ie" | "ios" | "node" | "opera" | "rhino" | "safari" | "esnext" | "es5" | "es6" | "es2015" | "es2016" | "es2017" | "es2018" | "es2019" | "es2020" | "es2021" | "es2022" | "es2023";
|
|
102
114
|
interface BuildOptions {
|
|
103
115
|
alias: Record<string, string>;
|
|
104
116
|
cjsInterop?: boolean;
|
|
105
117
|
clean: boolean;
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
devDependencies: string[];
|
|
118
|
+
debug: boolean;
|
|
119
|
+
declaration?: boolean | "compatible" | "node16" | undefined;
|
|
109
120
|
emitCJS?: boolean;
|
|
110
121
|
emitESM?: boolean;
|
|
111
122
|
entries: BuildEntry[];
|
|
112
123
|
externals: (RegExp | string)[];
|
|
113
124
|
failOnWarn?: boolean;
|
|
125
|
+
fileCache?: boolean;
|
|
126
|
+
isolatedDeclarationTransformer?: (code: string, id: string) => Promise<IsolatedDeclarationsResult>;
|
|
114
127
|
minify: boolean;
|
|
115
128
|
name: string;
|
|
116
|
-
optionalDependencies: string[];
|
|
117
129
|
outDir: string;
|
|
118
|
-
peerDependencies: string[];
|
|
119
130
|
replace: Record<string, string>;
|
|
120
131
|
rollup: RollupBuildOptions;
|
|
121
132
|
rootDir: string;
|
|
133
|
+
sourceDir: string;
|
|
122
134
|
sourcemap: boolean;
|
|
123
135
|
stub: boolean;
|
|
124
136
|
stubOptions: {
|
|
125
137
|
jiti: Omit<JITIOptions, "onError" | "transform">;
|
|
126
138
|
};
|
|
127
|
-
target: Target | Target[];
|
|
128
139
|
transformer?: (config: SwcPluginConfig | SucrasePluginConfig | EsbuildPluginConfig) => Plugin;
|
|
129
140
|
}
|
|
130
141
|
interface BuildHooks {
|
|
@@ -158,11 +169,10 @@ interface BuildContext {
|
|
|
158
169
|
buildEntries: BuildContextBuildEntry[];
|
|
159
170
|
dependencyGraphMap: Map<string, Set<[string, string]>>;
|
|
160
171
|
hooks: Hookable<BuildHooks>;
|
|
161
|
-
logger: Pail
|
|
172
|
+
logger: Pail;
|
|
162
173
|
mode: Mode;
|
|
163
174
|
options: InternalBuildOptions;
|
|
164
175
|
pkg: PackageJson;
|
|
165
|
-
rootDir: string;
|
|
166
176
|
tsconfig?: TsConfigResult;
|
|
167
177
|
usedImports: Set<string>;
|
|
168
178
|
warnings: Set<string>;
|
|
@@ -174,5 +184,9 @@ interface BuildConfig extends DeepPartial<Omit<BuildOptions, "entries">> {
|
|
|
174
184
|
preset?: BuildPreset | string;
|
|
175
185
|
}
|
|
176
186
|
type Mode = "build" | "jit" | "watch";
|
|
187
|
+
interface IsolatedDeclarationsResult {
|
|
188
|
+
errors: string[];
|
|
189
|
+
sourceText: string;
|
|
190
|
+
}
|
|
177
191
|
|
|
178
|
-
export type { BuildConfig as B, Mode as M, BuildPreset as a, BuildHooks as b };
|
|
192
|
+
export type { BuildConfig as B, IsolatedDeclarationsResult as I, Mode as M, BuildPreset as a, BuildHooks as b };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var i=Object.defineProperty;var s=(r,e)=>i(r,"name",{value:e,configurable:!0});const u=require("node:fs"),l=require("@visulima/path");var a=Object.defineProperty,f=s((r,e)=>a(r,"name",{value:e,configurable:!0}),"o");const v=f((r,e,t=!1)=>{const c=e.replace(/\.[jt]sx?$/,"");for(const n of r){const o=t?l.join(e,`index${n}`):`${c}${n}`;if(u.existsSync(o))return o}return null},"resolveFile");exports.u=v;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{DEFAULTS as e}from"@rollup/plugin-node-resolve";
|
|
2
|
+
// -- pack CommonJS Shims --
|
|
3
|
+
import __cjs_url__ from "node:url";
|
|
4
|
+
import __cjs_path__ from "node:path";
|
|
5
|
+
import __cjs_mod__ from "node:module";
|
|
6
|
+
const __filename = __cjs_url__.fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __cjs_path__.dirname(__filename);
|
|
8
|
+
const require = __cjs_mod__.createRequire(import.meta.url);
|
|
9
|
+
const i=[...e.extensions,".cjs",".ts",".cts",".mts",".tsx",".jsx"],l={".aac":"file",".cjs":"js",".css":"file",".cts":"ts",".eot":"file",".flac":"file",".gif":"file",".jpeg":"file",".jpg":"file",".js":"js",".json":"json",".jsx":"jsx",".mjs":"js",".mp3":"file",".mp4":"file",".mts":"ts",".ogg":"file",".otf":"file",".png":"file",".svg":"file",".ts":"ts",".tsx":"tsx",".ttf":"file",".wav":"file",".webm":"file",".webp":"file",".woff":"file",".woff2":"file"},s=["development","production"],f=["react-server","react-native","edge-light"];[...s,...f];const o=/node_modules/;export{i as D,o as E,f as R,l as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const s=require("@rollup/plugin-node-resolve"),t=[...s.DEFAULTS.extensions,".cjs",".ts",".cts",".mts",".tsx",".jsx"],f={".aac":"file",".cjs":"js",".css":"file",".cts":"ts",".eot":"file",".flac":"file",".gif":"file",".jpeg":"file",".jpg":"file",".js":"js",".json":"json",".jsx":"jsx",".mjs":"js",".mp3":"file",".mp4":"file",".mts":"ts",".ogg":"file",".otf":"file",".png":"file",".svg":"file",".ts":"ts",".tsx":"tsx",".ttf":"file",".wav":"file",".webm":"file",".webp":"file",".woff":"file",".woff2":"file"},i=["development","production"],e=["react-server","react-native","edge-light"];[...i,...e];const E=/node_modules/;exports.DEFAULT_EXTENSIONS=t;exports.DEFAULT_LOADERS=f;exports.EXCLUDE_REGEXP=E;exports.RUNTIME_EXPORT_CONVENTIONS=e;
|