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.
@@ -1,6 +1,6 @@
1
1
  const name = "silgi";
2
2
  const type = "module";
3
- const version = "0.4.1";
3
+ const version = "0.4.3";
4
4
  const packageManager = "pnpm@9.15.1";
5
5
  const sideEffects = false;
6
6
  const exports = {
@@ -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
- if (silgi.options.preset === "h3") {
37
- silgi.hook("prepare:schema.ts", (data) => {
38
- data.importItems.nitropack = {
39
- import: [
40
- { name: "NitroApp", type: true }
41
- ],
42
- from: "nitropack/types"
43
- };
44
- });
45
- silgi.hook("after:prepare:schema.ts", (data) => {
46
- data.unshift("type FrameworkContextExtends = NitroApp");
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
- const frameworkSetup = [h3Framework, nitroFramework];
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,
@@ -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"))
@@ -1,3 +1,3 @@
1
- const version = "0.4.1";
1
+ const version = "0.4.3";
2
2
 
3
3
  export { version };
@@ -1,3 +1,3 @@
1
- const version = "0.4.1";
1
+ const version = "0.4.3";
2
2
 
3
3
  export { version };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "silgi",
3
3
  "type": "module",
4
- "version": "0.4.1",
4
+ "version": "0.4.3",
5
5
  "sideEffects": false,
6
6
  "exports": {
7
7
  "./cli": {