untracked 1.4.5 → 1.4.9
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/package.json +8 -14
- package/src/getProductionDeps.js +1 -1
- package/src/load-config.js +19 -3
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "untracked",
|
|
3
3
|
"description": "Universal way for ignoring unnecessary common files to fit your bundle",
|
|
4
4
|
"homepage": "https://nicedoc.io/Kikobeats/untracked",
|
|
5
|
-
"version": "1.4.
|
|
5
|
+
"version": "1.4.9",
|
|
6
6
|
"main": "src/index.js",
|
|
7
7
|
"bin": {
|
|
8
8
|
"untracked": "bin/index.js"
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"webpack"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"
|
|
38
|
+
"joycon": "~3.1.1",
|
|
39
39
|
"lodash": "~4.17.21",
|
|
40
40
|
"meow": "~9.0.0",
|
|
41
41
|
"update-notifier": "~5.1.0"
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"conventional-github-releaser": "latest",
|
|
48
48
|
"finepack": "latest",
|
|
49
49
|
"git-authors-cli": "latest",
|
|
50
|
-
"
|
|
50
|
+
"nano-staged": "latest",
|
|
51
51
|
"npm-check-updates": "latest",
|
|
52
52
|
"prettier-standard": "latest",
|
|
53
53
|
"simple-git-hooks": "latest",
|
|
@@ -85,25 +85,19 @@
|
|
|
85
85
|
"@commitlint/config-conventional"
|
|
86
86
|
]
|
|
87
87
|
},
|
|
88
|
-
"
|
|
89
|
-
"hooks": {
|
|
90
|
-
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
|
|
91
|
-
"pre-commit": "lint-staged"
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
"lint-staged": {
|
|
95
|
-
"package.json": [
|
|
96
|
-
"finepack"
|
|
97
|
-
],
|
|
88
|
+
"nano-staged": {
|
|
98
89
|
"*.js,!*.min.js,": [
|
|
99
90
|
"prettier-standard"
|
|
100
91
|
],
|
|
101
92
|
"*.md": [
|
|
102
93
|
"standard-markdown"
|
|
94
|
+
],
|
|
95
|
+
"package.json": [
|
|
96
|
+
"finepack"
|
|
103
97
|
]
|
|
104
98
|
},
|
|
105
99
|
"simple-git-hooks": {
|
|
106
100
|
"commit-msg": "npx commitlint --edit",
|
|
107
|
-
"pre-commit": "npx
|
|
101
|
+
"pre-commit": "npx nano-staged"
|
|
108
102
|
}
|
|
109
103
|
}
|
package/src/getProductionDeps.js
CHANGED
|
@@ -16,7 +16,7 @@ const flattenDeps = (pkg, acc) => {
|
|
|
16
16
|
const readProductionDeps = () => {
|
|
17
17
|
let output
|
|
18
18
|
try {
|
|
19
|
-
output = execSync('npm ls --prod --json 2>/dev/null')
|
|
19
|
+
output = execSync('npm ls --prod --all --json 2>/dev/null')
|
|
20
20
|
} catch (err) {
|
|
21
21
|
output = err.stdout
|
|
22
22
|
}
|
package/src/load-config.js
CHANGED
|
@@ -1,20 +1,36 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
const config = require('cosmiconfig').cosmiconfig('untracked')
|
|
4
3
|
const { get } = require('lodash')
|
|
4
|
+
const JoyCon = require('joycon')
|
|
5
5
|
|
|
6
6
|
const DEFAULT = {
|
|
7
7
|
blacklist: require('./default/blacklist')
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
const loadConfig = async cwd => {
|
|
11
|
+
const joycon = new JoyCon({
|
|
12
|
+
cwd,
|
|
13
|
+
packageKey: 'untracked',
|
|
14
|
+
files: [
|
|
15
|
+
'package.json',
|
|
16
|
+
'.untrackedrc',
|
|
17
|
+
'.untrackedrc.json',
|
|
18
|
+
'.untrackedrc.js',
|
|
19
|
+
'untracked.config.js'
|
|
20
|
+
]
|
|
21
|
+
})
|
|
22
|
+
const { data: configFile } = await joycon.load()
|
|
23
|
+
return configFile
|
|
24
|
+
}
|
|
25
|
+
|
|
10
26
|
const createCollection = (configFile, propName) => {
|
|
11
|
-
const collection = new Set(get(configFile,
|
|
27
|
+
const collection = new Set(get(configFile, propName, []))
|
|
12
28
|
DEFAULT[propName] && DEFAULT[propName].forEach(item => collection.add(item))
|
|
13
29
|
return Array.from(collection)
|
|
14
30
|
}
|
|
15
31
|
|
|
16
32
|
module.exports = async ({ cwd = process.cwd() }) => {
|
|
17
|
-
const configFile = await
|
|
33
|
+
const configFile = await loadConfig(cwd)
|
|
18
34
|
|
|
19
35
|
return {
|
|
20
36
|
whitelist: createCollection(configFile, 'whitelist'),
|