silgi 0.3.13 → 0.4.0

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.
Files changed (69) hide show
  1. package/README.md +1 -31
  2. package/cli.d.ts +1 -0
  3. package/config.d.ts +1 -0
  4. package/core.d.ts +1 -0
  5. package/dist/_chunks/index.mjs +233 -0
  6. package/dist/cli/compatibility.mjs +42 -0
  7. package/dist/cli/index.mjs +3 -184
  8. package/dist/cli/prepare.mjs +1346 -0
  9. package/dist/config/index.d.mts +5 -0
  10. package/dist/config/index.d.ts +5 -0
  11. package/dist/core/index.d.mts +136 -0
  12. package/dist/core/index.d.ts +136 -0
  13. package/dist/core/index.mjs +1444 -0
  14. package/dist/ecosystem/nitro/index.mjs +21 -29
  15. package/dist/ecosystem/nuxt/module.mjs +4 -25
  16. package/dist/kit/index.d.mts +90 -0
  17. package/dist/kit/index.d.ts +90 -0
  18. package/dist/kit/index.mjs +316 -0
  19. package/dist/meta/index.d.mts +3 -0
  20. package/dist/meta/index.d.ts +3 -0
  21. package/dist/meta/index.mjs +1 -0
  22. package/dist/presets/_all.gen.d.ts +2 -0
  23. package/dist/presets/_all.gen.mjs +8 -0
  24. package/dist/presets/_resolve.d.ts +8 -0
  25. package/dist/presets/_resolve.mjs +58 -0
  26. package/dist/presets/_types.gen.d.ts +5 -0
  27. package/dist/presets/_types.gen.mjs +1 -0
  28. package/dist/presets/h3/preset.d.ts +2 -0
  29. package/dist/presets/h3/preset.mjs +22 -0
  30. package/dist/presets/index.d.mts +1 -0
  31. package/dist/presets/index.d.ts +2 -0
  32. package/dist/presets/index.mjs +1 -0
  33. package/dist/presets/nitro/preset.d.ts +2 -0
  34. package/dist/presets/nitro/preset.mjs +26 -0
  35. package/dist/presets/npmpackage/preset.d.ts +2 -0
  36. package/dist/presets/npmpackage/preset.mjs +23 -0
  37. package/dist/runtime/index.d.ts +1 -0
  38. package/dist/runtime/index.mjs +1 -0
  39. package/dist/runtime/internal/debug.d.ts +2 -0
  40. package/dist/runtime/internal/debug.mjs +5 -0
  41. package/dist/runtime/internal/nitro.d.ts +2 -0
  42. package/dist/runtime/internal/nitro.mjs +45 -0
  43. package/dist/runtime/internal/plugin.d.ts +3 -0
  44. package/dist/runtime/internal/plugin.mjs +4 -0
  45. package/dist/shared/silgi.40ZJYm8F.d.mts +11 -0
  46. package/dist/shared/silgi.40ZJYm8F.d.ts +11 -0
  47. package/dist/shared/{silgi.ClpvycKI.d.mts → silgi.D8h2AAVk.d.ts} +451 -437
  48. package/dist/shared/{silgi.ClpvycKI.d.ts → silgi.DSHNePNA.d.mts} +451 -437
  49. package/dist/types/index.d.mts +42 -0
  50. package/dist/types/index.d.ts +42 -0
  51. package/dist/types/index.mjs +1 -0
  52. package/kit.d.ts +1 -0
  53. package/meta.d.ts +1 -0
  54. package/package.json +89 -39
  55. package/presets.d.ts +1 -0
  56. package/runtime-meta.d.ts +4 -0
  57. package/runtime-meta.mjs +32 -0
  58. package/runtime.d.ts +1 -0
  59. package/types.d.ts +1 -0
  60. package/bin/silgi.mjs +0 -3
  61. package/dist/chunks/generate.mjs +0 -1257
  62. package/dist/cli/config.d.mts +0 -1633
  63. package/dist/cli/config.d.ts +0 -1633
  64. package/dist/index.d.mts +0 -198
  65. package/dist/index.d.ts +0 -198
  66. package/dist/index.mjs +0 -503
  67. package/dist/shared/silgi.D2yb1XAa.mjs +0 -842
  68. /package/dist/{chunks → cli}/init.mjs +0 -0
  69. /package/dist/{cli/config.mjs → config/index.mjs} +0 -0
@@ -0,0 +1,42 @@
1
+ import { D as DefaultNamespaces, B as BaseSchemaType, S as SilgiServiceInterface } from '../shared/silgi.DSHNePNA.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.DSHNePNA.mjs';
3
+ import { StandardSchemaV1 } from '@standard-schema/spec';
4
+ import 'defu';
5
+ import '@graphql-tools/utils';
6
+ import 'pkg-types';
7
+ import 'consola';
8
+ import 'hookable';
9
+ import 'silgi/presets';
10
+ import 'silgi/types';
11
+ import 'unimport';
12
+ import 'unstorage';
13
+ import 'c12';
14
+ import 'chokidar';
15
+ import 'compatx';
16
+ import 'unimport/unplugin';
17
+ import 'std-env';
18
+ import '../shared/silgi.40ZJYm8F.mjs';
19
+ import 'ignore';
20
+
21
+ interface SilgiModuleContext extends Record<string, any> {
22
+ }
23
+ interface ExtendContext {
24
+ }
25
+
26
+ interface GraphQLJSON {
27
+ queries: any;
28
+ mutations: any;
29
+ types: any;
30
+ inputs: any;
31
+ references: any;
32
+ }
33
+
34
+ interface BaseNamespaceType extends Record<keyof DefaultNamespaces, Record<string, BaseSchemaType<StandardSchemaV1>>> {
35
+ }
36
+ type Namespaces<T extends BaseNamespaceType> = {
37
+ [K in keyof T]: {
38
+ [P in keyof T[K]]: T[K][P] extends BaseSchemaType<StandardSchemaV1> ? SilgiServiceInterface<T[K][P]> : never;
39
+ };
40
+ };
41
+
42
+ export { type BaseNamespaceType, BaseSchemaType, DefaultNamespaces, type ExtendContext, type GraphQLJSON, type Namespaces, type SilgiModuleContext, SilgiServiceInterface };
@@ -0,0 +1,42 @@
1
+ import { D as DefaultNamespaces, B as BaseSchemaType, S as SilgiServiceInterface } from '../shared/silgi.D8h2AAVk.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.D8h2AAVk.js';
3
+ import { StandardSchemaV1 } from '@standard-schema/spec';
4
+ import 'defu';
5
+ import '@graphql-tools/utils';
6
+ import 'pkg-types';
7
+ import 'consola';
8
+ import 'hookable';
9
+ import 'silgi/presets';
10
+ import 'silgi/types';
11
+ import 'unimport';
12
+ import 'unstorage';
13
+ import 'c12';
14
+ import 'chokidar';
15
+ import 'compatx';
16
+ import 'unimport/unplugin';
17
+ import 'std-env';
18
+ import '../shared/silgi.40ZJYm8F.js';
19
+ import 'ignore';
20
+
21
+ interface SilgiModuleContext extends Record<string, any> {
22
+ }
23
+ interface ExtendContext {
24
+ }
25
+
26
+ interface GraphQLJSON {
27
+ queries: any;
28
+ mutations: any;
29
+ types: any;
30
+ inputs: any;
31
+ references: any;
32
+ }
33
+
34
+ interface BaseNamespaceType extends Record<keyof DefaultNamespaces, Record<string, BaseSchemaType<StandardSchemaV1>>> {
35
+ }
36
+ type Namespaces<T extends BaseNamespaceType> = {
37
+ [K in keyof T]: {
38
+ [P in keyof T[K]]: T[K][P] extends BaseSchemaType<StandardSchemaV1> ? SilgiServiceInterface<T[K][P]> : never;
39
+ };
40
+ };
41
+
42
+ export { type BaseNamespaceType, BaseSchemaType, DefaultNamespaces, type ExtendContext, type GraphQLJSON, type Namespaces, type SilgiModuleContext, SilgiServiceInterface };
@@ -0,0 +1 @@
1
+
package/kit.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/kit/index';
package/meta.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/meta/index';
package/package.json CHANGED
@@ -1,21 +1,23 @@
1
1
  {
2
2
  "name": "silgi",
3
3
  "type": "module",
4
- "version": "0.3.13",
4
+ "version": "0.4.0",
5
5
  "sideEffects": false,
6
6
  "exports": {
7
- ".": {
8
- "import": {
9
- "types": "./dist/index.d.mts",
10
- "default": "./dist/index.mjs"
11
- }
7
+ "./cli": {
8
+ "types": "./cli.d.ts",
9
+ "import": "./dist/cli/index.mjs"
12
10
  },
13
11
  "./config": {
14
- "types": "./dist/cli/config.d.mts",
15
- "import": "./dist/cli/config.mjs"
12
+ "types": "./config.d.ts",
13
+ "import": "./dist/config/index.mjs"
14
+ },
15
+ ".": {
16
+ "types": "./dist/core/index.d.ts",
17
+ "import": "./dist/core/index.mjs"
16
18
  },
17
19
  "./ecosystem/nitro": {
18
- "types": "./dist/ecosystem/nitro/index.d.mts",
20
+ "types": "./dist/ecosystem/nitro/index.d.ts",
19
21
  "import": "./dist/ecosystem/nitro/index.mjs"
20
22
  },
21
23
  "./ecosystem/nitro/runtime/*": {
@@ -23,42 +25,70 @@
23
25
  "import": "./dist/ecosystem/nitro/runtime/*.mjs"
24
26
  },
25
27
  "./ecosystem/nuxt/runtime/*": {
28
+ "silgi": "./dist/ecosystem/nuxt/runtime/**/*.ts",
29
+ "silgiTypes": "./dist/ecosystem/nuxt/runtime/**/*.ts",
26
30
  "types": "./dist/ecosystem/nuxt/runtime/*.d.ts",
27
31
  "import": "./dist/ecosystem/nuxt/runtime/*.mjs"
28
32
  },
29
33
  "./nuxt": {
30
- "types": "./dist/ecosystem/nuxt/module.d.mts",
34
+ "types": "./dist/ecosystem/nuxt/module.d.ts",
31
35
  "import": "./dist/ecosystem/nuxt/module.mjs"
32
- }
33
- },
34
- "module": "./dist/index.mjs",
35
- "types": "./dist/index.d.ts",
36
- "typesVersions": {
37
- "*": {
38
- "*": [
39
- "./dist/*"
40
- ],
41
- "modules/*": [
42
- "./dist/modules/*"
43
- ],
44
- "config": [
45
- "./dist/cli/config"
46
- ],
47
- "ecosystem/nuxt/runtime/*": [
48
- "./dist/ecosystem/nuxt/runtime/*"
49
- ],
50
- "ecosystem/nitro/runtime/*": [
51
- "./dist/ecosystem/nitro/runtime/*"
52
- ]
53
- }
36
+ },
37
+ "./meta": {
38
+ "types": "./dist/meta/index.d.ts",
39
+ "import": "./dist/meta/index.mjs"
40
+ },
41
+ "./types": {
42
+ "types": "./types.d.ts",
43
+ "import": "./dist/types/index.mjs"
44
+ },
45
+ "./kit": {
46
+ "types": "./kit.d.ts",
47
+ "import": "./dist/kit/index.mjs"
48
+ },
49
+ "./core": {
50
+ "types": "./core.d.ts",
51
+ "import": "./dist/core/index.mjs"
52
+ },
53
+ "./presets": {
54
+ "types": "./presets.d.ts",
55
+ "import": "./dist/presets/index.mjs"
56
+ },
57
+ "./runtime": {
58
+ "silgi": "./dist/runtime/*.ts",
59
+ "silgiTypes": "./dist/runtime/*.ts",
60
+ "types": "./runtime.d.ts",
61
+ "import": "./dist/runtime/index.mjs"
62
+ },
63
+ "./runtime/meta": {
64
+ "types": "./runtime-meta.d.ts",
65
+ "import": "./runtime-meta.mjs"
66
+ },
67
+ "./runtime/*": {
68
+ "silgi": "./dist/runtime/*.ts",
69
+ "silgiTypes": "./dist/runtime/*.ts",
70
+ "types": "./dist/runtime/*.d.ts",
71
+ "import": "./dist/runtime/*.mjs"
72
+ },
73
+ "./dist/runtime/*": {
74
+ "silgi": "./dist/runtime/*.ts",
75
+ "silgiTypes": "./dist/runtime/*.ts",
76
+ "types": "./dist/runtime/*.d.ts",
77
+ "import": "./dist/runtime/*.mjs"
78
+ },
79
+ "./package.json": "./package.json"
54
80
  },
81
+ "main": "./dist/core/index.mjs",
82
+ "types": "./dist/core/index.d.ts",
55
83
  "bin": {
56
- "silgi": "bin/silgi.mjs"
84
+ "silgi": "./dist/cli/index.mjs"
57
85
  },
58
86
  "files": [
87
+ "*.d.ts",
59
88
  "bin",
60
89
  "dist",
61
- "package.json"
90
+ "package.json",
91
+ "runtime-meta.*"
62
92
  ],
63
93
  "peerDependencies": {
64
94
  "@nuxt/kit": "^3.15.3",
@@ -91,22 +121,32 @@
91
121
  },
92
122
  "dependencies": {
93
123
  "@antfu/eslint-config": "^3.16.0",
124
+ "@graphql-tools/graphql-file-loader": "^8.0.12",
125
+ "@graphql-tools/load": "^8.0.12",
126
+ "@graphql-tools/schema": "^10.0.16",
127
+ "@graphql-tools/utils": "^10.7.2",
94
128
  "@nuxt/schema": "^3.15.2",
95
129
  "@oxc-parser/wasm": "^0.48.0",
96
130
  "@standard-schema/spec": "^1.0.0",
97
131
  "c12": "^2.0.1",
132
+ "chokidar": "^4.0.3",
98
133
  "citty": "^0.1.6",
134
+ "compatx": "^0.1.8",
99
135
  "consola": "^3.4.0",
100
136
  "defu": "^6.1.4",
137
+ "dot-prop": "^9.0.0",
138
+ "escape-string-regexp": "^5.0.0",
101
139
  "eslint": "^9.18.0",
102
140
  "esno": "^4.8.0",
103
141
  "globby": "^14.0.2",
142
+ "graphql": "^16.10.0",
104
143
  "hookable": "^5.5.3",
105
144
  "ignore": "^7.0.3",
106
145
  "jiti": "^2.4.2",
107
146
  "klona": "^2.0.6",
108
147
  "mlly": "^1.7.4",
109
148
  "ofetch": "^1.4.1",
149
+ "ohash": "^1.1.4",
110
150
  "pathe": "^2.0.2",
111
151
  "pkg-types": "^1.3.1",
112
152
  "scule": "^1.3.0",
@@ -121,9 +161,13 @@
121
161
  "untyped": "^1.5.2"
122
162
  },
123
163
  "devDependencies": {
164
+ "@graphql-codegen/core": "^4.0.2",
165
+ "@graphql-codegen/introspection": "^4.0.3",
124
166
  "@nuxt/kit": "^3.15.3",
125
167
  "@types/node": "^22.10.7",
126
168
  "@types/semver": "^7.5.8",
169
+ "@vitest/coverage-v8": "3.0.4",
170
+ "graphql-yoga": "^5.10.11",
127
171
  "h3": "^1.14.0",
128
172
  "nitropack": "^2.10.4",
129
173
  "nuxt": "^3.15.3",
@@ -133,17 +177,22 @@
133
177
  "zod": "^3.24.1"
134
178
  },
135
179
  "resolutions": {
136
- "@silgi/modules": "workspace:*",
137
- "silgi": "workspace:*"
180
+ "@silgi/module-builder": "link:./module-builder",
181
+ "@silgi/openapi": "link:./modules/openapi",
182
+ "@silgi/permission": "link:./modules/permission",
183
+ "@silgi/scalar": "link:./modules/scalar",
184
+ "@silgi/yoga": "link:./modules/yoga",
185
+ "silgi": "link:./"
138
186
  },
139
187
  "publishConfig": {
140
188
  "access": "public"
141
189
  },
142
190
  "scripts": {
143
- "build": "pnpm build:package && pnpm --filter ./modules... generate && pnpm build:module",
191
+ "build": "pnpm gen-presets && pnpm build:package && pnpm --filter './modules/*' generate && pnpm build:module",
192
+ "build:prepare": "pnpm gen-presets && pnpm build:package && pnpm --filter './modules/*' generate && pnpm build:prepare",
144
193
  "build:package": "unbuild",
145
194
  "build:module": "pnpm --filter '@silgi/*' build",
146
- "build:stub": "unbuild --stub",
195
+ "build:stub": "pnpm gen-presets && unbuild --stub && pnpm --filter './modules/*' build:stub && pnpm --filter './module-builder' build:stub",
147
196
  "dev:k6": "k6 run ./__tests__/k6.js",
148
197
  "test": "vitest",
149
198
  "test:coverage": "vitest run --coverage",
@@ -151,6 +200,7 @@
151
200
  "lint:fix": "eslint . --fix",
152
201
  "silgi": "tsx cli/index.ts",
153
202
  "pb": "pnpm unbuild && pnpm publish --no-git-checks --access public",
154
- "generate": "pnpm --filter ./playground... generate && pnpm --filter ./modules... generate && pnpm --filter ./ecosystem... generate && pnpm --filter ./examples/** generate"
203
+ "generate": "pnpm --filter './playground/*' silgi:prepare && pnpm --filter './modules/*' silgi:prepare && pnpm --filter './ecosystem/*' silgi:prepare && pnpm --filter './examples/**' silgi:prepare",
204
+ "gen-presets": "pnpm jiti scripts/gen-presets.ts"
155
205
  }
156
206
  }
package/presets.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/presets/index';
@@ -0,0 +1,4 @@
1
+ export declare const pkgDir: string
2
+ export declare const runtimeDir: string
3
+ export declare const subpaths: string[]
4
+ export declare const runtimeDependencies: string[]
@@ -0,0 +1,32 @@
1
+ import { fileURLToPath } from 'node:url'
2
+
3
+ export const pkgDir = fileURLToPath(new URL('.', import.meta.url))
4
+
5
+ export const runtimeDir = fileURLToPath(
6
+ new URL('dist/runtime/', import.meta.url),
7
+ )
8
+
9
+ export const runtimeDependencies = [
10
+ 'h3',
11
+ 'cookie-es',
12
+ 'defu',
13
+ 'destr',
14
+ 'hookable',
15
+ 'iron-webcrypto',
16
+ 'klona',
17
+ 'node-fetch-native',
18
+ 'ofetch',
19
+ 'ohash',
20
+ 'pathe',
21
+ 'radix3',
22
+ 'scule',
23
+ 'ufo',
24
+ 'db0',
25
+ 'std-env',
26
+ 'uncrypto',
27
+ 'unctx',
28
+ 'unenv',
29
+ 'unstorage',
30
+ 'crossws',
31
+ 'croner',
32
+ ]
package/runtime.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/runtime/index';
package/types.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/types/index';
package/bin/silgi.mjs DELETED
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- 'use strict'
3
- import '../dist/cli/index.mjs'