@form8ion/javascript 11.5.0 → 11.5.2
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 +15 -11
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +12 -8
- package/lib/index.mjs.map +1 -1
- package/package.json +9 -9
package/lib/index.mjs
CHANGED
|
@@ -18,9 +18,9 @@ import { EOL } from 'os';
|
|
|
18
18
|
import validatePackageName from 'validate-npm-package-name';
|
|
19
19
|
import { scaffold as scaffold$3 } from '@form8ion/rollup';
|
|
20
20
|
import mustache from 'mustache';
|
|
21
|
-
import
|
|
22
|
-
import makeDir from 'make-dir';
|
|
21
|
+
import mkdir from 'make-dir';
|
|
23
22
|
import touch from 'touch';
|
|
23
|
+
import camelcase from 'camelcase';
|
|
24
24
|
import { resolve } from 'path';
|
|
25
25
|
import filedirname from 'filedirname';
|
|
26
26
|
import * as huskyPlugin from '@form8ion/husky';
|
|
@@ -28,7 +28,7 @@ import { scaffold as scaffold$4 } from '@form8ion/husky';
|
|
|
28
28
|
import { scaffold as scaffold$2 } from '@form8ion/prettier';
|
|
29
29
|
import { scaffold as scaffold$1, lift as lift$4, test as test$1 } from '@form8ion/eslint';
|
|
30
30
|
import { promises as promises$1 } from 'node:fs';
|
|
31
|
-
import
|
|
31
|
+
import sortProperties from 'sort-object-keys';
|
|
32
32
|
|
|
33
33
|
const questionNames$1 = {
|
|
34
34
|
UNIT_TEST_FRAMEWORK: 'unitTestFramework',
|
|
@@ -313,6 +313,12 @@ async function chooseBundler ({bundlers, decisions}) {
|
|
|
313
313
|
return answers[questionNames$1.PACKAGE_BUNDLER];
|
|
314
314
|
}
|
|
315
315
|
|
|
316
|
+
async function scaffoldBundler ({projectRoot, projectType, bundlers, dialect, decisions}) {
|
|
317
|
+
const chosenBundler = await chooseBundler({bundlers, decisions});
|
|
318
|
+
|
|
319
|
+
return scaffoldChoice(bundlers, chosenBundler, {projectRoot, projectType, dialect});
|
|
320
|
+
}
|
|
321
|
+
|
|
316
322
|
function determinePathToTemplateFile (fileName) {
|
|
317
323
|
const [, __dirname] = filedirname();
|
|
318
324
|
|
|
@@ -354,11 +360,9 @@ async function buildDetails ({
|
|
|
354
360
|
}) {
|
|
355
361
|
if (dialects$1.COMMON_JS === dialect) return buildDetailsForCommonJsProject({projectRoot, projectName, provideExample});
|
|
356
362
|
|
|
357
|
-
const
|
|
358
|
-
|
|
359
|
-
const pathToCreatedSrcDirectory = await makeDir(`${projectRoot}/src`);
|
|
363
|
+
const pathToCreatedSrcDirectory = await mkdir(`${projectRoot}/src`);
|
|
360
364
|
const [bundlerResults] = await Promise.all([
|
|
361
|
-
|
|
365
|
+
scaffoldBundler({bundlers: packageBundlers, projectRoot, dialect, decisions, projectType: projectTypes$1.PACKAGE}),
|
|
362
366
|
provideExample ? await createExample(projectRoot, projectName) : Promise.resolve,
|
|
363
367
|
touch(`${pathToCreatedSrcDirectory}/index.js`)
|
|
364
368
|
]);
|
|
@@ -807,7 +811,7 @@ async function scaffoldPackage ({
|
|
|
807
811
|
}
|
|
808
812
|
|
|
809
813
|
function sortPackageProperties (packageContents) {
|
|
810
|
-
return
|
|
814
|
+
return sortProperties(
|
|
811
815
|
packageContents,
|
|
812
816
|
[
|
|
813
817
|
'name',
|