@modernpoacher/deps 2.1.4 → 2.1.5

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.
@@ -43,6 +43,7 @@ import {
43
43
  } from '#deps/src/common'
44
44
 
45
45
  const log = debug('@modernpoacher/deps')
46
+ const error = debug('@modernpoacher/deps:error')
46
47
 
47
48
  log(`\`common\` (${VERSION} - ${PLATFORM}) is awake`)
48
49
 
@@ -100,15 +101,19 @@ export function use (key) {
100
101
  }
101
102
  }
102
103
 
103
- function handleError (e = {}) {
104
+ export function handleError (e = {}) {
104
105
  const {
105
106
  code = CODE,
106
107
  message = MESSAGE
107
108
  } = e
108
109
 
109
- const log = debug('@modernpoacher/deps:error')
110
- if (code > 1) log(code)
111
- log(message)
110
+ if (code > 1) error(code)
111
+ error(message)
112
+ }
113
+
114
+ export function handleComplete (e) {
115
+ if (!e) return log('👍')
116
+ error('👎')
112
117
  }
113
118
 
114
119
  const handlePackageError = ({ message = MESSAGE } = {}) => { log(`Package error: "${message}"`) }
@@ -320,7 +325,6 @@ export {
320
325
  REGISTRY,
321
326
  AUTHOR,
322
327
  NVM,
323
- handleError,
324
328
  handlePackageError,
325
329
  handleConfigurationError,
326
330
  getPackageJsonPath,
package/bin/deps/deps.mjs CHANGED
@@ -12,7 +12,8 @@ import {
12
12
 
13
13
  import {
14
14
  getArgs,
15
- use
15
+ use,
16
+ handleComplete
16
17
  } from '#deps/bin/common'
17
18
 
18
19
  import {
@@ -33,9 +34,6 @@ const {
33
34
 
34
35
  debug.enable(DEBUG)
35
36
 
36
- const log = debug('@modernpoacher/deps')
37
- const error = debug('@modernpoacher/deps:error')
38
-
39
37
  const command = (
40
38
  PLATFORM === 'win32'
41
39
  ? `bash "${resolve(PATH, '.\\bin\\bash\\deps.sh')}"`
@@ -47,10 +45,7 @@ const args = getArgs()
47
45
  const {
48
46
  stdout,
49
47
  stderr
50
- } = exec(`${command} ${args}`, getOptions(), (e, v) => {
51
- if (!e) return log('👍')
52
- error('👎')
53
- })
48
+ } = exec(`${command} ${args}`, getOptions(), handleComplete)
54
49
 
55
50
  stdout.on('data', use('deps-deps'))
56
51
  stderr.on('data', use('deps-deps:error'))
package/bin/deps/head.mjs CHANGED
@@ -12,7 +12,8 @@ import {
12
12
 
13
13
  import {
14
14
  getArgs,
15
- use
15
+ use,
16
+ handleComplete
16
17
  } from '#deps/bin/common'
17
18
 
18
19
  import {
@@ -33,9 +34,6 @@ const {
33
34
 
34
35
  debug.enable(DEBUG)
35
36
 
36
- const log = debug('@modernpoacher/deps')
37
- const error = debug('@modernpoacher/deps:error')
38
-
39
37
  const command = (
40
38
  PLATFORM === 'win32'
41
39
  ? `bash "${resolve(PATH, '.\\bin\\bash\\head.sh')}"`
@@ -47,10 +45,7 @@ const args = getArgs()
47
45
  const {
48
46
  stdout,
49
47
  stderr
50
- } = exec(`${command} ${args}`, getOptions(), (e, v) => {
51
- if (!e) return log('👍')
52
- error('👎')
53
- })
48
+ } = exec(`${command} ${args}`, getOptions(), handleComplete)
54
49
 
55
- stdout.on('data', use('deps-deps'))
56
- stderr.on('data', use('deps-deps:error'))
50
+ stdout.on('data', use('deps-head'))
51
+ stderr.on('data', use('deps-head:error'))
package/bin/deps/push.mjs CHANGED
@@ -12,7 +12,8 @@ import {
12
12
 
13
13
  import {
14
14
  getArgs,
15
- use
15
+ use,
16
+ handleComplete
16
17
  } from '#deps/bin/common'
17
18
 
18
19
  import {
@@ -33,9 +34,6 @@ const {
33
34
 
34
35
  debug.enable(DEBUG)
35
36
 
36
- const log = debug('@modernpoacher/deps')
37
- const error = debug('@modernpoacher/deps:error')
38
-
39
37
  const command = (
40
38
  PLATFORM === 'win32'
41
39
  ? `bash "${resolve(PATH, '.\\bin\\bash\\push.sh')}"`
@@ -47,10 +45,7 @@ const args = getArgs()
47
45
  const {
48
46
  stdout,
49
47
  stderr
50
- } = exec(`${command} ${args}`, getOptions(), (e, v) => {
51
- if (!e) return log('👍')
52
- error('👎')
53
- })
48
+ } = exec(`${command} ${args}`, getOptions(), handleComplete)
54
49
 
55
- stdout.on('data', use('deps-deps'))
56
- stderr.on('data', use('deps-deps:error'))
50
+ stdout.on('data', use('deps-push'))
51
+ stderr.on('data', use('deps-push:error'))
package/bin/deps/wipe.mjs CHANGED
@@ -12,7 +12,8 @@ import {
12
12
 
13
13
  import {
14
14
  getArgs,
15
- use
15
+ use,
16
+ handleComplete
16
17
  } from '#deps/bin/common'
17
18
 
18
19
  import {
@@ -33,9 +34,6 @@ const {
33
34
 
34
35
  debug.enable(DEBUG)
35
36
 
36
- const log = debug('@modernpoacher/deps')
37
- const error = debug('@modernpoacher/deps:error')
38
-
39
37
  const command = (
40
38
  PLATFORM === 'win32'
41
39
  ? `bash "${resolve(PATH, '.\\bin\\bash\\wipe.sh')}"`
@@ -47,10 +45,7 @@ const args = getArgs()
47
45
  const {
48
46
  stdout,
49
47
  stderr
50
- } = exec(`${command} ${args}`, getOptions(), (e, v) => {
51
- if (!e) return log('👍')
52
- error('👎')
53
- })
48
+ } = exec(`${command} ${args}`, getOptions(), handleComplete)
54
49
 
55
- stdout.on('data', use('deps-deps'))
56
- stderr.on('data', use('deps-deps:error'))
50
+ stdout.on('data', use('deps-wipe'))
51
+ stderr.on('data', use('deps-wipe:error'))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modernpoacher/deps",
3
- "version": "2.1.4",
3
+ "version": "2.1.5",
4
4
  "description": "Update NPM package dependencies from the command line",
5
5
  "keywords": [
6
6
  "deps",