@form8ion/javascript 5.2.0 → 5.5.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
@@ -6,7 +6,7 @@ import { Separator } from 'inquirer';
6
6
  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
- import { fileExists, applyEnhancers } from '@form8ion/core';
9
+ import { fileExists, applyEnhancers, fileTypes } from '@form8ion/core';
10
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';
@@ -24,6 +24,7 @@ import { resolve } from 'path';
24
24
  import * as huskyPlugin from '@form8ion/husky';
25
25
  import { scaffold as scaffold$3 } from '@form8ion/husky';
26
26
  import { lift as lift$4, scaffold as scaffold$2 } from '@form8ion/eslint';
27
+ import { write } from '@form8ion/config-file';
27
28
 
28
29
  function ownKeys(object, enumerableOnly) {
29
30
  var keys = Object.keys(object);
@@ -141,7 +142,7 @@ async function removeNyc ({
141
142
  force: true
142
143
  }), removeDependencies({
143
144
  packageManager,
144
- dependencies: ['nyc', '@istanbuljs/nyc-config-babel']
145
+ dependencies: ['nyc', '@istanbuljs/nyc-config-babel', 'babel-plugin-istanbul']
145
146
  })]);
146
147
  }
147
148
 
@@ -657,25 +658,23 @@ async function prompt({
657
658
  async function scaffoldBabel ({
658
659
  projectRoot,
659
660
  preset,
660
- tests,
661
661
  buildDirectory
662
662
  }) {
663
663
  if (!preset) {
664
664
  throw new Error('No babel preset provided. Cannot configure babel transpilation');
665
665
  }
666
666
 
667
- await promises.writeFile(`${projectRoot}/.babelrc`, JSON.stringify(_objectSpread2({
668
- presets: [preset.name],
669
- ignore: [`./${buildDirectory}/`]
670
- }, tests.unit && {
671
- env: {
672
- test: {
673
- plugins: ['istanbul']
674
- }
667
+ await write({
668
+ path: projectRoot,
669
+ name: 'babel',
670
+ format: fileTypes.JSON,
671
+ config: {
672
+ presets: [preset.name],
673
+ ignore: [`./${buildDirectory}/`]
675
674
  }
676
- })));
675
+ });
677
676
  return {
678
- devDependencies: ['@babel/register', preset.packageName, ...(tests.unit ? ['babel-plugin-istanbul'] : [])],
677
+ devDependencies: ['@babel/register', preset.packageName],
679
678
  eslint: {}
680
679
  };
681
680
  }
@@ -731,7 +730,6 @@ function scaffoldDialect ({
731
730
  projectType,
732
731
  projectRoot,
733
732
  configs,
734
- tests,
735
733
  buildDirectory,
736
734
  testFilenamePattern
737
735
  }) {
@@ -740,7 +738,6 @@ function scaffoldDialect ({
740
738
  return scaffoldBabel({
741
739
  preset: configs.babelPreset,
742
740
  projectRoot,
743
- tests,
744
741
  buildDirectory
745
742
  });
746
743
 
@@ -1700,7 +1697,6 @@ async function scaffolder (options) {
1700
1697
  configs,
1701
1698
  projectRoot,
1702
1699
  projectType,
1703
- tests,
1704
1700
  buildDirectory: projectTypeResults.buildDirectory,
1705
1701
  testFilenamePattern: verificationResults.testFilenamePattern
1706
1702
  })]);