@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.js +45 -65
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +46 -66
- package/lib/index.mjs.map +1 -1
- package/package.json +3 -3
package/lib/index.js
CHANGED
|
@@ -8,13 +8,14 @@ var javascriptCore = require('@form8ion/javascript-core');
|
|
|
8
8
|
var joi = require('joi');
|
|
9
9
|
var overridablePrompts = require('@form8ion/overridable-prompts');
|
|
10
10
|
var codecov = require('@form8ion/codecov');
|
|
11
|
-
var
|
|
11
|
+
var configFile = require('@form8ion/config-file');
|
|
12
12
|
var core = require('@form8ion/core');
|
|
13
13
|
var cliMessages = require('@travi/cli-messages');
|
|
14
14
|
var commitConventionPlugin = require('@form8ion/commit-convention');
|
|
15
15
|
var hoek = require('@hapi/hoek');
|
|
16
16
|
var execa = require('@form8ion/execa-wrapper');
|
|
17
17
|
var npmConf = require('npm-conf');
|
|
18
|
+
var fs = require('fs');
|
|
18
19
|
var ini = require('ini');
|
|
19
20
|
var os = require('os');
|
|
20
21
|
var validatePackageName = require('validate-npm-package-name');
|
|
@@ -26,7 +27,6 @@ var touch = require('touch');
|
|
|
26
27
|
var path = require('path');
|
|
27
28
|
var filedirname = require('filedirname');
|
|
28
29
|
var huskyPlugin = require('@form8ion/husky');
|
|
29
|
-
var configFile = require('@form8ion/config-file');
|
|
30
30
|
var prettier = require('@form8ion/prettier');
|
|
31
31
|
var eslint = require('@form8ion/eslint');
|
|
32
32
|
|
|
@@ -82,13 +82,15 @@ const questionNames$1 = {
|
|
|
82
82
|
};
|
|
83
83
|
|
|
84
84
|
async function scaffoldC8 ({projectRoot}) {
|
|
85
|
-
await
|
|
86
|
-
|
|
87
|
-
JSON
|
|
85
|
+
await configFile.write({
|
|
86
|
+
name: 'c8',
|
|
87
|
+
format: core.fileTypes.JSON,
|
|
88
|
+
path: projectRoot,
|
|
89
|
+
config: {
|
|
88
90
|
reporter: ['lcov', 'text-summary', 'html'],
|
|
89
91
|
exclude: ['src/**/*-test.js', 'test/', 'thirdparty-wrappers/', 'vendor/']
|
|
90
|
-
}
|
|
91
|
-
);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
92
94
|
|
|
93
95
|
return {
|
|
94
96
|
devDependencies: ['cross-env', 'c8'],
|
|
@@ -191,17 +193,6 @@ async function scaffoldUnitTesting ({projectRoot, frameworks, decisions, visibil
|
|
|
191
193
|
]);
|
|
192
194
|
}
|
|
193
195
|
|
|
194
|
-
async function scaffoldEslint ({config, projectRoot, additionalConfiguration}) {
|
|
195
|
-
const {scope} = config;
|
|
196
|
-
const {ignore} = additionalConfiguration;
|
|
197
|
-
|
|
198
|
-
return eslint.scaffold({scope, projectRoot, ignore});
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
function lifter$1 ({results: {buildDirectory, eslintConfigs, eslint: eslint$1}, projectRoot}) {
|
|
202
|
-
return eslint.lift({projectRoot, configs: [...eslintConfigs || [], ...eslint$1?.configs || []], buildDirectory});
|
|
203
|
-
}
|
|
204
|
-
|
|
205
196
|
async function scaffoldRemark ({config, projectRoot, projectType, vcs, dialect}) {
|
|
206
197
|
await configFile.write({
|
|
207
198
|
format: core.fileTypes.JSON,
|
|
@@ -247,13 +238,12 @@ async function scaffoldCodeStyle ({
|
|
|
247
238
|
dialect,
|
|
248
239
|
configs,
|
|
249
240
|
vcs,
|
|
250
|
-
configureLinting
|
|
251
|
-
eslint
|
|
241
|
+
configureLinting
|
|
252
242
|
}) {
|
|
253
243
|
return deepmerge__default["default"].all(await Promise.all([
|
|
254
244
|
configs.eslint
|
|
255
245
|
&& configureLinting
|
|
256
|
-
&&
|
|
246
|
+
&& eslint.scaffold({projectRoot, config: configs.eslint}),
|
|
257
247
|
scaffoldRemark({
|
|
258
248
|
projectRoot,
|
|
259
249
|
projectType,
|
|
@@ -267,9 +257,9 @@ async function scaffoldCodeStyle ({
|
|
|
267
257
|
|
|
268
258
|
var codeStylePlugin = /*#__PURE__*/Object.freeze({
|
|
269
259
|
__proto__: null,
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
260
|
+
lift: eslint.lift,
|
|
261
|
+
test: eslint.test,
|
|
262
|
+
scaffold: scaffoldCodeStyle
|
|
273
263
|
});
|
|
274
264
|
|
|
275
265
|
async function test$1({projectRoot}) {
|
|
@@ -1509,38 +1499,36 @@ async function scaffolder (options) {
|
|
|
1509
1499
|
description,
|
|
1510
1500
|
pathWithinParent
|
|
1511
1501
|
});
|
|
1512
|
-
const
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
})
|
|
1543
|
-
]);
|
|
1502
|
+
const projectTypeResults = await scaffoldProjectType({
|
|
1503
|
+
projectType,
|
|
1504
|
+
projectRoot,
|
|
1505
|
+
projectName,
|
|
1506
|
+
packageName,
|
|
1507
|
+
packageManager,
|
|
1508
|
+
visibility,
|
|
1509
|
+
applicationTypes,
|
|
1510
|
+
packageTypes,
|
|
1511
|
+
packageBundlers,
|
|
1512
|
+
monorepoTypes,
|
|
1513
|
+
scope,
|
|
1514
|
+
tests,
|
|
1515
|
+
vcs,
|
|
1516
|
+
decisions,
|
|
1517
|
+
dialect,
|
|
1518
|
+
publishRegistry: registries.publish
|
|
1519
|
+
});
|
|
1520
|
+
const verificationResults = await scaffoldVerification({
|
|
1521
|
+
projectRoot,
|
|
1522
|
+
dialect,
|
|
1523
|
+
visibility,
|
|
1524
|
+
packageManager,
|
|
1525
|
+
vcs,
|
|
1526
|
+
registries,
|
|
1527
|
+
tests,
|
|
1528
|
+
unitTestFrameworks,
|
|
1529
|
+
decisions,
|
|
1530
|
+
pathWithinParent
|
|
1531
|
+
});
|
|
1544
1532
|
const [nodeVersion, npmResults, dialectResults, codeStyleResults, projectTypePluginResults] = await Promise.all([
|
|
1545
1533
|
scaffoldNodeVersion({projectRoot, nodeVersionCategory}),
|
|
1546
1534
|
scaffoldNpmConfig({projectType, projectRoot, registries}),
|
|
@@ -1551,15 +1539,7 @@ async function scaffolder (options) {
|
|
|
1551
1539
|
projectType,
|
|
1552
1540
|
testFilenamePattern: verificationResults.testFilenamePattern
|
|
1553
1541
|
}),
|
|
1554
|
-
scaffoldCodeStyle({
|
|
1555
|
-
projectRoot,
|
|
1556
|
-
projectType,
|
|
1557
|
-
dialect,
|
|
1558
|
-
configs,
|
|
1559
|
-
vcs,
|
|
1560
|
-
configureLinting,
|
|
1561
|
-
eslint: verificationResults.eslint
|
|
1562
|
-
}),
|
|
1542
|
+
scaffoldCodeStyle({projectRoot, projectType, dialect, configs, vcs, configureLinting}),
|
|
1563
1543
|
scaffoldProjectTypePlugin({
|
|
1564
1544
|
projectRoot,
|
|
1565
1545
|
projectType,
|