silgi 0.5.0 → 0.7.0
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/index.mjs +2 -230
- package/dist/cli/compatibility.mjs +2 -14
- package/dist/cli/prepare.mjs +406 -315
- package/dist/core/index.d.mts +36 -5
- package/dist/core/index.d.ts +36 -5
- package/dist/core/index.mjs +151 -135
- package/dist/ecosystem/nitro/index.mjs +5 -2
- package/dist/kit/index.d.mts +27 -25
- package/dist/kit/index.d.ts +27 -25
- package/dist/kit/index.mjs +63 -103
- package/dist/meta/index.d.mts +1 -1
- package/dist/meta/index.d.ts +1 -1
- package/dist/runtime/internal/nitro.mjs +1 -2
- package/dist/shared/{silgi.DGmIWx95.d.mts → silgi.BFbL2aof.d.mts} +2 -2
- package/dist/shared/{silgi.DGmIWx95.d.ts → silgi.BFbL2aof.d.ts} +2 -2
- package/dist/types/index.d.mts +736 -26
- package/dist/types/index.d.ts +736 -26
- package/package.json +33 -36
- package/dist/shared/silgi.CN_giHTc.d.mts +0 -634
- package/dist/shared/silgi.CN_giHTc.d.ts +0 -634
|
@@ -1,634 +0,0 @@
|
|
|
1
|
-
import { Defu } from 'defu';
|
|
2
|
-
import { TypeSource, IResolvers } from '@graphql-tools/utils';
|
|
3
|
-
import { TSConfig } from 'pkg-types';
|
|
4
|
-
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
5
|
-
import { LogLevel, ConsolaInstance } from 'consola';
|
|
6
|
-
import { Hookable } from 'hookable';
|
|
7
|
-
import { Options, Ignore } from 'ignore';
|
|
8
|
-
import { PresetOptions, PresetName, PresetNameInput } from 'silgi/presets';
|
|
9
|
-
import { StorageMounts, SilgiFrameworkInfo as SilgiFrameworkInfo$1, ResolvedServiceType, SilgiDefaultShared, SilgiModules as SilgiModules$1, ModuleMeta as ModuleMeta$1 } from 'silgi/types';
|
|
10
|
-
import { Unimport } from 'unimport';
|
|
11
|
-
import { Storage } from 'unstorage';
|
|
12
|
-
import { ResolvedConfig, ConfigWatcher, C12InputConfig, WatchConfigOptions } from 'c12';
|
|
13
|
-
import { ChokidarOptions } from 'chokidar';
|
|
14
|
-
import { DateString, CompatibilityDates, CompatibilityDateSpec } from 'compatx';
|
|
15
|
-
import { UnimportPluginOptions } from 'unimport/unplugin';
|
|
16
|
-
import { ProviderName } from 'std-env';
|
|
17
|
-
|
|
18
|
-
type HookResult = Promise<void> | void;
|
|
19
|
-
|
|
20
|
-
interface SilgiCompatibilityIssue {
|
|
21
|
-
name: string;
|
|
22
|
-
message: string;
|
|
23
|
-
}
|
|
24
|
-
interface SilgiCompatibilityIssues extends Array<SilgiCompatibilityIssue> {
|
|
25
|
-
/**
|
|
26
|
-
* Return formatted error message.
|
|
27
|
-
*/
|
|
28
|
-
toString: () => string;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
interface SilgiSchema {
|
|
32
|
-
}
|
|
33
|
-
interface MergedSilgiSchema {
|
|
34
|
-
}
|
|
35
|
-
type BaseSchemaType<T extends StandardSchemaV1> = {
|
|
36
|
-
[Action in BaseSilgiMethodType]?: Record<string, {
|
|
37
|
-
input?: T;
|
|
38
|
-
output?: T;
|
|
39
|
-
router?: T;
|
|
40
|
-
}>;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
interface SilgiURIs {
|
|
44
|
-
}
|
|
45
|
-
type URIsTypes<T extends Record<string, string>> = {
|
|
46
|
-
[K in keyof T]: string;
|
|
47
|
-
};
|
|
48
|
-
type ExtractPath<T extends string> = T extends `${infer Path}` ? Path extends `${infer Service}/${infer Entity}/${infer Method}/${infer Action}` ? {
|
|
49
|
-
service: Service;
|
|
50
|
-
entity: Entity;
|
|
51
|
-
method: Method;
|
|
52
|
-
action: Action;
|
|
53
|
-
} : never : never;
|
|
54
|
-
type GetInput<T extends {
|
|
55
|
-
service: string;
|
|
56
|
-
entity: string;
|
|
57
|
-
method: string;
|
|
58
|
-
action: string;
|
|
59
|
-
}> = T['service'] extends keyof SilgiSchema ? T['entity'] extends keyof SilgiSchema[T['service']] ? T['method'] extends keyof SilgiSchema[T['service']][T['entity']] ? T['action'] extends keyof SilgiSchema[T['service']][T['entity']][T['method']] ? SilgiSchema[T['service']][T['entity']][T['method']][T['action']] extends {
|
|
60
|
-
input: infer I;
|
|
61
|
-
} ? I extends StandardSchemaV1 ? StandardSchemaV1.InferInput<I> : never : never : never : never : never : never;
|
|
62
|
-
type GetOutput<T extends {
|
|
63
|
-
service: string;
|
|
64
|
-
entity: string;
|
|
65
|
-
method: string;
|
|
66
|
-
action: string;
|
|
67
|
-
}> = T['service'] extends keyof SilgiSchema ? T['entity'] extends keyof SilgiSchema[T['service']] ? T['method'] extends keyof SilgiSchema[T['service']][T['entity']] ? T['action'] extends keyof SilgiSchema[T['service']][T['entity']][T['method']] ? SilgiSchema[T['service']][T['entity']][T['method']][T['action']] extends {
|
|
68
|
-
output: infer O;
|
|
69
|
-
} ? O extends StandardSchemaV1 ? StandardSchemaV1.InferOutput<O> : never : never : never : never : never : never;
|
|
70
|
-
type GetRouterParams<T extends {
|
|
71
|
-
service: string;
|
|
72
|
-
entity: string;
|
|
73
|
-
method: string;
|
|
74
|
-
action: string;
|
|
75
|
-
}> = T['service'] extends keyof SilgiSchema ? T['entity'] extends keyof SilgiSchema[T['service']] ? T['method'] extends keyof SilgiSchema[T['service']][T['entity']] ? T['action'] extends keyof SilgiSchema[T['service']][T['entity']][T['method']] ? SilgiSchema[T['service']][T['entity']][T['method']][T['action']] extends {
|
|
76
|
-
router: infer I;
|
|
77
|
-
} ? I extends StandardSchemaV1 ? StandardSchemaV1.InferInput<I> : never : never : never : never : never : never;
|
|
78
|
-
type ExtractInputFromURI<TURI extends keyof SilgiURIs> = GetInput<ExtractPath<TURI>>;
|
|
79
|
-
type ExtractOutputFromURI<TURI extends keyof SilgiURIs> = GetOutput<ExtractPath<TURI>>;
|
|
80
|
-
type ExtractRouterParamsFromURI<TURI extends keyof SilgiURIs> = GetRouterParams<ExtractPath<TURI>>;
|
|
81
|
-
|
|
82
|
-
interface SilgiMethods {
|
|
83
|
-
}
|
|
84
|
-
interface SilgiNamespaces {
|
|
85
|
-
}
|
|
86
|
-
interface DefaultNamespaces extends SilgiNamespaces {
|
|
87
|
-
}
|
|
88
|
-
interface SilgiRouterTypes {
|
|
89
|
-
}
|
|
90
|
-
interface SilgiHook {
|
|
91
|
-
}
|
|
92
|
-
type BaseSilgiMethodType = 'post' | 'delete' | 'put' | 'get' | keyof SilgiMethods;
|
|
93
|
-
interface DefaultHooks {
|
|
94
|
-
}
|
|
95
|
-
type DeepPartial<T> = T extends void ? T : T extends Record<string, any> ? {
|
|
96
|
-
[P in keyof T]?: DeepPartial<T[P]>;
|
|
97
|
-
} : T;
|
|
98
|
-
type Awaitable<T> = T | Promise<T>;
|
|
99
|
-
interface CreateScope {
|
|
100
|
-
execute: <TURI extends keyof SilgiURIs>(uriString: TURI, input: ExtractInputFromURI<TURI>) => Promise<ExtractOutputFromURI<TURI>>;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
type SilgiPreset = SilgiCLIConfig | (() => SilgiCLIConfig);
|
|
104
|
-
interface SilgiPresetMeta {
|
|
105
|
-
url: string;
|
|
106
|
-
name: string;
|
|
107
|
-
stdName?: ProviderName;
|
|
108
|
-
aliases?: string[];
|
|
109
|
-
static?: boolean;
|
|
110
|
-
compatibilityDate?: DateString;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* SilgiCLI normalized options (silgi.options)
|
|
115
|
-
*/
|
|
116
|
-
interface SilgiCLIOptions extends PresetOptions {
|
|
117
|
-
_config: SilgiCLIConfig;
|
|
118
|
-
_c12: ResolvedConfig<SilgiCLIConfig> | ConfigWatcher<SilgiCLIConfig>;
|
|
119
|
-
_cli?: {
|
|
120
|
-
command?: string;
|
|
121
|
-
};
|
|
122
|
-
namespaces: string[];
|
|
123
|
-
plugins: {
|
|
124
|
-
path: string;
|
|
125
|
-
packageImport: string;
|
|
126
|
-
}[];
|
|
127
|
-
routeRules: Record<string, string>;
|
|
128
|
-
compatibilityDate: CompatibilityDates;
|
|
129
|
-
modules: (SilgiModule<any> | string | [SilgiModule | string, Record<string, any>] | undefined | null | false)[];
|
|
130
|
-
_modules: (SilgiModule<any> | string | [SilgiModule | string, Record<string, any>] | undefined | null | false)[];
|
|
131
|
-
debug: boolean;
|
|
132
|
-
preset: PresetName;
|
|
133
|
-
static: boolean;
|
|
134
|
-
logLevel: LogLevel;
|
|
135
|
-
appConfig: AppConfig;
|
|
136
|
-
appConfigFiles: string[];
|
|
137
|
-
storage: StorageMounts;
|
|
138
|
-
devStorage: StorageMounts;
|
|
139
|
-
workspaceDir: string;
|
|
140
|
-
rootDir: string;
|
|
141
|
-
srcDir: string;
|
|
142
|
-
scanDirs: string[];
|
|
143
|
-
apiDir: string;
|
|
144
|
-
routesDir: string;
|
|
145
|
-
build: {
|
|
146
|
-
dir: string;
|
|
147
|
-
typesDir: string;
|
|
148
|
-
};
|
|
149
|
-
modulesDir: string[];
|
|
150
|
-
output: {
|
|
151
|
-
dir: string;
|
|
152
|
-
serverDir: string;
|
|
153
|
-
publicDir: string;
|
|
154
|
-
};
|
|
155
|
-
serverDir: string;
|
|
156
|
-
clientDir: string;
|
|
157
|
-
silgi: {
|
|
158
|
-
serverDir: string;
|
|
159
|
-
clientDir: string;
|
|
160
|
-
publicDir: string;
|
|
161
|
-
utilsDir: string;
|
|
162
|
-
composablesDir: string;
|
|
163
|
-
typesDir: string;
|
|
164
|
-
servicesDir: string;
|
|
165
|
-
};
|
|
166
|
-
imports: UnimportPluginOptions | false;
|
|
167
|
-
watchOptions: ChokidarOptions;
|
|
168
|
-
nodeModulesDirs: string[];
|
|
169
|
-
commands: {
|
|
170
|
-
preview: string;
|
|
171
|
-
deploy: string;
|
|
172
|
-
};
|
|
173
|
-
framework: SilgiFrameworkInfo$1;
|
|
174
|
-
/**
|
|
175
|
-
* More customizable than `ignorePrefix`: all files matching glob patterns specified inside the `ignore` array will be ignored in building.
|
|
176
|
-
*
|
|
177
|
-
* @default ["**\/*.stories.{js,cts,mts,ts,jsx,tsx}","**\/*.{spec,test}.{js,cts,mts,ts,jsx,tsx}","**\/*.d.{cts,mts,ts}","**\/.{pnpm-store,vercel,netlify,output,git,cache,data}",".nuxt/analyze",".nuxt","**\/-*.*"]
|
|
178
|
-
*/
|
|
179
|
-
ignore: Array<string>;
|
|
180
|
-
/**
|
|
181
|
-
* Whether Nuxt is running in development mode.
|
|
182
|
-
*
|
|
183
|
-
* Normally, you should not need to set this.
|
|
184
|
-
*
|
|
185
|
-
* @default false
|
|
186
|
-
*/
|
|
187
|
-
dev: boolean;
|
|
188
|
-
/**
|
|
189
|
-
* Whether your app is being unit tested.
|
|
190
|
-
*
|
|
191
|
-
* @default false
|
|
192
|
-
*/
|
|
193
|
-
test: boolean;
|
|
194
|
-
extensions: string[];
|
|
195
|
-
future: {
|
|
196
|
-
/**
|
|
197
|
-
* This enables 'Bundler' module resolution mode for TypeScript, which is the recommended setting for frameworks like Nuxt and Vite.
|
|
198
|
-
*
|
|
199
|
-
* It improves type support when using modern libraries with `exports`.
|
|
200
|
-
* You can set it to false to use the legacy 'Node' mode, which is the default for TypeScript.
|
|
201
|
-
*
|
|
202
|
-
* @default true
|
|
203
|
-
*
|
|
204
|
-
* @see [TypeScript PR implementing `bundler` module resolution](https://github.com/microsoft/TypeScript/pull/51669)
|
|
205
|
-
*/
|
|
206
|
-
typescriptBundlerResolution: boolean;
|
|
207
|
-
};
|
|
208
|
-
typescript: {
|
|
209
|
-
/**
|
|
210
|
-
* TypeScript comes with certain checks to give you more safety and analysis of your program. Once you’ve converted your codebase to TypeScript, you can start enabling these checks for greater safety. [Read More](https://www.typescriptlang.org/docs/handbook/migrating-from-javascript.html#getting-stricter-checks)
|
|
211
|
-
*
|
|
212
|
-
* @default true
|
|
213
|
-
*/
|
|
214
|
-
strict: boolean;
|
|
215
|
-
/**
|
|
216
|
-
* Modules to generate deep aliases for within `compilerOptions.paths`. This does not yet support subpaths. It may be necessary when using Nuxt within a pnpm monorepo with `shamefully-hoist=false`.
|
|
217
|
-
*
|
|
218
|
-
* @default ["nitro/types","nitro/runtime","defu","h3","consola","ofetch","@unhead/vue","@nuxt/devtools","vue","@vue/runtime-core","@vue/compiler-sfc","vue-router","vue-router/auto-routes","unplugin-vue-router/client","@nuxt/schema","nuxt"]
|
|
219
|
-
*/
|
|
220
|
-
hoist: Array<string>;
|
|
221
|
-
/**
|
|
222
|
-
* Include parent workspace in the Nuxt project. Mostly useful for themes and module authors.
|
|
223
|
-
*
|
|
224
|
-
* @default false
|
|
225
|
-
*/
|
|
226
|
-
includeWorkspace: boolean;
|
|
227
|
-
/**
|
|
228
|
-
* Enable build-time type checking.
|
|
229
|
-
*
|
|
230
|
-
* If set to true, this will type check in development. You can restrict this to build-time type checking by setting it to `build`. Requires to install `typescript` and `vue-tsc` as dev dependencies.
|
|
231
|
-
*
|
|
232
|
-
* @default false
|
|
233
|
-
*
|
|
234
|
-
* @see [Nuxt TypeScript docs](https://nuxt.com/docs/guide/concepts/typescript)
|
|
235
|
-
*/
|
|
236
|
-
typeCheck: boolean | 'build';
|
|
237
|
-
/**
|
|
238
|
-
* You can extend generated `.nuxt/tsconfig.json` using this option.
|
|
239
|
-
*
|
|
240
|
-
*/
|
|
241
|
-
tsConfig: TSConfig;
|
|
242
|
-
/**
|
|
243
|
-
* Generate a `*.vue` shim.
|
|
244
|
-
*
|
|
245
|
-
* We recommend instead letting the [official Vue extension](https://marketplace.visualstudio.com/items?itemName=Vue.volar) generate accurate types for your components.
|
|
246
|
-
* Note that you may wish to set this to `true` if you are using other libraries, such as ESLint, that are unable to understand the type of `.vue` files.
|
|
247
|
-
*
|
|
248
|
-
* @default false
|
|
249
|
-
*/
|
|
250
|
-
shim: boolean;
|
|
251
|
-
/**
|
|
252
|
-
* @default "types/silgi.tsconfig.json"
|
|
253
|
-
*/
|
|
254
|
-
tsconfigPath: string;
|
|
255
|
-
/**
|
|
256
|
-
* @default true
|
|
257
|
-
*/
|
|
258
|
-
generateTsConfig: boolean;
|
|
259
|
-
/**
|
|
260
|
-
* @default false
|
|
261
|
-
*/
|
|
262
|
-
internalPaths?: boolean;
|
|
263
|
-
/**
|
|
264
|
-
* @default ['silgiTypes']
|
|
265
|
-
*/
|
|
266
|
-
customConditions: string[];
|
|
267
|
-
};
|
|
268
|
-
alias: Record<string, string>;
|
|
269
|
-
/**
|
|
270
|
-
* @default ['silgi']
|
|
271
|
-
*/
|
|
272
|
-
conditions: string[];
|
|
273
|
-
/**
|
|
274
|
-
* Pass options directly to `node-ignore` (which is used by Nuxt to ignore files).
|
|
275
|
-
*
|
|
276
|
-
*
|
|
277
|
-
* @see [node-ignore](https://github.com/kaelzhang/node-ignore)
|
|
278
|
-
*
|
|
279
|
-
* @example
|
|
280
|
-
* ```js
|
|
281
|
-
* ignoreOptions: {
|
|
282
|
-
* ignorecase: false
|
|
283
|
-
* }
|
|
284
|
-
* ```
|
|
285
|
-
*/
|
|
286
|
-
ignoreOptions: Options;
|
|
287
|
-
}
|
|
288
|
-
/**
|
|
289
|
-
* Silgi input config (silgi.config)
|
|
290
|
-
*/
|
|
291
|
-
interface SilgiCLIConfig extends DeepPartial<Omit<SilgiCLIOptions, 'preset' | 'compatibilityDate'>>, C12InputConfig<SilgiCLIConfig>, DeepPartial<SilgiModuleOptions> {
|
|
292
|
-
preset?: PresetNameInput;
|
|
293
|
-
extends?: string | string[] | SilgiPreset;
|
|
294
|
-
compatibilityDate?: CompatibilityDateSpec;
|
|
295
|
-
}
|
|
296
|
-
interface AppConfig {
|
|
297
|
-
[key: string]: any;
|
|
298
|
-
}
|
|
299
|
-
interface LoadConfigOptions {
|
|
300
|
-
watch?: boolean;
|
|
301
|
-
c12?: WatchConfigOptions;
|
|
302
|
-
compatibilityDate?: CompatibilityDateSpec;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
interface ImportItem {
|
|
306
|
-
importItems: {
|
|
307
|
-
[key: string]: {
|
|
308
|
-
import: {
|
|
309
|
-
type?: boolean;
|
|
310
|
-
name: string;
|
|
311
|
-
}[];
|
|
312
|
-
from: string;
|
|
313
|
-
};
|
|
314
|
-
};
|
|
315
|
-
customImports: string[];
|
|
316
|
-
customContent?: string[];
|
|
317
|
-
}
|
|
318
|
-
interface SilgiCLI {
|
|
319
|
-
_ignore?: Ignore;
|
|
320
|
-
services: ResolvedServiceType;
|
|
321
|
-
shareds: SilgiDefaultShared;
|
|
322
|
-
uris: Record<string, any>;
|
|
323
|
-
schemas: Record<string, any>;
|
|
324
|
-
modulesURIs: Partial<Record<keyof SilgiModules$1, any>>;
|
|
325
|
-
scannedURIs: Map<string, string>;
|
|
326
|
-
hooks: Hookable<SilgiCLIHooks>;
|
|
327
|
-
hook: SilgiCLI['hooks']['hook'];
|
|
328
|
-
callHook: SilgiCLI['hooks']['callHook'];
|
|
329
|
-
addHooks: SilgiCLI['hooks']['addHooks'];
|
|
330
|
-
storage: Storage;
|
|
331
|
-
unimport?: Unimport;
|
|
332
|
-
logger: ConsolaInstance;
|
|
333
|
-
close: () => Promise<void>;
|
|
334
|
-
updateConfig: (config: SilgiCLIDynamicConfig) => void | Promise<void>;
|
|
335
|
-
scanModules: Array<{
|
|
336
|
-
meta: ModuleMeta$1;
|
|
337
|
-
timings?: Record<string, number | undefined>;
|
|
338
|
-
entryPath: string;
|
|
339
|
-
installed?: boolean;
|
|
340
|
-
}>;
|
|
341
|
-
options: SilgiCLIOptions;
|
|
342
|
-
_requiredModules: Record<string, boolean>;
|
|
343
|
-
}
|
|
344
|
-
type SilgiCLIDynamicConfig = Pick<SilgiCLIConfig, 'routeRules'>;
|
|
345
|
-
interface SilgiFrameworkInfo {
|
|
346
|
-
name?: 'silgi' | (string & {});
|
|
347
|
-
version?: string;
|
|
348
|
-
}
|
|
349
|
-
/** Build info written to `.output/silgi.json` or `.silgi/dev/silgi.json` */
|
|
350
|
-
interface NitroBuildInfo {
|
|
351
|
-
date: string;
|
|
352
|
-
preset: PresetName;
|
|
353
|
-
framework: SilgiFrameworkInfo;
|
|
354
|
-
versions: {
|
|
355
|
-
silgi: string;
|
|
356
|
-
[key: string]: string;
|
|
357
|
-
};
|
|
358
|
-
commands?: {
|
|
359
|
-
preview?: string;
|
|
360
|
-
deploy?: string;
|
|
361
|
-
};
|
|
362
|
-
dev?: {
|
|
363
|
-
pid: number;
|
|
364
|
-
workerAddress: {
|
|
365
|
-
host: string;
|
|
366
|
-
port: number;
|
|
367
|
-
socketPath?: string;
|
|
368
|
-
};
|
|
369
|
-
};
|
|
370
|
-
config?: Partial<PresetOptions>;
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
type TSReference = {
|
|
374
|
-
types: string;
|
|
375
|
-
} | {
|
|
376
|
-
path: string;
|
|
377
|
-
};
|
|
378
|
-
interface SilgiCLIHooks {
|
|
379
|
-
/**
|
|
380
|
-
* Called after Silgi initialization, when the Silgi instance is ready to work.
|
|
381
|
-
* @param silgi The configured Silgi object
|
|
382
|
-
* @returns Promise
|
|
383
|
-
*/
|
|
384
|
-
'ready': (silgi: SilgiCLI) => HookResult;
|
|
385
|
-
/**
|
|
386
|
-
* Called when silgi instance is gracefully closing.
|
|
387
|
-
* @param silgi The configured silgi object
|
|
388
|
-
* @returns Promise
|
|
389
|
-
*/
|
|
390
|
-
'close': (silgi: SilgiCLI) => HookResult;
|
|
391
|
-
'module:register:before': (module: SilgiModule) => HookResult;
|
|
392
|
-
'module:register:after': (module: SilgiCLI['scanModules'][number]) => HookResult;
|
|
393
|
-
'module:setup:finish': (module: SilgiModule) => HookResult;
|
|
394
|
-
'prepare:createCoreFramework': (options: Pick<ImportItem, 'customImports' | 'importItems'> & {
|
|
395
|
-
functions?: string[];
|
|
396
|
-
}) => HookResult;
|
|
397
|
-
'prepare:createDTSFramework': (options: ImportItem) => HookResult;
|
|
398
|
-
/**
|
|
399
|
-
* Allows extending compatibility checks.
|
|
400
|
-
* @param compatibility Compatibility object
|
|
401
|
-
* @param issues Issues to be mapped
|
|
402
|
-
* @returns Promise
|
|
403
|
-
*/
|
|
404
|
-
'kit:compatibility': (compatibility: SilgiCompatibility, issues: SilgiCompatibilityIssues) => HookResult;
|
|
405
|
-
/**
|
|
406
|
-
* Called before Nuxi writes `.nuxt/tsconfig.json` and `.nuxt/nuxt.d.ts`, allowing addition of custom references and declarations in `nuxt.d.ts`, or directly modifying the options in `tsconfig.json`
|
|
407
|
-
* @param options Objects containing `references`, `declarations`, `tsConfig`
|
|
408
|
-
* @returns Promise
|
|
409
|
-
*/
|
|
410
|
-
'prepare:types': (options: {
|
|
411
|
-
references: TSReference[];
|
|
412
|
-
declarations: string[];
|
|
413
|
-
tsConfig: TSConfig;
|
|
414
|
-
}) => HookResult;
|
|
415
|
-
'prepare:core.ts': (options: {
|
|
416
|
-
uris: string[];
|
|
417
|
-
services: string[];
|
|
418
|
-
shareds: string[];
|
|
419
|
-
schemas: string[];
|
|
420
|
-
buildSilgiExtraContent: string[];
|
|
421
|
-
} & ImportItem) => HookResult;
|
|
422
|
-
'after:prepare:core.ts': (content: string[]) => HookResult;
|
|
423
|
-
'prepare:schema.ts': (options: {
|
|
424
|
-
configs: {
|
|
425
|
-
key: string;
|
|
426
|
-
value: string;
|
|
427
|
-
}[];
|
|
428
|
-
contexts: {
|
|
429
|
-
key: string;
|
|
430
|
-
value: string;
|
|
431
|
-
}[];
|
|
432
|
-
methods: {
|
|
433
|
-
key: string;
|
|
434
|
-
value: string;
|
|
435
|
-
}[];
|
|
436
|
-
shareds: {
|
|
437
|
-
key: string;
|
|
438
|
-
value: string;
|
|
439
|
-
}[];
|
|
440
|
-
events: {
|
|
441
|
-
key: string;
|
|
442
|
-
value: string;
|
|
443
|
-
extends?: boolean;
|
|
444
|
-
isSilgiContext?: boolean;
|
|
445
|
-
}[];
|
|
446
|
-
storeBase: string[];
|
|
447
|
-
} & ImportItem) => HookResult;
|
|
448
|
-
'after:prepare:schema.ts': (content: string[]) => HookResult;
|
|
449
|
-
'prepare:framework.d.ts': (options: {} & ImportItem) => HookResult;
|
|
450
|
-
'read:core.ts': (data: () => Awaitable<{
|
|
451
|
-
context: string;
|
|
452
|
-
object: {
|
|
453
|
-
uris?: string[];
|
|
454
|
-
services?: string[];
|
|
455
|
-
shareds?: string[];
|
|
456
|
-
schemas?: string[];
|
|
457
|
-
modulesURIs?: string[];
|
|
458
|
-
};
|
|
459
|
-
path: string;
|
|
460
|
-
}>) => HookResult;
|
|
461
|
-
'before:graphql:schema': (data: {
|
|
462
|
-
typeDefs: TypeSource[];
|
|
463
|
-
resolvers: Array<IResolvers<any, any>>;
|
|
464
|
-
}) => HookResult;
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
/**
|
|
468
|
-
* Bu nitrojs, h3 event or request context.
|
|
469
|
-
*/
|
|
470
|
-
interface SilgiEvent extends Record<string, unknown> {
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
/**
|
|
474
|
-
* @example
|
|
475
|
-
* namespace: 'coreApi'
|
|
476
|
-
* serviceName: 'basket'
|
|
477
|
-
* method: 'post'
|
|
478
|
-
* action: 'createBasket'
|
|
479
|
-
*/
|
|
480
|
-
interface SilgiOperation {
|
|
481
|
-
/**
|
|
482
|
-
* 'coreApi'
|
|
483
|
-
* 'storageApi'
|
|
484
|
-
*/
|
|
485
|
-
namespaceName: keyof DefaultNamespaces;
|
|
486
|
-
/**
|
|
487
|
-
* 'basket'
|
|
488
|
-
* 'user'
|
|
489
|
-
*/
|
|
490
|
-
serviceName: string;
|
|
491
|
-
/**
|
|
492
|
-
* 'post'
|
|
493
|
-
* 'delete'
|
|
494
|
-
*/
|
|
495
|
-
methodName: string;
|
|
496
|
-
/**
|
|
497
|
-
* 'createBasket'
|
|
498
|
-
* 'deleteUser'
|
|
499
|
-
*/
|
|
500
|
-
actionName: string;
|
|
501
|
-
/**
|
|
502
|
-
* 'coreApi/basket/post/createBasket'
|
|
503
|
-
*/
|
|
504
|
-
raw: string;
|
|
505
|
-
/**
|
|
506
|
-
* '/book/basket/getAllBaskets'
|
|
507
|
-
*/
|
|
508
|
-
uri: keyof SilgiURIs;
|
|
509
|
-
/**
|
|
510
|
-
* ['coreApi', 'book', 'basket', 'getAllBaskets']
|
|
511
|
-
*/
|
|
512
|
-
parts: string[];
|
|
513
|
-
/**
|
|
514
|
-
* {id: '123', name: 'John', bookId: '456', authorId: '789'}
|
|
515
|
-
*/
|
|
516
|
-
routerParams?: Record<string, string | undefined>;
|
|
517
|
-
/**
|
|
518
|
-
* url ?limit=10&page=1
|
|
519
|
-
* {limit: '10', page: '1'}
|
|
520
|
-
*/
|
|
521
|
-
query?: Record<string, string>;
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
interface SilgiModules {
|
|
525
|
-
}
|
|
526
|
-
interface SilgiModuleMethods {
|
|
527
|
-
}
|
|
528
|
-
interface SilgiModuleOptions {
|
|
529
|
-
}
|
|
530
|
-
type SilgiModuleInput = (SilgiModule<any> | string | [SilgiModule | string, Record<string, any>] | undefined | null | false);
|
|
531
|
-
interface SilgiCompatibility {
|
|
532
|
-
/**
|
|
533
|
-
* Required silgi version in semver format.
|
|
534
|
-
* @example `^3.2.0` or `>=3.13.0`.
|
|
535
|
-
*/
|
|
536
|
-
silgi?: string;
|
|
537
|
-
}
|
|
538
|
-
interface ModuleMeta {
|
|
539
|
-
/** Module name. */
|
|
540
|
-
name?: string;
|
|
541
|
-
/** Module description. */
|
|
542
|
-
description?: string;
|
|
543
|
-
/** Module author. */
|
|
544
|
-
author?: string;
|
|
545
|
-
/** Module license. */
|
|
546
|
-
license?: string;
|
|
547
|
-
/** exports */
|
|
548
|
-
exports?: {
|
|
549
|
-
interface?: {
|
|
550
|
-
config?: true;
|
|
551
|
-
shared?: true;
|
|
552
|
-
context?: true;
|
|
553
|
-
method?: true;
|
|
554
|
-
schema?: true;
|
|
555
|
-
event?: true;
|
|
556
|
-
options?: true;
|
|
557
|
-
};
|
|
558
|
-
variable?: {
|
|
559
|
-
shared?: true;
|
|
560
|
-
};
|
|
561
|
-
};
|
|
562
|
-
/** Module version. */
|
|
563
|
-
version?: string;
|
|
564
|
-
/**
|
|
565
|
-
* The configuration key used within `silgi.config` for this module's options.
|
|
566
|
-
* For example, `@silgijs/axios` uses `axios`.
|
|
567
|
-
*/
|
|
568
|
-
configKey?: string;
|
|
569
|
-
/**
|
|
570
|
-
* Constraints for the versions of silgi or features this module requires.
|
|
571
|
-
*/
|
|
572
|
-
compatibility?: SilgiCompatibility;
|
|
573
|
-
/**
|
|
574
|
-
* @private
|
|
575
|
-
*/
|
|
576
|
-
_modules?: {
|
|
577
|
-
[key: string]: string;
|
|
578
|
-
};
|
|
579
|
-
/**
|
|
580
|
-
* @private
|
|
581
|
-
*/
|
|
582
|
-
_packageName?: string;
|
|
583
|
-
readonly dependencies?: ReadonlyArray<string>;
|
|
584
|
-
[key: string]: unknown;
|
|
585
|
-
}
|
|
586
|
-
interface ResolvedModuleMeta extends ModuleMeta {
|
|
587
|
-
configKey: string;
|
|
588
|
-
name: string;
|
|
589
|
-
}
|
|
590
|
-
type ModuleHookContext = Readonly<{
|
|
591
|
-
event?: SilgiEvent;
|
|
592
|
-
operation?: SilgiOperation;
|
|
593
|
-
input?: unknown;
|
|
594
|
-
result?: unknown;
|
|
595
|
-
modules?: ModuleConfigurations;
|
|
596
|
-
timestamp?: number;
|
|
597
|
-
meta?: Record<string, unknown>;
|
|
598
|
-
error?: Error;
|
|
599
|
-
success?: boolean;
|
|
600
|
-
}>;
|
|
601
|
-
/** The options received. */
|
|
602
|
-
type ModuleOptions = Record<string, any>;
|
|
603
|
-
type Prettify<T> = {
|
|
604
|
-
[K in keyof T]: T[K];
|
|
605
|
-
} & {};
|
|
606
|
-
type ResolvedModuleOptions<TOptions extends ModuleOptions, TOptionsDefaults extends Partial<TOptions>> = Prettify<Defu<Partial<TOptions>, [
|
|
607
|
-
Partial<TOptions>,
|
|
608
|
-
TOptionsDefaults
|
|
609
|
-
]>>;
|
|
610
|
-
interface ModuleDefinition<TOptions extends ModuleOptions, TOptionsDefaults extends Partial<TOptions>, TWith extends boolean> {
|
|
611
|
-
meta?: ModuleMeta;
|
|
612
|
-
defaults?: TOptionsDefaults | ((silgi: SilgiCLI) => Awaitable<TOptionsDefaults>);
|
|
613
|
-
hooks?: Partial<SilgiCLIHooks>;
|
|
614
|
-
setup?: (this: void, resolvedOptions: TWith extends true ? ResolvedModuleOptions<TOptions, TOptionsDefaults> : TOptions, silgi: SilgiCLI) => ModuleSetupReturn;
|
|
615
|
-
}
|
|
616
|
-
interface ModuleSetupInstallResult {
|
|
617
|
-
/**
|
|
618
|
-
* Timing information for the initial setup
|
|
619
|
-
*/
|
|
620
|
-
timings?: {
|
|
621
|
-
/** Total time took for module setup in ms */
|
|
622
|
-
setup?: number;
|
|
623
|
-
[key: string]: number | undefined;
|
|
624
|
-
};
|
|
625
|
-
}
|
|
626
|
-
type ModuleSetupReturn = Awaitable<false | void | ModuleSetupInstallResult>;
|
|
627
|
-
interface SilgiModule<TOptions extends ModuleOptions = ModuleOptions, TOptionsDefaults extends Partial<TOptions> = Partial<TOptions>, TWith extends boolean = false> {
|
|
628
|
-
(this: void, resolvedOptions: TWith extends true ? ResolvedModuleOptions<TOptions, TOptionsDefaults> : TOptions, silgi: SilgiCLI): ModuleSetupReturn;
|
|
629
|
-
getOptions?: (inlineOptions?: Partial<TOptions>, silgi?: SilgiCLI) => Promise<TWith extends true ? ResolvedModuleOptions<TOptions, TOptionsDefaults> : TOptions>;
|
|
630
|
-
getMeta?: () => Promise<ModuleMeta>;
|
|
631
|
-
}
|
|
632
|
-
type ModuleConfigurations = SilgiModuleMethods;
|
|
633
|
-
|
|
634
|
-
export type { AppConfig as A, BaseSchemaType as B, CreateScope as C, DefaultHooks as D, ModuleSetupReturn as E, SilgiPreset as F, SilgiPresetMeta as G, HookResult as H, SilgiSchema as I, MergedSilgiSchema as J, ImportItem as K, LoadConfigOptions as L, ModuleOptions as M, SilgiCLI as N, SilgiCLIDynamicConfig as O, SilgiFrameworkInfo as P, NitroBuildInfo as Q, ResolvedModuleMeta as R, SilgiModule as S, TSReference as T, SilgiURIs as U, URIsTypes as V, ExtractInputFromURI as W, ExtractOutputFromURI as X, ExtractRouterParamsFromURI as Y, ModuleDefinition as a, SilgiOperation as b, SilgiEvent as c, ModuleConfigurations as d, BaseSilgiMethodType as e, SilgiModules as f, SilgiModuleOptions as g, DeepPartial as h, ModuleHookContext as i, DefaultNamespaces as j, SilgiCLIOptions as k, SilgiCLIConfig as l, SilgiCLIHooks as m, SilgiCompatibilityIssue as n, SilgiCompatibilityIssues as o, SilgiMethods as p, SilgiNamespaces as q, SilgiRouterTypes as r, SilgiHook as s, Awaitable as t, SilgiModuleMethods as u, SilgiModuleInput as v, SilgiCompatibility as w, ModuleMeta as x, ResolvedModuleOptions as y, ModuleSetupInstallResult as z };
|