@modernpoacher/deps 2.1.17 → 2.1.18

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.
@@ -3,10 +3,13 @@
3
3
  import debug from 'debug'
4
4
 
5
5
  import {
6
- resolve
6
+ resolve,
7
+ dirname
7
8
  } from 'node:path'
8
9
 
9
- import glob from 'glob-all'
10
+ import {
11
+ glob
12
+ } from 'glob'
10
13
 
11
14
  import {
12
15
  Command
@@ -226,17 +229,15 @@ function * genDirsList (directories = []) {
226
229
  while (directories.length) yield directories.shift()
227
230
  }
228
231
 
229
- function getPathList (directory) {
232
+ async function getPathList (directory) {
230
233
  log('getPathList')
231
234
 
235
+ const array = await glob(`${directory}/*/package.json`)
236
+
232
237
  return (
233
- new Promise((resolve, reject) => {
234
- glob(`${directory}/*/`, (error, array) => {
235
- (!error)
236
- ? resolve(array.sort())
237
- : reject(error)
238
- })
239
- })
238
+ array
239
+ .map(dirname)
240
+ .sort()
240
241
  )
241
242
  }
242
243
 
@@ -309,7 +310,9 @@ async function iteratePath (directory, registry, force, message, author) {
309
310
  if (pathList.length) {
310
311
  const depsList = await getDepsList(pathList)
311
312
 
312
- for (const d of genDirsList(depsList)) await iterate(d, registry, force, message, author)
313
+ if (depsList.length) {
314
+ for (const d of genDirsList(depsList)) await iterate(d, registry, force, message, author)
315
+ }
313
316
  }
314
317
  }
315
318
  }
package/bin/deps.mjs CHANGED
@@ -74,6 +74,24 @@ async function app () {
74
74
  * Any other command will continue
75
75
  */
76
76
 
77
+ const {
78
+ saveProd: P,
79
+ saveDev: D,
80
+ saveOptional: O,
81
+ saveBundle: B,
82
+ force,
83
+ registry
84
+ } = commander.opts()
85
+
86
+ log({
87
+ saveProd: P,
88
+ saveDev: D,
89
+ saveOptional: O,
90
+ saveBundle: B,
91
+ ...(registry ? { registry } : {}),
92
+ ...(force ? { force } : {})
93
+ })
94
+
77
95
  const {
78
96
  env: {
79
97
  PWD,
@@ -93,24 +111,6 @@ async function app () {
93
111
  : {}
94
112
  )
95
113
 
96
- const {
97
- saveProd: P,
98
- saveDev: D,
99
- saveOptional: O,
100
- saveBundle: B,
101
- force,
102
- registry
103
- } = commander.opts()
104
-
105
- log({
106
- saveProd: P,
107
- saveDev: D,
108
- saveOptional: O,
109
- saveBundle: B,
110
- ...(registry ? { registry } : {}),
111
- ...(force ? { force } : {})
112
- })
113
-
114
114
  if ((P && D) || (!P && !D && !O && !B)) {
115
115
  log('Prod')
116
116
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modernpoacher/deps",
3
- "version": "2.1.17",
3
+ "version": "2.1.18",
4
4
  "description": "Update NPM package dependencies from the command line",
5
5
  "keywords": [
6
6
  "deps",
@@ -40,7 +40,8 @@
40
40
  "lint": "eslint . --ext .mjs,.cjs",
41
41
  "lint:fix": "npm run lint -- --fix",
42
42
  "start": "npm run deps",
43
- "test": "cross-env DEBUG_COLORS=yes NODE_ENV=test mocha test --recursive --verbose --color"
43
+ "test": "cross-env DEBUG_COLORS=yes NODE_ENV=test mocha test --recursive --verbose --color",
44
+ "prepare": "husky"
44
45
  },
45
46
  "bin": {
46
47
  "deps": "bin/deps.mjs",
@@ -54,7 +55,7 @@
54
55
  "dependencies": {
55
56
  "commander": "^12.1.0",
56
57
  "debug": "^4.3.7",
57
- "glob-all": "^3.3.1",
58
+ "glob": "^11.0.0",
58
59
  "strip-ansi": "^7.1.0",
59
60
  "supports-color": "^9.4.0"
60
61
  },