@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 +11 -7
- package/bin/execute/app.mjs +21 -5
- package/bin/install/app.mjs +11 -7
- package/package.json +1 -1
- package/src/common/index.mjs +3 -3
package/bin/app.mjs
CHANGED
|
@@ -81,13 +81,17 @@ async function app () {
|
|
|
81
81
|
}
|
|
82
82
|
} = process
|
|
83
83
|
|
|
84
|
-
const PACKAGE =
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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,
|
package/bin/execute/app.mjs
CHANGED
|
@@ -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
|
}
|
package/bin/install/app.mjs
CHANGED
|
@@ -81,13 +81,17 @@ async function app () {
|
|
|
81
81
|
}
|
|
82
82
|
} = process
|
|
83
83
|
|
|
84
|
-
const PACKAGE =
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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
package/src/common/index.mjs
CHANGED
|
@@ -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}\\
|
|
161
|
+
echo Directory is \\"${directory}\\"
|
|
162
162
|
${commands}
|
|
163
163
|
`)
|
|
164
164
|
: (directory = DIRECTORY, commands = 'npm i') => tidy(`
|
|
165
|
-
echo Directory is \\"${directory}\\
|
|
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 } = {}) =>
|
|
244
|
+
export const getAuthor = ({ author } = {}) => author
|
|
245
245
|
|
|
246
246
|
/**
|
|
247
247
|
* @function isPreRelease
|