@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.cjs.js CHANGED
@@ -26,6 +26,7 @@ var touch = require('touch');
26
26
  var path = require('path');
27
27
  var huskyPlugin = require('@form8ion/husky');
28
28
  var eslint = require('@form8ion/eslint');
29
+ var configFile = require('@form8ion/config-file');
29
30
 
30
31
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
31
32
 
@@ -175,7 +176,7 @@ async function removeNyc ({
175
176
  force: true
176
177
  }), removeDependencies({
177
178
  packageManager,
178
- dependencies: ['nyc', '@istanbuljs/nyc-config-babel']
179
+ dependencies: ['nyc', '@istanbuljs/nyc-config-babel', 'babel-plugin-istanbul']
179
180
  })]);
180
181
  }
181
182
 
@@ -691,25 +692,23 @@ async function prompt({
691
692
  async function scaffoldBabel ({
692
693
  projectRoot,
693
694
  preset,
694
- tests,
695
695
  buildDirectory
696
696
  }) {
697
697
  if (!preset) {
698
698
  throw new Error('No babel preset provided. Cannot configure babel transpilation');
699
699
  }
700
700
 
701
- await fs.promises.writeFile(`${projectRoot}/.babelrc`, JSON.stringify(_objectSpread2({
702
- presets: [preset.name],
703
- ignore: [`./${buildDirectory}/`]
704
- }, tests.unit && {
705
- env: {
706
- test: {
707
- plugins: ['istanbul']
708
- }
701
+ await configFile.write({
702
+ path: projectRoot,
703
+ name: 'babel',
704
+ format: core.fileTypes.JSON,
705
+ config: {
706
+ presets: [preset.name],
707
+ ignore: [`./${buildDirectory}/`]
709
708
  }
710
- })));
709
+ });
711
710
  return {
712
- devDependencies: ['@babel/register', preset.packageName, ...(tests.unit ? ['babel-plugin-istanbul'] : [])],
711
+ devDependencies: ['@babel/register', preset.packageName],
713
712
  eslint: {}
714
713
  };
715
714
  }
@@ -765,7 +764,6 @@ function scaffoldDialect ({
765
764
  projectType,
766
765
  projectRoot,
767
766
  configs,
768
- tests,
769
767
  buildDirectory,
770
768
  testFilenamePattern
771
769
  }) {
@@ -774,7 +772,6 @@ function scaffoldDialect ({
774
772
  return scaffoldBabel({
775
773
  preset: configs.babelPreset,
776
774
  projectRoot,
777
- tests,
778
775
  buildDirectory
779
776
  });
780
777
 
@@ -1734,7 +1731,6 @@ async function scaffolder (options) {
1734
1731
  configs,
1735
1732
  projectRoot,
1736
1733
  projectType,
1737
- tests,
1738
1734
  buildDirectory: projectTypeResults.buildDirectory,
1739
1735
  testFilenamePattern: verificationResults.testFilenamePattern
1740
1736
  })]);