@visulima/packem 2.0.0-alpha.4 → 2.0.0-alpha.40

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.
Files changed (99) hide show
  1. package/CHANGELOG.md +449 -1
  2. package/LICENSE.md +5860 -963
  3. package/README.md +16 -12
  4. package/dist/builder/typedoc/generate-reference-documentation.d.ts +4 -0
  5. package/dist/builder/typedoc/index.d.ts +3 -26
  6. package/dist/cli/commands/add.d.ts +3 -0
  7. package/dist/cli/commands/build.d.ts +21 -0
  8. package/dist/cli/commands/init.d.ts +3 -0
  9. package/dist/cli/commands/migrate.d.ts +21 -0
  10. package/dist/cli/commands/utils/css-loader-dependencies.d.ts +2 -0
  11. package/dist/cli/index.d.ts +1 -0
  12. package/dist/cli/index.js +39 -35
  13. package/dist/config/index.d.ts +48 -28
  14. package/dist/config/preset/auto.d.ts +3 -0
  15. package/dist/config/preset/utils/infer-entries.d.ts +12 -0
  16. package/dist/config/preset/utils/overwrite-with-publish-config.d.ts +4 -0
  17. package/dist/config/utils/find-packem-file.d.ts +2 -0
  18. package/dist/config/utils/load-package-json.d.ts +6 -0
  19. package/dist/config/utils/load-packem-config.d.ts +7 -0
  20. package/dist/config/utils/load-preset.d.ts +4 -0
  21. package/dist/config/utils/load-tsconfig.d.ts +5 -0
  22. package/dist/config/utils/prepare-entries.d.ts +4 -0
  23. package/dist/index.d.ts +45 -32
  24. package/dist/index.js +1 -1
  25. package/dist/jit/create-stub.d.ts +4 -0
  26. package/dist/packem/build.d.ts +21 -0
  27. package/dist/packem/index.d.ts +25 -0
  28. package/dist/packem/node10-compatibility.d.ts +7 -0
  29. package/dist/packem/utils/brotli-size.d.ts +2 -0
  30. package/dist/packem/utils/group-by-keys.d.ts +3 -0
  31. package/dist/packem/utils/gzip-size.d.ts +2 -0
  32. package/dist/packem_shared/default-B2EOH52z.js +1 -0
  33. package/dist/packem_shared/default-BYM_JvQL.js +1 -0
  34. package/dist/packem_shared/{default-DqRcOUe1.js → default-Dego_fiC.js} +1 -1
  35. package/dist/packem_shared/{default-B6X7-Lx3.js → default-E4TiWfSK.js} +1 -1
  36. package/dist/packem_shared/esbuildPlugin-DpLtQGuZ-Bny-e486.js +3 -0
  37. package/dist/packem_shared/index-DFigeRU2.js +174 -0
  38. package/dist/packem_shared/oxcResolvePlugin-Ccef6pyL-D14z9S9i.js +1 -0
  39. package/dist/packem_shared/{resolveTypescriptMjsCtsPlugin-DcZrZTmM-BEkYWTsH.js → resolveTypescriptMjsCtsPlugin-DcZrZTmM-3AmQC7y7.js} +4 -4
  40. package/dist/rollup/build-types.d.ts +5 -0
  41. package/dist/rollup/build.d.ts +5 -0
  42. package/dist/rollup/get-rollup-options.d.ts +5 -0
  43. package/dist/rollup/plugins/css/loaders/less.d.ts +1 -1
  44. package/dist/rollup/plugins/css/loaders/less.js +1 -1
  45. package/dist/rollup/plugins/css/loaders/lightningcss.d.ts +1 -1
  46. package/dist/rollup/plugins/css/loaders/lightningcss.js +1 -1
  47. package/dist/rollup/plugins/css/loaders/postcss.d.ts +1 -1
  48. package/dist/rollup/plugins/css/loaders/postcss.js +1 -1
  49. package/dist/rollup/plugins/css/loaders/sass.d.ts +1 -1
  50. package/dist/rollup/plugins/css/loaders/sass.js +1 -1
  51. package/dist/rollup/plugins/css/loaders/sourcemap.d.ts +1 -8
  52. package/dist/rollup/plugins/css/loaders/sourcemap.js +1 -1
  53. package/dist/rollup/plugins/css/loaders/stylus.d.ts +1 -1
  54. package/dist/rollup/plugins/css/loaders/stylus.js +1 -1
  55. package/dist/rollup/plugins/css/loaders/tailwindcss.d.ts +1 -0
  56. package/dist/rollup/plugins/css/loaders/tailwindcss.js +1 -0
  57. package/dist/rollup/plugins/css/minifiers/cssnano.d.ts +1 -1
  58. package/dist/rollup/plugins/css/minifiers/cssnano.js +1 -1
  59. package/dist/rollup/plugins/css/minifiers/lightningcss.d.ts +1 -1
  60. package/dist/rollup/plugins/css/minifiers/lightningcss.js +1 -1
  61. package/dist/rollup/plugins/esbuild/index.d.ts +2 -24
  62. package/dist/rollup/plugins/esbuild/index.js +1 -1
  63. package/dist/rollup/plugins/oxc/isolated-declarations-oxc-transformer.d.ts +1 -25
  64. package/dist/rollup/plugins/oxc/oxc-transformer.d.ts +2 -20
  65. package/dist/rollup/plugins/resolve-externals-plugin.d.ts +60 -0
  66. package/dist/rollup/plugins/sucrase/index.d.ts +2 -19
  67. package/dist/rollup/plugins/swc/isolated-declarations-swc-transformer.d.ts +1 -20
  68. package/dist/rollup/plugins/swc/swc-plugin.d.ts +2 -26
  69. package/dist/rollup/plugins/typescript/isolated-declarations-typescript-transformer.d.ts +1 -24
  70. package/dist/rollup/utils/resolve-aliases.d.ts +4 -0
  71. package/dist/rollup/watch.d.ts +5 -0
  72. package/dist/types.d.ts +328 -0
  73. package/dist/utils/clean-distribution-directories.d.ts +4 -0
  74. package/dist/utils/create-or-update-key-storage.d.ts +3 -0
  75. package/dist/utils/extract-export-filenames.d.ts +16 -0
  76. package/dist/utils/find-alternatives.d.ts +2 -0
  77. package/dist/utils/get-package-side-effect.d.ts +3 -0
  78. package/dist/utils/infer-export-type.d.ts +3 -0
  79. package/dist/utils/kill-process.d.ts +14 -0
  80. package/dist/utils/log-build-errors.d.ts +4 -0
  81. package/dist/utils/remove-old-cache-folders.d.ts +3 -0
  82. package/dist/utils/warn-legacy-cjs.d.ts +8 -0
  83. package/dist/validator/attw.d.ts +7 -0
  84. package/dist/validator/package-json/index.d.ts +4 -0
  85. package/dist/validator/package-json/validate-dependencies.d.ts +4 -0
  86. package/dist/validator/package-json/validate-engines.d.ts +4 -0
  87. package/dist/validator/package-json/validate-package-entries.d.ts +4 -0
  88. package/dist/validator/package-json/validate-package-fields.d.ts +4 -0
  89. package/dist/validator/validate-alias-entries.d.ts +3 -0
  90. package/dist/validator/validate-bundle-size.d.ts +4 -0
  91. package/files.d.ts +37 -0
  92. package/package.json +53 -29
  93. package/dist/packem_shared/default-C3sdXf4G.js +0 -1
  94. package/dist/packem_shared/default-DR5Fia_R.js +0 -1
  95. package/dist/packem_shared/esbuildPlugin-BAwyhG6L-yty60jMl.js +0 -3
  96. package/dist/packem_shared/index-DySckW0r.d.ts +0 -5227
  97. package/dist/packem_shared/index-VKZ7e6tb.js +0 -138
  98. package/dist/packem_shared/oxcResolvePlugin-BJpi-eSG-BsYx9cDO.js +0 -1
  99. package/dist/packem_shared/types-CaBbG-vU.d.ts +0 -163
@@ -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 &lt;!-- TYPEDOC -->&lt;!-- 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,3 @@
1
+ import type { Pail } from "@visulima/pail";
2
+ declare const createOrUpdateKeyStorage: (hashKey: string, storePath: string, logger: Pail, shouldUpdate?: true) => void;
3
+ export default createOrUpdateKeyStorage;
@@ -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,2 @@
1
+ declare const findAlternatives: (string: string, array: string[]) => string[];
2
+ export default findAlternatives;
@@ -0,0 +1,3 @@
1
+ import type { PackageJson } from "@visulima/package";
2
+ declare const getPackageSideEffect: (cwd: string, packageJson: PackageJson) => (id: string) => boolean | undefined;
3
+ export default getPackageSideEffect;
@@ -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,4 @@
1
+ import type { BuildContext } from "@visulima/packem-share/types";
2
+ import type { InternalBuildOptions } from "../types.d.ts";
3
+ declare const logBuildErrors: (context: BuildContext<InternalBuildOptions>, hasOtherLogs: boolean) => void;
4
+ export default logBuildErrors;
@@ -0,0 +1,3 @@
1
+ import type { Pail } from "@visulima/pail";
2
+ declare const removeOldCacheFolders: (cachePath: string | undefined, logger: Pail, logged: boolean) => Promise<void>;
3
+ export default removeOldCacheFolders;
@@ -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;
@@ -0,0 +1,4 @@
1
+ import type { BuildContext } from "@visulima/packem-share/types";
2
+ import type { InternalBuildOptions } from "../../types.d.ts";
3
+ declare const validator: (context: BuildContext<InternalBuildOptions>) => void;
4
+ export default validator;
@@ -0,0 +1,4 @@
1
+ import type { BuildContext } from "@visulima/packem-share/types";
2
+ import type { InternalBuildOptions } from "../../types.d.ts";
3
+ declare const validateDependencies: (context: BuildContext<InternalBuildOptions>) => void;
4
+ export default validateDependencies;
@@ -0,0 +1,4 @@
1
+ import type { BuildContext } from "@visulima/packem-share/types";
2
+ import type { InternalBuildOptions } from "../../types.d.ts";
3
+ declare const validateEngines: (context: BuildContext<InternalBuildOptions>) => void;
4
+ export default validateEngines;
@@ -0,0 +1,4 @@
1
+ import type { BuildContext } from "@visulima/packem-share/types";
2
+ import type { InternalBuildOptions } from "../../types.d.ts";
3
+ declare const validatePackageEntries: (context: BuildContext<InternalBuildOptions>) => void;
4
+ export default validatePackageEntries;
@@ -0,0 +1,4 @@
1
+ import type { BuildContext } from "@visulima/packem-share/types";
2
+ import type { InternalBuildOptions } from "../../types.d.ts";
3
+ declare const validatePackageFields: (context: BuildContext<InternalBuildOptions>) => void;
4
+ export default validatePackageFields;
@@ -0,0 +1,3 @@
1
+ import type { Alias } from "@visulima/packem-rollup";
2
+ declare const validateAliasEntries: (entries: ReadonlyArray<Alias> | Record<string, string>) => void;
3
+ export default validateAliasEntries;
@@ -0,0 +1,4 @@
1
+ import type { BuildContext } from "@visulima/packem-share/types";
2
+ import type { InternalBuildOptions } from "../types.d.ts";
3
+ declare const validateBundleSize: (context: BuildContext<InternalBuildOptions>, logged: boolean) => void;
4
+ export default validateBundleSize;
package/files.d.ts CHANGED
@@ -223,3 +223,40 @@ declare module "*?raw" {
223
223
 
224
224
  export default source;
225
225
  }
226
+
227
+ // Data URI plugin support
228
+ declare module "*?data-uri" {
229
+ const dataUri: string;
230
+
231
+ export default dataUri;
232
+ }
233
+
234
+ declare module "*?data-uri&encoding=css" {
235
+ const dataUri: string;
236
+
237
+ export default dataUri;
238
+ }
239
+
240
+ declare module "*?data-uri&encoding=tiny" {
241
+ const dataUri: string;
242
+
243
+ export default dataUri;
244
+ }
245
+
246
+ declare module "*?data-uri&srcset" {
247
+ const dataUri: string;
248
+
249
+ export default dataUri;
250
+ }
251
+
252
+ declare module "*?data-uri&encoding=css&srcset" {
253
+ const dataUri: string;
254
+
255
+ export default dataUri;
256
+ }
257
+
258
+ declare module "*?data-uri&encoding=tiny&srcset" {
259
+ const dataUri: string;
260
+
261
+ export default dataUri;
262
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visulima/packem",
3
- "version": "2.0.0-alpha.4",
3
+ "version": "2.0.0-alpha.40",
4
4
  "description": "A fast and modern bundler for Node.js and TypeScript.",
5
5
  "keywords": [
6
6
  "anolilab",
@@ -102,6 +102,10 @@
102
102
  "types": "./dist/rollup/plugins/css/loaders/lightningcss.d.ts",
103
103
  "default": "./dist/rollup/plugins/css/loaders/lightningcss.js"
104
104
  },
105
+ "./css/loader/tailwindcss": {
106
+ "types": "./dist/rollup/plugins/css/loaders/tailwindcss.d.ts",
107
+ "default": "./dist/rollup/plugins/css/loaders/tailwindcss.js"
108
+ },
105
109
  "./css/minifier/cssnano": {
106
110
  "types": "./dist/rollup/plugins/css/minifiers/cssnano.d.ts",
107
111
  "default": "./dist/rollup/plugins/css/minifiers/cssnano.js"
@@ -110,14 +114,6 @@
110
114
  "types": "./dist/rollup/plugins/css/minifiers/lightningcss.d.ts",
111
115
  "default": "./dist/rollup/plugins/css/minifiers/lightningcss.js"
112
116
  },
113
- "./transformer/esbuild": {
114
- "types": "./dist/rollup/plugins/esbuild/index.d.ts",
115
- "default": "./dist/rollup/plugins/esbuild/index.js"
116
- },
117
- "./transformer/swc": {
118
- "types": "./dist/rollup/plugins/swc/swc-plugin.d.ts",
119
- "default": "./dist/rollup/plugins/swc/swc-plugin.js"
120
- },
121
117
  "./dts/isolated/transformer/swc": {
122
118
  "types": "./dist/rollup/plugins/swc/isolated-declarations-swc-transformer.d.ts",
123
119
  "default": "./dist/rollup/plugins/swc/isolated-declarations-swc-transformer.js"
@@ -130,6 +126,14 @@
130
126
  "types": "./dist/rollup/plugins/typescript/isolated-declarations-typescript-transformer.d.ts",
131
127
  "default": "./dist/rollup/plugins/typescript/isolated-declarations-typescript-transformer.js"
132
128
  },
129
+ "./transformer/esbuild": {
130
+ "types": "./dist/rollup/plugins/esbuild/index.d.ts",
131
+ "default": "./dist/rollup/plugins/esbuild/index.js"
132
+ },
133
+ "./transformer/swc": {
134
+ "types": "./dist/rollup/plugins/swc/swc-plugin.d.ts",
135
+ "default": "./dist/rollup/plugins/swc/swc-plugin.js"
136
+ },
133
137
  "./transformer/sucrase": {
134
138
  "types": "./dist/rollup/plugins/sucrase/index.d.ts",
135
139
  "default": "./dist/rollup/plugins/sucrase/index.js"
@@ -160,41 +164,49 @@
160
164
  "dependencies": {
161
165
  "@antfu/install-pkg": "1.1.0",
162
166
  "@clack/prompts": "0.11.0",
163
- "@rollup/pluginutils": "5.2.0",
164
- "@visulima/cerebro": "1.1.46",
165
- "@visulima/colorize": "1.4.23",
166
- "@visulima/find-cache-dir": "1.0.31",
167
- "@visulima/fs": "3.1.5",
168
- "@visulima/humanizer": "1.2.2",
169
- "@visulima/package": "3.5.8",
170
- "@visulima/packem-rollup": "1.0.0-alpha.4",
171
- "@visulima/packem-share": "1.0.0-alpha.4",
172
- "@visulima/pail": "2.1.25",
167
+ "@rollup/pluginutils": "5.3.0",
168
+ "@visulima/cerebro": "2.1.3",
169
+ "@visulima/colorize": "1.4.27",
170
+ "@visulima/find-cache-dir": "2.0.4",
171
+ "@visulima/fs": "4.0.4",
172
+ "@visulima/humanizer": "2.0.3",
173
+ "@visulima/package": "4.1.4",
174
+ "@visulima/packem-rollup": "1.0.0-alpha.30",
175
+ "@visulima/packem-share": "1.0.0-alpha.14",
176
+ "@visulima/pail": "3.2.0",
173
177
  "@visulima/path": "1.4.0",
174
- "@visulima/rollup-css-plugin": "1.0.0-alpha.4",
175
- "@visulima/source-map": "1.0.20",
176
- "@visulima/tsconfig": "1.1.19",
177
- "browserslist": "4.25.1",
178
+ "@visulima/rollup-plugin-css": "1.0.0-alpha.10",
179
+ "@visulima/source-map": "2.0.3",
180
+ "@visulima/tabular": "^3.1.3",
181
+ "@visulima/tsconfig": "2.1.0",
182
+ "browserslist": "4.26.2",
183
+ "cjs-module-lexer": "^2.1.1",
184
+ "clean-css": "^5.3.3",
178
185
  "defu": "6.1.4",
179
186
  "fastest-levenshtein": "1.0.16",
180
187
  "hookable": "5.5.3",
181
- "jiti": "2.5.1",
182
- "magic-string": "0.30.17",
183
- "mlly": "1.7.4",
188
+ "html-minifier-next": "^4.3.1",
189
+ "jiti": "2.6.0",
190
+ "magic-string": "0.30.19",
191
+ "mlly": "1.8.0",
184
192
  "picomatch": "4.0.3",
185
- "rollup": "4.46.2",
193
+ "rollup": "^4.53.3",
186
194
  "semver": "7.7.2",
187
195
  "tinyexec": "1.0.1",
188
- "tinyglobby": "0.2.14"
196
+ "tinyglobby": "0.2.15"
189
197
  },
190
198
  "peerDependencies": {
199
+ "@arethetypeswrong/core": ">=0.18.2",
191
200
  "@swc/core": ">=1.11.29",
201
+ "@tailwindcss/node": "^4.1.17",
202
+ "@tailwindcss/oxide": "^4.1.17",
192
203
  "cssnano": ">=7.0.6",
193
204
  "esbuild": ">=0.20.2",
194
205
  "icss-utils": ">=5.1.0",
195
206
  "less": ">=4.2.0",
196
207
  "lightningcss": ">=1.27.0",
197
208
  "oxc-transform": ">=0.20.0",
209
+ "package-manager-detector": "^1.5.0",
198
210
  "postcss": ">=8.4.47",
199
211
  "postcss-load-config": ">=6.0.1",
200
212
  "postcss-modules-extract-imports": ">=3.1.0",
@@ -212,12 +224,21 @@
212
224
  "typescript": ">=4.5 || >=5.0"
213
225
  },
214
226
  "peerDependenciesMeta": {
227
+ "@arethetypeswrong/core": {
228
+ "optional": true
229
+ },
215
230
  "@ckeditor/typedoc-plugins": {
216
231
  "optional": true
217
232
  },
218
233
  "@swc/core": {
219
234
  "optional": true
220
235
  },
236
+ "@tailwindcss/node": {
237
+ "optional": true
238
+ },
239
+ "@tailwindcss/oxide": {
240
+ "optional": true
241
+ },
221
242
  "cssnano": {
222
243
  "optional": true
223
244
  },
@@ -280,10 +301,13 @@
280
301
  },
281
302
  "typescript": {
282
303
  "optional": true
304
+ },
305
+ "which-pm-runs": {
306
+ "optional": true
283
307
  }
284
308
  },
285
309
  "engines": {
286
- "node": ">=20.* <=24.*"
310
+ "node": ">=20.19 <=25.*"
287
311
  },
288
312
  "publishConfig": {
289
313
  "access": "public",
@@ -1 +0,0 @@
1
- import{t as a}from"./swcPlugin-Boip4lWG-CwJ-HVJc.js";import{u as e}from"./isolatedDeclarationsSwcTransformer-Ch2AgtWC-B-0lOgFf.js";export{e as isolatedDeclarationsSwcTransformer,a as swcPlugin};
@@ -1 +0,0 @@
1
- import{z as a}from"./oxcResolvePlugin-BJpi-eSG-BsYx9cDO.js";import{n as s}from"./oxcTransformPlugin-DfVQouIB-Cpfv95eA.js";import{d as x}from"./isolatedDeclarationsOxcTransformer-WbfE6cGu-NeZOx2Y7.js";export{x as isolatedDeclarationsOxcTransformer,a as oxcResolvePlugin,s as oxcTransformPlugin};