@modernpoacher/deps 2.0.16 → 2.0.17

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/src/index.mjs CHANGED
@@ -1,3 +1,13 @@
1
+ /**
2
+ * Package or configuration dependencies
3
+ * @typedef {import('./common/index.mjs').Dependencies} Dependencies
4
+ */
5
+
6
+ /**
7
+ * Dependency descriptor
8
+ * @typedef {import('./common/index.mjs').DependencyDescriptor} DependencyDescriptor
9
+ */
10
+
1
11
  import debug from 'debug'
2
12
 
3
13
  import {
@@ -65,16 +75,16 @@ function use (key) {
65
75
  *
66
76
  * Get the `npm install --save-exact` commands as a string of parameters and arguments
67
77
  *
68
- * @param {Object} p - Packages
69
- * @param {String} r - Registry
70
- * @param {Boolean} f - Force
78
+ * @param {DependencyDescriptor|DependencyDescriptor[]} deps - Dependency descriptor(s)
79
+ * @param {string} r - Registry
80
+ * @param {boolean} f - Force
71
81
  *
72
- * @return {Array}
82
+ * @return {string}
73
83
  */
74
- export function getInstallSaveExactCommands (p, r, f) {
84
+ export function getInstallSaveExactCommands (deps, r, f) {
75
85
  log('getInstallSaveExactCommands')
76
86
 
77
- const c = transform(p)
87
+ const c = transform(deps)
78
88
  const commands = `npm i ${c}`
79
89
 
80
90
  return normalizeCommands(
@@ -87,16 +97,16 @@ export function getInstallSaveExactCommands (p, r, f) {
87
97
  *
88
98
  * Get the `npm install` commands as a string of parameters and arguments
89
99
  *
90
- * @param {Object} p - Packages
91
- * @param {String} r - Registry
92
- * @param {Boolean} f - Force
100
+ * @param {DependencyDescriptor|DependencyDescriptor[]} deps - Dependency descriptor(s)
101
+ * @param {string} r - Registry
102
+ * @param {boolean} f - Force
93
103
  *
94
- * @return {Array}
104
+ * @return {string}
95
105
  */
96
- export function getInstallCommands (p, r, f) {
106
+ export function getInstallCommands (deps, r, f) {
97
107
  log('getInstallCommands')
98
108
 
99
- const c = transform(p)
109
+ const c = transform(deps)
100
110
  const commands = `npm i ${c}`
101
111
 
102
112
  return normalizeCommands(
@@ -109,16 +119,16 @@ export function getInstallCommands (p, r, f) {
109
119
  *
110
120
  * Get the `npm install --save-bundle --save-exact` commands as a string of parameters and arguments
111
121
  *
112
- * @param {Object} p - Packages
113
- * @param {String} r - Registry
114
- * @param {Boolean} f - Force
122
+ * @param {DependencyDescriptor|DependencyDescriptor[]} deps - Dependency descriptor(s)
123
+ * @param {string} r - Registry
124
+ * @param {boolean} f - Force
115
125
  *
116
- * @return {Array}
126
+ * @return {string}
117
127
  */
118
- export function getInstallSaveBundleSaveExactCommands (p, r, f) {
128
+ export function getInstallSaveBundleSaveExactCommands (deps, r, f) {
119
129
  log('getInstallSaveBundleSaveExactCommands')
120
130
 
121
- const commands = getInstallSaveExactCommands(p, r, f)
131
+ const commands = getInstallSaveExactCommands(deps, r, f)
122
132
 
123
133
  return normalizeCommands(
124
134
  getSaveBundleParameter(commands)
@@ -130,16 +140,16 @@ export function getInstallSaveBundleSaveExactCommands (p, r, f) {
130
140
  *
131
141
  * Get the `npm install --save-bundle` commands as a string of parameters and arguments
132
142
  *
133
- * @param {Object} p - Packages
134
- * @param {String} r - Registry
135
- * @param {Boolean} f - Force
143
+ * @param {DependencyDescriptor|DependencyDescriptor[]} deps - Dependency descriptor(s)
144
+ * @param {string} r - Registry
145
+ * @param {boolean} f - Force
136
146
  *
137
- * @return {Array}
147
+ * @return {string}
138
148
  */
139
- export function getInstallSaveBundleCommands (p, r, f) {
149
+ export function getInstallSaveBundleCommands (deps, r, f) {
140
150
  log('getInstallSaveBundleCommands')
141
151
 
142
- const commands = getInstallCommands(p, r, f)
152
+ const commands = getInstallCommands(deps, r, f)
143
153
 
144
154
  return normalizeCommands(
145
155
  getSaveBundleParameter(commands)
@@ -151,16 +161,16 @@ export function getInstallSaveBundleCommands (p, r, f) {
151
161
  *
152
162
  * Get the `npm install --save-optional --save-exact` commands as a string of parameters and arguments
153
163
  *
154
- * @param {Object} p - Packages
155
- * @param {String} r - Registry
156
- * @param {Boolean} f - Force
164
+ * @param {DependencyDescriptor|DependencyDescriptor[]} deps - Dependency descriptor(s)
165
+ * @param {string} r - Registry
166
+ * @param {boolean} f - Force
157
167
  *
158
- * @return {Array}
168
+ * @return {string}
159
169
  */
160
- export function getInstallSaveOptionalSaveExactCommands (p, r, f) {
170
+ export function getInstallSaveOptionalSaveExactCommands (deps, r, f) {
161
171
  log('getInstallSaveOptionalSaveExactCommands')
162
172
 
163
- const commands = getInstallSaveExactCommands(p, r, f)
173
+ const commands = getInstallSaveExactCommands(deps, r, f)
164
174
 
165
175
  return normalizeCommands(
166
176
  getSaveOptionalParameter(commands)
@@ -172,16 +182,16 @@ export function getInstallSaveOptionalSaveExactCommands (p, r, f) {
172
182
  *
173
183
  * Get the `npm install --save-optional` commands as a string of parameters and arguments
174
184
  *
175
- * @param {Object} p - Packages
176
- * @param {String} r - Registry
177
- * @param {Boolean} f - Force
185
+ * @param {DependencyDescriptor|DependencyDescriptor[]} deps - Dependency descriptor(s)
186
+ * @param {string} r - Registry
187
+ * @param {boolean} f - Force
178
188
  *
179
- * @return {Array}
189
+ * @return {string}
180
190
  */
181
- export function getInstallSaveOptionalCommands (p, r, f) {
191
+ export function getInstallSaveOptionalCommands (deps, r, f) {
182
192
  log('getInstallSaveOptionalCommands')
183
193
 
184
- const commands = getInstallCommands(p, r, f)
194
+ const commands = getInstallCommands(deps, r, f)
185
195
 
186
196
  return normalizeCommands(
187
197
  getSaveOptionalParameter(commands)
@@ -193,16 +203,16 @@ export function getInstallSaveOptionalCommands (p, r, f) {
193
203
  *
194
204
  * Get the `npm install --save-dev --save-exact` commands as a string of parameters and arguments
195
205
  *
196
- * @param {Object} p - Packages
197
- * @param {String} r - Registry
198
- * @param {Boolean} f - Force
206
+ * @param {DependencyDescriptor|DependencyDescriptor[]} deps - Dependency descriptor(s)
207
+ * @param {string} r - Registry
208
+ * @param {boolean} f - Force
199
209
  *
200
- * @return {Array}
210
+ * @return {string}
201
211
  */
202
- export function getInstallSaveDevSaveExactCommands (p, r, f) {
212
+ export function getInstallSaveDevSaveExactCommands (deps, r, f) {
203
213
  log('getInstallSaveDevSaveExactCommands')
204
214
 
205
- const commands = getInstallSaveExactCommands(p, r, f)
215
+ const commands = getInstallSaveExactCommands(deps, r, f)
206
216
 
207
217
  return normalizeCommands(
208
218
  getSaveDevParameter(commands)
@@ -214,16 +224,16 @@ export function getInstallSaveDevSaveExactCommands (p, r, f) {
214
224
  *
215
225
  * Get the `npm install --save-dev` commands as a string of parameters and arguments
216
226
  *
217
- * @param {Object} p - Packages
218
- * @param {String} r - Registry
219
- * @param {Boolean} f - Force
227
+ * @param {DependencyDescriptor|DependencyDescriptor[]} deps - Dependency descriptor(s)
228
+ * @param {string} r - Registry
229
+ * @param {boolean} f - Force
220
230
  *
221
- * @return {Array}
231
+ * @return {string}
222
232
  */
223
- export function getInstallSaveDevCommands (p, r, f) {
233
+ export function getInstallSaveDevCommands (deps, r, f) {
224
234
  log('getInstallSaveDevCommands')
225
235
 
226
- const commands = getInstallCommands(p, r, f)
236
+ const commands = getInstallCommands(deps, r, f)
227
237
 
228
238
  return normalizeCommands(
229
239
  getSaveDevParameter(commands)
@@ -235,16 +245,16 @@ export function getInstallSaveDevCommands (p, r, f) {
235
245
  *
236
246
  * Get the `npm install --save-prod --save-exact` commands as a string of parameters and arguments
237
247
  *
238
- * @param {Object} p - Packages
239
- * @param {String} r - Registry
240
- * @param {Boolean} f - Force
248
+ * @param {DependencyDescriptor|DependencyDescriptor[]} deps - Dependency descriptor(s)
249
+ * @param {string} r - Registry
250
+ * @param {boolean} f - Force
241
251
  *
242
- * @return {Array}
252
+ * @return {string}
243
253
  */
244
- export function getInstallSaveProdSaveExactCommands (p, r, f) {
254
+ export function getInstallSaveProdSaveExactCommands (deps, r, f) {
245
255
  log('getInstallSaveProdSaveExactCommands')
246
256
 
247
- const commands = getInstallSaveExactCommands(p, r, f)
257
+ const commands = getInstallSaveExactCommands(deps, r, f)
248
258
 
249
259
  return normalizeCommands(
250
260
  getSaveProdParameter(commands)
@@ -256,16 +266,16 @@ export function getInstallSaveProdSaveExactCommands (p, r, f) {
256
266
  *
257
267
  * Get the `npm install --save-prod` commands as a string of parameters and arguments
258
268
  *
259
- * @param {Object} p - Packages
260
- * @param {String} r - Registry
261
- * @param {Boolean} f - Force
269
+ * @param {DependencyDescriptor|DependencyDescriptor[]} deps - Dependency descriptor(s)
270
+ * @param {string} r - Registry
271
+ * @param {boolean} f - Force
262
272
  *
263
- * @return {Array}
273
+ * @return {string}
264
274
  */
265
- export function getInstallSaveProdCommands (p, r, f) {
275
+ export function getInstallSaveProdCommands (deps, r, f) {
266
276
  log('getInstallSaveProdCommands')
267
277
 
268
- const commands = getInstallCommands(p, r, f)
278
+ const commands = getInstallCommands(deps, r, f)
269
279
 
270
280
  return normalizeCommands(
271
281
  getSaveProdParameter(commands)
@@ -277,25 +287,28 @@ export function getInstallSaveProdCommands (p, r, f) {
277
287
  *
278
288
  * Spawn the `npm install --save-bundle --save-exact` commands
279
289
  *
280
- * @param {String} d - Directory
281
- * @param {Object} p - Packages
282
- * @param {String} r - Registry
283
- * @param {Boolean} f - Force
290
+ * @param {string} d - Directory
291
+ * @param {DependencyDescriptor|DependencyDescriptor[]} deps - Dependency descriptor(s)
292
+ * @param {string} r - Registry
293
+ * @param {boolean} f - Force
284
294
  *
285
295
  * @return {Promise}
286
296
  */
287
- export function installSaveBundleSaveExact (d, p, r, f) {
297
+ export function installSaveBundleSaveExact (d, deps, r, f) {
288
298
  log('installSaveBundleSaveExact')
289
299
 
300
+ const directory = normalize(d)
301
+
302
+ log(`Directory is "${directory}"`)
303
+
290
304
  return (
291
305
  new Promise((resolve, reject) => {
292
- const D = normalize(d)
293
- const commands = getCommands(D, getInstallSaveBundleSaveExactCommands(p, r, f))
306
+ const commands = getCommands(getInstallSaveBundleSaveExactCommands(deps, r, f))
294
307
 
295
308
  const {
296
309
  stdout,
297
310
  stderr
298
- } = exec(commands, { ...OPTIONS, cwd: D }, (e, v) => {
311
+ } = exec(commands, { ...OPTIONS, cwd: directory }, (e, v) => {
299
312
  (!e)
300
313
  ? resolve(v)
301
314
  : reject(e)
@@ -314,25 +327,28 @@ export function installSaveBundleSaveExact (d, p, r, f) {
314
327
  *
315
328
  * Spawn the `npm install --save-bundle` commands
316
329
  *
317
- * @param {String} d - Directory
318
- * @param {Object} p - Packages
319
- * @param {String} r - Registry
320
- * @param {Boolean} f - Force
330
+ * @param {string} d - Directory
331
+ * @param {DependencyDescriptor|DependencyDescriptor[]} deps - Dependency descriptor(s)
332
+ * @param {string} r - Registry
333
+ * @param {boolean} f - Force
321
334
  *
322
335
  * @return {Promise}
323
336
  */
324
- export function installSaveBundle (d, p, r, f) {
337
+ export function installSaveBundle (d, deps, r, f) {
325
338
  log('installSaveBundle')
326
339
 
340
+ const directory = normalize(d)
341
+
342
+ log(`Directory is "${directory}"`)
343
+
327
344
  return (
328
345
  new Promise((resolve, reject) => {
329
- const D = normalize(d)
330
- const commands = getCommands(D, getInstallSaveBundleCommands(p, r, f))
346
+ const commands = getCommands(getInstallSaveBundleCommands(deps, r, f))
331
347
 
332
348
  const {
333
349
  stdout,
334
350
  stderr
335
- } = exec(commands, { ...OPTIONS, cwd: D }, (e, v) => {
351
+ } = exec(commands, { ...OPTIONS, cwd: directory }, (e, v) => {
336
352
  (!e)
337
353
  ? resolve(v)
338
354
  : reject(e)
@@ -351,25 +367,28 @@ export function installSaveBundle (d, p, r, f) {
351
367
  *
352
368
  * Spawn the `npm install --save-optional --save-exact` commands
353
369
  *
354
- * @param {String} d - Directory
355
- * @param {Object} p - Packages
356
- * @param {String} r - Registry
357
- * @param {Boolean} f - Force
370
+ * @param {string} d - Directory
371
+ * @param {DependencyDescriptor|DependencyDescriptor[]} deps - Dependency descriptor(s)
372
+ * @param {string} r - Registry
373
+ * @param {boolean} f - Force
358
374
  *
359
375
  * @return {Promise}
360
376
  */
361
- export function installSaveOptionalSaveExact (d, p, r, f) {
377
+ export function installSaveOptionalSaveExact (d, deps, r, f) {
362
378
  log('installSaveOptionalSaveExact')
363
379
 
380
+ const directory = normalize(d)
381
+
382
+ log(`Directory is "${directory}"`)
383
+
364
384
  return (
365
385
  new Promise((resolve, reject) => {
366
- const D = normalize(d)
367
- const commands = getCommands(D, getInstallSaveOptionalSaveExactCommands(p, r, f))
386
+ const commands = getCommands(getInstallSaveOptionalSaveExactCommands(deps, r, f))
368
387
 
369
388
  const {
370
389
  stdout,
371
390
  stderr
372
- } = exec(commands, { ...OPTIONS, cwd: D }, (e, v) => {
391
+ } = exec(commands, { ...OPTIONS, cwd: directory }, (e, v) => {
373
392
  (!e)
374
393
  ? resolve(v)
375
394
  : reject(e)
@@ -388,25 +407,28 @@ export function installSaveOptionalSaveExact (d, p, r, f) {
388
407
  *
389
408
  * Spawn the `npm install --save-optional` commands
390
409
  *
391
- * @param {String} d - Directory
392
- * @param {Object} p - Packages
393
- * @param {String} r - Registry
394
- * @param {Boolean} f - Force
410
+ * @param {string} d - Directory
411
+ * @param {Dependencies} dependencies - Dependencies
412
+ * @param {string} r - Registry
413
+ * @param {boolean} f - Force
395
414
  *
396
415
  * @return {Promise}
397
416
  */
398
- export function installSaveOptional (d, p, r, f) {
417
+ export function installSaveOptional (d, dependencies, r, f) {
399
418
  log('installSaveOptional')
400
419
 
420
+ const directory = normalize(d)
421
+
422
+ log(`Directory is "${directory}"`)
423
+
401
424
  return (
402
425
  new Promise((resolve, reject) => {
403
- const D = normalize(d)
404
- const commands = getCommands(D, getInstallSaveOptionalCommands(p, r, f))
426
+ const commands = getCommands(getInstallSaveOptionalCommands(dependencies, r, f))
405
427
 
406
428
  const {
407
429
  stdout,
408
430
  stderr
409
- } = exec(commands, { ...OPTIONS, cwd: D }, (e, v) => {
431
+ } = exec(commands, { ...OPTIONS, cwd: directory }, (e, v) => {
410
432
  (!e)
411
433
  ? resolve(v)
412
434
  : reject(e)
@@ -425,25 +447,28 @@ export function installSaveOptional (d, p, r, f) {
425
447
  *
426
448
  * Spawn the `npm install --save-dev --save-exact` commands
427
449
  *
428
- * @param {String} d - Directory
429
- * @param {Object} p - Packages
430
- * @param {String} r - Registry
431
- * @param {Boolean} f - Force
450
+ * @param {string} d - Directory
451
+ * @param {DependencyDescriptor|DependencyDescriptor[]} deps - Dependency descriptor(s)
452
+ * @param {string} r - Registry
453
+ * @param {boolean} f - Force
432
454
  *
433
455
  * @return {Promise}
434
456
  */
435
- export function installSaveDevSaveExact (d, p, r, f) {
457
+ export function installSaveDevSaveExact (d, deps, r, f) {
436
458
  log('installSaveDevSaveExact')
437
459
 
460
+ const directory = normalize(d)
461
+
462
+ log(`Directory is "${directory}"`)
463
+
438
464
  return (
439
465
  new Promise((resolve, reject) => {
440
- const D = normalize(d)
441
- const commands = getCommands(D, getInstallSaveDevSaveExactCommands(p, r, f))
466
+ const commands = getCommands(getInstallSaveDevSaveExactCommands(deps, r, f))
442
467
 
443
468
  const {
444
469
  stdout,
445
470
  stderr
446
- } = exec(commands, { ...OPTIONS, cwd: D }, (e, v) => {
471
+ } = exec(commands, { ...OPTIONS, cwd: directory }, (e, v) => {
447
472
  (!e)
448
473
  ? resolve(v)
449
474
  : reject(e)
@@ -462,25 +487,28 @@ export function installSaveDevSaveExact (d, p, r, f) {
462
487
  *
463
488
  * Spawn the `npm install --save-dev` commands
464
489
  *
465
- * @param {String} d - Directory
466
- * @param {Object} p - Packages
467
- * @param {String} r - Registry
468
- * @param {Boolean} f - Force
490
+ * @param {string} d - Directory
491
+ * @param {DependencyDescriptor|DependencyDescriptor[]} deps - Dependency descriptor(s)
492
+ * @param {string} r - Registry
493
+ * @param {boolean} f - Force
469
494
  *
470
495
  * @return {Promise}
471
496
  */
472
- export function installSaveDev (d, p, r, f) {
497
+ export function installSaveDev (d, deps, r, f) {
473
498
  log('installSaveDev')
474
499
 
500
+ const directory = normalize(d)
501
+
502
+ log(`Directory is "${directory}"`)
503
+
475
504
  return (
476
505
  new Promise((resolve, reject) => {
477
- const D = normalize(d)
478
- const commands = getCommands(D, getInstallSaveDevCommands(p, r, f))
506
+ const commands = getCommands(getInstallSaveDevCommands(deps, r, f))
479
507
 
480
508
  const {
481
509
  stdout,
482
510
  stderr
483
- } = exec(commands, { ...OPTIONS, cwd: D }, (e, v) => {
511
+ } = exec(commands, { ...OPTIONS, cwd: directory }, (e, v) => {
484
512
  (!e)
485
513
  ? resolve(v)
486
514
  : reject(e)
@@ -499,25 +527,28 @@ export function installSaveDev (d, p, r, f) {
499
527
  *
500
528
  * Spawn the `npm install --save-prod --save-exact` commands
501
529
  *
502
- * @param {String} d - Directory
503
- * @param {Object} p - Packages
504
- * @param {String} r - Registry
505
- * @param {Boolean} f - Force
530
+ * @param {string} d - Directory
531
+ * @param {DependencyDescriptor|DependencyDescriptor[]} deps - Dependency descriptor(s)
532
+ * @param {string} r - Registry
533
+ * @param {boolean} f - Force
506
534
  *
507
535
  * @return {Promise}
508
536
  */
509
- export function installSaveProdSaveExact (d, p, r, f) {
537
+ export function installSaveProdSaveExact (d, deps, r, f) {
510
538
  log('installSaveProdSaveExact')
511
539
 
540
+ const directory = normalize(d)
541
+
542
+ log(`Directory is "${directory}"`)
543
+
512
544
  return (
513
545
  new Promise((resolve, reject) => {
514
- const D = normalize(d)
515
- const commands = getCommands(D, getInstallSaveProdSaveExactCommands(p, r, f))
546
+ const commands = getCommands(getInstallSaveProdSaveExactCommands(deps, r, f))
516
547
 
517
548
  const {
518
549
  stdout,
519
550
  stderr
520
- } = exec(commands, { ...OPTIONS, cwd: D }, (e, v) => {
551
+ } = exec(commands, { ...OPTIONS, cwd: directory }, (e, v) => {
521
552
  (!e)
522
553
  ? resolve(v)
523
554
  : reject(e)
@@ -536,25 +567,28 @@ export function installSaveProdSaveExact (d, p, r, f) {
536
567
  *
537
568
  * Spawn the `npm install --save-prod` commands
538
569
  *
539
- * @param {String} d - Directory
540
- * @param {Object} p - Packages
541
- * @param {String} r - Registry
542
- * @param {Boolean} f - Force
570
+ * @param {string} d - Directory
571
+ * @param {DependencyDescriptor|DependencyDescriptor[]} deps - Dependency descriptor(s)
572
+ * @param {string} r - Registry
573
+ * @param {boolean} f - Force
543
574
  *
544
575
  * @return {Promise}
545
576
  */
546
- export function installSaveProd (d, p, r, f) {
577
+ export function installSaveProd (d, deps, r, f) {
547
578
  log('installSaveProd')
548
579
 
580
+ const directory = normalize(d)
581
+
582
+ log(`Directory is "${directory}"`)
583
+
549
584
  return (
550
585
  new Promise((resolve, reject) => {
551
- const D = normalize(d)
552
- const commands = getCommands(D, getInstallSaveProdCommands(p, r, f))
586
+ const commands = getCommands(getInstallSaveProdCommands(deps, r, f))
553
587
 
554
588
  const {
555
589
  stdout,
556
590
  stderr
557
- } = exec(commands, { ...OPTIONS, cwd: D }, (e, v) => {
591
+ } = exec(commands, { ...OPTIONS, cwd: directory }, (e, v) => {
558
592
  (!e)
559
593
  ? resolve(v)
560
594
  : reject(e)
@@ -573,24 +607,24 @@ export function installSaveProd (d, p, r, f) {
573
607
  *
574
608
  * Execute the `npm install --save-bundle --save-exact` and `npm install --save-bundle` commands according to configuration and parameters
575
609
  *
576
- * @param {String} d - Directory
577
- * @param {Object} p - Packages
578
- * @param {Object} c - Configuration
579
- * @param {String} r - Registry
580
- * @param {Boolean} f - Force
610
+ * @param {string} d - Directory
611
+ * @param {Dependencies} packageDependencies - Package dependencies
612
+ * @param {Dependencies} configurationDependencies - Configuration dependencies
613
+ * @param {string} r - Registry
614
+ * @param {boolean} f - Force
581
615
  *
582
616
  * @return {Promise}
583
617
  */
584
- export async function executeBundle (directory = DIRECTORY, packages = {}, configuration = {}, registry = REGISTRY, force = false) {
618
+ export async function executeBundle (d = DIRECTORY, packageDependencies = {}, configurationDependencies = {}, r = REGISTRY, f = false) {
585
619
  log('executeBundle')
586
620
 
587
- const depsExact = getDepsExact(packages, configuration)
621
+ const depsExact = getDepsExact(packageDependencies, configurationDependencies)
588
622
 
589
- if (depsExact.length) await installSaveBundleSaveExact(directory, depsExact, registry, force)
623
+ if (depsExact.length) await installSaveBundleSaveExact(d, depsExact, r, f)
590
624
 
591
- const deps = getDeps(packages)
625
+ const deps = getDeps(packageDependencies)
592
626
 
593
- if (deps.length) await installSaveBundle(directory, deps, registry, force)
627
+ if (deps.length) await installSaveBundle(d, deps, r, f)
594
628
  }
595
629
 
596
630
  /**
@@ -598,24 +632,24 @@ export async function executeBundle (directory = DIRECTORY, packages = {}, confi
598
632
  *
599
633
  * Execute the `npm install --save-optional --save-exact` and `npm install --save-optional` commands according to configuration and parameters
600
634
  *
601
- * @param {String} d - Directory
602
- * @param {Object} p - Packages
603
- * @param {Object} c - Configuration
604
- * @param {String} r - Registry
605
- * @param {Boolean} f - Force
635
+ * @param {string} d - Directory
636
+ * @param {Dependencies} packageDependencies - Package dependencies
637
+ * @param {Dependencies} configurationDependencies - Configuration dependencies
638
+ * @param {string} r - Registry
639
+ * @param {boolean} f - Force
606
640
  *
607
641
  * @return {Promise}
608
642
  */
609
- export async function executeOptional (directory = DIRECTORY, packages = {}, configuration = {}, registry = REGISTRY, force = false) {
643
+ export async function executeOptional (d = DIRECTORY, packageDependencies = {}, configurationDependencies = {}, r = REGISTRY, f = false) {
610
644
  log('executeOptional')
611
645
 
612
- const depsExact = getDepsExact(packages, configuration)
646
+ const depsExact = getDepsExact(packageDependencies, configurationDependencies)
613
647
 
614
- if (depsExact.length) await installSaveOptionalSaveExact(directory, depsExact, registry, force)
648
+ if (depsExact.length) await installSaveOptionalSaveExact(d, depsExact, r, f)
615
649
 
616
- const deps = getDeps(packages)
650
+ const deps = getDeps(packageDependencies)
617
651
 
618
- if (deps.length) await installSaveOptional(directory, deps, registry, force)
652
+ if (deps.length) await installSaveOptional(d, deps, r, f)
619
653
  }
620
654
 
621
655
  /**
@@ -623,24 +657,24 @@ export async function executeOptional (directory = DIRECTORY, packages = {}, con
623
657
  *
624
658
  * Execute the `npm install --save-dev --save-exact` and `npm install --save-dev` commands according to configuration and parameters
625
659
  *
626
- * @param {String} d - Directory
627
- * @param {Object} p - Packages
628
- * @param {Object} c - Configuration
629
- * @param {String} r - Registry
630
- * @param {Boolean} f - Force
660
+ * @param {string} d - Directory
661
+ * @param {Dependencies} packageDependencies - Package dependencies
662
+ * @param {Dependencies} configurationDependencies - Configuration dependencies
663
+ * @param {string} r - Registry
664
+ * @param {boolean} f - Force
631
665
  *
632
666
  * @return {Promise}
633
667
  */
634
- export async function executeDev (directory = DIRECTORY, packages = {}, configuration = {}, registry = REGISTRY, force = false) {
668
+ export async function executeDev (d = DIRECTORY, packageDependencies = {}, configurationDependencies = {}, r = REGISTRY, f = false) {
635
669
  log('executeDev')
636
670
 
637
- const depsExact = getDepsExact(packages, configuration)
671
+ const depsExact = getDepsExact(packageDependencies, configurationDependencies)
638
672
 
639
- if (depsExact.length) await installSaveDevSaveExact(directory, depsExact, registry, force)
673
+ if (depsExact.length) await installSaveDevSaveExact(d, depsExact, r, f)
640
674
 
641
- const deps = getDeps(packages)
675
+ const deps = getDeps(packageDependencies)
642
676
 
643
- if (deps.length) await installSaveDev(directory, deps, registry, force)
677
+ if (deps.length) await installSaveDev(d, deps, r, f)
644
678
  }
645
679
 
646
680
  /**
@@ -648,22 +682,22 @@ export async function executeDev (directory = DIRECTORY, packages = {}, configur
648
682
  *
649
683
  * Execute the `npm install --save-prod --save-exact` and `npm install --save-prod` commands according to configuration and parameters
650
684
  *
651
- * @param {String} d - Directory
652
- * @param {Object} p - Packages
653
- * @param {Object} c - Configuration
654
- * @param {String} r - Registry
655
- * @param {Boolean} f - Force
685
+ * @param {string} d - Directory
686
+ * @param {Dependencies} packageDependencies - Package dependencies
687
+ * @param {Dependencies} configurationDependencies - Configuration dependencies
688
+ * @param {string} r - Registry
689
+ * @param {boolean} f - Force
656
690
  *
657
691
  * @return {Promise}
658
692
  */
659
- export async function executeProd (directory = DIRECTORY, packages = {}, configuration = {}, registry = REGISTRY, force = false) {
693
+ export async function executeProd (d = DIRECTORY, packageDependencies = {}, configurationDependencies = {}, r = REGISTRY, f = false) {
660
694
  log('executeProd')
661
695
 
662
- const depsExact = getDepsExact(packages, configuration)
696
+ const depsExact = getDepsExact(packageDependencies, configurationDependencies)
663
697
 
664
- if (depsExact.length) await installSaveProdSaveExact(directory, depsExact, registry, force)
698
+ if (depsExact.length) await installSaveProdSaveExact(d, depsExact, r, f)
665
699
 
666
- const deps = getDeps(packages)
700
+ const deps = getDeps(packageDependencies)
667
701
 
668
- if (deps.length) await installSaveProd(directory, deps, registry, force)
702
+ if (deps.length) await installSaveProd(d, deps, r, f)
669
703
  }