silgi 0.4.1 → 0.4.3
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/prepare.mjs +29 -14
- package/dist/core/index.mjs +1 -1
- package/dist/meta/index.d.mts +1 -1
- package/dist/meta/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/_chunks/index.mjs
CHANGED
package/dist/cli/prepare.mjs
CHANGED
|
@@ -33,19 +33,29 @@ import 'unctx';
|
|
|
33
33
|
async function h3Framework(silgi, skip = false) {
|
|
34
34
|
if (silgi.options.preset !== "h3" && skip === false)
|
|
35
35
|
return;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
36
|
+
silgi.hook("prepare:schema.ts", (data) => {
|
|
37
|
+
data.importItems.nitropack = {
|
|
38
|
+
import: [
|
|
39
|
+
{ name: "NitroApp", type: true }
|
|
40
|
+
],
|
|
41
|
+
from: "nitropack/types"
|
|
42
|
+
};
|
|
43
|
+
data.importItems.h3 = {
|
|
44
|
+
import: [
|
|
45
|
+
{ name: "H3Event", type: true }
|
|
46
|
+
],
|
|
47
|
+
from: "h3"
|
|
48
|
+
};
|
|
49
|
+
data.events.push({
|
|
50
|
+
key: "H3Event",
|
|
51
|
+
value: "H3Event",
|
|
52
|
+
extends: true,
|
|
53
|
+
isSilgiContext: false
|
|
47
54
|
});
|
|
48
|
-
}
|
|
55
|
+
});
|
|
56
|
+
silgi.hook("after:prepare:schema.ts", (data) => {
|
|
57
|
+
data.unshift("type FrameworkContextExtends = NitroApp");
|
|
58
|
+
});
|
|
49
59
|
silgi.hook("prepare:createDTSFramework", (data) => {
|
|
50
60
|
data.importItems["silgi/types"] = {
|
|
51
61
|
import: [
|
|
@@ -84,7 +94,13 @@ async function nitroFramework(silgi, skip = false) {
|
|
|
84
94
|
await h3Framework(silgi, true);
|
|
85
95
|
}
|
|
86
96
|
|
|
87
|
-
|
|
97
|
+
async function nuxtFramework(silgi, skip = false) {
|
|
98
|
+
if (silgi.options.preset !== "nuxt" && skip === false)
|
|
99
|
+
return;
|
|
100
|
+
await nitroFramework(silgi, true);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const frameworkSetup = [h3Framework, nitroFramework, nuxtFramework];
|
|
88
104
|
|
|
89
105
|
async function prepare$1(silgi) {
|
|
90
106
|
await prepareDir(silgi.options.output.dir);
|
|
@@ -1276,7 +1292,6 @@ async function createSilgiCLI(config = {}, opts = {}) {
|
|
|
1276
1292
|
close: () => silgi.hooks.callHook("close", silgi),
|
|
1277
1293
|
storage: undefined,
|
|
1278
1294
|
scanModules: [],
|
|
1279
|
-
_modules: [],
|
|
1280
1295
|
callHook: hooks.callHook,
|
|
1281
1296
|
addHooks: hooks.addHooks,
|
|
1282
1297
|
hook: hooks.hook,
|
package/dist/core/index.mjs
CHANGED
|
@@ -656,7 +656,7 @@ async function silgiGenerateType(silgi) {
|
|
|
656
656
|
jsxFactory: "h",
|
|
657
657
|
jsxFragmentFactory: "Fragment",
|
|
658
658
|
allowImportingTsExtensions: true,
|
|
659
|
-
customConditions: ["silgiTypes"],
|
|
659
|
+
...silgi.options.typescript.customConditions ? { customConditions: ["silgiTypes"] } : {},
|
|
660
660
|
paths: {
|
|
661
661
|
"#imports": [
|
|
662
662
|
relativeWithDot(tsconfigDir, join(silgi.options.build.typesDir, "silgi-imports"))
|
package/dist/meta/index.d.mts
CHANGED
package/dist/meta/index.d.ts
CHANGED