silgi 0.43.20 → 0.43.22
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/cli/scan/prepareSchema.mjs +9 -5
- package/dist/core/index.mjs +1 -1
- package/dist/core/utils/resolver.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/kit/index.mjs +1 -1
- package/dist/kit/resolve.mjs +1 -1
- package/dist/package.mjs +1 -1
- package/dist/types/kits.d.mts +3 -3
- package/package.json +1 -1
|
@@ -48,12 +48,16 @@ async function prepareSchema(silgi) {
|
|
|
48
48
|
"",
|
|
49
49
|
`type SilgiModuleContextExtends = ${data.contexts.length ? data.contexts.map(({ value }) => value).join(" & ") : "{}"}`,
|
|
50
50
|
"",
|
|
51
|
-
data.events.length ?
|
|
51
|
+
data.events.length ? (() => {
|
|
52
|
+
const extendsTypes = data.events.filter((item) => item.extends).map((item) => item.value).join(", ");
|
|
53
|
+
const hasExtends = extendsTypes.length > 0;
|
|
54
|
+
return `interface SilgiModuleEventsExtends ${hasExtends ? `extends ${extendsTypes} ` : ""}{
|
|
52
55
|
${data.events.map((item) => {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
56
|
+
if (item.isSilgiContext) addSilgiContext = true;
|
|
57
|
+
return !item.extends && !addSilgiContext ? ` ${item.key}: ${item.value}` : item.isSilgiContext ? " context: SilgiRuntimeContext" : "";
|
|
58
|
+
}).join(",\n")}
|
|
59
|
+
}`;
|
|
60
|
+
})() : "interface SilgiModuleEventsExtends {}",
|
|
57
61
|
"",
|
|
58
62
|
`type SetupModuleOptionExtend = ${data.setupModuleOption?.length ? data.setupModuleOption.map(({ value }) => `${value}`).join(" & ") : "{}"}`,
|
|
59
63
|
"",
|
package/dist/core/index.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import { createStorage, useSilgiStorage } from "./utils/storage.mjs";
|
|
|
7
7
|
import { createSilgi } from "./createSilgi.mjs";
|
|
8
8
|
import { SilgiHttpEvent } from "./event.mjs";
|
|
9
9
|
import { handleResponse, kHandled, kNotFound } from "./response.mjs";
|
|
10
|
-
import { createResolver, getUrlPrefix } from "./utils/resolver.mjs";
|
|
10
|
+
import { createResolver$1 as createResolver, getUrlPrefix } from "./utils/resolver.mjs";
|
|
11
11
|
import { getWebsocket, handler, middleware, silgiFetch } from "./silgi.mjs";
|
|
12
12
|
import { storageMount } from "./storage.mjs";
|
|
13
13
|
import { createEventStream } from "./utils/event-stream.mjs";
|
package/dist/index.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import { createStorage, useSilgiStorage } from "./core/utils/storage.mjs";
|
|
|
7
7
|
import { createSilgi } from "./core/createSilgi.mjs";
|
|
8
8
|
import { SilgiHttpEvent } from "./core/event.mjs";
|
|
9
9
|
import { handleResponse, kHandled, kNotFound } from "./core/response.mjs";
|
|
10
|
-
import { createResolver, getUrlPrefix } from "./core/utils/resolver.mjs";
|
|
10
|
+
import { createResolver$1 as createResolver, getUrlPrefix } from "./core/utils/resolver.mjs";
|
|
11
11
|
import { getWebsocket, handler, middleware, silgiFetch } from "./core/silgi.mjs";
|
|
12
12
|
import { storageMount } from "./core/storage.mjs";
|
|
13
13
|
import { createEventStream } from "./core/utils/event-stream.mjs";
|
package/dist/kit/index.mjs
CHANGED
|
@@ -16,7 +16,7 @@ import { useLogger } from "./logger.mjs";
|
|
|
16
16
|
import { MigrationStatus, generateMigration, getMigration, listMigrations, migrationDown, migrationUp } from "./migration.mjs";
|
|
17
17
|
import { defineSilgiModule } from "./module.mjs";
|
|
18
18
|
import { defineSilgiPreset } from "./preset.mjs";
|
|
19
|
-
import { createResolver
|
|
19
|
+
import { createResolver, resolveAlias, resolvePath, resolveSilgiModule } from "./resolve.mjs";
|
|
20
20
|
import { addTemplate, normalizeTemplate } from "./template.mjs";
|
|
21
21
|
import { getIpAddress, useRequest } from "./useRequest.mjs";
|
|
22
22
|
|
package/dist/kit/resolve.mjs
CHANGED
|
@@ -79,4 +79,4 @@ async function resolveSilgiModule(base, paths) {
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
//#endregion
|
|
82
|
-
export { createResolver
|
|
82
|
+
export { createResolver, resolveAlias$1 as resolveAlias, resolvePath$1 as resolvePath, resolveSilgiModule };
|
package/dist/package.mjs
CHANGED
package/dist/types/kits.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { SilgiCLI } from "./silgiCLI.mjs";
|
|
2
2
|
import { BuildSilgi } from "./silgi.mjs";
|
|
3
3
|
import { ESMCodeGenOptions, ESMImport } from "knitwork";
|
|
4
|
-
import * as
|
|
4
|
+
import * as h33 from "h3";
|
|
5
5
|
import { PresetName } from "silgi/presets";
|
|
6
|
-
import * as
|
|
6
|
+
import * as nitropack_types1 from "nitropack/types";
|
|
7
7
|
|
|
8
8
|
//#region src/types/kits.d.ts
|
|
9
9
|
interface SilgiCommands {}
|
|
@@ -24,7 +24,7 @@ interface GenImport {
|
|
|
24
24
|
imports: ESMImport | ESMImport[];
|
|
25
25
|
options?: ESMCodeGenOptions;
|
|
26
26
|
}
|
|
27
|
-
type Framework<T extends PresetName> = T extends "nitro" ?
|
|
27
|
+
type Framework<T extends PresetName> = T extends "nitro" ? nitropack_types1.NitroApp : T extends "nuxt" ? nitropack_types1.NitroApp : T extends "h3" ? h33.Router : never;
|
|
28
28
|
interface DefineFrameworkOptions<T extends PresetName> extends Omit<BuildSilgi, "framework"> {
|
|
29
29
|
framework: Framework<T>;
|
|
30
30
|
}
|