silgi 0.0.7 → 0.0.9
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/dist/chunks/generate.mjs +21 -22
- package/dist/cli/index.mjs +1 -1
- package/package.json +2 -2
package/dist/chunks/generate.mjs
CHANGED
|
@@ -842,11 +842,10 @@ class SchemaManager {
|
|
|
842
842
|
if (!this.storage || !this.storage.schemaObjects) {
|
|
843
843
|
return;
|
|
844
844
|
}
|
|
845
|
-
if (
|
|
846
|
-
|
|
845
|
+
if (this.config.output.server) {
|
|
846
|
+
const resolvedPath = resolve(this.config.rootDir, this.config.output.server, "silgi.generated.ts");
|
|
847
|
+
await generateSilgiInterface(this.storage, resolvedPath);
|
|
847
848
|
}
|
|
848
|
-
const resolvedPath = resolve(this.config.rootDir, this.config.output.server, "silgi.generated.ts");
|
|
849
|
-
await generateSilgiInterface(this.storage, resolvedPath);
|
|
850
849
|
if (this.storage?.schemaObjects && this.storage.files) {
|
|
851
850
|
const schemaCount = Object.keys(this.storage.schemaObjects).length;
|
|
852
851
|
consola.log(`Found ${schemaCount} schema objects in ${this.storage.files.length} files`);
|
|
@@ -856,12 +855,9 @@ class SchemaManager {
|
|
|
856
855
|
if (!this.clientSchemas) {
|
|
857
856
|
return;
|
|
858
857
|
}
|
|
859
|
-
if (
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
const resolvedPath = resolve(this.config.rootDir, this.config.output.client, "silgi.generated.ts");
|
|
863
|
-
await generateClientGenTS(this.clientSchemas, resolvedPath);
|
|
864
|
-
if (this.storage?.schemaObjects && this.storage.files) {
|
|
858
|
+
if (this.config.output.client && this.storage.schemaObjects && this.storage.files) {
|
|
859
|
+
const resolvedPath = resolve(this.config.rootDir, this.config.output.client, "silgi.generated.ts");
|
|
860
|
+
await generateClientGenTS(this.clientSchemas, resolvedPath);
|
|
865
861
|
const schemaCount = Object.keys(this.storage.schemaObjects).length;
|
|
866
862
|
consola.log(`Found ${schemaCount} schema objects in ${this.storage.files.length} files`);
|
|
867
863
|
consola.success(`Generated client schema files in ${resolvedPath}`);
|
|
@@ -889,18 +885,21 @@ async function generate$1(config) {
|
|
|
889
885
|
await schemaManager.generateOutput();
|
|
890
886
|
await schemaManager.generateClientOutput();
|
|
891
887
|
consola.success("Schema generation completed successfully");
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
888
|
+
try {
|
|
889
|
+
const eslint = new ESLint({
|
|
890
|
+
fix: true,
|
|
891
|
+
cwd: mergeConfig.rootDir,
|
|
892
|
+
baseConfig: await antfu({ typescript: true })
|
|
893
|
+
});
|
|
894
|
+
const results = await eslint.lintFiles([
|
|
895
|
+
mergeConfig._silgi.outputDirTS,
|
|
896
|
+
mergeConfig._silgi.outputDirClientTS
|
|
897
|
+
]);
|
|
898
|
+
await ESLint.outputFixes(results);
|
|
899
|
+
const formatter = await eslint.loadFormatter("stylish");
|
|
900
|
+
formatter.format(results);
|
|
901
|
+
} catch {
|
|
902
|
+
}
|
|
904
903
|
} catch (error) {
|
|
905
904
|
consola.error("Schema generation failed:", error);
|
|
906
905
|
process.exit(1);
|
package/dist/cli/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "silgi",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.9",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
7
|
"import": {
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"unbuild": "^3.0.1",
|
|
69
|
-
"silgi": "0.0.
|
|
69
|
+
"silgi": "0.0.9"
|
|
70
70
|
},
|
|
71
71
|
"resolutions": {
|
|
72
72
|
"silgi": "workspace:*"
|