npm-pkg-lint 2.2.0 → 2.3.1
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/dist/index.js +14 -1
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -17716,6 +17716,10 @@ function getFilePath(key) {
|
|
|
17716
17716
|
const filename2 = `${hash.slice(0, 2)}/${hash.slice(2)}.json`;
|
|
17717
17717
|
return path5.join(cacheDir, filename2);
|
|
17718
17718
|
}
|
|
17719
|
+
async function setCacheDirecory(directory2) {
|
|
17720
|
+
await fs3.mkdir(directory2, { recursive: true });
|
|
17721
|
+
cacheDir = directory2;
|
|
17722
|
+
}
|
|
17719
17723
|
async function persistentCacheGet(key) {
|
|
17720
17724
|
if (!enabled) {
|
|
17721
17725
|
return null;
|
|
@@ -17804,7 +17808,12 @@ async function* getDeepDependencies(pkg, dependency) {
|
|
|
17804
17808
|
if (!pkgData) {
|
|
17805
17809
|
return;
|
|
17806
17810
|
}
|
|
17807
|
-
for (
|
|
17811
|
+
for (let [key, value] of Object.entries(pkgData.dependencies ?? {})) {
|
|
17812
|
+
if (value.startsWith("npm:")) {
|
|
17813
|
+
const [newKey, newVersion] = value.slice("npm:".length).split("@", 2);
|
|
17814
|
+
key = newKey;
|
|
17815
|
+
value = newVersion;
|
|
17816
|
+
}
|
|
17808
17817
|
if (key === "@types/node") {
|
|
17809
17818
|
continue;
|
|
17810
17819
|
}
|
|
@@ -18093,6 +18102,7 @@ async function run() {
|
|
|
18093
18102
|
parser.add_argument("-v", "--version", { action: "version", version });
|
|
18094
18103
|
parser.add_argument("-t", "--tarball", { help: "specify tarball location" });
|
|
18095
18104
|
parser.add_argument("-p", "--pkgfile", { help: "specify package.json location" });
|
|
18105
|
+
parser.add_argument("--cache", { help: "specify cache directory" });
|
|
18096
18106
|
parser.add_argument("--allow-types-dependencies", {
|
|
18097
18107
|
action: "store_true",
|
|
18098
18108
|
help: "allow dependencies to `@types/*`"
|
|
@@ -18102,6 +18112,9 @@ async function run() {
|
|
|
18102
18112
|
help: "ignore errors for missing fields (but still checks for empty and valid)"
|
|
18103
18113
|
});
|
|
18104
18114
|
const args = parser.parse_args();
|
|
18115
|
+
if (args.cache) {
|
|
18116
|
+
await setCacheDirecory(args.cache);
|
|
18117
|
+
}
|
|
18105
18118
|
let regenerateReportName = false;
|
|
18106
18119
|
if (args.tarball === "-") {
|
|
18107
18120
|
args.tarball = await preloadStdin();
|