silgi 0.20.26 → 0.20.28
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 +1 -1
- package/dist/cli/common.mjs +74 -74
- package/dist/meta/index.d.mts +1 -1
- package/dist/meta/index.d.ts +1 -1
- package/dist/types/index.d.mts +73 -74
- package/dist/types/index.d.ts +73 -74
- package/package.json +1 -1
package/dist/_chunks/index.mjs
CHANGED
package/dist/cli/common.mjs
CHANGED
|
@@ -342,125 +342,147 @@ async function nuxtFramework(silgi, skip = false) {
|
|
|
342
342
|
const frameworkSetup = [emptyFramework, h3Framework, nitroFramework, nuxtFramework];
|
|
343
343
|
|
|
344
344
|
async function registerModuleExportScan(silgi) {
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
345
|
+
for (const module of silgi.scanModules) {
|
|
346
|
+
const moduleReExports = [];
|
|
347
|
+
const moduleTypes = await promises.readFile(module.entryPath.replace(/\.mjs$/, "Types.d.ts"), "utf8").catch(() => "");
|
|
348
|
+
const normalisedModuleTypes = moduleTypes.replace(/export\s*\{.*?\}/gs, (match) => match.replace(/\b(type|interface)\b/g, ""));
|
|
349
|
+
for (const e of findTypeExports(normalisedModuleTypes)) {
|
|
350
|
+
moduleReExports.push(e);
|
|
351
|
+
}
|
|
352
|
+
for (const e of findExports(normalisedModuleTypes)) {
|
|
353
|
+
moduleReExports.push(e);
|
|
354
|
+
}
|
|
355
|
+
const hasTypeExport = (name) => moduleReExports.find((exp) => exp.names?.includes(name));
|
|
356
|
+
const configKey = module.meta.configKey;
|
|
357
|
+
const moduleName = module.meta.name || module.meta._packageName;
|
|
358
|
+
silgi.hook("prepare:schema.ts", async (options) => {
|
|
359
359
|
options.importItems[configKey] = {
|
|
360
360
|
import: [],
|
|
361
361
|
from: module.meta._packageName ? moduleName : relativeWithDot(silgi.options.build.typesDir, module.entryPath)
|
|
362
362
|
};
|
|
363
|
-
|
|
364
|
-
|
|
363
|
+
});
|
|
364
|
+
if (hasTypeExport("ModuleOptions")) {
|
|
365
|
+
const importName = `_${hash(`${configKey}ModuleOptions`)}`;
|
|
366
|
+
silgi.hook("prepare:schema.ts", async (options) => {
|
|
365
367
|
options.importItems[configKey].import.push({
|
|
366
368
|
name: `ModuleOptions as ${importName}`,
|
|
367
369
|
type: true,
|
|
368
370
|
key: importName
|
|
369
371
|
});
|
|
370
372
|
options.options.push({ key: configKey, value: importName });
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
if (hasTypeExport("ModuleRuntimeOptions")) {
|
|
376
|
+
const importName = `_${hash(`${configKey}ModuleRuntimeOptions`)}`;
|
|
377
|
+
silgi.hook("prepare:schema.ts", async (options) => {
|
|
374
378
|
options.importItems[configKey].import.push({
|
|
375
379
|
name: `ModuleRuntimeOptions as ${importName}`,
|
|
376
380
|
type: true,
|
|
377
381
|
key: importName
|
|
378
382
|
});
|
|
379
383
|
options.runtimeOptions.push({ key: configKey, value: importName });
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
if (hasTypeExport("ModuleRuntimeShareds")) {
|
|
387
|
+
const importName = `_${hash(`${configKey}ModuleRuntimeShareds`)}`;
|
|
388
|
+
silgi.hook("prepare:schema.ts", async (options) => {
|
|
383
389
|
options.importItems[configKey].import.push({
|
|
384
390
|
name: `ModuleRuntimeShareds as ${importName}`,
|
|
385
391
|
type: true,
|
|
386
392
|
key: importName
|
|
387
393
|
});
|
|
388
394
|
options.shareds.push({ key: configKey, value: importName });
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
if (hasTypeExport("ModuleEvents")) {
|
|
398
|
+
const importName = `_${hash(`${configKey}ModuleEvents`)}`;
|
|
399
|
+
silgi.hook("prepare:schema.ts", async (options) => {
|
|
392
400
|
options.importItems[configKey].import.push({
|
|
393
401
|
name: `ModuleEvents as ${importName}`,
|
|
394
402
|
type: true,
|
|
395
403
|
key: importName
|
|
396
404
|
});
|
|
397
405
|
options.events.push({ key: configKey, value: importName });
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
if (hasTypeExport("ModuleRuntimeContexts")) {
|
|
409
|
+
const importName = `_${hash(`${configKey}ModuleRuntimeContexts`)}`;
|
|
410
|
+
silgi.hook("prepare:schema.ts", async (options) => {
|
|
401
411
|
options.importItems[configKey].import.push({
|
|
402
412
|
name: `ModuleRuntimeContexts as ${importName}`,
|
|
403
413
|
type: true,
|
|
404
414
|
key: importName
|
|
405
415
|
});
|
|
406
416
|
options.contexts.push({ key: configKey, value: importName });
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
if (hasTypeExport("ModuleHooks")) {
|
|
420
|
+
const importName = `_${hash(`${configKey}ModuleHooks`)}`;
|
|
421
|
+
silgi.hook("prepare:schema.ts", async (options) => {
|
|
410
422
|
options.importItems[configKey].import.push({
|
|
411
423
|
name: `ModuleHooks as ${importName}`,
|
|
412
424
|
type: true,
|
|
413
425
|
key: importName
|
|
414
426
|
});
|
|
415
427
|
options.hooks.push({ key: configKey, value: importName });
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
if (hasTypeExport("ModuleRuntimeHooks")) {
|
|
431
|
+
const importName = `_${hash(`${configKey}RuntimeHooks`)}`;
|
|
432
|
+
silgi.hook("prepare:schema.ts", async (options) => {
|
|
419
433
|
options.importItems[configKey].import.push({
|
|
420
434
|
name: `ModuleRuntimeHooks as ${importName}`,
|
|
421
435
|
type: true,
|
|
422
436
|
key: importName
|
|
423
437
|
});
|
|
424
438
|
options.runtimeHooks.push({ key: configKey, value: importName });
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
if (hasTypeExport("ModuleRuntimeActions")) {
|
|
442
|
+
const importName = `_${hash(`${configKey}ModuleRuntimeActions`)}`;
|
|
443
|
+
silgi.hook("prepare:schema.ts", async (options) => {
|
|
428
444
|
options.importItems[configKey].import.push({
|
|
429
445
|
name: `ModuleRuntimeActions as ${importName}`,
|
|
430
446
|
type: true,
|
|
431
447
|
key: importName
|
|
432
448
|
});
|
|
433
449
|
options.actions.push({ key: configKey, value: importName });
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
|
|
450
|
+
});
|
|
451
|
+
}
|
|
452
|
+
if (hasTypeExport("ModuleRuntimeMethods")) {
|
|
453
|
+
const importName = `_${hash(`${configKey}ModuleRuntimeMethods`)}`;
|
|
454
|
+
silgi.hook("prepare:schema.ts", async (options) => {
|
|
437
455
|
options.importItems[configKey].import.push({
|
|
438
456
|
name: `ModuleRuntimeMethods as ${importName}`,
|
|
439
457
|
type: true,
|
|
440
458
|
key: importName
|
|
441
459
|
});
|
|
442
460
|
options.methods.push({ key: configKey, value: importName });
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
|
|
461
|
+
});
|
|
462
|
+
}
|
|
463
|
+
if (hasTypeExport("ModuleRuntimeRouteRules")) {
|
|
464
|
+
const importName = `_${hash(`${configKey}ModuleRuntimeRouteRules`)}`;
|
|
465
|
+
silgi.hook("prepare:schema.ts", async (options) => {
|
|
446
466
|
options.importItems[configKey].import.push({
|
|
447
467
|
name: `ModuleRuntimeRouteRules as ${importName}`,
|
|
448
468
|
type: true,
|
|
449
469
|
key: importName
|
|
450
470
|
});
|
|
451
471
|
options.routeRules.push({ key: configKey, value: importName });
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
if (hasTypeExport("ModuleRuntimeRouteRulesConfig")) {
|
|
475
|
+
const importName = `_${hash(`${configKey}ModuleRuntimeRouteRulesConfig`)}`;
|
|
476
|
+
silgi.hook("prepare:schema.ts", async (options) => {
|
|
455
477
|
options.importItems[configKey].import.push({
|
|
456
478
|
name: `ModuleRuntimeRouteRulesConfig as ${importName}`,
|
|
457
479
|
type: true,
|
|
458
480
|
key: importName
|
|
459
481
|
});
|
|
460
482
|
options.routeRulesConfig.push({ key: configKey, value: importName });
|
|
461
|
-
}
|
|
483
|
+
});
|
|
462
484
|
}
|
|
463
|
-
}
|
|
485
|
+
}
|
|
464
486
|
}
|
|
465
487
|
|
|
466
488
|
async function loadSilgiModuleInstance(silgiModule) {
|
|
@@ -923,6 +945,10 @@ async function prepareServerFiles(silgi) {
|
|
|
923
945
|
defu$1(scanned.modulesURIs, silgi.modulesURIs);
|
|
924
946
|
}
|
|
925
947
|
await silgi.callHook("prepare:scan.ts", scanned);
|
|
948
|
+
scanned.services = [...new Set(scanned.services)];
|
|
949
|
+
scanned.shareds = [...new Set(scanned.shareds)];
|
|
950
|
+
scanned.schemas = [...new Set(scanned.schemas)];
|
|
951
|
+
scanned.customImports = [...new Set(scanned.customImports)];
|
|
926
952
|
if (importItems["#silgi/vfs"].import.length === 0) {
|
|
927
953
|
delete importItems["#silgi/vfs"];
|
|
928
954
|
}
|
|
@@ -938,9 +964,6 @@ async function prepareServerFiles(silgi) {
|
|
|
938
964
|
for (const key in importItems) {
|
|
939
965
|
importItems[key].import = deduplicateImportsByKey(importItems[key].import);
|
|
940
966
|
}
|
|
941
|
-
scanned.services = deduplicateArray(scanned.services);
|
|
942
|
-
scanned.schemas = deduplicateArray(scanned.schemas);
|
|
943
|
-
scanned.shareds = deduplicateArray(scanned.shareds);
|
|
944
967
|
const importsContent = [
|
|
945
968
|
...Object.entries(importItems).map(([_name, { from, import: imports }]) => {
|
|
946
969
|
if (silgi.options.typescript.removeFileExtension) {
|
|
@@ -990,9 +1013,6 @@ function deduplicateImportsByKey(imports) {
|
|
|
990
1013
|
return true;
|
|
991
1014
|
});
|
|
992
1015
|
}
|
|
993
|
-
function deduplicateArray(array) {
|
|
994
|
-
return [...new Set(array)];
|
|
995
|
-
}
|
|
996
1016
|
|
|
997
1017
|
async function writeScanFiles(silgi) {
|
|
998
1018
|
const data = await prepareServerFiles(silgi);
|
|
@@ -2156,26 +2176,6 @@ async function prepareSchema(silgi) {
|
|
|
2156
2176
|
routeRules: [],
|
|
2157
2177
|
routeRulesConfig: []
|
|
2158
2178
|
};
|
|
2159
|
-
function reset() {
|
|
2160
|
-
data.options = [];
|
|
2161
|
-
data.contexts = [];
|
|
2162
|
-
data.actions = [];
|
|
2163
|
-
data.shareds = [
|
|
2164
|
-
{
|
|
2165
|
-
key: "modulesURIs",
|
|
2166
|
-
value: "{ modulesURIs: typeof modulesURIs }"
|
|
2167
|
-
}
|
|
2168
|
-
];
|
|
2169
|
-
data.events = [];
|
|
2170
|
-
data.storeBase = [];
|
|
2171
|
-
data.hooks = [];
|
|
2172
|
-
data.runtimeHooks = [];
|
|
2173
|
-
data.runtimeOptions = [];
|
|
2174
|
-
data.methods = [];
|
|
2175
|
-
data.routeRules = [];
|
|
2176
|
-
data.routeRulesConfig = [];
|
|
2177
|
-
}
|
|
2178
|
-
reset();
|
|
2179
2179
|
await silgi.callHook("prepare:schema.ts", data);
|
|
2180
2180
|
relativeWithDot(silgi.options.build.typesDir, `${silgi.options.silgi.serverDir}/core.ts`);
|
|
2181
2181
|
const silgiScanTS = relativeWithDot(silgi.options.build.typesDir, `${silgi.options.silgi.serverDir}/scan.ts`);
|
package/dist/meta/index.d.mts
CHANGED
package/dist/meta/index.d.ts
CHANGED
package/dist/types/index.d.mts
CHANGED
|
@@ -149,78 +149,6 @@ interface ResolvedSilgiTemplate<Options = TemplateDefaultOptions> extends SilgiT
|
|
|
149
149
|
modified?: boolean;
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
-
type TSReference = {
|
|
153
|
-
types: string;
|
|
154
|
-
} | {
|
|
155
|
-
path: string;
|
|
156
|
-
};
|
|
157
|
-
interface SilgiHooks {
|
|
158
|
-
}
|
|
159
|
-
interface GenerateAppOptions {
|
|
160
|
-
filter?: (template: ResolvedSilgiTemplate<any>) => boolean;
|
|
161
|
-
}
|
|
162
|
-
interface PrepareCore extends ImportItem {
|
|
163
|
-
buildSilgiExtraContent: string[];
|
|
164
|
-
beforeBuildSilgiExtraContent: {
|
|
165
|
-
value: string;
|
|
166
|
-
type: 'function' | 'variable';
|
|
167
|
-
}[];
|
|
168
|
-
afterCliOptions: string[];
|
|
169
|
-
_silgiConfigs: any[];
|
|
170
|
-
}
|
|
171
|
-
interface SchemaPreparationOptions extends ImportItem {
|
|
172
|
-
options: {
|
|
173
|
-
key: string;
|
|
174
|
-
value: string;
|
|
175
|
-
}[];
|
|
176
|
-
runtimeOptions: {
|
|
177
|
-
key: string;
|
|
178
|
-
value: string;
|
|
179
|
-
}[];
|
|
180
|
-
methods: {
|
|
181
|
-
key: string;
|
|
182
|
-
value: string;
|
|
183
|
-
}[];
|
|
184
|
-
routeRules: {
|
|
185
|
-
key: string;
|
|
186
|
-
value: string;
|
|
187
|
-
}[];
|
|
188
|
-
routeRulesConfig: {
|
|
189
|
-
key: string;
|
|
190
|
-
value: string;
|
|
191
|
-
}[];
|
|
192
|
-
contexts: {
|
|
193
|
-
key: string;
|
|
194
|
-
value: string;
|
|
195
|
-
}[];
|
|
196
|
-
actions: {
|
|
197
|
-
key: string;
|
|
198
|
-
value: string;
|
|
199
|
-
}[];
|
|
200
|
-
shareds: {
|
|
201
|
-
key: string;
|
|
202
|
-
value: string;
|
|
203
|
-
}[];
|
|
204
|
-
events: {
|
|
205
|
-
key: string;
|
|
206
|
-
value: string;
|
|
207
|
-
/**
|
|
208
|
-
* Extend olursa key value interface icine eklenmez.
|
|
209
|
-
* interface SilgiModuleEventsExtends extends SilgiEvents {}
|
|
210
|
-
*/
|
|
211
|
-
extends?: boolean;
|
|
212
|
-
isSilgiContext?: boolean;
|
|
213
|
-
}[];
|
|
214
|
-
storeBase: string[];
|
|
215
|
-
hooks: {
|
|
216
|
-
key: string;
|
|
217
|
-
value: string;
|
|
218
|
-
}[];
|
|
219
|
-
runtimeHooks: {
|
|
220
|
-
key: string;
|
|
221
|
-
value: string;
|
|
222
|
-
}[];
|
|
223
|
-
}
|
|
224
152
|
interface SilgiCLIHooks extends SilgiHooks {
|
|
225
153
|
/**
|
|
226
154
|
* Called after Silgi initialization, when the Silgi instance is ready to work.
|
|
@@ -269,7 +197,59 @@ interface SilgiCLIHooks extends SilgiHooks {
|
|
|
269
197
|
modulesURIs: Record<string, string>;
|
|
270
198
|
}) => HookResult;
|
|
271
199
|
'after:prepare:scan.ts': (content: string[]) => HookResult;
|
|
272
|
-
'prepare:schema.ts': (options:
|
|
200
|
+
'prepare:schema.ts': (options: {
|
|
201
|
+
options: {
|
|
202
|
+
key: string;
|
|
203
|
+
value: string;
|
|
204
|
+
}[];
|
|
205
|
+
runtimeOptions: {
|
|
206
|
+
key: string;
|
|
207
|
+
value: string;
|
|
208
|
+
}[];
|
|
209
|
+
methods: {
|
|
210
|
+
key: string;
|
|
211
|
+
value: string;
|
|
212
|
+
}[];
|
|
213
|
+
routeRules: {
|
|
214
|
+
key: string;
|
|
215
|
+
value: string;
|
|
216
|
+
}[];
|
|
217
|
+
routeRulesConfig: {
|
|
218
|
+
key: string;
|
|
219
|
+
value: string;
|
|
220
|
+
}[];
|
|
221
|
+
contexts: {
|
|
222
|
+
key: string;
|
|
223
|
+
value: string;
|
|
224
|
+
}[];
|
|
225
|
+
actions: {
|
|
226
|
+
key: string;
|
|
227
|
+
value: string;
|
|
228
|
+
}[];
|
|
229
|
+
shareds: {
|
|
230
|
+
key: string;
|
|
231
|
+
value: string;
|
|
232
|
+
}[];
|
|
233
|
+
events: {
|
|
234
|
+
key: string;
|
|
235
|
+
value: string;
|
|
236
|
+
/**
|
|
237
|
+
* If extends is true, it won't be added to the key value interface.
|
|
238
|
+
* interface SilgiModuleEventsExtends extends SilgiEvents {}
|
|
239
|
+
*/
|
|
240
|
+
extends?: boolean;
|
|
241
|
+
isSilgiContext?: boolean;
|
|
242
|
+
}[];
|
|
243
|
+
storeBase: string[];
|
|
244
|
+
hooks: {
|
|
245
|
+
key: string;
|
|
246
|
+
value: string;
|
|
247
|
+
}[];
|
|
248
|
+
runtimeHooks: {
|
|
249
|
+
key: string;
|
|
250
|
+
value: string;
|
|
251
|
+
}[];
|
|
252
|
+
} & ImportItem) => HookResult;
|
|
273
253
|
'after:prepare:schema.ts': (content: string[]) => HookResult;
|
|
274
254
|
'prepare:framework.d.ts': (options: {} & ImportItem) => HookResult;
|
|
275
255
|
'prepare:configs.ts': (cliOptions: Record<string, any>) => HookResult;
|
|
@@ -289,6 +269,25 @@ interface SilgiCLIHooks extends SilgiHooks {
|
|
|
289
269
|
'prepare:commands': (commands: SilgiCLI['commands']) => HookResult;
|
|
290
270
|
'prepare:installPackages': (packages: Record<'dependencies' | 'devDependencies', Record<string, string>>) => HookResult;
|
|
291
271
|
}
|
|
272
|
+
type TSReference = {
|
|
273
|
+
types: string;
|
|
274
|
+
} | {
|
|
275
|
+
path: string;
|
|
276
|
+
};
|
|
277
|
+
interface SilgiHooks {
|
|
278
|
+
}
|
|
279
|
+
interface GenerateAppOptions {
|
|
280
|
+
filter?: (template: ResolvedSilgiTemplate<any>) => boolean;
|
|
281
|
+
}
|
|
282
|
+
interface PrepareCore extends ImportItem {
|
|
283
|
+
buildSilgiExtraContent: string[];
|
|
284
|
+
beforeBuildSilgiExtraContent: {
|
|
285
|
+
value: string;
|
|
286
|
+
type: 'function' | 'variable';
|
|
287
|
+
}[];
|
|
288
|
+
afterCliOptions: string[];
|
|
289
|
+
_silgiConfigs: any[];
|
|
290
|
+
}
|
|
292
291
|
|
|
293
292
|
/**
|
|
294
293
|
* Bu nitrojs, h3 event or request context.
|
|
@@ -1134,4 +1133,4 @@ interface ServiceParseModule {
|
|
|
1134
1133
|
|
|
1135
1134
|
declare const autoImportTypes: string[];
|
|
1136
1135
|
|
|
1137
|
-
export { type AppConfig, type Awaitable, type BaseNamespaceType, type BaseSchemaType, type BaseSilgiMethodType, type CaptureError, type CapturedErrorContext, type CommandType, type CreateScope, type DeepPartial, type DefaultHooks, type DefaultNamespaces, type DefaultRouteConfig, type DefaultRouteRules, type DotenvOptions, type EnvOptions, type EventHandlerResponse, type ExtendContext, type ExtendShared, type ExtractInputFromURI, type ExtractOutputFromURI, type ExtractPathParamsFromURI, type ExtractQueryParamsFromURI, type ExtractSourceFromURI, type FrameworkContext, type GenerateAppOptions, type GraphQLJSON, type HookResult, type ImportItem, type LoadConfigOptions, type MergedSilgiSchema, type MethodHandlerType, type ModuleDefinition, type ModuleHookContext, type ModuleMeta, type ModuleOptionsCustom, type ModuleSetupInstallResult, type ModuleSetupReturn, type Namespaces, type NitroBuildInfo, type PrepareCore, type RequiredServiceType, type ResolvedMethodHandlerType, type ResolvedModuleMeta, type ResolvedModuleOptions, type ResolvedServiceType, type ResolvedSilgiTemplate, type RouteRules, type ScanFile, type
|
|
1136
|
+
export { type AppConfig, type Awaitable, type BaseNamespaceType, type BaseSchemaType, type BaseSilgiMethodType, type CaptureError, type CapturedErrorContext, type CommandType, type CreateScope, type DeepPartial, type DefaultHooks, type DefaultNamespaces, type DefaultRouteConfig, type DefaultRouteRules, type DotenvOptions, type EnvOptions, type EventHandlerResponse, type ExtendContext, type ExtendShared, type ExtractInputFromURI, type ExtractOutputFromURI, type ExtractPathParamsFromURI, type ExtractQueryParamsFromURI, type ExtractSourceFromURI, type FrameworkContext, type GenerateAppOptions, type GraphQLJSON, type HookResult, type ImportItem, type LoadConfigOptions, type MergedSilgiSchema, type MethodHandlerType, type ModuleDefinition, type ModuleHookContext, type ModuleMeta, type ModuleOptionsCustom, type ModuleSetupInstallResult, type ModuleSetupReturn, type Namespaces, type NitroBuildInfo, type PrepareCore, type RequiredServiceType, type ResolvedMethodHandlerType, type ResolvedModuleMeta, type ResolvedModuleOptions, type ResolvedServiceType, type ResolvedSilgiTemplate, type RouteRules, type ScanFile, type ServiceParse, type ServiceParseModule, type ServiceType, type Silgi, type SilgiAppPlugin, type SilgiCLI, type SilgiCLIConfig, type SilgiCLIDynamicConfig, type SilgiCLIHooks, type SilgiCLIOptions, type SilgiCommands, type SilgiCompatibility, type SilgiCompatibilityIssue, type SilgiCompatibilityIssues, type SilgiConfig, type SilgiEvents, type SilgiFrameworkInfo, type SilgiFunction, type SilgiHooks, type SilgiModule, type SilgiModuleInput, type SilgiModuleOptions, type SilgiNamespaces, type SilgiOperation, type SilgiOptions, type SilgiPreset, type SilgiPresetMeta, type SilgiRouteRules, type SilgiRouterTypes, type SilgiRuntimeActions, type SilgiRuntimeConfig, type SilgiRuntimeContext, type SilgiRuntimeHooks, type SilgiRuntimeMethods, type SilgiRuntimeOptions, type SilgiRuntimeRouteRules, type SilgiRuntimeRouteRulesConfig, type SilgiRuntimeShareds, type SilgiRuntimeSharedsExtend, type SilgiSchema, type SilgiServiceInterface, type SilgiStorageBase, type SilgiTemplate, type SilgiURIs, type StorageConfig, type StorageKeyGenerator, type StorageKeyParams, type StorageMounts, type TSReference, type URIsTypes, autoImportTypes };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -149,78 +149,6 @@ interface ResolvedSilgiTemplate<Options = TemplateDefaultOptions> extends SilgiT
|
|
|
149
149
|
modified?: boolean;
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
-
type TSReference = {
|
|
153
|
-
types: string;
|
|
154
|
-
} | {
|
|
155
|
-
path: string;
|
|
156
|
-
};
|
|
157
|
-
interface SilgiHooks {
|
|
158
|
-
}
|
|
159
|
-
interface GenerateAppOptions {
|
|
160
|
-
filter?: (template: ResolvedSilgiTemplate<any>) => boolean;
|
|
161
|
-
}
|
|
162
|
-
interface PrepareCore extends ImportItem {
|
|
163
|
-
buildSilgiExtraContent: string[];
|
|
164
|
-
beforeBuildSilgiExtraContent: {
|
|
165
|
-
value: string;
|
|
166
|
-
type: 'function' | 'variable';
|
|
167
|
-
}[];
|
|
168
|
-
afterCliOptions: string[];
|
|
169
|
-
_silgiConfigs: any[];
|
|
170
|
-
}
|
|
171
|
-
interface SchemaPreparationOptions extends ImportItem {
|
|
172
|
-
options: {
|
|
173
|
-
key: string;
|
|
174
|
-
value: string;
|
|
175
|
-
}[];
|
|
176
|
-
runtimeOptions: {
|
|
177
|
-
key: string;
|
|
178
|
-
value: string;
|
|
179
|
-
}[];
|
|
180
|
-
methods: {
|
|
181
|
-
key: string;
|
|
182
|
-
value: string;
|
|
183
|
-
}[];
|
|
184
|
-
routeRules: {
|
|
185
|
-
key: string;
|
|
186
|
-
value: string;
|
|
187
|
-
}[];
|
|
188
|
-
routeRulesConfig: {
|
|
189
|
-
key: string;
|
|
190
|
-
value: string;
|
|
191
|
-
}[];
|
|
192
|
-
contexts: {
|
|
193
|
-
key: string;
|
|
194
|
-
value: string;
|
|
195
|
-
}[];
|
|
196
|
-
actions: {
|
|
197
|
-
key: string;
|
|
198
|
-
value: string;
|
|
199
|
-
}[];
|
|
200
|
-
shareds: {
|
|
201
|
-
key: string;
|
|
202
|
-
value: string;
|
|
203
|
-
}[];
|
|
204
|
-
events: {
|
|
205
|
-
key: string;
|
|
206
|
-
value: string;
|
|
207
|
-
/**
|
|
208
|
-
* Extend olursa key value interface icine eklenmez.
|
|
209
|
-
* interface SilgiModuleEventsExtends extends SilgiEvents {}
|
|
210
|
-
*/
|
|
211
|
-
extends?: boolean;
|
|
212
|
-
isSilgiContext?: boolean;
|
|
213
|
-
}[];
|
|
214
|
-
storeBase: string[];
|
|
215
|
-
hooks: {
|
|
216
|
-
key: string;
|
|
217
|
-
value: string;
|
|
218
|
-
}[];
|
|
219
|
-
runtimeHooks: {
|
|
220
|
-
key: string;
|
|
221
|
-
value: string;
|
|
222
|
-
}[];
|
|
223
|
-
}
|
|
224
152
|
interface SilgiCLIHooks extends SilgiHooks {
|
|
225
153
|
/**
|
|
226
154
|
* Called after Silgi initialization, when the Silgi instance is ready to work.
|
|
@@ -269,7 +197,59 @@ interface SilgiCLIHooks extends SilgiHooks {
|
|
|
269
197
|
modulesURIs: Record<string, string>;
|
|
270
198
|
}) => HookResult;
|
|
271
199
|
'after:prepare:scan.ts': (content: string[]) => HookResult;
|
|
272
|
-
'prepare:schema.ts': (options:
|
|
200
|
+
'prepare:schema.ts': (options: {
|
|
201
|
+
options: {
|
|
202
|
+
key: string;
|
|
203
|
+
value: string;
|
|
204
|
+
}[];
|
|
205
|
+
runtimeOptions: {
|
|
206
|
+
key: string;
|
|
207
|
+
value: string;
|
|
208
|
+
}[];
|
|
209
|
+
methods: {
|
|
210
|
+
key: string;
|
|
211
|
+
value: string;
|
|
212
|
+
}[];
|
|
213
|
+
routeRules: {
|
|
214
|
+
key: string;
|
|
215
|
+
value: string;
|
|
216
|
+
}[];
|
|
217
|
+
routeRulesConfig: {
|
|
218
|
+
key: string;
|
|
219
|
+
value: string;
|
|
220
|
+
}[];
|
|
221
|
+
contexts: {
|
|
222
|
+
key: string;
|
|
223
|
+
value: string;
|
|
224
|
+
}[];
|
|
225
|
+
actions: {
|
|
226
|
+
key: string;
|
|
227
|
+
value: string;
|
|
228
|
+
}[];
|
|
229
|
+
shareds: {
|
|
230
|
+
key: string;
|
|
231
|
+
value: string;
|
|
232
|
+
}[];
|
|
233
|
+
events: {
|
|
234
|
+
key: string;
|
|
235
|
+
value: string;
|
|
236
|
+
/**
|
|
237
|
+
* If extends is true, it won't be added to the key value interface.
|
|
238
|
+
* interface SilgiModuleEventsExtends extends SilgiEvents {}
|
|
239
|
+
*/
|
|
240
|
+
extends?: boolean;
|
|
241
|
+
isSilgiContext?: boolean;
|
|
242
|
+
}[];
|
|
243
|
+
storeBase: string[];
|
|
244
|
+
hooks: {
|
|
245
|
+
key: string;
|
|
246
|
+
value: string;
|
|
247
|
+
}[];
|
|
248
|
+
runtimeHooks: {
|
|
249
|
+
key: string;
|
|
250
|
+
value: string;
|
|
251
|
+
}[];
|
|
252
|
+
} & ImportItem) => HookResult;
|
|
273
253
|
'after:prepare:schema.ts': (content: string[]) => HookResult;
|
|
274
254
|
'prepare:framework.d.ts': (options: {} & ImportItem) => HookResult;
|
|
275
255
|
'prepare:configs.ts': (cliOptions: Record<string, any>) => HookResult;
|
|
@@ -289,6 +269,25 @@ interface SilgiCLIHooks extends SilgiHooks {
|
|
|
289
269
|
'prepare:commands': (commands: SilgiCLI['commands']) => HookResult;
|
|
290
270
|
'prepare:installPackages': (packages: Record<'dependencies' | 'devDependencies', Record<string, string>>) => HookResult;
|
|
291
271
|
}
|
|
272
|
+
type TSReference = {
|
|
273
|
+
types: string;
|
|
274
|
+
} | {
|
|
275
|
+
path: string;
|
|
276
|
+
};
|
|
277
|
+
interface SilgiHooks {
|
|
278
|
+
}
|
|
279
|
+
interface GenerateAppOptions {
|
|
280
|
+
filter?: (template: ResolvedSilgiTemplate<any>) => boolean;
|
|
281
|
+
}
|
|
282
|
+
interface PrepareCore extends ImportItem {
|
|
283
|
+
buildSilgiExtraContent: string[];
|
|
284
|
+
beforeBuildSilgiExtraContent: {
|
|
285
|
+
value: string;
|
|
286
|
+
type: 'function' | 'variable';
|
|
287
|
+
}[];
|
|
288
|
+
afterCliOptions: string[];
|
|
289
|
+
_silgiConfigs: any[];
|
|
290
|
+
}
|
|
292
291
|
|
|
293
292
|
/**
|
|
294
293
|
* Bu nitrojs, h3 event or request context.
|
|
@@ -1134,4 +1133,4 @@ interface ServiceParseModule {
|
|
|
1134
1133
|
|
|
1135
1134
|
declare const autoImportTypes: string[];
|
|
1136
1135
|
|
|
1137
|
-
export { type AppConfig, type Awaitable, type BaseNamespaceType, type BaseSchemaType, type BaseSilgiMethodType, type CaptureError, type CapturedErrorContext, type CommandType, type CreateScope, type DeepPartial, type DefaultHooks, type DefaultNamespaces, type DefaultRouteConfig, type DefaultRouteRules, type DotenvOptions, type EnvOptions, type EventHandlerResponse, type ExtendContext, type ExtendShared, type ExtractInputFromURI, type ExtractOutputFromURI, type ExtractPathParamsFromURI, type ExtractQueryParamsFromURI, type ExtractSourceFromURI, type FrameworkContext, type GenerateAppOptions, type GraphQLJSON, type HookResult, type ImportItem, type LoadConfigOptions, type MergedSilgiSchema, type MethodHandlerType, type ModuleDefinition, type ModuleHookContext, type ModuleMeta, type ModuleOptionsCustom, type ModuleSetupInstallResult, type ModuleSetupReturn, type Namespaces, type NitroBuildInfo, type PrepareCore, type RequiredServiceType, type ResolvedMethodHandlerType, type ResolvedModuleMeta, type ResolvedModuleOptions, type ResolvedServiceType, type ResolvedSilgiTemplate, type RouteRules, type ScanFile, type
|
|
1136
|
+
export { type AppConfig, type Awaitable, type BaseNamespaceType, type BaseSchemaType, type BaseSilgiMethodType, type CaptureError, type CapturedErrorContext, type CommandType, type CreateScope, type DeepPartial, type DefaultHooks, type DefaultNamespaces, type DefaultRouteConfig, type DefaultRouteRules, type DotenvOptions, type EnvOptions, type EventHandlerResponse, type ExtendContext, type ExtendShared, type ExtractInputFromURI, type ExtractOutputFromURI, type ExtractPathParamsFromURI, type ExtractQueryParamsFromURI, type ExtractSourceFromURI, type FrameworkContext, type GenerateAppOptions, type GraphQLJSON, type HookResult, type ImportItem, type LoadConfigOptions, type MergedSilgiSchema, type MethodHandlerType, type ModuleDefinition, type ModuleHookContext, type ModuleMeta, type ModuleOptionsCustom, type ModuleSetupInstallResult, type ModuleSetupReturn, type Namespaces, type NitroBuildInfo, type PrepareCore, type RequiredServiceType, type ResolvedMethodHandlerType, type ResolvedModuleMeta, type ResolvedModuleOptions, type ResolvedServiceType, type ResolvedSilgiTemplate, type RouteRules, type ScanFile, type ServiceParse, type ServiceParseModule, type ServiceType, type Silgi, type SilgiAppPlugin, type SilgiCLI, type SilgiCLIConfig, type SilgiCLIDynamicConfig, type SilgiCLIHooks, type SilgiCLIOptions, type SilgiCommands, type SilgiCompatibility, type SilgiCompatibilityIssue, type SilgiCompatibilityIssues, type SilgiConfig, type SilgiEvents, type SilgiFrameworkInfo, type SilgiFunction, type SilgiHooks, type SilgiModule, type SilgiModuleInput, type SilgiModuleOptions, type SilgiNamespaces, type SilgiOperation, type SilgiOptions, type SilgiPreset, type SilgiPresetMeta, type SilgiRouteRules, type SilgiRouterTypes, type SilgiRuntimeActions, type SilgiRuntimeConfig, type SilgiRuntimeContext, type SilgiRuntimeHooks, type SilgiRuntimeMethods, type SilgiRuntimeOptions, type SilgiRuntimeRouteRules, type SilgiRuntimeRouteRulesConfig, type SilgiRuntimeShareds, type SilgiRuntimeSharedsExtend, type SilgiSchema, type SilgiServiceInterface, type SilgiStorageBase, type SilgiTemplate, type SilgiURIs, type StorageConfig, type StorageKeyGenerator, type StorageKeyParams, type StorageMounts, type TSReference, type URIsTypes, autoImportTypes };
|