@form8ion/javascript 7.2.5 → 7.3.1-beta.1

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.mjs CHANGED
@@ -4,14 +4,15 @@ import { validateOptions, scaffoldChoice, projectTypes, dialects as dialects$1,
4
4
  import joi from 'joi';
5
5
  import { prompt as prompt$1, Separator } from '@form8ion/overridable-prompts';
6
6
  import { scaffold, lift as lift$3 } from '@form8ion/codecov';
7
- import { promises } from 'fs';
8
- import { fileExists, fileTypes, writeConfigFile, applyEnhancers } from '@form8ion/core';
7
+ import { write as write$1 } from '@form8ion/config-file';
8
+ import { fileTypes, fileExists, writeConfigFile, applyEnhancers } from '@form8ion/core';
9
9
  import { info, warn, error } from '@travi/cli-messages';
10
10
  import * as commitConventionPlugin from '@form8ion/commit-convention';
11
11
  import { scaffold as scaffold$5 } from '@form8ion/commit-convention';
12
12
  import hoek from '@hapi/hoek';
13
13
  import execa from '@form8ion/execa-wrapper';
14
14
  import npmConf from 'npm-conf';
15
+ import { promises } from 'fs';
15
16
  import { stringify } from 'ini';
16
17
  import { EOL } from 'os';
17
18
  import validatePackageName from 'validate-npm-package-name';
@@ -24,7 +25,6 @@ import { resolve } from 'path';
24
25
  import filedirname from 'filedirname';
25
26
  import * as huskyPlugin from '@form8ion/husky';
26
27
  import { scaffold as scaffold$4 } from '@form8ion/husky';
27
- import { write as write$1 } from '@form8ion/config-file';
28
28
  import { scaffold as scaffold$2 } from '@form8ion/prettier';
29
29
  import { scaffold as scaffold$1, lift as lift$4, test as test$2 } from '@form8ion/eslint';
30
30
 
@@ -46,13 +46,15 @@ const questionNames$1 = {
46
46
  };
47
47
 
48
48
  async function scaffoldC8 ({projectRoot}) {
49
- await promises.writeFile(
50
- `${projectRoot}/.c8rc.json`,
51
- JSON.stringify({
49
+ await write$1({
50
+ name: 'c8',
51
+ format: fileTypes.JSON,
52
+ path: projectRoot,
53
+ config: {
52
54
  reporter: ['lcov', 'text-summary', 'html'],
53
55
  exclude: ['src/**/*-test.js', 'test/', 'thirdparty-wrappers/', 'vendor/']
54
- })
55
- );
56
+ }
57
+ });
56
58
 
57
59
  return {
58
60
  devDependencies: ['cross-env', 'c8'],
@@ -155,17 +157,6 @@ async function scaffoldUnitTesting ({projectRoot, frameworks, decisions, visibil
155
157
  ]);
156
158
  }
157
159
 
158
- async function scaffoldEslint ({config, projectRoot, additionalConfiguration}) {
159
- const {scope} = config;
160
- const {ignore} = additionalConfiguration;
161
-
162
- return scaffold$1({scope, projectRoot, ignore});
163
- }
164
-
165
- function lifter$1 ({results: {buildDirectory, eslintConfigs, eslint}, projectRoot}) {
166
- return lift$4({projectRoot, configs: [...eslintConfigs || [], ...eslint?.configs || []], buildDirectory});
167
- }
168
-
169
160
  async function scaffoldRemark ({config, projectRoot, projectType, vcs, dialect}) {
170
161
  await write$1({
171
162
  format: fileTypes.JSON,
@@ -211,13 +202,12 @@ async function scaffoldCodeStyle ({
211
202
  dialect,
212
203
  configs,
213
204
  vcs,
214
- configureLinting,
215
- eslint
205
+ configureLinting
216
206
  }) {
217
207
  return deepmerge.all(await Promise.all([
218
208
  configs.eslint
219
209
  && configureLinting
220
- && scaffoldEslint({projectRoot, config: configs.eslint, additionalConfiguration: eslint}),
210
+ && scaffold$1({projectRoot, config: configs.eslint}),
221
211
  scaffoldRemark({
222
212
  projectRoot,
223
213
  projectType,
@@ -231,9 +221,9 @@ async function scaffoldCodeStyle ({
231
221
 
232
222
  var codeStylePlugin = /*#__PURE__*/Object.freeze({
233
223
  __proto__: null,
234
- scaffold: scaffoldCodeStyle,
235
- lift: lifter$1,
236
- test: test$2
224
+ lift: lift$4,
225
+ test: test$2,
226
+ scaffold: scaffoldCodeStyle
237
227
  });
238
228
 
239
229
  async function test$1({projectRoot}) {
@@ -1473,38 +1463,36 @@ async function scaffolder (options) {
1473
1463
  description,
1474
1464
  pathWithinParent
1475
1465
  });
1476
- const [projectTypeResults, verificationResults] = await Promise.all([
1477
- scaffoldProjectType({
1478
- projectType,
1479
- projectRoot,
1480
- projectName,
1481
- packageName,
1482
- packageManager,
1483
- visibility,
1484
- applicationTypes,
1485
- packageTypes,
1486
- packageBundlers,
1487
- monorepoTypes,
1488
- scope,
1489
- tests,
1490
- vcs,
1491
- decisions,
1492
- dialect,
1493
- publishRegistry: registries.publish
1494
- }),
1495
- scaffoldVerification({
1496
- projectRoot,
1497
- dialect,
1498
- visibility,
1499
- packageManager,
1500
- vcs,
1501
- registries,
1502
- tests,
1503
- unitTestFrameworks,
1504
- decisions,
1505
- pathWithinParent
1506
- })
1507
- ]);
1466
+ const projectTypeResults = await scaffoldProjectType({
1467
+ projectType,
1468
+ projectRoot,
1469
+ projectName,
1470
+ packageName,
1471
+ packageManager,
1472
+ visibility,
1473
+ applicationTypes,
1474
+ packageTypes,
1475
+ packageBundlers,
1476
+ monorepoTypes,
1477
+ scope,
1478
+ tests,
1479
+ vcs,
1480
+ decisions,
1481
+ dialect,
1482
+ publishRegistry: registries.publish
1483
+ });
1484
+ const verificationResults = await scaffoldVerification({
1485
+ projectRoot,
1486
+ dialect,
1487
+ visibility,
1488
+ packageManager,
1489
+ vcs,
1490
+ registries,
1491
+ tests,
1492
+ unitTestFrameworks,
1493
+ decisions,
1494
+ pathWithinParent
1495
+ });
1508
1496
  const [nodeVersion, npmResults, dialectResults, codeStyleResults, projectTypePluginResults] = await Promise.all([
1509
1497
  scaffoldNodeVersion({projectRoot, nodeVersionCategory}),
1510
1498
  scaffoldNpmConfig({projectType, projectRoot, registries}),
@@ -1515,15 +1503,7 @@ async function scaffolder (options) {
1515
1503
  projectType,
1516
1504
  testFilenamePattern: verificationResults.testFilenamePattern
1517
1505
  }),
1518
- scaffoldCodeStyle({
1519
- projectRoot,
1520
- projectType,
1521
- dialect,
1522
- configs,
1523
- vcs,
1524
- configureLinting,
1525
- eslint: verificationResults.eslint
1526
- }),
1506
+ scaffoldCodeStyle({projectRoot, projectType, dialect, configs, vcs, configureLinting}),
1527
1507
  scaffoldProjectTypePlugin({
1528
1508
  projectRoot,
1529
1509
  projectType,