@modernpoacher/deps 2.0.28 → 2.0.29
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/execute/app.mjs +38 -14
- package/package.json +4 -5
package/bin/execute/app.mjs
CHANGED
|
@@ -32,6 +32,7 @@ import {
|
|
|
32
32
|
} from '#deps/src/common/git'
|
|
33
33
|
|
|
34
34
|
import {
|
|
35
|
+
DIRECTORY,
|
|
35
36
|
REGISTRY,
|
|
36
37
|
getIgnore,
|
|
37
38
|
getAuthor,
|
|
@@ -61,8 +62,6 @@ const log = debug('@modernpoacher/deps')
|
|
|
61
62
|
|
|
62
63
|
log(`\`execute\` (${VERSION} - ${PLATFORM}) is awake`)
|
|
63
64
|
|
|
64
|
-
const DIRECTORY = process.cwd()
|
|
65
|
-
|
|
66
65
|
function handleCommandError (e) {
|
|
67
66
|
const {
|
|
68
67
|
code = 0
|
|
@@ -239,14 +238,21 @@ function getPathList (directory) {
|
|
|
239
238
|
)
|
|
240
239
|
}
|
|
241
240
|
|
|
242
|
-
async function getDepsList (directories) {
|
|
241
|
+
async function getDepsList (directories = []) {
|
|
243
242
|
log('getDepsList')
|
|
244
243
|
|
|
244
|
+
const alpha = (
|
|
245
|
+
directories
|
|
246
|
+
.filter(filterDeps)
|
|
247
|
+
.reduce(reduceDeps, [])
|
|
248
|
+
.sort()
|
|
249
|
+
)
|
|
250
|
+
|
|
245
251
|
try {
|
|
246
|
-
const
|
|
252
|
+
const omega = await Promise.all(alpha.map(mapRevParseShowTopLevel))
|
|
247
253
|
|
|
248
254
|
return (
|
|
249
|
-
|
|
255
|
+
omega
|
|
250
256
|
.filter(filterDeps)
|
|
251
257
|
.reduce(reduceDeps, [])
|
|
252
258
|
.sort()
|
|
@@ -294,6 +300,26 @@ async function iterate ([directory, ...directories] = [], registry, force, messa
|
|
|
294
300
|
}
|
|
295
301
|
}
|
|
296
302
|
|
|
303
|
+
async function iteratePath (directory, registry, force, message, author) {
|
|
304
|
+
log('iteratePath')
|
|
305
|
+
|
|
306
|
+
if (directory) {
|
|
307
|
+
const D = resolve(directory)
|
|
308
|
+
|
|
309
|
+
const pathList = await getPathList(D)
|
|
310
|
+
|
|
311
|
+
if (pathList.length) {
|
|
312
|
+
const depsList = await getDepsList(pathList)
|
|
313
|
+
|
|
314
|
+
if (depsList.length) {
|
|
315
|
+
return (
|
|
316
|
+
await iterate(depsList, registry, force, message, author)
|
|
317
|
+
)
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
|
|
297
323
|
async function execute (directory = DIRECTORY, registry = REGISTRY, force = false, message = MESSAGE, author = AUTHOR) {
|
|
298
324
|
log('execute')
|
|
299
325
|
|
|
@@ -374,19 +400,17 @@ async function executePath (directory, registry, force, message, author) {
|
|
|
374
400
|
}
|
|
375
401
|
}
|
|
376
402
|
} catch (e) {
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
const pathList = await getPathList(D)
|
|
381
|
-
|
|
382
|
-
if (pathList.length) {
|
|
383
|
-
const depsList = await getDepsList(pathList)
|
|
403
|
+
const {
|
|
404
|
+
code
|
|
405
|
+
} = e
|
|
384
406
|
|
|
385
|
-
if (
|
|
407
|
+
if (code === 128) {
|
|
386
408
|
return (
|
|
387
|
-
await
|
|
409
|
+
await iteratePath(directory, registry, force, message, author)
|
|
388
410
|
)
|
|
389
411
|
}
|
|
412
|
+
|
|
413
|
+
handleCommandError(e)
|
|
390
414
|
}
|
|
391
415
|
}
|
|
392
416
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modernpoacher/deps",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.29",
|
|
4
4
|
"description": "Update NPM package dependencies from the command line",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"deps",
|
|
@@ -57,15 +57,14 @@
|
|
|
57
57
|
"supports-color": "8.1.1"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@babel/
|
|
61
|
-
"@babel/core": "^7.21.8",
|
|
60
|
+
"@babel/core": "^7.22.1",
|
|
62
61
|
"@babel/eslint-parser": "^7.21.8",
|
|
63
|
-
"@babel/preset-env": "^7.
|
|
62
|
+
"@babel/preset-env": "^7.22.2",
|
|
64
63
|
"@babel/register": "^7.21.0",
|
|
65
64
|
"chai": "^4.3.7",
|
|
66
65
|
"core-js": "^3.30.2",
|
|
67
66
|
"cross-env": "^7.0.3",
|
|
68
|
-
"eslint": "^8.
|
|
67
|
+
"eslint": "^8.41.0",
|
|
69
68
|
"eslint-config-standard": "^17.0.0",
|
|
70
69
|
"eslint-plugin-import": "^2.27.5",
|
|
71
70
|
"eslint-plugin-node": "^11.1.0",
|