@form8ion/javascript 4.5.1 → 4.7.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
@@ -7,7 +7,7 @@ import { prompt as prompt$1 } from '@form8ion/overridable-prompts';
7
7
  import { scaffold, lift as lift$3 } from '@form8ion/codecov';
8
8
  import { promises } from 'fs';
9
9
  import { fileExists, applyEnhancers } from '@form8ion/core';
10
- import { info, warn } from '@travi/cli-messages';
10
+ import { info, error, warn } from '@travi/cli-messages';
11
11
  import * as commitConventionPlugin from '@form8ion/commit-convention';
12
12
  import { scaffold as scaffold$4 } from '@form8ion/commit-convention';
13
13
  import hoek from '@hapi/hoek';
@@ -304,8 +304,13 @@ async function liftPackage ({
304
304
  }
305
305
 
306
306
  info('Installing dependencies');
307
- await installDependencies(dependencies || [], PROD_DEPENDENCY_TYPE, projectRoot, packageManager);
308
- await installDependencies([...(devDependencies || [])], DEV_DEPENDENCY_TYPE, projectRoot, packageManager);
307
+
308
+ try {
309
+ await installDependencies(dependencies || [], PROD_DEPENDENCY_TYPE, projectRoot, packageManager);
310
+ await installDependencies([...(devDependencies || [])], DEV_DEPENDENCY_TYPE, projectRoot, packageManager);
311
+ } catch (e) {
312
+ error('Failed to install dependencies');
313
+ }
309
314
  }
310
315
 
311
316
  async function resolvePackageManager ({
@@ -367,6 +372,10 @@ async function lift ({
367
372
  return enhancerResults;
368
373
  }
369
374
 
375
+ const packageBundlersSchema = joi.object().pattern(/^/, joi.object({
376
+ scaffolder: joi.func().arity(1).required()
377
+ }));
378
+
370
379
  function validate(options) {
371
380
  const schema = joi.object().required().keys({
372
381
  projectRoot: joi.string().required(),
@@ -432,9 +441,10 @@ function validate(options) {
432
441
  scaffolder: joi.func().arity(1).required()
433
442
  }))
434
443
  }).keys({
435
- decisions: joi.object()
444
+ unitTestFrameworks: unitTestFrameworksSchema,
445
+ packageBundlers: packageBundlersSchema
436
446
  }).keys({
437
- unitTestFrameworks: unitTestFrameworksSchema
447
+ decisions: joi.object()
438
448
  }).keys({
439
449
  registries: joi.object().pattern(joi.string(), joi.string().uri()).default({})
440
450
  });
@@ -1427,7 +1437,10 @@ async function scaffoldRemark ({
1427
1437
  })));
1428
1438
  }
1429
1439
 
1430
- function scaffoldBanSensitiveFiles () {
1440
+ function scaffoldBanSensitiveFiles ({
1441
+ pathWithinParent
1442
+ }) {
1443
+ if (pathWithinParent) return {};
1431
1444
  return {
1432
1445
  scripts: {
1433
1446
  'lint:sensitive': 'ban'
@@ -1493,6 +1506,7 @@ async function scaffoldLinting ({
1493
1506
  vcs,
1494
1507
  configureLinting,
1495
1508
  buildDirectory,
1509
+ pathWithinParent,
1496
1510
  eslint
1497
1511
  }) {
1498
1512
  return deepmerge.all(await Promise.all([scaffoldLockfileLint({
@@ -1510,7 +1524,9 @@ async function scaffoldLinting ({
1510
1524
  dialect,
1511
1525
  vcs,
1512
1526
  config: configs.remark || '@form8ion/remark-lint-preset'
1513
- }), vcs ? scaffoldBanSensitiveFiles() : {}]));
1527
+ }), vcs ? scaffoldBanSensitiveFiles({
1528
+ pathWithinParent
1529
+ }) : {}]));
1514
1530
  }
1515
1531
 
1516
1532
  async function scaffoldVerification({
@@ -1554,6 +1570,7 @@ async function scaffoldVerification({
1554
1570
  vcs,
1555
1571
  configureLinting,
1556
1572
  buildDirectory,
1573
+ pathWithinParent,
1557
1574
  eslint: deepmerge.all([testingResults.eslint, {
1558
1575
  configs: testingResults.eslintConfigs
1559
1576
  }, {