@preventive/deptree 1.0.0-alpha.11 → 1.0.0-alpha.12
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/bin/deptree.js +4 -3
- package/package.json +1 -1
- package/src/pnpm/package.js +8 -2
package/bin/deptree.js
CHANGED
|
@@ -36,9 +36,10 @@ disk holding nothing else. Exits 0 where the two are the same, 1 where
|
|
|
36
36
|
they differ, 2 on trouble.
|
|
37
37
|
|
|
38
38
|
Tarballs, zips and crates are kept in ${defaultCacheDir ?? 'no cache, as no home directory is known'}.
|
|
39
|
-
A scoped package is fetched with
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
A scoped package is fetched with PREVENTIVE_MEASURES_NPM_TOKEN,
|
|
40
|
+
STASIS_NPM_TOKEN or NPM_TOKEN, else with a ~/.npmrc line of nothing but
|
|
41
|
+
//registry.npmjs.org/:_authToken=npm_…; a Soldeer git dependency with
|
|
42
|
+
GITHUB_TOKEN or GH_TOKEN, else anonymously.
|
|
42
43
|
|
|
43
44
|
--pnpm, --yarn, --npm, --soldeer, --cargo <version>
|
|
44
45
|
the one that installed: by default the one
|
package/package.json
CHANGED
package/src/pnpm/package.js
CHANGED
|
@@ -74,8 +74,14 @@ function readManifest(files, pkg, where) {
|
|
|
74
74
|
return manifest
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
|
|
77
|
+
// npm's abbreviated metadata, which pnpm resolves from unless a setting such
|
|
78
|
+
// as supportedArchitectures.libc has it ask for the full document, has no
|
|
79
|
+
// libc, nor has the package.json pnpm 9 and 10 keep in the store: a lockfile
|
|
80
|
+
// may leave out a libc a registry package's package.json has. One it names is
|
|
81
|
+
// held to it, as a directory's always is: pnpm reads that package.json whole.
|
|
82
|
+
export function checkManifest(manifest, pkg, where, major, registry = false) {
|
|
78
83
|
for (const field of ['os', 'cpu', 'libc']) {
|
|
84
|
+
if (registry && field === 'libc' && pkg.libc === undefined) continue
|
|
79
85
|
if (!same(manifest[field], pkg[field])) throw new DeptreeError(`package.json's ${field} is not the lockfile's`, where)
|
|
80
86
|
}
|
|
81
87
|
const has = hasBin(manifest, major)
|
|
@@ -118,6 +124,6 @@ export async function fetchPackage(pkg, where, major, fetching) {
|
|
|
118
124
|
const { entries, about } = await fetchTarball(pkg.name, pkg.version, pkg.resolution.integrity, where, fetching)
|
|
119
125
|
const files = filesOf(entries, where)
|
|
120
126
|
const manifest = readManifest(files, pkg, where)
|
|
121
|
-
checkManifest(manifest, pkg, where, major)
|
|
127
|
+
checkManifest(manifest, pkg, where, major, true)
|
|
122
128
|
return { files, manifest, about }
|
|
123
129
|
}
|