@visulima/packem 1.0.0-alpha.4 → 1.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 (39) hide show
  1. package/CHANGELOG.md +285 -0
  2. package/README.md +16 -3
  3. package/dist/cli.cjs +7 -1
  4. package/dist/cli.mjs +15 -1
  5. package/dist/config.cjs +1 -1
  6. package/dist/config.d.cts +4 -4
  7. package/dist/config.d.mts +4 -4
  8. package/dist/config.d.ts +4 -4
  9. package/dist/config.mjs +9 -1
  10. package/dist/create-bundler.cjs +65 -56
  11. package/dist/create-bundler.d.cts +2 -2
  12. package/dist/create-bundler.d.mts +2 -2
  13. package/dist/create-bundler.d.ts +2 -2
  14. package/dist/create-bundler.mjs +74 -57
  15. package/dist/rollup/plugins/esbuild/index.cjs +1 -1
  16. package/dist/rollup/plugins/esbuild/index.mjs +2 -2
  17. package/dist/rollup/plugins/sucrase/index.cjs +1 -1
  18. package/dist/rollup/plugins/sucrase/index.mjs +9 -1
  19. package/dist/rollup/plugins/swc/index.cjs +1 -1
  20. package/dist/rollup/plugins/swc/index.d.cts +1 -1
  21. package/dist/rollup/plugins/swc/index.d.mts +1 -1
  22. package/dist/rollup/plugins/swc/index.d.ts +1 -1
  23. package/dist/rollup/plugins/swc/index.mjs +9 -1
  24. package/dist/shared/packem.BAcY88If.mjs +9 -0
  25. package/dist/shared/{packem.DIUR7hAQ.d.mts → packem.BBXO6_87.d.mts} +13 -6
  26. package/dist/shared/{packem.Bx49YBYz.d.cts → packem.ClcPYkxx.d.cts} +13 -6
  27. package/dist/shared/{packem.CRdgUXSu.d.ts → packem.DtAA_1Hu.d.ts} +13 -6
  28. package/dist/shared/packem.HRXF255z.mjs +9 -0
  29. package/dist/shared/packem.NVRVuzg1.cjs +1 -0
  30. package/dist/shared/{packem.C44tLE3n.d.cts → packem.aYVbzCkK.d.cts} +1 -1
  31. package/dist/shared/{packem.C44tLE3n.d.mts → packem.aYVbzCkK.d.mts} +1 -1
  32. package/dist/shared/{packem.C44tLE3n.d.ts → packem.aYVbzCkK.d.ts} +1 -1
  33. package/package.json +57 -53
  34. package/dist/cli.d.cts +0 -2
  35. package/dist/cli.d.mts +0 -2
  36. package/dist/cli.d.ts +0 -2
  37. package/dist/shared/packem.Bdmp1hC5.mjs +0 -1
  38. package/dist/shared/packem.Bj4QPFg7.mjs +0 -1
  39. package/dist/shared/packem.uvB0cQX0.cjs +0 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,288 @@
1
+ ## @visulima/packem [1.0.0-alpha.40](https://github.com/visulima/packem/compare/@visulima/packem@1.0.0-alpha.39...@visulima/packem@1.0.0-alpha.40) (2024-06-04)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * text changes ([cc0005e](https://github.com/visulima/packem/commit/cc0005e7f45211a54ca9363dab1f3e83a5e4709c))
7
+
8
+ ## @visulima/packem [1.0.0-alpha.39](https://github.com/visulima/packem/compare/@visulima/packem@1.0.0-alpha.38...@visulima/packem@1.0.0-alpha.39) (2024-06-04)
9
+
10
+
11
+ ### Features
12
+
13
+ * more improvements ([b1a1013](https://github.com/visulima/packem/commit/b1a10136d2b7b275b78910b0d6c5e11c1b262b1b))
14
+
15
+ ## @visulima/packem [1.0.0-alpha.38](https://github.com/visulima/packem/compare/@visulima/packem@1.0.0-alpha.37...@visulima/packem@1.0.0-alpha.38) (2024-06-03)
16
+
17
+
18
+ ### Features
19
+
20
+ * improved auto preset handling, split the builder based on evn and runtime ([6d92a3b](https://github.com/visulima/packem/commit/6d92a3bebd3916bb008aa862164740f520017f8f))
21
+
22
+ ## @visulima/packem [1.0.0-alpha.37](https://github.com/visulima/packem/compare/@visulima/packem@1.0.0-alpha.36...@visulima/packem@1.0.0-alpha.37) (2024-06-02)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * disabled cjs ([8c714e6](https://github.com/visulima/packem/commit/8c714e653669efa07250122b84fe200c103d81a0))
28
+
29
+ ## @visulima/packem [1.0.0-alpha.36](https://github.com/visulima/packem/compare/@visulima/packem@1.0.0-alpha.35...@visulima/packem@1.0.0-alpha.36) (2024-06-02)
30
+
31
+
32
+ ### Features
33
+
34
+ * reduced complexity scope of builder ([958049a](https://github.com/visulima/packem/commit/958049a8d5fb1bc81b59a85f6373ba26b1ba0edc))
35
+
36
+ ## @visulima/packem [1.0.0-alpha.35](https://github.com/visulima/packem/compare/@visulima/packem@1.0.0-alpha.34...@visulima/packem@1.0.0-alpha.35) (2024-06-02)
37
+
38
+
39
+ ### Bug Fixes
40
+
41
+ * fixed path handling without ./ ([e717627](https://github.com/visulima/packem/commit/e717627a8a8bc332a54126c79653cccee1aeea3d))
42
+
43
+ ## @visulima/packem [1.0.0-alpha.34](https://github.com/visulima/packem/compare/@visulima/packem@1.0.0-alpha.33...@visulima/packem@1.0.0-alpha.34) (2024-06-02)
44
+
45
+
46
+ ### Features
47
+
48
+ * optimized package.json auto resolver ([89bda92](https://github.com/visulima/packem/commit/89bda9259044a02ec629283a6152a8381ec2d4d1))
49
+ * optimized package.json auto resolver ([1348ada](https://github.com/visulima/packem/commit/1348ada13f778db685ddfcede9a11caca3af1a0c))
50
+ * optimized package.json auto resolver ([87be4ea](https://github.com/visulima/packem/commit/87be4ea19acc2dbd9c90b4b783df372aeb6cee23))
51
+
52
+ ## @visulima/packem [1.0.0-alpha.33](https://github.com/visulima/packem/compare/@visulima/packem@1.0.0-alpha.32...@visulima/packem@1.0.0-alpha.33) (2024-06-01)
53
+
54
+
55
+ ### Features
56
+
57
+ * working on a better auto preset, changed package to esm ([1697cd2](https://github.com/visulima/packem/commit/1697cd23ae35155795c4d727a7ac3004b1eec450))
58
+
59
+ ## @visulima/packem [1.0.0-alpha.32](https://github.com/visulima/packem/compare/@visulima/packem@1.0.0-alpha.31...@visulima/packem@1.0.0-alpha.32) (2024-05-31)
60
+
61
+
62
+ ### Features
63
+
64
+ * delete the cache if the cacheKey did changed based on the packagejson data ([820a564](https://github.com/visulima/packem/commit/820a5642be00ac7b1a08f05c10a924af802a8d53))
65
+
66
+ ## @visulima/packem [1.0.0-alpha.31](https://github.com/visulima/packem/compare/@visulima/packem@1.0.0-alpha.30...@visulima/packem@1.0.0-alpha.31) (2024-05-31)
67
+
68
+
69
+ ### Bug Fixes
70
+
71
+ * improved hashing of plugins ([2ca9377](https://github.com/visulima/packem/commit/2ca9377c82e726707881e8b06b2a56ab51ed8d06))
72
+
73
+ ## @visulima/packem [1.0.0-alpha.30](https://github.com/visulima/packem/compare/@visulima/packem@1.0.0-alpha.29...@visulima/packem@1.0.0-alpha.30) (2024-05-31)
74
+
75
+
76
+ ### Bug Fixes
77
+
78
+ * fixed issue with cache dir, added auto update of lock file ([a49df8a](https://github.com/visulima/packem/commit/a49df8a093578b3c781e466b2e3d4478a9a8d01a))
79
+
80
+ ## @visulima/packem [1.0.0-alpha.29](https://github.com/visulima/packem/compare/@visulima/packem@1.0.0-alpha.28...@visulima/packem@1.0.0-alpha.29) (2024-05-31)
81
+
82
+
83
+ ### Bug Fixes
84
+
85
+ * added missing variable to watch ([174124b](https://github.com/visulima/packem/commit/174124b68063da42afb51ca008c542480f32c436))
86
+
87
+ ## @visulima/packem [1.0.0-alpha.28](https://github.com/visulima/packem/compare/@visulima/packem@1.0.0-alpha.27...@visulima/packem@1.0.0-alpha.28) (2024-05-30)
88
+
89
+
90
+ ### Features
91
+
92
+ * optimized file names for the cache ([e8abc95](https://github.com/visulima/packem/commit/e8abc9569a7ed6cfca2d531a6dfb4a3e26999af8))
93
+
94
+ ## @visulima/packem [1.0.0-alpha.27](https://github.com/visulima/packem/compare/@visulima/packem@1.0.0-alpha.26...@visulima/packem@1.0.0-alpha.27) (2024-05-30)
95
+
96
+
97
+ ### Features
98
+
99
+ * added plugin cache ([e77052f](https://github.com/visulima/packem/commit/e77052fe960470f55a4a5ee33efa11eed5ecd191))
100
+
101
+ ## @visulima/packem [1.0.0-alpha.26](https://github.com/visulima/packem/compare/@visulima/packem@1.0.0-alpha.25...@visulima/packem@1.0.0-alpha.26) (2024-05-30)
102
+
103
+
104
+ ### Features
105
+
106
+ * added NODE_ENV ([9c04a6f](https://github.com/visulima/packem/commit/9c04a6f0a27427d25141e03cc27679cd42b2a847))
107
+
108
+ ## @visulima/packem [1.0.0-alpha.25](https://github.com/visulima/packem/compare/@visulima/packem@1.0.0-alpha.24...@visulima/packem@1.0.0-alpha.25) (2024-05-29)
109
+
110
+
111
+ ### Bug Fixes
112
+
113
+ * cs fixes ([66e0149](https://github.com/visulima/packem/commit/66e014993490253f8d5a4f92c017aecddbcd8284))
114
+
115
+ ## @visulima/packem [1.0.0-alpha.24](https://github.com/visulima/packem/compare/@visulima/packem@1.0.0-alpha.23...@visulima/packem@1.0.0-alpha.24) (2024-05-29)
116
+
117
+
118
+ ### Features
119
+
120
+ * added file cache to rollup, added support of es5 ([c6734ac](https://github.com/visulima/packem/commit/c6734ac079db193d1c88e473cf01361a728c9bdd))
121
+ * added option to disable cache ([9ee5cac](https://github.com/visulima/packem/commit/9ee5cacb3db1f1e59419f5a00f0f245a5be43d3a))
122
+
123
+ ## @visulima/packem [1.0.0-alpha.23](https://github.com/visulima/packem/compare/@visulima/packem@1.0.0-alpha.22...@visulima/packem@1.0.0-alpha.23) (2024-05-29)
124
+
125
+
126
+ ### Bug Fixes
127
+
128
+ * removed packem from package.json. fixed test runs ([05b346a](https://github.com/visulima/packem/commit/05b346a57749147fb7f5cbd810112eaf01ec2a56))
129
+
130
+ ## @visulima/packem [1.0.0-alpha.22](https://github.com/visulima/packem/compare/@visulima/packem@1.0.0-alpha.21...@visulima/packem@1.0.0-alpha.22) (2024-05-29)
131
+
132
+
133
+ ### Bug Fixes
134
+
135
+ * fixing tests for check all functions ([786fb37](https://github.com/visulima/packem/commit/786fb378b7cbab3dbb48cdf43561485cdf5436a0))
136
+
137
+ ## @visulima/packem [1.0.0-alpha.21](https://github.com/visulima/packem/compare/@visulima/packem@1.0.0-alpha.20...@visulima/packem@1.0.0-alpha.21) (2024-05-28)
138
+
139
+
140
+ ### Bug Fixes
141
+
142
+ * optimized logs ([63d9d45](https://github.com/visulima/packem/commit/63d9d4557d1ae3e7eb8c85d43df9a645c2e3af57))
143
+
144
+ ## @visulima/packem [1.0.0-alpha.20](https://github.com/visulima/packem/compare/@visulima/packem@1.0.0-alpha.19...@visulima/packem@1.0.0-alpha.20) (2024-05-28)
145
+
146
+
147
+ ### Bug Fixes
148
+
149
+ * extended logs ([984a1ea](https://github.com/visulima/packem/commit/984a1eac339f12b6683b5284325bf97d0b606334))
150
+
151
+ ## @visulima/packem [1.0.0-alpha.19](https://github.com/visulima/packem/compare/@visulima/packem@1.0.0-alpha.18...@visulima/packem@1.0.0-alpha.19) (2024-05-28)
152
+
153
+
154
+ ### Bug Fixes
155
+
156
+ * fixed error handling of promises ([be3b055](https://github.com/visulima/packem/commit/be3b055d68f2544c4271d1da9899e6ea40ebdb04))
157
+
158
+ ## @visulima/packem [1.0.0-alpha.18](https://github.com/visulima/packem/compare/@visulima/packem@1.0.0-alpha.17...@visulima/packem@1.0.0-alpha.18) (2024-05-28)
159
+
160
+
161
+ ### Bug Fixes
162
+
163
+ * new debug message ([ef7db6f](https://github.com/visulima/packem/commit/ef7db6ff4af9a91372ae57241dc38a38093e5d6b))
164
+
165
+ ## @visulima/packem [1.0.0-alpha.17](https://github.com/visulima/packem/compare/@visulima/packem@1.0.0-alpha.16...@visulima/packem@1.0.0-alpha.17) (2024-05-28)
166
+
167
+
168
+ ### Bug Fixes
169
+
170
+ * working on better tests ([a6a569e](https://github.com/visulima/packem/commit/a6a569e88496ac30bfebebc05c0b0f967d8810b8))
171
+
172
+ ## @visulima/packem [1.0.0-alpha.16](https://github.com/visulima/packem/compare/@visulima/packem@1.0.0-alpha.15...@visulima/packem@1.0.0-alpha.16) (2024-05-28)
173
+
174
+
175
+ ### Bug Fixes
176
+
177
+ * working on better tests ([a612717](https://github.com/visulima/packem/commit/a6127174c0368a8d5dd5c94dde0777d0a7305a90))
178
+
179
+
180
+ ### Miscellaneous Chores
181
+
182
+ * updated readme ([637d0a8](https://github.com/visulima/packem/commit/637d0a8e63ac51071da0fc98c6f8458d0402a7ea))
183
+
184
+ ## @visulima/packem [1.0.0-alpha.15](https://github.com/visulima/packem/compare/@visulima/packem@1.0.0-alpha.14...@visulima/packem@1.0.0-alpha.15) (2024-05-27)
185
+
186
+
187
+ ### Features
188
+
189
+ * added a first version of the init command ([ab3b009](https://github.com/visulima/packem/commit/ab3b0091cb30d7632be3e6818cb76a03ecd13a4f))
190
+
191
+ ## @visulima/packem [1.0.0-alpha.14](https://github.com/visulima/packem/compare/@visulima/packem@1.0.0-alpha.13...@visulima/packem@1.0.0-alpha.14) (2024-05-27)
192
+
193
+
194
+ ### Bug Fixes
195
+
196
+ * optimized the code a bit ([c644e8a](https://github.com/visulima/packem/commit/c644e8a3b1926b55c3c4038943100260bb9de811))
197
+
198
+ ## @visulima/packem [1.0.0-alpha.13](https://github.com/visulima/packem/compare/@visulima/packem@1.0.0-alpha.12...@visulima/packem@1.0.0-alpha.13) (2024-05-27)
199
+
200
+
201
+ ### Bug Fixes
202
+
203
+ * optimized the code with memo calls ([fe27249](https://github.com/visulima/packem/commit/fe27249d25fabcf5f2f9a8717a0fe750667475d8))
204
+
205
+
206
+ ### Styles
207
+
208
+ * cs fixes ([44f813e](https://github.com/visulima/packem/commit/44f813e6a0f3bc787490c480eeb338530cd37ede))
209
+
210
+ ## @visulima/packem [1.0.0-alpha.12](https://github.com/visulima/packem/compare/@visulima/packem@1.0.0-alpha.11...@visulima/packem@1.0.0-alpha.12) (2024-05-27)
211
+
212
+
213
+ ### Bug Fixes
214
+
215
+ * fixed types validation ([f0f572e](https://github.com/visulima/packem/commit/f0f572ea04a001bd566371d67f3f0df2da35d09d))
216
+
217
+ ## @visulima/packem [1.0.0-alpha.11](https://github.com/visulima/packem/compare/@visulima/packem@1.0.0-alpha.10...@visulima/packem@1.0.0-alpha.11) (2024-05-27)
218
+
219
+
220
+ ### Bug Fixes
221
+
222
+ * optimize config loading of types, cjs and esm ([ed4368f](https://github.com/visulima/packem/commit/ed4368f833c2e577ae78bb7a89f18075d8fde6d9))
223
+
224
+ ## @visulima/packem [1.0.0-alpha.10](https://github.com/visulima/packem/compare/@visulima/packem@1.0.0-alpha.9...@visulima/packem@1.0.0-alpha.10) (2024-05-27)
225
+
226
+
227
+ ### Bug Fixes
228
+
229
+ * optimize the code a bit ([90fa3e4](https://github.com/visulima/packem/commit/90fa3e4e468a75fe9c764614473119ca6671661c))
230
+
231
+
232
+ ### Styles
233
+
234
+ * cs fix ([6a77847](https://github.com/visulima/packem/commit/6a778475666bd236eb9dee56797ba969989b99fa))
235
+
236
+
237
+ ### Code Refactoring
238
+
239
+ * optimize the code a bit ([0960712](https://github.com/visulima/packem/commit/0960712bac282a691bbf7b88c0492cf101d3e812))
240
+
241
+ ## @visulima/packem [1.0.0-alpha.9](https://github.com/visulima/packem/compare/@visulima/packem@1.0.0-alpha.8...@visulima/packem@1.0.0-alpha.9) (2024-05-25)
242
+
243
+
244
+ ### Features
245
+
246
+ * added build time ([5ad7b27](https://github.com/visulima/packem/commit/5ad7b27eedd056dc1ce127ad76bcc03a52fe5d31))
247
+
248
+
249
+ ### Miscellaneous Chores
250
+
251
+ * clean up of started node native plugin ([6b67ca9](https://github.com/visulima/packem/commit/6b67ca93299d876893028d80816defa5da27c5f0))
252
+
253
+ ## @visulima/packem [1.0.0-alpha.8](https://github.com/visulima/packem/compare/@visulima/packem@1.0.0-alpha.7...@visulima/packem@1.0.0-alpha.8) (2024-05-25)
254
+
255
+
256
+ ### Bug Fixes
257
+
258
+ * removed vue examples, removed jsx preserve error ([55f5571](https://github.com/visulima/packem/commit/55f55712e021a3a4a1aa24c2026a508597a28d14))
259
+
260
+ ## @visulima/packem [1.0.0-alpha.7](https://github.com/visulima/packem/compare/@visulima/packem@1.0.0-alpha.6...@visulima/packem@1.0.0-alpha.7) (2024-05-25)
261
+
262
+
263
+ ### Bug Fixes
264
+
265
+ * adjusted target on swc and esbuild ([5ee4937](https://github.com/visulima/packem/commit/5ee493757e5fc51945228df0ff97db77c35eac3e))
266
+
267
+ ## @visulima/packem [1.0.0-alpha.6](https://github.com/visulima/packem/compare/@visulima/packem@1.0.0-alpha.5...@visulima/packem@1.0.0-alpha.6) (2024-05-25)
268
+
269
+
270
+ ### Bug Fixes
271
+
272
+ * added target options to esbuild and swc ([5d3100b](https://github.com/visulima/packem/commit/5d3100b6bce15819a90b97f537b5626498bb6b18))
273
+
274
+
275
+ ### Styles
276
+
277
+ * cs fix ([78752e4](https://github.com/visulima/packem/commit/78752e434e62c20c5efb800015d321899770030f))
278
+
279
+ ## @visulima/packem [1.0.0-alpha.5](https://github.com/visulima/packem/compare/@visulima/packem@1.0.0-alpha.4...@visulima/packem@1.0.0-alpha.5) (2024-05-25)
280
+
281
+
282
+ ### Bug Fixes
283
+
284
+ * added better dx for invalid entries ([55fc8ed](https://github.com/visulima/packem/commit/55fc8ed9040dc40d751028e2143a85962aa6b54e))
285
+
1
286
  ## @visulima/packem [1.0.0-alpha.4](https://github.com/visulima/packem/compare/@visulima/packem@1.0.0-alpha.3...@visulima/packem@1.0.0-alpha.4) (2024-05-25)
2
287
 
3
288
 
package/README.md CHANGED
@@ -39,17 +39,30 @@ yarn add @visulima/packem
39
39
  pnpm add @visulima/packem
40
40
  ```
41
41
 
42
+ ### Choose you transformer
43
+
44
+ You choose which one of the three supported transformer to use.
45
+
46
+ - [esbuild](https://github.com/evanw/esbuild)
47
+ - [@swc/core](https://github.com/swc-project/swc)
48
+ - [sucrase](https://github.com/alangpierce/sucrase)
49
+
42
50
  ## Usage
43
51
 
44
52
  ```typescript
45
53
 
46
54
  ```
47
55
 
56
+ Links:
57
+
58
+ - https://github.com/frehner/modern-guide-to-packaging-js-library#set-the-main-field
59
+
48
60
  ## Related
49
61
 
50
62
  - [bunchee](https://github.com/huozhi/bunchee) - Zero config bundler for ECMAScript and TypeScript packages
51
63
  - [unbuild](https://github.com/unjs/unbuild) - 📦 An unified javascript build system
52
64
  - [pkgroll](https://github.com/privatenumber/pkgroll) - 📦 Zero-config package bundler for Node.js + TypeScript
65
+ - [siroc](https://github.com/danielroe/siroc) - Zero-config build tooling for Node
53
66
  - [tsup](https://github.com/egoist/tsup) - The simplest and fastest way to bundle your TypeScript libraries
54
67
 
55
68
  ## Supported Node.js Versions
@@ -74,7 +87,7 @@ The visulima pack is open-sourced software licensed under the [MIT][license-url]
74
87
 
75
88
  [typescript-image]: https://img.shields.io/badge/Typescript-294E80.svg?style=for-the-badge&logo=typescript
76
89
  [typescript-url]: "typescript"
77
- [license-image]: https://img.shields.io/npm/l/@visulima/pack?color=blueviolet&style=for-the-badge
90
+ [license-image]: https://img.shields.io/npm/l/@visulima/packem?color=blueviolet&style=for-the-badge
78
91
  [license-url]: LICENSE.md "license"
79
- [npm-image]: https://img.shields.io/npm/v/@visulima/pack/latest.svg?style=for-the-badge&logo=npm
80
- [npm-url]: https://www.npmjs.com/package/@visulima/pack/v/latest "npm"
92
+ [npm-image]: https://img.shields.io/npm/v/@visulima/packem/latest.svg?style=for-the-badge&logo=npm
93
+ [npm-url]: https://www.npmjs.com/package/@visulima/packem/v/latest "npm"
package/dist/cli.cjs CHANGED
@@ -1,2 +1,8 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var s=Object.defineProperty;var a=(t,e)=>s(t,"name",{value:e,configurable:!0});const l=require("node:process"),p=require("@visulima/cerebro"),u=require("./create-bundler.cjs");function m(t){return t&&typeof t=="object"&&"default"in t?t.default:t}a(m,"_interopDefaultCompat");const d=m(p),f="@visulima/packem",y="1.0.0-alpha.3";var g=Object.defineProperty,o=a((t,e)=>g(t,"name",{value:e,configurable:!0}),"n");const h=o(t=>{t.addCommand({description:"Demonstrate options required",execute:o(async({options:e})=>{let n="build";e.watch?n="watch":e.jit&&(n="jit");const i={};if(e.env)for(const c of e.env)i[c.key]=c.value;await u(e.dir,n,{cjsInterop:e.cjsInterop,configPath:e.config??void 0,debug:e.debug,minify:e.minify,replace:{...i},rollup:{esbuild:{target:e.target},license:{path:e.license},metafile:e.metafile,...e.analyze?{visualizer:{}}:{visualizer:!1}},sourcemap:e.sourcemap,tsconfigPath:e.tsconfig??void 0})},"execute"),name:"build",options:[{defaultValue:".",description:"The directory to build",name:"dir",type:String},{alias:"t",description:"Environments to support. `target` in tsconfig.json is automatically added. Defaults to the current Node.js version.",name:"target"},{description:"Use a custom config file",name:"config",type:String},{description:"Path to the tsconfig.json file",name:"tsconfig",type:String},{description:"Minify the output",name:"minify",type:Boolean},{description:"Generate sourcemaps (experimental)",name:"sourcemap",type:Boolean},{description:"Watch for changes",name:"watch",type:Boolean},{description:"Stub the package for JIT compilation",name:"jit",type:Boolean},{description:"Compile-time environment variables (eg. --env.NODE_ENV=production)",multiple:!0,name:"env",type:o(e=>{const[n,i]=e.split("=");return{key:n,value:i}},"type")},{defaultValue:!1,description:"Generate meta file (experimental)",name:"metafile",type:Boolean},{description:"Path to the license file",name:"license",type:String},{conflicts:"watch",description:"Visualize and analyze the bundle",name:"analyze",type:Boolean},{description:"CJS interop mode, can export default and named export, (experimental).",name:"cjsInterop",type:Boolean}]})},"createBuildCommand"),r=new d("packem",{packageName:f,packageVersion:y});h(r),r.setDefaultCommand("build"),r.run().catch(t=>{console.error(t.message),l.exit(1)});
2
+ "use strict";var v=Object.defineProperty;var r=(n,e)=>v(n,"name",{value:e,configurable:!0});const k=require("@visulima/cerebro"),b=require("./create-bundler.cjs"),s=require("node:process"),h=require("@antfu/install-pkg"),i=require("@clack/prompts"),c=require("@visulima/fs"),j=require("@visulima/package/package-json"),l=require("@visulima/path"),w=r(n=>n&&typeof n=="object"&&"default"in n?n.default:n,"_interopDefaultCompat"),x=w(k),C="@visulima/packem",P="1.0.0-alpha.39";var S=Object.defineProperty,p=r((n,e)=>S(n,"name",{value:e,configurable:!0}),"n");const q=p(n=>{n.addCommand({description:"Demonstrate options required",execute:p(async({options:e})=>{let t="build";e.watch?t="watch":e.jit&&(t="jit");const a={};if(e.env)for(const o of e.env)a[o.key]=o.value;await b(e.dir,t,{cjsInterop:e.cjsInterop,configPath:e.config??void 0,debug:e.debug,minify:e.minify,replace:{...a},rollup:{esbuild:{target:e.target},license:{path:e.license},metafile:e.metafile,...e.analyze?{visualizer:{}}:{visualizer:!1}},sourcemap:e.sourcemap,tsconfigPath:e.tsconfig??void 0})},"execute"),name:"build",options:[{defaultValue:".",description:"The directory to build",name:"dir",type:String},{alias:"t",description:"Environments to support. `target` in tsconfig.json is automatically added. Defaults to the current Node.js version.",name:"target"},{description:"Use a custom config file",name:"config",type:String},{description:"Path to the tsconfig.json file",name:"tsconfig",type:String},{description:"Minify the output",name:"minify",type:Boolean},{description:"Generate sourcemaps (experimental)",name:"sourcemap",type:Boolean},{description:"Watch for changes",name:"watch",type:Boolean},{description:"Stub the package for JIT compilation",name:"jit",type:Boolean},{description:"Compile-time environment variables (eg. --env.NODE_ENV=production)",multiple:!0,name:"env",type:p(e=>{const[t,a]=e.split("=");return{key:t,value:a}},"type")},{defaultValue:!1,description:"Generate meta file (experimental)",name:"metafile",type:Boolean},{description:"Path to the license file",name:"license",type:String},{description:"Visualize and analyze the bundle",name:"analyze",type:Boolean},{description:"CJS interop mode, can export default and named export, (experimental).",name:"cjsInterop",type:Boolean}]})},"createBuildCommand");var z=Object.defineProperty,g=r((n,e)=>z(n,"name",{value:e,configurable:!0}),"i");const B=g(n=>{n.addCommand({description:"Initialize packem configuration",execute:g(async({logger:e,options:t})=>{if(i.intro("Welcome to packem setup"),c.isAccessibleSync(l.join(t.dir,"packem.config.ts")))return e.info("Packem project already initialized, you can use `packem build` to build your project"),s.exit(0);if(i.isCancel(t.transformer))return i.cancel("Operation cancelled"),s.exit(0);if(t.transformer===void 0){const u=l.join(t.dir,"package.json");if(!c.isAccessibleSync(u))return e.error("No package.json found in the directory"),s.exit(1);const d=j.parsePackageJson(u),y=[...Object.keys(d.dependencies??{}),...Object.keys(d.devDependencies??{})];if(t.transformer=await i.select({message:"Pick a transformer",options:[{label:"esbuild",value:"esbuild"},{label:"swc",value:"swc"},{label:"Sucrase",value:"sucrase"}]}),!y.includes(t.transformer)&&await i.confirm({message:"Do you want to install "+t.transformer+"?"})){const f=i.spinner();f.start("Installing "+t.transformer),await h.installPackage(t.transformer==="swc"?"@swc/core":t.transformer,{cwd:t.dir,dev:!0,silent:!0}),f.stop("")}}const a=`import { defineConfig } from "@visulima/packem/config";
3
+ import transformer from "@visulima/packem/transformer/${t.transformer}";
4
+
5
+ export default defineConfig({
6
+ transformer
7
+ });
8
+ `,o=i.spinner();return o.start("Creating packem.config.ts"),c.writeFileSync(l.join(t.dir,"packem.config.ts"),a),o.stop("Created packem.config.ts"),i.outro("Now you can run `packem build` to build your project"),s.exit(0)},"execute"),name:"init",options:[{defaultValue:".",description:"The directory to initialize",name:"dir",type:String},{description:"Choose a transformer to use for packem",name:"transformer",type:String}]})},"createInitCommand"),m=new x("packem",{packageName:C,packageVersion:P});B(m);q(m);m.run();
package/dist/cli.mjs CHANGED
@@ -1,2 +1,16 @@
1
1
  #!/usr/bin/env node
2
- var s=Object.defineProperty;var c=(t,e)=>s(t,"name",{value:e,configurable:!0});import{exit as p}from"node:process";import l from"@visulima/cerebro";import m from"./create-bundler.mjs";const d="@visulima/packem",u="1.0.0-alpha.3";var f=Object.defineProperty,a=c((t,e)=>f(t,"name",{value:e,configurable:!0}),"n");const y=a(t=>{t.addCommand({description:"Demonstrate options required",execute:a(async({options:e})=>{let i="build";e.watch?i="watch":e.jit&&(i="jit");const n={};if(e.env)for(const r of e.env)n[r.key]=r.value;await m(e.dir,i,{cjsInterop:e.cjsInterop,configPath:e.config??void 0,debug:e.debug,minify:e.minify,replace:{...n},rollup:{esbuild:{target:e.target},license:{path:e.license},metafile:e.metafile,...e.analyze?{visualizer:{}}:{visualizer:!1}},sourcemap:e.sourcemap,tsconfigPath:e.tsconfig??void 0})},"execute"),name:"build",options:[{defaultValue:".",description:"The directory to build",name:"dir",type:String},{alias:"t",description:"Environments to support. `target` in tsconfig.json is automatically added. Defaults to the current Node.js version.",name:"target"},{description:"Use a custom config file",name:"config",type:String},{description:"Path to the tsconfig.json file",name:"tsconfig",type:String},{description:"Minify the output",name:"minify",type:Boolean},{description:"Generate sourcemaps (experimental)",name:"sourcemap",type:Boolean},{description:"Watch for changes",name:"watch",type:Boolean},{description:"Stub the package for JIT compilation",name:"jit",type:Boolean},{description:"Compile-time environment variables (eg. --env.NODE_ENV=production)",multiple:!0,name:"env",type:a(e=>{const[i,n]=e.split("=");return{key:i,value:n}},"type")},{defaultValue:!1,description:"Generate meta file (experimental)",name:"metafile",type:Boolean},{description:"Path to the license file",name:"license",type:String},{conflicts:"watch",description:"Visualize and analyze the bundle",name:"analyze",type:Boolean},{description:"CJS interop mode, can export default and named export, (experimental).",name:"cjsInterop",type:Boolean}]})},"createBuildCommand"),o=new l("packem",{packageName:d,packageVersion:u});y(o),o.setDefaultCommand("build"),o.run().catch(t=>{console.error(t.message),p(1)});
2
+ var v=Object.defineProperty;var r=(i,e)=>v(i,"name",{value:e,configurable:!0});import k from"@visulima/cerebro";import b from"./create-bundler.mjs";import{exit as a}from"node:process";import{installPackage as h}from"@antfu/install-pkg";import{intro as j,isCancel as w,cancel as C,select as x,confirm as P,spinner as f,outro as S}from"@clack/prompts";import{isAccessibleSync as u,writeFileSync as z}from"@visulima/fs";import{parsePackageJson as B}from"@visulima/package/package-json";import{join as s}from"@visulima/path";
3
+ // -- pack CommonJS Shims --
4
+ import __cjs_url__ from "node:url";
5
+ import __cjs_path__ from "node:path";
6
+ import __cjs_mod__ from "node:module";
7
+ const __filename = __cjs_url__.fileURLToPath(import.meta.url);
8
+ const __dirname = __cjs_path__.dirname(__filename);
9
+ const require = __cjs_mod__.createRequire(import.meta.url);
10
+ const I="@visulima/packem",N="1.0.0-alpha.39";var O=Object.defineProperty,c=r((i,e)=>O(i,"name",{value:e,configurable:!0}),"n");const V=c(i=>{i.addCommand({description:"Demonstrate options required",execute:c(async({options:e})=>{let t="build";e.watch?t="watch":e.jit&&(t="jit");const n={};if(e.env)for(const o of e.env)n[o.key]=o.value;await b(e.dir,t,{cjsInterop:e.cjsInterop,configPath:e.config??void 0,debug:e.debug,minify:e.minify,replace:{...n},rollup:{esbuild:{target:e.target},license:{path:e.license},metafile:e.metafile,...e.analyze?{visualizer:{}}:{visualizer:!1}},sourcemap:e.sourcemap,tsconfigPath:e.tsconfig??void 0})},"execute"),name:"build",options:[{defaultValue:".",description:"The directory to build",name:"dir",type:String},{alias:"t",description:"Environments to support. `target` in tsconfig.json is automatically added. Defaults to the current Node.js version.",name:"target"},{description:"Use a custom config file",name:"config",type:String},{description:"Path to the tsconfig.json file",name:"tsconfig",type:String},{description:"Minify the output",name:"minify",type:Boolean},{description:"Generate sourcemaps (experimental)",name:"sourcemap",type:Boolean},{description:"Watch for changes",name:"watch",type:Boolean},{description:"Stub the package for JIT compilation",name:"jit",type:Boolean},{description:"Compile-time environment variables (eg. --env.NODE_ENV=production)",multiple:!0,name:"env",type:c(e=>{const[t,n]=e.split("=");return{key:t,value:n}},"type")},{defaultValue:!1,description:"Generate meta file (experimental)",name:"metafile",type:Boolean},{description:"Path to the license file",name:"license",type:String},{description:"Visualize and analyze the bundle",name:"analyze",type:Boolean},{description:"CJS interop mode, can export default and named export, (experimental).",name:"cjsInterop",type:Boolean}]})},"createBuildCommand");var D=Object.defineProperty,g=r((i,e)=>D(i,"name",{value:e,configurable:!0}),"i");const E=g(i=>{i.addCommand({description:"Initialize packem configuration",execute:g(async({logger:e,options:t})=>{if(j("Welcome to packem setup"),u(s(t.dir,"packem.config.ts")))return e.info("Packem project already initialized, you can use `packem build` to build your project"),a(0);if(w(t.transformer))return C("Operation cancelled"),a(0);if(t.transformer===void 0){const p=s(t.dir,"package.json");if(!u(p))return e.error("No package.json found in the directory"),a(1);const l=B(p),y=[...Object.keys(l.dependencies??{}),...Object.keys(l.devDependencies??{})];if(t.transformer=await x({message:"Pick a transformer",options:[{label:"esbuild",value:"esbuild"},{label:"swc",value:"swc"},{label:"Sucrase",value:"sucrase"}]}),!y.includes(t.transformer)&&await P({message:"Do you want to install "+t.transformer+"?"})){const d=f();d.start("Installing "+t.transformer),await h(t.transformer==="swc"?"@swc/core":t.transformer,{cwd:t.dir,dev:!0,silent:!0}),d.stop("")}}const n=`import { defineConfig } from "@visulima/packem/config";
11
+ import transformer from "@visulima/packem/transformer/${t.transformer}";
12
+
13
+ export default defineConfig({
14
+ transformer
15
+ });
16
+ `,o=f();return o.start("Creating packem.config.ts"),z(s(t.dir,"packem.config.ts"),n),o.stop("Created packem.config.ts"),S("Now you can run `packem build` to build your project"),a(0)},"execute"),name:"init",options:[{defaultValue:".",description:"The directory to initialize",name:"dir",type:String},{description:"Choose a transformer to use for packem",name:"transformer",type:String}]})},"createInitCommand"),m=new k("packem",{packageName:I,packageVersion:N});E(m);V(m);m.run();
package/dist/config.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var f=Object.defineProperty;var r=(e,i)=>f(e,"name",{value:i,configurable:!0});var t=Object.defineProperty,n=r((e,i)=>t(e,"name",{value:i,configurable:!0}),"i");const a=n(e=>(Array.isArray(e)?e:[e]).filter(Boolean),"defineConfig"),o=n(e=>e,"definePreset");exports.defineConfig=a,exports.definePreset=o;
1
+ "use strict";var f=Object.defineProperty;var n=(e,i)=>f(e,"name",{value:i,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var r=Object.defineProperty,t=n((e,i)=>r(e,"name",{value:i,configurable:!0}),"i");const o=t(e=>e,"defineConfig"),d=t(e=>e,"definePreset");exports.defineConfig=o;exports.definePreset=d;
package/dist/config.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { B as BuildConfig, a as BuildPreset } from './shared/packem.Bx49YBYz.cjs';
2
- export { b as BuildHooks } from './shared/packem.Bx49YBYz.cjs';
1
+ import { B as BuildConfig, a as BuildPreset } from './shared/packem.ClcPYkxx.cjs';
2
+ export { b as BuildHooks } from './shared/packem.ClcPYkxx.cjs';
3
3
  import '@rollup/plugin-alias';
4
4
  import '@rollup/plugin-commonjs';
5
5
  import '@rollup/plugin-json';
@@ -19,9 +19,9 @@ import './shared/packem.D09xRBAa.cjs';
19
19
  import 'esbuild';
20
20
  import './shared/packem.DvWhOdt5.cjs';
21
21
  import 'sucrase';
22
- import './shared/packem.C44tLE3n.cjs';
22
+ import './shared/packem.aYVbzCkK.cjs';
23
23
 
24
- declare const defineConfig: (config: BuildConfig | BuildConfig[]) => BuildConfig[];
24
+ declare const defineConfig: (config: BuildConfig) => BuildConfig;
25
25
  declare const definePreset: (preset: BuildPreset) => BuildPreset;
26
26
 
27
27
  export { BuildConfig, BuildPreset, defineConfig, definePreset };
package/dist/config.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { B as BuildConfig, a as BuildPreset } from './shared/packem.DIUR7hAQ.mjs';
2
- export { b as BuildHooks } from './shared/packem.DIUR7hAQ.mjs';
1
+ import { B as BuildConfig, a as BuildPreset } from './shared/packem.BBXO6_87.mjs';
2
+ export { b as BuildHooks } from './shared/packem.BBXO6_87.mjs';
3
3
  import '@rollup/plugin-alias';
4
4
  import '@rollup/plugin-commonjs';
5
5
  import '@rollup/plugin-json';
@@ -19,9 +19,9 @@ import './shared/packem.D09xRBAa.mjs';
19
19
  import 'esbuild';
20
20
  import './shared/packem.DvWhOdt5.mjs';
21
21
  import 'sucrase';
22
- import './shared/packem.C44tLE3n.mjs';
22
+ import './shared/packem.aYVbzCkK.mjs';
23
23
 
24
- declare const defineConfig: (config: BuildConfig | BuildConfig[]) => BuildConfig[];
24
+ declare const defineConfig: (config: BuildConfig) => BuildConfig;
25
25
  declare const definePreset: (preset: BuildPreset) => BuildPreset;
26
26
 
27
27
  export { BuildConfig, BuildPreset, defineConfig, definePreset };
package/dist/config.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { B as BuildConfig, a as BuildPreset } from './shared/packem.CRdgUXSu.js';
2
- export { b as BuildHooks } from './shared/packem.CRdgUXSu.js';
1
+ import { B as BuildConfig, a as BuildPreset } from './shared/packem.DtAA_1Hu.js';
2
+ export { b as BuildHooks } from './shared/packem.DtAA_1Hu.js';
3
3
  import '@rollup/plugin-alias';
4
4
  import '@rollup/plugin-commonjs';
5
5
  import '@rollup/plugin-json';
@@ -19,9 +19,9 @@ import './shared/packem.D09xRBAa.js';
19
19
  import 'esbuild';
20
20
  import './shared/packem.DvWhOdt5.js';
21
21
  import 'sucrase';
22
- import './shared/packem.C44tLE3n.js';
22
+ import './shared/packem.aYVbzCkK.js';
23
23
 
24
- declare const defineConfig: (config: BuildConfig | BuildConfig[]) => BuildConfig[];
24
+ declare const defineConfig: (config: BuildConfig) => BuildConfig;
25
25
  declare const definePreset: (preset: BuildPreset) => BuildPreset;
26
26
 
27
27
  export { BuildConfig, BuildPreset, defineConfig, definePreset };
package/dist/config.mjs CHANGED
@@ -1 +1,9 @@
1
- var f=Object.defineProperty;var i=(e,r)=>f(e,"name",{value:r,configurable:!0});var a=Object.defineProperty,n=i((e,r)=>a(e,"name",{value:r,configurable:!0}),"i");const o=n(e=>(Array.isArray(e)?e:[e]).filter(Boolean),"defineConfig"),t=n(e=>e,"definePreset");export{o as defineConfig,t as definePreset};
1
+
2
+ // -- pack CommonJS Shims --
3
+ import __cjs_url__ from "node:url";
4
+ import __cjs_path__ from "node:path";
5
+ import __cjs_mod__ from "node:module";
6
+ const __filename = __cjs_url__.fileURLToPath(import.meta.url);
7
+ const __dirname = __cjs_path__.dirname(__filename);
8
+ const require = __cjs_mod__.createRequire(import.meta.url);
9
+ var r=Object.defineProperty;var i=(e,n)=>r(e,"name",{value:n,configurable:!0});var t=Object.defineProperty,f=i((e,n)=>t(e,"name",{value:n,configurable:!0}),"i");const a=f(e=>e,"defineConfig"),d=f(e=>e,"definePreset");export{a as defineConfig,d as definePreset};