create-gasket-app 7.0.0-next.51 → 7.0.0-next.53

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.
@@ -111,6 +111,7 @@ createCommand.action = async function run(appname, options, command) {
111
111
  await globalPrompts({ context });
112
112
 
113
113
  if (rawPresets.length || localPresets.length) {
114
+
114
115
  await loadPreset({ context });
115
116
 
116
117
  const presetGasket = makeGasket({
@@ -109,6 +109,7 @@ async function performGenerate(context, descriptors) {
109
109
  handlebars.registerHelper('jspretty', (data) => {
110
110
  return JSON.stringify(data).replace(/"/g, '\'');
111
111
  });
112
+ handlebars.registerHelper('eq', (a, b) => a === b)
112
113
 
113
114
  debug('descriptors', JSON.stringify(descriptors, null, 2));
114
115
 
@@ -89,8 +89,8 @@ function cleanupFields(config) {
89
89
  * @returns {Promise} promise
90
90
  */
91
91
  async function writeGasketConfig({ context }) {
92
- const { dest, gasketConfig, generatedFiles } = context;
93
- const fileName = context.typescript ? 'gasket.ts' : 'gasket.js';
92
+ const { dest, gasketConfig, generatedFiles, typescript } = context;
93
+ const fileName = typescript ? 'gasket.ts' : 'gasket.js';
94
94
  const filePath = path.join(dest, fileName);
95
95
  const plugins = gasketConfig.fields.plugins;
96
96
  const assignments = gasketConfig.fields.injectionAssignments || null;
@@ -99,6 +99,7 @@ async function writeGasketConfig({ context }) {
99
99
  gasketConfig.fields.filename = 'FILENAME_REPLACE';
100
100
 
101
101
  let contents = '';
102
+ if (typescript) contents += `import type { GasketConfigDefinition } from '@gasket/core';\n`;
102
103
  contents += `import { makeGasket } from '@gasket/core';\n`;
103
104
  contents += writeImports(gasketConfig.fields.pluginImports);
104
105
  contents += writeImports(gasketConfig.fields.imports);
@@ -106,8 +107,9 @@ async function writeGasketConfig({ context }) {
106
107
  createInjectionAssignments(gasketConfig.fields, assignments);
107
108
  cleanupFields(gasketConfig);
108
109
 
109
- const pluginImports = `[\n${writePluginImports(plugins)}\n\xa0\xa0]`;
110
- contents += `\nexport default makeGasket(${JSON5.stringify(gasketConfig.fields, null, 2)});\n`;
110
+ const pluginImports = `[\n${writePluginImports(plugins)}\n ]`;
111
+ const typeCoercion = typescript ? ' as GasketConfigDefinition' : '';
112
+ contents += `\nexport default makeGasket(${JSON5.stringify(gasketConfig.fields, null, 2)}${typeCoercion});\n`;
111
113
  contents = contents.replace('\'FILENAME_REPLACE\'', 'import.meta.filename');
112
114
  contents = contents.replace('\'PLUGIN_REPLACE\'', pluginImports);
113
115
  contents = replaceInjectionAssignments(contents, assignments);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-gasket-app",
3
- "version": "7.0.0-next.51",
3
+ "version": "7.0.0-next.53",
4
4
  "description": "starter pack for creating a gasket app",
5
5
  "type": "module",
6
6
  "bin": {
@@ -33,14 +33,14 @@
33
33
  },
34
34
  "homepage": "https://github.com/godaddy/gasket/tree/main/packages/create-gasket-app",
35
35
  "dependencies": {
36
- "@gasket/core": "7.0.0-next.51",
37
- "@gasket/plugin-command": "7.0.0-next.51",
38
- "@gasket/plugin-docs": "7.0.0-next.51",
39
- "@gasket/plugin-docusaurus": "7.0.0-next.51",
40
- "@gasket/plugin-git": "7.0.0-next.51",
41
- "@gasket/plugin-logger": "7.0.0-next.51",
42
- "@gasket/plugin-metadata": "7.0.0-next.51",
43
- "@gasket/utils": "7.0.0-next.51",
36
+ "@gasket/core": "7.0.0-next.53",
37
+ "@gasket/plugin-command": "7.0.0-next.53",
38
+ "@gasket/plugin-docs": "7.0.0-next.53",
39
+ "@gasket/plugin-docusaurus": "7.0.0-next.53",
40
+ "@gasket/plugin-git": "7.0.0-next.53",
41
+ "@gasket/plugin-logger": "7.0.0-next.53",
42
+ "@gasket/plugin-metadata": "7.0.0-next.53",
43
+ "@gasket/utils": "7.0.0-next.53",
44
44
  "commander": "^12.0.0",
45
45
  "deepmerge": "^4.3.1",
46
46
  "glob": "^8.1.0",
@@ -83,5 +83,5 @@
83
83
  "jest": {
84
84
  "transform": {}
85
85
  },
86
- "gitHead": "bc43507fca778b76e3e2093d683615464488d77b"
86
+ "gitHead": "243aa1f948f88a5066d687a02631a388eed97abb"
87
87
  }