@modernpoacher/deps 2.2.14 → 2.2.15
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/deps.mjs +2 -8
- package/bin/node/deps.mjs +6 -14
- package/bin/node/execute.mjs +32 -44
- package/bin/node/head.mjs +6 -14
- package/bin/node/install.mjs +2 -8
- package/bin/node/push.mjs +6 -14
- package/bin/node/wipe.mjs +6 -14
- package/package.json +9 -9
- package/src/common/debug.mjs +9 -0
- package/src/common/git/index.mjs +13 -26
- package/src/common/index.mjs +53 -75
- package/src/common/options/index.mjs +14 -15
- package/src/index.mjs +26 -48
- package/src/install/index.mjs +9 -14
package/bin/deps.mjs
CHANGED
|
@@ -6,6 +6,8 @@ import {
|
|
|
6
6
|
Command
|
|
7
7
|
} from 'commander'
|
|
8
8
|
|
|
9
|
+
import '#deps/src/common/debug'
|
|
10
|
+
|
|
9
11
|
import {
|
|
10
12
|
VERSION,
|
|
11
13
|
PLATFORM
|
|
@@ -33,14 +35,6 @@ import {
|
|
|
33
35
|
executeBundle
|
|
34
36
|
} from '#deps/src'
|
|
35
37
|
|
|
36
|
-
const {
|
|
37
|
-
env: {
|
|
38
|
-
DEBUG = '@modernpoacher/deps*'
|
|
39
|
-
}
|
|
40
|
-
} = process
|
|
41
|
-
|
|
42
|
-
debug.enable(DEBUG)
|
|
43
|
-
|
|
44
38
|
const log = debug('@modernpoacher/deps')
|
|
45
39
|
|
|
46
40
|
log(`\`deps\` (${VERSION} - ${PLATFORM}) is awake`)
|
package/bin/node/deps.mjs
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import debug from 'debug'
|
|
4
|
-
|
|
5
3
|
import {
|
|
6
4
|
exec
|
|
7
5
|
} from 'node:child_process'
|
|
@@ -10,11 +8,7 @@ import {
|
|
|
10
8
|
join
|
|
11
9
|
} from 'node:path'
|
|
12
10
|
|
|
13
|
-
import
|
|
14
|
-
getArgs,
|
|
15
|
-
use,
|
|
16
|
-
handleComplete
|
|
17
|
-
} from '#deps/bin/common'
|
|
11
|
+
import '#deps/src/common/debug'
|
|
18
12
|
|
|
19
13
|
import {
|
|
20
14
|
PLATFORM,
|
|
@@ -25,13 +19,11 @@ import {
|
|
|
25
19
|
getOptions
|
|
26
20
|
} from '#deps/src/common/options'
|
|
27
21
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
debug.enable(DEBUG)
|
|
22
|
+
import {
|
|
23
|
+
getArgs,
|
|
24
|
+
use,
|
|
25
|
+
handleComplete
|
|
26
|
+
} from '#deps/bin/common'
|
|
35
27
|
|
|
36
28
|
const command = (
|
|
37
29
|
PLATFORM === 'win32'
|
package/bin/node/execute.mjs
CHANGED
|
@@ -15,6 +15,8 @@ import {
|
|
|
15
15
|
Command
|
|
16
16
|
} from 'commander'
|
|
17
17
|
|
|
18
|
+
import '#deps/src/common/debug'
|
|
19
|
+
|
|
18
20
|
import {
|
|
19
21
|
VERSION,
|
|
20
22
|
PLATFORM
|
|
@@ -53,14 +55,6 @@ import {
|
|
|
53
55
|
getPackage
|
|
54
56
|
} from '#deps/bin/common'
|
|
55
57
|
|
|
56
|
-
const {
|
|
57
|
-
env: {
|
|
58
|
-
DEBUG = '@modernpoacher/deps*'
|
|
59
|
-
}
|
|
60
|
-
} = process
|
|
61
|
-
|
|
62
|
-
debug.enable(DEBUG)
|
|
63
|
-
|
|
64
58
|
const log = debug('@modernpoacher/deps')
|
|
65
59
|
|
|
66
60
|
log(`\`execute\` (${VERSION} - ${PLATFORM}) is awake`)
|
|
@@ -96,13 +90,12 @@ async function isHeadDefaultBranch (directory) {
|
|
|
96
90
|
}
|
|
97
91
|
|
|
98
92
|
/**
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
* Interrogates `.depsrc` or `.depsrc.json` for an `ignore` value
|
|
93
|
+
* @function getIgnoreFromConfiguration
|
|
102
94
|
*
|
|
103
|
-
*
|
|
95
|
+
* Interrogates `.depsrc` or `.depsrc.json` for an `ignore` value
|
|
104
96
|
*
|
|
105
|
-
*
|
|
97
|
+
* @param {string} directory
|
|
98
|
+
* @returns {Promise<boolean>}
|
|
106
99
|
*/
|
|
107
100
|
async function getIgnoreFromConfiguration (directory) {
|
|
108
101
|
log('getIgnoreFromConfiguration')
|
|
@@ -119,13 +112,12 @@ async function getIgnoreFromConfiguration (directory) {
|
|
|
119
112
|
}
|
|
120
113
|
|
|
121
114
|
/**
|
|
122
|
-
*
|
|
115
|
+
* @function getAuthorFromConfiguration
|
|
123
116
|
*
|
|
124
|
-
*
|
|
117
|
+
* Interrogates `.depsrc` or `.depsrc.json` for an `author` value
|
|
125
118
|
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
* @return {Promise<string|null>}
|
|
119
|
+
* @param {string} directory
|
|
120
|
+
* @returns {Promise<string|null>}
|
|
129
121
|
*/
|
|
130
122
|
async function getAuthorFromConfiguration (directory) {
|
|
131
123
|
log('getAuthorFromConfiguration')
|
|
@@ -142,13 +134,12 @@ async function getAuthorFromConfiguration (directory) {
|
|
|
142
134
|
}
|
|
143
135
|
|
|
144
136
|
/**
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
* Interrogates `package.json` for an `author` value
|
|
137
|
+
* @function getAuthorFromPackage
|
|
148
138
|
*
|
|
149
|
-
*
|
|
139
|
+
* Interrogates `package.json` for an `author` value
|
|
150
140
|
*
|
|
151
|
-
*
|
|
141
|
+
* @param {string} directory
|
|
142
|
+
* @returns {Promise<string|null>}
|
|
152
143
|
*/
|
|
153
144
|
async function getAuthorFromPackage (directory) {
|
|
154
145
|
log('getAuthorFromPackage')
|
|
@@ -165,13 +156,12 @@ async function getAuthorFromPackage (directory) {
|
|
|
165
156
|
}
|
|
166
157
|
|
|
167
158
|
/**
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
* Interrogates `.depsrc` or `.depsrc.json` for a `message` value
|
|
159
|
+
* @function getMessageFromConfiguration
|
|
171
160
|
*
|
|
172
|
-
*
|
|
161
|
+
* Interrogates `.depsrc` or `.depsrc.json` for a `message` value
|
|
173
162
|
*
|
|
174
|
-
*
|
|
163
|
+
* @param {string} directory
|
|
164
|
+
* @returns {Promise<string|null>}
|
|
175
165
|
*/
|
|
176
166
|
async function getMessageFromConfiguration (directory) {
|
|
177
167
|
log('getMessageFromConfiguration')
|
|
@@ -188,34 +178,32 @@ async function getMessageFromConfiguration (directory) {
|
|
|
188
178
|
}
|
|
189
179
|
|
|
190
180
|
/**
|
|
191
|
-
*
|
|
181
|
+
* @function toAuthor
|
|
192
182
|
*
|
|
193
|
-
*
|
|
194
|
-
*
|
|
183
|
+
* Ensures that the `author` is set either from the command line,
|
|
184
|
+
* configuration, package, or a default
|
|
195
185
|
*
|
|
196
|
-
*
|
|
186
|
+
* Since it can be null `author` may not default in function arguments
|
|
197
187
|
*
|
|
198
|
-
*
|
|
199
|
-
*
|
|
200
|
-
*
|
|
201
|
-
* @return {Promise<string>}
|
|
188
|
+
* @param {string|null} author
|
|
189
|
+
* @param {string} directory
|
|
190
|
+
* @returns {Promise<string>}
|
|
202
191
|
*/
|
|
203
192
|
async function toAuthor (author, directory) {
|
|
204
193
|
return author || await getAuthorFromConfiguration(directory) || await getAuthorFromPackage(directory) || AUTHOR
|
|
205
194
|
}
|
|
206
195
|
|
|
207
196
|
/**
|
|
208
|
-
*
|
|
209
|
-
*
|
|
210
|
-
* Ensures that the `message` is set either from the command line,
|
|
211
|
-
* configuration, or a default
|
|
197
|
+
* @function toMessage
|
|
212
198
|
*
|
|
213
|
-
*
|
|
199
|
+
* Ensures that the `message` is set either from the command line,
|
|
200
|
+
* configuration, or a default
|
|
214
201
|
*
|
|
215
|
-
*
|
|
216
|
-
* @param {string} directory
|
|
202
|
+
* Since it can be null `message` may not default in function arguments
|
|
217
203
|
*
|
|
218
|
-
*
|
|
204
|
+
* @param {string|null} message
|
|
205
|
+
* @param {string} directory
|
|
206
|
+
* @returns {Promise<string>}
|
|
219
207
|
*/
|
|
220
208
|
async function toMessage (message, directory) {
|
|
221
209
|
return message || await getMessageFromConfiguration(directory) || MESSAGE
|
package/bin/node/head.mjs
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import debug from 'debug'
|
|
4
|
-
|
|
5
3
|
import {
|
|
6
4
|
exec
|
|
7
5
|
} from 'node:child_process'
|
|
@@ -10,11 +8,7 @@ import {
|
|
|
10
8
|
join
|
|
11
9
|
} from 'node:path'
|
|
12
10
|
|
|
13
|
-
import
|
|
14
|
-
getArgs,
|
|
15
|
-
use,
|
|
16
|
-
handleComplete
|
|
17
|
-
} from '#deps/bin/common'
|
|
11
|
+
import '#deps/src/common/debug'
|
|
18
12
|
|
|
19
13
|
import {
|
|
20
14
|
PLATFORM,
|
|
@@ -25,13 +19,11 @@ import {
|
|
|
25
19
|
getOptions
|
|
26
20
|
} from '#deps/src/common/options'
|
|
27
21
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
debug.enable(DEBUG)
|
|
22
|
+
import {
|
|
23
|
+
getArgs,
|
|
24
|
+
use,
|
|
25
|
+
handleComplete
|
|
26
|
+
} from '#deps/bin/common'
|
|
35
27
|
|
|
36
28
|
const command = (
|
|
37
29
|
PLATFORM === 'win32'
|
package/bin/node/install.mjs
CHANGED
|
@@ -6,6 +6,8 @@ import {
|
|
|
6
6
|
Command
|
|
7
7
|
} from 'commander'
|
|
8
8
|
|
|
9
|
+
import '#deps/src/common/debug'
|
|
10
|
+
|
|
9
11
|
import {
|
|
10
12
|
VERSION,
|
|
11
13
|
PLATFORM
|
|
@@ -31,14 +33,6 @@ import {
|
|
|
31
33
|
execute
|
|
32
34
|
} from '#deps/src/install'
|
|
33
35
|
|
|
34
|
-
const {
|
|
35
|
-
env: {
|
|
36
|
-
DEBUG = '@modernpoacher/deps*'
|
|
37
|
-
}
|
|
38
|
-
} = process
|
|
39
|
-
|
|
40
|
-
debug.enable(DEBUG)
|
|
41
|
-
|
|
42
36
|
const log = debug('@modernpoacher/deps')
|
|
43
37
|
|
|
44
38
|
log(`\`install\` (${VERSION} - ${PLATFORM}) is awake`)
|
package/bin/node/push.mjs
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import debug from 'debug'
|
|
4
|
-
|
|
5
3
|
import {
|
|
6
4
|
exec
|
|
7
5
|
} from 'node:child_process'
|
|
@@ -10,11 +8,7 @@ import {
|
|
|
10
8
|
join
|
|
11
9
|
} from 'node:path'
|
|
12
10
|
|
|
13
|
-
import
|
|
14
|
-
getArgs,
|
|
15
|
-
use,
|
|
16
|
-
handleComplete
|
|
17
|
-
} from '#deps/bin/common'
|
|
11
|
+
import '#deps/src/common/debug'
|
|
18
12
|
|
|
19
13
|
import {
|
|
20
14
|
PLATFORM,
|
|
@@ -25,13 +19,11 @@ import {
|
|
|
25
19
|
getOptions
|
|
26
20
|
} from '#deps/src/common/options'
|
|
27
21
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
debug.enable(DEBUG)
|
|
22
|
+
import {
|
|
23
|
+
getArgs,
|
|
24
|
+
use,
|
|
25
|
+
handleComplete
|
|
26
|
+
} from '#deps/bin/common'
|
|
35
27
|
|
|
36
28
|
const command = (
|
|
37
29
|
PLATFORM === 'win32'
|
package/bin/node/wipe.mjs
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import debug from 'debug'
|
|
4
|
-
|
|
5
3
|
import {
|
|
6
4
|
exec
|
|
7
5
|
} from 'node:child_process'
|
|
@@ -10,12 +8,6 @@ import {
|
|
|
10
8
|
join
|
|
11
9
|
} from 'node:path'
|
|
12
10
|
|
|
13
|
-
import {
|
|
14
|
-
getArgs,
|
|
15
|
-
use,
|
|
16
|
-
handleComplete
|
|
17
|
-
} from '#deps/bin/common'
|
|
18
|
-
|
|
19
11
|
import {
|
|
20
12
|
PLATFORM,
|
|
21
13
|
BIN
|
|
@@ -25,13 +17,13 @@ import {
|
|
|
25
17
|
getOptions
|
|
26
18
|
} from '#deps/src/common/options'
|
|
27
19
|
|
|
28
|
-
|
|
29
|
-
env: {
|
|
30
|
-
DEBUG = '@modernpoacher/deps*'
|
|
31
|
-
}
|
|
32
|
-
} = process
|
|
20
|
+
import '#deps/src/common/debug'
|
|
33
21
|
|
|
34
|
-
|
|
22
|
+
import {
|
|
23
|
+
getArgs,
|
|
24
|
+
use,
|
|
25
|
+
handleComplete
|
|
26
|
+
} from '#deps/bin/common'
|
|
35
27
|
|
|
36
28
|
const command = (
|
|
37
29
|
PLATFORM === 'win32'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modernpoacher/deps",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.15",
|
|
4
4
|
"description": "Update NPM package dependencies from the command line",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"deps",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
},
|
|
20
20
|
"license": "ISC",
|
|
21
21
|
"engines": {
|
|
22
|
-
"node": ">=
|
|
22
|
+
"node": ">=22.11.0"
|
|
23
23
|
},
|
|
24
24
|
"repository": {
|
|
25
25
|
"type": "git",
|
|
@@ -53,24 +53,24 @@
|
|
|
53
53
|
"deps-wipe": "bin/deps/wipe.sh"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"commander": "^13.
|
|
56
|
+
"commander": "^13.1.0",
|
|
57
57
|
"debug": "^4.4.0",
|
|
58
58
|
"glob": "^11.0.1",
|
|
59
59
|
"strip-ansi": "^7.1.0",
|
|
60
60
|
"supports-color": "^10.0.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"@babel/core": "^7.26.
|
|
64
|
-
"@babel/eslint-parser": "^7.
|
|
65
|
-
"@babel/preset-env": "^7.26.
|
|
63
|
+
"@babel/core": "^7.26.10",
|
|
64
|
+
"@babel/eslint-parser": "^7.26.10",
|
|
65
|
+
"@babel/preset-env": "^7.26.9",
|
|
66
66
|
"@babel/register": "^7.25.9",
|
|
67
|
-
"chai": "^5.
|
|
68
|
-
"core-js": "^3.
|
|
67
|
+
"chai": "^5.2.0",
|
|
68
|
+
"core-js": "^3.41.0",
|
|
69
69
|
"cross-env": "^7.0.3",
|
|
70
70
|
"eslint": "8.57.1",
|
|
71
71
|
"eslint-config-standard": "^17.1.0",
|
|
72
72
|
"husky": "^9.1.7",
|
|
73
|
-
"mocha": "^11.0
|
|
73
|
+
"mocha": "^11.1.0"
|
|
74
74
|
},
|
|
75
75
|
"imports": {
|
|
76
76
|
"#deps/bin": "./bin/index.mjs",
|
package/src/common/git/index.mjs
CHANGED
|
@@ -150,8 +150,7 @@ export function err (key, directory) {
|
|
|
150
150
|
* Get an error code from an error
|
|
151
151
|
*
|
|
152
152
|
* @param {Error}
|
|
153
|
-
*
|
|
154
|
-
* @return {number}
|
|
153
|
+
* @returns {number}
|
|
155
154
|
*/
|
|
156
155
|
const getErrorCode = ({ code = 0 } = {}) => code
|
|
157
156
|
|
|
@@ -161,8 +160,7 @@ const getErrorCode = ({ code = 0 } = {}) => code
|
|
|
161
160
|
* Get an error message from an error
|
|
162
161
|
*
|
|
163
162
|
* @param {Error}
|
|
164
|
-
*
|
|
165
|
-
* @return {string}
|
|
163
|
+
* @returns {string}
|
|
166
164
|
*/
|
|
167
165
|
const getErrorMessage = ({ message = '' } = {}) => message
|
|
168
166
|
|
|
@@ -172,8 +170,7 @@ const getErrorMessage = ({ message = '' } = {}) => message
|
|
|
172
170
|
* Determine whether an error is a safe non-zero exit from a Git command
|
|
173
171
|
*
|
|
174
172
|
* @param {Error}
|
|
175
|
-
*
|
|
176
|
-
* @return {boolean}
|
|
173
|
+
* @returns {boolean}
|
|
177
174
|
*/
|
|
178
175
|
function isCommandError (e) {
|
|
179
176
|
log('isCommandError')
|
|
@@ -190,8 +187,7 @@ function isCommandError (e) {
|
|
|
190
187
|
* Get the default branch from `.git/refs/remotes/origin/HEAD`
|
|
191
188
|
*
|
|
192
189
|
* @param {string} d - A directory configured for Git
|
|
193
|
-
*
|
|
194
|
-
* @return {Promise<string>}
|
|
190
|
+
* @returns {Promise<string>}
|
|
195
191
|
*/
|
|
196
192
|
export function catGitRefsRemotesOriginHead (d = DIRECTORY) {
|
|
197
193
|
log('catGitRefsRemotesOriginHead')
|
|
@@ -224,8 +220,7 @@ export function catGitRefsRemotesOriginHead (d = DIRECTORY) {
|
|
|
224
220
|
* Get the remote default branch
|
|
225
221
|
*
|
|
226
222
|
* @param {string} d - A directory configured for Git
|
|
227
|
-
*
|
|
228
|
-
* @return {Promise<string>}
|
|
223
|
+
* @returns {Promise<string>}
|
|
229
224
|
*/
|
|
230
225
|
export function awkGitRemoteShowOriginHead (d = DIRECTORY) {
|
|
231
226
|
log('awkGitRemoteShowOriginHead')
|
|
@@ -258,8 +253,7 @@ export function awkGitRemoteShowOriginHead (d = DIRECTORY) {
|
|
|
258
253
|
* Determine whether a directory is configured for Git
|
|
259
254
|
*
|
|
260
255
|
* @param {string} d - A directory
|
|
261
|
-
*
|
|
262
|
-
* @return {Promise<string>}
|
|
256
|
+
* @returns {Promise<string>}
|
|
263
257
|
*/
|
|
264
258
|
export function gitRevParseShowTopLevel (d = DIRECTORY) {
|
|
265
259
|
log('gitRevParseShowTopLevel')
|
|
@@ -292,8 +286,7 @@ export function gitRevParseShowTopLevel (d = DIRECTORY) {
|
|
|
292
286
|
* Determine which branch is HEAD
|
|
293
287
|
*
|
|
294
288
|
* @param {string} d - A directory
|
|
295
|
-
*
|
|
296
|
-
* @return {Promise<string>}
|
|
289
|
+
* @returns {Promise<string>}
|
|
297
290
|
*/
|
|
298
291
|
export function gitRevParseAbbrevRefHead (d = DIRECTORY) {
|
|
299
292
|
log('gitRevParseAbbrevRefHead')
|
|
@@ -327,8 +320,7 @@ export function gitRevParseAbbrevRefHead (d = DIRECTORY) {
|
|
|
327
320
|
*
|
|
328
321
|
* @param {string} d - A directory configured for Git
|
|
329
322
|
* @param {string} branch - The Git branch
|
|
330
|
-
*
|
|
331
|
-
* @return {Promise<string>}
|
|
323
|
+
* @returns {Promise<string>}
|
|
332
324
|
*/
|
|
333
325
|
export function gitCheckout (d = DIRECTORY, branch = BRANCH) {
|
|
334
326
|
log('gitCheckout')
|
|
@@ -365,8 +357,7 @@ export function gitCheckout (d = DIRECTORY, branch = BRANCH) {
|
|
|
365
357
|
* Pull changes from the Git remote
|
|
366
358
|
*
|
|
367
359
|
* @param {string} d - A directory configured for Git
|
|
368
|
-
*
|
|
369
|
-
* @return {Promise<string>}
|
|
360
|
+
* @returns {Promise<string>}
|
|
370
361
|
*/
|
|
371
362
|
export function gitPull (d = DIRECTORY) {
|
|
372
363
|
log('gitPull')
|
|
@@ -403,8 +394,7 @@ export function gitPull (d = DIRECTORY) {
|
|
|
403
394
|
* Push changes to the Git remote
|
|
404
395
|
*
|
|
405
396
|
* @param {string} d - A directory configured for Git
|
|
406
|
-
*
|
|
407
|
-
* @return {Promise<string>}
|
|
397
|
+
* @returns {Promise<string>}
|
|
408
398
|
*/
|
|
409
399
|
export function gitPush (d = DIRECTORY) {
|
|
410
400
|
log('gitPush')
|
|
@@ -441,8 +431,7 @@ export function gitPush (d = DIRECTORY) {
|
|
|
441
431
|
* Push tags changes to the Git remote
|
|
442
432
|
*
|
|
443
433
|
* @param {string} d - A directory configured for Git
|
|
444
|
-
*
|
|
445
|
-
* @return {Promise<string>}
|
|
434
|
+
* @returns {Promise<string>}
|
|
446
435
|
*/
|
|
447
436
|
export function gitPushTags (d = DIRECTORY) {
|
|
448
437
|
log('gitPushTags')
|
|
@@ -480,8 +469,7 @@ export function gitPushTags (d = DIRECTORY) {
|
|
|
480
469
|
*
|
|
481
470
|
* @param {string} d - A directory configured for Git
|
|
482
471
|
* @param {string} add - An add parameter
|
|
483
|
-
*
|
|
484
|
-
* @return {Promise<string>}
|
|
472
|
+
* @returns {Promise<string>}
|
|
485
473
|
*/
|
|
486
474
|
export function gitAdd (d = DIRECTORY, add = ADD) {
|
|
487
475
|
log('gitAdd')
|
|
@@ -520,8 +508,7 @@ export function gitAdd (d = DIRECTORY, add = ADD) {
|
|
|
520
508
|
* @param {string} c - A directory configured for Git
|
|
521
509
|
* @param {string} message - A commit message
|
|
522
510
|
* @param {string} author - The commit author
|
|
523
|
-
*
|
|
524
|
-
* @return {Promise<string>}
|
|
511
|
+
* @returns {Promise<string>}
|
|
525
512
|
*/
|
|
526
513
|
export function gitCommit (d = DIRECTORY, message = MESSAGE, author = AUTHOR) {
|
|
527
514
|
log('gitCommit')
|
package/src/common/index.mjs
CHANGED
|
@@ -1,36 +1,40 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* Package or configuration dependencies
|
|
3
|
+
*
|
|
4
|
+
* @typedef {Record<string, string>} Dependencies
|
|
4
5
|
*/
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* A dependency descriptor
|
|
9
|
+
*
|
|
10
|
+
* @typedef {Object} DependencyDescriptor
|
|
11
|
+
* @property {string} name - Dependency name in NPM.
|
|
12
|
+
* @property {string} version - Dependency version or "latest".
|
|
11
13
|
*/
|
|
12
14
|
|
|
13
15
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
16
|
+
* A package
|
|
17
|
+
*
|
|
18
|
+
* @typedef {Object} Package
|
|
19
|
+
* @property {string|{name: string, email: string}} author
|
|
20
|
+
* @property {Dependencies} dependencies - Production dependencies.
|
|
21
|
+
* @property {Dependencies} devDependencies - Development dependencies.
|
|
22
|
+
* @property {Dependencies} optionalDependencies - Optional dependencies.
|
|
23
|
+
* @property {Dependencies} bundleDependencies - Bundle dependencies.
|
|
24
|
+
* @property {Dependencies} peerDependencies - Peer dependencies
|
|
22
25
|
*/
|
|
23
26
|
|
|
24
27
|
/**
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
28
|
+
* A configuration
|
|
29
|
+
*
|
|
30
|
+
* @typedef {Object} Configuration
|
|
31
|
+
* @property {string|{name: string, email: string}} author
|
|
32
|
+
* @property {boolean} ignore
|
|
33
|
+
* @property {Dependencies} dependencies - Production dependencies.
|
|
34
|
+
* @property {Dependencies} devDependencies - Development dependencies.
|
|
35
|
+
* @property {Dependencies} optionalDependencies - Optional dependencies.
|
|
36
|
+
* @property {Dependencies} bundleDependencies - Bundle dependencies.
|
|
37
|
+
* @property {Dependencies} peerDependencies - Peer dependencies
|
|
34
38
|
*/
|
|
35
39
|
|
|
36
40
|
import debug from 'debug'
|
|
@@ -68,8 +72,7 @@ export const trim = (v) => v.split(String.fromCharCode(10)).map((v) => v.trimEnd
|
|
|
68
72
|
* Get the `--save-prod` parameter
|
|
69
73
|
*
|
|
70
74
|
* @param {string} current commands string
|
|
71
|
-
*
|
|
72
|
-
* @return {string}
|
|
75
|
+
* @returns {string}
|
|
73
76
|
*/
|
|
74
77
|
export const getSaveProdParameter = (commands) => commands.concat(' --save-prod')
|
|
75
78
|
|
|
@@ -79,8 +82,7 @@ export const getSaveProdParameter = (commands) => commands.concat(' --save-prod'
|
|
|
79
82
|
* Get the `--save-dev` parameter
|
|
80
83
|
*
|
|
81
84
|
* @param {string} current commands string
|
|
82
|
-
*
|
|
83
|
-
* @return {string}
|
|
85
|
+
* @returns {string}
|
|
84
86
|
*/
|
|
85
87
|
export const getSaveDevParameter = (commands) => commands.concat(' --save-dev')
|
|
86
88
|
|
|
@@ -90,8 +92,7 @@ export const getSaveDevParameter = (commands) => commands.concat(' --save-dev')
|
|
|
90
92
|
* Get the "save bundle" parameter
|
|
91
93
|
*
|
|
92
94
|
* @param {string} commands - Current commands string
|
|
93
|
-
*
|
|
94
|
-
* @return {string}
|
|
95
|
+
* @returns {string}
|
|
95
96
|
*/
|
|
96
97
|
export const getSaveBundleParameter = (commands) => commands.concat(' --save-bundle')
|
|
97
98
|
|
|
@@ -101,8 +102,7 @@ export const getSaveBundleParameter = (commands) => commands.concat(' --save-bun
|
|
|
101
102
|
* Get the `--save-optional` parameter
|
|
102
103
|
*
|
|
103
104
|
* @param {string} commands - Current commands string
|
|
104
|
-
*
|
|
105
|
-
* @return {string}
|
|
105
|
+
* @returns {string}
|
|
106
106
|
*/
|
|
107
107
|
export const getSaveOptionalParameter = (commands) => commands.concat(' --save-optional')
|
|
108
108
|
|
|
@@ -113,8 +113,7 @@ export const getSaveOptionalParameter = (commands) => commands.concat(' --save-o
|
|
|
113
113
|
*
|
|
114
114
|
* @param {string} r - Registry
|
|
115
115
|
* @param {string} commands - Current commands string
|
|
116
|
-
*
|
|
117
|
-
* @return {string}
|
|
116
|
+
* @returns {string}
|
|
118
117
|
*/
|
|
119
118
|
export const getRegistryParameter = (r, commands) => r ? commands.concat(` --registry ${r}`) : commands
|
|
120
119
|
|
|
@@ -125,8 +124,7 @@ export const getRegistryParameter = (r, commands) => r ? commands.concat(` --reg
|
|
|
125
124
|
*
|
|
126
125
|
* @param {boolean} f - Force
|
|
127
126
|
* @param {string} commands - Current commands string
|
|
128
|
-
*
|
|
129
|
-
* @return {string}
|
|
127
|
+
* @returns {string}
|
|
130
128
|
*/
|
|
131
129
|
export const getForceParameter = (f, commands) => f ? commands.concat(' --force') : commands
|
|
132
130
|
|
|
@@ -137,8 +135,7 @@ export const getForceParameter = (f, commands) => f ? commands.concat(' --force'
|
|
|
137
135
|
*
|
|
138
136
|
* @param {boolean} s - Save
|
|
139
137
|
* @param {string} commands - Current commands string
|
|
140
|
-
*
|
|
141
|
-
* @return {string}
|
|
138
|
+
* @returns {string}
|
|
142
139
|
*/
|
|
143
140
|
export const getNoSaveParameter = (s, commands) => s ? commands : commands.concat(' --no-save')
|
|
144
141
|
|
|
@@ -148,8 +145,7 @@ export const getNoSaveParameter = (s, commands) => s ? commands : commands.conca
|
|
|
148
145
|
* Get the `--save-exact` parameter
|
|
149
146
|
*
|
|
150
147
|
* @param {string} commands - Current commands string
|
|
151
|
-
*
|
|
152
|
-
* @return {string}
|
|
148
|
+
* @returns {string}
|
|
153
149
|
*/
|
|
154
150
|
export const getSaveExactParameter = (commands) => commands.concat(' --save-exact')
|
|
155
151
|
|
|
@@ -159,8 +155,7 @@ export const getSaveExactParameter = (commands) => commands.concat(' --save-exac
|
|
|
159
155
|
* Get the export PATH shell script
|
|
160
156
|
*
|
|
161
157
|
* @param {string} commands - Current commands string
|
|
162
|
-
*
|
|
163
|
-
* @return {string}
|
|
158
|
+
* @returns {string}
|
|
164
159
|
*/
|
|
165
160
|
export const getExportPath = (commands) => `
|
|
166
161
|
export PATH=/usr/local/bin:$PATH &> /dev/null
|
|
@@ -173,8 +168,7 @@ ${commands}
|
|
|
173
168
|
* Get the NVM shell script
|
|
174
169
|
*
|
|
175
170
|
* @param {string} commands - Current commands string
|
|
176
|
-
*
|
|
177
|
-
* @return {string}
|
|
171
|
+
* @returns {string}
|
|
178
172
|
*/
|
|
179
173
|
export const getNvm = (commands) => `
|
|
180
174
|
bash "${NVM}" 2> /dev/null
|
|
@@ -187,8 +181,7 @@ ${commands}
|
|
|
187
181
|
* Get the installation shell script
|
|
188
182
|
*
|
|
189
183
|
* @param {string} commands - Current commands string
|
|
190
|
-
*
|
|
191
|
-
* @return {string}
|
|
184
|
+
* @returns {string}
|
|
192
185
|
*/
|
|
193
186
|
export const getCommands = PLATFORM === 'win32'
|
|
194
187
|
? (commands = 'npm i') => tidy(commands)
|
|
@@ -200,8 +193,7 @@ export const getCommands = PLATFORM === 'win32'
|
|
|
200
193
|
* Get the production dependencies by destructuring the package or configuration
|
|
201
194
|
*
|
|
202
195
|
* @param {Package|Configuration}
|
|
203
|
-
*
|
|
204
|
-
* @return {Dependencies}
|
|
196
|
+
* @returns {Dependencies}
|
|
205
197
|
*/
|
|
206
198
|
export const getProdDependencies = ({ dependencies = {} } = {}) => dependencies
|
|
207
199
|
|
|
@@ -211,8 +203,7 @@ export const getProdDependencies = ({ dependencies = {} } = {}) => dependencies
|
|
|
211
203
|
* Get the development dependencies by destructuring the package or configuration
|
|
212
204
|
*
|
|
213
205
|
* @param {Package|Configuration}
|
|
214
|
-
*
|
|
215
|
-
* @return {Dependencies}
|
|
206
|
+
* @returns {Dependencies}
|
|
216
207
|
*/
|
|
217
208
|
export const getDevDependencies = ({ devDependencies = {} } = {}) => devDependencies
|
|
218
209
|
|
|
@@ -222,8 +213,7 @@ export const getDevDependencies = ({ devDependencies = {} } = {}) => devDependen
|
|
|
222
213
|
* Get the optional dependencies by destructuring the package or configuration
|
|
223
214
|
*
|
|
224
215
|
* @param {Package|Configuration}
|
|
225
|
-
*
|
|
226
|
-
* @return {Dependencies}
|
|
216
|
+
* @returns {Dependencies}
|
|
227
217
|
*/
|
|
228
218
|
export const getOptionalDependencies = ({ optionalDependencies = {} } = {}) => optionalDependencies
|
|
229
219
|
|
|
@@ -233,8 +223,7 @@ export const getOptionalDependencies = ({ optionalDependencies = {} } = {}) => o
|
|
|
233
223
|
* Get the bundle dependencies by destructuring the package or configuration
|
|
234
224
|
*
|
|
235
225
|
* @param {Package|Configuration}
|
|
236
|
-
*
|
|
237
|
-
* @return {Dependencies}
|
|
226
|
+
* @returns {Dependencies}
|
|
238
227
|
*/
|
|
239
228
|
export const getBundleDependencies = ({ bundleDependencies = {} } = {}) => bundleDependencies
|
|
240
229
|
|
|
@@ -244,8 +233,7 @@ export const getBundleDependencies = ({ bundleDependencies = {} } = {}) => bundl
|
|
|
244
233
|
* Get the peer dependencies by destructuring the package or configuration
|
|
245
234
|
*
|
|
246
235
|
* @param {Package|Configuration}
|
|
247
|
-
*
|
|
248
|
-
* @return {Dependencies}
|
|
236
|
+
* @returns {Dependencies}
|
|
249
237
|
*/
|
|
250
238
|
export const getPeerDependencies = ({ peerDependencies } = {}) => peerDependencies
|
|
251
239
|
|
|
@@ -255,8 +243,7 @@ export const getPeerDependencies = ({ peerDependencies } = {}) => peerDependenci
|
|
|
255
243
|
* Get the ignore flag by destructuring the configuration
|
|
256
244
|
*
|
|
257
245
|
* @param {Configuration}
|
|
258
|
-
*
|
|
259
|
-
* @return {boolean}
|
|
246
|
+
* @returns {boolean}
|
|
260
247
|
*/
|
|
261
248
|
export const getIgnore = ({ ignore = false } = {}) => ignore === true
|
|
262
249
|
|
|
@@ -266,8 +253,7 @@ export const getIgnore = ({ ignore = false } = {}) => ignore === true
|
|
|
266
253
|
* Get the author by destructuring the package or configuration
|
|
267
254
|
*
|
|
268
255
|
* @param {Package|Configuration}
|
|
269
|
-
*
|
|
270
|
-
* @return {string|null}
|
|
256
|
+
* @returns {string|null}
|
|
271
257
|
*/
|
|
272
258
|
export const getAuthor = ({ author = '' } = {}) => {
|
|
273
259
|
if ((author || false) instanceof Object) {
|
|
@@ -295,8 +281,7 @@ export const getAuthor = ({ author = '' } = {}) => {
|
|
|
295
281
|
* Get the message by destructuring the configuration
|
|
296
282
|
*
|
|
297
283
|
* @param {Configuration}
|
|
298
|
-
*
|
|
299
|
-
* @return {string|null}
|
|
284
|
+
* @returns {string|null}
|
|
300
285
|
*/
|
|
301
286
|
export const getMessage = ({ message = '' } = {}) => message || null
|
|
302
287
|
|
|
@@ -306,8 +291,7 @@ export const getMessage = ({ message = '' } = {}) => message || null
|
|
|
306
291
|
* Determine whether the dependency is a pre-release with a Regular Expression
|
|
307
292
|
*
|
|
308
293
|
* @param {string} v
|
|
309
|
-
*
|
|
310
|
-
* @return {boolean}
|
|
294
|
+
* @returns {boolean}
|
|
311
295
|
*/
|
|
312
296
|
export const isPreRelease = (v) => /-/.test(v)
|
|
313
297
|
|
|
@@ -317,8 +301,7 @@ export const isPreRelease = (v) => /-/.test(v)
|
|
|
317
301
|
* Determine whether the dependency is exact with a Regular Expression
|
|
318
302
|
*
|
|
319
303
|
* @param {string} v
|
|
320
|
-
*
|
|
321
|
-
* @return {boolean}
|
|
304
|
+
* @returns {boolean}
|
|
322
305
|
*/
|
|
323
306
|
export const isExact = (v) => /^\d/.test(v)
|
|
324
307
|
|
|
@@ -329,8 +312,7 @@ export const isExact = (v) => /^\d/.test(v)
|
|
|
329
312
|
*
|
|
330
313
|
* @param {Dependencies} packageDependencies - Package dependencies
|
|
331
314
|
* @param {Dependencies} configurationDependencies - Configuration dependencies
|
|
332
|
-
*
|
|
333
|
-
* @return {DependencyDescriptor[]}
|
|
315
|
+
* @returns {DependencyDescriptor[]}
|
|
334
316
|
*/
|
|
335
317
|
export function getDepsExact (packageDependencies, configurationDependencies) {
|
|
336
318
|
log('getDepsExact')
|
|
@@ -351,8 +333,7 @@ export function getDepsExact (packageDependencies, configurationDependencies) {
|
|
|
351
333
|
* Get an array of dependencies to be installed
|
|
352
334
|
*
|
|
353
335
|
* @param {Dependencies} packageDependencies - Package dependencies
|
|
354
|
-
*
|
|
355
|
-
* @return {DependencyDescriptor[]}
|
|
336
|
+
* @returns {DependencyDescriptor[]}
|
|
356
337
|
*/
|
|
357
338
|
export function getDeps (packageDependencies) {
|
|
358
339
|
log('getDeps')
|
|
@@ -375,8 +356,7 @@ export function getDeps (packageDependencies) {
|
|
|
375
356
|
* Normalise the commands string
|
|
376
357
|
*
|
|
377
358
|
* @param {string} value
|
|
378
|
-
*
|
|
379
|
-
* @return {string}
|
|
359
|
+
* @returns {string}
|
|
380
360
|
*/
|
|
381
361
|
export function normalizeCommands (commands) {
|
|
382
362
|
const s = String.fromCharCode(32)
|
|
@@ -396,8 +376,7 @@ export function normalizeCommands (commands) {
|
|
|
396
376
|
* Transform by destructuring the value
|
|
397
377
|
*
|
|
398
378
|
* @param {DependencyDescriptor}
|
|
399
|
-
*
|
|
400
|
-
* @return {string}
|
|
379
|
+
* @returns {string}
|
|
401
380
|
*/
|
|
402
381
|
export const transformDependency = ({ name = '@modernpoacher/deps', version = 'latest' } = {}) => `${name}@${version}`
|
|
403
382
|
|
|
@@ -407,8 +386,7 @@ export const transformDependency = ({ name = '@modernpoacher/deps', version = 'l
|
|
|
407
386
|
* Transform the parameter to a string
|
|
408
387
|
*
|
|
409
388
|
* @param {DependencyDescriptor|DependencyDescriptor[]} value
|
|
410
|
-
*
|
|
411
|
-
* @return {string}
|
|
389
|
+
* @returns {string}
|
|
412
390
|
*/
|
|
413
391
|
export function transform (value) {
|
|
414
392
|
log('transform')
|
|
@@ -39,21 +39,20 @@ log(`\`common/options\` (${VERSION} - ${PLATFORM}) is awake`)
|
|
|
39
39
|
* Get the installation `exec` child process options
|
|
40
40
|
*
|
|
41
41
|
* @param {string} cwd normalized directory
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
|
|
56
|
-
*/
|
|
42
|
+
* @returns {{
|
|
43
|
+
* maxBuffer: number,
|
|
44
|
+
* stdio: string
|
|
45
|
+
* env: {
|
|
46
|
+
* DEBUG_COLORS: string,
|
|
47
|
+
* FORCE_COLOR: number,
|
|
48
|
+
* NODE_OPTIONS: string,
|
|
49
|
+
* SSH_AUTH_SOCK?: string,
|
|
50
|
+
* HOME?: string,
|
|
51
|
+
* PATH?: string
|
|
52
|
+
* }
|
|
53
|
+
* cwd: string
|
|
54
|
+
* }}
|
|
55
|
+
*/
|
|
57
56
|
export function getOptions (cwd) {
|
|
58
57
|
log('getOptions')
|
|
59
58
|
|
package/src/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* Package or configuration dependencies
|
|
3
|
+
* @typedef {import('./common/index.mjs').Dependencies} Dependencies
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* Dependency descriptor
|
|
8
|
+
* @typedef {import('./common/index.mjs').DependencyDescriptor} DependencyDescriptor
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import debug from 'debug'
|
|
@@ -77,8 +77,7 @@ export function use (key) {
|
|
|
77
77
|
* @param {DependencyDescriptor|DependencyDescriptor[]} deps - Dependency descriptor(s)
|
|
78
78
|
* @param {string} r - Registry
|
|
79
79
|
* @param {boolean} f - Force
|
|
80
|
-
*
|
|
81
|
-
* @return {string}
|
|
80
|
+
* @returns {string}
|
|
82
81
|
*/
|
|
83
82
|
export function getInstallSaveExactCommands (deps, r, f) {
|
|
84
83
|
log('getInstallSaveExactCommands')
|
|
@@ -96,8 +95,7 @@ export function getInstallSaveExactCommands (deps, r, f) {
|
|
|
96
95
|
* @param {DependencyDescriptor|DependencyDescriptor[]} deps - Dependency descriptor(s)
|
|
97
96
|
* @param {string} r - Registry
|
|
98
97
|
* @param {boolean} f - Force
|
|
99
|
-
*
|
|
100
|
-
* @return {string}
|
|
98
|
+
* @returns {string}
|
|
101
99
|
*/
|
|
102
100
|
export function getInstallCommands (deps, r, f) {
|
|
103
101
|
log('getInstallCommands')
|
|
@@ -115,8 +113,7 @@ export function getInstallCommands (deps, r, f) {
|
|
|
115
113
|
* @param {DependencyDescriptor|DependencyDescriptor[]} deps - Dependency descriptor(s)
|
|
116
114
|
* @param {string} r - Registry
|
|
117
115
|
* @param {boolean} f - Force
|
|
118
|
-
*
|
|
119
|
-
* @return {string}
|
|
116
|
+
* @returns {string}
|
|
120
117
|
*/
|
|
121
118
|
export function getInstallSaveBundleSaveExactCommands (deps, r, f) {
|
|
122
119
|
log('getInstallSaveBundleSaveExactCommands')
|
|
@@ -138,8 +135,7 @@ export function getInstallSaveBundleSaveExactCommands (deps, r, f) {
|
|
|
138
135
|
* @param {DependencyDescriptor|DependencyDescriptor[]} deps - Dependency descriptor(s)
|
|
139
136
|
* @param {string} r - Registry
|
|
140
137
|
* @param {boolean} f - Force
|
|
141
|
-
*
|
|
142
|
-
* @return {string}
|
|
138
|
+
* @returns {string}
|
|
143
139
|
*/
|
|
144
140
|
export function getInstallSaveBundleCommands (deps, r, f) {
|
|
145
141
|
log('getInstallSaveBundleCommands')
|
|
@@ -161,8 +157,7 @@ export function getInstallSaveBundleCommands (deps, r, f) {
|
|
|
161
157
|
* @param {DependencyDescriptor|DependencyDescriptor[]} deps - Dependency descriptor(s)
|
|
162
158
|
* @param {string} r - Registry
|
|
163
159
|
* @param {boolean} f - Force
|
|
164
|
-
*
|
|
165
|
-
* @return {string}
|
|
160
|
+
* @returns {string}
|
|
166
161
|
*/
|
|
167
162
|
export function getInstallSaveOptionalSaveExactCommands (deps, r, f) {
|
|
168
163
|
log('getInstallSaveOptionalSaveExactCommands')
|
|
@@ -184,8 +179,7 @@ export function getInstallSaveOptionalSaveExactCommands (deps, r, f) {
|
|
|
184
179
|
* @param {DependencyDescriptor|DependencyDescriptor[]} deps - Dependency descriptor(s)
|
|
185
180
|
* @param {string} r - Registry
|
|
186
181
|
* @param {boolean} f - Force
|
|
187
|
-
*
|
|
188
|
-
* @return {string}
|
|
182
|
+
* @returns {string}
|
|
189
183
|
*/
|
|
190
184
|
export function getInstallSaveOptionalCommands (deps, r, f) {
|
|
191
185
|
log('getInstallSaveOptionalCommands')
|
|
@@ -207,8 +201,7 @@ export function getInstallSaveOptionalCommands (deps, r, f) {
|
|
|
207
201
|
* @param {DependencyDescriptor|DependencyDescriptor[]} deps - Dependency descriptor(s)
|
|
208
202
|
* @param {string} r - Registry
|
|
209
203
|
* @param {boolean} f - Force
|
|
210
|
-
*
|
|
211
|
-
* @return {string}
|
|
204
|
+
* @returns {string}
|
|
212
205
|
*/
|
|
213
206
|
export function getInstallSaveDevSaveExactCommands (deps, r, f) {
|
|
214
207
|
log('getInstallSaveDevSaveExactCommands')
|
|
@@ -230,8 +223,7 @@ export function getInstallSaveDevSaveExactCommands (deps, r, f) {
|
|
|
230
223
|
* @param {DependencyDescriptor|DependencyDescriptor[]} deps - Dependency descriptor(s)
|
|
231
224
|
* @param {string} r - Registry
|
|
232
225
|
* @param {boolean} f - Force
|
|
233
|
-
*
|
|
234
|
-
* @return {string}
|
|
226
|
+
* @returns {string}
|
|
235
227
|
*/
|
|
236
228
|
export function getInstallSaveDevCommands (deps, r, f) {
|
|
237
229
|
log('getInstallSaveDevCommands')
|
|
@@ -253,8 +245,7 @@ export function getInstallSaveDevCommands (deps, r, f) {
|
|
|
253
245
|
* @param {DependencyDescriptor|DependencyDescriptor[]} deps - Dependency descriptor(s)
|
|
254
246
|
* @param {string} r - Registry
|
|
255
247
|
* @param {boolean} f - Force
|
|
256
|
-
*
|
|
257
|
-
* @return {string}
|
|
248
|
+
* @returns {string}
|
|
258
249
|
*/
|
|
259
250
|
export function getInstallSaveProdSaveExactCommands (deps, r, f) {
|
|
260
251
|
log('getInstallSaveProdSaveExactCommands')
|
|
@@ -276,8 +267,7 @@ export function getInstallSaveProdSaveExactCommands (deps, r, f) {
|
|
|
276
267
|
* @param {DependencyDescriptor|DependencyDescriptor[]} deps - Dependency descriptor(s)
|
|
277
268
|
* @param {string} r - Registry
|
|
278
269
|
* @param {boolean} f - Force
|
|
279
|
-
*
|
|
280
|
-
* @return {string}
|
|
270
|
+
* @returns {string}
|
|
281
271
|
*/
|
|
282
272
|
export function getInstallSaveProdCommands (deps, r, f) {
|
|
283
273
|
log('getInstallSaveProdCommands')
|
|
@@ -300,8 +290,7 @@ export function getInstallSaveProdCommands (deps, r, f) {
|
|
|
300
290
|
* @param {DependencyDescriptor|DependencyDescriptor[]} deps - Dependency descriptor(s)
|
|
301
291
|
* @param {string} r - Registry
|
|
302
292
|
* @param {boolean} f - Force
|
|
303
|
-
*
|
|
304
|
-
* @return {Promise<string>}
|
|
293
|
+
* @returns {Promise<string>}
|
|
305
294
|
*/
|
|
306
295
|
export function installSaveBundleSaveExact (d, deps, r, f) {
|
|
307
296
|
log('installSaveBundleSaveExact')
|
|
@@ -339,8 +328,7 @@ export function installSaveBundleSaveExact (d, deps, r, f) {
|
|
|
339
328
|
* @param {DependencyDescriptor|DependencyDescriptor[]} deps - Dependency descriptor(s)
|
|
340
329
|
* @param {string} r - Registry
|
|
341
330
|
* @param {boolean} f - Force
|
|
342
|
-
*
|
|
343
|
-
* @return {Promise<string>}
|
|
331
|
+
* @returns {Promise<string>}
|
|
344
332
|
*/
|
|
345
333
|
export function installSaveBundle (d, deps, r, f) {
|
|
346
334
|
log('installSaveBundle')
|
|
@@ -378,8 +366,7 @@ export function installSaveBundle (d, deps, r, f) {
|
|
|
378
366
|
* @param {DependencyDescriptor|DependencyDescriptor[]} deps - Dependency descriptor(s)
|
|
379
367
|
* @param {string} r - Registry
|
|
380
368
|
* @param {boolean} f - Force
|
|
381
|
-
*
|
|
382
|
-
* @return {Promise<string>}
|
|
369
|
+
* @returns {Promise<string>}
|
|
383
370
|
*/
|
|
384
371
|
export function installSaveOptionalSaveExact (d, deps, r, f) {
|
|
385
372
|
log('installSaveOptionalSaveExact')
|
|
@@ -417,8 +404,7 @@ export function installSaveOptionalSaveExact (d, deps, r, f) {
|
|
|
417
404
|
* @param {Dependencies} dependencies - Dependencies
|
|
418
405
|
* @param {string} r - Registry
|
|
419
406
|
* @param {boolean} f - Force
|
|
420
|
-
*
|
|
421
|
-
* @return {Promise<string>}
|
|
407
|
+
* @returns {Promise<string>}
|
|
422
408
|
*/
|
|
423
409
|
export function installSaveOptional (d, dependencies, r, f) {
|
|
424
410
|
log('installSaveOptional')
|
|
@@ -456,8 +442,7 @@ export function installSaveOptional (d, dependencies, r, f) {
|
|
|
456
442
|
* @param {DependencyDescriptor|DependencyDescriptor[]} deps - Dependency descriptor(s)
|
|
457
443
|
* @param {string} r - Registry
|
|
458
444
|
* @param {boolean} f - Force
|
|
459
|
-
*
|
|
460
|
-
* @return {Promise<string>}
|
|
445
|
+
* @returns {Promise<string>}
|
|
461
446
|
*/
|
|
462
447
|
export function installSaveDevSaveExact (d, deps, r, f) {
|
|
463
448
|
log('installSaveDevSaveExact')
|
|
@@ -495,8 +480,7 @@ export function installSaveDevSaveExact (d, deps, r, f) {
|
|
|
495
480
|
* @param {DependencyDescriptor|DependencyDescriptor[]} deps - Dependency descriptor(s)
|
|
496
481
|
* @param {string} r - Registry
|
|
497
482
|
* @param {boolean} f - Force
|
|
498
|
-
*
|
|
499
|
-
* @return {Promise<string>}
|
|
483
|
+
* @returns {Promise<string>}
|
|
500
484
|
*/
|
|
501
485
|
export function installSaveDev (d, deps, r, f) {
|
|
502
486
|
log('installSaveDev')
|
|
@@ -534,8 +518,7 @@ export function installSaveDev (d, deps, r, f) {
|
|
|
534
518
|
* @param {DependencyDescriptor|DependencyDescriptor[]} deps - Dependency descriptor(s)
|
|
535
519
|
* @param {string} r - Registry
|
|
536
520
|
* @param {boolean} f - Force
|
|
537
|
-
*
|
|
538
|
-
* @return {Promise<string>}
|
|
521
|
+
* @returns {Promise<string>}
|
|
539
522
|
*/
|
|
540
523
|
export function installSaveProdSaveExact (d, deps, r, f) {
|
|
541
524
|
log('installSaveProdSaveExact')
|
|
@@ -573,8 +556,7 @@ export function installSaveProdSaveExact (d, deps, r, f) {
|
|
|
573
556
|
* @param {DependencyDescriptor|DependencyDescriptor[]} deps - Dependency descriptor(s)
|
|
574
557
|
* @param {string} r - Registry
|
|
575
558
|
* @param {boolean} f - Force
|
|
576
|
-
*
|
|
577
|
-
* @return {Promise<string>}
|
|
559
|
+
* @returns {Promise<string>}
|
|
578
560
|
*/
|
|
579
561
|
export function installSaveProd (d, deps, r, f) {
|
|
580
562
|
log('installSaveProd')
|
|
@@ -613,8 +595,7 @@ export function installSaveProd (d, deps, r, f) {
|
|
|
613
595
|
* @param {Dependencies} configurationDependencies - Configuration dependencies
|
|
614
596
|
* @param {string} r - Registry
|
|
615
597
|
* @param {boolean} f - Force
|
|
616
|
-
*
|
|
617
|
-
* @return {Promise<void>}
|
|
598
|
+
* @returns {Promise<void>}
|
|
618
599
|
*/
|
|
619
600
|
export async function executeBundle (d = DIRECTORY, packageDependencies = {}, configurationDependencies = {}, r = REGISTRY, f = false) {
|
|
620
601
|
log('executeBundle')
|
|
@@ -638,8 +619,7 @@ export async function executeBundle (d = DIRECTORY, packageDependencies = {}, co
|
|
|
638
619
|
* @param {Dependencies} configurationDependencies - Configuration dependencies
|
|
639
620
|
* @param {string} r - Registry
|
|
640
621
|
* @param {boolean} f - Force
|
|
641
|
-
*
|
|
642
|
-
* @return {Promise<void>}
|
|
622
|
+
* @returns {Promise<void>}
|
|
643
623
|
*/
|
|
644
624
|
export async function executeOptional (d = DIRECTORY, packageDependencies = {}, configurationDependencies = {}, r = REGISTRY, f = false) {
|
|
645
625
|
log('executeOptional')
|
|
@@ -663,8 +643,7 @@ export async function executeOptional (d = DIRECTORY, packageDependencies = {},
|
|
|
663
643
|
* @param {Dependencies} configurationDependencies - Configuration dependencies
|
|
664
644
|
* @param {string} r - Registry
|
|
665
645
|
* @param {boolean} f - Force
|
|
666
|
-
*
|
|
667
|
-
* @return {Promise<void>}
|
|
646
|
+
* @returns {Promise<void>}
|
|
668
647
|
*/
|
|
669
648
|
export async function executeDev (d = DIRECTORY, packageDependencies = {}, configurationDependencies = {}, r = REGISTRY, f = false) {
|
|
670
649
|
log('executeDev')
|
|
@@ -688,8 +667,7 @@ export async function executeDev (d = DIRECTORY, packageDependencies = {}, confi
|
|
|
688
667
|
* @param {Dependencies} configurationDependencies - Configuration dependencies
|
|
689
668
|
* @param {string} r - Registry
|
|
690
669
|
* @param {boolean} f - Force
|
|
691
|
-
*
|
|
692
|
-
* @return {Promise<void>}
|
|
670
|
+
* @returns {Promise<void>}
|
|
693
671
|
*/
|
|
694
672
|
export async function executeProd (d = DIRECTORY, packageDependencies = {}, configurationDependencies = {}, r = REGISTRY, f = false) {
|
|
695
673
|
log('executeProd')
|
package/src/install/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* A package
|
|
3
|
+
* @typedef {import('../common/index.mjs').Package} Package
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* A configuration
|
|
8
|
+
* @typedef {import('../common/index.mjs').Configuration} Configuration
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import debug from 'debug'
|
|
@@ -55,8 +55,7 @@ log(`\`install\` (${VERSION} - ${PLATFORM}) is awake`)
|
|
|
55
55
|
* @param {boolean} s - Save
|
|
56
56
|
* @param {string} r - Registry
|
|
57
57
|
* @param {boolean} f - Force
|
|
58
|
-
*
|
|
59
|
-
* @return {string}
|
|
58
|
+
* @returns {string}
|
|
60
59
|
*/
|
|
61
60
|
export function getInstallSaveExactCommands (p, s, r, f) {
|
|
62
61
|
log('getInstallSaveExactCommands')
|
|
@@ -79,8 +78,7 @@ export function getInstallSaveExactCommands (p, s, r, f) {
|
|
|
79
78
|
* @param {boolean} s - Save
|
|
80
79
|
* @param {string} r - Registry
|
|
81
80
|
* @param {boolean} f - Force
|
|
82
|
-
*
|
|
83
|
-
* @return {string}
|
|
81
|
+
* @returns {string}
|
|
84
82
|
*/
|
|
85
83
|
export function getInstallCommands (p, s, r, f) {
|
|
86
84
|
log('getInstallCommands')
|
|
@@ -104,8 +102,7 @@ export function getInstallCommands (p, s, r, f) {
|
|
|
104
102
|
* @param {Configuration} c - Configuration
|
|
105
103
|
* @param {boolean} s - Save
|
|
106
104
|
* @param {string} r - Registry
|
|
107
|
-
*
|
|
108
|
-
* @return {Promise<string>}
|
|
105
|
+
* @returns {Promise<string>}
|
|
109
106
|
*/
|
|
110
107
|
export function installSaveExact (d, p, s, r, f) {
|
|
111
108
|
log('installSaveExact')
|
|
@@ -142,8 +139,7 @@ export function installSaveExact (d, p, s, r, f) {
|
|
|
142
139
|
* @param {Configuration} c - Configuration
|
|
143
140
|
* @param {boolean} s - Save
|
|
144
141
|
* @param {string} r - Registry
|
|
145
|
-
*
|
|
146
|
-
* @return {Promise<string>}
|
|
142
|
+
* @returns {Promise<string>}
|
|
147
143
|
*/
|
|
148
144
|
export function install (d, p, s, r, f) {
|
|
149
145
|
log('install')
|
|
@@ -181,8 +177,7 @@ export function install (d, p, s, r, f) {
|
|
|
181
177
|
* @param {boolean} s - Save
|
|
182
178
|
* @param {string} r - Registry
|
|
183
179
|
* @param {boolean} f - Force
|
|
184
|
-
*
|
|
185
|
-
* @return {Promise<void>}
|
|
180
|
+
* @returns {Promise<void>}
|
|
186
181
|
*/
|
|
187
182
|
export async function execute (d = DIRECTORY, p = {}, c = {}, s = false, r = REGISTRY, f = false) {
|
|
188
183
|
log('execute')
|