@form8ion/javascript 5.8.0 → 5.9.0

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/lib/index.es.js CHANGED
@@ -296,6 +296,10 @@ function write({
296
296
  });
297
297
  }
298
298
 
299
+ function scaffoldScripts () {
300
+ return {};
301
+ }
302
+
299
303
  function projectWillBeTested(scripts) {
300
304
  return Object.keys(scripts).find(scriptName => scriptName.startsWith('test:'));
301
305
  }
@@ -304,10 +308,17 @@ function projectShouldBeBuiltForVerification(scripts) {
304
308
  return 'run-s build' === scripts['pregenerate:md'];
305
309
  }
306
310
 
307
- function defineScripts(scripts) {
308
- return {
311
+ function updateTestScript (scripts) {
312
+ return _objectSpread2(_objectSpread2({}, scripts), {}, {
309
313
  test: `npm-run-all --print-label${projectShouldBeBuiltForVerification(scripts) ? ' build' : ''} --parallel lint:*${projectWillBeTested(scripts) ? ' --parallel test:*' : ''}`
310
- };
314
+ });
315
+ }
316
+
317
+ function liftScripts ({
318
+ existingScripts,
319
+ scripts
320
+ }) {
321
+ return updateTestScript(_objectSpread2(_objectSpread2({}, existingScripts), scripts));
311
322
  }
312
323
 
313
324
  function defineVcsHostDetails(vcs, packageType, packageName, pathWithinParent) {
@@ -330,7 +341,6 @@ function buildPackageDetails ({
330
341
  vcs,
331
342
  author,
332
343
  description,
333
- scripts,
334
344
  packageProperties,
335
345
  pathWithinParent
336
346
  }) {
@@ -341,7 +351,7 @@ function buildPackageDetails ({
341
351
  type: dialects.ESM === dialect ? 'module' : 'commonjs'
342
352
  }, packageProperties), defineVcsHostDetails(vcs, projectType, packageName, pathWithinParent)), {}, {
343
353
  author: `${author.name}${author.email ? ` <${author.email}>` : ''}${author.url ? ` (${author.url})` : ''}`,
344
- scripts: defineScripts(scripts)
354
+ scripts: scaffoldScripts()
345
355
  });
346
356
  }
347
357
 
@@ -349,7 +359,6 @@ async function scaffoldPackage ({
349
359
  projectRoot,
350
360
  projectType,
351
361
  dialect,
352
- scripts,
353
362
  packageName,
354
363
  license,
355
364
  vcs,
@@ -367,7 +376,6 @@ async function scaffoldPackage ({
367
376
  vcs,
368
377
  author,
369
378
  description,
370
- scripts,
371
379
  packageProperties,
372
380
  pathWithinParent
373
381
  });
@@ -380,13 +388,6 @@ async function scaffoldPackage ({
380
388
  };
381
389
  }
382
390
 
383
- function liftScripts ({
384
- existingScripts,
385
- scripts
386
- }) {
387
- return _objectSpread2(_objectSpread2({}, existingScripts), scripts);
388
- }
389
-
390
391
  async function liftPackage ({
391
392
  projectRoot,
392
393
  scripts,
@@ -1763,7 +1764,6 @@ async function scaffolder (options) {
1763
1764
  author,
1764
1765
  description,
1765
1766
  packageProperties: mergedContributions.packageProperties,
1766
- scripts: mergedContributions.scripts,
1767
1767
  pathWithinParent
1768
1768
  });
1769
1769
  const liftResults = await lift({