@visulima/packem 2.0.0-alpha.40 → 2.0.0-alpha.43
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 +31 -0
- package/LICENSE.md +1548 -1497
- package/dist/builder/typedoc/index.js +160 -3
- package/dist/cli/index.js +1377 -45
- package/dist/config/index.js +4 -1
- package/dist/config/preset/react.d.ts +59 -0
- package/dist/config/preset/react.js +43 -0
- package/dist/config/preset/solid.d.ts +101 -0
- package/dist/config/preset/solid.js +72 -0
- package/dist/config/preset/svelte.d.ts +71 -0
- package/dist/config/preset/svelte.js +44 -0
- package/dist/config/preset/vue.d.ts +53 -0
- package/dist/config/preset/vue.js +33 -0
- package/dist/index.js +30 -1
- package/dist/packem_shared/create-or-update-key-storage-Dd7b8-t1.js +36 -0
- package/dist/packem_shared/default-79SPobLI.js +12 -0
- package/dist/packem_shared/default-DWBYeUSC.js +210 -0
- package/dist/packem_shared/default-DaU6CQEi.js +28 -0
- package/dist/packem_shared/default-DavaZMwC.js +32 -0
- package/dist/packem_shared/default-DeYZ934H.js +32 -0
- package/dist/packem_shared/default-tUOOZ8w7.js +42 -0
- package/dist/packem_shared/default-wScAfTaq.js +27 -0
- package/dist/packem_shared/index-CTIRxV2x.js +63 -0
- package/dist/packem_shared/index-DzTDn4ad.js +9521 -0
- package/dist/rollup/plugins/css/loaders/less.js +1 -1
- package/dist/rollup/plugins/css/loaders/lightningcss.js +1 -1
- package/dist/rollup/plugins/css/loaders/postcss.js +1 -1
- package/dist/rollup/plugins/css/loaders/sass.js +1 -1
- package/dist/rollup/plugins/css/loaders/sourcemap.js +1 -1
- package/dist/rollup/plugins/css/loaders/stylus.js +1 -1
- package/dist/rollup/plugins/css/loaders/tailwindcss.js +1 -1
- package/dist/rollup/plugins/css/minifiers/cssnano.js +1 -1
- package/dist/rollup/plugins/css/minifiers/lightningcss.js +1 -1
- package/dist/rollup/plugins/esbuild/index.js +1 -1
- package/dist/rollup/plugins/oxc/isolated-declarations-oxc-transformer.js +1 -1
- package/dist/rollup/plugins/oxc/oxc-transformer.js +1 -1
- package/dist/rollup/plugins/sucrase/index.js +1 -1
- package/dist/rollup/plugins/swc/isolated-declarations-swc-transformer.js +1 -1
- package/dist/rollup/plugins/swc/swc-plugin.js +1 -1
- package/dist/rollup/plugins/typescript/isolated-declarations-typescript-transformer.js +1 -1
- package/dist/types.d.ts +2 -1
- package/package.json +143 -6
- package/dist/builder/typedoc/generate-reference-documentation.d.ts +0 -4
- package/dist/cli/commands/add.d.ts +0 -3
- package/dist/cli/commands/build.d.ts +0 -21
- package/dist/cli/commands/init.d.ts +0 -3
- package/dist/cli/commands/migrate.d.ts +0 -21
- package/dist/cli/commands/utils/css-loader-dependencies.d.ts +0 -2
- package/dist/config/preset/auto.d.ts +0 -3
- package/dist/config/preset/utils/infer-entries.d.ts +0 -12
- package/dist/config/preset/utils/overwrite-with-publish-config.d.ts +0 -4
- package/dist/config/utils/find-packem-file.d.ts +0 -2
- package/dist/config/utils/load-package-json.d.ts +0 -6
- package/dist/config/utils/load-packem-config.d.ts +0 -7
- package/dist/config/utils/load-preset.d.ts +0 -4
- package/dist/config/utils/load-tsconfig.d.ts +0 -5
- package/dist/config/utils/prepare-entries.d.ts +0 -4
- package/dist/jit/create-stub.d.ts +0 -4
- package/dist/packem/build.d.ts +0 -21
- package/dist/packem/index.d.ts +0 -25
- package/dist/packem/utils/brotli-size.d.ts +0 -2
- package/dist/packem/utils/group-by-keys.d.ts +0 -3
- package/dist/packem/utils/gzip-size.d.ts +0 -2
- package/dist/packem_shared/browserslistToEsbuild-C0IWmbNe-C6xPL1oW.js +0 -1
- package/dist/packem_shared/create-or-update-key-storage-GwAIWW7R.js +0 -3
- package/dist/packem_shared/default-B2EOH52z.js +0 -1
- package/dist/packem_shared/default-BYM_JvQL.js +0 -1
- package/dist/packem_shared/default-B_dUKZ_J.js +0 -1
- package/dist/packem_shared/default-Dego_fiC.js +0 -1
- package/dist/packem_shared/default-E4TiWfSK.js +0 -1
- package/dist/packem_shared/esbuildPlugin-DpLtQGuZ-Bny-e486.js +0 -3
- package/dist/packem_shared/index-CUp9WuCG.js +0 -1
- package/dist/packem_shared/index-DFigeRU2.js +0 -174
- package/dist/packem_shared/isolatedDeclarationsOxcTransformer-WbfE6cGu-NeZOx2Y7.js +0 -1
- package/dist/packem_shared/isolatedDeclarationsSwcTransformer-Ch2AgtWC-B-0lOgFf.js +0 -1
- package/dist/packem_shared/isolatedDeclarationsTypescriptTransformer-DkuEkofo-Cwe3ODMG.js +0 -3
- package/dist/packem_shared/oxcResolvePlugin-Ccef6pyL-D14z9S9i.js +0 -1
- package/dist/packem_shared/oxcTransformPlugin-DfVQouIB-Cpfv95eA.js +0 -4
- package/dist/packem_shared/resolveTypescriptMjsCtsPlugin-DcZrZTmM-3AmQC7y7.js +0 -6
- package/dist/packem_shared/swcPlugin-Boip4lWG-CwJ-HVJc.js +0 -1
- package/dist/rollup/build-types.d.ts +0 -5
- package/dist/rollup/build.d.ts +0 -5
- package/dist/rollup/get-rollup-options.d.ts +0 -5
- package/dist/rollup/utils/resolve-aliases.d.ts +0 -4
- package/dist/rollup/watch.d.ts +0 -5
- package/dist/utils/clean-distribution-directories.d.ts +0 -4
- package/dist/utils/create-or-update-key-storage.d.ts +0 -3
- package/dist/utils/extract-export-filenames.d.ts +0 -16
- package/dist/utils/find-alternatives.d.ts +0 -2
- package/dist/utils/get-package-side-effect.d.ts +0 -3
- package/dist/utils/infer-export-type.d.ts +0 -3
- package/dist/utils/kill-process.d.ts +0 -14
- package/dist/utils/log-build-errors.d.ts +0 -4
- package/dist/utils/remove-old-cache-folders.d.ts +0 -3
- package/dist/utils/warn-legacy-cjs.d.ts +0 -8
- package/dist/validator/attw.d.ts +0 -7
- package/dist/validator/package-json/index.d.ts +0 -4
- package/dist/validator/package-json/validate-dependencies.d.ts +0 -4
- package/dist/validator/package-json/validate-engines.d.ts +0 -4
- package/dist/validator/package-json/validate-package-entries.d.ts +0 -4
- package/dist/validator/package-json/validate-package-fields.d.ts +0 -4
- package/dist/validator/validate-alias-entries.d.ts +0 -3
- package/dist/validator/validate-bundle-size.d.ts +0 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export { default } from '@visulima/rollup-plugin-css/loader/less';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export { default } from '@visulima/rollup-plugin-css/loader/lightningcss';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export { default } from '@visulima/rollup-plugin-css/loader/postcss';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export { default } from '@visulima/rollup-plugin-css/loader/sass';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export { default } from '@visulima/rollup-plugin-css/loader/sourcemap';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export { default } from '@visulima/rollup-plugin-css/loader/stylus';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export { default } from '@visulima/rollup-plugin-css/loader/tailwindcss';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export { default } from '@visulima/rollup-plugin-css/minifier/cssnano';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export { default } from '@visulima/rollup-plugin-css/minifier/lightningcss';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export { default } from '../../../packem_shared/default-DWBYeUSC.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export { default } from '../../../packem_shared/default-79SPobLI.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export { default } from '../../../packem_shared/default-DeYZ934H.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export { sucrasePlugin as default } from '../../../packem_shared/default-wScAfTaq.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export { default } from '../../../packem_shared/default-DavaZMwC.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export { default } from '../../../packem_shared/default-DaU6CQEi.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export { default } from '../../../packem_shared/default-tUOOZ8w7.js';
|
package/dist/types.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { CheckPackageOptions } from "@arethetypeswrong/core";
|
|
2
2
|
import type { IsolatedDeclarationsTransformer, PackemRollupOptions, TransformerFn, TransformerName } from "@visulima/packem-rollup";
|
|
3
3
|
import type { InternalOXCTransformPluginConfig } from "@visulima/packem-rollup/oxc";
|
|
4
|
+
import type { NativeModulesOptions } from "@visulima/packem-rollup/plugin/native-modules";
|
|
4
5
|
import type { BuildContext, BuildHooks, Environment, Format, Mode, Runtime } from "@visulima/packem-share/types";
|
|
5
6
|
import type { FileCache } from "@visulima/packem-share/utils";
|
|
6
7
|
import type { StyleOptions } from "@visulima/rollup-plugin-css";
|
|
@@ -52,7 +53,7 @@ export interface AttwOptions extends CheckPackageOptions {
|
|
|
52
53
|
export interface BuildConfig extends DeepPartial<Omit<BuildOptions, "entries">> {
|
|
53
54
|
entries?: (BuildEntry | string)[];
|
|
54
55
|
hooks?: Partial<BuildHooks<InternalBuildOptions>>;
|
|
55
|
-
preset?: BuildPreset | "
|
|
56
|
+
preset?: BuildPreset | "none" | (NonNullable<unknown> & string);
|
|
56
57
|
}
|
|
57
58
|
export type BuildPreset = BuildConfig | (() => BuildConfig);
|
|
58
59
|
/**
|
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.43",
|
|
4
4
|
"description": "A fast and modern bundler for Node.js and TypeScript.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"anolilab",
|
|
@@ -78,6 +78,22 @@
|
|
|
78
78
|
"types": "./dist/config/index.d.ts",
|
|
79
79
|
"default": "./dist/config/index.js"
|
|
80
80
|
},
|
|
81
|
+
"./config/preset/react": {
|
|
82
|
+
"types": "./dist/config/preset/react.d.ts",
|
|
83
|
+
"default": "./dist/config/preset/react.js"
|
|
84
|
+
},
|
|
85
|
+
"./config/preset/solid": {
|
|
86
|
+
"types": "./dist/config/preset/solid.d.ts",
|
|
87
|
+
"default": "./dist/config/preset/solid.js"
|
|
88
|
+
},
|
|
89
|
+
"./config/preset/svelte": {
|
|
90
|
+
"types": "./dist/config/preset/svelte.d.ts",
|
|
91
|
+
"default": "./dist/config/preset/svelte.js"
|
|
92
|
+
},
|
|
93
|
+
"./config/preset/vue": {
|
|
94
|
+
"types": "./dist/config/preset/vue.d.ts",
|
|
95
|
+
"default": "./dist/config/preset/vue.js"
|
|
96
|
+
},
|
|
81
97
|
"./css/loader/sourcemap": {
|
|
82
98
|
"types": "./dist/rollup/plugins/css/loaders/sourcemap.d.ts",
|
|
83
99
|
"default": "./dist/rollup/plugins/css/loaders/sourcemap.js"
|
|
@@ -171,11 +187,11 @@
|
|
|
171
187
|
"@visulima/fs": "4.0.4",
|
|
172
188
|
"@visulima/humanizer": "2.0.3",
|
|
173
189
|
"@visulima/package": "4.1.4",
|
|
174
|
-
"@visulima/packem-rollup": "1.0.0-alpha.
|
|
175
|
-
"@visulima/packem-share": "1.0.0-alpha.
|
|
190
|
+
"@visulima/packem-rollup": "1.0.0-alpha.32",
|
|
191
|
+
"@visulima/packem-share": "1.0.0-alpha.15",
|
|
176
192
|
"@visulima/pail": "3.2.0",
|
|
177
193
|
"@visulima/path": "1.4.0",
|
|
178
|
-
"@visulima/rollup-plugin-css": "1.0.0-alpha.
|
|
194
|
+
"@visulima/rollup-plugin-css": "1.0.0-alpha.12",
|
|
179
195
|
"@visulima/source-map": "2.0.3",
|
|
180
196
|
"@visulima/tabular": "^3.1.3",
|
|
181
197
|
"@visulima/tsconfig": "2.1.0",
|
|
@@ -185,7 +201,7 @@
|
|
|
185
201
|
"defu": "6.1.4",
|
|
186
202
|
"fastest-levenshtein": "1.0.16",
|
|
187
203
|
"hookable": "5.5.3",
|
|
188
|
-
"html-minifier-next": "^4.
|
|
204
|
+
"html-minifier-next": "^4.7.0",
|
|
189
205
|
"jiti": "2.6.0",
|
|
190
206
|
"magic-string": "0.30.19",
|
|
191
207
|
"mlly": "1.8.0",
|
|
@@ -195,6 +211,99 @@
|
|
|
195
211
|
"tinyexec": "1.0.1",
|
|
196
212
|
"tinyglobby": "0.2.15"
|
|
197
213
|
},
|
|
214
|
+
"devDependencies": {
|
|
215
|
+
"@anolilab/eslint-config": "^16.4.4",
|
|
216
|
+
"@anolilab/prettier-config": "^6.0.8",
|
|
217
|
+
"@anolilab/semantic-release-pnpm": "2.0.4",
|
|
218
|
+
"@anolilab/semantic-release-preset": "^12.1.2",
|
|
219
|
+
"@arethetypeswrong/cli": "^0.18.2",
|
|
220
|
+
"@arethetypeswrong/core": "^0.18.2",
|
|
221
|
+
"@babel/core": "^7.28.5",
|
|
222
|
+
"@babel/parser": "7.28.4",
|
|
223
|
+
"@csstools/css-parser-algorithms": "3.0.5",
|
|
224
|
+
"@csstools/css-tokenizer": "3.0.4",
|
|
225
|
+
"@csstools/postcss-slow-plugins": "^2.0.0",
|
|
226
|
+
"@oxc-transform/binding-linux-x64-gnu": "*",
|
|
227
|
+
"@rollup/plugin-alias": "5.1.1",
|
|
228
|
+
"@rollup/plugin-commonjs": "29.0.0",
|
|
229
|
+
"@rollup/plugin-dynamic-import-vars": "2.1.5",
|
|
230
|
+
"@rollup/plugin-inject": "5.0.5",
|
|
231
|
+
"@rollup/plugin-json": "6.1.0",
|
|
232
|
+
"@rollup/plugin-node-resolve": "16.0.1",
|
|
233
|
+
"@rollup/plugin-replace": "6.0.2",
|
|
234
|
+
"@rollup/plugin-wasm": "6.2.2",
|
|
235
|
+
"@secretlint/secretlint-rule-preset-recommend": "^11.2.5",
|
|
236
|
+
"@svgr/core": "^8.1.0",
|
|
237
|
+
"@swc/core": "^1.15.3",
|
|
238
|
+
"@swc/types": "0.1.25",
|
|
239
|
+
"@tailwindcss/node": "^4.1.17",
|
|
240
|
+
"@tailwindcss/oxide": "^4.1.17",
|
|
241
|
+
"@total-typescript/ts-reset": "^0.6.1",
|
|
242
|
+
"@types/babel__core": "^7.20.5",
|
|
243
|
+
"@types/node": "24.5.2",
|
|
244
|
+
"@types/picomatch": "^4.0.2",
|
|
245
|
+
"@types/react-dom": "^19.2.3",
|
|
246
|
+
"@types/semver": "^7.7.1",
|
|
247
|
+
"@vitest/coverage-v8": "^4.0.15",
|
|
248
|
+
"@vitest/ui": "^4.0.15",
|
|
249
|
+
"conventional-changelog-conventionalcommits": "9.1.0",
|
|
250
|
+
"cross-env": "^10.1.0",
|
|
251
|
+
"cssnano": "^7.1.2",
|
|
252
|
+
"deeks": "^3.2.0",
|
|
253
|
+
"detect-indent": "^7.0.2",
|
|
254
|
+
"esbuild": "^0.27.1",
|
|
255
|
+
"eslint": "^9.36.0",
|
|
256
|
+
"execa": "^9.6.1",
|
|
257
|
+
"glob-parent": "6.0.2",
|
|
258
|
+
"icss-utils": "^5.1.0",
|
|
259
|
+
"less": "^4.4.2",
|
|
260
|
+
"lightningcss": "^1.30.2",
|
|
261
|
+
"lit": "^3.3.1",
|
|
262
|
+
"lucide-static": "^0.556.0",
|
|
263
|
+
"minireset.css": "0.0.7",
|
|
264
|
+
"oxc-parser": "0.99.0",
|
|
265
|
+
"oxc-resolver": "11.14.0",
|
|
266
|
+
"oxc-transform": "0.99.0",
|
|
267
|
+
"package-manager-detector": "^1.6.0",
|
|
268
|
+
"postcss": "^8.5.6",
|
|
269
|
+
"postcss-custom-properties": "14.0.6",
|
|
270
|
+
"postcss-load-config": "^6.0.1",
|
|
271
|
+
"postcss-modules-extract-imports": "^3.1.0",
|
|
272
|
+
"postcss-modules-local-by-default": "^4.2.0",
|
|
273
|
+
"postcss-modules-scope": "^3.2.1",
|
|
274
|
+
"postcss-modules-values": "^4.0.0",
|
|
275
|
+
"postcss-value-parser": "^4.2.0",
|
|
276
|
+
"prettier": "^3.7.4",
|
|
277
|
+
"publint": "^0.3.15",
|
|
278
|
+
"react": "^19.2.1",
|
|
279
|
+
"react-dom": "^19.2.1",
|
|
280
|
+
"rimraf": "^6.1.2",
|
|
281
|
+
"rollup-plugin-dts": "6.2.3",
|
|
282
|
+
"rollup-plugin-license": "3.6.0",
|
|
283
|
+
"rollup-plugin-lit-css": "^6.0.0",
|
|
284
|
+
"rollup-plugin-polyfill-node": "0.13.0",
|
|
285
|
+
"rollup-plugin-pure": "^0.4.0",
|
|
286
|
+
"rollup-plugin-visualizer": "6.0.3",
|
|
287
|
+
"rs-module-lexer": "^2.6.0",
|
|
288
|
+
"sass": "^1.95.0",
|
|
289
|
+
"sass-embedded": "^1.93.3",
|
|
290
|
+
"secretlint": "^11.2.5",
|
|
291
|
+
"semantic-release": "^25.0.2",
|
|
292
|
+
"sort-package-json": "3.4.0",
|
|
293
|
+
"stylus": "^0.64.0",
|
|
294
|
+
"sucrase": "^3.35.1",
|
|
295
|
+
"sugarss": "5.0.1",
|
|
296
|
+
"tailwindcss": "^4.1.17",
|
|
297
|
+
"tempy": "^3.1.0",
|
|
298
|
+
"tree-kill": "^1.2.2",
|
|
299
|
+
"typedoc": "0.28.13",
|
|
300
|
+
"typedoc-plugin-markdown": "4.9.0",
|
|
301
|
+
"typedoc-plugin-rename-defaults": "0.7.3",
|
|
302
|
+
"typescript": "^5.9.3",
|
|
303
|
+
"unplugin-vue": "^7.1.0",
|
|
304
|
+
"rollup-plugin-svelte": "^7.2.3",
|
|
305
|
+
"vitest": "^4.0.15"
|
|
306
|
+
},
|
|
198
307
|
"peerDependencies": {
|
|
199
308
|
"@arethetypeswrong/core": ">=0.18.2",
|
|
200
309
|
"@swc/core": ">=1.11.29",
|
|
@@ -206,7 +315,7 @@
|
|
|
206
315
|
"less": ">=4.2.0",
|
|
207
316
|
"lightningcss": ">=1.27.0",
|
|
208
317
|
"oxc-transform": ">=0.20.0",
|
|
209
|
-
"package-manager-detector": "^1.
|
|
318
|
+
"package-manager-detector": "^1.6.0",
|
|
210
319
|
"postcss": ">=8.4.47",
|
|
211
320
|
"postcss-load-config": ">=6.0.1",
|
|
212
321
|
"postcss-modules-extract-imports": ">=3.1.0",
|
|
@@ -217,6 +326,8 @@
|
|
|
217
326
|
"sass": ">=1.43.4",
|
|
218
327
|
"sass-embedded": ">=1.79.4",
|
|
219
328
|
"stylus": ">=0.63.0",
|
|
329
|
+
"unplugin-vue": ">=7",
|
|
330
|
+
"rollup-plugin-svelte": ">=7",
|
|
220
331
|
"sucrase": ">=3.35.0",
|
|
221
332
|
"typedoc": ">=0.26.0",
|
|
222
333
|
"typedoc-plugin-markdown": ">=4.2.0",
|
|
@@ -227,6 +338,9 @@
|
|
|
227
338
|
"@arethetypeswrong/core": {
|
|
228
339
|
"optional": true
|
|
229
340
|
},
|
|
341
|
+
"@babel/core": {
|
|
342
|
+
"optional": true
|
|
343
|
+
},
|
|
230
344
|
"@ckeditor/typedoc-plugins": {
|
|
231
345
|
"optional": true
|
|
232
346
|
},
|
|
@@ -278,6 +392,9 @@
|
|
|
278
392
|
"postcss-value-parser": {
|
|
279
393
|
"optional": true
|
|
280
394
|
},
|
|
395
|
+
"rollup-plugin-svelte": {
|
|
396
|
+
"optional": true
|
|
397
|
+
},
|
|
281
398
|
"sass": {
|
|
282
399
|
"optional": true
|
|
283
400
|
},
|
|
@@ -302,6 +419,9 @@
|
|
|
302
419
|
"typescript": {
|
|
303
420
|
"optional": true
|
|
304
421
|
},
|
|
422
|
+
"unplugin-vue": {
|
|
423
|
+
"optional": true
|
|
424
|
+
},
|
|
305
425
|
"which-pm-runs": {
|
|
306
426
|
"optional": true
|
|
307
427
|
}
|
|
@@ -312,5 +432,22 @@
|
|
|
312
432
|
"publishConfig": {
|
|
313
433
|
"access": "public",
|
|
314
434
|
"provenance": true
|
|
435
|
+
},
|
|
436
|
+
"scripts": {
|
|
437
|
+
"build": "cross-env INTERNAL_PACKEM_BUILD=1 JITI_INTEROP_DEFAULT=1 jiti src/cli/index.ts build --development",
|
|
438
|
+
"build:prod": "cross-env INTERNAL_PACKEM_BUILD=1 JITI_INTEROP_DEFAULT=1 jiti src/cli/index.ts build --production",
|
|
439
|
+
"clean": "rimraf node_modules dist .eslintcache",
|
|
440
|
+
"dev": "pnpm run build",
|
|
441
|
+
"lint:attw": "attw --pack",
|
|
442
|
+
"lint:eslint": "eslint ./src",
|
|
443
|
+
"lint:eslint:fix": "eslint . --cache --concurrency auto --fix,",
|
|
444
|
+
"lint:package-json": "publint --strict",
|
|
445
|
+
"lint:prettier": "prettier --config=.prettierrc.cjs --check .",
|
|
446
|
+
"lint:prettier:fix": "prettier --config=.prettierrc.cjs --write .",
|
|
447
|
+
"lint:types": "tsc --noEmit",
|
|
448
|
+
"test": "vitest run --cache",
|
|
449
|
+
"test:coverage": "vitest run --cache --coverage",
|
|
450
|
+
"test:ui": "vitest --cache --ui --coverage.enabled=true",
|
|
451
|
+
"test:watch": "vitest"
|
|
315
452
|
}
|
|
316
453
|
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { Pail } from "@visulima/pail";
|
|
2
|
-
import type { BuildEntry, TypeDocumentOptions } from "../../types.d.ts";
|
|
3
|
-
declare const generateReferenceDocumentation: (options: TypeDocumentOptions, entries: BuildEntry[], outputDirectory: string, logger: Pail) => Promise<void>;
|
|
4
|
-
export default generateReferenceDocumentation;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { Cli } from "@visulima/cerebro";
|
|
2
|
-
/**
|
|
3
|
-
* Creates and registers the build command with the CLI.
|
|
4
|
-
* Handles various build modes, environment variables, and build configurations.
|
|
5
|
-
* @param cli CLI instance to register the command with
|
|
6
|
-
* @example
|
|
7
|
-
* ```typescript
|
|
8
|
-
* // Usage from command line:
|
|
9
|
-
* // Build for production:
|
|
10
|
-
* // packem build --production
|
|
11
|
-
*
|
|
12
|
-
* // Watch mode with development environment:
|
|
13
|
-
* // packem build --watch --development
|
|
14
|
-
*
|
|
15
|
-
* // With custom environment variables:
|
|
16
|
-
* // packem build --env.API_URL=http://api.example.com
|
|
17
|
-
* ```
|
|
18
|
-
* @internal
|
|
19
|
-
*/
|
|
20
|
-
declare const createBuildCommand: (cli: Cli) => void;
|
|
21
|
-
export default createBuildCommand;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { Cli } from "@visulima/cerebro";
|
|
2
|
-
/**
|
|
3
|
-
* Creates and registers the migrate command with the CLI.
|
|
4
|
-
* Handles migration from other bundlers (tsup, unbuild, bunchee, etc.) to packem.
|
|
5
|
-
* @param cli CLI instance to register the command with
|
|
6
|
-
* @example
|
|
7
|
-
* ```typescript
|
|
8
|
-
* // From command line:
|
|
9
|
-
* // Migrate from tsup to packem:
|
|
10
|
-
* // packem migrate
|
|
11
|
-
*
|
|
12
|
-
* // Dry run to preview changes:
|
|
13
|
-
* // packem migrate --dry-run
|
|
14
|
-
*
|
|
15
|
-
* // Specify custom directory:
|
|
16
|
-
* // packem migrate --cwd /path/to/project
|
|
17
|
-
* ```
|
|
18
|
-
* @internal
|
|
19
|
-
*/
|
|
20
|
-
declare const createMigrateCommand: (cli: Cli) => void;
|
|
21
|
-
export default createMigrateCommand;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { PackageJson } from "@visulima/package";
|
|
2
|
-
import type { BuildContext } from "@visulima/packem-share/types";
|
|
3
|
-
import type { InferEntriesResult, InternalBuildOptions } from "../../../types.d.ts";
|
|
4
|
-
/**
|
|
5
|
-
* Infer entries from package files.
|
|
6
|
-
* @param packageJson
|
|
7
|
-
* @param sourceFiles A list of source files to use for inferring entries.
|
|
8
|
-
* @param context
|
|
9
|
-
* @returns
|
|
10
|
-
*/
|
|
11
|
-
declare const inferEntries: (packageJson: PackageJson, sourceFiles: string[], context: BuildContext<InternalBuildOptions>) => Promise<InferEntriesResult>;
|
|
12
|
-
export default inferEntries;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { NormalizedPackageJson } from "@visulima/package";
|
|
2
|
-
import type { BuildConfig } from "../../../types.d.ts";
|
|
3
|
-
declare const overwriteWithPublishConfig: (packageJson: NormalizedPackageJson, declaration?: BuildConfig["declaration"]) => NormalizedPackageJson;
|
|
4
|
-
export default overwriteWithPublishConfig;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Jiti } from "jiti";
|
|
2
|
-
import type { BuildConfig, Environment, Mode } from "../../types.d.ts";
|
|
3
|
-
declare const loadPackemConfig: (jiti: Jiti, rootDirectory: string, environment: Environment, mode: Mode, configPath?: string) => Promise<{
|
|
4
|
-
config: BuildConfig;
|
|
5
|
-
path: string;
|
|
6
|
-
}>;
|
|
7
|
-
export default loadPackemConfig;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { NormalizedPackageJson } from "@visulima/package";
|
|
2
|
-
import type { Pail } from "@visulima/pail";
|
|
3
|
-
import type { TsConfigResult } from "@visulima/tsconfig";
|
|
4
|
-
declare const loadTsconfig: (rootDirectory: string, packageJson: NormalizedPackageJson, logger: Pail, tsconfigPath?: string) => Promise<TsConfigResult | undefined>;
|
|
5
|
-
export default loadTsconfig;
|
package/dist/packem/build.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { FileCache } from "@visulima/packem-share";
|
|
2
|
-
import type { BuildContext } from "@visulima/packem-share/types";
|
|
3
|
-
import type { InternalBuildOptions } from "../types.d.ts";
|
|
4
|
-
/**
|
|
5
|
-
* Main build function that orchestrates the entire build process.
|
|
6
|
-
* Handles both JavaScript/TypeScript compilation and type definition generation.
|
|
7
|
-
* @param context Build context containing configuration and state
|
|
8
|
-
* @param fileCache Cache instance for file operations
|
|
9
|
-
* @returns Promise resolving to a boolean indicating build success
|
|
10
|
-
* @example
|
|
11
|
-
* ```typescript
|
|
12
|
-
* const success = await build(BuildContext<InternalBuildOptions>, new FileCache());
|
|
13
|
-
* if (success) {
|
|
14
|
-
* console.log('Build completed successfully');
|
|
15
|
-
* }
|
|
16
|
-
* ```
|
|
17
|
-
* @throws {Error} If the build process encounters critical errors
|
|
18
|
-
* @public
|
|
19
|
-
*/
|
|
20
|
-
declare const build: (context: BuildContext<InternalBuildOptions>, fileCache: FileCache) => Promise<boolean>;
|
|
21
|
-
export default build;
|
package/dist/packem/index.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { Pail } from "@visulima/pail";
|
|
2
|
-
import type { BuildConfig, Environment, Mode } from '../types.d.ts';
|
|
3
|
-
/**
|
|
4
|
-
* Main entry point for the Packem bundler.
|
|
5
|
-
* Handles the complete build process including configuration loading, validation,
|
|
6
|
-
* and execution of the build/watch process.
|
|
7
|
-
* @param rootDirectory Root directory of the project
|
|
8
|
-
* @param mode Build mode (build/watch)
|
|
9
|
-
* @param environment Build environment (development/production)
|
|
10
|
-
* @param logger Logger instance for output
|
|
11
|
-
* @param inputConfig User provided build configuration and options
|
|
12
|
-
* @example
|
|
13
|
-
* ```typescript
|
|
14
|
-
* import packem from 'packem';
|
|
15
|
-
*
|
|
16
|
-
* await packem('/path/to/project', 'build', 'production', logger, {
|
|
17
|
-
* debug: true,
|
|
18
|
-
* configPath: './packem.config.js'
|
|
19
|
-
* });
|
|
20
|
-
* ```
|
|
21
|
-
* @throws {Error} If configuration validation fails or build process encounters errors
|
|
22
|
-
* @public
|
|
23
|
-
*/
|
|
24
|
-
declare const packem: (rootDirectory: string, mode: Mode, environment: Environment, logger: Pail, debug: boolean, config: BuildConfig, tsconfigPath?: string) => Promise<void>;
|
|
25
|
-
export default packem;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var i=Object.defineProperty;var s=(a,t)=>i(a,"name",{value:t,configurable:!0});var o=Object.defineProperty,n=s((a,t)=>o(a,"name",{value:t,configurable:!0}),"r"),l=Object.defineProperty,d=n((a,t)=>l(a,"name",{value:t,configurable:!0}),"a"),f=Object.defineProperty,c=d((a,t)=>f(a,"name",{value:t,configurable:!0}),"r");const m=new Set(["chrome","edge","es","firefox","ie","ios","node","opera","safari"]),p=["android 4"],u={android:"chrome",ios_saf:"ios"},b=" ",O=c(a=>{let t=a.filter(e=>!p.some(r=>e.startsWith(r))).map(e=>e.split(b)).map(([e,r])=>[u[e]||e,r]).map(([e,r])=>[e,r.includes("-")?r.slice(0,r.indexOf("-")):r]).map(([e,r])=>[e,r.endsWith(".0")?r.slice(0,-2):r]).filter(([,e])=>/^\d+(?:\.\d+)*$/.test(e)).filter(([e])=>m.has(e));return t=Object.entries(Object.fromEntries(t)),t.map(([e,r])=>`${e}${r}`)},"browserslistToEsbuild");export{O as b};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
var i=Object.defineProperty;var c=(e,r)=>i(e,"name",{value:r,configurable:!0});import{isAccessibleSync as s,readJsonSync as u,writeJsonSync as f}from"@visulima/fs";import{join as l}from"@visulima/path";var p=Object.defineProperty,g=c((e,r)=>p(e,"name",{value:r,configurable:!0}),"t"),v=Object.defineProperty,y=g((e,r)=>v(e,"name",{value:r,configurable:!0}),"a"),b=Object.defineProperty,m=y((e,r)=>b(e,"name",{value:r,configurable:!0}),"r");const w=m((e,r,n)=>{const a=new RegExp(`(<!-- ${r} -->)[\\s\\S]*?(<!-- /${r} -->)`,"g");if(a.test(e))return e.replace(a,`$1
|
|
2
|
-
${n}
|
|
3
|
-
$2`)},"replaceContentWithinMarker");var d=Object.defineProperty,S=c((e,r)=>d(e,"name",{value:r,configurable:!0}),"i");const x=S((e,r,n,a)=>{try{let t={};const o=l(r,"keystore.json");a&&s(o)&&(t=u(o)),t[e]===void 0&&(t[e]=new Date().toISOString()),f(o,t,{overwrite:!0})}catch(t){n.debug({context:[t],message:t.message,prefix:"cache-key-store"})}},"createOrUpdateKeyStorage");export{x as d,w as p};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as a}from"./isolatedDeclarationsOxcTransformer-WbfE6cGu-NeZOx2Y7.js";import{z as s}from"./oxcResolvePlugin-Ccef6pyL-D14z9S9i.js";import{n as x}from"./oxcTransformPlugin-DfVQouIB-Cpfv95eA.js";export{a as isolatedDeclarationsOxcTransformer,s as oxcResolvePlugin,x as oxcTransformPlugin};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u as a}from"./isolatedDeclarationsSwcTransformer-Ch2AgtWC-B-0lOgFf.js";import{t as e}from"./swcPlugin-Boip4lWG-CwJ-HVJc.js";export{a as isolatedDeclarationsSwcTransformer,e as swcPlugin};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var m=Object.defineProperty;var n=(e,r)=>m(e,"name",{value:r,configurable:!0});import{createFilter as f}from"@rollup/pluginutils";import{f as l}from"./index-CUp9WuCG.js";import{transform as p}from"sucrase";var d=Object.defineProperty,v=n((e,r)=>d(e,"name",{value:r,configurable:!0}),"n"),b=Object.defineProperty,P=v((e,r)=>b(e,"name",{value:r,configurable:!0}),"a"),g=Object.defineProperty,y=P((e,r)=>g(e,"name",{value:r,configurable:!0}),"n");const o=y(({exclude:e,include:r,...t})=>{const c=f(r,e??l);return{name:"packem:sucrase",async transform(u,a){if(!c(a))return;const{code:s,sourceMap:i}=p(u,{...t,filePath:a,sourceMapOptions:{compiledFilename:a}});return{code:s,map:i}}}},"sucraseTransformPlugin");o.NAME="sucrase";const F=o;export{F as sucrasePlugin};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{v as r}from"./isolatedDeclarationsTypescriptTransformer-DkuEkofo-Cwe3ODMG.js";import{B as o,B as p,N as t,D as a,i as c}from"./resolveTypescriptMjsCtsPlugin-DcZrZTmM-3AmQC7y7.js";export{r as isolatedDeclarationsTypescriptTransformer,o as patchTypescriptTypes,p as patchTypescriptTypesPlugin,t as resolveTsconfigPathsPlugin,a as resolveTsconfigRootDirectoriesPlugin,c as resolveTypescriptMjsCtsPlugin};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as r}from"./browserslistToEsbuild-C0IWmbNe-C6xPL1oW.js";import{z as e}from"./esbuildPlugin-DpLtQGuZ-Bny-e486.js";export{r as browserslistToEsbuild,e as esbuildPlugin};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
var x=Object.defineProperty;var v=(e,r)=>x(e,"name",{value:r,configurable:!0});import{createFilter as O}from"@rollup/pluginutils";import{a as k}from"./index-CUp9WuCG.js";import{extname as M,join as P}from"@visulima/path";import{transform as y,formatMessages as $,build as A}from"esbuild";import{findCacheDirSync as E}from"@visulima/find-cache-dir";import{readFileSync as S}from"@visulima/fs";import*as W from"rs-module-lexer";import __cjs_mod__ from "node:module"; // -- packem CommonJS require shim --
|
|
2
|
-
const require = __cjs_mod__.createRequire(import.meta.url);
|
|
3
|
-
var C=Object.defineProperty,F=v((e,r)=>C(e,"name",{value:r,configurable:!0}),"h"),I=Object.defineProperty,f=F((e,r)=>I(e,"name",{value:r,configurable:!0}),"u"),R=Object.defineProperty,q=f((e,r)=>R(e,"name",{value:r,configurable:!0}),"n$1");const w=q(async(e,r)=>{r.length>0&&(await $(r,{color:!0,kind:"warning"})).forEach(s=>e.warn(s))},"warn");var L=Object.defineProperty,D=f((e,r)=>L(e,"name",{value:r,configurable:!0}),"t");const N=D(e=>{if(e==="es")return"esm";if(e==="cjs")return e},"getEsbuildFormat"),T=D(({sourceMap:e=!0,...r})=>async function(s,n,i){if(r.minify||r.minifyWhitespace||r.minifyIdentifiers||r.minifySyntax){const t=N(i.format),c=await y(s,{format:t,loader:"js",sourcemap:e,...r});if(await w(this,c.warnings),c.code)return{code:c.code,map:c.map||void 0}}},"getRenderChunk");var B=Object.defineProperty,j=f((e,r)=>B(e,"name",{value:r,configurable:!0}),"n");const h=j(e=>e.replaceAll("\\","/"),"slash"),{parseAsync:G}=W,H=j(async e=>{const r=E("@visulima/packem/optimize-deps",{create:!0,cwd:e.cwd});if(!r)throw new Error('[packem:optimize-deps]: failed to find or create cache directory "node_modules/.cache/packem/optimize_deps".');await A({absWorkingDir:e.cwd,bundle:!0,entryPoints:e.include,format:"esm",ignoreAnnotations:!0,metafile:!0,outdir:r,sourcemap:e.sourceMap,splitting:!0,...e.esbuildOptions,plugins:[{name:"optimize-deps",async setup(n){n.onResolve({filter:/.*/},async i=>{if(e.exclude?.includes(i.path))return{external:!0};if(!i.pluginData?.__resolving_dep_path__&&e.include.includes(i.path)){const t=await n.resolve(i.path,{kind:"import-statement",pluginData:{__resolving_dep_path__:!0},resolveDir:i.resolveDir});return t.errors.length>0||t.warnings.length>0?t:{namespace:"optimize-deps",path:i.path,pluginData:{absolute:t.path,resolveDir:i.resolveDir}}}}),n.onLoad({filter:/.*/,namespace:"optimize-deps"},async i=>{const{absolute:t,resolveDir:c}=i.pluginData,p=S(t),{output:g}=await G({input:[{code:p,filename:t}]});return{contents:(g[0]?.exports??[]).length>0?`export * from '${h(t)}'`:`module.exports = require('${h(t)}')`,resolveDir:c}})}},...e.esbuildOptions?.plugins??[]]});const s=new Map;for(const n of e.include)s.set(n,{file:P(r,`${n}.js`)});return{cacheDir:r,optimized:s}},"optimizeDeps");var U=Object.defineProperty,J=f((e,r)=>U(e,"name",{value:r,configurable:!0}),"g");const K=J(({exclude:e,include:r,loaders:s,logger:n,optimizeDeps:i,sourceMap:t,...c})=>{const p=k;if(s!==void 0)for(let[o,a]of Object.entries(s)){const l=o.startsWith(".")?o:`.${o}`;typeof a=="string"?p[l]=a:a||delete p[l]}const g=Object.keys(p),z=new RegExp(`\\.(${g.map(o=>o.slice(1)).join("|")})$`),_=O(r??z,e);let u,b=process.cwd();return{async buildStart(){!i||u||(u=await H({cwd:b,sourceMap:t??!1,...i}),n.debug("optimized %O",u.optimized))},name:"packem:esbuild",options({context:o}){o&&(b=o)},renderChunk:T({...c,sourceMap:t}),async resolveId(o){if(u?.optimized.has(o)){const a=u.optimized.get(o);if(a)return n.debug("resolved %s to %s",o,a.file),a.file}},async transform(o,a){if(!_(a)||u?.optimized.has(a))return;const l=M(a),d=p[l];if(n.debug("transforming %s with %s loader",a,d),!d)return;const m=await y(o,{format:["base64","binary","dataurl","text","json"].includes(d)?"esm":void 0,loader:d,sourcefile:a.replace(/\.[cm]ts/,".ts"),sourcemap:t,...c});if(await w(this,m.warnings),m.code)return{code:m.code,map:m.map||void 0}}}},"esbuildTransformer");K.NAME="esbuild";export{K as z};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const s=[".js",".mjs",".cjs",".ts",".mts",".cts",".d.ts",".d.mts",".d.cts",".jsx",".tsx",".json",".node"],c=[...s,".ctsx",".mtsx"],l={".aac":"file",".cjs":"js",".cts":"ts",".ctsx":"tsx",".eot":"file",".flac":"file",".js":"js",".jsx":"jsx",".mjs":"js",".mp3":"file",".mp4":"file",".mts":"ts",".mtsx":"tsx",".ogg":"file",".otf":"file",".ts":"ts",".tsx":"tsx",".ttf":"file",".wav":"file",".webm":"file",".woff":"file",".woff2":"file"},t="production",e="development",f=new Set(["edge-light","react-native","react-server"]),m=new Set([e,t,...f]),i=/node_modules/,x=/(?:\.d\.[mc]?tsx?|\.\w+)$/,j="packem_chunks",o="packem_shared",a=/\.(?:m|c)?(?:j|t)sx?$/;export{e as E,m as N,j as O,c as _,l as a,x as c,f as e,i as f,o as l,a as m,s,t};
|