@visulima/packem 2.0.0-alpha.14 → 2.0.0-alpha.16

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 (39) hide show
  1. package/CHANGELOG.md +43 -7
  2. package/dist/builder/typedoc/index.d.ts +3 -4
  3. package/dist/cli/index.js +2 -2
  4. package/dist/config/index.d.ts +3 -4
  5. package/dist/index.d.ts +5 -6
  6. package/dist/index.js +1 -1
  7. package/dist/packem_shared/{default-B6X7-Lx3.js → default-DpHYpsSt.js} +1 -1
  8. package/dist/packem_shared/esbuildPlugin-CXr7ud3R-CwR2FCHj.js +3 -0
  9. package/dist/packem_shared/{index-s8SAEiZI.js → index-CfcRSWHX.js} +70 -69
  10. package/dist/packem_shared/{index-DvyuEcZZ.d.ts → index-zrs6Po_w.d.ts} +6 -0
  11. package/dist/packem_shared/{types-0XfKu6f9.d.ts → types-B0J7_ujg.d.ts} +5 -4
  12. package/dist/rollup/plugins/css/loaders/less.d.ts +1 -1
  13. package/dist/rollup/plugins/css/loaders/less.js +1 -1
  14. package/dist/rollup/plugins/css/loaders/lightningcss.d.ts +1 -1
  15. package/dist/rollup/plugins/css/loaders/lightningcss.js +1 -1
  16. package/dist/rollup/plugins/css/loaders/postcss.d.ts +1 -1
  17. package/dist/rollup/plugins/css/loaders/postcss.js +1 -1
  18. package/dist/rollup/plugins/css/loaders/sass.d.ts +1 -1
  19. package/dist/rollup/plugins/css/loaders/sass.js +1 -1
  20. package/dist/rollup/plugins/css/loaders/sourcemap.d.ts +9 -9
  21. package/dist/rollup/plugins/css/loaders/sourcemap.js +1 -1
  22. package/dist/rollup/plugins/css/loaders/stylus.d.ts +1 -1
  23. package/dist/rollup/plugins/css/loaders/stylus.js +1 -1
  24. package/dist/rollup/plugins/css/loaders/tailwindcss.d.ts +1 -1
  25. package/dist/rollup/plugins/css/loaders/tailwindcss.js +1 -1
  26. package/dist/rollup/plugins/css/minifiers/cssnano.d.ts +1 -1
  27. package/dist/rollup/plugins/css/minifiers/cssnano.js +1 -1
  28. package/dist/rollup/plugins/css/minifiers/lightningcss.d.ts +1 -1
  29. package/dist/rollup/plugins/css/minifiers/lightningcss.js +1 -1
  30. package/dist/rollup/plugins/esbuild/index.d.ts +2 -2
  31. package/dist/rollup/plugins/esbuild/index.js +1 -1
  32. package/dist/rollup/plugins/oxc/isolated-declarations-oxc-transformer.d.ts +1 -1
  33. package/dist/rollup/plugins/oxc/oxc-transformer.d.ts +1 -1
  34. package/dist/rollup/plugins/sucrase/index.d.ts +1 -1
  35. package/dist/rollup/plugins/swc/isolated-declarations-swc-transformer.d.ts +1 -1
  36. package/dist/rollup/plugins/swc/swc-plugin.d.ts +2 -2
  37. package/dist/rollup/plugins/typescript/isolated-declarations-typescript-transformer.d.ts +1 -1
  38. package/package.json +8 -8
  39. package/dist/packem_shared/esbuildPlugin-BAwyhG6L-yty60jMl.js +0 -3
package/CHANGELOG.md CHANGED
@@ -1,3 +1,39 @@
1
+ ## @visulima/packem [2.0.0-alpha.16](https://github.com/visulima/packem/compare/@visulima/packem@2.0.0-alpha.15...@visulima/packem@2.0.0-alpha.16) (2025-09-01)
2
+
3
+ ### Features
4
+
5
+ * add inline CSS processing mode to rollup-plugin-css ([2605997](https://github.com/visulima/packem/commit/2605997bc1e76a80b22529fd71ec053c02111ea2))
6
+
7
+ ### Miscellaneous Chores
8
+
9
+ * update dependencies and versions in package.json and pnpm-lock.yaml ([e6086fb](https://github.com/visulima/packem/commit/e6086fbd6ad21bbc35b8365b03e8a5d543354154))
10
+
11
+
12
+ ### Dependencies
13
+
14
+ * **@visulima/rollup-plugin-css:** upgraded to 1.0.0-alpha.2
15
+
16
+ ## @visulima/packem [2.0.0-alpha.15](https://github.com/visulima/packem/compare/@visulima/packem@2.0.0-alpha.14...@visulima/packem@2.0.0-alpha.15) (2025-08-29)
17
+
18
+ ### Features
19
+
20
+ * added the first migration for the rolldown-plugin-dts for rollup ([fb3321f](https://github.com/visulima/packem/commit/fb3321fedb5101368bdf8e711db30d00d9ef26f3))
21
+ * enhance jiti import resolution in create-stub ([6c4ddb3](https://github.com/visulima/packem/commit/6c4ddb32238fd5cb3ac94e9f98ce27999c58034a))
22
+ * implement lazy barrel optimization in rollup-plugin ([2cdcb34](https://github.com/visulima/packem/commit/2cdcb342f41940b4b277698740153953b905acd0))
23
+ * introduce debarrel optimization for improved import handling ([129435e](https://github.com/visulima/packem/commit/129435ee941f2cd9f003046225e2a8862eb2cba7))
24
+ * update rollup-plugin-dts with new dependencies and type handling improvements ([b9ca7f8](https://github.com/visulima/packem/commit/b9ca7f802247977c5cd0a4debf8fe3a376c525df))
25
+
26
+ ### Code Refactoring
27
+
28
+ * rename rollup-css-plugin to rollup-plugin-css and update related imports ([876e241](https://github.com/visulima/packem/commit/876e241ec8cf727e9f1666902733996752b18295))
29
+
30
+
31
+ ### Dependencies
32
+
33
+ * **@visulima/packem-rollup:** upgraded to 1.0.0-alpha.12
34
+ * **@visulima/packem-share:** upgraded to 1.0.0-alpha.9
35
+ * **@visulima/rollup-plugin-css:** upgraded to 1.0.0-alpha.1
36
+
1
37
  ## @visulima/packem [2.0.0-alpha.14](https://github.com/visulima/packem/compare/@visulima/packem@2.0.0-alpha.13...@visulima/packem@2.0.0-alpha.14) (2025-08-25)
2
38
 
3
39
  ### Features
@@ -9,7 +45,7 @@
9
45
 
10
46
  * **@visulima/packem-rollup:** upgraded to 1.0.0-alpha.11
11
47
  * **@visulima/packem-share:** upgraded to 1.0.0-alpha.8
12
- * **@visulima/rollup-css-plugin:** upgraded to 1.0.0-alpha.10
48
+ * **@visulima/rollup-plugin-css:** upgraded to 1.0.0-alpha.10
13
49
 
14
50
  ## @visulima/packem [2.0.0-alpha.13](https://github.com/visulima/packem/compare/@visulima/packem@2.0.0-alpha.12...@visulima/packem@2.0.0-alpha.13) (2025-08-21)
15
51
 
@@ -26,14 +62,14 @@
26
62
  ### Dependencies
27
63
 
28
64
  * **@visulima/packem-rollup:** upgraded to 1.0.0-alpha.10
29
- * **@visulima/rollup-css-plugin:** upgraded to 1.0.0-alpha.9
65
+ * **@visulima/rollup-plugin-css:** upgraded to 1.0.0-alpha.9
30
66
 
31
67
  ## @visulima/packem [2.0.0-alpha.12](https://github.com/visulima/packem/compare/@visulima/packem@2.0.0-alpha.11...@visulima/packem@2.0.0-alpha.12) (2025-08-21)
32
68
 
33
69
 
34
70
  ### Dependencies
35
71
 
36
- * **@visulima/rollup-css-plugin:** upgraded to 1.0.0-alpha.8
72
+ * **@visulima/rollup-plugin-css:** upgraded to 1.0.0-alpha.8
37
73
 
38
74
  ## @visulima/packem [2.0.0-alpha.11](https://github.com/visulima/packem/compare/@visulima/packem@2.0.0-alpha.10...@visulima/packem@2.0.0-alpha.11) (2025-08-20)
39
75
 
@@ -61,7 +97,7 @@
61
97
 
62
98
  * **@visulima/packem-rollup:** upgraded to 1.0.0-alpha.8
63
99
  * **@visulima/packem-share:** upgraded to 1.0.0-alpha.7
64
- * **@visulima/rollup-css-plugin:** upgraded to 1.0.0-alpha.7
100
+ * **@visulima/rollup-plugin-css:** upgraded to 1.0.0-alpha.7
65
101
 
66
102
  ## @visulima/packem [2.0.0-alpha.9](https://github.com/visulima/packem/compare/@visulima/packem@2.0.0-alpha.8...@visulima/packem@2.0.0-alpha.9) (2025-08-17)
67
103
 
@@ -74,7 +110,7 @@
74
110
 
75
111
  * **@visulima/packem-rollup:** upgraded to 1.0.0-alpha.7
76
112
  * **@visulima/packem-share:** upgraded to 1.0.0-alpha.6
77
- * **@visulima/rollup-css-plugin:** upgraded to 1.0.0-alpha.6
113
+ * **@visulima/rollup-plugin-css:** upgraded to 1.0.0-alpha.6
78
114
 
79
115
  ## @visulima/packem [2.0.0-alpha.8](https://github.com/visulima/packem/compare/@visulima/packem@2.0.0-alpha.7...@visulima/packem@2.0.0-alpha.8) (2025-08-11)
80
116
 
@@ -104,7 +140,7 @@
104
140
 
105
141
  * **@visulima/packem-rollup:** upgraded to 1.0.0-alpha.5
106
142
  * **@visulima/packem-share:** upgraded to 1.0.0-alpha.5
107
- * **@visulima/rollup-css-plugin:** upgraded to 1.0.0-alpha.5
143
+ * **@visulima/rollup-plugin-css:** upgraded to 1.0.0-alpha.5
108
144
 
109
145
  ## @visulima/packem [2.0.0-alpha.5](https://github.com/visulima/packem/compare/@visulima/packem@2.0.0-alpha.4...@visulima/packem@2.0.0-alpha.5) (2025-07-31)
110
146
 
@@ -287,7 +323,7 @@
287
323
 
288
324
  * **@visulima/packem-rollup:** upgraded to 1.0.0-alpha.1
289
325
  * **@visulima/packem-share:** upgraded to 1.0.0-alpha.1
290
- * **@visulima/rollup-css-plugin:** upgraded to 1.0.0-alpha.1
326
+ * **@visulima/rollup-plugin-css:** upgraded to 1.0.0-alpha.1
291
327
 
292
328
  ## @visulima/packem [1.28.2](https://github.com/visulima/packem/compare/@visulima/packem@1.28.1...@visulima/packem@1.28.2) (2025-06-24)
293
329
 
@@ -1,5 +1,5 @@
1
- import { B as BuildContext } from '../../packem_shared/index-DvyuEcZZ.js';
2
- import { I as InternalBuildOptions } from '../../packem_shared/types-0XfKu6f9.js';
1
+ import { B as BuildContext } from '../../packem_shared/index-zrs6Po_w.js';
2
+ import { I as InternalBuildOptions } from '../../packem_shared/types-B0J7_ujg.js';
3
3
  import '@rollup/plugin-alias';
4
4
  import '@rollup/plugin-commonjs';
5
5
  import '@rollup/plugin-json';
@@ -18,8 +18,7 @@ import '@visulima/colorize';
18
18
  import 'oxc-resolver';
19
19
  import 'oxc-transform';
20
20
  import 'sucrase';
21
- import '@visulima/rollup-css-plugin';
22
- import 'jiti';
21
+ import '@visulima/rollup-plugin-css';
23
22
  import 'typedoc';
24
23
 
25
24
  declare const builder: (context: BuildContext<InternalBuildOptions>, cachePath: string | undefined, _: never, logged: boolean) => Promise<void>;
package/dist/cli/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
- var Y=Object.defineProperty;var k=(s,t)=>Y(s,"name",{value:t,configurable:!0});import Q from"@visulima/cerebro";import{SimpleReporter as Z}from"@visulima/pail/reporter";import{cwd as A,exit as ee}from"node:process";import{installPackage as N}from"@antfu/install-pkg";import{spinner as K,select as $,multiselect as F,confirm as w,intro as se,log as G,cancel as te,outro as oe}from"@clack/prompts";import{isAccessible as ie,readFile as ne,writeFile as ae,isAccessibleSync as S,collectSync as re,writeJsonSync as le,writeFileSync as ce}from"@visulima/fs";import{join as x,resolve as M,extname as W,toNamespacedPath as pe}from"@visulima/path";import de from"magic-string";import{t as I,E as V,e as ue,N as q,_ as me,c as fe}from"../packem_shared/index-CUp9WuCG.js";import{defu as ye}from"defu";import{createJiti as ge}from"jiti";import{cyan as be,bold as O,gray as ve}from"@visulima/colorize";import{e as we,i as J,c as he,b as ke}from"../packem_shared/index-s8SAEiZI.js";import{parsePackageJson as $e}from"@visulima/package/package-json";import __cjs_mod__ from "node:module"; // -- packem CommonJS require shim --
2
+ var Y=Object.defineProperty;var k=(s,t)=>Y(s,"name",{value:t,configurable:!0});import Q from"@visulima/cerebro";import{SimpleReporter as Z}from"@visulima/pail/reporter";import{cwd as A,exit as ee}from"node:process";import{installPackage as N}from"@antfu/install-pkg";import{spinner as K,select as $,multiselect as F,confirm as w,intro as se,log as G,cancel as te,outro as oe}from"@clack/prompts";import{isAccessible as ie,readFile as ne,writeFile as ae,isAccessibleSync as S,collectSync as re,writeJsonSync as le,writeFileSync as ce}from"@visulima/fs";import{join as x,resolve as M,extname as W,toNamespacedPath as pe}from"@visulima/path";import de from"magic-string";import{t as I,E as V,e as ue,N as q,_ as me,c as fe}from"../packem_shared/index-CUp9WuCG.js";import{defu as ye}from"defu";import{createJiti as ge}from"jiti";import{cyan as be,bold as O,gray as ve}from"@visulima/colorize";import{e as we,i as J,c as he,b as ke}from"../packem_shared/index-CfcRSWHX.js";import{parsePackageJson as $e}from"@visulima/package/package-json";import __cjs_mod__ from "node:module"; // -- packem CommonJS require shim --
3
3
  const require = __cjs_mod__.createRequire(import.meta.url);
4
- const Se="@visulima/packem",xe="2.0.0-alpha.13";var je=Object.defineProperty,Ce=k((s,t)=>je(s,"name",{value:t,configurable:!0}),"t$2");const _=Ce(async(s,t="")=>{let e=t;if(!e){const r=["packem.config.js","packem.config.mjs","packem.config.cjs","packem.config.ts","packem.config.cts","packem.config.mts"];for(const n of r)if(await ie(x(s,n))){e=`./${n}`;break}}if(!/\.(?:js|mjs|cjs|ts|cts|mts)$/.test(e))throw new Error("Invalid packem config file extension. Only .js, .mjs, .cjs, .ts, .cts and .mts extensions are allowed.");return e},"findPackemFile"),X={less:["less"],lightningcss:["lightningcss"],"node-sass":["node-sass"],postcss:["postcss","postcss-load-config","postcss-modules-extract-imports","postcss-modules-local-by-default","postcss-modules-scope","postcss-modules-values","postcss-value-parser","@csstools/css-parser-algorithms","@csstools/css-tokenizer","@csstools/postcss-slow-plugins","icss-utils","@visulima/css-style-inject"],sass:["sass"],"sass-embedded":["sass-embedded"],stylus:["stylus"],tailwindcss:["@tailwindcss/node","@tailwindcss/oxide","tailwindcss"]};var Ee=Object.defineProperty,R=k((s,t)=>Ee(s,"name",{value:t,configurable:!0}),"g");const De=["typedoc","typedoc-plugin-markdown","typedoc-plugin-rename-defaults"],Pe=R(s=>{s.addCommand({argument:{description:"Add a packem feature to your project",name:"feature",required:!0},description:"Add a optional packem feature to your project",execute:R(async({argument:t,logger:e,options:r})=>{const n=K(),i=M(A(),r.dir??".");let d;try{d=await _(i,r.config)}catch{e.error("Could not find a packem config file, please run `packem init` first.");return}const f=await ne(d,{buffer:!1});let y="cjs";f.includes("import")&&(y="esm");const o=new de(f),u=" transformer,";let p=" transformer";if(f.includes(" transformer,")&&(p=" transformer,"),t.includes("typedoc")){if(f.includes("typedoc: typedocBuilder")||f.includes("@visulima/packem/builder/typedoc")){e.warn("Typedoc has already been added to the packem config.");return}y==="cjs"?o.prepend(`const typedocBuilder = require("@visulima/packem/builder/typedoc");
4
+ const Se="@visulima/packem",xe="2.0.0-alpha.15";var je=Object.defineProperty,Ce=k((s,t)=>je(s,"name",{value:t,configurable:!0}),"t$2");const _=Ce(async(s,t="")=>{let e=t;if(!e){const r=["packem.config.js","packem.config.mjs","packem.config.cjs","packem.config.ts","packem.config.cts","packem.config.mts"];for(const n of r)if(await ie(x(s,n))){e=`./${n}`;break}}if(!/\.(?:js|mjs|cjs|ts|cts|mts)$/.test(e))throw new Error("Invalid packem config file extension. Only .js, .mjs, .cjs, .ts, .cts and .mts extensions are allowed.");return e},"findPackemFile"),X={less:["less"],lightningcss:["lightningcss"],"node-sass":["node-sass"],postcss:["postcss","postcss-load-config","postcss-modules-extract-imports","postcss-modules-local-by-default","postcss-modules-scope","postcss-modules-values","postcss-value-parser","@csstools/css-parser-algorithms","@csstools/css-tokenizer","@csstools/postcss-slow-plugins","icss-utils","@visulima/css-style-inject"],sass:["sass"],"sass-embedded":["sass-embedded"],stylus:["stylus"],tailwindcss:["@tailwindcss/node","@tailwindcss/oxide","tailwindcss"]};var Ee=Object.defineProperty,R=k((s,t)=>Ee(s,"name",{value:t,configurable:!0}),"g");const De=["typedoc","typedoc-plugin-markdown","typedoc-plugin-rename-defaults"],Pe=R(s=>{s.addCommand({argument:{description:"Add a packem feature to your project",name:"feature",required:!0},description:"Add a optional packem feature to your project",execute:R(async({argument:t,logger:e,options:r})=>{const n=K(),i=M(A(),r.dir??".");let d;try{d=await _(i,r.config)}catch{e.error("Could not find a packem config file, please run `packem init` first.");return}const f=await ne(d,{buffer:!1});let y="cjs";f.includes("import")&&(y="esm");const o=new de(f),u=" transformer,";let p=" transformer";if(f.includes(" transformer,")&&(p=" transformer,"),t.includes("typedoc")){if(f.includes("typedoc: typedocBuilder")||f.includes("@visulima/packem/builder/typedoc")){e.warn("Typedoc has already been added to the packem config.");return}y==="cjs"?o.prepend(`const typedocBuilder = require("@visulima/packem/builder/typedoc");
5
5
  `):o.prepend(`import typedocBuilder from "@visulima/packem/builder/typedoc";
6
6
  `),f.includes("builder: {")?o.replace("builder: {",`builder: {
7
7
  typedoc: typedocBuilder,
@@ -1,7 +1,6 @@
1
- import { B as BuildConfig, c as BuildConfigFunction, d as BuildPreset } from '../packem_shared/types-0XfKu6f9.js';
2
- export { d as BuildHooks } from '../packem_shared/index-DvyuEcZZ.js';
3
- import '@visulima/rollup-css-plugin';
4
- import 'jiti';
1
+ import { B as BuildConfig, c as BuildConfigFunction, d as BuildPreset } from '../packem_shared/types-B0J7_ujg.js';
2
+ export { d as BuildHooks } from '../packem_shared/index-zrs6Po_w.js';
3
+ import '@visulima/rollup-plugin-css';
5
4
  import 'typedoc';
6
5
  import '@rollup/plugin-alias';
7
6
  import '@rollup/plugin-commonjs';
package/dist/index.d.ts CHANGED
@@ -1,10 +1,9 @@
1
1
  import { ConstructorOptions } from '@visulima/pail';
2
- import { B as BuildConfig } from './packem_shared/types-0XfKu6f9.js';
3
- export { a as BuildEntry, b as BuildOptions, R as RollupBuildOptions } from './packem_shared/types-0XfKu6f9.js';
4
- import { E as Environment, M as Mode } from './packem_shared/index-DvyuEcZZ.js';
5
- export { B as BuildContext, b as BuildContextBuildAssetAndChunk, c as BuildContextBuildEntry, d as BuildHooks, I as IsolatedDeclarationsTransformer, R as Runtime, T as TransformerFn, a as TransformerName } from './packem_shared/index-DvyuEcZZ.js';
6
- import '@visulima/rollup-css-plugin';
7
- import 'jiti';
2
+ import { B as BuildConfig } from './packem_shared/types-B0J7_ujg.js';
3
+ export { a as BuildEntry, b as BuildOptions, R as RollupBuildOptions } from './packem_shared/types-B0J7_ujg.js';
4
+ import { E as Environment, M as Mode } from './packem_shared/index-zrs6Po_w.js';
5
+ export { B as BuildContext, b as BuildContextBuildAssetAndChunk, c as BuildContextBuildEntry, d as BuildHooks, I as IsolatedDeclarationsTransformer, R as Runtime, T as TransformerFn, a as TransformerName } from './packem_shared/index-zrs6Po_w.js';
6
+ import '@visulima/rollup-plugin-css';
8
7
  import 'typedoc';
9
8
  import '@rollup/plugin-alias';
10
9
  import '@rollup/plugin-commonjs';
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- var c=Object.defineProperty;var o=(e,r)=>c(e,"name",{value:r,configurable:!0});import{createPail as s}from"@visulima/pail";import{SimpleReporter as u}from"@visulima/pail/reporter";import{b as g}from"./packem_shared/index-s8SAEiZI.js";var f=Object.defineProperty,l=o((e,r)=>f(e,"name",{value:r,configurable:!0}),"r");const C=l(async(e,r={})=>{const{debug:t,environment:i,logger:a,mode:n,tsconfigPath:m,...d}={debug:!1,environment:"production",logger:{},mode:"build",tsconfigPath:void 0,...r},p=s({reporters:[new u({error:{hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0}})],scope:"packem",...a});await g(e,n,i,p,t,d,m)},"packem");export{C as packem};
1
+ var c=Object.defineProperty;var o=(e,r)=>c(e,"name",{value:r,configurable:!0});import{createPail as s}from"@visulima/pail";import{SimpleReporter as u}from"@visulima/pail/reporter";import{b as g}from"./packem_shared/index-CfcRSWHX.js";var f=Object.defineProperty,l=o((e,r)=>f(e,"name",{value:r,configurable:!0}),"r");const C=l(async(e,r={})=>{const{debug:t,environment:i,logger:a,mode:n,tsconfigPath:m,...d}={debug:!1,environment:"production",logger:{},mode:"build",tsconfigPath:void 0,...r},p=s({reporters:[new u({error:{hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0}})],scope:"packem",...a});await g(e,n,i,p,t,d,m)},"packem");export{C as packem};
@@ -1 +1 @@
1
- import{b as r}from"./browserslistToEsbuild-C0IWmbNe-C6xPL1oW.js";import{_ as e}from"./esbuildPlugin-BAwyhG6L-yty60jMl.js";export{r as browserslistToEsbuild,e as esbuildPlugin};
1
+ import{b as r}from"./browserslistToEsbuild-C0IWmbNe-C6xPL1oW.js";import{z as e}from"./esbuildPlugin-CXr7ud3R-CwR2FCHj.js";export{r as browserslistToEsbuild,e as esbuildPlugin};
@@ -0,0 +1,3 @@
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 E,build as $}from"esbuild";import{findCacheDirSync as A}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 E(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"),G=j(async e=>{const r=A("@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 $({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 W.parseAsync({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,H=f((e,r)=>U(e,"name",{value:r,configurable:!0}),"g");const J=H(({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 G({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");J.NAME="esbuild";export{J as z};