@comet/admin-generator 8.11.0-canary-20251223115946 → 8.11.0-canary-20251223132411
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.
|
@@ -16,15 +16,18 @@ exports.injectFormVariables = injectFormVariables;
|
|
|
16
16
|
exports.defineConfig = defineConfig;
|
|
17
17
|
const graphql_file_loader_1 = require("@graphql-tools/graphql-file-loader");
|
|
18
18
|
const load_1 = require("@graphql-tools/load");
|
|
19
|
+
const child_process_1 = require("child_process");
|
|
19
20
|
const commander_1 = require("commander");
|
|
20
21
|
const fs_1 = require("fs");
|
|
21
22
|
const glob_1 = require("glob");
|
|
22
23
|
const graphql_1 = require("graphql");
|
|
23
24
|
const path_1 = require("path");
|
|
25
|
+
const util_1 = require("util");
|
|
24
26
|
const parseConfig_1 = require("./config/parseConfig");
|
|
25
27
|
const generateForm_1 = require("./generateForm/generateForm");
|
|
26
28
|
const generateGrid_1 = require("./generateGrid/generateGrid");
|
|
27
29
|
const writeGenerated_1 = require("./utils/writeGenerated");
|
|
30
|
+
const exec = (0, util_1.promisify)(child_process_1.exec);
|
|
28
31
|
function isComponentFormFieldConfig(arg) {
|
|
29
32
|
return arg && arg.type === "component";
|
|
30
33
|
}
|
|
@@ -51,6 +54,7 @@ function runGenerate() {
|
|
|
51
54
|
loaders: [new graphql_file_loader_1.GraphQLFileLoader()],
|
|
52
55
|
});
|
|
53
56
|
const gqlIntrospection = (0, graphql_1.introspectionFromSchema)(schema);
|
|
57
|
+
const writtenFiles = [];
|
|
54
58
|
const files = yield (0, glob_1.glob)(filePattern);
|
|
55
59
|
for (const file of files) {
|
|
56
60
|
let outputCode = "";
|
|
@@ -80,6 +84,7 @@ function runGenerate() {
|
|
|
80
84
|
gqlDocumentsOutputCode += `${exportStatement} const ${queryName} = gql\`${generated.gqlDocuments[queryName].document}\`\n`;
|
|
81
85
|
}
|
|
82
86
|
yield (0, writeGenerated_1.writeGenerated)(codeOuputFilename, outputCode);
|
|
87
|
+
writtenFiles.push(codeOuputFilename);
|
|
83
88
|
if (gqlDocumentsOutputCode != "") {
|
|
84
89
|
const gqlDocumentsOuputFilename = `${targetDirectory}/${(0, path_1.basename)(file.replace(/\.cometGen\.tsx?$/, ""))}.gql.tsx`;
|
|
85
90
|
yield fs_1.promises.rm(gqlDocumentsOuputFilename, { force: true });
|
|
@@ -89,9 +94,12 @@ function runGenerate() {
|
|
|
89
94
|
${gqlDocumentsOutputCode}
|
|
90
95
|
`;
|
|
91
96
|
yield (0, writeGenerated_1.writeGenerated)(gqlDocumentsOuputFilename, gqlDocumentsOutputCode);
|
|
97
|
+
writtenFiles.push(gqlDocumentsOuputFilename);
|
|
92
98
|
}
|
|
93
99
|
console.log("");
|
|
94
100
|
}
|
|
101
|
+
console.log("Formatting generated files...");
|
|
102
|
+
yield exec(`./node_modules/.bin/prettier --write ${writtenFiles.join(" ")}`);
|
|
95
103
|
});
|
|
96
104
|
}
|
|
97
105
|
exports.generateCommand = new commander_1.Command("generate")
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@comet/admin-generator",
|
|
3
|
-
"version": "8.11.0-canary-
|
|
3
|
+
"version": "8.11.0-canary-20251223132411",
|
|
4
4
|
"description": "Comet Admin Generator CLI tool",
|
|
5
5
|
"repository": {
|
|
6
6
|
"directory": "packages/admin/admin-generator",
|
|
@@ -48,10 +48,10 @@
|
|
|
48
48
|
"rimraf": "^6.1.2",
|
|
49
49
|
"ts-jest": "^29.4.0",
|
|
50
50
|
"typescript": "5.9.3",
|
|
51
|
-
"@comet/admin": "8.11.0-canary-
|
|
52
|
-
"@comet/admin-icons": "8.11.0-canary-
|
|
53
|
-
"@comet/cms-admin": "8.11.0-canary-
|
|
54
|
-
"@comet/eslint-config": "8.11.0-canary-
|
|
51
|
+
"@comet/admin": "8.11.0-canary-20251223132411",
|
|
52
|
+
"@comet/admin-icons": "8.11.0-canary-20251223132411",
|
|
53
|
+
"@comet/cms-admin": "8.11.0-canary-20251223132411",
|
|
54
|
+
"@comet/eslint-config": "8.11.0-canary-20251223132411"
|
|
55
55
|
},
|
|
56
56
|
"engines": {
|
|
57
57
|
"node": ">=22.0.0"
|