@modernpoacher/deps 2.2.19 → 2.2.21
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/bin/common/index.mjs +2 -2
- package/bin/deps.mjs +4 -3
- package/bin/node/execute.mjs +16 -16
- package/bin/node/install.mjs +4 -3
- package/eslint.config.mjs +17 -0
- package/package.json +20 -16
- package/src/common/debug.mjs +2 -0
- package/src/common/env/index.mjs +4 -4
- package/src/common/git/index.mjs +148 -85
- package/src/common/index.mjs +48 -67
- package/src/common/options/index.mjs +3 -2
- package/src/index.mjs +125 -70
- package/src/install/index.mjs +37 -18
package/bin/common/index.mjs
CHANGED
|
@@ -5,8 +5,6 @@
|
|
|
5
5
|
* @typedef {DepsTypes.Configuration} Configuration
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import debug from 'debug'
|
|
9
|
-
|
|
10
8
|
import stripAnsi from 'strip-ansi'
|
|
11
9
|
|
|
12
10
|
import {
|
|
@@ -32,6 +30,8 @@ import {
|
|
|
32
30
|
readFile
|
|
33
31
|
} from 'node:fs/promises'
|
|
34
32
|
|
|
33
|
+
import debug from '#deps/src/common/debug'
|
|
34
|
+
|
|
35
35
|
import {
|
|
36
36
|
VERSION,
|
|
37
37
|
PLATFORM,
|
package/bin/deps.mjs
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import debug from 'debug'
|
|
4
|
-
|
|
5
3
|
import {
|
|
6
4
|
Command
|
|
7
5
|
} from 'commander'
|
|
8
6
|
|
|
9
|
-
import '#deps/src/common/debug'
|
|
7
|
+
import debug from '#deps/src/common/debug'
|
|
10
8
|
|
|
11
9
|
import {
|
|
12
10
|
VERSION,
|
|
@@ -39,6 +37,9 @@ const log = debug('@modernpoacher/deps')
|
|
|
39
37
|
|
|
40
38
|
log(`\`deps\` (${VERSION} - ${PLATFORM}) is awake`)
|
|
41
39
|
|
|
40
|
+
/**
|
|
41
|
+
* @function app
|
|
42
|
+
*/
|
|
42
43
|
async function app () {
|
|
43
44
|
log('Deps')
|
|
44
45
|
|
package/bin/node/execute.mjs
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import debug from 'debug'
|
|
4
|
-
|
|
5
3
|
import {
|
|
6
4
|
resolve,
|
|
7
5
|
dirname
|
|
@@ -15,7 +13,7 @@ import {
|
|
|
15
13
|
Command
|
|
16
14
|
} from 'commander'
|
|
17
15
|
|
|
18
|
-
import '#deps/src/common/debug'
|
|
16
|
+
import debug from '#deps/src/common/debug'
|
|
19
17
|
|
|
20
18
|
import {
|
|
21
19
|
VERSION,
|
|
@@ -107,9 +105,8 @@ async function isHeadDefaultBranch (directory) {
|
|
|
107
105
|
|
|
108
106
|
/**
|
|
109
107
|
* @function getIgnoreFromConfiguration
|
|
110
|
-
*
|
|
108
|
+
* @description
|
|
111
109
|
* Interrogates `.depsrc` or `.depsrc.json` for an `ignore` value
|
|
112
|
-
*
|
|
113
110
|
* @param {string} directory
|
|
114
111
|
* @returns {Promise<boolean>}
|
|
115
112
|
*/
|
|
@@ -129,9 +126,8 @@ async function getIgnoreFromConfiguration (directory) {
|
|
|
129
126
|
|
|
130
127
|
/**
|
|
131
128
|
* @function getAuthorFromConfiguration
|
|
132
|
-
*
|
|
129
|
+
* @description
|
|
133
130
|
* Interrogates `.depsrc` or `.depsrc.json` for an `author` value
|
|
134
|
-
*
|
|
135
131
|
* @param {string} directory
|
|
136
132
|
* @returns {Promise<string | null>}
|
|
137
133
|
*/
|
|
@@ -151,9 +147,8 @@ async function getAuthorFromConfiguration (directory) {
|
|
|
151
147
|
|
|
152
148
|
/**
|
|
153
149
|
* @function getAuthorFromPackage
|
|
154
|
-
*
|
|
150
|
+
* @description
|
|
155
151
|
* Interrogates `package.json` for an `author` value
|
|
156
|
-
*
|
|
157
152
|
* @param {string} directory
|
|
158
153
|
* @returns {Promise<string | null>}
|
|
159
154
|
*/
|
|
@@ -173,9 +168,8 @@ async function getAuthorFromPackage (directory) {
|
|
|
173
168
|
|
|
174
169
|
/**
|
|
175
170
|
* @function getMessageFromConfiguration
|
|
176
|
-
*
|
|
171
|
+
* @description
|
|
177
172
|
* Interrogates `.depsrc` or `.depsrc.json` for a `message` value
|
|
178
|
-
*
|
|
179
173
|
* @param {string} directory
|
|
180
174
|
* @returns {Promise<string | null>}
|
|
181
175
|
*/
|
|
@@ -195,12 +189,11 @@ async function getMessageFromConfiguration (directory) {
|
|
|
195
189
|
|
|
196
190
|
/**
|
|
197
191
|
* @function toAuthor
|
|
198
|
-
*
|
|
192
|
+
* @description
|
|
199
193
|
* Ensures that the `author` is set either from the command line,
|
|
200
194
|
* configuration, package, or a default
|
|
201
195
|
*
|
|
202
196
|
* Since it can be null `author` may not default in function arguments
|
|
203
|
-
*
|
|
204
197
|
* @param {string | { name: string; email: string }} author
|
|
205
198
|
* @param {string} directory
|
|
206
199
|
* @returns {Promise<string | { name: string; email: string }>}
|
|
@@ -211,12 +204,11 @@ async function toAuthor (author, directory) {
|
|
|
211
204
|
|
|
212
205
|
/**
|
|
213
206
|
* @function toMessage
|
|
214
|
-
*
|
|
207
|
+
* @description
|
|
215
208
|
* Ensures that the `message` is set either from the command line,
|
|
216
209
|
* configuration, or a default
|
|
217
210
|
*
|
|
218
211
|
* Since it can be null `message` may not default in function arguments
|
|
219
|
-
*
|
|
220
212
|
* @param {string | null} message
|
|
221
213
|
* @param {string} directory
|
|
222
214
|
* @returns {Promise<string>}
|
|
@@ -240,6 +232,7 @@ const reduceDeps = (a, v = '') => a.includes(v) ? a : a.concat(v) // de-dupe
|
|
|
240
232
|
|
|
241
233
|
/**
|
|
242
234
|
* @param {string[]} directories
|
|
235
|
+
* @yields {string | undefined}
|
|
243
236
|
*/
|
|
244
237
|
function * genDirsList (directories = []) {
|
|
245
238
|
while (directories.length) yield directories.shift()
|
|
@@ -281,7 +274,6 @@ async function getDepsList (directories = []) {
|
|
|
281
274
|
try {
|
|
282
275
|
/**
|
|
283
276
|
* Recreate `directories` from `alpha`
|
|
284
|
-
*
|
|
285
277
|
* @type {Array<string | undefined>}
|
|
286
278
|
*/
|
|
287
279
|
const directories = (
|
|
@@ -331,6 +323,7 @@ async function mapRevParseShowTopLevel (directory) {
|
|
|
331
323
|
* @param {boolean} force
|
|
332
324
|
* @param {string} message
|
|
333
325
|
* @param {string | { name: string; email: string }} author
|
|
326
|
+
* @returns {Promise<void>}
|
|
334
327
|
*/
|
|
335
328
|
async function iterate (directory, registry, force, message, author) {
|
|
336
329
|
log('iterate')
|
|
@@ -385,6 +378,7 @@ async function iteratePath (directory, registry, force, message, author) {
|
|
|
385
378
|
* @param {boolean} force
|
|
386
379
|
* @param {string} message
|
|
387
380
|
* @param {string | { name: string; email: string }} author
|
|
381
|
+
* @returns {Promise<void>}
|
|
388
382
|
*/
|
|
389
383
|
async function execute (directory = DIRECTORY, registry = REGISTRY, force = false, message = MESSAGE, author = AUTHOR) {
|
|
390
384
|
log('execute')
|
|
@@ -415,6 +409,7 @@ async function execute (directory = DIRECTORY, registry = REGISTRY, force = fals
|
|
|
415
409
|
* @param {boolean} force
|
|
416
410
|
* @param {string} message
|
|
417
411
|
* @param {string | { name: string; email: string }} author
|
|
412
|
+
* @returns {Promise<void>}
|
|
418
413
|
*/
|
|
419
414
|
async function executeFrom (directory, registry, force, message, author) {
|
|
420
415
|
log('executeFrom')
|
|
@@ -446,6 +441,7 @@ async function executeFrom (directory, registry, force, message, author) {
|
|
|
446
441
|
* @param {boolean} force
|
|
447
442
|
* @param {string} message
|
|
448
443
|
* @param {string | { name: string; email: string }} author
|
|
444
|
+
* @returns {Promise<void>}
|
|
449
445
|
*/
|
|
450
446
|
async function executeOnly (directory, registry, force, message, author) {
|
|
451
447
|
log('executeOnly')
|
|
@@ -477,6 +473,7 @@ async function executeOnly (directory, registry, force, message, author) {
|
|
|
477
473
|
* @param {boolean} force
|
|
478
474
|
* @param {string} message
|
|
479
475
|
* @param {string | { name: string; email: string }} author
|
|
476
|
+
* @returns {Promise<void>}
|
|
480
477
|
*/
|
|
481
478
|
async function executePath (directory, registry, force, message, author) {
|
|
482
479
|
log('executePath')
|
|
@@ -512,6 +509,9 @@ async function executePath (directory, registry, force, message, author) {
|
|
|
512
509
|
}
|
|
513
510
|
}
|
|
514
511
|
|
|
512
|
+
/**
|
|
513
|
+
* @function app
|
|
514
|
+
*/
|
|
515
515
|
async function app () {
|
|
516
516
|
log('Deps')
|
|
517
517
|
|
package/bin/node/install.mjs
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import debug from 'debug'
|
|
4
|
-
|
|
5
3
|
import {
|
|
6
4
|
Command
|
|
7
5
|
} from 'commander'
|
|
8
6
|
|
|
9
|
-
import '#deps/src/common/debug'
|
|
7
|
+
import debug from '#deps/src/common/debug'
|
|
10
8
|
|
|
11
9
|
import {
|
|
12
10
|
VERSION,
|
|
@@ -37,6 +35,9 @@ const log = debug('@modernpoacher/deps')
|
|
|
37
35
|
|
|
38
36
|
log(`\`install\` (${VERSION} - ${PLATFORM}) is awake`)
|
|
39
37
|
|
|
38
|
+
/**
|
|
39
|
+
* @function app
|
|
40
|
+
*/
|
|
40
41
|
async function app () {
|
|
41
42
|
log('Deps')
|
|
42
43
|
|
package/eslint.config.mjs
CHANGED
|
@@ -1,9 +1,26 @@
|
|
|
1
1
|
import globals from 'globals'
|
|
2
|
+
import jsdoc from 'eslint-plugin-jsdoc'
|
|
3
|
+
import merge from '@sequencemedia/eslint-merge'
|
|
2
4
|
import standard from '@sequencemedia/eslint-config-standard/configs/recommended/merge'
|
|
3
5
|
import typescript from '@sequencemedia/eslint-config-typescript/configs/recommended/merge'
|
|
4
6
|
import typescriptParser from '@typescript-eslint/parser'
|
|
5
7
|
|
|
6
8
|
export default [
|
|
9
|
+
merge(
|
|
10
|
+
jsdoc.configs['flat/recommended'],
|
|
11
|
+
{
|
|
12
|
+
languageOptions: {
|
|
13
|
+
globals: {
|
|
14
|
+
DepsTypes: 'readonly'
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
rules: {
|
|
18
|
+
'jsdoc/require-param-description': 'off',
|
|
19
|
+
'jsdoc/require-returns-description': 'off' /* ,
|
|
20
|
+
'jsdoc/tag-lines': 'off' */
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
),
|
|
7
24
|
/**
|
|
8
25
|
* Standard config
|
|
9
26
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modernpoacher/deps",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.21",
|
|
4
4
|
"description": "Update NPM package dependencies from the command line",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"deps",
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
},
|
|
25
25
|
"repository": {
|
|
26
26
|
"type": "git",
|
|
27
|
-
"url": "git://github.com/modernpoacher/deps.git"
|
|
27
|
+
"url": "git+https://github.com/modernpoacher/deps.git"
|
|
28
28
|
},
|
|
29
|
-
"homepage": "https://github.com/modernpoacher/deps",
|
|
29
|
+
"homepage": "https://github.com/modernpoacher/deps#readme",
|
|
30
30
|
"bugs": {
|
|
31
31
|
"url": "https://github.com/modernpoacher/deps/issues"
|
|
32
32
|
},
|
|
@@ -54,25 +54,28 @@
|
|
|
54
54
|
"deps-wipe": "bin/deps/wipe.sh"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"commander": "^
|
|
58
|
-
"debug": "^4.4.
|
|
59
|
-
"glob": "^11.0.
|
|
57
|
+
"commander": "^14.0.0",
|
|
58
|
+
"debug": "^4.4.1",
|
|
59
|
+
"glob": "^11.0.3",
|
|
60
60
|
"strip-ansi": "^7.1.0",
|
|
61
|
-
"supports-color": "^10.
|
|
61
|
+
"supports-color": "^10.2.0"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
|
-
"@sequencemedia/eslint-config-standard": "^0.2.
|
|
65
|
-
"@sequencemedia/eslint-config-typescript": "^0.1.
|
|
66
|
-
"@
|
|
64
|
+
"@sequencemedia/eslint-config-standard": "^0.2.79",
|
|
65
|
+
"@sequencemedia/eslint-config-typescript": "^0.1.137",
|
|
66
|
+
"@sequencemedia/eslint-merge": "^0.0.47",
|
|
67
|
+
"@types/chai": "^5.2.2",
|
|
67
68
|
"@types/debug": "^4.1.12",
|
|
68
69
|
"@types/mocha": "^10.0.10",
|
|
69
|
-
"@
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
70
|
+
"@types/node": "^24.3.1",
|
|
71
|
+
"@typescript-eslint/parser": "^8.42.0",
|
|
72
|
+
"chai": "^6.0.1",
|
|
73
|
+
"cross-env": "^10.0.0",
|
|
74
|
+
"eslint": "^9.34.0",
|
|
75
|
+
"eslint-plugin-jsdoc": "^54.3.1",
|
|
76
|
+
"globals": "^16.3.0",
|
|
74
77
|
"husky": "^9.1.7",
|
|
75
|
-
"mocha": "^11.
|
|
78
|
+
"mocha": "^11.7.2"
|
|
76
79
|
},
|
|
77
80
|
"imports": {
|
|
78
81
|
"#deps/bin": "./bin/index.mjs",
|
|
@@ -84,6 +87,7 @@
|
|
|
84
87
|
"#deps/src/common/*": "./src/common/*/index.mjs",
|
|
85
88
|
"#deps/src/common/debug": "./src/common/debug.mjs",
|
|
86
89
|
"#deps/src/install": "./src/install/index.mjs",
|
|
90
|
+
"#deps/test/*": "./test/*.mjs",
|
|
87
91
|
"#where-am-i": "./where-am-i.mjs"
|
|
88
92
|
}
|
|
89
93
|
}
|
package/src/common/debug.mjs
CHANGED
package/src/common/env/index.mjs
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import debug from 'debug'
|
|
2
|
-
|
|
3
|
-
import PATH from '#where-am-i'
|
|
4
|
-
|
|
5
1
|
import {
|
|
6
2
|
join
|
|
7
3
|
} from 'node:path'
|
|
@@ -14,6 +10,10 @@ import {
|
|
|
14
10
|
platform
|
|
15
11
|
} from 'node:os'
|
|
16
12
|
|
|
13
|
+
import PATH from '#where-am-i'
|
|
14
|
+
|
|
15
|
+
import debug from '#deps/src/common/debug'
|
|
16
|
+
|
|
17
17
|
const {
|
|
18
18
|
name: NAME,
|
|
19
19
|
version: VERSION
|