silgi 0.4.0 → 0.4.2
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 +17 -2
- package/dist/core/index.mjs +1 -1
- package/dist/kit/index.d.mts +1 -1
- package/dist/kit/index.d.ts +1 -1
- package/dist/kit/index.mjs +4 -4
- package/dist/meta/index.d.mts +1 -1
- package/dist/meta/index.d.ts +1 -1
- package/dist/presets/_all.gen.d.ts +1 -1
- package/dist/presets/_all.gen.mjs +3 -1
- package/dist/presets/_types.gen.d.ts +2 -2
- package/dist/presets/nuxt/preset.d.ts +2 -0
- package/dist/presets/nuxt/preset.mjs +26 -0
- package/dist/shared/{silgi.DSHNePNA.d.mts → silgi.CzUPBllI.d.mts} +1 -1
- package/dist/shared/{silgi.D8h2AAVk.d.ts → silgi.D_LzzCtJ.d.ts} +1 -1
- package/dist/types/index.d.mts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/package.json +1 -1
package/dist/_chunks/index.mjs
CHANGED
package/dist/cli/prepare.mjs
CHANGED
|
@@ -41,6 +41,12 @@ async function h3Framework(silgi, skip = false) {
|
|
|
41
41
|
],
|
|
42
42
|
from: "nitropack/types"
|
|
43
43
|
};
|
|
44
|
+
data.events.push({
|
|
45
|
+
key: "H3Event",
|
|
46
|
+
value: "H3Event",
|
|
47
|
+
extends: true,
|
|
48
|
+
isSilgiContext: false
|
|
49
|
+
});
|
|
44
50
|
});
|
|
45
51
|
silgi.hook("after:prepare:schema.ts", (data) => {
|
|
46
52
|
data.unshift("type FrameworkContextExtends = NitroApp");
|
|
@@ -84,7 +90,13 @@ async function nitroFramework(silgi, skip = false) {
|
|
|
84
90
|
await h3Framework(silgi, true);
|
|
85
91
|
}
|
|
86
92
|
|
|
87
|
-
|
|
93
|
+
async function nuxtFramework(silgi, skip = false) {
|
|
94
|
+
if (silgi.options.preset !== "nuxt" && skip === false)
|
|
95
|
+
return;
|
|
96
|
+
await nitroFramework(silgi, true);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const frameworkSetup = [h3Framework, nitroFramework, nuxtFramework];
|
|
88
100
|
|
|
89
101
|
async function prepare$1(silgi) {
|
|
90
102
|
await prepareDir(silgi.options.output.dir);
|
|
@@ -875,6 +887,10 @@ async function installModules(silgi) {
|
|
|
875
887
|
default: true,
|
|
876
888
|
conditions: silgi.options.conditions
|
|
877
889
|
});
|
|
890
|
+
if (silgiModule.name !== "silgiNormalizedModule") {
|
|
891
|
+
silgi.scanModules = silgi.scanModules.filter((m) => m.entryPath !== module.entryPath);
|
|
892
|
+
continue;
|
|
893
|
+
}
|
|
878
894
|
await installModule(silgiModule, silgi);
|
|
879
895
|
} catch (err) {
|
|
880
896
|
silgi.logger.error(err);
|
|
@@ -1272,7 +1288,6 @@ async function createSilgiCLI(config = {}, opts = {}) {
|
|
|
1272
1288
|
close: () => silgi.hooks.callHook("close", silgi),
|
|
1273
1289
|
storage: undefined,
|
|
1274
1290
|
scanModules: [],
|
|
1275
|
-
_modules: [],
|
|
1276
1291
|
callHook: hooks.callHook,
|
|
1277
1292
|
addHooks: hooks.addHooks,
|
|
1278
1293
|
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/kit/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Buffer } from 'node:buffer';
|
|
2
2
|
import { GraphQLSchema } from 'graphql';
|
|
3
3
|
import { SilgiCLI, GraphQLJSON, SilgiPreset, SilgiPresetMeta } from 'silgi/types';
|
|
4
|
-
import { w as ModuleOptions, y as ModuleDefinition, F as SilgiModule } from '../shared/silgi.
|
|
4
|
+
import { w as ModuleOptions, y as ModuleDefinition, F as SilgiModule } from '../shared/silgi.CzUPBllI.mjs';
|
|
5
5
|
import 'defu';
|
|
6
6
|
import '@graphql-tools/utils';
|
|
7
7
|
import 'pkg-types';
|
package/dist/kit/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Buffer } from 'node:buffer';
|
|
2
2
|
import { GraphQLSchema } from 'graphql';
|
|
3
3
|
import { SilgiCLI, GraphQLJSON, SilgiPreset, SilgiPresetMeta } from 'silgi/types';
|
|
4
|
-
import { w as ModuleOptions, y as ModuleDefinition, F as SilgiModule } from '../shared/silgi.
|
|
4
|
+
import { w as ModuleOptions, y as ModuleDefinition, F as SilgiModule } from '../shared/silgi.D_LzzCtJ.js';
|
|
5
5
|
import 'defu';
|
|
6
6
|
import '@graphql-tools/utils';
|
|
7
7
|
import 'pkg-types';
|
package/dist/kit/index.mjs
CHANGED
|
@@ -185,7 +185,7 @@ function _defineSilgiModule(definition) {
|
|
|
185
185
|
const options = defu(inlineOptions, nuxtConfigOptions, optionsDefaults);
|
|
186
186
|
return Promise.resolve(options);
|
|
187
187
|
}
|
|
188
|
-
async function
|
|
188
|
+
async function silgiNormalizedModule(inlineOptions, silgi = tryUseSilgiCLI()) {
|
|
189
189
|
if (!silgi) {
|
|
190
190
|
throw new TypeError("Cannot use module outside of Silgi context");
|
|
191
191
|
}
|
|
@@ -227,9 +227,9 @@ ${issues.toString()}`);
|
|
|
227
227
|
}
|
|
228
228
|
});
|
|
229
229
|
}
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
return
|
|
230
|
+
silgiNormalizedModule.getMeta = () => Promise.resolve(module.meta);
|
|
231
|
+
silgiNormalizedModule.getOptions = getOptions;
|
|
232
|
+
return silgiNormalizedModule;
|
|
233
233
|
}
|
|
234
234
|
|
|
235
235
|
function defineSilgiPreset(preset, meta) {
|
package/dist/meta/index.d.mts
CHANGED
package/dist/meta/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: readonly [any, any, any];
|
|
1
|
+
declare const _default: readonly [any, any, any, any];
|
|
2
2
|
export default _default;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import _h3 from "./h3/preset.mjs";
|
|
2
2
|
import _nitro from "./nitro/preset.mjs";
|
|
3
3
|
import _npmpackage from "./npmpackage/preset.mjs";
|
|
4
|
+
import _nuxt from "./nuxt/preset.mjs";
|
|
4
5
|
export default [
|
|
5
6
|
..._h3,
|
|
6
7
|
..._nitro,
|
|
7
|
-
..._npmpackage
|
|
8
|
+
..._npmpackage,
|
|
9
|
+
..._nuxt
|
|
8
10
|
];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export interface PresetOptions {
|
|
2
2
|
}
|
|
3
3
|
export declare const presetsWithConfig: readonly [];
|
|
4
|
-
export type PresetName = "h3" | "nitro" | "npm-package";
|
|
5
|
-
export type PresetNameInput = "h3" | "nitro" | "npm-package" | "npmPackage" | "npm_package" | (string & {});
|
|
4
|
+
export type PresetName = "h3" | "nitro" | "npm-package" | "nuxt";
|
|
5
|
+
export type PresetNameInput = "h3" | "nitro" | "npm-package" | "npmPackage" | "npm_package" | "nuxt" | (string & {});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { defineSilgiPreset } from "silgi/kit";
|
|
2
|
+
const nuxt = defineSilgiPreset(
|
|
3
|
+
{
|
|
4
|
+
static: true,
|
|
5
|
+
output: {
|
|
6
|
+
dir: "{{ rootDir }}/.output",
|
|
7
|
+
publicDir: "{{ output.dir }}/public"
|
|
8
|
+
},
|
|
9
|
+
prerender: {
|
|
10
|
+
crawlLinks: true
|
|
11
|
+
},
|
|
12
|
+
typescript: {
|
|
13
|
+
generateTsConfig: false,
|
|
14
|
+
tsconfigPath: ".nuxt/silgi.tsconfig.json"
|
|
15
|
+
},
|
|
16
|
+
commands: {
|
|
17
|
+
preview: "npx serve ./public"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: "nuxt",
|
|
22
|
+
static: true,
|
|
23
|
+
url: import.meta.url
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
export default [nuxt];
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as DefaultNamespaces, B as BaseSchemaType, S as SilgiServiceInterface } from '../shared/silgi.
|
|
2
|
-
export { A as AppConfig, o as Awaitable, l as BaseSilgiMethodType, W as CaptureError, V as CapturedErrorContext, C as CreateScope, n as DeepPartial, m as DefaultHooks, N as EventHandlerResponse, a2 as ExtendShared, ae as ExtractInputFromURI, af as ExtractOutputFromURI, ag as ExtractRouterParamsFromURI, a3 as FrameworkContext, a7 as ImportItem, L as LoadConfigOptions, Y as MergedSilgiSchema, O as MethodHandlerType, Q as MethodResponse, K as MethodSchemaType, G as ModuleConfigurations, y as ModuleDefinition, v as ModuleHookContext, M as ModuleMeta, w as ModuleOptions, z as ModuleSetupInstallResult, E as ModuleSetupReturn, ab as NitroBuildInfo, _ as RequiredServiceType, P as ResolvedMethodHandlerType, R as ResolvedModuleMeta, x as ResolvedModuleOptions, $ as ResolvedServiceType, Z as ServiceType, a4 as Silgi, U as SilgiAppPlugin, a8 as SilgiCLI, b as SilgiCLIConfig, a9 as SilgiCLIDynamicConfig, c as SilgiCLIHooks, a as SilgiCLIOptions, u as SilgiCompatibility, d as SilgiCompatibilityIssue, e as SilgiCompatibilityIssues, a5 as SilgiConfig, a0 as SilgiDefaultShared, g as SilgiEvent, aa as SilgiFrameworkInfo, a6 as SilgiFunction, k as SilgiHook, p as SilgiHooks, h as SilgiMethods, F as SilgiModule, t as SilgiModuleInput, r as SilgiModuleMethods, s as SilgiModuleOptions, a1 as SilgiModuleShared, q as SilgiModules, i as SilgiNamespaces, H as SilgiOperation, f as SilgiOptions, I as SilgiPreset, J as SilgiPresetMeta, j as SilgiRouterTypes, X as SilgiSchema, ai as SilgiStorageBase, ac as SilgiURIs, ak as StorageConfig, aj as StorageKeyGenerator, al as StorageKeyParams, ah as StorageMounts, T as TSReference, ad as URIsTypes } from '../shared/silgi.
|
|
1
|
+
import { D as DefaultNamespaces, B as BaseSchemaType, S as SilgiServiceInterface } from '../shared/silgi.CzUPBllI.mjs';
|
|
2
|
+
export { A as AppConfig, o as Awaitable, l as BaseSilgiMethodType, W as CaptureError, V as CapturedErrorContext, C as CreateScope, n as DeepPartial, m as DefaultHooks, N as EventHandlerResponse, a2 as ExtendShared, ae as ExtractInputFromURI, af as ExtractOutputFromURI, ag as ExtractRouterParamsFromURI, a3 as FrameworkContext, a7 as ImportItem, L as LoadConfigOptions, Y as MergedSilgiSchema, O as MethodHandlerType, Q as MethodResponse, K as MethodSchemaType, G as ModuleConfigurations, y as ModuleDefinition, v as ModuleHookContext, M as ModuleMeta, w as ModuleOptions, z as ModuleSetupInstallResult, E as ModuleSetupReturn, ab as NitroBuildInfo, _ as RequiredServiceType, P as ResolvedMethodHandlerType, R as ResolvedModuleMeta, x as ResolvedModuleOptions, $ as ResolvedServiceType, Z as ServiceType, a4 as Silgi, U as SilgiAppPlugin, a8 as SilgiCLI, b as SilgiCLIConfig, a9 as SilgiCLIDynamicConfig, c as SilgiCLIHooks, a as SilgiCLIOptions, u as SilgiCompatibility, d as SilgiCompatibilityIssue, e as SilgiCompatibilityIssues, a5 as SilgiConfig, a0 as SilgiDefaultShared, g as SilgiEvent, aa as SilgiFrameworkInfo, a6 as SilgiFunction, k as SilgiHook, p as SilgiHooks, h as SilgiMethods, F as SilgiModule, t as SilgiModuleInput, r as SilgiModuleMethods, s as SilgiModuleOptions, a1 as SilgiModuleShared, q as SilgiModules, i as SilgiNamespaces, H as SilgiOperation, f as SilgiOptions, I as SilgiPreset, J as SilgiPresetMeta, j as SilgiRouterTypes, X as SilgiSchema, ai as SilgiStorageBase, ac as SilgiURIs, ak as StorageConfig, aj as StorageKeyGenerator, al as StorageKeyParams, ah as StorageMounts, T as TSReference, ad as URIsTypes } from '../shared/silgi.CzUPBllI.mjs';
|
|
3
3
|
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
4
4
|
import 'defu';
|
|
5
5
|
import '@graphql-tools/utils';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as DefaultNamespaces, B as BaseSchemaType, S as SilgiServiceInterface } from '../shared/silgi.
|
|
2
|
-
export { A as AppConfig, o as Awaitable, l as BaseSilgiMethodType, W as CaptureError, V as CapturedErrorContext, C as CreateScope, n as DeepPartial, m as DefaultHooks, N as EventHandlerResponse, a2 as ExtendShared, ae as ExtractInputFromURI, af as ExtractOutputFromURI, ag as ExtractRouterParamsFromURI, a3 as FrameworkContext, a7 as ImportItem, L as LoadConfigOptions, Y as MergedSilgiSchema, O as MethodHandlerType, Q as MethodResponse, K as MethodSchemaType, G as ModuleConfigurations, y as ModuleDefinition, v as ModuleHookContext, M as ModuleMeta, w as ModuleOptions, z as ModuleSetupInstallResult, E as ModuleSetupReturn, ab as NitroBuildInfo, _ as RequiredServiceType, P as ResolvedMethodHandlerType, R as ResolvedModuleMeta, x as ResolvedModuleOptions, $ as ResolvedServiceType, Z as ServiceType, a4 as Silgi, U as SilgiAppPlugin, a8 as SilgiCLI, b as SilgiCLIConfig, a9 as SilgiCLIDynamicConfig, c as SilgiCLIHooks, a as SilgiCLIOptions, u as SilgiCompatibility, d as SilgiCompatibilityIssue, e as SilgiCompatibilityIssues, a5 as SilgiConfig, a0 as SilgiDefaultShared, g as SilgiEvent, aa as SilgiFrameworkInfo, a6 as SilgiFunction, k as SilgiHook, p as SilgiHooks, h as SilgiMethods, F as SilgiModule, t as SilgiModuleInput, r as SilgiModuleMethods, s as SilgiModuleOptions, a1 as SilgiModuleShared, q as SilgiModules, i as SilgiNamespaces, H as SilgiOperation, f as SilgiOptions, I as SilgiPreset, J as SilgiPresetMeta, j as SilgiRouterTypes, X as SilgiSchema, ai as SilgiStorageBase, ac as SilgiURIs, ak as StorageConfig, aj as StorageKeyGenerator, al as StorageKeyParams, ah as StorageMounts, T as TSReference, ad as URIsTypes } from '../shared/silgi.
|
|
1
|
+
import { D as DefaultNamespaces, B as BaseSchemaType, S as SilgiServiceInterface } from '../shared/silgi.D_LzzCtJ.js';
|
|
2
|
+
export { A as AppConfig, o as Awaitable, l as BaseSilgiMethodType, W as CaptureError, V as CapturedErrorContext, C as CreateScope, n as DeepPartial, m as DefaultHooks, N as EventHandlerResponse, a2 as ExtendShared, ae as ExtractInputFromURI, af as ExtractOutputFromURI, ag as ExtractRouterParamsFromURI, a3 as FrameworkContext, a7 as ImportItem, L as LoadConfigOptions, Y as MergedSilgiSchema, O as MethodHandlerType, Q as MethodResponse, K as MethodSchemaType, G as ModuleConfigurations, y as ModuleDefinition, v as ModuleHookContext, M as ModuleMeta, w as ModuleOptions, z as ModuleSetupInstallResult, E as ModuleSetupReturn, ab as NitroBuildInfo, _ as RequiredServiceType, P as ResolvedMethodHandlerType, R as ResolvedModuleMeta, x as ResolvedModuleOptions, $ as ResolvedServiceType, Z as ServiceType, a4 as Silgi, U as SilgiAppPlugin, a8 as SilgiCLI, b as SilgiCLIConfig, a9 as SilgiCLIDynamicConfig, c as SilgiCLIHooks, a as SilgiCLIOptions, u as SilgiCompatibility, d as SilgiCompatibilityIssue, e as SilgiCompatibilityIssues, a5 as SilgiConfig, a0 as SilgiDefaultShared, g as SilgiEvent, aa as SilgiFrameworkInfo, a6 as SilgiFunction, k as SilgiHook, p as SilgiHooks, h as SilgiMethods, F as SilgiModule, t as SilgiModuleInput, r as SilgiModuleMethods, s as SilgiModuleOptions, a1 as SilgiModuleShared, q as SilgiModules, i as SilgiNamespaces, H as SilgiOperation, f as SilgiOptions, I as SilgiPreset, J as SilgiPresetMeta, j as SilgiRouterTypes, X as SilgiSchema, ai as SilgiStorageBase, ac as SilgiURIs, ak as StorageConfig, aj as StorageKeyGenerator, al as StorageKeyParams, ah as StorageMounts, T as TSReference, ad as URIsTypes } from '../shared/silgi.D_LzzCtJ.js';
|
|
3
3
|
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
4
4
|
import 'defu';
|
|
5
5
|
import '@graphql-tools/utils';
|