silgi 0.0.5 → 0.0.6
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 +15 -0
- package/dist/cli/config.d.mts +4 -4
- package/dist/cli/config.d.ts +4 -4
- package/dist/cli/index.mjs +15 -1
- package/package.json +2 -2
package/dist/chunks/generate.mjs
CHANGED
|
@@ -828,12 +828,21 @@ class SchemaManager {
|
|
|
828
828
|
}
|
|
829
829
|
}
|
|
830
830
|
async initialize() {
|
|
831
|
+
if (!this.config.output.server) {
|
|
832
|
+
throw new Error("No output directory specified");
|
|
833
|
+
}
|
|
831
834
|
const outputFileTS = resolve(this.config.rootDir, this.config.output.server, "silgi.generated.ts");
|
|
832
835
|
this.config._silgi.outputDirTS = outputFileTS;
|
|
833
836
|
this.config._silgi.outputDirClientTS = resolve(this.config.rootDir, this.config.output.server, "silgi.generated.ts");
|
|
834
837
|
await promises.mkdir(this.config.output.server, { recursive: true });
|
|
835
838
|
}
|
|
836
839
|
async generateOutput() {
|
|
840
|
+
if (!this.storage || !this.storage.schemaObjects) {
|
|
841
|
+
return;
|
|
842
|
+
}
|
|
843
|
+
if (!this.config.output.server) {
|
|
844
|
+
throw new Error("No output directory specified");
|
|
845
|
+
}
|
|
837
846
|
const resolvedPath = resolve(this.config.rootDir, this.config.output.server, "silgi.generated.ts");
|
|
838
847
|
await generateSilgiInterface(this.storage, resolvedPath);
|
|
839
848
|
if (this.storage?.schemaObjects && this.storage.files) {
|
|
@@ -842,6 +851,12 @@ class SchemaManager {
|
|
|
842
851
|
}
|
|
843
852
|
}
|
|
844
853
|
async generateClientOutput() {
|
|
854
|
+
if (!this.clientSchemas) {
|
|
855
|
+
return;
|
|
856
|
+
}
|
|
857
|
+
if (!this.config.output.client) {
|
|
858
|
+
throw new Error("No output directory specified");
|
|
859
|
+
}
|
|
845
860
|
const resolvedPath = resolve(this.config.rootDir, this.config.output.client, "silgi.generated.ts");
|
|
846
861
|
await generateClientGenTS(this.clientSchemas, resolvedPath);
|
|
847
862
|
if (this.storage?.schemaObjects && this.storage.files) {
|
package/dist/cli/config.d.mts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
interface SilgiConfig {
|
|
2
2
|
scopes: ScopeConfig[];
|
|
3
|
-
removeExtensions
|
|
3
|
+
removeExtensions?: boolean;
|
|
4
4
|
output: {
|
|
5
|
-
server
|
|
6
|
-
client
|
|
5
|
+
server?: string;
|
|
6
|
+
client?: string;
|
|
7
7
|
};
|
|
8
8
|
modules?: string[];
|
|
9
|
-
moduleDir
|
|
9
|
+
moduleDir?: string[];
|
|
10
10
|
}
|
|
11
11
|
interface ScopeConfig {
|
|
12
12
|
name: string;
|
package/dist/cli/config.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
interface SilgiConfig {
|
|
2
2
|
scopes: ScopeConfig[];
|
|
3
|
-
removeExtensions
|
|
3
|
+
removeExtensions?: boolean;
|
|
4
4
|
output: {
|
|
5
|
-
server
|
|
6
|
-
client
|
|
5
|
+
server?: string;
|
|
6
|
+
client?: string;
|
|
7
7
|
};
|
|
8
8
|
modules?: string[];
|
|
9
|
-
moduleDir
|
|
9
|
+
moduleDir?: string[];
|
|
10
10
|
}
|
|
11
11
|
interface ScopeConfig {
|
|
12
12
|
name: string;
|
package/dist/cli/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import consola from 'consola';
|
|
|
3
3
|
|
|
4
4
|
const name = "silgi";
|
|
5
5
|
const type = "module";
|
|
6
|
-
const version = "0.0.
|
|
6
|
+
const version = "0.0.6";
|
|
7
7
|
const exports = {
|
|
8
8
|
".": {
|
|
9
9
|
"import": {
|
|
@@ -25,6 +25,19 @@ const exports = {
|
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
27
|
const types = "./dist/index.d.ts";
|
|
28
|
+
const typesVersions = {
|
|
29
|
+
"*": {
|
|
30
|
+
"*": [
|
|
31
|
+
"./dist/*"
|
|
32
|
+
],
|
|
33
|
+
"plugins/*": [
|
|
34
|
+
"./dist/plugins/*"
|
|
35
|
+
],
|
|
36
|
+
config: [
|
|
37
|
+
"./dist/cli/config"
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
};
|
|
28
41
|
const bin = {
|
|
29
42
|
silgi: "bin/silgi.mjs"
|
|
30
43
|
};
|
|
@@ -72,6 +85,7 @@ const packageJson = {
|
|
|
72
85
|
version: version,
|
|
73
86
|
exports: exports,
|
|
74
87
|
types: types,
|
|
88
|
+
typesVersions: typesVersions,
|
|
75
89
|
bin: bin,
|
|
76
90
|
files: files,
|
|
77
91
|
scripts: scripts,
|
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.6",
|
|
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.6"
|
|
70
70
|
},
|
|
71
71
|
"resolutions": {
|
|
72
72
|
"silgi": "workspace:*"
|