@modernpoacher/deps 2.3.0 → 2.3.1
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 +9 -6
- package/package.json +6 -5
- package/src/common/git/index.mjs +13 -12
package/bin/common/index.mjs
CHANGED
|
@@ -136,6 +136,7 @@ export const ARGS = PLATFORM === 'win32'
|
|
|
136
136
|
|
|
137
137
|
/**
|
|
138
138
|
* @param {{ code?: number, message?: string }} [e]
|
|
139
|
+
* @returns {void}
|
|
139
140
|
*/
|
|
140
141
|
export function handleError (e = {}) {
|
|
141
142
|
const {
|
|
@@ -162,6 +163,7 @@ export function handleComplete (e) {
|
|
|
162
163
|
|
|
163
164
|
/**
|
|
164
165
|
* @param {{ code?: number, message?: string }} e
|
|
166
|
+
* @returns {void}
|
|
165
167
|
*/
|
|
166
168
|
function handlePackageError ({ message = MESSAGE }) {
|
|
167
169
|
error(`Package error: "${message}"`)
|
|
@@ -169,30 +171,31 @@ function handlePackageError ({ message = MESSAGE }) {
|
|
|
169
171
|
|
|
170
172
|
/**
|
|
171
173
|
* @param {{ code?: number, message?: string }} e
|
|
174
|
+
* @returns {void}
|
|
172
175
|
*/
|
|
173
176
|
function handleConfigurationError ({ message = MESSAGE }) {
|
|
174
177
|
error(`Configuration error: "${message}"`)
|
|
175
178
|
}
|
|
176
179
|
|
|
177
180
|
/**
|
|
178
|
-
*
|
|
179
|
-
*
|
|
181
|
+
* @param {string} directory
|
|
182
|
+
* @returns {string}
|
|
180
183
|
*/
|
|
181
184
|
function getPackageJsonPath (directory = DIRECTORY) {
|
|
182
185
|
return resolve(join(directory, 'package.json'))
|
|
183
186
|
}
|
|
184
187
|
|
|
185
188
|
/**
|
|
186
|
-
*
|
|
187
|
-
*
|
|
189
|
+
* @param {string} directory
|
|
190
|
+
* @returns {string}
|
|
188
191
|
*/
|
|
189
192
|
function getDepsRcPath (directory = DIRECTORY) {
|
|
190
193
|
return resolve(join(directory, '.depsrc'))
|
|
191
194
|
}
|
|
192
195
|
|
|
193
196
|
/**
|
|
194
|
-
*
|
|
195
|
-
*
|
|
197
|
+
* @param {string} directory
|
|
198
|
+
* @returns {string}
|
|
196
199
|
*/
|
|
197
200
|
function getDepsRcJsonPath (directory = DIRECTORY) {
|
|
198
201
|
return resolve(join(directory, '.depsrc.json'))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modernpoacher/deps",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"description": "Update NPM package dependencies from the command line",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"deps",
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"deps-wipe": "cross-env NODE_OPTIONS=--disable-warning=ExperimentalWarning DEBUG_COLORS=yes NODE_ENV=production node bin/deps/wipe.mjs",
|
|
41
41
|
"lint": "eslint .",
|
|
42
42
|
"lint:fix": "npm run lint -- --fix",
|
|
43
|
+
"prepare": "husky || true",
|
|
43
44
|
"start": "npm run deps",
|
|
44
45
|
"test": "cross-env NODE_OPTIONS=--disable-warning=ExperimentalWarning DEBUG_COLORS=yes NODE_ENV=test mocha test --recursive --verbose --color"
|
|
45
46
|
},
|
|
@@ -65,13 +66,13 @@
|
|
|
65
66
|
"@types/chai": "^5.2.3",
|
|
66
67
|
"@types/debug": "^4.1.13",
|
|
67
68
|
"@types/mocha": "^10.0.10",
|
|
68
|
-
"@types/node": "^
|
|
69
|
-
"@typescript-eslint/parser": "^8.
|
|
69
|
+
"@types/node": "^26.1.1",
|
|
70
|
+
"@typescript-eslint/parser": "^8.64.0",
|
|
70
71
|
"chai": "^6.2.2",
|
|
71
72
|
"cross-env": "^10.1.0",
|
|
72
73
|
"eslint": "9.38.0",
|
|
73
|
-
"eslint-plugin-jsdoc": "^63.0.
|
|
74
|
-
"globals": "^17.
|
|
74
|
+
"eslint-plugin-jsdoc": "^63.0.13",
|
|
75
|
+
"globals": "^17.7.0",
|
|
75
76
|
"husky": "^9.1.7",
|
|
76
77
|
"mocha": "^11.7.6"
|
|
77
78
|
},
|
package/src/common/git/index.mjs
CHANGED
|
@@ -27,6 +27,7 @@ import {
|
|
|
27
27
|
} from '#deps/src/common/env'
|
|
28
28
|
|
|
29
29
|
import {
|
|
30
|
+
formatDirectory,
|
|
30
31
|
use,
|
|
31
32
|
trim
|
|
32
33
|
} from '#deps/src/common/format'
|
|
@@ -241,8 +242,8 @@ export function gitConfigUserName (d = DIRECTORY) {
|
|
|
241
242
|
stderr
|
|
242
243
|
} = exec(commands, options, handleComplete)
|
|
243
244
|
|
|
244
|
-
if (stdout) stdout.on('data', out('git-config-user-name', directory))
|
|
245
|
-
if (stderr) stderr.on('data', err('git-config-user-name', directory))
|
|
245
|
+
if (stdout) stdout.on('data', out('git-config-user-name', formatDirectory(directory)))
|
|
246
|
+
if (stderr) stderr.on('data', err('git-config-user-name', formatDirectory(directory)))
|
|
246
247
|
})
|
|
247
248
|
)
|
|
248
249
|
}
|
|
@@ -277,8 +278,8 @@ export function gitConfigUserEmail (d = DIRECTORY) {
|
|
|
277
278
|
stderr
|
|
278
279
|
} = exec(commands, options, handleComplete)
|
|
279
280
|
|
|
280
|
-
if (stdout) stdout.on('data', out('git-config-user-email', directory))
|
|
281
|
-
if (stderr) stderr.on('data', err('git-config-user-email', directory))
|
|
281
|
+
if (stdout) stdout.on('data', out('git-config-user-email', formatDirectory(directory)))
|
|
282
|
+
if (stderr) stderr.on('data', err('git-config-user-email', formatDirectory(directory)))
|
|
282
283
|
})
|
|
283
284
|
)
|
|
284
285
|
}
|
|
@@ -315,8 +316,8 @@ export function catGitRefsRemotesOriginHead (d = DIRECTORY) {
|
|
|
315
316
|
stderr
|
|
316
317
|
} = exec(commands, options, handleComplete)
|
|
317
318
|
|
|
318
|
-
if (stdout) stdout.on('data', out('cat-git-refs-remotes-origin-head', directory))
|
|
319
|
-
if (stderr) stderr.on('data', err('cat-git-refs-remotes-origin-head', directory))
|
|
319
|
+
if (stdout) stdout.on('data', out('cat-git-refs-remotes-origin-head', formatDirectory(directory)))
|
|
320
|
+
if (stderr) stderr.on('data', err('cat-git-refs-remotes-origin-head', formatDirectory(directory)))
|
|
320
321
|
})
|
|
321
322
|
)
|
|
322
323
|
}
|
|
@@ -353,8 +354,8 @@ export function awkGitRemoteShowOriginHead (d = DIRECTORY) {
|
|
|
353
354
|
stderr
|
|
354
355
|
} = exec(commands, options, handleComplete)
|
|
355
356
|
|
|
356
|
-
if (stdout) stdout.on('data', out('git-remote-show-origin-head', directory))
|
|
357
|
-
if (stderr) stderr.on('data', err('git-remote-show-origin-head', directory))
|
|
357
|
+
if (stdout) stdout.on('data', out('git-remote-show-origin-head', formatDirectory(directory)))
|
|
358
|
+
if (stderr) stderr.on('data', err('git-remote-show-origin-head', formatDirectory(directory)))
|
|
358
359
|
})
|
|
359
360
|
)
|
|
360
361
|
}
|
|
@@ -391,8 +392,8 @@ export function gitRevParseShowTopLevel (d = DIRECTORY) {
|
|
|
391
392
|
stderr
|
|
392
393
|
} = exec(commands, options, handleComplete)
|
|
393
394
|
|
|
394
|
-
if (stdout) stdout.on('data', out('git-rev-parse-show-toplevel', directory))
|
|
395
|
-
if (stderr) stderr.on('data', err('git-rev-parse-show-toplevel', directory))
|
|
395
|
+
if (stdout) stdout.on('data', out('git-rev-parse-show-toplevel', formatDirectory(directory)))
|
|
396
|
+
if (stderr) stderr.on('data', err('git-rev-parse-show-toplevel', formatDirectory(directory)))
|
|
396
397
|
})
|
|
397
398
|
)
|
|
398
399
|
}
|
|
@@ -429,8 +430,8 @@ export function gitRevParseAbbrevRefHead (d = DIRECTORY) {
|
|
|
429
430
|
stderr
|
|
430
431
|
} = exec(commands, options, handleComplete)
|
|
431
432
|
|
|
432
|
-
if (stdout) stdout.on('data', out('git-rev-parse-abbrev-ref-head', directory))
|
|
433
|
-
if (stderr) stderr.on('data', err('git-rev-parse-abbrev-ref-head', directory))
|
|
433
|
+
if (stdout) stdout.on('data', out('git-rev-parse-abbrev-ref-head', formatDirectory(directory)))
|
|
434
|
+
if (stderr) stderr.on('data', err('git-rev-parse-abbrev-ref-head', formatDirectory(directory)))
|
|
434
435
|
})
|
|
435
436
|
)
|
|
436
437
|
}
|