@visulima/package 4.1.7 → 5.0.0-alpha.10
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 +185 -0
- package/LICENSE.md +1 -1
- package/README.md +29 -20
- package/dist/error.js +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +7 -1
- package/dist/lockfile.d.ts +113 -0
- package/dist/lockfile.js +425 -0
- package/dist/monorepo.js +121 -1
- package/dist/package-json.d.ts +2 -2
- package/dist/package-json.js +621 -3
- package/dist/package-manager.d.ts +4 -5
- package/dist/package-manager.js +186 -9
- package/dist/package.js +81 -1
- package/dist/packem_shared/PackageNotFoundError-C0ltLzw7.js +44 -0
- package/dist/pnpm.js +105 -1
- package/dist/types.d.ts +1 -1
- package/dist/utils/confirm.d.ts +11 -0
- package/package.json +12 -8
- package/dist/packem_shared/PackageNotFoundError-BictYTIA.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,188 @@
|
|
|
1
|
+
## @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)
|
|
2
|
+
|
|
3
|
+
### Miscellaneous Chores
|
|
4
|
+
|
|
5
|
+
* jsr.json update and lock file ([73fce38](https://github.com/visulima/visulima/commit/73fce38c7cb4603f3fffb88609b1b18e2feb4937))
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Dependencies
|
|
9
|
+
|
|
10
|
+
* **@visulima/fs:** upgraded to 5.0.0-alpha.11
|
|
11
|
+
|
|
12
|
+
## @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)
|
|
13
|
+
|
|
14
|
+
### Miscellaneous Chores
|
|
15
|
+
|
|
16
|
+
* update the jsr.json ([864ab7e](https://github.com/visulima/visulima/commit/864ab7e71c4b5ae82f64792d1ae8debfea2c539b))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Dependencies
|
|
20
|
+
|
|
21
|
+
* **@visulima/fs:** upgraded to 5.0.0-alpha.10
|
|
22
|
+
|
|
23
|
+
## @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)
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
* 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))
|
|
28
|
+
* **package:** add lockfile utilities ([12f9076](https://github.com/visulima/visulima/commit/12f9076ba1570bec2f2d43b58fcd31701634434e))
|
|
29
|
+
|
|
30
|
+
### Bug Fixes
|
|
31
|
+
|
|
32
|
+
* **package:** hoist regexes, rewrite lockfile parser, resolve eslint issues ([585ed7f](https://github.com/visulima/visulima/commit/585ed7f16b3f42996bb030a8bae5f1f37a50c316))
|
|
33
|
+
|
|
34
|
+
### Miscellaneous Chores
|
|
35
|
+
|
|
36
|
+
* **api-platform:** apply pending lint and source updates ([3fb0043](https://github.com/visulima/visulima/commit/3fb0043a4cf35f752ca89a09a077100ae0142da8))
|
|
37
|
+
* bump engines.node to ^22.14.0 || >=24.10.0 ([c3d0931](https://github.com/visulima/visulima/commit/c3d0931d1504e4f21ebf50ea680cfa7ce4ba15ce))
|
|
38
|
+
* fixed jsr.json ([5d85e51](https://github.com/visulima/visulima/commit/5d85e5179de38e284ec433b14d77c71a1619c8d6))
|
|
39
|
+
* **package:** apply formatter and lint fixes ([a0f4acf](https://github.com/visulima/visulima/commit/a0f4acfb15beb256edd3b62958b4e3db039757a9))
|
|
40
|
+
* **package:** apply pending changes ([919b214](https://github.com/visulima/visulima/commit/919b214f9659a5b4ff95ec8b35a70c10af3c4853))
|
|
41
|
+
* **package:** apply pending lint and source updates ([2fd1c04](https://github.com/visulima/visulima/commit/2fd1c044d9528500943368c01f9b24fd2280058c))
|
|
42
|
+
* **package:** enforce curly braces and apply lint fixes ([0df50ba](https://github.com/visulima/visulima/commit/0df50ba4f45bac67dabeb78ebfc3d555ba5aec56))
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
### Dependencies
|
|
46
|
+
|
|
47
|
+
* **@visulima/fs:** upgraded to 5.0.0-alpha.9
|
|
48
|
+
|
|
49
|
+
## @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)
|
|
50
|
+
|
|
51
|
+
### Bug Fixes
|
|
52
|
+
|
|
53
|
+
* **package:** properly fix eslint errors in code ([56b1547](https://github.com/visulima/visulima/commit/56b15474d6edd8f33fb46cca81fa34d600df2023))
|
|
54
|
+
* **package:** remove remaining eslint suppressions with proper code fixes ([69efa7a](https://github.com/visulima/visulima/commit/69efa7a9c67977c491a1ec8eaded733478ed29a1))
|
|
55
|
+
* **package:** resolve eslint errors ([1ec4728](https://github.com/visulima/visulima/commit/1ec47286cfcec55ea50c51d51f198b119dd22e71))
|
|
56
|
+
* resolve failing tests across multiple packages ([2b4b6f0](https://github.com/visulima/visulima/commit/2b4b6f04169b60fdc4cf77b293015436a272c0fb))
|
|
57
|
+
|
|
58
|
+
### Miscellaneous Chores
|
|
59
|
+
|
|
60
|
+
* **package:** add tsconfig.eslint.json for type-aware linting ([0355fea](https://github.com/visulima/visulima/commit/0355fea301fb7a8571da25bebd108830bc23ed04))
|
|
61
|
+
* **package:** apply prettier formatting ([ebb5bd1](https://github.com/visulima/visulima/commit/ebb5bd12c6b7d49811c68ea96bf62ce7e2a7d42d))
|
|
62
|
+
* **package:** migrate .prettierrc.cjs to prettier.config.js ([2b84ef0](https://github.com/visulima/visulima/commit/2b84ef0db67467e1360b2f1e6f9b6e96bf3dbbb0))
|
|
63
|
+
* **tooling:** remove empty dependency objects from package.json ([dc52a23](https://github.com/visulima/visulima/commit/dc52a23bc1e2d36f4ec71ca67506bf6861a02929))
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
### Dependencies
|
|
67
|
+
|
|
68
|
+
* **@visulima/fs:** upgraded to 5.0.0-alpha.7
|
|
69
|
+
* **@visulima/path:** upgraded to 3.0.0-alpha.8
|
|
70
|
+
|
|
71
|
+
## @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)
|
|
72
|
+
|
|
73
|
+
### Features
|
|
74
|
+
|
|
75
|
+
* **web:** auto-generate packages page from workspace metadata ([623e520](https://github.com/visulima/visulima/commit/623e5207693a7fe720f5f2f179593a3654c880e3))
|
|
76
|
+
|
|
77
|
+
### Miscellaneous Chores
|
|
78
|
+
|
|
79
|
+
* update homepage URLs to visulima.com/packages/ format ([be42968](https://github.com/visulima/visulima/commit/be42968129df85fb074224435e33135ff44cab91))
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
### Dependencies
|
|
83
|
+
|
|
84
|
+
* **@visulima/fs:** upgraded to 5.0.0-alpha.6
|
|
85
|
+
* **@visulima/path:** upgraded to 3.0.0-alpha.7
|
|
86
|
+
|
|
87
|
+
## @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)
|
|
88
|
+
|
|
89
|
+
### Bug Fixes
|
|
90
|
+
|
|
91
|
+
* **package:** use workspace:* for internal [@visulima](https://github.com/visulima) deps ([e409128](https://github.com/visulima/visulima/commit/e409128c02a6d801dd385ae845c1ab28ca5c09da))
|
|
92
|
+
* **web:** improve build setup with incremental stats caching and prod install ([fe33e75](https://github.com/visulima/visulima/commit/fe33e75827586779b4b3a0c6d57b39f889ee6207))
|
|
93
|
+
|
|
94
|
+
### Miscellaneous Chores
|
|
95
|
+
|
|
96
|
+
* **package:** migrate deps to pnpm catalogs ([301fac4](https://github.com/visulima/visulima/commit/301fac41be88df7469155649467921a72ca740a6))
|
|
97
|
+
* **package:** update dependencies ([fb1a43d](https://github.com/visulima/visulima/commit/fb1a43de0fd345806d76aec660d48c627d576083))
|
|
98
|
+
* visulima website ([#591](https://github.com/visulima/visulima/issues/591)) ([59ab2e2](https://github.com/visulima/visulima/commit/59ab2e2befb03e51cd2088956f83d9b87de6d033))
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
### Dependencies
|
|
102
|
+
|
|
103
|
+
* **@visulima/fs:** upgraded to 5.0.0-alpha.5
|
|
104
|
+
* **@visulima/path:** upgraded to 3.0.0-alpha.6
|
|
105
|
+
|
|
106
|
+
## @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)
|
|
107
|
+
|
|
108
|
+
### Bug Fixes
|
|
109
|
+
|
|
110
|
+
* **package:** update packem to 2.0.0-alpha.54 ([e5b3249](https://github.com/visulima/visulima/commit/e5b3249026a425b7a42443f66a08f8f68c3d62e4))
|
|
111
|
+
* **package:** use intentionally malformed JSON in bad workspace fixture ([a6680e7](https://github.com/visulima/visulima/commit/a6680e7a97aeae643c26b69bc5eb6c64c28de278))
|
|
112
|
+
|
|
113
|
+
### Documentation
|
|
114
|
+
|
|
115
|
+
* **humanizer,html,iso-locale,package,tsconfig:** add comprehensive Fumadocs documentation ([19781ce](https://github.com/visulima/visulima/commit/19781ce5d27605971a9f2fdf0a99863effd98091))
|
|
116
|
+
|
|
117
|
+
### Miscellaneous Chores
|
|
118
|
+
|
|
119
|
+
* **package:** update dependencies ([d89cde6](https://github.com/visulima/visulima/commit/d89cde6792e9036d0690cfaf9b771e26b24faac8))
|
|
120
|
+
* **package:** update dependencies ([4b62cf8](https://github.com/visulima/visulima/commit/4b62cf85e6ef4deac4ef01c8a7e15bcf49ecbe80))
|
|
121
|
+
* **tooling:** update dependencies ([7f6f9d3](https://github.com/visulima/visulima/commit/7f6f9d3c41b170c53659ab34b79ceb23e4e9660a))
|
|
122
|
+
* update lock file maintenance ([d83e716](https://github.com/visulima/visulima/commit/d83e71697b75d24704185b66bb521a934d2db02d))
|
|
123
|
+
* year update ([47f4105](https://github.com/visulima/visulima/commit/47f410596ce7190cfea36a073db32e0cec50bbcd))
|
|
124
|
+
|
|
125
|
+
### Tests
|
|
126
|
+
|
|
127
|
+
* **package:** fix broken JSON test fixture ([46141d6](https://github.com/visulima/visulima/commit/46141d6472d8de20512109200a12e79c48ddc33c))
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
### Dependencies
|
|
131
|
+
|
|
132
|
+
* **@visulima/fs:** upgraded to 5.0.0-alpha.4
|
|
133
|
+
* **@visulima/path:** upgraded to 3.0.0-alpha.5
|
|
134
|
+
|
|
135
|
+
## @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)
|
|
136
|
+
|
|
137
|
+
### Bug Fixes
|
|
138
|
+
|
|
139
|
+
* **package:** update package files ([586668e](https://github.com/visulima/visulima/commit/586668ee3a790163aca11ddc8f35b7bdfd740ac6))
|
|
140
|
+
|
|
141
|
+
### Miscellaneous Chores
|
|
142
|
+
|
|
143
|
+
* fixed project.json names and schema path ([964722f](https://github.com/visulima/visulima/commit/964722f691db205c7edb9aa6db29e849a647500b))
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
### Dependencies
|
|
147
|
+
|
|
148
|
+
* **@visulima/fs:** upgraded to 5.0.0-alpha.3
|
|
149
|
+
* **@visulima/path:** upgraded to 3.0.0-alpha.4
|
|
150
|
+
|
|
151
|
+
## @visulima/package [5.0.0-alpha.2](https://github.com/visulima/visulima/compare/@visulima/package@5.0.0-alpha.1...@visulima/package@5.0.0-alpha.2) (2025-12-11)
|
|
152
|
+
|
|
153
|
+
### Bug Fixes
|
|
154
|
+
|
|
155
|
+
* update package OG images across multiple packages ([f08e4dd](https://github.com/visulima/visulima/commit/f08e4dd2b105ccb29c8412020a9c2be36d6c1e9e))
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
### Dependencies
|
|
159
|
+
|
|
160
|
+
* **@visulima/fs:** upgraded to 5.0.0-alpha.2
|
|
161
|
+
* **@visulima/path:** upgraded to 3.0.0-alpha.3
|
|
162
|
+
|
|
163
|
+
## @visulima/package [5.0.0-alpha.1](https://github.com/visulima/visulima/compare/@visulima/package@4.1.7...@visulima/package@5.0.0-alpha.1) (2025-12-07)
|
|
164
|
+
|
|
165
|
+
### ⚠ BREAKING CHANGES
|
|
166
|
+
|
|
167
|
+
* change min node version to 22.13
|
|
168
|
+
|
|
169
|
+
### Bug Fixes
|
|
170
|
+
|
|
171
|
+
* add new package image, fixed readme rendering on npm, fixed building of packages ([b790ba2](https://github.com/visulima/visulima/commit/b790ba253ea07fef83528fd822a678facf021b5f))
|
|
172
|
+
* update Node.js engine version requirement to >=22.13 in multiple package.json files for improved compatibility ([b828e9a](https://github.com/visulima/visulima/commit/b828e9aeaebfc798eecddccd90e6ec7560c6d36a))
|
|
173
|
+
|
|
174
|
+
### Miscellaneous Chores
|
|
175
|
+
|
|
176
|
+
* moved all packages into groups ([0615e9d](https://github.com/visulima/visulima/commit/0615e9d14a8a886e11da529ce150cf31ca973c10))
|
|
177
|
+
* update @anolilab/semantic-release-pnpm and @anolilab/semantic-release-preset to versions 3.2.2 and 12.1.2 across multiple package.json files for improved compatibility ([3921626](https://github.com/visulima/visulima/commit/3921626141fe5da398749bf0ba675f1596f18afb))
|
|
178
|
+
* update dependencies across multiple packages to improve compatibility and performance, including upgrading `@anolilab/semantic-release-pnpm` and `@anolilab/semantic-release-preset` to versions 3.2.0 and 12.1.0 respectively, and updating `react`, `react-dom`, and `next` versions to 19.2.1 and 16.0.7 in various package.json files ([aee8fcd](https://github.com/visulima/visulima/commit/aee8fcd796ae9b8d055903260e7150996ea9f53d))
|
|
179
|
+
* upgrade `vitest` version to 4.0.15 in multiple package.json files and update lockfile for improved compatibility; adjust test cases for ESM package support in tooling tests ([0fba407](https://github.com/visulima/visulima/commit/0fba407e08283ba8c1c9488f99ca1f9ff676c4cf))
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
### Dependencies
|
|
183
|
+
|
|
184
|
+
* **@visulima/fs:** upgraded to 5.0.0-alpha.1
|
|
185
|
+
|
|
1
186
|
## @visulima/package [4.1.7](https://github.com/visulima/visulima/compare/@visulima/package@4.1.6...@visulima/package@4.1.7) (2025-11-19)
|
|
2
187
|
|
|
3
188
|
### Miscellaneous Chores
|
package/LICENSE.md
CHANGED
package/README.md
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
<h3>Visulima package</h3>
|
|
3
|
-
<p>
|
|
4
|
-
A comprehensive package management utility that helps you find root directories, monorepos, package managers, and parse package.json, package.yaml, and package.json5 files with advanced features like catalog resolution and caching.
|
|
1
|
+
<!-- START_PACKAGE_OG_IMAGE_PLACEHOLDER -->
|
|
5
2
|
|
|
6
|
-
|
|
3
|
+
<a href="https://www.anolilab.com/open-source" align="center">
|
|
7
4
|
|
|
8
|
-
|
|
9
|
-
[@visulima/path](https://github.com/visulima/visulima/tree/main/packages/path),
|
|
10
|
-
[normalize-package-data](https://github.com/npm/normalize-package-data),
|
|
11
|
-
[pathe](https://github.com/unjs/pathe), and
|
|
12
|
-
[type-fest](https://github.com/sindresorhus/type-fest)
|
|
5
|
+
<img src="__assets__/package-og.svg" alt="package" />
|
|
13
6
|
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
</a>
|
|
8
|
+
|
|
9
|
+
<h3 align="center">A comprehensive package management utility that helps you find root directories, monorepos, package managers, and parse package.json, package.yaml, and package.json5 files with advanced features like catalog resolution.</h3>
|
|
10
|
+
|
|
11
|
+
<!-- END_PACKAGE_OG_IMAGE_PLACEHOLDER -->
|
|
16
12
|
|
|
17
13
|
<br />
|
|
18
14
|
|
|
19
15
|
<div align="center">
|
|
20
16
|
|
|
21
|
-
[![typescript-image]
|
|
17
|
+
[![typescript-image][typescript-badge]][typescript-url]
|
|
18
|
+
[![mit licence][license-badge]][license]
|
|
19
|
+
[![npm downloads][npm-downloads-badge]][npm-downloads]
|
|
20
|
+
[![Chat][chat-badge]][chat]
|
|
21
|
+
[![PRs Welcome][prs-welcome-badge]][prs-welcome]
|
|
22
22
|
|
|
23
23
|
</div>
|
|
24
24
|
|
|
@@ -357,14 +357,23 @@ If you would like to help take a look at the [list of issues](https://github.com
|
|
|
357
357
|
|
|
358
358
|
- [read-pkg](https://github.com/sindresorhus/read-pkg) - Read a package.json file.
|
|
359
359
|
|
|
360
|
+
## Made with ❤️ at Anolilab
|
|
361
|
+
|
|
362
|
+
This is an open source project and will always remain free to use. If you think it's cool, please star it 🌟. [Anolilab](https://www.anolilab.com/open-source) is a Development and AI Studio. Contact us at [hello@anolilab.com](mailto:hello@anolilab.com) if you need any help with these technologies or just want to say hi!
|
|
363
|
+
|
|
360
364
|
## License
|
|
361
365
|
|
|
362
|
-
The visulima package is open-sourced software licensed under the [MIT][license
|
|
366
|
+
The visulima package is open-sourced software licensed under the [MIT][license]
|
|
363
367
|
|
|
364
|
-
|
|
368
|
+
<!-- badges -->
|
|
365
369
|
|
|
366
|
-
[
|
|
367
|
-
[license
|
|
368
|
-
[
|
|
369
|
-
[npm-
|
|
370
|
-
[
|
|
370
|
+
[license-badge]: https://img.shields.io/npm/l/@visulima/package?style=for-the-badge
|
|
371
|
+
[license]: https://github.com/visulima/visulima/blob/main/LICENSE
|
|
372
|
+
[npm-downloads-badge]: https://img.shields.io/npm/dm/@visulima/package?style=for-the-badge
|
|
373
|
+
[npm-downloads]: https://www.npmjs.com/package/@visulima/package
|
|
374
|
+
[prs-welcome-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=for-the-badge
|
|
375
|
+
[prs-welcome]: https://github.com/visulima/visulima/blob/main/.github/CONTRIBUTING.md
|
|
376
|
+
[chat-badge]: https://img.shields.io/discord/932323359193186354.svg?style=for-the-badge
|
|
377
|
+
[chat]: https://discord.gg/TtFJY8xkFK
|
|
378
|
+
[typescript-badge]: https://img.shields.io/badge/Typescript-294E80.svg?style=for-the-badge&logo=typescript
|
|
379
|
+
[typescript-url]: https://www.typescriptlang.org/
|
package/dist/error.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export { default as PackageNotFoundError } from './packem_shared/PackageNotFoundError-C0ltLzw7.js';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { default as PackageNotFoundError } from "./error/package-not-found-error.d.ts";
|
|
2
|
+
export type { LockFileEntry, LockFileIntegrity, LockFileIntegrityAlgorithm, LockFileParseResult, LockFileType } from "./lockfile.d.ts";
|
|
3
|
+
export { decodeSriIntegrity, parseBunLockFile, parseLockFile, parseLockFileContent, parseLockFileSync, parseNpmLockFile, parsePnpmLockFile, parseYarnLockFile, } from "./lockfile.d.ts";
|
|
2
4
|
export type { RootMonorepo, Strategy } from "./monorepo.d.ts";
|
|
3
5
|
export { findMonorepoRoot, findMonorepoRootSync } from "./monorepo.d.ts";
|
|
4
6
|
export { findPackageRoot, findPackageRootSync } from "./package.d.ts";
|
package/dist/index.js
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
export { default as PackageNotFoundError } from './packem_shared/PackageNotFoundError-C0ltLzw7.js';
|
|
2
|
+
export { decodeSriIntegrity, parseBunLockFile, parseLockFile, parseLockFileContent, parseLockFileSync, parseNpmLockFile, parsePnpmLockFile, parseYarnLockFile } from './lockfile.js';
|
|
3
|
+
export { findMonorepoRoot, findMonorepoRootSync } from './monorepo.js';
|
|
4
|
+
export { findPackageRoot, findPackageRootSync } from './package.js';
|
|
5
|
+
export { ensurePackages, findPackageJson, findPackageJsonSync, getPackageJsonProperty, hasPackageJsonAnyDependency, hasPackageJsonProperty, parsePackageJson, parsePackageJsonSync, writePackageJson, writePackageJsonSync } from './package-json.js';
|
|
6
|
+
export { findLockFile, findLockFileSync, findPackageManager, findPackageManagerSync, generateMissingPackagesInstallMessage, getPackageManagerVersion, identifyInitiatingPackageManager } from './package-manager.js';
|
|
7
|
+
export { isPackageInWorkspace, readPnpmCatalogs, readPnpmCatalogsSync, resolveCatalogReference, resolveCatalogReferences, resolveDependenciesCatalogReferences } from './pnpm.js';
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/** Lockfiles the parser recognises. Legacy binary `bun.lockb` is unsupported. */
|
|
2
|
+
export type LockFileType = "bun" | "npm" | "pnpm" | "yarn";
|
|
3
|
+
/** SRI algorithms the parser can decode into hex. */
|
|
4
|
+
export type LockFileIntegrityAlgorithm = "sha256" | "sha384" | "sha512";
|
|
5
|
+
/** Decoded integrity digest: algorithm + lowercase hex string. */
|
|
6
|
+
export interface LockFileIntegrity {
|
|
7
|
+
algorithm: LockFileIntegrityAlgorithm;
|
|
8
|
+
hex: string;
|
|
9
|
+
}
|
|
10
|
+
/** A single resolved package extracted from a lockfile. */
|
|
11
|
+
export 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
|
+
export 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-<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-<base64>`.
|
|
50
|
+
* @returns Decoded algorithm + hex digest, or `undefined` when the
|
|
51
|
+
* input can't be parsed.
|
|
52
|
+
*/
|
|
53
|
+
export 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
|
+
export 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
|
+
export 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
|
+
export 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
|
+
export 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
|
+
export 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
|
+
export 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
|
+
export declare const parseLockFileSync: (cwd?: URL | string) => LockFileParseResult;
|