npm-pkg-lint 4.0.0 → 4.0.2
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/README.md +7 -4
- package/dist/index.js +120 -83
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -71,10 +71,13 @@ This tool can be used directly with Github Actions:
|
|
|
71
71
|
> You need to have `npm-pkg-lint` installed as a dependency in `package.json`.
|
|
72
72
|
> This ensures you have control over which version of the tool is actually running.
|
|
73
73
|
|
|
74
|
-
| Input parameter | Default | Description
|
|
75
|
-
| -------------------- | --------- |
|
|
76
|
-
|
|
|
77
|
-
|
|
|
74
|
+
| Input parameter | Default | Description |
|
|
75
|
+
| -------------------- | --------- | ------------------------------------------------------------------------------------------ |
|
|
76
|
+
| allow-dependencies | `-` | Comma-separated list of dependencies to explicitly allow even if they would yield an error |
|
|
77
|
+
| build | `"build"` | Build command (executed with `npm run`). Set to `false` to disable build. |
|
|
78
|
+
| folders | `"."` | Space-separated list of folder to run in. |
|
|
79
|
+
| ignore-node-version | - | Ignore error for outdated node version (see --ignore-node-version CLI argument) |
|
|
80
|
+
| npm-pack | `true` | When enabled `npm pack` is run automatically |
|
|
78
81
|
|
|
79
82
|
## Disallowed files
|
|
80
83
|
|
package/dist/index.js
CHANGED
|
@@ -3229,33 +3229,31 @@ var require_tmp = __commonJS({
|
|
|
3229
3229
|
}
|
|
3230
3230
|
function tmpName(options, callback) {
|
|
3231
3231
|
const args = _parseArguments(options, callback), opts = args[0], cb = args[1];
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
cb(
|
|
3247
|
-
}
|
|
3248
|
-
}
|
|
3249
|
-
|
|
3250
|
-
}
|
|
3251
|
-
})();
|
|
3232
|
+
_assertAndSanitizeOptions(opts, function(err, sanitizedOptions) {
|
|
3233
|
+
if (err) return cb(err);
|
|
3234
|
+
let tries = sanitizedOptions.tries;
|
|
3235
|
+
(function _getUniqueName() {
|
|
3236
|
+
try {
|
|
3237
|
+
const name2 = _generateTmpName(sanitizedOptions);
|
|
3238
|
+
fs16.stat(name2, function(err2) {
|
|
3239
|
+
if (!err2) {
|
|
3240
|
+
if (tries-- > 0) return _getUniqueName();
|
|
3241
|
+
return cb(new Error("Could not get a unique tmp filename, max tries reached " + name2));
|
|
3242
|
+
}
|
|
3243
|
+
cb(null, name2);
|
|
3244
|
+
});
|
|
3245
|
+
} catch (err2) {
|
|
3246
|
+
cb(err2);
|
|
3247
|
+
}
|
|
3248
|
+
})();
|
|
3249
|
+
});
|
|
3252
3250
|
}
|
|
3253
3251
|
function tmpNameSync(options) {
|
|
3254
3252
|
const args = _parseArguments(options), opts = args[0];
|
|
3255
|
-
|
|
3256
|
-
let tries =
|
|
3253
|
+
const sanitizedOptions = _assertAndSanitizeOptionsSync(opts);
|
|
3254
|
+
let tries = sanitizedOptions.tries;
|
|
3257
3255
|
do {
|
|
3258
|
-
const name2 = _generateTmpName(
|
|
3256
|
+
const name2 = _generateTmpName(sanitizedOptions);
|
|
3259
3257
|
try {
|
|
3260
3258
|
fs16.statSync(name2);
|
|
3261
3259
|
} catch (e) {
|
|
@@ -3285,7 +3283,7 @@ var require_tmp = __commonJS({
|
|
|
3285
3283
|
const args = _parseArguments(options), opts = args[0];
|
|
3286
3284
|
const discardOrDetachDescriptor = opts.discardDescriptor || opts.detachDescriptor;
|
|
3287
3285
|
const name2 = tmpNameSync(opts);
|
|
3288
|
-
|
|
3286
|
+
let fd = fs16.openSync(name2, CREATE_FLAGS, opts.mode || FILE_MODE);
|
|
3289
3287
|
if (opts.discardDescriptor) {
|
|
3290
3288
|
fs16.closeSync(fd);
|
|
3291
3289
|
fd = void 0;
|
|
@@ -3392,14 +3390,11 @@ var require_tmp = __commonJS({
|
|
|
3392
3390
|
} catch (e) {
|
|
3393
3391
|
rnd = crypto2.pseudoRandomBytes(howMany);
|
|
3394
3392
|
}
|
|
3395
|
-
for (
|
|
3393
|
+
for (let i = 0; i < howMany; i++) {
|
|
3396
3394
|
value.push(RANDOM_CHARS[rnd[i] % RANDOM_CHARS.length]);
|
|
3397
3395
|
}
|
|
3398
3396
|
return value.join("");
|
|
3399
3397
|
}
|
|
3400
|
-
function _isBlank(s) {
|
|
3401
|
-
return s === null || _isUndefined(s) || !s.trim();
|
|
3402
|
-
}
|
|
3403
3398
|
function _isUndefined(obj) {
|
|
3404
3399
|
return typeof obj === "undefined";
|
|
3405
3400
|
}
|
|
@@ -3416,12 +3411,37 @@ var require_tmp = __commonJS({
|
|
|
3416
3411
|
}
|
|
3417
3412
|
return [actualOptions, callback];
|
|
3418
3413
|
}
|
|
3414
|
+
function _resolvePath(name2, tmpDir, cb) {
|
|
3415
|
+
const pathToResolve = path15.isAbsolute(name2) ? name2 : path15.join(tmpDir, name2);
|
|
3416
|
+
fs16.stat(pathToResolve, function(err) {
|
|
3417
|
+
if (err) {
|
|
3418
|
+
fs16.realpath(path15.dirname(pathToResolve), function(err2, parentDir) {
|
|
3419
|
+
if (err2) return cb(err2);
|
|
3420
|
+
cb(null, path15.join(parentDir, path15.basename(pathToResolve)));
|
|
3421
|
+
});
|
|
3422
|
+
} else {
|
|
3423
|
+
fs16.realpath(path15, cb);
|
|
3424
|
+
}
|
|
3425
|
+
});
|
|
3426
|
+
}
|
|
3427
|
+
function _resolvePathSync(name2, tmpDir) {
|
|
3428
|
+
const pathToResolve = path15.isAbsolute(name2) ? name2 : path15.join(tmpDir, name2);
|
|
3429
|
+
try {
|
|
3430
|
+
fs16.statSync(pathToResolve);
|
|
3431
|
+
return fs16.realpathSync(pathToResolve);
|
|
3432
|
+
} catch (_err) {
|
|
3433
|
+
const parentDir = fs16.realpathSync(path15.dirname(pathToResolve));
|
|
3434
|
+
return path15.join(parentDir, path15.basename(pathToResolve));
|
|
3435
|
+
}
|
|
3436
|
+
}
|
|
3419
3437
|
function _generateTmpName(opts) {
|
|
3420
3438
|
const tmpDir = opts.tmpdir;
|
|
3421
|
-
if (!_isUndefined(opts.name))
|
|
3439
|
+
if (!_isUndefined(opts.name)) {
|
|
3422
3440
|
return path15.join(tmpDir, opts.dir, opts.name);
|
|
3423
|
-
|
|
3441
|
+
}
|
|
3442
|
+
if (!_isUndefined(opts.template)) {
|
|
3424
3443
|
return path15.join(tmpDir, opts.dir, opts.template).replace(TEMPLATE_PATTERN, _randomChars(6));
|
|
3444
|
+
}
|
|
3425
3445
|
const name2 = [
|
|
3426
3446
|
opts.prefix ? opts.prefix : "tmp",
|
|
3427
3447
|
"-",
|
|
@@ -3432,54 +3452,75 @@ var require_tmp = __commonJS({
|
|
|
3432
3452
|
].join("");
|
|
3433
3453
|
return path15.join(tmpDir, opts.dir, name2);
|
|
3434
3454
|
}
|
|
3435
|
-
function
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
if (!_isUndefined(options.tries) && isNaN(options.tries) || options.tries < 0)
|
|
3455
|
+
function _assertOptionsBase(options) {
|
|
3456
|
+
if (!_isUndefined(options.name)) {
|
|
3457
|
+
const name2 = options.name;
|
|
3458
|
+
if (path15.isAbsolute(name2)) throw new Error(`name option must not contain an absolute path, found "${name2}".`);
|
|
3459
|
+
const basename2 = path15.basename(name2);
|
|
3460
|
+
if (basename2 === ".." || basename2 === "." || basename2 !== name2)
|
|
3461
|
+
throw new Error(`name option must not contain a path, found "${name2}".`);
|
|
3462
|
+
}
|
|
3463
|
+
if (!_isUndefined(options.template) && !options.template.match(TEMPLATE_PATTERN)) {
|
|
3464
|
+
throw new Error(`Invalid template, found "${options.template}".`);
|
|
3465
|
+
}
|
|
3466
|
+
if (!_isUndefined(options.tries) && isNaN(options.tries) || options.tries < 0) {
|
|
3448
3467
|
throw new Error(`Invalid tries, found "${options.tries}".`);
|
|
3468
|
+
}
|
|
3449
3469
|
options.tries = _isUndefined(options.name) ? options.tries || DEFAULT_TRIES : 1;
|
|
3450
3470
|
options.keep = !!options.keep;
|
|
3451
3471
|
options.detachDescriptor = !!options.detachDescriptor;
|
|
3452
3472
|
options.discardDescriptor = !!options.discardDescriptor;
|
|
3453
3473
|
options.unsafeCleanup = !!options.unsafeCleanup;
|
|
3454
|
-
options.dir = _isUndefined(options.dir) ? "" : path15.relative(tmpDir, _resolvePath(options.dir, tmpDir));
|
|
3455
|
-
options.template = _isUndefined(options.template) ? void 0 : path15.relative(tmpDir, _resolvePath(options.template, tmpDir));
|
|
3456
|
-
options.template = _isBlank(options.template) ? void 0 : path15.relative(options.dir, options.template);
|
|
3457
|
-
options.name = _isUndefined(options.name) ? void 0 : options.name;
|
|
3458
3474
|
options.prefix = _isUndefined(options.prefix) ? "" : options.prefix;
|
|
3459
3475
|
options.postfix = _isUndefined(options.postfix) ? "" : options.postfix;
|
|
3460
3476
|
}
|
|
3461
|
-
function
|
|
3462
|
-
if (name2
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3477
|
+
function _getRelativePath(option, name2, tmpDir, cb) {
|
|
3478
|
+
if (_isUndefined(name2)) return cb(null);
|
|
3479
|
+
_resolvePath(name2, tmpDir, function(err, resolvedPath) {
|
|
3480
|
+
if (err) return cb(err);
|
|
3481
|
+
const relativePath = path15.relative(tmpDir, resolvedPath);
|
|
3482
|
+
if (!resolvedPath.startsWith(tmpDir)) {
|
|
3483
|
+
return cb(new Error(`${option} option must be relative to "${tmpDir}", found "${relativePath}".`));
|
|
3484
|
+
}
|
|
3485
|
+
cb(null, relativePath);
|
|
3486
|
+
});
|
|
3487
|
+
}
|
|
3488
|
+
function _getRelativePathSync(option, name2, tmpDir) {
|
|
3489
|
+
if (_isUndefined(name2)) return;
|
|
3490
|
+
const resolvedPath = _resolvePathSync(name2, tmpDir);
|
|
3491
|
+
const relativePath = path15.relative(tmpDir, resolvedPath);
|
|
3492
|
+
if (!resolvedPath.startsWith(tmpDir)) {
|
|
3493
|
+
throw new Error(`${option} option must be relative to "${tmpDir}", found "${relativePath}".`);
|
|
3466
3494
|
}
|
|
3495
|
+
return relativePath;
|
|
3467
3496
|
}
|
|
3468
|
-
function
|
|
3469
|
-
|
|
3470
|
-
if (
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
if (path15.isAbsolute(name2) && !name2.startsWith(tmpDir)) {
|
|
3477
|
-
throw new Error(`${option} option must be relative to "${tmpDir}", found "${name2}".`);
|
|
3497
|
+
function _assertAndSanitizeOptions(options, cb) {
|
|
3498
|
+
_getTmpDir(options, function(err, tmpDir) {
|
|
3499
|
+
if (err) return cb(err);
|
|
3500
|
+
options.tmpdir = tmpDir;
|
|
3501
|
+
try {
|
|
3502
|
+
_assertOptionsBase(options, tmpDir);
|
|
3503
|
+
} catch (err2) {
|
|
3504
|
+
return cb(err2);
|
|
3478
3505
|
}
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3506
|
+
_getRelativePath("dir", options.dir, tmpDir, function(err2, dir2) {
|
|
3507
|
+
if (err2) return cb(err2);
|
|
3508
|
+
options.dir = _isUndefined(dir2) ? "" : dir2;
|
|
3509
|
+
_getRelativePath("template", options.template, tmpDir, function(err3, template) {
|
|
3510
|
+
if (err3) return cb(err3);
|
|
3511
|
+
options.template = template;
|
|
3512
|
+
cb(null, options);
|
|
3513
|
+
});
|
|
3514
|
+
});
|
|
3515
|
+
});
|
|
3516
|
+
}
|
|
3517
|
+
function _assertAndSanitizeOptionsSync(options) {
|
|
3518
|
+
const tmpDir = options.tmpdir = _getTmpDirSync(options);
|
|
3519
|
+
_assertOptionsBase(options, tmpDir);
|
|
3520
|
+
const dir2 = _getRelativePathSync("dir", options.dir, tmpDir);
|
|
3521
|
+
options.dir = _isUndefined(dir2) ? "" : dir2;
|
|
3522
|
+
options.template = _getRelativePathSync("template", options.template, tmpDir);
|
|
3523
|
+
return options;
|
|
3483
3524
|
}
|
|
3484
3525
|
function _isEBADF(error) {
|
|
3485
3526
|
return _isExpectedError(error, -EBADF, "EBADF");
|
|
@@ -3493,15 +3534,18 @@ var require_tmp = __commonJS({
|
|
|
3493
3534
|
function setGracefulCleanup() {
|
|
3494
3535
|
_gracefulCleanup = true;
|
|
3495
3536
|
}
|
|
3496
|
-
function _getTmpDir(options) {
|
|
3497
|
-
return
|
|
3537
|
+
function _getTmpDir(options, cb) {
|
|
3538
|
+
return fs16.realpath(options && options.tmpdir || os2.tmpdir(), cb);
|
|
3539
|
+
}
|
|
3540
|
+
function _getTmpDirSync(options) {
|
|
3541
|
+
return fs16.realpathSync(options && options.tmpdir || os2.tmpdir());
|
|
3498
3542
|
}
|
|
3499
3543
|
process.addListener(EXIT, _garbageCollector);
|
|
3500
3544
|
Object.defineProperty(module.exports, "tmpdir", {
|
|
3501
3545
|
enumerable: true,
|
|
3502
3546
|
configurable: false,
|
|
3503
3547
|
get: function() {
|
|
3504
|
-
return
|
|
3548
|
+
return _getTmpDirSync();
|
|
3505
3549
|
}
|
|
3506
3550
|
});
|
|
3507
3551
|
module.exports.dir = dir;
|
|
@@ -7182,8 +7226,7 @@ var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__
|
|
|
7182
7226
|
var require_text_table = __commonJS2({
|
|
7183
7227
|
"node_modules/text-table/index.js"(exports, module) {
|
|
7184
7228
|
module.exports = function(rows_, opts) {
|
|
7185
|
-
if (!opts)
|
|
7186
|
-
opts = {};
|
|
7229
|
+
if (!opts) opts = {};
|
|
7187
7230
|
var hsep = opts.hsep === void 0 ? " " : opts.hsep;
|
|
7188
7231
|
var align = opts.align || [];
|
|
7189
7232
|
var stringLength = opts.stringLength || function(s) {
|
|
@@ -7192,8 +7235,7 @@ var require_text_table = __commonJS2({
|
|
|
7192
7235
|
var dotsizes = reduce(rows_, function(acc, row) {
|
|
7193
7236
|
forEach(row, function(c, ix) {
|
|
7194
7237
|
var n = dotindex(c);
|
|
7195
|
-
if (!acc[ix] || n > acc[ix])
|
|
7196
|
-
acc[ix] = n;
|
|
7238
|
+
if (!acc[ix] || n > acc[ix]) acc[ix] = n;
|
|
7197
7239
|
});
|
|
7198
7240
|
return acc;
|
|
7199
7241
|
}, []);
|
|
@@ -7204,15 +7246,13 @@ var require_text_table = __commonJS2({
|
|
|
7204
7246
|
var index = dotindex(c);
|
|
7205
7247
|
var size = dotsizes[ix] + (/\./.test(c) ? 1 : 2) - (stringLength(c) - index);
|
|
7206
7248
|
return c + Array(size).join(" ");
|
|
7207
|
-
} else
|
|
7208
|
-
return c;
|
|
7249
|
+
} else return c;
|
|
7209
7250
|
});
|
|
7210
7251
|
});
|
|
7211
7252
|
var sizes = reduce(rows, function(acc, row) {
|
|
7212
7253
|
forEach(row, function(c, ix) {
|
|
7213
7254
|
var n = stringLength(c);
|
|
7214
|
-
if (!acc[ix] || n > acc[ix])
|
|
7215
|
-
acc[ix] = n;
|
|
7255
|
+
if (!acc[ix] || n > acc[ix]) acc[ix] = n;
|
|
7216
7256
|
});
|
|
7217
7257
|
return acc;
|
|
7218
7258
|
}, []);
|
|
@@ -7235,8 +7275,7 @@ var require_text_table = __commonJS2({
|
|
|
7235
7275
|
return m ? m.index + 1 : c.length;
|
|
7236
7276
|
}
|
|
7237
7277
|
function reduce(xs, f, init2) {
|
|
7238
|
-
if (xs.reduce)
|
|
7239
|
-
return xs.reduce(f, init2);
|
|
7278
|
+
if (xs.reduce) return xs.reduce(f, init2);
|
|
7240
7279
|
var i = 0;
|
|
7241
7280
|
var acc = arguments.length >= 3 ? init2 : xs[i++];
|
|
7242
7281
|
for (; i < xs.length; i++) {
|
|
@@ -7245,15 +7284,13 @@ var require_text_table = __commonJS2({
|
|
|
7245
7284
|
return acc;
|
|
7246
7285
|
}
|
|
7247
7286
|
function forEach(xs, f) {
|
|
7248
|
-
if (xs.forEach)
|
|
7249
|
-
return xs.forEach(f);
|
|
7287
|
+
if (xs.forEach) return xs.forEach(f);
|
|
7250
7288
|
for (var i = 0; i < xs.length; i++) {
|
|
7251
7289
|
f.call(xs, xs[i], i);
|
|
7252
7290
|
}
|
|
7253
7291
|
}
|
|
7254
7292
|
function map(xs, f) {
|
|
7255
|
-
if (xs.map)
|
|
7256
|
-
return xs.map(f);
|
|
7293
|
+
if (xs.map) return xs.map(f);
|
|
7257
7294
|
var res = [];
|
|
7258
7295
|
for (var i = 0; i < xs.length; i++) {
|
|
7259
7296
|
res.push(f.call(xs, xs[i], i));
|