@modernpoacher/deps 2.2.47 → 2.2.49
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 +5 -5
- package/bin/deps.mjs +1 -1
- package/bin/node/execute.mjs +1 -1
- package/bin/node/install.mjs +1 -1
- package/package.json +6 -6
- package/src/common/env/index.mjs +4 -3
- package/src/common/format/index.mjs +12 -3
- package/src/common/index.mjs +5 -12
package/bin/common/index.mjs
CHANGED
|
@@ -42,6 +42,7 @@ import {
|
|
|
42
42
|
import debug from '#deps/src/common/debug'
|
|
43
43
|
|
|
44
44
|
import {
|
|
45
|
+
NVM,
|
|
45
46
|
BIN,
|
|
46
47
|
PLATFORM
|
|
47
48
|
} from '#deps/src/common/env'
|
|
@@ -61,11 +62,10 @@ import {
|
|
|
61
62
|
DIRECTORY,
|
|
62
63
|
REGISTRY,
|
|
63
64
|
AUTHOR,
|
|
64
|
-
NVM,
|
|
65
65
|
getRegistryParameter,
|
|
66
66
|
getForceParameter,
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
getNvm,
|
|
68
|
+
getBin
|
|
69
69
|
} from '#deps/src/common'
|
|
70
70
|
|
|
71
71
|
const log = debug('@modernpoacher/deps')
|
|
@@ -92,11 +92,11 @@ rm -rf node_modules package-lock.json
|
|
|
92
92
|
|
|
93
93
|
const getNpmiCommands = PLATFORM === 'win32'
|
|
94
94
|
? (registry = REGISTRY, force = false) => trim(tidy(getRegistryParameter(registry, getForceParameter(force, 'npm i'))))
|
|
95
|
-
: (registry = REGISTRY, force = false) => trim(tidy(
|
|
95
|
+
: (registry = REGISTRY, force = false) => trim(tidy(getBin(getNvm(getRegistryParameter(registry, getForceParameter(force, 'npm i'))))))
|
|
96
96
|
|
|
97
97
|
const getDepsCommands = PLATFORM === 'win32'
|
|
98
98
|
? (registry = REGISTRY, force = false) => trim(tidy(getRegistryParameter(registry, getForceParameter(force, 'deps'))))
|
|
99
|
-
: (registry = REGISTRY, force = false) => trim(tidy(
|
|
99
|
+
: (registry = REGISTRY, force = false) => trim(tidy(getBin(getNvm(getRegistryParameter(registry, getForceParameter(force, 'deps'))))))
|
|
100
100
|
|
|
101
101
|
export const DEPS = PLATFORM === 'win32'
|
|
102
102
|
? `bash "${join(BIN, '.\\bash\\deps.sh')}"`
|
package/bin/deps.mjs
CHANGED
package/bin/node/execute.mjs
CHANGED
package/bin/node/install.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modernpoacher/deps",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.49",
|
|
4
4
|
"description": "Update NPM package dependencies from the command line",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"deps",
|
|
@@ -63,17 +63,17 @@
|
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@sequencemedia/eslint-config-standard": "^0.2.89",
|
|
66
|
-
"@sequencemedia/eslint-config-typescript": "^0.1.
|
|
67
|
-
"@sequencemedia/eslint-merge": "^0.0.
|
|
66
|
+
"@sequencemedia/eslint-config-typescript": "^0.1.153",
|
|
67
|
+
"@sequencemedia/eslint-merge": "^0.0.55",
|
|
68
68
|
"@types/chai": "^5.2.2",
|
|
69
69
|
"@types/debug": "^4.1.12",
|
|
70
70
|
"@types/mocha": "^10.0.10",
|
|
71
|
-
"@types/node": "^24.
|
|
72
|
-
"@typescript-eslint/parser": "^8.
|
|
71
|
+
"@types/node": "^24.7.0",
|
|
72
|
+
"@typescript-eslint/parser": "^8.46.0",
|
|
73
73
|
"chai": "^6.2.0",
|
|
74
74
|
"cross-env": "^10.1.0",
|
|
75
75
|
"eslint": "^9.37.0",
|
|
76
|
-
"eslint-plugin-jsdoc": "^60.8.
|
|
76
|
+
"eslint-plugin-jsdoc": "^60.8.3",
|
|
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
|
@@ -21,14 +21,15 @@ const {
|
|
|
21
21
|
} = JSON.parse(readFileSync(join(PATH, 'package.json')).toString('utf8'))
|
|
22
22
|
|
|
23
23
|
const PLATFORM = platform()
|
|
24
|
-
const HOMEDIR = homedir()
|
|
25
24
|
|
|
26
25
|
const {
|
|
27
26
|
env: {
|
|
28
|
-
HOME
|
|
27
|
+
HOME = homedir()
|
|
29
28
|
}
|
|
30
29
|
} = process
|
|
31
30
|
|
|
31
|
+
const NVM = join(PATH, 'nvm.sh')
|
|
32
|
+
|
|
32
33
|
const BIN = PLATFORM === 'win32'
|
|
33
34
|
? join(PATH, '.\\bin') // \\bash')
|
|
34
35
|
: join(PATH, './bin') // /bash')
|
|
@@ -41,7 +42,7 @@ export {
|
|
|
41
42
|
NAME,
|
|
42
43
|
VERSION,
|
|
43
44
|
PLATFORM,
|
|
44
|
-
HOMEDIR,
|
|
45
45
|
HOME,
|
|
46
|
+
NVM,
|
|
46
47
|
BIN
|
|
47
48
|
}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import stripAnsi from 'strip-ansi'
|
|
2
2
|
|
|
3
|
+
import {
|
|
4
|
+
normalize,
|
|
5
|
+
resolve
|
|
6
|
+
} from 'node:path'
|
|
7
|
+
|
|
3
8
|
import debug from '#deps/src/common/debug'
|
|
4
9
|
|
|
5
10
|
import {
|
|
6
11
|
PLATFORM,
|
|
7
|
-
|
|
12
|
+
HOME
|
|
8
13
|
} from '#deps/src/common/env'
|
|
9
14
|
|
|
10
15
|
const log = debug('@modernpoacher/deps')
|
|
@@ -31,8 +36,12 @@ export function formatAuthor (name, email) {
|
|
|
31
36
|
* @type {(directory: string) => string}
|
|
32
37
|
*/
|
|
33
38
|
export const formatDirectory = PLATFORM === 'win32'
|
|
34
|
-
? (directory) => directory
|
|
35
|
-
: (directory) =>
|
|
39
|
+
? (directory) => resolve(normalize(directory)).trim()
|
|
40
|
+
: (directory) => {
|
|
41
|
+
const d = resolve(normalize(directory)).trim()
|
|
42
|
+
if (d.startsWith(HOME)) return d.replace(new RegExp('^' + HOME), '~')
|
|
43
|
+
return d
|
|
44
|
+
}
|
|
36
45
|
|
|
37
46
|
const LF = String.fromCodePoint(10)
|
|
38
47
|
|
package/src/common/index.mjs
CHANGED
|
@@ -5,16 +5,11 @@
|
|
|
5
5
|
* @typedef {DepsTypes.Configuration} Configuration
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
join
|
|
10
|
-
} from 'node:path'
|
|
11
|
-
|
|
12
|
-
import PATH from '#where-am-i'
|
|
13
|
-
|
|
14
8
|
import debug from '#deps/src/common/debug'
|
|
15
9
|
|
|
16
10
|
import {
|
|
17
|
-
PLATFORM
|
|
11
|
+
PLATFORM,
|
|
12
|
+
NVM
|
|
18
13
|
} from '#deps/src/common/env'
|
|
19
14
|
|
|
20
15
|
import {
|
|
@@ -29,8 +24,6 @@ export const REGISTRY = 'https://registry.npmjs.org'
|
|
|
29
24
|
|
|
30
25
|
export const AUTHOR = 'Modern Poacher Limited <modernpoacher@modernpoacher.com>'
|
|
31
26
|
|
|
32
|
-
export const NVM = join(PATH, 'nvm.sh')
|
|
33
|
-
|
|
34
27
|
const log = debug('@modernpoacher/deps')
|
|
35
28
|
|
|
36
29
|
log('`common` is awake')
|
|
@@ -129,13 +122,13 @@ export function getSaveExactParameter (commands) {
|
|
|
129
122
|
}
|
|
130
123
|
|
|
131
124
|
/**
|
|
132
|
-
* @function
|
|
125
|
+
* @function getBin
|
|
133
126
|
* @description
|
|
134
127
|
* Get the export PATH shell script
|
|
135
128
|
* @param {string} commands - Current commands string
|
|
136
129
|
* @returns {string}
|
|
137
130
|
*/
|
|
138
|
-
export function
|
|
131
|
+
export function getBin (commands) {
|
|
139
132
|
return `
|
|
140
133
|
export PATH=/usr/local/bin:$PATH &> /dev/null
|
|
141
134
|
${commands}
|
|
@@ -165,7 +158,7 @@ ${commands}
|
|
|
165
158
|
*/
|
|
166
159
|
export const getCommands = PLATFORM === 'win32'
|
|
167
160
|
? (commands = 'npm i') => trim(tidy(commands))
|
|
168
|
-
: (commands = 'npm i') => trim(tidy(
|
|
161
|
+
: (commands = 'npm i') => trim(tidy(getBin(getNvm(commands))))
|
|
169
162
|
|
|
170
163
|
/**
|
|
171
164
|
* @function getProdDependencies
|