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.
package/lib/commands/create.js
CHANGED
|
@@ -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 =
|
|
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
|
|
110
|
-
|
|
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.
|
|
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.
|
|
37
|
-
"@gasket/plugin-command": "7.0.0-next.
|
|
38
|
-
"@gasket/plugin-docs": "7.0.0-next.
|
|
39
|
-
"@gasket/plugin-docusaurus": "7.0.0-next.
|
|
40
|
-
"@gasket/plugin-git": "7.0.0-next.
|
|
41
|
-
"@gasket/plugin-logger": "7.0.0-next.
|
|
42
|
-
"@gasket/plugin-metadata": "7.0.0-next.
|
|
43
|
-
"@gasket/utils": "7.0.0-next.
|
|
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": "
|
|
86
|
+
"gitHead": "243aa1f948f88a5066d687a02631a388eed97abb"
|
|
87
87
|
}
|