@form8ion/javascript 12.1.0 → 12.3.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.js +149 -103
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +164 -118
- package/lib/index.mjs.map +1 -1
- package/package.json +14 -12
package/lib/index.js
CHANGED
|
@@ -24,10 +24,10 @@ var camelcase = require('camelcase');
|
|
|
24
24
|
var path = require('path');
|
|
25
25
|
var filedirname = require('filedirname');
|
|
26
26
|
var huskyPlugin = require('@form8ion/husky');
|
|
27
|
+
var node_fs = require('node:fs');
|
|
27
28
|
var ini = require('ini');
|
|
28
29
|
var prettier = require('@form8ion/prettier');
|
|
29
30
|
var eslintPlugin = require('@form8ion/eslint');
|
|
30
|
-
var node_fs = require('node:fs');
|
|
31
31
|
var sortProperties = require('sort-object-keys');
|
|
32
32
|
|
|
33
33
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -250,7 +250,7 @@ async function scaffoldCodeStyle ({
|
|
|
250
250
|
].filter(Boolean)));
|
|
251
251
|
}
|
|
252
252
|
|
|
253
|
-
function lifter$
|
|
253
|
+
function lifter$4 (options) {
|
|
254
254
|
return core.applyEnhancers({options, enhancers: [eslintPlugin__namespace]});
|
|
255
255
|
}
|
|
256
256
|
|
|
@@ -261,7 +261,7 @@ function tester$3 (options) {
|
|
|
261
261
|
var codeStylePlugin = /*#__PURE__*/Object.freeze({
|
|
262
262
|
__proto__: null,
|
|
263
263
|
scaffold: scaffoldCodeStyle,
|
|
264
|
-
lift: lifter$
|
|
264
|
+
lift: lifter$4,
|
|
265
265
|
test: tester$3
|
|
266
266
|
});
|
|
267
267
|
|
|
@@ -296,7 +296,7 @@ function tester$2 ({projectRoot}) {
|
|
|
296
296
|
return core.fileExists(`${projectRoot}/.npmrc`);
|
|
297
297
|
}
|
|
298
298
|
|
|
299
|
-
async function lifter$
|
|
299
|
+
async function lifter$3 ({projectRoot}) {
|
|
300
300
|
const pathToConfig = `${projectRoot}/.npmrc`;
|
|
301
301
|
|
|
302
302
|
const {
|
|
@@ -314,7 +314,7 @@ var npmConfigPlugin = /*#__PURE__*/Object.freeze({
|
|
|
314
314
|
__proto__: null,
|
|
315
315
|
scaffold: scaffoldNpmConfig,
|
|
316
316
|
test: tester$2,
|
|
317
|
-
lift: lifter$
|
|
317
|
+
lift: lifter$3
|
|
318
318
|
});
|
|
319
319
|
|
|
320
320
|
async function test({projectRoot}) {
|
|
@@ -428,14 +428,18 @@ async function liftProvenance ({projectRoot, packageDetails}) {
|
|
|
428
428
|
}
|
|
429
429
|
|
|
430
430
|
async function liftPublishable ({projectRoot, packageDetails}) {
|
|
431
|
-
const {name: packageName, publishConfig: {access:
|
|
431
|
+
const {name: packageName, publishConfig: {access: packageAccessLevel}} = packageDetails;
|
|
432
|
+
const homepage = `https://npm.im/${packageName}`;
|
|
433
|
+
|
|
434
|
+
await javascriptCore.mergeIntoExistingPackageJson({projectRoot, config: {homepage}});
|
|
432
435
|
|
|
433
436
|
return deepmerge__default["default"](
|
|
434
437
|
await liftProvenance({packageDetails, projectRoot}),
|
|
435
438
|
{
|
|
439
|
+
homepage,
|
|
436
440
|
devDependencies: ['publint'],
|
|
437
441
|
scripts: {'lint:publish': 'publint --strict'},
|
|
438
|
-
badges: defineBadges(packageName,
|
|
442
|
+
badges: defineBadges(packageName, packageAccessLevel)
|
|
439
443
|
}
|
|
440
444
|
);
|
|
441
445
|
}
|
|
@@ -650,6 +654,10 @@ async function scaffoldApplicationType ({projectRoot}) {
|
|
|
650
654
|
};
|
|
651
655
|
}
|
|
652
656
|
|
|
657
|
+
function isApplication ({packageDetails}) {
|
|
658
|
+
return !!packageDetails.private;
|
|
659
|
+
}
|
|
660
|
+
|
|
653
661
|
async function scaffoldMonorepoType ({projectRoot}) {
|
|
654
662
|
cliMessages.info('Scaffolding Monorepo Details');
|
|
655
663
|
|
|
@@ -728,7 +736,6 @@ async function scaffoldProjectType ({
|
|
|
728
736
|
visibility,
|
|
729
737
|
packageBundlers,
|
|
730
738
|
scope,
|
|
731
|
-
vcs,
|
|
732
739
|
decisions,
|
|
733
740
|
dialect,
|
|
734
741
|
provideExample,
|
|
@@ -744,7 +751,6 @@ async function scaffoldProjectType ({
|
|
|
744
751
|
visibility,
|
|
745
752
|
scope,
|
|
746
753
|
packageBundlers,
|
|
747
|
-
vcs,
|
|
748
754
|
decisions,
|
|
749
755
|
dialect,
|
|
750
756
|
provideExample,
|
|
@@ -772,21 +778,35 @@ async function scaffoldProjectType ({
|
|
|
772
778
|
}
|
|
773
779
|
|
|
774
780
|
async function tester$1 ({projectRoot, packageDetails}) {
|
|
775
|
-
return await isPackage({projectRoot, packageDetails})
|
|
781
|
+
return await isPackage({projectRoot, packageDetails})
|
|
782
|
+
|| await isCli({projectRoot, packageDetails})
|
|
783
|
+
|| isApplication({projectRoot, packageDetails});
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
function vcsRepositoryHostedOnGithub(vcs) {
|
|
787
|
+
return vcs && 'github' === vcs.host;
|
|
776
788
|
}
|
|
777
789
|
|
|
778
|
-
async function lifter$
|
|
790
|
+
async function lifter$2 ({projectRoot, packageDetails, vcs}) {
|
|
779
791
|
if (await isPackage({projectRoot, packageDetails})) return liftPackage$1({projectRoot, packageDetails});
|
|
780
792
|
if (await isCli({projectRoot, packageDetails})) return liftCli({projectRoot, packageDetails});
|
|
781
793
|
|
|
782
|
-
|
|
794
|
+
let homepage;
|
|
795
|
+
|
|
796
|
+
if (vcsRepositoryHostedOnGithub(vcs)) {
|
|
797
|
+
homepage = `https://github.com/${vcs.owner}/${vcs.name}#readme`;
|
|
798
|
+
|
|
799
|
+
await javascriptCore.mergeIntoExistingPackageJson({projectRoot, config: {homepage}});
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
return {homepage};
|
|
783
803
|
}
|
|
784
804
|
|
|
785
805
|
var projectTypes = /*#__PURE__*/Object.freeze({
|
|
786
806
|
__proto__: null,
|
|
787
807
|
scaffold: scaffoldProjectType,
|
|
788
808
|
test: tester$1,
|
|
789
|
-
lift: lifter$
|
|
809
|
+
lift: lifter$2
|
|
790
810
|
});
|
|
791
811
|
|
|
792
812
|
function write ({projectRoot, config}) {
|
|
@@ -795,7 +815,7 @@ function write ({projectRoot, config}) {
|
|
|
795
815
|
|
|
796
816
|
async function addIgnore ({projectRoot, ignore}) {
|
|
797
817
|
if (ignore) {
|
|
798
|
-
const existingConfig = JSON.parse(await
|
|
818
|
+
const existingConfig = JSON.parse(await node_fs.promises.readFile(`${projectRoot}/.babelrc.json`, 'utf-8'));
|
|
799
819
|
|
|
800
820
|
await write({projectRoot, config: {...existingConfig, ignore: [`./${ignore}/`]}});
|
|
801
821
|
}
|
|
@@ -814,7 +834,7 @@ async function scaffoldBabel ({projectRoot, preset}) {
|
|
|
814
834
|
};
|
|
815
835
|
}
|
|
816
836
|
|
|
817
|
-
async function lifter ({results, projectRoot}) {
|
|
837
|
+
async function lifter$1 ({results, projectRoot}) {
|
|
818
838
|
await addIgnore({ignore: results.buildDirectory, projectRoot});
|
|
819
839
|
|
|
820
840
|
return {};
|
|
@@ -868,100 +888,47 @@ var dialects = /*#__PURE__*/Object.freeze({
|
|
|
868
888
|
__proto__: null,
|
|
869
889
|
scaffold: scaffoldDialect,
|
|
870
890
|
test: predicate,
|
|
871
|
-
lift: lifter
|
|
891
|
+
lift: lifter$1
|
|
872
892
|
});
|
|
873
893
|
|
|
874
|
-
function scaffoldScripts () {
|
|
875
|
-
return {};
|
|
876
|
-
}
|
|
877
|
-
|
|
878
|
-
function projectWillBeTested(scripts) {
|
|
879
|
-
return Object.keys(scripts).find(scriptName => scriptName.startsWith('test:'));
|
|
880
|
-
}
|
|
881
|
-
|
|
882
|
-
function projectShouldBeBuiltForVerification(scripts) {
|
|
883
|
-
return 'run-s build' === scripts['pregenerate:md'];
|
|
884
|
-
}
|
|
885
|
-
|
|
886
|
-
function updateTestScript (scripts) {
|
|
887
|
-
return {
|
|
888
|
-
...scripts,
|
|
889
|
-
test: `npm-run-all --print-label${
|
|
890
|
-
projectShouldBeBuiltForVerification(scripts) ? ' build' : ''
|
|
891
|
-
} --parallel lint:*${
|
|
892
|
-
projectWillBeTested(scripts) ? ' --parallel test:*' : ''
|
|
893
|
-
}`
|
|
894
|
-
};
|
|
895
|
-
}
|
|
896
|
-
|
|
897
|
-
function liftScripts ({existingScripts, scripts}) {
|
|
898
|
-
return updateTestScript({...existingScripts, ...scripts});
|
|
899
|
-
}
|
|
900
|
-
|
|
901
|
-
function defineVcsHostDetails(vcs, packageType, packageName, pathWithinParent) {
|
|
902
|
-
return vcs && 'github' === vcs.host && {
|
|
903
|
-
repository: pathWithinParent
|
|
904
|
-
? {
|
|
905
|
-
type: 'git',
|
|
906
|
-
url: `https://github.com/${vcs.owner}/${vcs.name}.git`,
|
|
907
|
-
directory: pathWithinParent
|
|
908
|
-
}
|
|
909
|
-
: `${vcs.owner}/${vcs.name}`,
|
|
910
|
-
bugs: `https://github.com/${vcs.owner}/${vcs.name}/issues`,
|
|
911
|
-
homepage: (javascriptCore.projectTypes.PACKAGE === packageType)
|
|
912
|
-
? `https://npm.im/${packageName}`
|
|
913
|
-
: `https://github.com/${vcs.owner}/${vcs.name}#readme`
|
|
914
|
-
};
|
|
915
|
-
}
|
|
916
|
-
|
|
917
894
|
function buildPackageDetails ({
|
|
918
895
|
packageName,
|
|
919
|
-
projectType,
|
|
920
896
|
dialect,
|
|
921
897
|
license,
|
|
922
|
-
vcs,
|
|
923
898
|
author,
|
|
924
|
-
description
|
|
925
|
-
pathWithinParent
|
|
899
|
+
description
|
|
926
900
|
}) {
|
|
927
901
|
return {
|
|
928
902
|
name: packageName,
|
|
929
903
|
description,
|
|
930
904
|
license,
|
|
931
905
|
type: javascriptCore.dialects.ESM === dialect ? 'module' : 'commonjs',
|
|
932
|
-
...defineVcsHostDetails(vcs, projectType, packageName, pathWithinParent),
|
|
933
906
|
author: `${author.name}${author.email ? ` <${author.email}>` : ''}${author.url ? ` (${author.url})` : ''}`,
|
|
934
|
-
scripts:
|
|
907
|
+
scripts: {}
|
|
935
908
|
};
|
|
936
909
|
}
|
|
937
910
|
|
|
938
911
|
async function scaffoldPackage ({
|
|
939
912
|
projectRoot,
|
|
940
|
-
projectType,
|
|
941
913
|
dialect,
|
|
942
914
|
packageName,
|
|
943
915
|
license,
|
|
944
|
-
vcs,
|
|
945
916
|
author,
|
|
946
|
-
description
|
|
947
|
-
pathWithinParent
|
|
917
|
+
description
|
|
948
918
|
}) {
|
|
949
919
|
cliMessages.info('Configuring package.json');
|
|
950
920
|
|
|
951
921
|
const packageData = await buildPackageDetails({
|
|
952
922
|
packageName,
|
|
953
|
-
projectType,
|
|
954
923
|
dialect,
|
|
955
924
|
license,
|
|
956
|
-
vcs,
|
|
957
925
|
author,
|
|
958
|
-
description
|
|
959
|
-
pathWithinParent
|
|
926
|
+
description
|
|
960
927
|
});
|
|
961
928
|
|
|
962
929
|
await javascriptCore.writePackageJson({projectRoot, config: packageData});
|
|
963
930
|
|
|
964
|
-
return {
|
|
931
|
+
return {};
|
|
965
932
|
}
|
|
966
933
|
|
|
967
934
|
function sortPackageProperties (packageContents) {
|
|
@@ -1000,6 +967,19 @@ function sortPackageProperties (packageContents) {
|
|
|
1000
967
|
);
|
|
1001
968
|
}
|
|
1002
969
|
|
|
970
|
+
function defineVcsHostDetails (vcs, pathWithinParent) {
|
|
971
|
+
return vcs && 'github' === vcs.host && {
|
|
972
|
+
repository: pathWithinParent
|
|
973
|
+
? {
|
|
974
|
+
type: 'git',
|
|
975
|
+
url: `https://github.com/${vcs.owner}/${vcs.name}.git`,
|
|
976
|
+
directory: pathWithinParent
|
|
977
|
+
}
|
|
978
|
+
: `${vcs.owner}/${vcs.name}`,
|
|
979
|
+
bugs: `https://github.com/${vcs.owner}/${vcs.name}/issues`
|
|
980
|
+
};
|
|
981
|
+
}
|
|
982
|
+
|
|
1003
983
|
const details = {
|
|
1004
984
|
[javascriptCore.packageManagers.NPM]: {
|
|
1005
985
|
installationCommand: 'install',
|
|
@@ -1046,13 +1026,38 @@ async function install$1 (dependencies, dependenciesType, projectRoot, packageMa
|
|
|
1046
1026
|
} else cliMessages.warn(`No ${dependenciesType} dependencies to install`);
|
|
1047
1027
|
}
|
|
1048
1028
|
|
|
1029
|
+
function projectWillBeTested(scripts) {
|
|
1030
|
+
return Object.keys(scripts).find(scriptName => scriptName.startsWith('test:'));
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
function projectShouldBeBuiltForVerification(scripts) {
|
|
1034
|
+
return 'run-s build' === scripts['pregenerate:md'];
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
function updateTestScript (scripts) {
|
|
1038
|
+
return {
|
|
1039
|
+
...scripts,
|
|
1040
|
+
test: `npm-run-all --print-label${
|
|
1041
|
+
projectShouldBeBuiltForVerification(scripts) ? ' build' : ''
|
|
1042
|
+
} --parallel lint:*${
|
|
1043
|
+
projectWillBeTested(scripts) ? ' --parallel test:*' : ''
|
|
1044
|
+
}`
|
|
1045
|
+
};
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
function liftScripts ({existingScripts, scripts}) {
|
|
1049
|
+
return updateTestScript({...existingScripts, ...scripts});
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1049
1052
|
async function liftPackage ({
|
|
1050
1053
|
projectRoot,
|
|
1051
1054
|
scripts,
|
|
1052
1055
|
tags,
|
|
1053
1056
|
dependencies,
|
|
1054
1057
|
devDependencies,
|
|
1055
|
-
packageManager
|
|
1058
|
+
packageManager,
|
|
1059
|
+
vcs,
|
|
1060
|
+
pathWithinParent
|
|
1056
1061
|
}) {
|
|
1057
1062
|
if (scripts || tags) {
|
|
1058
1063
|
cliMessages.info('Updating `package.json`', {level: 'secondary'});
|
|
@@ -1065,7 +1070,11 @@ async function liftPackage ({
|
|
|
1065
1070
|
projectRoot,
|
|
1066
1071
|
config: sortPackageProperties({
|
|
1067
1072
|
...existingPackageJsonContents,
|
|
1068
|
-
|
|
1073
|
+
...defineVcsHostDetails(vcs, pathWithinParent),
|
|
1074
|
+
scripts: liftScripts({
|
|
1075
|
+
existingScripts: existingPackageJsonContents.scripts,
|
|
1076
|
+
scripts
|
|
1077
|
+
}),
|
|
1069
1078
|
...tags && {
|
|
1070
1079
|
keywords: existingPackageJsonContents.keywords ? [...existingPackageJsonContents.keywords, ...tags] : tags
|
|
1071
1080
|
}
|
|
@@ -1084,21 +1093,65 @@ async function liftPackage ({
|
|
|
1084
1093
|
}
|
|
1085
1094
|
}
|
|
1086
1095
|
|
|
1096
|
+
function determineLockfilePathFor (packageManager) {
|
|
1097
|
+
const lockfilePaths = {
|
|
1098
|
+
[javascriptCore.packageManagers.NPM]: 'package-lock.json',
|
|
1099
|
+
[javascriptCore.packageManagers.YARN]: 'yarn.lock'
|
|
1100
|
+
};
|
|
1101
|
+
|
|
1102
|
+
return lockfilePaths[packageManager];
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
function npmIsUsed ({projectRoot}) {
|
|
1106
|
+
return core.fileExists(`${projectRoot}/${determineLockfilePathFor(javascriptCore.packageManagers.NPM)}`);
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1109
|
+
function yarnIsUsed ({projectRoot}) {
|
|
1110
|
+
return core.fileExists(`${projectRoot}/${determineLockfilePathFor(javascriptCore.packageManagers.YARN)}`);
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
async function jsPackageManagerIsUsed ({projectRoot}) {
|
|
1114
|
+
const [npmFound, yarnFound] = await Promise.all([
|
|
1115
|
+
npmIsUsed({projectRoot}),
|
|
1116
|
+
yarnIsUsed({projectRoot})
|
|
1117
|
+
]);
|
|
1118
|
+
|
|
1119
|
+
return npmFound || yarnFound;
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1122
|
+
async function liftCorepack () {
|
|
1123
|
+
await execa__default["default"]('corepack', ['use', 'npm@latest']);
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
async function lifter () {
|
|
1127
|
+
await liftCorepack();
|
|
1128
|
+
|
|
1129
|
+
return {};
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1087
1132
|
async function resolvePackageManager ({projectRoot, packageManager}) {
|
|
1088
1133
|
if (packageManager) return packageManager;
|
|
1089
1134
|
|
|
1090
|
-
if (await
|
|
1135
|
+
if (await npmIsUsed({projectRoot})) {
|
|
1091
1136
|
return javascriptCore.packageManagers.NPM;
|
|
1092
1137
|
}
|
|
1093
1138
|
|
|
1094
|
-
if (await
|
|
1139
|
+
if (await yarnIsUsed({projectRoot})) {
|
|
1095
1140
|
return javascriptCore.packageManagers.YARN;
|
|
1096
1141
|
}
|
|
1097
1142
|
|
|
1098
1143
|
throw new Error('Package-manager could not be determined');
|
|
1099
1144
|
}
|
|
1100
1145
|
|
|
1101
|
-
|
|
1146
|
+
var packageManagers = /*#__PURE__*/Object.freeze({
|
|
1147
|
+
__proto__: null,
|
|
1148
|
+
test: jsPackageManagerIsUsed,
|
|
1149
|
+
lift: lifter,
|
|
1150
|
+
determineCurrent: resolvePackageManager,
|
|
1151
|
+
defineLockfilePath: determineLockfilePathFor
|
|
1152
|
+
});
|
|
1153
|
+
|
|
1154
|
+
async function lift ({projectRoot, vcs, results, pathWithinParent}) {
|
|
1102
1155
|
cliMessages.info('Lifting JavaScript-specific details');
|
|
1103
1156
|
|
|
1104
1157
|
const {
|
|
@@ -1124,14 +1177,15 @@ async function lift ({projectRoot, vcs, results}) {
|
|
|
1124
1177
|
dialects,
|
|
1125
1178
|
codeStylePlugin,
|
|
1126
1179
|
npmConfigPlugin,
|
|
1127
|
-
projectTypes
|
|
1180
|
+
projectTypes,
|
|
1181
|
+
packageManagers
|
|
1128
1182
|
],
|
|
1129
1183
|
options: {packageManager, projectRoot, vcs, packageDetails: JSON.parse(packageContents)}
|
|
1130
1184
|
});
|
|
1131
1185
|
|
|
1132
1186
|
await liftPackage(
|
|
1133
1187
|
deepmerge__default["default"].all([
|
|
1134
|
-
{projectRoot, scripts, tags, dependencies, devDependencies, packageManager},
|
|
1188
|
+
{projectRoot, scripts, tags, dependencies, devDependencies, packageManager, vcs, pathWithinParent},
|
|
1135
1189
|
enhancerResults
|
|
1136
1190
|
])
|
|
1137
1191
|
);
|
|
@@ -1468,13 +1522,17 @@ async function scaffoldNodeVersion ({projectRoot, nodeVersionCategory}) {
|
|
|
1468
1522
|
|
|
1469
1523
|
const version = await determineLatestVersionOf(nodeVersionCategory);
|
|
1470
1524
|
|
|
1471
|
-
await
|
|
1525
|
+
await node_fs.promises.writeFile(`${projectRoot}/.nvmrc`, version);
|
|
1472
1526
|
|
|
1473
1527
|
await install(nodeVersionCategory);
|
|
1474
1528
|
|
|
1475
1529
|
return version;
|
|
1476
1530
|
}
|
|
1477
1531
|
|
|
1532
|
+
function nvmIsUsed ({projectRoot}) {
|
|
1533
|
+
return core.fileExists(`${projectRoot}/.nvmrc`);
|
|
1534
|
+
}
|
|
1535
|
+
|
|
1478
1536
|
function buildBadgesDetails (contributors) {
|
|
1479
1537
|
return deepmerge__default["default"].all(contributors).badges;
|
|
1480
1538
|
}
|
|
@@ -1569,15 +1627,6 @@ function buildAllowedHostsList ({packageManager, registries}) {
|
|
|
1569
1627
|
|
|
1570
1628
|
const lockfileLintSupportedPackageManagers = [javascriptCore.packageManagers.NPM, javascriptCore.packageManagers.YARN];
|
|
1571
1629
|
|
|
1572
|
-
function determineLockfilePathFor(packageManager) {
|
|
1573
|
-
const lockfilePaths = {
|
|
1574
|
-
[javascriptCore.packageManagers.NPM]: 'package-lock.json',
|
|
1575
|
-
[javascriptCore.packageManagers.YARN]: 'yarn.lock'
|
|
1576
|
-
};
|
|
1577
|
-
|
|
1578
|
-
return lockfilePaths[packageManager];
|
|
1579
|
-
}
|
|
1580
|
-
|
|
1581
1630
|
function lockfileLintSupports(packageManager) {
|
|
1582
1631
|
return lockfileLintSupportedPackageManagers.includes(packageManager);
|
|
1583
1632
|
}
|
|
@@ -1683,16 +1732,13 @@ async function scaffolder (options) {
|
|
|
1683
1732
|
cliMessages.info('Writing project files', {level: 'secondary'});
|
|
1684
1733
|
|
|
1685
1734
|
const packageName = buildPackageName(projectName, scope);
|
|
1686
|
-
|
|
1735
|
+
await scaffoldPackage({
|
|
1687
1736
|
projectRoot,
|
|
1688
|
-
projectType,
|
|
1689
1737
|
dialect,
|
|
1690
1738
|
packageName,
|
|
1691
1739
|
license,
|
|
1692
|
-
vcs,
|
|
1693
1740
|
author,
|
|
1694
|
-
description
|
|
1695
|
-
pathWithinParent
|
|
1741
|
+
description
|
|
1696
1742
|
});
|
|
1697
1743
|
const projectTypeResults = await scaffoldProjectType({
|
|
1698
1744
|
projectType,
|
|
@@ -1775,7 +1821,8 @@ async function scaffolder (options) {
|
|
|
1775
1821
|
results: deepmerge__default["default"]({devDependencies: ['npm-run-all2'], packageManager}, mergedContributions),
|
|
1776
1822
|
projectRoot,
|
|
1777
1823
|
configs,
|
|
1778
|
-
vcs
|
|
1824
|
+
vcs,
|
|
1825
|
+
pathWithinParent
|
|
1779
1826
|
});
|
|
1780
1827
|
|
|
1781
1828
|
return {
|
|
@@ -1784,19 +1831,18 @@ async function scaffolder (options) {
|
|
|
1784
1831
|
tags: projectTypeResults.tags,
|
|
1785
1832
|
vcsIgnore: buildVcsIgnoreLists(mergedContributions.vcsIgnore),
|
|
1786
1833
|
verificationCommand: `${buildDocumentationCommand(packageManager)} && ${packageManager} test`,
|
|
1787
|
-
projectDetails: {...
|
|
1834
|
+
projectDetails: {...liftResults.homepage && {homepage: liftResults.homepage}},
|
|
1788
1835
|
nextSteps: mergedContributions.nextSteps
|
|
1789
1836
|
};
|
|
1790
1837
|
}
|
|
1791
1838
|
|
|
1792
1839
|
async function tester ({projectRoot}) {
|
|
1793
|
-
const [
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
core.fileExists(`${projectRoot}/yarn.lock`)
|
|
1840
|
+
const [nvmFound, jsPackageManagerFound] = await Promise.all([
|
|
1841
|
+
nvmIsUsed({projectRoot}),
|
|
1842
|
+
jsPackageManagerIsUsed({projectRoot})
|
|
1797
1843
|
]);
|
|
1798
1844
|
|
|
1799
|
-
return
|
|
1845
|
+
return nvmFound || jsPackageManagerFound;
|
|
1800
1846
|
}
|
|
1801
1847
|
|
|
1802
1848
|
const questionNames = {...languageScaffolderPrompts.questionNames, ...questionNames$1};
|