@visulima/packem 2.0.0-alpha.32 → 2.0.0-alpha.33
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 +15 -0
- package/LICENSE.md +5508 -9
- package/dist/builder/typedoc/generate-reference-documentation.d.ts +4 -0
- package/dist/builder/typedoc/index.d.ts +3 -29
- package/dist/cli/commands/add.d.ts +3 -0
- package/dist/cli/commands/build.d.ts +21 -0
- package/dist/cli/commands/init.d.ts +3 -0
- package/dist/cli/commands/utils/css-loader-dependencies.d.ts +2 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +10 -10
- package/dist/config/index.d.ts +48 -31
- package/dist/config/preset/auto.d.ts +3 -0
- package/dist/config/preset/utils/infer-entries.d.ts +12 -0
- package/dist/config/preset/utils/overwrite-with-publish-config.d.ts +4 -0
- package/dist/config/utils/find-packem-file.d.ts +2 -0
- package/dist/config/utils/load-package-json.d.ts +6 -0
- package/dist/config/utils/load-packem-config.d.ts +7 -0
- package/dist/config/utils/load-preset.d.ts +4 -0
- package/dist/config/utils/load-tsconfig.d.ts +5 -0
- package/dist/config/utils/prepare-entries.d.ts +4 -0
- package/dist/index.d.ts +45 -35
- package/dist/index.js +1 -1
- package/dist/jit/create-stub.d.ts +4 -0
- package/dist/packem/build.d.ts +21 -0
- package/dist/packem/index.d.ts +25 -0
- package/dist/packem/node10-compatibility.d.ts +7 -0
- package/dist/packem/utils/brotli-size.d.ts +2 -0
- package/dist/packem/utils/group-by-keys.d.ts +3 -0
- package/dist/packem/utils/gzip-size.d.ts +2 -0
- package/dist/packem_shared/{index-8EL_RHKk.js → index-BgdmVZI8.js} +63 -63
- package/dist/rollup/build-types.d.ts +5 -0
- package/dist/rollup/build.d.ts +5 -0
- package/dist/rollup/get-rollup-options.d.ts +5 -0
- package/dist/rollup/plugins/css/loaders/less.d.ts +1 -1
- package/dist/rollup/plugins/css/loaders/lightningcss.d.ts +1 -1
- package/dist/rollup/plugins/css/loaders/postcss.d.ts +1 -1
- package/dist/rollup/plugins/css/loaders/sass.d.ts +1 -1
- package/dist/rollup/plugins/css/loaders/sourcemap.d.ts +1 -9
- package/dist/rollup/plugins/css/loaders/stylus.d.ts +1 -1
- package/dist/rollup/plugins/css/loaders/tailwindcss.d.ts +1 -1
- package/dist/rollup/plugins/css/minifiers/cssnano.d.ts +1 -1
- package/dist/rollup/plugins/css/minifiers/lightningcss.d.ts +1 -1
- package/dist/rollup/plugins/esbuild/index.d.ts +2 -26
- package/dist/rollup/plugins/oxc/isolated-declarations-oxc-transformer.d.ts +1 -27
- package/dist/rollup/plugins/oxc/oxc-transformer.d.ts +2 -22
- package/dist/rollup/plugins/resolve-externals-plugin.d.ts +60 -0
- package/dist/rollup/plugins/sucrase/index.d.ts +2 -21
- package/dist/rollup/plugins/swc/isolated-declarations-swc-transformer.d.ts +1 -27
- package/dist/rollup/plugins/swc/swc-plugin.d.ts +2 -22
- package/dist/rollup/plugins/typescript/isolated-declarations-typescript-transformer.d.ts +1 -26
- package/dist/rollup/utils/resolve-aliases.d.ts +4 -0
- package/dist/rollup/watch.d.ts +5 -0
- package/dist/types.d.ts +328 -0
- package/dist/utils/clean-distribution-directories.d.ts +4 -0
- package/dist/utils/create-or-update-key-storage.d.ts +3 -0
- package/dist/utils/extract-export-filenames.d.ts +16 -0
- package/dist/utils/find-alternatives.d.ts +2 -0
- package/dist/utils/get-package-side-effect.d.ts +3 -0
- package/dist/utils/infer-export-type.d.ts +3 -0
- package/dist/utils/kill-process.d.ts +14 -0
- package/dist/utils/log-build-errors.d.ts +4 -0
- package/dist/utils/remove-old-cache-folders.d.ts +3 -0
- package/dist/utils/warn-legacy-cjs.d.ts +8 -0
- package/dist/validator/attw.d.ts +7 -0
- package/dist/validator/package-json/index.d.ts +4 -0
- package/dist/validator/package-json/validate-dependencies.d.ts +4 -0
- package/dist/validator/package-json/validate-engines.d.ts +4 -0
- package/dist/validator/package-json/validate-package-entries.d.ts +4 -0
- package/dist/validator/package-json/validate-package-fields.d.ts +4 -0
- package/dist/validator/validate-alias-entries.d.ts +3 -0
- package/dist/validator/validate-bundle-size.d.ts +4 -0
- package/package.json +2 -2
- package/dist/packem_shared/index-Cjp2s4rr.d.ts +0 -5106
- package/dist/packem_shared/types-0Eba14hg.d.ts +0 -175
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
import type { CheckPackageOptions } from "@arethetypeswrong/core";
|
|
2
|
+
import type { IsolatedDeclarationsTransformer, PackemRollupOptions, TransformerFn, TransformerName } from "@visulima/packem-rollup";
|
|
3
|
+
import type { InternalOXCTransformPluginConfig } from "@visulima/packem-rollup/oxc";
|
|
4
|
+
import type { BuildContext, BuildHooks, Environment, Format, Mode, Runtime } from "@visulima/packem-share/types";
|
|
5
|
+
import type { FileCache } from "@visulima/packem-share/utils";
|
|
6
|
+
import type { StyleOptions } from "@visulima/rollup-plugin-css";
|
|
7
|
+
import type { JitiOptions } from "jiti";
|
|
8
|
+
import type { Plugin } from "rollup";
|
|
9
|
+
import type { TypeDocOptions as BaseTypeDocumentOptions } from "typedoc";
|
|
10
|
+
import type { Node10CompatibilityOptions } from './packem/node10-compatibility.d.ts';
|
|
11
|
+
import type { ResolveExternalsPluginOptions } from './rollup/plugins/resolve-externals-plugin.d.ts';
|
|
12
|
+
type DeepPartial<T> = {
|
|
13
|
+
[P in keyof T]?: DeepPartial<T[P]>;
|
|
14
|
+
};
|
|
15
|
+
export interface AttwOptions extends CheckPackageOptions {
|
|
16
|
+
/**
|
|
17
|
+
* Ignore the scripts on pack
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
ignoreScripts?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* The level of the check.
|
|
23
|
+
*
|
|
24
|
+
* The available levels are:
|
|
25
|
+
* - `error`: fails the build
|
|
26
|
+
* - `warn`: warns the build
|
|
27
|
+
* @default 'warn'
|
|
28
|
+
*/
|
|
29
|
+
level?: "error" | "warn";
|
|
30
|
+
/**
|
|
31
|
+
* Specify the package manager to use for --pack
|
|
32
|
+
* Bun does not support --json option on the pack command, if you choose bun you will get a error.
|
|
33
|
+
* @default 'auto'
|
|
34
|
+
*/
|
|
35
|
+
pm?: "pnpm" | "yarn" | "npm" | "bun" | "auto";
|
|
36
|
+
/**
|
|
37
|
+
* Profiles select a set of resolution modes to require/ignore. All are evaluated but failures outside
|
|
38
|
+
* of those required are ignored.
|
|
39
|
+
*
|
|
40
|
+
* The available profiles are:
|
|
41
|
+
* - `strict`: requires all resolutions
|
|
42
|
+
* - `node16`: ignores node10 resolution failures
|
|
43
|
+
* - `esmOnly`: ignores CJS resolution failures
|
|
44
|
+
* @default 'strict'
|
|
45
|
+
*/
|
|
46
|
+
profile?: "strict" | "node16" | "esmOnly";
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* In addition to basic `entries`, `presets`, and `hooks`,
|
|
50
|
+
* there are also all the properties of `BuildOptions` except for BuildOption's `entries`.
|
|
51
|
+
*/
|
|
52
|
+
export interface BuildConfig extends DeepPartial<Omit<BuildOptions, "entries">> {
|
|
53
|
+
entries?: (BuildEntry | string)[];
|
|
54
|
+
hooks?: Partial<BuildHooks<InternalBuildOptions>>;
|
|
55
|
+
preset?: BuildPreset | "auto" | "none" | (NonNullable<unknown> & string);
|
|
56
|
+
}
|
|
57
|
+
export type BuildPreset = BuildConfig | (() => BuildConfig);
|
|
58
|
+
/**
|
|
59
|
+
* Function type for dynamic build configuration.
|
|
60
|
+
* Allows configuration to be generated based on environment and mode.
|
|
61
|
+
* @param environment The build environment (development/production)
|
|
62
|
+
* @param mode The build mode (build/watch)
|
|
63
|
+
* @returns Build configuration object or Promise resolving to one
|
|
64
|
+
* @public
|
|
65
|
+
*/
|
|
66
|
+
export type BuildConfigFunction = (environment: Environment, mode: Mode) => BuildConfig | Promise<BuildConfig>;
|
|
67
|
+
export type BuildEntry = {
|
|
68
|
+
/** Whether to generate CommonJS output for this entry */
|
|
69
|
+
cjs?: boolean;
|
|
70
|
+
/** TypeScript declaration file generation mode */
|
|
71
|
+
declaration?: boolean | "compatible" | "node16";
|
|
72
|
+
/** Build environment for this entry */
|
|
73
|
+
environment?: Environment;
|
|
74
|
+
/** Whether to generate ESM output for this entry */
|
|
75
|
+
esm?: boolean;
|
|
76
|
+
/** Whether this entry should be marked as executable */
|
|
77
|
+
executable?: true;
|
|
78
|
+
/** Set of export keys to include for this entry */
|
|
79
|
+
exportKey?: Set<string>;
|
|
80
|
+
/** Alternative filename for the output file */
|
|
81
|
+
fileAlias?: string;
|
|
82
|
+
/** Input file path for this entry */
|
|
83
|
+
input: string;
|
|
84
|
+
/** Whether the input is a glob pattern */
|
|
85
|
+
isGlob?: boolean;
|
|
86
|
+
/** Name identifier for this entry */
|
|
87
|
+
name?: string;
|
|
88
|
+
/** Output directory for this entry */
|
|
89
|
+
outDir?: string;
|
|
90
|
+
/** Runtime environment for this entry */
|
|
91
|
+
runtime?: Runtime;
|
|
92
|
+
};
|
|
93
|
+
export type InferEntriesResult = {
|
|
94
|
+
/** Inferred build entries */
|
|
95
|
+
entries: BuildEntry[];
|
|
96
|
+
/** Warning messages from the inference process */
|
|
97
|
+
warnings: string[];
|
|
98
|
+
};
|
|
99
|
+
export interface BuildOptions {
|
|
100
|
+
/** Path alias mappings for module resolution */
|
|
101
|
+
alias: Record<string, string>;
|
|
102
|
+
/** Whether to analyze bundle size and dependencies */
|
|
103
|
+
analyze?: boolean;
|
|
104
|
+
/** Browser targets for transpilation (e.g., ['chrome 58', 'firefox 57']) */
|
|
105
|
+
browserTargets?: string[];
|
|
106
|
+
/** Custom builder functions for different build types */
|
|
107
|
+
builder?: Record<string, (context: BuildContext<BuildOptions>, cachePath: string | undefined, fileCache: FileCache, logged: boolean) => Promise<void>>;
|
|
108
|
+
/** Whether to enable CommonJS interop for ESM modules */
|
|
109
|
+
cjsInterop?: boolean;
|
|
110
|
+
/** Whether to clean the output directory before building */
|
|
111
|
+
clean: boolean;
|
|
112
|
+
/** Whether to enable debug mode with verbose logging */
|
|
113
|
+
debug: boolean;
|
|
114
|
+
/**
|
|
115
|
+
* `compatible` means "src/gather.ts" will generate "dist/index.d.mts", "dist/index.d.cts" and "dist/index.d.ts".
|
|
116
|
+
* `node16` means "src/gather.ts" will generate "dist/index.d.mts" and "dist/index.d.cts".
|
|
117
|
+
* `true` is equivalent to `compatible`.
|
|
118
|
+
* `false` will disable declaration generation.
|
|
119
|
+
* `undefined` will auto-detect based on "package.json". If "package.json" has "types" field, it will be `"compatible"`, otherwise `false`.
|
|
120
|
+
*/
|
|
121
|
+
declaration?: boolean | "compatible" | "node16" | undefined;
|
|
122
|
+
/**
|
|
123
|
+
* If `true`, only generate declaration files.
|
|
124
|
+
* If `false` or `undefined`, generate both declaration and source files.
|
|
125
|
+
*/
|
|
126
|
+
dtsOnly?: boolean;
|
|
127
|
+
/** Whether to emit CommonJS output */
|
|
128
|
+
emitCJS?: boolean;
|
|
129
|
+
/** Whether to emit ESM output */
|
|
130
|
+
emitESM?: boolean;
|
|
131
|
+
/** Build entry points */
|
|
132
|
+
entries: BuildEntry[];
|
|
133
|
+
/** Experimental features configuration */
|
|
134
|
+
experimental?: {
|
|
135
|
+
/**
|
|
136
|
+
* If `true`, the `oxc resolve` plugin will be used instead of the default `@rollup/plugin-node-resolve` and `@rollup/plugin-alias`.
|
|
137
|
+
*/
|
|
138
|
+
oxcResolve?: boolean;
|
|
139
|
+
};
|
|
140
|
+
/** External dependencies that should not be bundled */
|
|
141
|
+
externals: (RegExp | string)[];
|
|
142
|
+
/** Whether to fail the build on warnings */
|
|
143
|
+
failOnWarn?: boolean;
|
|
144
|
+
/** Whether to enable file caching for faster rebuilds */
|
|
145
|
+
fileCache?: boolean;
|
|
146
|
+
/**
|
|
147
|
+
* Array of export keys to ignore during entry inference.
|
|
148
|
+
* Useful for excluding exports that only contain images or other non-JavaScript assets.
|
|
149
|
+
* @example ["images", "assets", "icons"]
|
|
150
|
+
*/
|
|
151
|
+
ignoreExportKeys?: string[];
|
|
152
|
+
/**
|
|
153
|
+
* Isolated declaration transformer for TypeScript declaration generation
|
|
154
|
+
* @experimental
|
|
155
|
+
*/
|
|
156
|
+
isolatedDeclarationTransformer?: IsolatedDeclarationsTransformer;
|
|
157
|
+
/**
|
|
158
|
+
* Jiti options, where [jiti](https://github.com/unjs/jiti) is used to load the entry files.
|
|
159
|
+
* @default { alias: {}, debug: false, interopDefault: true }
|
|
160
|
+
*/
|
|
161
|
+
jiti: Omit<JitiOptions & {
|
|
162
|
+
absoluteJitiPath?: boolean;
|
|
163
|
+
}, "onError" | "transform">;
|
|
164
|
+
/** Signal to use when killing child processes */
|
|
165
|
+
killSignal?: KillSignal;
|
|
166
|
+
/** Whether to minify the output */
|
|
167
|
+
minify?: boolean | undefined;
|
|
168
|
+
/** Name of the build */
|
|
169
|
+
name: string;
|
|
170
|
+
/** Node.js 10 compatibility options */
|
|
171
|
+
node10Compatibility?: Node10CompatibilityOptions | false;
|
|
172
|
+
/** Command to run or function to execute after successful build */
|
|
173
|
+
onSuccess?: string | (() => Promise<(() => Promise<void> | void) | undefined | void>);
|
|
174
|
+
/** Timeout for the onSuccess command in milliseconds */
|
|
175
|
+
onSuccessTimeout?: number;
|
|
176
|
+
/** Output directory for build artifacts */
|
|
177
|
+
outDir: string;
|
|
178
|
+
/** Custom file extensions for different output formats */
|
|
179
|
+
outputExtensionMap?: Record<Format, string>;
|
|
180
|
+
/** Rollup-specific build options */
|
|
181
|
+
rollup: RollupBuildOptions;
|
|
182
|
+
/** Root directory of the project */
|
|
183
|
+
rootDir: string;
|
|
184
|
+
/** Target runtime environment */
|
|
185
|
+
runtime?: "browser" | "node";
|
|
186
|
+
/** Source directory containing the source files */
|
|
187
|
+
sourceDir: string;
|
|
188
|
+
/** Whether to generate source maps */
|
|
189
|
+
sourcemap: boolean;
|
|
190
|
+
/** Transformer function for processing source files */
|
|
191
|
+
transformer: TransformerFn;
|
|
192
|
+
/** TypeDoc configuration for generating documentation */
|
|
193
|
+
typedoc: TypeDocumentOptions | false;
|
|
194
|
+
/**
|
|
195
|
+
* If `true`, enables unbundle mode which preserves the source file structure.
|
|
196
|
+
* Instead of bundling everything into a single file, each module is output as a separate file
|
|
197
|
+
* maintaining the original directory structure.
|
|
198
|
+
* @default false
|
|
199
|
+
* @example
|
|
200
|
+
* ```typescript
|
|
201
|
+
* // With unbundle: true
|
|
202
|
+
* // src/index.ts exports from './a/indexA', '.d.ts';
|
|
203
|
+
* // Output: dist/index.js, dist/a/indexA.js, dist/b/indexB.js
|
|
204
|
+
* ```
|
|
205
|
+
*/
|
|
206
|
+
unbundle?: boolean;
|
|
207
|
+
/** Validation options for the build */
|
|
208
|
+
validation?: ValidationOptions | false;
|
|
209
|
+
}
|
|
210
|
+
export interface InternalBuildOptions extends BuildOptions {
|
|
211
|
+
/** Rollup options with internal OXC configuration */
|
|
212
|
+
rollup: BuildOptions["rollup"] & {
|
|
213
|
+
nativeModules?: NativeModulesOptions | false;
|
|
214
|
+
oxc?: InternalOXCTransformPluginConfig;
|
|
215
|
+
};
|
|
216
|
+
/** Name of the transformer being used */
|
|
217
|
+
transformerName: TransformerName | undefined;
|
|
218
|
+
}
|
|
219
|
+
/** Valid kill signals for terminating child processes */
|
|
220
|
+
export type KillSignal = "SIGKILL" | "SIGTERM";
|
|
221
|
+
export interface RollupBuildOptions extends PackemRollupOptions {
|
|
222
|
+
/** CSS processing options or false to disable */
|
|
223
|
+
css?: StyleOptions | false;
|
|
224
|
+
/** External dependency resolution plugin options */
|
|
225
|
+
resolveExternals?: ResolveExternalsPluginOptions;
|
|
226
|
+
}
|
|
227
|
+
export type RollupPlugins = {
|
|
228
|
+
/** Plugin enforcement order ('pre' or 'post') */
|
|
229
|
+
enforce?: "post" | "pre";
|
|
230
|
+
/** The Rollup plugin instance */
|
|
231
|
+
plugin: Plugin;
|
|
232
|
+
/** Type of build this plugin applies to */
|
|
233
|
+
type?: "build" | "dts";
|
|
234
|
+
}[];
|
|
235
|
+
export type TypeDocumentOptions = Partial<Omit<BaseTypeDocumentOptions, "entryPoints" | "hideGenerator" | "out" | "preserveWatchOutput" | "watch">> & {
|
|
236
|
+
/**
|
|
237
|
+
* The format of the output.
|
|
238
|
+
* @default "html"
|
|
239
|
+
*/
|
|
240
|
+
format?: "html" | "inline" | "json" | "markdown";
|
|
241
|
+
/**
|
|
242
|
+
* The name of the JSON file.
|
|
243
|
+
*/
|
|
244
|
+
jsonFileName?: string;
|
|
245
|
+
/**
|
|
246
|
+
* A marker to replace the content within the file on the correct location.
|
|
247
|
+
* @default "TYPEDOC" This marker need to be placed in the readme <!-- TYPEDOC --><!-- TYPEDOC -->
|
|
248
|
+
*/
|
|
249
|
+
marker?: string;
|
|
250
|
+
/**
|
|
251
|
+
* The path of the output directory.
|
|
252
|
+
*/
|
|
253
|
+
output?: string;
|
|
254
|
+
/**
|
|
255
|
+
* The path of the README file.
|
|
256
|
+
*/
|
|
257
|
+
readmePath?: string;
|
|
258
|
+
};
|
|
259
|
+
export type ValidationOptions = {
|
|
260
|
+
/**
|
|
261
|
+
* Run `arethetypeswrong` after bundling.
|
|
262
|
+
* Requires `@arethetypeswrong/core` to be installed.
|
|
263
|
+
* @default false
|
|
264
|
+
* @see https://github.com/arethetypeswrong/arethetypeswrong.github.io
|
|
265
|
+
*/
|
|
266
|
+
attw?: boolean | AttwOptions;
|
|
267
|
+
/** Bundle size validation options */
|
|
268
|
+
bundleLimit?: {
|
|
269
|
+
/** Allow the build to succeed even if limits are exceeded */
|
|
270
|
+
allowFail?: boolean;
|
|
271
|
+
/**
|
|
272
|
+
* Bundle size limit in bytes, or string with unit (e.g., "1MB", "500KB")
|
|
273
|
+
* @example
|
|
274
|
+
* - "1MB"
|
|
275
|
+
* - "500KB"
|
|
276
|
+
* - 1048576 // 1MB in bytes
|
|
277
|
+
*/
|
|
278
|
+
limit?: number | `${number}${"B" | "GB" | "KB" | "MB" | "TB"}`;
|
|
279
|
+
/** Size limits for specific files or globs */
|
|
280
|
+
limits?: Record<string, number | `${number}${"B" | "GB" | "KB" | "MB" | "TB"}`>;
|
|
281
|
+
};
|
|
282
|
+
/** Dependency validation options */
|
|
283
|
+
dependencies: {
|
|
284
|
+
/** Hoisted dependency validation with exclusions */
|
|
285
|
+
hoisted: {
|
|
286
|
+
exclude: string[];
|
|
287
|
+
} | false;
|
|
288
|
+
/** Unused dependency validation with exclusions */
|
|
289
|
+
unused: {
|
|
290
|
+
exclude: string[];
|
|
291
|
+
} | false;
|
|
292
|
+
} | false;
|
|
293
|
+
/** Package.json validation options */
|
|
294
|
+
packageJson?: {
|
|
295
|
+
/** Allowed file extensions in exports field */
|
|
296
|
+
allowedExportExtensions?: string[];
|
|
297
|
+
/** Whether to validate the bin field */
|
|
298
|
+
bin?: boolean;
|
|
299
|
+
/** Whether to validate dependencies */
|
|
300
|
+
dependencies?: boolean;
|
|
301
|
+
/** Whether to validate the engines field */
|
|
302
|
+
engines?: boolean;
|
|
303
|
+
/** Whether to validate the exports field */
|
|
304
|
+
exports?: boolean;
|
|
305
|
+
/**
|
|
306
|
+
* Additional custom conditions to consider valid in exports field validation.
|
|
307
|
+
* These will be added to the standard and community conditions.
|
|
308
|
+
* @example ["custom", "my-bundler"]
|
|
309
|
+
*/
|
|
310
|
+
extraConditions?: string[];
|
|
311
|
+
/** Whether to validate the files field */
|
|
312
|
+
files?: boolean;
|
|
313
|
+
/** Whether to validate the main field */
|
|
314
|
+
main?: boolean;
|
|
315
|
+
/** Whether to validate the module field */
|
|
316
|
+
module?: boolean;
|
|
317
|
+
/** Whether to validate the name field */
|
|
318
|
+
name?: boolean;
|
|
319
|
+
/** Whether to validate the sideEffects field */
|
|
320
|
+
sideEffects?: boolean;
|
|
321
|
+
/** Whether to validate the types field */
|
|
322
|
+
types?: boolean;
|
|
323
|
+
/** Whether to validate the typesVersions field */
|
|
324
|
+
typesVersions?: boolean;
|
|
325
|
+
};
|
|
326
|
+
};
|
|
327
|
+
export type { Environment, Format, Mode, Runtime } from "@visulima/packem-share/types";
|
|
328
|
+
export type { InjectOptions, StyleOptions } from "@visulima/rollup-plugin-css";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { BuildContext } from "@visulima/packem-share/types";
|
|
2
|
+
import type { InternalBuildOptions } from "../types.d.ts";
|
|
3
|
+
declare const cleanDistributionDirectories: (context: BuildContext<InternalBuildOptions>) => Promise<void>;
|
|
4
|
+
export default cleanDistributionDirectories;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { PackageJson } from "@visulima/package";
|
|
2
|
+
import type { BuildOptions, Format } from "../types.d.ts";
|
|
3
|
+
declare const runtimeExportConventions: Set<string>;
|
|
4
|
+
export type OutputDescriptor = {
|
|
5
|
+
exportKey?: string;
|
|
6
|
+
fieldName?: string;
|
|
7
|
+
file: string;
|
|
8
|
+
/** Whether this output was from an ignored export key */
|
|
9
|
+
ignored?: boolean;
|
|
10
|
+
isExecutable?: true;
|
|
11
|
+
key: "bin" | "exports" | "main" | "module" | "types";
|
|
12
|
+
subKey?: typeof runtimeExportConventions | (NonNullable<unknown> & string);
|
|
13
|
+
type?: Format;
|
|
14
|
+
};
|
|
15
|
+
export declare const extractExportFilenames: (packageExports: PackageJson["exports"], packageType: "cjs" | "esm", declaration: BuildOptions["declaration"], conditions?: string[], ignoreExportKeys?: string[]) => OutputDescriptor[];
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { Format } from "../types.d.ts";
|
|
2
|
+
export declare const inferExportTypeFromFileName: (filename: string) => Format | undefined;
|
|
3
|
+
export declare const inferExportType: (condition: string, previousConditions: string[], packageType: Format, filename?: string) => Format;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { KillSignal } from "../types.d.ts";
|
|
2
|
+
/**
|
|
3
|
+
* Terminates a process with the specified signal.
|
|
4
|
+
* @param params The parameters object
|
|
5
|
+
* @param params.pid Process ID to terminate
|
|
6
|
+
* @param params.signal Signal to send ('SIGTERM', 'SIGKILL', etc.)
|
|
7
|
+
* @throws {Error} If pid is invalid or process termination fails
|
|
8
|
+
* @returns Resolves when process is terminated
|
|
9
|
+
*/
|
|
10
|
+
declare const killProcess: ({ pid, signal }: {
|
|
11
|
+
pid: number;
|
|
12
|
+
signal: KillSignal;
|
|
13
|
+
}) => Promise<void>;
|
|
14
|
+
export default killProcess;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { BuildContext } from "@visulima/packem-share/types";
|
|
2
|
+
import type { InternalBuildOptions } from "../types.d.ts";
|
|
3
|
+
/**
|
|
4
|
+
* Warns when building CommonJS for Node targets that have deprecated CJS.
|
|
5
|
+
* Triggers for Node >= 23.0.0 or >= 22.12.0.
|
|
6
|
+
*/
|
|
7
|
+
declare const warnLegacyCJS: (context: BuildContext<InternalBuildOptions>) => void;
|
|
8
|
+
export default warnLegacyCJS;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { BuildContext } from "@visulima/packem-share/types";
|
|
2
|
+
import type { InternalBuildOptions } from "../types.d.ts";
|
|
3
|
+
/**
|
|
4
|
+
* End.
|
|
5
|
+
*/
|
|
6
|
+
declare const attw: (context: BuildContext<InternalBuildOptions>, logged: boolean) => Promise<void>;
|
|
7
|
+
export default attw;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visulima/packem",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.33",
|
|
4
4
|
"description": "A fast and modern bundler for Node.js and TypeScript.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"anolilab",
|
|
@@ -171,7 +171,7 @@
|
|
|
171
171
|
"@visulima/fs": "3.1.8",
|
|
172
172
|
"@visulima/humanizer": "1.2.2",
|
|
173
173
|
"@visulima/package": "4.0.0",
|
|
174
|
-
"@visulima/packem-rollup": "1.0.0-alpha.
|
|
174
|
+
"@visulima/packem-rollup": "1.0.0-alpha.26",
|
|
175
175
|
"@visulima/packem-share": "1.0.0-alpha.13",
|
|
176
176
|
"@visulima/pail": "2.1.28",
|
|
177
177
|
"@visulima/path": "1.4.0",
|