@modernpoacher/deps 2.2.37 → 2.2.39
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 +4 -3
- package/bin/deps.mjs +2 -1
- package/bin/node/execute.mjs +54 -66
- package/bin/node/install.mjs +2 -2
- package/package.json +6 -6
- package/src/common/env/index.mjs +5 -1
- package/src/common/format/index.mjs +7 -6
- package/src/common/git/index.mjs +2 -1
- package/src/common/index.mjs +6 -5
- package/src/common/options/index.mjs +2 -1
- package/src/index.mjs +2 -1
- package/src/install/index.mjs +2 -1
package/bin/common/index.mjs
CHANGED
|
@@ -42,9 +42,10 @@ import {
|
|
|
42
42
|
import debug from '#deps/src/common/debug'
|
|
43
43
|
|
|
44
44
|
import {
|
|
45
|
+
BIN,
|
|
46
|
+
NAME,
|
|
45
47
|
VERSION,
|
|
46
|
-
PLATFORM
|
|
47
|
-
BIN
|
|
48
|
+
PLATFORM
|
|
48
49
|
} from '#deps/src/common/env'
|
|
49
50
|
|
|
50
51
|
import {
|
|
@@ -72,7 +73,7 @@ const log = debug('@modernpoacher/deps')
|
|
|
72
73
|
const info = debug('@modernpoacher/deps:info')
|
|
73
74
|
const error = debug('@modernpoacher/deps:error')
|
|
74
75
|
|
|
75
|
-
log(`\`common\` (${VERSION} - ${PLATFORM}) is awake`)
|
|
76
|
+
log(`\`common\` (${NAME} - ${VERSION} - ${PLATFORM}) is awake`)
|
|
76
77
|
|
|
77
78
|
const ARGV = argv.slice(2)
|
|
78
79
|
|
package/bin/deps.mjs
CHANGED
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
import debug from '#deps/src/common/debug'
|
|
8
8
|
|
|
9
9
|
import {
|
|
10
|
+
NAME,
|
|
10
11
|
VERSION,
|
|
11
12
|
PLATFORM
|
|
12
13
|
} from '#deps/src/common/env'
|
|
@@ -35,7 +36,7 @@ import {
|
|
|
35
36
|
|
|
36
37
|
const log = debug('@modernpoacher/deps')
|
|
37
38
|
|
|
38
|
-
log(`\`deps\` (${VERSION} - ${PLATFORM}) is awake`)
|
|
39
|
+
log(`\`deps\` (${NAME} - ${VERSION} - ${PLATFORM}) is awake`)
|
|
39
40
|
|
|
40
41
|
const {
|
|
41
42
|
table
|
package/bin/node/execute.mjs
CHANGED
|
@@ -18,6 +18,7 @@ import '#deps/src/common/write'
|
|
|
18
18
|
import debug from '#deps/src/common/debug'
|
|
19
19
|
|
|
20
20
|
import {
|
|
21
|
+
NAME,
|
|
21
22
|
VERSION,
|
|
22
23
|
PLATFORM
|
|
23
24
|
} from '#deps/src/common/env'
|
|
@@ -64,7 +65,7 @@ import {
|
|
|
64
65
|
const log = debug('@modernpoacher/deps')
|
|
65
66
|
const info = debug('@modernpoacher/deps:info')
|
|
66
67
|
|
|
67
|
-
log(`\`execute\` (${VERSION} - ${PLATFORM}) is awake`)
|
|
68
|
+
log(`\`execute\` (${NAME} - ${VERSION} - ${PLATFORM}) is awake`)
|
|
68
69
|
|
|
69
70
|
const {
|
|
70
71
|
table
|
|
@@ -125,15 +126,15 @@ async function isHeadDefaultBranch (directory) {
|
|
|
125
126
|
async function getIgnoreFromConfiguration (directory) {
|
|
126
127
|
log('getIgnoreFromConfiguration')
|
|
127
128
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
129
|
+
if (await hasConfiguration(directory)) {
|
|
130
|
+
return (
|
|
131
|
+
getIgnore(
|
|
132
|
+
await getConfiguration(directory)
|
|
133
|
+
)
|
|
134
|
+
)
|
|
135
|
+
}
|
|
133
136
|
|
|
134
|
-
return
|
|
135
|
-
getIgnore(CONFIGURATION)
|
|
136
|
-
)
|
|
137
|
+
return false
|
|
137
138
|
}
|
|
138
139
|
|
|
139
140
|
/**
|
|
@@ -146,15 +147,15 @@ async function getIgnoreFromConfiguration (directory) {
|
|
|
146
147
|
async function getAuthorFromConfiguration (directory) {
|
|
147
148
|
log('getAuthorFromConfiguration')
|
|
148
149
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
150
|
+
if (await hasConfiguration(directory)) {
|
|
151
|
+
return (
|
|
152
|
+
getAuthor(
|
|
153
|
+
await getConfiguration(directory)
|
|
154
|
+
)
|
|
155
|
+
)
|
|
156
|
+
}
|
|
154
157
|
|
|
155
|
-
return
|
|
156
|
-
getAuthor(CONFIGURATION)
|
|
157
|
-
)
|
|
158
|
+
return null
|
|
158
159
|
}
|
|
159
160
|
|
|
160
161
|
/**
|
|
@@ -167,13 +168,11 @@ async function getAuthorFromConfiguration (directory) {
|
|
|
167
168
|
async function getAuthorFromGit (directory) {
|
|
168
169
|
log('getAuthorFromGitConfig')
|
|
169
170
|
|
|
170
|
-
const GIT = {
|
|
171
|
-
name: await gitConfigUserName(directory),
|
|
172
|
-
email: await gitConfigUserEmail(directory)
|
|
173
|
-
}
|
|
174
|
-
|
|
175
171
|
return (
|
|
176
|
-
getAuthor(
|
|
172
|
+
getAuthor({
|
|
173
|
+
name: await gitConfigUserName(directory),
|
|
174
|
+
email: await gitConfigUserEmail(directory)
|
|
175
|
+
})
|
|
177
176
|
)
|
|
178
177
|
}
|
|
179
178
|
|
|
@@ -187,15 +186,15 @@ async function getAuthorFromGit (directory) {
|
|
|
187
186
|
async function getAuthorFromPackage (directory) {
|
|
188
187
|
log('getAuthorFromPackage')
|
|
189
188
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
189
|
+
if (await hasPackage(directory)) {
|
|
190
|
+
return (
|
|
191
|
+
getAuthor(
|
|
192
|
+
await getPackage(directory)
|
|
193
|
+
)
|
|
194
|
+
)
|
|
195
|
+
}
|
|
195
196
|
|
|
196
|
-
return
|
|
197
|
-
getAuthor(PACKAGE)
|
|
198
|
-
)
|
|
197
|
+
return null
|
|
199
198
|
}
|
|
200
199
|
|
|
201
200
|
/**
|
|
@@ -208,15 +207,15 @@ async function getAuthorFromPackage (directory) {
|
|
|
208
207
|
async function getMessageFromConfiguration (directory) {
|
|
209
208
|
log('getMessageFromConfiguration')
|
|
210
209
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
210
|
+
if (await hasConfiguration(directory)) {
|
|
211
|
+
return (
|
|
212
|
+
getMessage(
|
|
213
|
+
await getConfiguration(directory)
|
|
214
|
+
)
|
|
215
|
+
)
|
|
216
|
+
}
|
|
216
217
|
|
|
217
|
-
return
|
|
218
|
-
getMessage(CONFIGURATION)
|
|
219
|
-
)
|
|
218
|
+
return null
|
|
220
219
|
}
|
|
221
220
|
|
|
222
221
|
/**
|
|
@@ -225,7 +224,7 @@ async function getMessageFromConfiguration (directory) {
|
|
|
225
224
|
* Ensures that the `author` is set either from the command line,
|
|
226
225
|
* configuration, package, or a default
|
|
227
226
|
*
|
|
228
|
-
* Since it can be null `author`
|
|
227
|
+
* Since it can be null `author` will not default in function arguments
|
|
229
228
|
* @param {string | { name: string; email: string }} author
|
|
230
229
|
* @param {string} directory
|
|
231
230
|
* @returns {Promise<string | { name: string; email: string }>}
|
|
@@ -240,7 +239,7 @@ async function toAuthor (author, directory) {
|
|
|
240
239
|
* Ensures that the `message` is set either from the command line,
|
|
241
240
|
* configuration, or a default
|
|
242
241
|
*
|
|
243
|
-
* Since it can be null `message`
|
|
242
|
+
* Since it can be null `message` will not default in function arguments
|
|
244
243
|
* @param {string | null} message
|
|
245
244
|
* @param {string} directory
|
|
246
245
|
* @returns {Promise<string>}
|
|
@@ -250,21 +249,21 @@ async function toMessage (message, directory) {
|
|
|
250
249
|
}
|
|
251
250
|
|
|
252
251
|
/**
|
|
252
|
+
* @type {(v: string | undefined) => v is string}
|
|
253
253
|
* @param {string | undefined} v
|
|
254
254
|
* @returns {boolean}
|
|
255
255
|
*/
|
|
256
|
-
|
|
256
|
+
function filter (v) { // de-falsy
|
|
257
257
|
return Boolean(v)
|
|
258
258
|
}
|
|
259
259
|
|
|
260
260
|
/**
|
|
261
|
-
*
|
|
262
|
-
*
|
|
263
|
-
*
|
|
261
|
+
* @param {string} alpha
|
|
262
|
+
* @param {string} omega
|
|
263
|
+
* @returns {number}
|
|
264
264
|
*/
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
return a
|
|
265
|
+
function sort (alpha, omega) {
|
|
266
|
+
return alpha.localeCompare(omega)
|
|
268
267
|
}
|
|
269
268
|
|
|
270
269
|
/**
|
|
@@ -287,21 +286,12 @@ async function getPathList (directory) {
|
|
|
287
286
|
return (
|
|
288
287
|
array
|
|
289
288
|
.map(dirname)
|
|
290
|
-
.sort()
|
|
289
|
+
.sort(sort)
|
|
291
290
|
)
|
|
292
291
|
}
|
|
293
292
|
|
|
294
293
|
/**
|
|
295
|
-
*
|
|
296
|
-
* @param {string} omega
|
|
297
|
-
* @returns {number}
|
|
298
|
-
*/
|
|
299
|
-
function sort (alpha, omega) {
|
|
300
|
-
return alpha.localeCompare(omega)
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
/**
|
|
304
|
-
* @param {Array<string | undefined>} [directories]
|
|
294
|
+
* @param {(string | undefined)[]} [directories]
|
|
305
295
|
* @returns {Promise<string[]>}
|
|
306
296
|
*/
|
|
307
297
|
async function getDepsList (directories = []) {
|
|
@@ -312,16 +302,15 @@ async function getDepsList (directories = []) {
|
|
|
312
302
|
* @type {string[]}
|
|
313
303
|
*/
|
|
314
304
|
const alpha = (
|
|
315
|
-
directories
|
|
316
|
-
.filter(
|
|
317
|
-
.reduce(reduceDeps, [])
|
|
305
|
+
Array.from(new Set(directories))
|
|
306
|
+
.filter(filter)
|
|
318
307
|
.sort(sort)
|
|
319
308
|
)
|
|
320
309
|
|
|
321
310
|
try {
|
|
322
311
|
/**
|
|
323
312
|
* Recreate `directories` from `alpha`
|
|
324
|
-
* @type {
|
|
313
|
+
* @type {(string | undefined)[]}
|
|
325
314
|
*/
|
|
326
315
|
const directories = (
|
|
327
316
|
await Promise.all(
|
|
@@ -335,9 +324,8 @@ async function getDepsList (directories = []) {
|
|
|
335
324
|
* @type {string[]}
|
|
336
325
|
*/
|
|
337
326
|
const omega = (
|
|
338
|
-
directories
|
|
339
|
-
.filter(
|
|
340
|
-
.reduce(reduceDeps, [])
|
|
327
|
+
Array.from(new Set(directories))
|
|
328
|
+
.filter(filter)
|
|
341
329
|
.sort(sort)
|
|
342
330
|
)
|
|
343
331
|
|
package/bin/node/install.mjs
CHANGED
|
@@ -9,9 +9,9 @@ import '#deps/src/common/write'
|
|
|
9
9
|
import debug from '#deps/src/common/debug'
|
|
10
10
|
|
|
11
11
|
import {
|
|
12
|
+
NAME,
|
|
12
13
|
VERSION,
|
|
13
14
|
PLATFORM
|
|
14
|
-
|
|
15
15
|
} from '#deps/src/common/env'
|
|
16
16
|
|
|
17
17
|
import {
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
|
|
37
37
|
const log = debug('@modernpoacher/deps')
|
|
38
38
|
|
|
39
|
-
log(`\`install\` (${VERSION} - ${PLATFORM}) is awake`)
|
|
39
|
+
log(`\`install\` (${NAME} - ${VERSION} - ${PLATFORM}) is awake`)
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
42
|
* @function app
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modernpoacher/deps",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.39",
|
|
4
4
|
"description": "Update NPM package dependencies from the command line",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"deps",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"deps-wipe": "bin/deps/wipe.sh"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@sequencemedia/write": "^0.2.
|
|
57
|
+
"@sequencemedia/write": "^0.2.15",
|
|
58
58
|
"commander": "^14.0.1",
|
|
59
59
|
"debug": "^4.4.3",
|
|
60
60
|
"glob": "^11.0.3",
|
|
@@ -62,8 +62,8 @@
|
|
|
62
62
|
"supports-color": "^10.2.2"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@sequencemedia/eslint-config-standard": "^0.2.
|
|
66
|
-
"@sequencemedia/eslint-config-typescript": "^0.1.
|
|
65
|
+
"@sequencemedia/eslint-config-standard": "^0.2.89",
|
|
66
|
+
"@sequencemedia/eslint-config-typescript": "^0.1.151",
|
|
67
67
|
"@sequencemedia/eslint-merge": "^0.0.54",
|
|
68
68
|
"@types/chai": "^5.2.2",
|
|
69
69
|
"@types/debug": "^4.1.12",
|
|
@@ -72,8 +72,8 @@
|
|
|
72
72
|
"@typescript-eslint/parser": "^8.45.0",
|
|
73
73
|
"chai": "^6.2.0",
|
|
74
74
|
"cross-env": "^10.1.0",
|
|
75
|
-
"eslint": "^9.
|
|
76
|
-
"eslint-plugin-jsdoc": "^60.
|
|
75
|
+
"eslint": "^9.37.0",
|
|
76
|
+
"eslint-plugin-jsdoc": "^60.8.0",
|
|
77
77
|
"globals": "^16.4.0",
|
|
78
78
|
"husky": "^9.1.7",
|
|
79
79
|
"mocha": "^11.7.4"
|
package/src/common/env/index.mjs
CHANGED
|
@@ -7,7 +7,8 @@ import {
|
|
|
7
7
|
} from 'node:fs'
|
|
8
8
|
|
|
9
9
|
import {
|
|
10
|
-
platform
|
|
10
|
+
platform,
|
|
11
|
+
homedir
|
|
11
12
|
} from 'node:os'
|
|
12
13
|
|
|
13
14
|
import PATH from '#where-am-i'
|
|
@@ -21,6 +22,8 @@ const {
|
|
|
21
22
|
|
|
22
23
|
const PLATFORM = platform()
|
|
23
24
|
|
|
25
|
+
const HOMEDIR = homedir()
|
|
26
|
+
|
|
24
27
|
const {
|
|
25
28
|
env: {
|
|
26
29
|
HOME
|
|
@@ -39,6 +42,7 @@ export {
|
|
|
39
42
|
NAME,
|
|
40
43
|
VERSION,
|
|
41
44
|
PLATFORM,
|
|
45
|
+
HOMEDIR,
|
|
42
46
|
HOME,
|
|
43
47
|
BIN
|
|
44
48
|
}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import debug from 'debug'
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
homedir
|
|
5
|
-
} from 'node:os'
|
|
6
|
-
|
|
7
3
|
import stripAnsi from 'strip-ansi'
|
|
8
4
|
|
|
9
5
|
import {
|
|
10
|
-
|
|
6
|
+
NAME,
|
|
7
|
+
VERSION,
|
|
8
|
+
PLATFORM,
|
|
9
|
+
HOMEDIR
|
|
11
10
|
} from '#deps/src/common/env'
|
|
12
11
|
|
|
13
|
-
const
|
|
12
|
+
const log = debug('@modernpoacher/deps')
|
|
13
|
+
|
|
14
|
+
log(`\`common/format\` (${NAME} - ${VERSION} - ${PLATFORM}) is awake`)
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
17
|
* @function toHomeDir
|
package/src/common/git/index.mjs
CHANGED
|
@@ -23,6 +23,7 @@ import debug from '#deps/src/common/debug'
|
|
|
23
23
|
|
|
24
24
|
import {
|
|
25
25
|
BIN,
|
|
26
|
+
NAME,
|
|
26
27
|
VERSION,
|
|
27
28
|
PLATFORM
|
|
28
29
|
} from '#deps/src/common/env'
|
|
@@ -74,7 +75,7 @@ git push --tags
|
|
|
74
75
|
|
|
75
76
|
const log = debug('@modernpoacher/deps')
|
|
76
77
|
|
|
77
|
-
log(`\`common/git\` (${VERSION} - ${PLATFORM}) is awake`)
|
|
78
|
+
log(`\`common/git\` (${NAME} - ${VERSION} - ${PLATFORM}) is awake`)
|
|
78
79
|
|
|
79
80
|
const LF = String.fromCodePoint(10)
|
|
80
81
|
|
package/src/common/index.mjs
CHANGED
|
@@ -14,14 +14,15 @@ import PATH from '#where-am-i'
|
|
|
14
14
|
import debug from '#deps/src/common/debug'
|
|
15
15
|
|
|
16
16
|
import {
|
|
17
|
-
|
|
18
|
-
} from '#deps/src/common/format'
|
|
19
|
-
|
|
20
|
-
import {
|
|
17
|
+
NAME,
|
|
21
18
|
VERSION,
|
|
22
19
|
PLATFORM
|
|
23
20
|
} from '#deps/src/common/env'
|
|
24
21
|
|
|
22
|
+
import {
|
|
23
|
+
tidy
|
|
24
|
+
} from '#deps/src/common/format'
|
|
25
|
+
|
|
25
26
|
export const DIRECTORY = '.'
|
|
26
27
|
|
|
27
28
|
export const REGISTRY = 'https://registry.npmjs.org'
|
|
@@ -32,7 +33,7 @@ export const NVM = join(PATH, 'nvm.sh')
|
|
|
32
33
|
|
|
33
34
|
const log = debug('@modernpoacher/deps')
|
|
34
35
|
|
|
35
|
-
log(`\`common\` (${VERSION} - ${PLATFORM}) is awake`)
|
|
36
|
+
log(`\`common\` (${NAME} - ${VERSION} - ${PLATFORM}) is awake`)
|
|
36
37
|
|
|
37
38
|
const SP = String.fromCodePoint(32)
|
|
38
39
|
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import debug from '#deps/src/common/debug'
|
|
6
6
|
|
|
7
7
|
import {
|
|
8
|
+
NAME,
|
|
8
9
|
VERSION,
|
|
9
10
|
PLATFORM
|
|
10
11
|
} from '#deps/src/common/env'
|
|
@@ -38,7 +39,7 @@ export const OPTIONS = {
|
|
|
38
39
|
|
|
39
40
|
const log = debug('@modernpoacher/deps')
|
|
40
41
|
|
|
41
|
-
log(`\`common/options\` (${VERSION} - ${PLATFORM}) is awake`)
|
|
42
|
+
log(`\`common/options\` (${NAME} - ${VERSION} - ${PLATFORM}) is awake`)
|
|
42
43
|
|
|
43
44
|
/**
|
|
44
45
|
* @function getOptions
|
package/src/index.mjs
CHANGED
|
@@ -30,6 +30,7 @@ import {
|
|
|
30
30
|
import debug from '#deps/src/common/debug'
|
|
31
31
|
|
|
32
32
|
import {
|
|
33
|
+
NAME,
|
|
33
34
|
VERSION,
|
|
34
35
|
PLATFORM
|
|
35
36
|
} from '#deps/src/common/env'
|
|
@@ -63,7 +64,7 @@ import {
|
|
|
63
64
|
const log = debug('@modernpoacher/deps')
|
|
64
65
|
const info = debug('@modernpoacher/deps:info')
|
|
65
66
|
|
|
66
|
-
log(`\`deps\` (${VERSION} - ${PLATFORM}) is awake`)
|
|
67
|
+
log(`\`deps\` (${NAME} - ${VERSION} - ${PLATFORM}) is awake`)
|
|
67
68
|
|
|
68
69
|
/**
|
|
69
70
|
* @function getInstallSaveExactCommands
|
package/src/install/index.mjs
CHANGED
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
import debug from '#deps/src/common/debug'
|
|
24
24
|
|
|
25
25
|
import {
|
|
26
|
+
NAME,
|
|
26
27
|
VERSION,
|
|
27
28
|
PLATFORM
|
|
28
29
|
} from '#deps/src/common/env'
|
|
@@ -52,7 +53,7 @@ import {
|
|
|
52
53
|
const log = debug('@modernpoacher/deps')
|
|
53
54
|
const info = debug('@modernpoacher/deps:info')
|
|
54
55
|
|
|
55
|
-
log(`\`install\` (${VERSION} - ${PLATFORM}) is awake`)
|
|
56
|
+
log(`\`install\` (${NAME} - ${VERSION} - ${PLATFORM}) is awake`)
|
|
56
57
|
|
|
57
58
|
/**
|
|
58
59
|
* @function getInstallSaveExactCommands
|