@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.cjs.js CHANGED
@@ -330,6 +330,10 @@ function write({
330
330
  });
331
331
  }
332
332
 
333
+ function scaffoldScripts () {
334
+ return {};
335
+ }
336
+
333
337
  function projectWillBeTested(scripts) {
334
338
  return Object.keys(scripts).find(scriptName => scriptName.startsWith('test:'));
335
339
  }
@@ -338,10 +342,17 @@ function projectShouldBeBuiltForVerification(scripts) {
338
342
  return 'run-s build' === scripts['pregenerate:md'];
339
343
  }
340
344
 
341
- function defineScripts(scripts) {
342
- return {
345
+ function updateTestScript (scripts) {
346
+ return _objectSpread2(_objectSpread2({}, scripts), {}, {
343
347
  test: `npm-run-all --print-label${projectShouldBeBuiltForVerification(scripts) ? ' build' : ''} --parallel lint:*${projectWillBeTested(scripts) ? ' --parallel test:*' : ''}`
344
- };
348
+ });
349
+ }
350
+
351
+ function liftScripts ({
352
+ existingScripts,
353
+ scripts
354
+ }) {
355
+ return updateTestScript(_objectSpread2(_objectSpread2({}, existingScripts), scripts));
345
356
  }
346
357
 
347
358
  function defineVcsHostDetails(vcs, packageType, packageName, pathWithinParent) {
@@ -364,7 +375,6 @@ function buildPackageDetails ({
364
375
  vcs,
365
376
  author,
366
377
  description,
367
- scripts,
368
378
  packageProperties,
369
379
  pathWithinParent
370
380
  }) {
@@ -375,7 +385,7 @@ function buildPackageDetails ({
375
385
  type: javascriptCore.dialects.ESM === dialect ? 'module' : 'commonjs'
376
386
  }, packageProperties), defineVcsHostDetails(vcs, projectType, packageName, pathWithinParent)), {}, {
377
387
  author: `${author.name}${author.email ? ` <${author.email}>` : ''}${author.url ? ` (${author.url})` : ''}`,
378
- scripts: defineScripts(scripts)
388
+ scripts: scaffoldScripts()
379
389
  });
380
390
  }
381
391
 
@@ -383,7 +393,6 @@ async function scaffoldPackage ({
383
393
  projectRoot,
384
394
  projectType,
385
395
  dialect,
386
- scripts,
387
396
  packageName,
388
397
  license,
389
398
  vcs,
@@ -401,7 +410,6 @@ async function scaffoldPackage ({
401
410
  vcs,
402
411
  author,
403
412
  description,
404
- scripts,
405
413
  packageProperties,
406
414
  pathWithinParent
407
415
  });
@@ -414,13 +422,6 @@ async function scaffoldPackage ({
414
422
  };
415
423
  }
416
424
 
417
- function liftScripts ({
418
- existingScripts,
419
- scripts
420
- }) {
421
- return _objectSpread2(_objectSpread2({}, existingScripts), scripts);
422
- }
423
-
424
425
  async function liftPackage ({
425
426
  projectRoot,
426
427
  scripts,
@@ -1797,7 +1798,6 @@ async function scaffolder (options) {
1797
1798
  author,
1798
1799
  description,
1799
1800
  packageProperties: mergedContributions.packageProperties,
1800
- scripts: mergedContributions.scripts,
1801
1801
  pathWithinParent
1802
1802
  });
1803
1803
  const liftResults = await lift({