@modernpoacher/deps 2.0.3 → 2.0.4
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 +104 -2
- package/bin/execute/app.mjs +1 -1
- package/bin/install/app.mjs +1 -1
- package/package.json +9 -2
- package/src/common/git/index.mjs +2 -1
- package/src/common/index.mjs +2 -1
- package/src/index.mjs +2 -1
- package/src/install/index.mjs +2 -5
- package/where-am-i.mjs +1 -1
package/README.md
CHANGED
|
@@ -32,7 +32,8 @@ When installed locally, or not installed, use `npx`:
|
|
|
32
32
|
```sh
|
|
33
33
|
npx @modernpoacher/deps
|
|
34
34
|
```
|
|
35
|
-
|
|
35
|
+
|
|
36
|
+
Alternatively, use `npm` with a script target in your project's `package.json`:
|
|
36
37
|
|
|
37
38
|
```json
|
|
38
39
|
{
|
|
@@ -41,10 +42,13 @@ Or when installed locally, use `npm` with script targets in `package.json`:
|
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
44
|
```
|
|
45
|
+
|
|
44
46
|
Then:
|
|
47
|
+
|
|
45
48
|
```sh
|
|
46
49
|
npm run deps
|
|
47
50
|
```
|
|
51
|
+
|
|
48
52
|
### Updating only production dependencies
|
|
49
53
|
|
|
50
54
|
To update only _production_ dependencies (on the `dependencies` field):
|
|
@@ -102,6 +106,26 @@ It should contain *JSON* and be structured as `package.json`:
|
|
|
102
106
|
}
|
|
103
107
|
```
|
|
104
108
|
|
|
109
|
+
### Author
|
|
110
|
+
|
|
111
|
+
Add an `author` field to `.depsrc`:
|
|
112
|
+
|
|
113
|
+
```json
|
|
114
|
+
{
|
|
115
|
+
"author": "Jonathan Perry <jonathanperry@modernpoacher.com>"
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Ignore
|
|
120
|
+
|
|
121
|
+
Instruct *Deps* not to execute with an `ignore` field in `.depsrc`:
|
|
122
|
+
|
|
123
|
+
```json
|
|
124
|
+
{
|
|
125
|
+
"ignore": true
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
105
129
|
Without a `.depsrc` configuration file, whenever *Deps* encounters an _exact_ version, it will assume that _an exact version should not be updated_.
|
|
106
130
|
|
|
107
131
|
The `.depsrc` configuration file enables this behaviour to be changed.
|
|
@@ -128,4 +152,82 @@ Again, with the `.depsrc` configuration file as the example above:
|
|
|
128
152
|
|
|
129
153
|
- If `package.json` defines `gulp` at version `4.0.2` then *Deps* will update to the latest version
|
|
130
154
|
|
|
131
|
-
|
|
155
|
+
## *Deps* with the shell
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
deps \
|
|
159
|
+
--save-prod \ # Boolean
|
|
160
|
+
--save-dev \ # Boolean
|
|
161
|
+
--save-optional \ # Boolean
|
|
162
|
+
--save-bundle \ # Boolean
|
|
163
|
+
--registry '<REGISTRY>' \
|
|
164
|
+
--force # Boolean
|
|
165
|
+
|
|
166
|
+
deps-execute \
|
|
167
|
+
--path '<PATH>' \
|
|
168
|
+
--from '<FROM>' \
|
|
169
|
+
--only '<ONLY>' \
|
|
170
|
+
--registry '<REGISTRY>' \
|
|
171
|
+
--force \ # Boolean
|
|
172
|
+
--message '<MESSAGE>' \
|
|
173
|
+
--author '<AUTHOR>'
|
|
174
|
+
|
|
175
|
+
deps-install \
|
|
176
|
+
--prod \ # Boolean
|
|
177
|
+
--dev \ # Boolean
|
|
178
|
+
--optional \ # Boolean
|
|
179
|
+
--bundle \ # Boolean
|
|
180
|
+
--peer \ # Boolean
|
|
181
|
+
--save \ # Boolean
|
|
182
|
+
'--registry '<REGISTRY>' \
|
|
183
|
+
--force # Boolean
|
|
184
|
+
|
|
185
|
+
deps-deps \
|
|
186
|
+
--path=. \
|
|
187
|
+
--from=. \
|
|
188
|
+
--only=.
|
|
189
|
+
|
|
190
|
+
deps-wipe --path=.
|
|
191
|
+
deps-push --path=.
|
|
192
|
+
deps-head --path=.
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
## *Deps* with its own script targets
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
npm run deps -- \
|
|
199
|
+
--save-prod \ # Boolean
|
|
200
|
+
--save-dev \ # Boolean
|
|
201
|
+
--save-optional \ # Boolean
|
|
202
|
+
--save-bundle \ # Boolean
|
|
203
|
+
--registry '<REGISTRY>' \
|
|
204
|
+
--force # Boolean
|
|
205
|
+
|
|
206
|
+
npm run deps-execute -- \
|
|
207
|
+
--path '<PATH>' \
|
|
208
|
+
--from '<FROM>' \
|
|
209
|
+
--only '<ONLY>' \
|
|
210
|
+
--registry '<REGISTRY>' \
|
|
211
|
+
--force \ # Boolean
|
|
212
|
+
--message '<MESSAGE>' \
|
|
213
|
+
--author '<AUTHOR>'
|
|
214
|
+
|
|
215
|
+
npm run deps-install -- \
|
|
216
|
+
--prod \ # Boolean
|
|
217
|
+
--dev \ # Boolean
|
|
218
|
+
--optional \ # Boolean
|
|
219
|
+
--bundle \ # Boolean
|
|
220
|
+
--peer \ # Boolean
|
|
221
|
+
--save \ # Boolean
|
|
222
|
+
'--registry '<REGISTRY>' \
|
|
223
|
+
--force # Boolean
|
|
224
|
+
|
|
225
|
+
npm run deps-deps -- \
|
|
226
|
+
--path=. \
|
|
227
|
+
--from=. \
|
|
228
|
+
--only=.
|
|
229
|
+
|
|
230
|
+
npm run deps-wipe -- --path=.
|
|
231
|
+
npm run deps-push -- --path=.
|
|
232
|
+
npm run deps-head -- --path=.
|
|
233
|
+
```
|
package/bin/execute/app.mjs
CHANGED
|
@@ -281,7 +281,7 @@ async function app () {
|
|
|
281
281
|
.option('-o, --only [only]', 'Update only directory')
|
|
282
282
|
.option('--registry [registry]', 'Installation registry')
|
|
283
283
|
.option('--force [force]', 'Force installation`', false)
|
|
284
|
-
.option('-m, --message [
|
|
284
|
+
.option('-m, --message [message]', 'Git commit message')
|
|
285
285
|
.option('-a, --author [author]', 'Git commit author')
|
|
286
286
|
.parse(argv)
|
|
287
287
|
|
package/bin/install/app.mjs
CHANGED
|
@@ -62,7 +62,7 @@ async function app () {
|
|
|
62
62
|
.option('-O, --optional [optionalDependencies]', 'Install `optionalDependencies`', false)
|
|
63
63
|
.option('-B, --bundle [bundleDependencies]', 'Install `bundleDependencies`', false)
|
|
64
64
|
.option('-p, --peer [peerDependencies]', 'Install `peerDependencies`', false)
|
|
65
|
-
.option('-s, --save [save]', '
|
|
65
|
+
.option('-s, --save [save]', 'Save installed dependencies', false)
|
|
66
66
|
.option('--registry [registry]', 'Installation registry')
|
|
67
67
|
.option('--force [force]', 'Force installation`', false)
|
|
68
68
|
.parse(argv)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modernpoacher/deps",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"description": "Update NPM package dependencies from the command line",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"deps",
|
|
@@ -32,7 +32,14 @@
|
|
|
32
32
|
"lint": "eslint . --ext .cjs --ext .mjs",
|
|
33
33
|
"lint:fix": "npm run lint -- --fix",
|
|
34
34
|
"test": "cross-env DEBUG_COLORS=yes NODE_ENV=test mocha test --recursive -r @babel/register --verbose --color",
|
|
35
|
-
"pre-commit": "npm run lint && npm run test"
|
|
35
|
+
"pre-commit": "npm run lint && npm run test",
|
|
36
|
+
"deps": "cross-env DEBUG_COLORS=yes NODE_ENV=production node bin/app.mjs",
|
|
37
|
+
"deps-execute": "cross-env DEBUG_COLORS=yes NODE_ENV=production node bin/execute/app.mjs",
|
|
38
|
+
"deps-install": "cross-env DEBUG_COLORS=yes NODE_ENV=production node bin/install/app.mjs",
|
|
39
|
+
"deps-deps": "cross-env DEBUG_COLORS=yes NODE_ENV=production bash bin/deps.sh",
|
|
40
|
+
"deps-wipe": "cross-env DEBUG_COLORS=yes NODE_ENV=production bash bin/wipe.sh",
|
|
41
|
+
"deps-push": "cross-env DEBUG_COLORS=yes NODE_ENV=production bash bin/push.sh",
|
|
42
|
+
"deps-head": "cross-env DEBUG_COLORS=yes NODE_ENV=production bash bin/head.sh"
|
|
36
43
|
},
|
|
37
44
|
"bin": {
|
|
38
45
|
"deps": "bin/app.mjs",
|
package/src/common/git/index.mjs
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
} from 'child_process'
|
|
10
10
|
|
|
11
11
|
import {
|
|
12
|
+
VERSION,
|
|
12
13
|
PLATFORM
|
|
13
14
|
} from '#deps/src/common/env'
|
|
14
15
|
|
|
@@ -38,7 +39,7 @@ const OPTIONS = {
|
|
|
38
39
|
|
|
39
40
|
const log = debug('@modernpoacher/deps')
|
|
40
41
|
|
|
41
|
-
log(`\`git\` (${PLATFORM}) is awake`)
|
|
42
|
+
log(`\`git\` (${VERSION} - ${PLATFORM}) is awake`)
|
|
42
43
|
|
|
43
44
|
const trim = (v) => v.split('\n').map((v) => v.trimEnd()).join('\n').trim()
|
|
44
45
|
|
package/src/common/index.mjs
CHANGED
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
} from 'path'
|
|
8
8
|
|
|
9
9
|
import {
|
|
10
|
+
VERSION,
|
|
10
11
|
PLATFORM
|
|
11
12
|
} from '#deps/src/common/env'
|
|
12
13
|
|
|
@@ -20,7 +21,7 @@ export const NVM = resolve(PATH, 'nvm.sh')
|
|
|
20
21
|
|
|
21
22
|
const log = debug('@modernpoacher/deps')
|
|
22
23
|
|
|
23
|
-
log(`\`common\` (${PLATFORM}) is awake`)
|
|
24
|
+
log(`\`common\` (${VERSION} - ${PLATFORM}) is awake`)
|
|
24
25
|
|
|
25
26
|
const tidy = (v) => v.replace(/\n\n/gm, String.fromCharCode(10)).trim()
|
|
26
27
|
|
package/src/index.mjs
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
} from 'child_process'
|
|
10
10
|
|
|
11
11
|
import {
|
|
12
|
+
VERSION,
|
|
12
13
|
PLATFORM
|
|
13
14
|
} from '#deps/src/common/env'
|
|
14
15
|
|
|
@@ -31,7 +32,7 @@ import {
|
|
|
31
32
|
|
|
32
33
|
const log = debug('@modernpoacher/deps')
|
|
33
34
|
|
|
34
|
-
log(`\`deps\` (${PLATFORM}) is awake`)
|
|
35
|
+
log(`\`deps\` (${VERSION} - ${PLATFORM}) is awake`)
|
|
35
36
|
|
|
36
37
|
const OPTIONS = {
|
|
37
38
|
maxBuffer: 1024 * 2000,
|
package/src/install/index.mjs
CHANGED
|
@@ -4,15 +4,12 @@ import {
|
|
|
4
4
|
normalize
|
|
5
5
|
} from 'path'
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
platform
|
|
9
|
-
} from 'os'
|
|
10
|
-
|
|
11
7
|
import {
|
|
12
8
|
exec
|
|
13
9
|
} from 'child_process'
|
|
14
10
|
|
|
15
11
|
import {
|
|
12
|
+
VERSION,
|
|
16
13
|
PLATFORM
|
|
17
14
|
} from '#deps/src/common/env'
|
|
18
15
|
|
|
@@ -32,7 +29,7 @@ import {
|
|
|
32
29
|
|
|
33
30
|
const log = debug('@modernpoacher/deps:install')
|
|
34
31
|
|
|
35
|
-
log(`\`install\` (${
|
|
32
|
+
log(`\`install\` (${VERSION} - ${PLATFORM}) is awake`)
|
|
36
33
|
|
|
37
34
|
const OPTIONS = {
|
|
38
35
|
maxBuffer: 1024 * 2000,
|