@form8ion/javascript 12.6.1 → 13.0.0-alpha.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/README.md CHANGED
@@ -103,6 +103,12 @@ const {
103
103
  scripts: {},
104
104
  eslint: {configs: [], ignore: {directories: []}},
105
105
  packageManager: 'npm'
106
+ },
107
+ enhancers: {
108
+ PluginName: {
109
+ test: () => true,
110
+ lift: () => ({})
111
+ }
106
112
  }
107
113
  });
108
114
  }
package/example.js CHANGED
@@ -71,6 +71,12 @@ const {
71
71
  scripts: {},
72
72
  eslint: {configs: [], ignore: {directories: []}},
73
73
  packageManager: 'npm'
74
+ },
75
+ enhancers: {
76
+ PluginName: {
77
+ test: () => true,
78
+ lift: () => ({})
79
+ }
74
80
  }
75
81
  });
76
82
  }
package/lib/index.js CHANGED
@@ -163,9 +163,7 @@ var coveragePlugin = /*#__PURE__*/Object.freeze({
163
163
  test: tester$4
164
164
  });
165
165
 
166
- const unitTestFrameworksSchema = joi__default["default"].object().required().pattern(/^/, joi__default["default"].object({
167
- scaffolder: joi__default["default"].func().arity(1).required()
168
- }));
166
+ const unitTestFrameworksSchema = joi__default["default"].object().required().pattern(/^/, core.optionsSchemas.form8ionPlugin);
169
167
 
170
168
  async function chooseFramework ({frameworks, decisions}) {
171
169
  if (!Object.keys(frameworks).length) return 'Other';
@@ -597,8 +595,8 @@ async function scaffoldPackageType ({
597
595
  }
598
596
  },
599
597
  ...javascriptCore.dialects.ESM === dialect && {
600
- main: './lib/index.mjs',
601
- exports: './lib/index.mjs'
598
+ main: './lib/index.js',
599
+ exports: './lib/index.js'
602
600
  },
603
601
  ...javascriptCore.dialects.TYPESCRIPT === dialect && {
604
602
  main: './lib/index.js',
@@ -620,6 +618,7 @@ async function scaffoldPackageType ({
620
618
  documentation: scaffoldPackageDocumentation({packageName, visibility, scope, packageManager, provideExample}),
621
619
  nextSteps: [
622
620
  {summary: 'Add the appropriate `save` flag to the installation instructions in the README'},
621
+ {summary: 'Define supported node.js versions as `engines.node` in the `package.json` file'},
623
622
  {summary: 'Publish pre-release versions to npm until package is stable enough to publish v1.0.0'}
624
623
  ]
625
624
  },
@@ -718,7 +717,7 @@ async function scaffoldCliType ({
718
717
  devDependencies: ['rimraf'],
719
718
  vcsIgnore: {files: [], directories: [`/${defaultBuildDirectory}/`]},
720
719
  buildDirectory: defaultBuildDirectory,
721
- nextSteps: []
720
+ nextSteps: [{summary: 'Define supported node.js versions as `engines.node` in the `package.json` file'}]
722
721
  }
723
722
  ]);
724
723
  }
@@ -1156,7 +1155,7 @@ var packageManagers = /*#__PURE__*/Object.freeze({
1156
1155
  defineLockfilePath: determineLockfilePathFor
1157
1156
  });
1158
1157
 
1159
- async function lift ({projectRoot, vcs, results, pathWithinParent}) {
1158
+ async function lift ({projectRoot, vcs, results, pathWithinParent, enhancers = {}}) {
1160
1159
  cliMessages.info('Lifting JavaScript-specific details');
1161
1160
 
1162
1161
  const {
@@ -1174,17 +1173,18 @@ async function lift ({projectRoot, vcs, results, pathWithinParent}) {
1174
1173
 
1175
1174
  const enhancerResults = await core.applyEnhancers({
1176
1175
  results,
1177
- enhancers: [
1178
- huskyPlugin__namespace,
1176
+ enhancers: {
1177
+ ...enhancers,
1178
+ huskyPlugin: huskyPlugin__namespace,
1179
1179
  enginesEnhancer,
1180
1180
  coveragePlugin,
1181
- commitConventionPlugin__namespace,
1181
+ commitConventionPlugin: commitConventionPlugin__namespace,
1182
1182
  dialects,
1183
1183
  codeStylePlugin,
1184
1184
  npmConfigPlugin,
1185
1185
  projectTypes,
1186
1186
  packageManagers
1187
- ],
1187
+ },
1188
1188
  options: {packageManager, projectRoot, vcs, packageDetails: JSON.parse(packageContents)}
1189
1189
  });
1190
1190
 
@@ -1198,8 +1198,7 @@ async function lift ({projectRoot, vcs, results, pathWithinParent}) {
1198
1198
  return enhancerResults;
1199
1199
  }
1200
1200
 
1201
- const pluginSchema = joi__default["default"].object({scaffolder: joi__default["default"].func().arity(1).required()});
1202
- const pluginMapSchema = joi__default["default"].object().pattern(joi__default["default"].string(), pluginSchema);
1201
+ const pluginMapSchema = joi__default["default"].object().pattern(joi__default["default"].string(), core.optionsSchemas.form8ionPlugin);
1203
1202
 
1204
1203
  const packageBundlersSchema = pluginMapSchema.default({});
1205
1204
 
@@ -1266,13 +1265,13 @@ function validate(options) {
1266
1265
  })).default({})
1267
1266
  })
1268
1267
  .keys({
1269
- applicationTypes: applicationTypesSchema,
1270
- packageTypes: packageTypesSchema,
1271
- monorepoTypes: monorepoTypesSchema
1272
- })
1273
- .keys({
1274
- unitTestFrameworks: unitTestFrameworksSchema,
1275
- packageBundlers: packageBundlersSchema
1268
+ plugins: {
1269
+ unitTestFrameworks: unitTestFrameworksSchema,
1270
+ packageBundlers: packageBundlersSchema,
1271
+ applicationTypes: applicationTypesSchema,
1272
+ packageTypes: packageTypesSchema,
1273
+ monorepoTypes: monorepoTypesSchema
1274
+ }
1276
1275
  })
1277
1276
  .keys({
1278
1277
  decisions: joi__default["default"].object()
@@ -1710,14 +1709,16 @@ async function scaffolder (options) {
1710
1709
  overrides,
1711
1710
  ciServices,
1712
1711
  hosts,
1713
- applicationTypes,
1714
- packageTypes,
1715
- packageBundlers,
1716
- monorepoTypes,
1717
1712
  decisions,
1718
- unitTestFrameworks,
1719
1713
  pathWithinParent,
1720
- registries
1714
+ registries,
1715
+ plugins: {
1716
+ applicationTypes,
1717
+ packageTypes,
1718
+ monorepoTypes,
1719
+ packageBundlers,
1720
+ unitTestFrameworks
1721
+ }
1721
1722
  } = validate(options);
1722
1723
 
1723
1724
  const {