@modernpoacher/deps 2.1.18 → 2.1.19

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.
@@ -32,6 +32,10 @@ import {
32
32
  PLATFORM
33
33
  } from '#deps/src/common/env'
34
34
 
35
+ import {
36
+ getOptions
37
+ } from '#deps/src/common/options'
38
+
35
39
  import {
36
40
  DIRECTORY,
37
41
  REGISTRY,
@@ -40,8 +44,7 @@ import {
40
44
  getRegistryParameter,
41
45
  getForceParameter,
42
46
  getExportPath,
43
- getNvm,
44
- getOptions
47
+ getNvm
45
48
  } from '#deps/src/common'
46
49
 
47
50
  const log = debug('@modernpoacher/deps')
package/bin/deps/deps.mjs CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  import debug from 'debug'
4
4
 
5
+ import PATH from '#where-am-i'
6
+
5
7
  import {
6
8
  exec
7
9
  } from 'node:child_process'
@@ -16,15 +18,13 @@ import {
16
18
  handleComplete
17
19
  } from '#deps/bin/common'
18
20
 
19
- import {
20
- getOptions
21
- } from '#deps/src/common'
22
-
23
21
  import {
24
22
  PLATFORM
25
23
  } from '#deps/src/common/env'
26
24
 
27
- import PATH from '#where-am-i'
25
+ import {
26
+ getOptions
27
+ } from '#deps/src/common/options'
28
28
 
29
29
  const {
30
30
  env: {
package/bin/deps/head.mjs CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  import debug from 'debug'
4
4
 
5
+ import PATH from '#where-am-i'
6
+
5
7
  import {
6
8
  exec
7
9
  } from 'node:child_process'
@@ -16,15 +18,13 @@ import {
16
18
  handleComplete
17
19
  } from '#deps/bin/common'
18
20
 
19
- import {
20
- getOptions
21
- } from '#deps/src/common'
22
-
23
21
  import {
24
22
  PLATFORM
25
23
  } from '#deps/src/common/env'
26
24
 
27
- import PATH from '#where-am-i'
25
+ import {
26
+ getOptions
27
+ } from '#deps/src/common/options'
28
28
 
29
29
  const {
30
30
  env: {
package/bin/deps/push.mjs CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  import debug from 'debug'
4
4
 
5
+ import PATH from '#where-am-i'
6
+
5
7
  import {
6
8
  exec
7
9
  } from 'node:child_process'
@@ -16,15 +18,13 @@ import {
16
18
  handleComplete
17
19
  } from '#deps/bin/common'
18
20
 
19
- import {
20
- getOptions
21
- } from '#deps/src/common'
22
-
23
21
  import {
24
22
  PLATFORM
25
23
  } from '#deps/src/common/env'
26
24
 
27
- import PATH from '#where-am-i'
25
+ import {
26
+ getOptions
27
+ } from '#deps/src/common/options'
28
28
 
29
29
  const {
30
30
  env: {
package/bin/deps/wipe.mjs CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  import debug from 'debug'
4
4
 
5
+ import PATH from '#where-am-i'
6
+
5
7
  import {
6
8
  exec
7
9
  } from 'node:child_process'
@@ -16,15 +18,13 @@ import {
16
18
  handleComplete
17
19
  } from '#deps/bin/common'
18
20
 
19
- import {
20
- getOptions
21
- } from '#deps/src/common'
22
-
23
21
  import {
24
22
  PLATFORM
25
23
  } from '#deps/src/common/env'
26
24
 
27
- import PATH from '#where-am-i'
25
+ import {
26
+ getOptions
27
+ } from '#deps/src/common/options'
28
28
 
29
29
  const {
30
30
  env: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modernpoacher/deps",
3
- "version": "2.1.18",
3
+ "version": "2.1.19",
4
4
  "description": "Update NPM package dependencies from the command line",
5
5
  "keywords": [
6
6
  "deps",
@@ -79,8 +79,7 @@
79
79
  "#deps/src": "./src/index.mjs",
80
80
  "#deps/src/*": "./src/*.mjs",
81
81
  "#deps/src/common": "./src/common/index.mjs",
82
- "#deps/src/common/env": "./src/common/env/index.mjs",
83
- "#deps/src/common/git": "./src/common/git/index.mjs",
82
+ "#deps/src/common/*": "./src/common/*/index.mjs",
84
83
  "#deps/src/install": "./src/install/index.mjs",
85
84
  "#where-am-i": "./where-am-i.mjs"
86
85
  }
@@ -23,7 +23,7 @@ const PLATFORM = platform()
23
23
 
24
24
  const log = debug('@modernpoacher/deps')
25
25
 
26
- log(`\`env\` (${NAME} - ${VERSION} - ${PLATFORM}) is awake at "${PATH}"`)
26
+ log(`\`common/env\` (${NAME} - ${VERSION} - ${PLATFORM}) is awake`)
27
27
 
28
28
  export {
29
29
  NAME,
@@ -17,7 +17,7 @@ import {
17
17
 
18
18
  import {
19
19
  getOptions
20
- } from '#deps/src/common'
20
+ } from '#deps/src/common/options'
21
21
 
22
22
  export const DIRECTORY = '.'
23
23
 
@@ -57,7 +57,7 @@ eval $(ssh-agent -k) 1> /dev/null
57
57
 
58
58
  const log = debug('@modernpoacher/deps')
59
59
 
60
- log(`\`git\` (${VERSION} - ${PLATFORM}) is awake`)
60
+ log(`\`common/git\` (${VERSION} - ${PLATFORM}) is awake`)
61
61
 
62
62
  const trim = (v) => v.split(String.fromCharCode(10)).map((v) => v.trimEnd()).join(String.fromCharCode(10)).trim()
63
63
 
@@ -65,13 +65,13 @@ function filter (v) {
65
65
  return Boolean(stripAnsi(v).trim())
66
66
  }
67
67
 
68
- export function getIsDirectory (directory) {
68
+ function getIsDirectory (directory) {
69
69
  return function isDirectory (s) {
70
70
  return directory === s
71
71
  }
72
72
  }
73
73
 
74
- export function isFatal (s) {
74
+ function isFatal (s) {
75
75
  return s.toLowerCase().startsWith('fatal: not a git repository')
76
76
  }
77
77
 
@@ -54,21 +54,9 @@ export const AUTHOR = 'Modern Poacher Limited <modernpoacher@modernpoacher.com>'
54
54
 
55
55
  export const NVM = resolve(PATH, 'nvm.sh')
56
56
 
57
- export const OPTIONS = {
58
- maxBuffer: 1024 * 2000,
59
- stdio: 'inherit',
60
- env: {
61
- DEBUG_COLORS: 'yes',
62
- FORCE_COLOR: PLATFORM === 'win32'
63
- ? 3
64
- : 2,
65
- PATH: process.env.PATH
66
- }
67
- }
68
-
69
57
  const log = debug('@modernpoacher/deps')
70
58
 
71
- log(`\`common\` (${VERSION} - ${PLATFORM}) is awake at "${PATH}"`)
59
+ log(`\`common\` (${VERSION} - ${PLATFORM}) is awake`)
72
60
 
73
61
  export const tidy = (v) => v.replace(/\n{2,}}/gm, String.fromCharCode(10)).trim()
74
62
 
@@ -206,31 +194,6 @@ export const getCommands = PLATFORM === 'win32'
206
194
  ? (commands = 'npm i') => tidy(commands)
207
195
  : (commands = 'npm i') => tidy(getExportPath(getNvm(commands)))
208
196
 
209
- /**
210
- * @function getOptions
211
- *
212
- * Get the installation `exec` child process options
213
- *
214
- * @param {string} cwd normalized directory
215
- *
216
- * @return {{
217
- * maxBuffer: number,
218
- * stdio: string
219
- * env: {
220
- * DEBUG_COLORS: string,
221
- * FORCE_COLOR: number,
222
- * PROCESS: string
223
- * }
224
- * cwd: string
225
- * }}
226
- */
227
- export function getOptions (cwd) {
228
- return {
229
- ...OPTIONS,
230
- cwd
231
- }
232
- }
233
-
234
197
  /**
235
198
  * @function getProdDependencies
236
199
  *
@@ -0,0 +1,53 @@
1
+ import debug from 'debug'
2
+
3
+ import {
4
+ VERSION,
5
+ PLATFORM
6
+ } from '#deps/src/common/env'
7
+
8
+ const {
9
+ env: {
10
+ PATH
11
+ }
12
+ } = process
13
+
14
+ export const OPTIONS = {
15
+ maxBuffer: 1024 * 2000,
16
+ stdio: 'inherit',
17
+ env: {
18
+ DEBUG_COLORS: 'yes',
19
+ FORCE_COLOR: PLATFORM === 'win32'
20
+ ? 3
21
+ : 2,
22
+ PATH
23
+ }
24
+ }
25
+
26
+ const log = debug('@modernpoacher/deps')
27
+
28
+ log(`\`common/options\` (${VERSION} - ${PLATFORM}) is awake`)
29
+
30
+ /**
31
+ * @function getOptions
32
+ *
33
+ * Get the installation `exec` child process options
34
+ *
35
+ * @param {string} cwd normalized directory
36
+ *
37
+ * @return {{
38
+ * maxBuffer: number,
39
+ * stdio: string
40
+ * env: {
41
+ * DEBUG_COLORS: string,
42
+ * FORCE_COLOR: number,
43
+ * PROCESS: string
44
+ * }
45
+ * cwd: string
46
+ * }}
47
+ */
48
+ export function getOptions (cwd) {
49
+ return {
50
+ ...OPTIONS,
51
+ cwd
52
+ }
53
+ }
package/src/index.mjs CHANGED
@@ -25,6 +25,10 @@ import {
25
25
  PLATFORM
26
26
  } from '#deps/src/common/env'
27
27
 
28
+ import {
29
+ getOptions
30
+ } from '#deps/src/common/options'
31
+
28
32
  import {
29
33
  DIRECTORY,
30
34
  REGISTRY,
@@ -36,7 +40,6 @@ import {
36
40
  getSaveDevParameter,
37
41
  getSaveProdParameter,
38
42
  getCommands,
39
- getOptions,
40
43
  normalizeCommands,
41
44
  transform,
42
45
  getDepsExact,
@@ -23,6 +23,10 @@ import {
23
23
  PLATFORM
24
24
  } from '#deps/src/common/env'
25
25
 
26
+ import {
27
+ getOptions
28
+ } from '#deps/src/common/options'
29
+
26
30
  import {
27
31
  DIRECTORY,
28
32
  REGISTRY,
@@ -31,7 +35,6 @@ import {
31
35
  getForceParameter,
32
36
  getSaveExactParameter,
33
37
  getCommands,
34
- getOptions,
35
38
  normalizeCommands,
36
39
  transform,
37
40
  getDepsExact,