@visulima/package 5.0.0-alpha.3 → 5.0.0-alpha.30

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 CHANGED
@@ -1,3 +1,348 @@
1
+ ## @visulima/package [5.0.0-alpha.30](https://github.com/visulima/visulima/compare/@visulima/package@5.0.0-alpha.29...@visulima/package@5.0.0-alpha.30) (2026-06-04)
2
+
3
+
4
+ ### Dependencies
5
+
6
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.31
7
+
8
+ ## @visulima/package [5.0.0-alpha.29](https://github.com/visulima/visulima/compare/@visulima/package@5.0.0-alpha.28...@visulima/package@5.0.0-alpha.29) (2026-06-04)
9
+
10
+ ### Bug Fixes
11
+
12
+ * **lint:** clear pre-existing eslint rot across packages ([#674](https://github.com/visulima/visulima/issues/674)) ([5354253](https://github.com/visulima/visulima/commit/5354253b163bd50bcefaf8a3fddf831bdb5df32b))
13
+ * **package:** 4 bug fixes ([1e2fba6](https://github.com/visulima/visulima/commit/1e2fba6b0d048f3b90f4e0b428fd984d66f1431e))
14
+
15
+ ### Tests
16
+
17
+ * fix cross-platform flakes in package + cerebro ([#676](https://github.com/visulima/visulima/issues/676)) ([d1afb4b](https://github.com/visulima/visulima/commit/d1afb4ba743cf18bdf9f02081539d70bdcda91e9))
18
+
19
+
20
+ ### Dependencies
21
+
22
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.30
23
+ * **@visulima/path:** upgraded to 3.0.0-alpha.12
24
+
25
+ ## @visulima/package [5.0.0-alpha.28](https://github.com/visulima/visulima/compare/@visulima/package@5.0.0-alpha.27...@visulima/package@5.0.0-alpha.28) (2026-06-02)
26
+
27
+ ### Miscellaneous Chores
28
+
29
+ * apply eslint + prettier autofixes across packages ([c1bb784](https://github.com/visulima/visulima/commit/c1bb7848a0d93d0dfe2960c77e3cda22239c79a0))
30
+
31
+ ### Tests
32
+
33
+ * **package:** cover confirm prompt, lockfile parsers, package-json/manager, monorepo, and pnpm workspace branches ([7916131](https://github.com/visulima/visulima/commit/7916131a2206a8ebefb0817d7ae0a340fdee2ba0))
34
+
35
+
36
+ ### Dependencies
37
+
38
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.29
39
+
40
+ ## @visulima/package [5.0.0-alpha.27](https://github.com/visulima/visulima/compare/@visulima/package@5.0.0-alpha.26...@visulima/package@5.0.0-alpha.27) (2026-05-27)
41
+
42
+ ### Bug Fixes
43
+
44
+ * **storage-client:** percent-encode user fields in defaultFingerprint ([7c78a0f](https://github.com/visulima/visulima/commit/7c78a0f9512e2a673b941d80839e9f1e86b7b5d0))
45
+
46
+
47
+ ### Dependencies
48
+
49
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.28
50
+ * **@visulima/path:** upgraded to 3.0.0-alpha.11
51
+
52
+ ## @visulima/package [5.0.0-alpha.26](https://github.com/visulima/visulima/compare/@visulima/package@5.0.0-alpha.25...@visulima/package@5.0.0-alpha.26) (2026-05-26)
53
+
54
+ ### Miscellaneous Chores
55
+
56
+ * sorted package.json ([b47c545](https://github.com/visulima/visulima/commit/b47c545591600fdab17d5cd3a3fbc68b61e199da))
57
+
58
+
59
+ ### Dependencies
60
+
61
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.27
62
+
63
+ ## @visulima/package [5.0.0-alpha.25](https://github.com/visulima/visulima/compare/@visulima/package@5.0.0-alpha.24...@visulima/package@5.0.0-alpha.25) (2026-05-26)
64
+
65
+ ### Miscellaneous Chores
66
+
67
+ * **ci-stability:** green CI across vis, native, lint, tests, attw ([#651](https://github.com/visulima/visulima/issues/651)) ([d4eb684](https://github.com/visulima/visulima/commit/d4eb684b5f75c818c9251048c605a0ed54a268e3))
68
+ * **repo:** sort package.json keys across all packages ([e1fd9ab](https://github.com/visulima/visulima/commit/e1fd9ab467ef96a98c777da1572ff6a50fcf7e71))
69
+
70
+ ### Tests
71
+
72
+ * **repo:** add dist runtime + types integration tests ([32ee300](https://github.com/visulima/visulima/commit/32ee300b7184117a0ddf9f9d390f75f8932d5ed9))
73
+
74
+
75
+ ### Dependencies
76
+
77
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.26
78
+
79
+ ## @visulima/package [5.0.0-alpha.24](https://github.com/visulima/visulima/compare/@visulima/package@5.0.0-alpha.23...@visulima/package@5.0.0-alpha.24) (2026-05-20)
80
+
81
+
82
+ ### Dependencies
83
+
84
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.25
85
+
86
+ ## @visulima/package [5.0.0-alpha.23](https://github.com/visulima/visulima/compare/@visulima/package@5.0.0-alpha.22...@visulima/package@5.0.0-alpha.23) (2026-05-19)
87
+
88
+
89
+ ### Dependencies
90
+
91
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.24
92
+
93
+ ## @visulima/package [5.0.0-alpha.22](https://github.com/visulima/visulima/compare/@visulima/package@5.0.0-alpha.21...@visulima/package@5.0.0-alpha.22) (2026-05-16)
94
+
95
+
96
+ ### Dependencies
97
+
98
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.23
99
+
100
+ ## @visulima/package [5.0.0-alpha.21](https://github.com/visulima/visulima/compare/@visulima/package@5.0.0-alpha.20...@visulima/package@5.0.0-alpha.21) (2026-05-14)
101
+
102
+ ### Miscellaneous Chores
103
+
104
+ * **tooling:** apply prettier and eslint formatting sweep ([c2c641d](https://github.com/visulima/visulima/commit/c2c641d40242e99030cb990fa01039db5e267667))
105
+
106
+
107
+ ### Dependencies
108
+
109
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.22
110
+
111
+ ## @visulima/package [5.0.0-alpha.20](https://github.com/visulima/visulima/compare/@visulima/package@5.0.0-alpha.19...@visulima/package@5.0.0-alpha.20) (2026-05-11)
112
+
113
+ ### ⚠ BREAKING CHANGES
114
+
115
+ * **vis:** vis sbom now emits CycloneDX 1.7. Downstream consumers
116
+ pinned to a 1.6 validator must upgrade.
117
+
118
+ Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
119
+
120
+ ### Features
121
+
122
+ * **vis:** bump sbom to cyclonedx 1.7 ([904075f](https://github.com/visulima/visulima/commit/904075fd9353e40b593d5a13f53307c584e31da7))
123
+
124
+
125
+ ### Dependencies
126
+
127
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.21
128
+
129
+ ## @visulima/package [5.0.0-alpha.19](https://github.com/visulima/visulima/compare/@visulima/package@5.0.0-alpha.18...@visulima/package@5.0.0-alpha.19) (2026-05-11)
130
+
131
+
132
+ ### Dependencies
133
+
134
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.20
135
+
136
+ ## @visulima/package [5.0.0-alpha.18](https://github.com/visulima/visulima/compare/@visulima/package@5.0.0-alpha.17...@visulima/package@5.0.0-alpha.18) (2026-05-10)
137
+
138
+
139
+ ### Dependencies
140
+
141
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.19
142
+
143
+ ## @visulima/package [5.0.0-alpha.17](https://github.com/visulima/visulima/compare/@visulima/package@5.0.0-alpha.16...@visulima/package@5.0.0-alpha.17) (2026-05-10)
144
+
145
+ ### Code Refactoring
146
+
147
+ * replace execa with tinyexec ([56ec776](https://github.com/visulima/visulima/commit/56ec776908fe0c068c54542f3885cb29f061fea7))
148
+
149
+
150
+ ### Dependencies
151
+
152
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.18
153
+
154
+ ## @visulima/package [5.0.0-alpha.16](https://github.com/visulima/visulima/compare/@visulima/package@5.0.0-alpha.15...@visulima/package@5.0.0-alpha.16) (2026-05-07)
155
+
156
+
157
+ ### Dependencies
158
+
159
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.17
160
+
161
+ ## @visulima/package [5.0.0-alpha.15](https://github.com/visulima/visulima/compare/@visulima/package@5.0.0-alpha.14...@visulima/package@5.0.0-alpha.15) (2026-05-07)
162
+
163
+
164
+ ### Dependencies
165
+
166
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.16
167
+
168
+ ## @visulima/package [5.0.0-alpha.14](https://github.com/visulima/visulima/compare/@visulima/package@5.0.0-alpha.13...@visulima/package@5.0.0-alpha.14) (2026-05-06)
169
+
170
+
171
+ ### Dependencies
172
+
173
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.15
174
+
175
+ ## @visulima/package [5.0.0-alpha.13](https://github.com/visulima/visulima/compare/@visulima/package@5.0.0-alpha.12...@visulima/package@5.0.0-alpha.13) (2026-05-06)
176
+
177
+ ### Miscellaneous Chores
178
+
179
+ * **package:** apply prettier and eslint quote-style auto-fix ([0316bca](https://github.com/visulima/visulima/commit/0316bca0deca444ff12675bc760c7091ce243d31))
180
+ * **package:** housekeeping cleanup ([113978b](https://github.com/visulima/visulima/commit/113978b0babcfc7879514aec076f6e2d5e7afab0))
181
+
182
+
183
+ ### Dependencies
184
+
185
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.14
186
+
187
+ ## @visulima/package [5.0.0-alpha.12](https://github.com/visulima/visulima/compare/@visulima/package@5.0.0-alpha.11...@visulima/package@5.0.0-alpha.12) (2026-05-04)
188
+
189
+ ### Miscellaneous Chores
190
+
191
+ * **package:** upgrade packem to 2.0.0-alpha.76 ([b2ef62b](https://github.com/visulima/visulima/commit/b2ef62b72a84545cb025a250cbe7e3e36b34330d))
192
+ * re-sort workspace package.json files via vis sort-package-json ([f625696](https://github.com/visulima/visulima/commit/f625696cfac974325774b3243e1a83c3d23acbd7))
193
+ * simplify pnpm-workspace packages list ([7cab221](https://github.com/visulima/visulima/commit/7cab221163632d9b7aa044a6f88c49083103a869))
194
+
195
+
196
+ ### Dependencies
197
+
198
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.13
199
+
200
+ ## @visulima/package [5.0.0-alpha.11](https://github.com/visulima/visulima/compare/@visulima/package@5.0.0-alpha.10...@visulima/package@5.0.0-alpha.11) (2026-04-22)
201
+
202
+ ### Bug Fixes
203
+
204
+ * Remove JSR configuration generation script and generated jsr.json files ([#616](https://github.com/visulima/visulima/issues/616)) ([533744b](https://github.com/visulima/visulima/commit/533744b103b74896941db5b727173e617a27a63b))
205
+
206
+
207
+ ### Dependencies
208
+
209
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.12
210
+ * **@visulima/path:** upgraded to 3.0.0-alpha.10
211
+
212
+ ## @visulima/package [5.0.0-alpha.10](https://github.com/visulima/visulima/compare/@visulima/package@5.0.0-alpha.9...@visulima/package@5.0.0-alpha.10) (2026-04-21)
213
+
214
+ ### Miscellaneous Chores
215
+
216
+ * jsr.json update and lock file ([73fce38](https://github.com/visulima/visulima/commit/73fce38c7cb4603f3fffb88609b1b18e2feb4937))
217
+
218
+
219
+ ### Dependencies
220
+
221
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.11
222
+
223
+ ## @visulima/package [5.0.0-alpha.9](https://github.com/visulima/visulima/compare/@visulima/package@5.0.0-alpha.8...@visulima/package@5.0.0-alpha.9) (2026-04-21)
224
+
225
+ ### Miscellaneous Chores
226
+
227
+ * update the jsr.json ([864ab7e](https://github.com/visulima/visulima/commit/864ab7e71c4b5ae82f64792d1ae8debfea2c539b))
228
+
229
+
230
+ ### Dependencies
231
+
232
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.10
233
+
234
+ ## @visulima/package [5.0.0-alpha.8](https://github.com/visulima/visulima/compare/@visulima/package@5.0.0-alpha.7...@visulima/package@5.0.0-alpha.8) (2026-04-21)
235
+
236
+ ### Features
237
+
238
+ * Add CycloneDX 1.6 SBOM generation with `vis sbom` command ([#611](https://github.com/visulima/visulima/issues/611)) ([1e95276](https://github.com/visulima/visulima/commit/1e9527630958722a0f0f7e79d18bb23b5a57e0df))
239
+ * **package:** add lockfile utilities ([12f9076](https://github.com/visulima/visulima/commit/12f9076ba1570bec2f2d43b58fcd31701634434e))
240
+
241
+ ### Bug Fixes
242
+
243
+ * **package:** hoist regexes, rewrite lockfile parser, resolve eslint issues ([585ed7f](https://github.com/visulima/visulima/commit/585ed7f16b3f42996bb030a8bae5f1f37a50c316))
244
+
245
+ ### Miscellaneous Chores
246
+
247
+ * **api-platform:** apply pending lint and source updates ([3fb0043](https://github.com/visulima/visulima/commit/3fb0043a4cf35f752ca89a09a077100ae0142da8))
248
+ * bump engines.node to ^22.14.0 || >=24.10.0 ([c3d0931](https://github.com/visulima/visulima/commit/c3d0931d1504e4f21ebf50ea680cfa7ce4ba15ce))
249
+ * fixed jsr.json ([5d85e51](https://github.com/visulima/visulima/commit/5d85e5179de38e284ec433b14d77c71a1619c8d6))
250
+ * **package:** apply formatter and lint fixes ([a0f4acf](https://github.com/visulima/visulima/commit/a0f4acfb15beb256edd3b62958b4e3db039757a9))
251
+ * **package:** apply pending changes ([919b214](https://github.com/visulima/visulima/commit/919b214f9659a5b4ff95ec8b35a70c10af3c4853))
252
+ * **package:** apply pending lint and source updates ([2fd1c04](https://github.com/visulima/visulima/commit/2fd1c044d9528500943368c01f9b24fd2280058c))
253
+ * **package:** enforce curly braces and apply lint fixes ([0df50ba](https://github.com/visulima/visulima/commit/0df50ba4f45bac67dabeb78ebfc3d555ba5aec56))
254
+
255
+
256
+ ### Dependencies
257
+
258
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.9
259
+
260
+ ## @visulima/package [5.0.0-alpha.7](https://github.com/visulima/visulima/compare/@visulima/package@5.0.0-alpha.6...@visulima/package@5.0.0-alpha.7) (2026-04-08)
261
+
262
+ ### Bug Fixes
263
+
264
+ * **package:** properly fix eslint errors in code ([56b1547](https://github.com/visulima/visulima/commit/56b15474d6edd8f33fb46cca81fa34d600df2023))
265
+ * **package:** remove remaining eslint suppressions with proper code fixes ([69efa7a](https://github.com/visulima/visulima/commit/69efa7a9c67977c491a1ec8eaded733478ed29a1))
266
+ * **package:** resolve eslint errors ([1ec4728](https://github.com/visulima/visulima/commit/1ec47286cfcec55ea50c51d51f198b119dd22e71))
267
+ * resolve failing tests across multiple packages ([2b4b6f0](https://github.com/visulima/visulima/commit/2b4b6f04169b60fdc4cf77b293015436a272c0fb))
268
+
269
+ ### Miscellaneous Chores
270
+
271
+ * **package:** add tsconfig.eslint.json for type-aware linting ([0355fea](https://github.com/visulima/visulima/commit/0355fea301fb7a8571da25bebd108830bc23ed04))
272
+ * **package:** apply prettier formatting ([ebb5bd1](https://github.com/visulima/visulima/commit/ebb5bd12c6b7d49811c68ea96bf62ce7e2a7d42d))
273
+ * **package:** migrate .prettierrc.cjs to prettier.config.js ([2b84ef0](https://github.com/visulima/visulima/commit/2b84ef0db67467e1360b2f1e6f9b6e96bf3dbbb0))
274
+ * **tooling:** remove empty dependency objects from package.json ([dc52a23](https://github.com/visulima/visulima/commit/dc52a23bc1e2d36f4ec71ca67506bf6861a02929))
275
+
276
+
277
+ ### Dependencies
278
+
279
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.7
280
+ * **@visulima/path:** upgraded to 3.0.0-alpha.8
281
+
282
+ ## @visulima/package [5.0.0-alpha.6](https://github.com/visulima/visulima/compare/@visulima/package@5.0.0-alpha.5...@visulima/package@5.0.0-alpha.6) (2026-03-26)
283
+
284
+ ### Features
285
+
286
+ * **web:** auto-generate packages page from workspace metadata ([623e520](https://github.com/visulima/visulima/commit/623e5207693a7fe720f5f2f179593a3654c880e3))
287
+
288
+ ### Miscellaneous Chores
289
+
290
+ * update homepage URLs to visulima.com/packages/ format ([be42968](https://github.com/visulima/visulima/commit/be42968129df85fb074224435e33135ff44cab91))
291
+
292
+
293
+ ### Dependencies
294
+
295
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.6
296
+ * **@visulima/path:** upgraded to 3.0.0-alpha.7
297
+
298
+ ## @visulima/package [5.0.0-alpha.5](https://github.com/visulima/visulima/compare/@visulima/package@5.0.0-alpha.4...@visulima/package@5.0.0-alpha.5) (2026-03-26)
299
+
300
+ ### Bug Fixes
301
+
302
+ * **package:** use workspace:* for internal [@visulima](https://github.com/visulima) deps ([e409128](https://github.com/visulima/visulima/commit/e409128c02a6d801dd385ae845c1ab28ca5c09da))
303
+ * **web:** improve build setup with incremental stats caching and prod install ([fe33e75](https://github.com/visulima/visulima/commit/fe33e75827586779b4b3a0c6d57b39f889ee6207))
304
+
305
+ ### Miscellaneous Chores
306
+
307
+ * **package:** migrate deps to pnpm catalogs ([301fac4](https://github.com/visulima/visulima/commit/301fac41be88df7469155649467921a72ca740a6))
308
+ * **package:** update dependencies ([fb1a43d](https://github.com/visulima/visulima/commit/fb1a43de0fd345806d76aec660d48c627d576083))
309
+ * visulima website ([#591](https://github.com/visulima/visulima/issues/591)) ([59ab2e2](https://github.com/visulima/visulima/commit/59ab2e2befb03e51cd2088956f83d9b87de6d033))
310
+
311
+
312
+ ### Dependencies
313
+
314
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.5
315
+ * **@visulima/path:** upgraded to 3.0.0-alpha.6
316
+
317
+ ## @visulima/package [5.0.0-alpha.4](https://github.com/visulima/visulima/compare/@visulima/package@5.0.0-alpha.3...@visulima/package@5.0.0-alpha.4) (2026-03-06)
318
+
319
+ ### Bug Fixes
320
+
321
+ * **package:** update packem to 2.0.0-alpha.54 ([e5b3249](https://github.com/visulima/visulima/commit/e5b3249026a425b7a42443f66a08f8f68c3d62e4))
322
+ * **package:** use intentionally malformed JSON in bad workspace fixture ([a6680e7](https://github.com/visulima/visulima/commit/a6680e7a97aeae643c26b69bc5eb6c64c28de278))
323
+
324
+ ### Documentation
325
+
326
+ * **humanizer,html,iso-locale,package,tsconfig:** add comprehensive Fumadocs documentation ([19781ce](https://github.com/visulima/visulima/commit/19781ce5d27605971a9f2fdf0a99863effd98091))
327
+
328
+ ### Miscellaneous Chores
329
+
330
+ * **package:** update dependencies ([d89cde6](https://github.com/visulima/visulima/commit/d89cde6792e9036d0690cfaf9b771e26b24faac8))
331
+ * **package:** update dependencies ([4b62cf8](https://github.com/visulima/visulima/commit/4b62cf85e6ef4deac4ef01c8a7e15bcf49ecbe80))
332
+ * **tooling:** update dependencies ([7f6f9d3](https://github.com/visulima/visulima/commit/7f6f9d3c41b170c53659ab34b79ceb23e4e9660a))
333
+ * update lock file maintenance ([d83e716](https://github.com/visulima/visulima/commit/d83e71697b75d24704185b66bb521a934d2db02d))
334
+ * year update ([47f4105](https://github.com/visulima/visulima/commit/47f410596ce7190cfea36a073db32e0cec50bbcd))
335
+
336
+ ### Tests
337
+
338
+ * **package:** fix broken JSON test fixture ([46141d6](https://github.com/visulima/visulima/commit/46141d6472d8de20512109200a12e79c48ddc33c))
339
+
340
+
341
+ ### Dependencies
342
+
343
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.4
344
+ * **@visulima/path:** upgraded to 3.0.0-alpha.5
345
+
1
346
  ## @visulima/package [5.0.0-alpha.3](https://github.com/visulima/visulima/compare/@visulima/package@5.0.0-alpha.2...@visulima/package@5.0.0-alpha.3) (2025-12-27)
2
347
 
3
348
  ### Bug Fixes
package/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2025 visulima
3
+ Copyright (c) 2026 visulima
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/dist/error.d.ts CHANGED
@@ -1 +1,15 @@
1
- export { default as PackageNotFoundError } from "./error/package-not-found-error.d.ts";
1
+ /**
2
+ * Error thrown when a package was not found.
3
+ */
4
+ declare class PackageNotFoundError extends Error {
5
+ /**
6
+ * @param packageName The name of the package that was not found.
7
+ * @param packageManager The package manager used to install the package.
8
+ */
9
+ constructor(packageName: string[] | string, packageManager?: string);
10
+ get code(): string;
11
+ set code(_name: string);
12
+ override get name(): string;
13
+ override set name(_name: string);
14
+ }
15
+ export { PackageNotFoundError };
package/dist/error.js CHANGED
@@ -1 +1 @@
1
- import{default as a}from"./packem_shared/PackageNotFoundError-BictYTIA.js";export{a as PackageNotFoundError};
1
+ import{default as a}from"./packem_shared/PackageNotFoundError--qHnCLzN.js";export{a as PackageNotFoundError};
package/dist/index.d.ts CHANGED
@@ -1,11 +1,13 @@
1
- export { default as PackageNotFoundError } from "./error/package-not-found-error.d.ts";
2
- export type { RootMonorepo, Strategy } from "./monorepo.d.ts";
3
- export { findMonorepoRoot, findMonorepoRootSync } from "./monorepo.d.ts";
4
- export { findPackageRoot, findPackageRootSync } from "./package.d.ts";
5
- export type { FindPackageJsonCache, NormalizedReadResult } from "./package-json.d.ts";
6
- export { ensurePackages, findPackageJson, findPackageJsonSync, getPackageJsonProperty, hasPackageJsonAnyDependency, hasPackageJsonProperty, parsePackageJson, parsePackageJsonSync, writePackageJson, writePackageJsonSync, } from "./package-json.d.ts";
7
- export type { PackageManager, PackageManagerResult } from "./package-manager.d.ts";
8
- export { findLockFile, findLockFileSync, findPackageManager, findPackageManagerSync, generateMissingPackagesInstallMessage, getPackageManagerVersion, identifyInitiatingPackageManager, } from "./package-manager.d.ts";
9
- export type { PnpmCatalog, PnpmCatalogs } from "./pnpm.d.ts";
10
- export { isPackageInWorkspace, readPnpmCatalogs, readPnpmCatalogsSync, resolveCatalogReference, resolveCatalogReferences, resolveDependenciesCatalogReferences, } from "./pnpm.d.ts";
11
- export type { EnsurePackagesOptions, NormalizedPackageJson, PackageJson } from "./types.d.ts";
1
+ export { PackageNotFoundError } from "./error.js";
2
+ export { type LockFileEntry, type LockFileIntegrity, type LockFileIntegrityAlgorithm, type LockFileParseResult, type LockFileType, decodeSriIntegrity, parseBunLockFile, parseLockFile, parseLockFileContent, parseLockFileSync, parseNpmLockFile, parsePnpmLockFile, parseYarnLockFile } from "./lockfile.js";
3
+ export { type RootMonorepo, type Strategy, findMonorepoRoot, findMonorepoRootSync } from "./monorepo.js";
4
+ export { findPackageRoot, findPackageRootSync } from "./package.js";
5
+ export { type E as EnsurePackagesOptions, type F as FindPackageJsonCache, type N as NormalizedPackageJson, type a as NormalizedReadResult, type P as PackageJson, e as ensurePackages, f as findPackageJson, b as findPackageJsonSync, g as getPackageJsonProperty, h as hasPackageJsonAnyDependency, c as hasPackageJsonProperty, p as parsePackageJson, d as parsePackageJsonSync, w as writePackageJson, i as writePackageJsonSync } from "./packem_shared/package-json.d-R9WIRfmM.js";
6
+ export { type PackageManager, type PackageManagerResult, findLockFile, findLockFileSync, findPackageManager, findPackageManagerSync, generateMissingPackagesInstallMessage, getPackageManagerVersion, identifyInitiatingPackageManager } from "./package-manager.js";
7
+ export { type PnpmCatalog, type PnpmCatalogs, isPackageInWorkspace, readPnpmCatalogs, readPnpmCatalogsSync, resolveCatalogReference, resolveCatalogReferences, resolveDependenciesCatalogReferences } from "./pnpm.js";
8
+ import '@visulima/fs';
9
+ import 'type-fest';
10
+ import '@antfu/install-pkg';
11
+ import '@inquirer/core';
12
+ import '@inquirer/type';
13
+ import 'normalize-package-data';
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{default as n}from"./packem_shared/PackageNotFoundError-BictYTIA.js";import{findMonorepoRoot as r,findMonorepoRootSync as c}from"./monorepo.js";import{findPackageRoot as s,findPackageRootSync as t}from"./package.js";import{ensurePackages as P,findPackageJson as k,findPackageJsonSync as f,getPackageJsonProperty as d,hasPackageJsonAnyDependency as p,hasPackageJsonProperty as l,parsePackageJson as y,parsePackageJsonSync as J,writePackageJson as m,writePackageJsonSync as M}from"./package-json.js";import{findLockFile as R,findLockFileSync as x,findPackageManager as C,findPackageManagerSync as u,generateMissingPackagesInstallMessage as v,getPackageManagerVersion as F,identifyInitiatingPackageManager as I}from"./package-manager.js";import{isPackageInWorkspace as w,readPnpmCatalogs as D,readPnpmCatalogsSync as L,resolveCatalogReference as A,resolveCatalogReferences as E,resolveDependenciesCatalogReferences as N}from"./pnpm.js";export{n as PackageNotFoundError,P as ensurePackages,R as findLockFile,x as findLockFileSync,r as findMonorepoRoot,c as findMonorepoRootSync,k as findPackageJson,f as findPackageJsonSync,C as findPackageManager,u as findPackageManagerSync,s as findPackageRoot,t as findPackageRootSync,v as generateMissingPackagesInstallMessage,d as getPackageJsonProperty,F as getPackageManagerVersion,p as hasPackageJsonAnyDependency,l as hasPackageJsonProperty,I as identifyInitiatingPackageManager,w as isPackageInWorkspace,y as parsePackageJson,J as parsePackageJsonSync,D as readPnpmCatalogs,L as readPnpmCatalogsSync,A as resolveCatalogReference,E as resolveCatalogReferences,N as resolveDependenciesCatalogReferences,m as writePackageJson,M as writePackageJsonSync};
1
+ import{default as o}from"./packem_shared/PackageNotFoundError--qHnCLzN.js";import{decodeSriIntegrity as r,parseBunLockFile as c,parseLockFile as s,parseLockFileContent as g,parseLockFileSync as i,parseNpmLockFile as t,parsePnpmLockFile as k,parseYarnLockFile as p}from"./lockfile.js";import{findMonorepoRoot as f,findMonorepoRootSync as l}from"./monorepo.js";import{findPackageRoot as y,findPackageRootSync as m}from"./package.js";import{ensurePackages as S,findPackageJson as J,findPackageJsonSync as L,getPackageJsonProperty as M,hasPackageJsonAnyDependency as x,hasPackageJsonProperty as R,parsePackageJson as C,parsePackageJsonSync as u,writePackageJson as I,writePackageJsonSync as v}from"./package-json.js";import{findLockFile as w,findLockFileSync as D,findPackageManager as N,findPackageManagerSync as A,generateMissingPackagesInstallMessage as B,getPackageManagerVersion as E,identifyInitiatingPackageManager as V}from"./package-manager.js";import{isPackageInWorkspace as Y,readPnpmCatalogs as b,readPnpmCatalogsSync as j,resolveCatalogReference as q,resolveCatalogReferences as z,resolveDependenciesCatalogReferences as G}from"./pnpm.js";export{o as PackageNotFoundError,r as decodeSriIntegrity,S as ensurePackages,w as findLockFile,D as findLockFileSync,f as findMonorepoRoot,l as findMonorepoRootSync,J as findPackageJson,L as findPackageJsonSync,N as findPackageManager,A as findPackageManagerSync,y as findPackageRoot,m as findPackageRootSync,B as generateMissingPackagesInstallMessage,M as getPackageJsonProperty,E as getPackageManagerVersion,x as hasPackageJsonAnyDependency,R as hasPackageJsonProperty,V as identifyInitiatingPackageManager,Y as isPackageInWorkspace,c as parseBunLockFile,s as parseLockFile,g as parseLockFileContent,i as parseLockFileSync,t as parseNpmLockFile,C as parsePackageJson,u as parsePackageJsonSync,k as parsePnpmLockFile,p as parseYarnLockFile,b as readPnpmCatalogs,j as readPnpmCatalogsSync,q as resolveCatalogReference,z as resolveCatalogReferences,G as resolveDependenciesCatalogReferences,I as writePackageJson,v as writePackageJsonSync};
@@ -0,0 +1,114 @@
1
+ /** Lockfiles the parser recognises. Legacy binary `bun.lockb` is unsupported. */
2
+ type LockFileType = "bun" | "npm" | "pnpm" | "yarn";
3
+ /** SRI algorithms the parser can decode into hex. */
4
+ type LockFileIntegrityAlgorithm = "sha256" | "sha384" | "sha512";
5
+ /** Decoded integrity digest: algorithm + lowercase hex string. */
6
+ interface LockFileIntegrity {
7
+ algorithm: LockFileIntegrityAlgorithm;
8
+ hex: string;
9
+ }
10
+ /** A single resolved package extracted from a lockfile. */
11
+ interface LockFileEntry {
12
+ /**
13
+ * Declared runtime dependencies — `name → specifier[]` map. Values
14
+ * are arrays so pnpm v9+ peer-context variants (the same dep name
15
+ * resolved to different versions under different peer contexts)
16
+ * can all be preserved. npm, yarn v1, bun, and pnpm v6-v8 always
17
+ * produce single-element arrays; pnpm v9+ may produce multi-element
18
+ * arrays for peer-context-sensitive deps.
19
+ *
20
+ * Specifiers are whatever the lockfile recorded — a range
21
+ * (`^1.0.0`) for npm / yarn / bun, or an already-resolved exact
22
+ * version for pnpm. Callers resolve each specifier against
23
+ * {@link LockFileEntry.version} values elsewhere in the lockfile
24
+ * when they need a concrete edge.
25
+ */
26
+ dependencies?: Record<string, string[]>;
27
+ /** Decoded SRI digest, if the lockfile recorded one. */
28
+ integrity?: LockFileIntegrity;
29
+ /** Package name — `lodash` or `@scope/name`. */
30
+ name: string;
31
+ /** Declared optional dependencies, same shape as `dependencies`. */
32
+ optionalDependencies?: Record<string, string[]>;
33
+ /** Declared peer dependencies, same shape as `dependencies`. */
34
+ peerDependencies?: Record<string, string[]>;
35
+ /** Resolved exact version — e.g. `4.17.21`. */
36
+ version: string;
37
+ }
38
+ /** Result of locating + parsing a lockfile on disk. */
39
+ interface LockFileParseResult {
40
+ entries: LockFileEntry[];
41
+ /** Absolute path of the lockfile that was parsed. */
42
+ path: string;
43
+ type: LockFileType;
44
+ }
45
+ /**
46
+ * Decodes a Subresource Integrity string (`sha512-&lt;base64>`) into a
47
+ * `{ algorithm, hex }` pair. Returns `undefined` if the string is
48
+ * malformed, oversized, or uses an unsupported algorithm.
49
+ * @param sri Full SRI string, e.g. `sha512-&lt;base64>`.
50
+ * @returns Decoded algorithm + hex digest, or `undefined` when the
51
+ * input can't be parsed.
52
+ */
53
+ declare const decodeSriIntegrity: (sri: string) => LockFileIntegrity | undefined;
54
+ /**
55
+ * Parses `package-lock.json` (npm v2 / v3 format).
56
+ * @param content Raw JSON text of the lockfile.
57
+ * @returns One {@link LockFileEntry} per distinct `name@version`.
58
+ */
59
+ declare const parseNpmLockFile: (content: string) => LockFileEntry[];
60
+ /**
61
+ * Parses `pnpm-lock.yaml`. Regex-based; works for lockfile v6 through
62
+ * v9. v9 moves concrete resolved dependency versions out of `packages:`
63
+ * and into `snapshots:`; this parser reads both sections and unions
64
+ * their dep-maps onto the final entry.
65
+ * @param content Raw YAML text of the lockfile.
66
+ * @returns One {@link LockFileEntry} per distinct `name@version`.
67
+ */
68
+ declare const parsePnpmLockFile: (content: string) => LockFileEntry[];
69
+ /**
70
+ * Parses `yarn.lock` for Yarn Classic (v1) and Berry (v2+). Berry's
71
+ * XXH64 `checksum:` is not a cryptographic hash and is intentionally
72
+ * dropped; only v1's SRI `integrity:` flows through to
73
+ * {@link LockFileEntry.integrity}.
74
+ * @param content Raw text of the lockfile.
75
+ * @returns One {@link LockFileEntry} per distinct `name@version`.
76
+ */
77
+ declare const parseYarnLockFile: (content: string) => LockFileEntry[];
78
+ /**
79
+ * Parses `bun.lock` (Bun v1.1+, JSON-ish with trailing commas). The
80
+ * binary `bun.lockb` format is not supported.
81
+ *
82
+ * Attribution: format + tuple layout verified against lockparse
83
+ * (https://github.com/43081j/lockparse, MIT).
84
+ * @param content Raw text of the lockfile.
85
+ * @returns One {@link LockFileEntry} per distinct `name@version`.
86
+ */
87
+ declare const parseBunLockFile: (content: string) => LockFileEntry[];
88
+ /**
89
+ * Parses raw lockfile content of the given type. Returns an empty
90
+ * array if the content is malformed or doesn't contain any package
91
+ * entries.
92
+ * @param content Raw text of the lockfile.
93
+ * @param type Which parser to dispatch to.
94
+ * @returns One {@link LockFileEntry} per distinct `name@version`.
95
+ */
96
+ declare const parseLockFileContent: (content: string, type: LockFileType) => LockFileEntry[];
97
+ /**
98
+ * Walks up from `cwd`, locates the nearest supported lockfile, reads
99
+ * it, and returns the parsed entries alongside the lockfile type and
100
+ * absolute path.
101
+ * @param cwd Directory to start the search from. Defaults to
102
+ * `process.cwd()` (delegated to `findUp`).
103
+ * @returns The parsed result, keyed by the discovered lockfile path.
104
+ * @throws If no supported lockfile can be found above `cwd`.
105
+ */
106
+ declare const parseLockFile: (cwd?: URL | string) => Promise<LockFileParseResult>;
107
+ /**
108
+ * Synchronous counterpart to {@link parseLockFile}.
109
+ * @param cwd Directory to start the search from.
110
+ * @returns The parsed result, keyed by the discovered lockfile path.
111
+ * @throws If no supported lockfile can be found above `cwd`.
112
+ */
113
+ declare const parseLockFileSync: (cwd?: URL | string) => LockFileParseResult;
114
+ export { LockFileEntry, LockFileIntegrity, LockFileIntegrityAlgorithm, LockFileParseResult, LockFileType, decodeSriIntegrity, parseBunLockFile, parseLockFile, parseLockFileContent, parseLockFileSync, parseNpmLockFile, parsePnpmLockFile, parseYarnLockFile };
@@ -0,0 +1 @@
1
+ var M=Object.defineProperty;var b=(n,e)=>M(n,"name",{value:e,configurable:!0});import{createRequire as P}from"node:module";import{findUp as N,findUpSync as R}from"@visulima/fs";const A=P(import.meta.url),k=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,F=b(n=>{if(typeof k<"u"&&k.versions&&k.versions.node){const[e,t]=k.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return k.getBuiltinModule(n)}return A(n)},"__cjs_getBuiltinModule"),{readFileSync:B}=F("node:fs"),{readFile:C}=F("node:fs/promises");var T=Object.defineProperty,l=b((n,e)=>T(n,"name",{value:e,configurable:!0}),"g");const U={sha256:"sha256",sha384:"sha384",sha512:"sha512"},I=1024,q=/^[A-Z0-9+/]+={0,2}$/i,Y=/.*node_modules\/((?:@[^/]+\/)?[^/]+)$/,h=/^['"]/,y=/['"]$/,z=/^[a-z][a-zA-Z0-9]*:\s*$/m,J=/resolution:\s*\{[^}]*integrity:\s*([^,}\s]+)/,Z=/^["']?((?:@[^/@"']+\/)?[^@"'\n]+)@[^\n]+\n((?:[\t ][^\n]*(?:\n|$))+)/gm,K=/^\s+version:?\s+"?([^"\n]+)"?/m,G=/^\s+integrity[\s:]+"?([^"\s]+)"?/m,x=l(n=>{if(n.length>I)return;const e=n.indexOf("-");if(e<=0)return;const t=U[n.slice(0,e).toLowerCase()];if(!t)return;const s=n.slice(e+1);if(q.test(s))try{const r=Buffer.from(s,"base64");return r.length===0?void 0:{algorithm:t,hex:r.toString("hex")}}catch{return}},"decodeSriIntegrity"),w=l((n,e,t)=>{const s=`${t.name}@${t.version}`;e.has(s)||(e.add(s),n.push(t))},"pushUniqueEntry"),m=l((n,e,t)=>{t&&Object.keys(t).length>0&&(n[e]={...t})},"copyDepMap"),g=l(n=>{if(!n)return;const e={};for(const[t,s]of Object.entries(n))e[t]=[s];return Object.keys(e).length>0?e:void 0},"liftDepMap"),H=l(n=>{const e=[],t=new Set;let s;try{s=JSON.parse(n)}catch{return e}if(!s.packages)return e;for(const[r,o]of Object.entries(s.packages)){if(!r||!o.version)continue;const p=Y.exec(r);if(!p?.[1])continue;const i=o.name??p[1];if(i.startsWith("."))continue;const c={name:i,version:o.version};if(o.integrity){const a=x(o.integrity);a&&(c.integrity=a)}m(c,"dependencies",g(o.dependencies)),m(c,"peerDependencies",g(o.peerDependencies)),m(c,"optionalDependencies",g(o.optionalDependencies)),w(e,t,c)}return e},"parseNpmLockFile"),L=l(n=>{let e=n.trim();e.startsWith("/")&&(e=e.slice(1)),e=e.replace(h,"").replace(y,"");const t=e.indexOf("(");t>0&&(e=e.slice(0,t));const s=e.lastIndexOf("@");if(s<=0)return;const r=e.slice(0,s),o=e.slice(s+1);if(!(!r||!o||o.startsWith("link:")||o.startsWith("workspace:")||o.startsWith("file:")))return{name:r,version:o}},"splitPnpmPackageKey"),$=l((n,e)=>{const t=new RegExp(String.raw`^${e}:\s*$`,"m").exec(n);if(!t)return;const s=t.index+t[0].length,r=z.exec(n.slice(s));return n.slice(s,r?s+r.index:n.length)},"sliceTopLevelSection"),Q=l(n=>{const e=new Map,t=$(n,"snapshots");if(!t)return e;const s=/^ {2}(['"]?[^\s:][^:\n]*?['"]?):\s*\n((?: {4}[^\n]*\n?)+)/gm;let r;for(;(r=s.exec(t)??void 0)!==void 0;){const o=L(r[1]);if(!o)continue;const p=`${o.name}@${o.version}`,i=r[2],c=e.get(p)??{};for(const a of["dependencies","peerDependencies","optionalDependencies"]){const d=v(i,a);if(!d)continue;const f=c[a]??{};for(const[u,E]of Object.entries(d)){const D=f[u]??[];for(const S of E)D.includes(S)||D.push(S);f[u]=D}c[a]=f}e.set(p,c)}return e},"parsePnpmSnapshotEdges"),V=l(n=>{const e=[],t=new Set,s=$(n,"packages");if(!s)return e;const r=Q(n),o=/^ {2}(['"]?[^\s:][^:\n]*?['"]?):\s*\n((?: {4}[^\n]*\n?)+)/gm;let p;for(;(p=o.exec(s)??void 0)!==void 0;){const i=L(p[1]);if(!i)continue;const c=p[2],a=J.exec(c),d={name:i.name,version:i.version};if(a?.[1]){const u=x(a[1]);u&&(d.integrity=u)}const f=r.get(`${i.name}@${i.version}`);m(d,"dependencies",f?.dependencies??v(c,"dependencies")),m(d,"peerDependencies",f?.peerDependencies??v(c,"peerDependencies")),m(d,"optionalDependencies",f?.optionalDependencies??v(c,"optionalDependencies")),w(e,t,d)}return e},"parsePnpmLockFile"),v=l((n,e)=>{const t=new RegExp(String.raw`^ {4}${e}:\s*\n((?: {6,}[^\n]*\n?)+)`,"m").exec(n);if(!t?.[1])return;const s={},r=/^ {6}([^\s:]+):\s*([^\n]+)/gm;let o;for(;(o=r.exec(t[1])??void 0)!==void 0;){const p=o[1].replace(h,"").replace(y,"");let i=o[2].trim();i=i.replace(h,"").replace(y,"");const c=i.indexOf("(");if(c>0&&(i=i.slice(0,c).trim()),!p||!i)continue;const a=s[p]??[];a.includes(i)||a.push(i),s[p]=a}return Object.keys(s).length>0?s:void 0},"extractPnpmDependencyMap"),X=l(n=>{const e=[],t=new Set,s=Z;s.lastIndex=0;let r;for(;(r=s.exec(n)??void 0)!==void 0;){const o=r[1].replace(h,"").replace(y,"");if(!o)continue;const p=r[2],i=K.exec(p);if(!i?.[1])continue;const c={name:o,version:i[1].trim()},a=G.exec(p);if(a?.[1]){const d=x(a[1]);d&&(c.integrity=d)}m(c,"dependencies",j(p,"dependencies")),m(c,"peerDependencies",j(p,"peerDependencies")),m(c,"optionalDependencies",j(p,"optionalDependencies")),w(e,t,c)}return e},"parseYarnLockFile"),j=l((n,e)=>{const t=new RegExp(String.raw`^ {2}${e}:\s*\n((?: {4,}[^\n]*\n?)+)`,"m").exec(n);if(!t?.[1])return;const s={},r=/^ {4}(['"]?[^\s:'"]+['"]?)\s*(?::\s*)?['"]([^'"\n]+)['"]/gm;let o;for(;(o=r.exec(t[1])??void 0)!==void 0;){const p=o[1].replace(h,"").replace(y,""),i=o[2];if(p&&i){const c=s[p]??[];c.includes(i)||c.push(i),s[p]=c}}return Object.keys(s).length>0?s:void 0},"extractYarnDependencyMap"),ee=/,(?=\s*[}\]])/g,ne=l(n=>{const e=[],t=new Set;let s;try{s=JSON.parse(n.replaceAll(ee,""))}catch{return e}if(!s.packages)return e;for(const r of Object.values(s.packages)){const o=r[0];if(typeof o!="string")continue;const p=o.indexOf("@",1);if(p<=0)continue;const i=o.slice(0,p),c=o.slice(p+1);if(!i||!c||c.startsWith("workspace:")||c.startsWith("link:")||c.startsWith("file:"))continue;const a={name:i,version:c},d=r[3];if(typeof d=="string"&&d.length>0){const u=x(d);u&&(a.integrity=u)}const f=r[2];if(f&&typeof f=="object"&&!Array.isArray(f)){const u=f;m(a,"dependencies",g(u.dependencies)),m(a,"peerDependencies",g(u.peerDependencies)),m(a,"optionalDependencies",g(u.optionalDependencies))}w(e,t,a)}return e},"parseBunLockFile"),O=l(n=>{if(n.endsWith("pnpm-lock.yaml"))return"pnpm";if(n.endsWith("package-lock.json"))return"npm";if(n.endsWith("yarn.lock"))return"yarn";if(n.endsWith("bun.lock"))return"bun"},"inferLockFileType"),_=l((n,e)=>{switch(e){case"bun":return ne(n);case"npm":return H(n);case"pnpm":return V(n);case"yarn":return X(n);default:return[]}},"parseLockFileContent"),W=["pnpm-lock.yaml","package-lock.json","yarn.lock","bun.lock"],ce=l(async n=>{const e=await N(W,{type:"file",...n&&{cwd:n}});if(!e)throw new Error("Could not find a supported lock file (pnpm-lock.yaml, package-lock.json, yarn.lock, bun.lock)");const t=O(e);if(!t)throw new Error(`Unsupported lock file: ${e}`);const s=await C(e,"utf8");return{entries:_(s,t),path:e,type:t}},"parseLockFile"),re=l(n=>{const e=R(W,{type:"file",...n&&{cwd:n}});if(!e)throw new Error("Could not find a supported lock file (pnpm-lock.yaml, package-lock.json, yarn.lock, bun.lock)");const t=O(e);if(!t)throw new Error(`Unsupported lock file: ${e}`);return{entries:_(B(e,"utf8"),t),path:e,type:t}},"parseLockFileSync");export{x as decodeSriIntegrity,ne as parseBunLockFile,ce as parseLockFile,_ as parseLockFileContent,re as parseLockFileSync,H as parseNpmLockFile,V as parsePnpmLockFile,X as parseYarnLockFile};
@@ -1,25 +1,26 @@
1
- export type Strategy = "lerna" | "npm" | "pnpm" | "turbo" | "yarn";
2
- export interface RootMonorepo<T extends Strategy = Strategy> {
3
- path: string;
4
- strategy: T;
1
+ type Strategy = "lerna" | "npm" | "pnpm" | "turbo" | "yarn";
2
+ interface RootMonorepo<T extends Strategy = Strategy> {
3
+ path: string;
4
+ strategy: T;
5
5
  }
6
6
  /**
7
- * An asynchronous function to find the root directory path and strategy for a monorepo based on
8
- * the given current working directory (cwd).
9
- * @param cwd The current working directory. The type of `cwd` is part of an `Options` type, specifically `Options["cwd"]`.
10
- * Default is undefined.
11
- * @returns A `Promise` that resolves to the root directory path and strategy for the monorepo.
12
- * The type of the returned promise is `Promise&lt;RootMonorepo>`.
13
- * @throws An `Error` if no monorepo root can be found using lerna, yarn, pnpm, or npm as indicators.
14
- */
15
- export declare const findMonorepoRoot: (cwd?: URL | string) => Promise<RootMonorepo>;
7
+ * An asynchronous function to find the root directory path and strategy for a monorepo based on
8
+ * the given current working directory (cwd).
9
+ * @param cwd The current working directory. The type of `cwd` is part of an `Options` type, specifically `Options["cwd"]`.
10
+ * Default is undefined.
11
+ * @returns A `Promise` that resolves to the root directory path and strategy for the monorepo.
12
+ * The type of the returned promise is `Promise&lt;RootMonorepo>`.
13
+ * @throws An `Error` if no monorepo root can be found using lerna, yarn, pnpm, or npm as indicators.
14
+ */
15
+ declare const findMonorepoRoot: (cwd?: URL | string) => Promise<RootMonorepo>;
16
16
  /**
17
- * An function to find the root directory path and strategy for a monorepo based on
18
- * the given current working directory (cwd).
19
- * @param cwd The current working directory. The type of `cwd` is part of an `Options` type, specifically `Options["cwd"]`.
20
- * Default is undefined.
21
- * @returns A `Promise` that resolves to the root directory path and strategy for the monorepo.
22
- * The type of the returned promise is `Promise&lt;RootMonorepo>`.
23
- * @throws An `Error` if no monorepo root can be found using lerna, yarn, pnpm, or npm as indicators.
24
- */
25
- export declare const findMonorepoRootSync: (cwd?: URL | string) => RootMonorepo;
17
+ * An function to find the root directory path and strategy for a monorepo based on
18
+ * the given current working directory (cwd).
19
+ * @param cwd The current working directory. The type of `cwd` is part of an `Options` type, specifically `Options["cwd"]`.
20
+ * Default is undefined.
21
+ * @returns A `Promise` that resolves to the root directory path and strategy for the monorepo.
22
+ * The type of the returned promise is `Promise&lt;RootMonorepo>`.
23
+ * @throws An `Error` if no monorepo root can be found using lerna, yarn, pnpm, or npm as indicators.
24
+ */
25
+ declare const findMonorepoRootSync: (cwd?: URL | string) => RootMonorepo;
26
+ export { RootMonorepo, Strategy, findMonorepoRoot, findMonorepoRootSync };
package/dist/monorepo.js CHANGED
@@ -1 +1 @@
1
- var l=Object.defineProperty;var p=(r,e)=>l(r,"name",{value:e,configurable:!0});import{createRequire as y}from"node:module";import{findUp as j,readJson as w,findUpSync as b,readJsonSync as k}from"@visulima/fs";import{NotFoundError as u}from"@visulima/fs/error";import{dirname as d,join as a}from"@visulima/path";import{findPackageManager as _,findPackageManagerSync as M}from"./package-manager.js";const g=y(import.meta.url),i=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,h=p(r=>{if(typeof i<"u"&&i.versions&&i.versions.node){const[e,t]=i.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return i.getBuiltinModule(r)}return g(r)},"__cjs_getBuiltinModule"),{existsSync:c,readFileSync:f}=h("node:fs");var S=Object.defineProperty,m=p((r,e)=>S(r,"name",{value:e,configurable:!0}),"i");const E=m(async r=>{const e=await j(["lerna.json","turbo.json"],{type:"file",...r&&{cwd:r}});if(e?.endsWith("lerna.json")){const o=await w(e);if(o.useWorkspaces||o.packages)return{path:d(e),strategy:"lerna"}}const t=e?.endsWith("turbo.json");try{const{packageManager:o,path:n}=await _(r);if(["npm","yarn"].includes(o)){const s=a(n,"package.json");if(c(s)&&f(a(n,"package.json"),"utf8").includes("workspaces"))return{path:n,strategy:t?"turbo":o}}else if(o==="pnpm"){const s=a(n,"pnpm-workspace.yaml");if(c(s))return{path:n,strategy:t?"turbo":"pnpm"}}}catch(o){if(!(o instanceof u))throw o}throw new Error(`No monorepo root could be found upwards from the directory ${r} using lerna, yarn, pnpm, or npm as indicators.`)},"findMonorepoRoot"),T=m(r=>{const e=b(["lerna.json","turbo.json"],{type:"file",...r&&{cwd:r}});if(e?.endsWith("lerna.json")){const o=k(e);if(o.useWorkspaces||o.packages)return{path:d(e),strategy:"lerna"}}const t=e?.endsWith("turbo.json");try{const{packageManager:o,path:n}=M(r);if(["npm","yarn"].includes(o)){const s=a(n,"package.json");if(c(s)&&f(a(n,"package.json"),"utf8").includes("workspaces"))return{path:n,strategy:t?"turbo":o}}else if(o==="pnpm"){const s=a(n,"pnpm-workspace.yaml");if(c(s))return{path:n,strategy:t?"turbo":"pnpm"}}}catch(o){if(!(o instanceof u))throw o}throw new Error(`No monorepo root could be found upwards from the directory ${r} using lerna, yarn, pnpm, or npm as indicators.`)},"findMonorepoRootSync");export{E as findMonorepoRoot,T as findMonorepoRootSync};
1
+ var l=Object.defineProperty;var p=(e,n)=>l(e,"name",{value:n,configurable:!0});import{createRequire as y}from"node:module";import{findUp as j,readJson as w,findUpSync as b,readJsonSync as k}from"@visulima/fs";import{NotFoundError as u}from"@visulima/fs/error";import{dirname as d,join as a}from"@visulima/path";import{findPackageManager as _,findPackageManagerSync as M}from"./package-manager.js";const g=y(import.meta.url),i=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,h=p(e=>{if(typeof i<"u"&&i.versions&&i.versions.node){const[n,t]=i.versions.node.split(".").map(Number);if(n>22||n===22&&t>=3||n===20&&t>=16)return i.getBuiltinModule(e)}return g(e)},"__cjs_getBuiltinModule"),{existsSync:c,readFileSync:f}=h("node:fs");var S=Object.defineProperty,m=p((e,n)=>S(e,"name",{value:n,configurable:!0}),"i");const E=m(async e=>{const n=await j(["lerna.json","turbo.json"],{type:"file",...e&&{cwd:e}});if(n?.endsWith("lerna.json")){const o=await w(n);if(o&&typeof o=="object"&&!Array.isArray(o)){const r=o;if(r.useWorkspaces||r.packages)return{path:d(n),strategy:"lerna"}}}const t=n?.endsWith("turbo.json");try{const{packageManager:o,path:r}=await _(e);if(["npm","yarn"].includes(o)){const s=a(r,"package.json");if(c(s)&&f(a(r,"package.json"),"utf8").includes("workspaces"))return{path:r,strategy:t?"turbo":o}}else if(o==="pnpm"){const s=a(r,"pnpm-workspace.yaml");if(c(s))return{path:r,strategy:t?"turbo":"pnpm"}}}catch(o){if(!(o instanceof u))throw o}throw new Error(`No monorepo root could be found upwards from the directory ${e??process.cwd()} using lerna, yarn, pnpm, or npm as indicators.`)},"findMonorepoRoot"),T=m(e=>{const n=b(["lerna.json","turbo.json"],{type:"file",...e&&{cwd:e}});if(n?.endsWith("lerna.json")){const o=k(n);if(o.useWorkspaces||o.packages)return{path:d(n),strategy:"lerna"}}const t=n?.endsWith("turbo.json");try{const{packageManager:o,path:r}=M(e);if(["npm","yarn"].includes(o)){const s=a(r,"package.json");if(c(s)&&f(a(r,"package.json"),"utf8").includes("workspaces"))return{path:r,strategy:t?"turbo":o}}else if(o==="pnpm"){const s=a(r,"pnpm-workspace.yaml");if(c(s))return{path:r,strategy:t?"turbo":"pnpm"}}}catch(o){if(!(o instanceof u))throw o}throw new Error(`No monorepo root could be found upwards from the directory ${e??process.cwd()} using lerna, yarn, pnpm, or npm as indicators.`)},"findMonorepoRootSync");export{E as findMonorepoRoot,T as findMonorepoRootSync};