npq 3.8.1 → 3.9.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/.github/npq.mov +0 -0
- package/.github/npq.mp4 +0 -0
- package/.github/npq.png +0 -0
- package/.github/workflows/main.yml +2 -2
- package/README.md +18 -9
- package/__tests__/__fixtures__/test.marshall.js +5 -6
- package/__tests__/cli.test.js +110 -0
- package/__tests__/cliPrompt.test.js +409 -0
- package/__tests__/marshalls.base.test.js +1 -1
- package/__tests__/marshalls.classMethods.test.js +11 -14
- package/__tests__/marshalls.expiredDomains.test.js +2 -2
- package/__tests__/marshalls.provenance.test.js +181 -4
- package/__tests__/marshalls.signatures.test.js +0 -4
- package/__tests__/marshalls.snyk.test.js +294 -0
- package/__tests__/marshalls.tasks.test.js +48 -24
- package/__tests__/marshalls.typosquatting.test.js +16 -9
- package/__tests__/reportResults.test.js +772 -0
- package/__tests__/scripts.test.js +2 -2
- package/bin/npq-hero.js +73 -20
- package/bin/npq.js +113 -21
- package/lib/cli.js +140 -24
- package/lib/helpers/cliPrompt.js +97 -0
- package/lib/helpers/cliSpinner.js +104 -0
- package/lib/helpers/cliSupportHandler.js +50 -7
- package/lib/helpers/packageRepoUtils.js +5 -0
- package/lib/helpers/promiseThrottler.js +96 -0
- package/lib/helpers/reportResults.js +304 -0
- package/lib/helpers/sourcePackages.js +36 -0
- package/lib/marshall.js +42 -65
- package/lib/marshalls/age.marshall.js +3 -2
- package/lib/marshalls/author.marshall.js +36 -7
- package/lib/marshalls/baseMarshall.js +9 -17
- package/lib/marshalls/deprecation.marshall.js +43 -0
- package/lib/marshalls/downloads.marshall.js +1 -1
- package/lib/marshalls/expiredDomains.marshall.js +7 -5
- package/lib/marshalls/index.js +110 -80
- package/lib/marshalls/license.marshall.js +1 -1
- package/lib/marshalls/newbin.marshall.js +1 -2
- package/lib/marshalls/provenance.marshall.js +152 -33
- package/lib/marshalls/repo.marshall.js +6 -5
- package/lib/marshalls/scripts.marshall.js +1 -1
- package/lib/marshalls/signatures.marshall.js +26 -2
- package/lib/marshalls/snyk.marshall.js +61 -15
- package/lib/marshalls/typosquatting.marshall.js +8 -5
- package/lib/marshalls/version-maturity.marshall.js +1 -1
- package/package.json +16 -19
- package/scripts/postinstall.js +10 -11
- package/lib/cliCommons.js +0 -80
package/lib/cliCommons.js
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
const npa = require('npm-package-arg')
|
|
2
|
-
class cliCommons {
|
|
3
|
-
static getInstallCommand() {
|
|
4
|
-
return {
|
|
5
|
-
command: 'install [package...]',
|
|
6
|
-
aliases: [
|
|
7
|
-
'i',
|
|
8
|
-
'add',
|
|
9
|
-
'isntall',
|
|
10
|
-
'in',
|
|
11
|
-
'ins',
|
|
12
|
-
'inst',
|
|
13
|
-
'insta',
|
|
14
|
-
'instal',
|
|
15
|
-
'isnt',
|
|
16
|
-
'isnta',
|
|
17
|
-
'isntal'
|
|
18
|
-
],
|
|
19
|
-
desc: 'install a package',
|
|
20
|
-
handler: (argv) => {
|
|
21
|
-
if (argv && argv.package) {
|
|
22
|
-
for (let i = 0; i < argv.package.length; i++) {
|
|
23
|
-
const parsedPackage = npa(argv.package[i])
|
|
24
|
-
const versionModifier =
|
|
25
|
-
parsedPackage.fetchSpec === '*' ? 'latest' : parsedPackage.fetchSpec
|
|
26
|
-
// eslint-disable-next-line security/detect-object-injection
|
|
27
|
-
argv.package[i] = `${parsedPackage.name}@${versionModifier}`
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
static getOptions() {
|
|
35
|
-
return {
|
|
36
|
-
S: {
|
|
37
|
-
alias: ['save', 'save-prod', 'save-optional', 'save-bundle'],
|
|
38
|
-
type: 'boolean'
|
|
39
|
-
},
|
|
40
|
-
g: {
|
|
41
|
-
alias: 'global',
|
|
42
|
-
type: 'boolean'
|
|
43
|
-
},
|
|
44
|
-
P: {
|
|
45
|
-
alias: ['save-prod', 'peer'],
|
|
46
|
-
type: 'boolean'
|
|
47
|
-
},
|
|
48
|
-
D: {
|
|
49
|
-
alias: ['save-dev', 'dev'],
|
|
50
|
-
type: 'boolean'
|
|
51
|
-
},
|
|
52
|
-
O: {
|
|
53
|
-
alias: ['save-optional', 'optional'],
|
|
54
|
-
type: 'boolean'
|
|
55
|
-
},
|
|
56
|
-
E: {
|
|
57
|
-
alias: ['save-exact', 'exact'],
|
|
58
|
-
type: 'boolean'
|
|
59
|
-
},
|
|
60
|
-
B: {
|
|
61
|
-
alias: 'save-bundle',
|
|
62
|
-
type: 'boolean'
|
|
63
|
-
},
|
|
64
|
-
T: {
|
|
65
|
-
alias: 'tilde',
|
|
66
|
-
type: 'boolean'
|
|
67
|
-
},
|
|
68
|
-
nosave: {
|
|
69
|
-
alias: 'no-save',
|
|
70
|
-
type: 'boolean'
|
|
71
|
-
},
|
|
72
|
-
'dry-run': {
|
|
73
|
-
alias: 'dry-run',
|
|
74
|
-
type: 'boolean'
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
module.exports = cliCommons
|