@modernpoacher/deps 2.0.8 → 2.0.10

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/app.mjs CHANGED
@@ -81,13 +81,17 @@ async function app () {
81
81
  }
82
82
  } = process
83
83
 
84
- const PACKAGE = await hasPackage(DEPS_PATH)
85
- ? await getPackage(DEPS_PATH)
86
- : {}
87
-
88
- const CONFIGURATION = await hasConfiguration(DEPS_PATH)
89
- ? await getConfiguration(DEPS_PATH)
90
- : {}
84
+ const PACKAGE = (
85
+ await hasPackage(DEPS_PATH)
86
+ ? await getPackage(DEPS_PATH)
87
+ : {}
88
+ )
89
+
90
+ const CONFIGURATION = (
91
+ await hasConfiguration(DEPS_PATH)
92
+ ? await getConfiguration(DEPS_PATH)
93
+ : {}
94
+ )
91
95
 
92
96
  const {
93
97
  saveProd: P,
@@ -42,7 +42,9 @@ import {
42
42
  npmi,
43
43
  deps,
44
44
  hasConfiguration,
45
- getConfiguration
45
+ getConfiguration,
46
+ hasPackage,
47
+ getPackage
46
48
  } from '#deps/bin/common'
47
49
 
48
50
  const {
@@ -103,6 +105,20 @@ async function getAuthorFromConfiguration (directory) {
103
105
  )
104
106
  }
105
107
 
108
+ async function getAuthorFromPackage (directory) {
109
+ log('getAuthorFromPackage')
110
+
111
+ const PACKAGE = (
112
+ await hasPackage(directory)
113
+ ? await getPackage(directory)
114
+ : {}
115
+ )
116
+
117
+ return (
118
+ getAuthor(PACKAGE)
119
+ )
120
+ }
121
+
106
122
  const filterDeps = (v) => !!v // de-falsy
107
123
 
108
124
  const reduceDeps = (a, v) => a.includes(v) ? a : a.concat(v) // de-dupe
@@ -160,7 +176,7 @@ async function iterate ([directory, ...directories] = [], registry, force, messa
160
176
  if (D === await gitRevParse(D)) {
161
177
  const ignore = await getIgnoreFromConfiguration(D)
162
178
  if (!ignore) {
163
- await execute(D, registry, force, message, author || await getAuthorFromConfiguration(D))
179
+ await execute(D, registry, force, message, author || await getAuthorFromConfiguration(D) || await getAuthorFromPackage(D))
164
180
  }
165
181
  }
166
182
  } catch (e) {
@@ -203,7 +219,7 @@ async function executeFrom (directory, registry, force, message, author) {
203
219
  const ignore = await getIgnoreFromConfiguration(D)
204
220
  if (!ignore) {
205
221
  return (
206
- await execute(D, registry, force, message, author || await getAuthorFromConfiguration(D))
222
+ await execute(D, registry, force, message, author || await getAuthorFromConfiguration(D) || await getAuthorFromPackage(D))
207
223
  )
208
224
  }
209
225
  }
@@ -222,7 +238,7 @@ async function executeOnly (directory, registry, force, message, author) {
222
238
  const ignore = await getIgnoreFromConfiguration(D)
223
239
  if (!ignore) {
224
240
  return (
225
- await execute(D, registry, force, message, author || await getAuthorFromConfiguration(D))
241
+ await execute(D, registry, force, message, author || await getAuthorFromConfiguration(D) || await getAuthorFromPackage(D))
226
242
  )
227
243
  }
228
244
  }
@@ -241,7 +257,7 @@ async function executePath (directory, registry, force, message, author) {
241
257
  const ignore = await getIgnoreFromConfiguration(D)
242
258
  if (!ignore) {
243
259
  return (
244
- await execute(D, registry, force, message, author || await getAuthorFromConfiguration(D))
260
+ await execute(D, registry, force, message, author || await getAuthorFromConfiguration(D) || await getAuthorFromPackage(D))
245
261
  )
246
262
  }
247
263
  }
@@ -81,13 +81,17 @@ async function app () {
81
81
  }
82
82
  } = process
83
83
 
84
- const PACKAGE = await hasPackage(DEPS_PATH)
85
- ? await getPackage(DEPS_PATH)
86
- : {}
87
-
88
- const CONFIGURATION = await hasConfiguration(DEPS_PATH)
89
- ? await getConfiguration(DEPS_PATH)
90
- : {}
84
+ const PACKAGE = (
85
+ await hasPackage(DEPS_PATH)
86
+ ? await getPackage(DEPS_PATH)
87
+ : {}
88
+ )
89
+
90
+ const CONFIGURATION = (
91
+ await hasConfiguration(DEPS_PATH)
92
+ ? await getConfiguration(DEPS_PATH)
93
+ : {}
94
+ )
91
95
 
92
96
  const {
93
97
  prod: P,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modernpoacher/deps",
3
- "version": "2.0.8",
3
+ "version": "2.0.10",
4
4
  "description": "Update NPM package dependencies from the command line",
5
5
  "keywords": [
6
6
  "deps",
@@ -158,11 +158,11 @@ ${commands}
158
158
 
159
159
  export const getCommands = PLATFORM === 'win32'
160
160
  ? (directory = DIRECTORY, commands = 'npm i') => tidy(`
161
- echo Directory is \\"${directory}\\ (\\"%cd%\\")"
161
+ echo Directory is \\"${directory}\\"
162
162
  ${commands}
163
163
  `)
164
164
  : (directory = DIRECTORY, commands = 'npm i') => tidy(`
165
- echo Directory is \\"${directory}\\ (\\"$PWD\\")"
165
+ echo Directory is \\"${directory}\\"
166
166
  ${getExportPath(getNvm(commands))}
167
167
  `)
168
168
 
@@ -241,7 +241,7 @@ export const getIgnore = ({ ignore = false } = {}) => ignore === true
241
241
  *
242
242
  * @return {String}
243
243
  */
244
- export const getAuthor = ({ author } = {}) => String(author)
244
+ export const getAuthor = ({ author } = {}) => author
245
245
 
246
246
  /**
247
247
  * @function isPreRelease