@form8ion/javascript 5.3.0 → 5.6.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);
@@ -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
  }
@@ -707,9 +706,6 @@ async function scaffoldTypescript ({
707
706
  },
708
707
  eslintConfigs,
709
708
  devDependencies: ['typescript', shareableTsConfigPackage],
710
- packageProperties: {
711
- types: 'lib/index.d.ts'
712
- },
713
709
  vcsIgnore: {
714
710
  files: ['tsconfig.tsbuildinfo']
715
711
  }
@@ -731,7 +727,6 @@ function scaffoldDialect ({
731
727
  projectType,
732
728
  projectRoot,
733
729
  configs,
734
- tests,
735
730
  buildDirectory,
736
731
  testFilenamePattern
737
732
  }) {
@@ -740,7 +735,6 @@ function scaffoldDialect ({
740
735
  return scaffoldBabel({
741
736
  preset: configs.babelPreset,
742
737
  projectRoot,
743
- tests,
744
738
  buildDirectory
745
739
  });
746
740
 
@@ -1138,7 +1132,9 @@ async function scaffoldPackageType ({
1138
1132
  packageProperties: {
1139
1133
  main: './lib/index.cjs.js',
1140
1134
  module: './lib/index.es.js',
1135
+ types: './lib/index.d.ts',
1141
1136
  exports: {
1137
+ types: './lib/index.d.ts',
1142
1138
  require: './lib/index.cjs.js',
1143
1139
  import: './lib/index.es.js'
1144
1140
  },
@@ -1700,7 +1696,6 @@ async function scaffolder (options) {
1700
1696
  configs,
1701
1697
  projectRoot,
1702
1698
  projectType,
1703
- tests,
1704
1699
  buildDirectory: projectTypeResults.buildDirectory,
1705
1700
  testFilenamePattern: verificationResults.testFilenamePattern
1706
1701
  })]);