silgi 0.27.13 → 0.28.1
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/build.mjs +1 -0
- package/dist/cli/dev.mjs +1 -0
- package/dist/cli/index.mjs +1 -1
- package/dist/cli/init.mjs +1 -0
- package/dist/cli/install.mjs +1 -0
- package/dist/cli/silgi.mjs +11 -1
- package/dist/types/index.d.mts +6 -0
- package/package.json +9 -8
package/dist/build.mjs
CHANGED
package/dist/cli/dev.mjs
CHANGED
package/dist/cli/index.mjs
CHANGED
package/dist/cli/init.mjs
CHANGED
package/dist/cli/install.mjs
CHANGED
package/dist/cli/silgi.mjs
CHANGED
|
@@ -13,6 +13,7 @@ import { generateTypes, resolveSchema } from 'untyped';
|
|
|
13
13
|
import { s as silgiGenerateType, l as loadOptions } from './types.mjs';
|
|
14
14
|
import { createHooks, createDebugger } from 'hookable';
|
|
15
15
|
import { useSilgiCLI, replaceRuntimeValues, silgiCLICtx, autoImportTypes } from 'silgi';
|
|
16
|
+
import { createAdapter } from 'unadapter';
|
|
16
17
|
import { c as createRouteRules } from '../_chunks/routeRules.mjs';
|
|
17
18
|
import * as p from '@clack/prompts';
|
|
18
19
|
import * as dotenv from 'dotenv';
|
|
@@ -2346,8 +2347,17 @@ async function createSilgiCLI(config = {}, opts = {}) {
|
|
|
2346
2347
|
hook: hooks.hook,
|
|
2347
2348
|
async updateConfig(_config) {
|
|
2348
2349
|
},
|
|
2349
|
-
routeRules: void 0
|
|
2350
|
+
routeRules: void 0,
|
|
2351
|
+
adapter: void 0
|
|
2350
2352
|
};
|
|
2353
|
+
if (silgi.options.database && Object.keys(silgi.options.database)?.length > 0) {
|
|
2354
|
+
for (const [key, value] of Object.entries(silgi.options.database)) {
|
|
2355
|
+
silgi.adapter[key] = createAdapter(
|
|
2356
|
+
value.tables,
|
|
2357
|
+
value.adapter
|
|
2358
|
+
);
|
|
2359
|
+
}
|
|
2360
|
+
}
|
|
2351
2361
|
await prepareEnv(options);
|
|
2352
2362
|
const routeRules = createRouteRules();
|
|
2353
2363
|
routeRules.importRules(options.routeRules ?? {});
|
package/dist/types/index.d.mts
CHANGED
|
@@ -8,6 +8,7 @@ import { Ignore, Options } from 'ignore';
|
|
|
8
8
|
import { TSConfig } from 'pkg-types';
|
|
9
9
|
import { PresetName, PresetOptions, PresetNameInput } from 'silgi/presets';
|
|
10
10
|
import { ResolvedServiceType as ResolvedServiceType$1, SilgiRuntimeShareds as SilgiRuntimeShareds$1, SilgiRuntimeOptions as SilgiRuntimeOptions$1, RouteRules as RouteRules$1, ModuleMeta as ModuleMeta$1, SilgiModule as SilgiModule$1, SilgiRouteRules as SilgiRouteRules$1, DotenvOptions as DotenvOptions$1, EnvOptions as EnvOptions$1, SilgiRuntimeConfig as SilgiRuntimeConfig$1, ServiceParseModule as ServiceParseModule$1, SilgiCLIHooks as SilgiCLIHooks$1, StorageMounts as StorageMounts$1, SilgiTemplate as SilgiTemplate$1, SilgiFrameworkInfo as SilgiFrameworkInfo$1 } from 'silgi/types';
|
|
11
|
+
import { Adapter, TablesSchema, InferModelTypes, AdapterOptions } from 'unadapter/types';
|
|
11
12
|
import { UnimportPluginOptions } from 'unimport/unplugin';
|
|
12
13
|
import { H3Event } from 'h3';
|
|
13
14
|
import { NitroRuntimeConfig } from 'nitropack/types';
|
|
@@ -88,6 +89,7 @@ interface SilgiCLI {
|
|
|
88
89
|
tags?: (keyof SilgiCommands)[];
|
|
89
90
|
enabled?: boolean;
|
|
90
91
|
}>>;
|
|
92
|
+
adapter: Record<string, Adapter<Record<string, any>, TablesSchema, InferModelTypes<TablesSchema>>>;
|
|
91
93
|
}
|
|
92
94
|
type SilgiCLIDynamicConfig = Pick<SilgiCLIConfig, 'routeRules'>;
|
|
93
95
|
interface SilgiFrameworkInfo {
|
|
@@ -811,6 +813,10 @@ interface SilgiCLIOptions extends PresetOptions {
|
|
|
811
813
|
}>>;
|
|
812
814
|
installPackages: Record<'dependencies' | 'devDependencies', Record<string, string>>;
|
|
813
815
|
apiFul: ApifulConfig;
|
|
816
|
+
database: Record<string, {
|
|
817
|
+
adapter: Adapter<any, TablesSchema, any>;
|
|
818
|
+
tables: (options: AdapterOptions) => TablesSchema;
|
|
819
|
+
} & AdapterOptions>;
|
|
814
820
|
}
|
|
815
821
|
/**
|
|
816
822
|
* Silgi input config (silgi.config)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "silgi",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.28.1",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"exports": {
|
|
@@ -81,9 +81,9 @@
|
|
|
81
81
|
"destr": "^2.0.5",
|
|
82
82
|
"dev-jiti": "^2.4.2",
|
|
83
83
|
"dot-prop": "^9.0.0",
|
|
84
|
-
"dotenv": "^16.
|
|
84
|
+
"dotenv": "^16.5.0",
|
|
85
85
|
"escape-string-regexp": "^5.0.0",
|
|
86
|
-
"exsolve": "^1.0.
|
|
86
|
+
"exsolve": "^1.0.5",
|
|
87
87
|
"globby": "^14.1.0",
|
|
88
88
|
"hookable": "^5.5.3",
|
|
89
89
|
"ignore": "^7.0.3",
|
|
@@ -99,6 +99,7 @@
|
|
|
99
99
|
"semver": "^7.7.1",
|
|
100
100
|
"std-env": "^3.9.0",
|
|
101
101
|
"ufo": "^1.6.1",
|
|
102
|
+
"unadapter": "^0.1.0",
|
|
102
103
|
"unctx": "^2.4.1",
|
|
103
104
|
"unimport": "^5.0.0",
|
|
104
105
|
"unstorage": "^1.15.0",
|
|
@@ -108,19 +109,19 @@
|
|
|
108
109
|
"@antfu/eslint-config": "^4.12.0",
|
|
109
110
|
"@nuxt/kit": "^3.16.2",
|
|
110
111
|
"@nuxt/schema": "^3.16.2",
|
|
111
|
-
"@silgi/ecosystem": "^0.4.
|
|
112
|
-
"@types/node": "^22.14.
|
|
112
|
+
"@silgi/ecosystem": "^0.4.10",
|
|
113
|
+
"@types/node": "^22.14.1",
|
|
113
114
|
"@types/semver": "^7.7.0",
|
|
114
115
|
"@vitest/coverage-v8": "3.0.5",
|
|
115
|
-
"eslint": "^9.
|
|
116
|
+
"eslint": "^9.25.0",
|
|
116
117
|
"h3": "^1.15.1",
|
|
117
|
-
"nitropack": "^2.11.
|
|
118
|
+
"nitropack": "^2.11.9",
|
|
118
119
|
"nuxt": "^3.16.2",
|
|
119
120
|
"typescript": "^5.8.3",
|
|
120
121
|
"unbuild": "^3.5.0",
|
|
121
122
|
"vitest": "^3.1.1",
|
|
122
123
|
"vue": "^3.5.13",
|
|
123
|
-
"zod": "^3.24.
|
|
124
|
+
"zod": "^3.24.3"
|
|
124
125
|
},
|
|
125
126
|
"resolutions": {
|
|
126
127
|
"silgi": "link:."
|