nitro-graphql 2.0.0-beta.70 → 2.0.0-beta.73
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/README.md +1 -1
- package/dist/cli/adapter.d.mts +0 -3
- package/dist/cli/adapter.mjs +7 -32
- package/dist/cli/commands/build.d.mts +2 -2
- package/dist/cli/commands/build.mjs +1 -3
- package/dist/cli/commands/dev.d.mts +2 -2
- package/dist/cli/commands/dev.mjs +1 -3
- package/dist/cli/commands/generate.mjs +10 -10
- package/dist/cli/commands/init.mjs +4 -4
- package/dist/cli/commands/validate.mjs +1 -3
- package/dist/cli/completions.mjs +1 -3
- package/dist/cli/config.d.mts +4 -5
- package/dist/cli/config.mjs +4 -3
- package/dist/cli/index.d.mts +3 -6
- package/dist/cli/index.mjs +2 -4
- package/dist/cli/server/debug-handler.mjs +2 -5
- package/dist/cli/server/dev-server.mjs +1 -3
- package/dist/cli/server/graphql-handler.mjs +3 -4
- package/dist/cli/server/health-handler.mjs +1 -2
- package/dist/cli/server/loader.mjs +1 -3
- package/dist/cli/server/sandbox-handler.mjs +1 -3
- package/dist/cli/server/watcher.mjs +2 -4
- package/dist/cli/server/ws-handler.mjs +1 -3
- package/dist/config.mjs +1 -2
- package/dist/core/codegen/client.d.mts +4 -27
- package/dist/core/codegen/client.mjs +26 -447
- package/dist/core/codegen/document-loader.mjs +1 -3
- package/dist/core/codegen/file-header.d.mts +7 -0
- package/dist/core/codegen/file-header.mjs +12 -0
- package/dist/core/codegen/index.d.mts +7 -5
- package/dist/core/codegen/index.mjs +7 -6
- package/dist/core/codegen/{runtime.d.mts → runtime-generator.d.mts} +1 -3
- package/dist/core/codegen/{runtime.mjs → runtime-generator.mjs} +7 -6
- package/dist/core/codegen/schema-loader.d.mts +2 -7
- package/dist/core/codegen/schema-loader.mjs +66 -73
- package/dist/core/codegen/server-type-helpers.d.mts +14 -0
- package/dist/core/codegen/server-type-helpers.mjs +76 -0
- package/dist/core/codegen/server.d.mts +1 -15
- package/dist/core/codegen/server.mjs +15 -107
- package/dist/core/codegen/subscription-extractor.d.mts +20 -0
- package/dist/core/codegen/subscription-extractor.mjs +30 -0
- package/dist/core/codegen/validation.mjs +1 -3
- package/dist/core/codegen/vue-subscription-builder.d.mts +10 -0
- package/dist/core/codegen/vue-subscription-builder.mjs +351 -0
- package/dist/core/constants.d.mts +5 -53
- package/dist/core/constants.mjs +13 -56
- package/dist/core/create-config.d.mts +31 -0
- package/dist/core/create-config.mjs +42 -0
- package/dist/core/debug/index.d.mts +2 -2
- package/dist/core/debug/index.mjs +2 -3
- package/dist/core/debug/template.d.mts +1 -5
- package/dist/core/debug/template.mjs +5 -4
- package/dist/core/extend/index.mjs +1 -2
- package/dist/core/extend/loader.d.mts +0 -1
- package/dist/core/extend/loader.mjs +60 -92
- package/dist/core/index.d.mts +22 -21
- package/dist/core/index.mjs +19 -16
- package/dist/core/manifest.mjs +4 -4
- package/dist/core/pubsub/index.d.mts +2 -109
- package/dist/core/pubsub/index.mjs +2 -148
- package/dist/core/pubsub/memory-pubsub.d.mts +109 -0
- package/dist/core/pubsub/memory-pubsub.mjs +146 -0
- package/dist/core/scanning/ast-scanner.mjs +5 -5
- package/dist/core/scanning/directives.mjs +3 -5
- package/dist/core/scanning/documents.d.mts +4 -3
- package/dist/core/scanning/documents.mjs +4 -5
- package/dist/core/scanning/{common.d.mts → file-scanner.d.mts} +1 -1
- package/dist/core/scanning/{common.mjs → file-scanner.mjs} +3 -13
- package/dist/core/scanning/index.d.mts +3 -3
- package/dist/core/scanning/index.mjs +3 -4
- package/dist/core/scanning/resolvers.mjs +9 -11
- package/dist/core/scanning/schemas.d.mts +1 -5
- package/dist/core/scanning/schemas.mjs +2 -26
- package/dist/core/schema/builder.d.mts +4 -2
- package/dist/core/schema/builder.mjs +4 -4
- package/dist/core/schema/federation.mjs +1 -3
- package/dist/core/schema/index.d.mts +2 -2
- package/dist/core/schema/index.mjs +2 -3
- package/dist/core/server/apollo.d.mts +20 -0
- package/dist/core/server/apollo.mjs +54 -0
- package/dist/core/server/index.d.mts +4 -2
- package/dist/core/server/index.mjs +3 -3
- package/dist/core/server/sandbox.mjs +1 -2
- package/dist/core/server/types.d.mts +7 -14
- package/dist/core/server/types.mjs +15 -1
- package/dist/core/server/yoga.d.mts +1 -7
- package/dist/core/server/yoga.mjs +4 -15
- package/dist/core/types/adapter.d.mts +3 -40
- package/dist/core/types/adapter.mjs +1 -1
- package/dist/core/types/codegen.d.mts +22 -45
- package/dist/core/types/codegen.mjs +1 -1
- package/dist/core/types/config.d.mts +33 -121
- package/dist/core/types/config.mjs +1 -1
- package/dist/core/types/define.d.mts +8 -5
- package/dist/core/types/define.mjs +1 -1
- package/dist/core/types/index.d.mts +5 -4
- package/dist/core/types/index.mjs +1 -1
- package/dist/core/types/scanning.d.mts +4 -1
- package/dist/core/types/scanning.mjs +1 -1
- package/dist/core/types/standard-schema.d.mts +64 -0
- package/dist/core/types/standard-schema.mjs +1 -0
- package/dist/core/utils/directive-parser.d.mts +8 -63
- package/dist/core/utils/directive-parser.mjs +114 -167
- package/dist/core/utils/errors.mjs +1 -3
- package/dist/core/utils/file-io.d.mts +1 -5
- package/dist/core/utils/file-io.mjs +1 -13
- package/dist/core/utils/imports.mjs +3 -4
- package/dist/core/utils/index.d.mts +5 -4
- package/dist/core/utils/index.mjs +6 -6
- package/dist/core/utils/logger.d.mts +1 -10
- package/dist/core/utils/logger.mjs +1 -21
- package/dist/core/utils/ofetch-templates.mjs +4 -6
- package/dist/core/utils/runtime.d.mts +1 -30
- package/dist/core/utils/runtime.mjs +2 -46
- package/dist/core/utils/string.d.mts +10 -0
- package/dist/core/utils/string.mjs +12 -0
- package/dist/core/utils/subscribe-templates.mjs +1 -2
- package/dist/core/validation/external-services.mjs +3 -3
- package/dist/core/validation/index.mjs +1 -2
- package/dist/core/watcher/create-watcher.d.mts +103 -0
- package/dist/core/watcher/create-watcher.mjs +143 -0
- package/dist/core/watcher/index.d.mts +2 -107
- package/dist/core/watcher/index.mjs +2 -141
- package/dist/define.d.mts +4 -2
- package/dist/define.mjs +8 -9
- package/dist/index.d.mts +4 -3
- package/dist/index.mjs +3 -4
- package/dist/nitro/adapter.d.mts +6 -11
- package/dist/nitro/adapter.mjs +12 -45
- package/dist/nitro/apollo.mjs +1 -3
- package/dist/nitro/codegen/client-types.d.mts +12 -0
- package/dist/nitro/codegen/client-types.mjs +73 -0
- package/dist/nitro/codegen/external-types.d.mts +8 -0
- package/dist/nitro/codegen/external-types.mjs +47 -0
- package/dist/nitro/codegen/index.d.mts +4 -0
- package/dist/nitro/codegen/index.mjs +4 -0
- package/dist/nitro/codegen/server-types.d.mts +12 -0
- package/dist/nitro/codegen/server-types.mjs +81 -0
- package/dist/nitro/defaults.d.mts +28 -0
- package/dist/nitro/defaults.mjs +34 -0
- package/dist/nitro/index.d.mts +11 -3
- package/dist/nitro/index.mjs +4 -6
- package/dist/nitro/paths.d.mts +3 -2
- package/dist/nitro/paths.mjs +14 -5
- package/dist/nitro/rollup.mjs +8 -8
- package/dist/nitro/routes/_ws-handler.d.mts +6 -0
- package/dist/nitro/routes/_ws-handler.mjs +49 -0
- package/dist/nitro/routes/apollo-sandbox-script.d.mts +2 -2
- package/dist/nitro/routes/apollo-sandbox-script.mjs +1 -3
- package/dist/nitro/routes/apollo-server-ws.d.mts +1 -1
- package/dist/nitro/routes/apollo-server-ws.mjs +10 -48
- package/dist/nitro/routes/apollo-server.d.mts +2 -2
- package/dist/nitro/routes/apollo-server.mjs +17 -58
- package/dist/nitro/routes/debug.d.mts +2 -2
- package/dist/nitro/routes/debug.mjs +4 -7
- package/dist/nitro/routes/graphql-yoga-ws.d.mts +3 -3
- package/dist/nitro/routes/graphql-yoga-ws.mjs +7 -48
- package/dist/nitro/routes/graphql-yoga.d.mts +2 -2
- package/dist/nitro/routes/graphql-yoga.mjs +8 -8
- package/dist/nitro/routes/health.d.mts +2 -2
- package/dist/nitro/routes/health.mjs +23 -27
- package/dist/nitro/setup/extend-loader.d.mts +6 -5
- package/dist/nitro/setup/extend-loader.mjs +31 -61
- package/dist/nitro/setup/file-watcher.mjs +9 -8
- package/dist/nitro/setup/logging.d.mts +1 -8
- package/dist/nitro/setup/logging.mjs +7 -24
- package/dist/nitro/setup/rollup-integration.mjs +36 -4
- package/dist/nitro/setup/routes.mjs +1 -3
- package/dist/nitro/setup/scanner.d.mts +8 -43
- package/dist/nitro/setup/scanner.mjs +56 -60
- package/dist/nitro/setup/security.d.mts +10 -0
- package/dist/nitro/setup/security.mjs +17 -0
- package/dist/nitro/setup/ts-config.mjs +1 -3
- package/dist/nitro/setup/type-generation.d.mts +13 -0
- package/dist/nitro/setup/type-generation.mjs +16 -0
- package/dist/nitro/setup.d.mts +4 -3
- package/dist/nitro/setup.mjs +88 -77
- package/dist/nitro/state.d.mts +32 -0
- package/dist/nitro/state.mjs +58 -0
- package/dist/nitro/types/augmentation.d.mts +59 -0
- package/dist/nitro/types/augmentation.mjs +1 -0
- package/dist/nitro/types/config.d.mts +327 -0
- package/dist/nitro/types/config.mjs +1 -0
- package/dist/nitro/types/define.d.mts +13 -0
- package/dist/nitro/types/define.mjs +1 -0
- package/dist/nitro/types/index.d.mts +10 -0
- package/dist/nitro/types/index.mjs +1 -0
- package/dist/nitro/virtual/debug-info.d.mts +9 -0
- package/dist/nitro/virtual/debug-info.mjs +35 -0
- package/dist/nitro/virtual/graphql-config.d.mts +9 -0
- package/dist/nitro/virtual/graphql-config.mjs +33 -0
- package/dist/nitro/virtual/index.d.mts +25 -0
- package/dist/nitro/virtual/index.mjs +45 -0
- package/dist/nitro/virtual/module-config.d.mts +9 -0
- package/dist/nitro/virtual/module-config.mjs +10 -0
- package/dist/nitro/virtual/pubsub.d.mts +9 -0
- package/dist/nitro/virtual/pubsub.mjs +17 -0
- package/dist/nitro/virtual/server-directives.d.mts +9 -0
- package/dist/nitro/virtual/server-directives.mjs +12 -0
- package/dist/nitro/virtual/server-resolvers.d.mts +9 -0
- package/dist/nitro/virtual/server-resolvers.mjs +17 -0
- package/dist/nitro/virtual/server-schemas.d.mts +9 -0
- package/dist/nitro/virtual/server-schemas.mjs +31 -0
- package/dist/nitro/virtual/stubs.d.mts +42 -10
- package/dist/nitro/virtual/stubs.mjs +1 -7
- package/dist/nitro/virtual/utils.d.mts +15 -0
- package/dist/nitro/virtual/utils.mjs +26 -0
- package/dist/nitro/virtual/validation-schemas.d.mts +9 -0
- package/dist/nitro/virtual/validation-schemas.mjs +33 -0
- package/dist/nuxt.mjs +4 -5
- package/dist/stubs/index.mjs +1 -1
- package/dist/subscribe/index.mjs +3 -4
- package/native/index.js +52 -52
- package/package.json +41 -41
- package/dist/cli/commands/index.d.mts +0 -5
- package/dist/cli/commands/index.mjs +0 -6
- package/dist/core/codegen/plugin.d.mts +0 -19
- package/dist/core/codegen/plugin.mjs +0 -30
- package/dist/core/config.d.mts +0 -45
- package/dist/core/config.mjs +0 -78
- package/dist/nitro/codegen.d.mts +0 -18
- package/dist/nitro/codegen.mjs +0 -173
- package/dist/nitro/config.d.mts +0 -50
- package/dist/nitro/config.mjs +0 -57
- package/dist/nitro/types.d.mts +0 -549
- package/dist/nitro/types.mjs +0 -1
- package/dist/nitro/virtual/generators.d.mts +0 -38
- package/dist/nitro/virtual/generators.mjs +0 -192
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nitro-graphql",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.73",
|
|
5
5
|
"description": "GraphQL integration for Nitro",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
"graphql": "^16.12.0",
|
|
141
141
|
"graphql-sse": "^2.6.0",
|
|
142
142
|
"graphql-ws": "^6.0.6",
|
|
143
|
-
"nitro": "^3.0.
|
|
143
|
+
"nitro": "^3.0.260311-beta"
|
|
144
144
|
},
|
|
145
145
|
"peerDependenciesMeta": {
|
|
146
146
|
"@apollo/server": {
|
|
@@ -157,16 +157,16 @@
|
|
|
157
157
|
}
|
|
158
158
|
},
|
|
159
159
|
"dependencies": {
|
|
160
|
-
"@apollo/subgraph": "^2.13.
|
|
161
|
-
"@bomb.sh/tab": "^0.0.
|
|
162
|
-
"@graphql-codegen/core": "^5.0.
|
|
163
|
-
"@graphql-codegen/import-types-preset": "^
|
|
164
|
-
"@graphql-codegen/typed-document-node": "^6.1.
|
|
165
|
-
"@graphql-codegen/typescript": "^5.0.
|
|
166
|
-
"@graphql-codegen/typescript-generic-sdk": "^
|
|
167
|
-
"@graphql-codegen/typescript-operations": "^5.0.
|
|
168
|
-
"@graphql-codegen/typescript-resolvers": "^5.1.
|
|
169
|
-
"@graphql-tools/graphql-file-loader": "^8.1.
|
|
160
|
+
"@apollo/subgraph": "^2.13.2",
|
|
161
|
+
"@bomb.sh/tab": "^0.0.14",
|
|
162
|
+
"@graphql-codegen/core": "^5.0.1",
|
|
163
|
+
"@graphql-codegen/import-types-preset": "^4.0.0",
|
|
164
|
+
"@graphql-codegen/typed-document-node": "^6.1.7",
|
|
165
|
+
"@graphql-codegen/typescript": "^5.0.9",
|
|
166
|
+
"@graphql-codegen/typescript-generic-sdk": "^5.0.0",
|
|
167
|
+
"@graphql-codegen/typescript-operations": "^5.0.9",
|
|
168
|
+
"@graphql-codegen/typescript-resolvers": "^5.1.7",
|
|
169
|
+
"@graphql-tools/graphql-file-loader": "^8.1.12",
|
|
170
170
|
"@graphql-tools/load": "^8.1.8",
|
|
171
171
|
"@graphql-tools/load-files": "^7.0.1",
|
|
172
172
|
"@graphql-tools/merge": "^9.1.7",
|
|
@@ -175,55 +175,55 @@
|
|
|
175
175
|
"@graphql-tools/utils": "^11.0.0",
|
|
176
176
|
"c12": "^3.3.3",
|
|
177
177
|
"chokidar": "^5.0.0",
|
|
178
|
-
"citty": "^0.2.
|
|
178
|
+
"citty": "^0.2.1",
|
|
179
179
|
"consola": "^3.4.2",
|
|
180
180
|
"defu": "^6.1.4",
|
|
181
|
-
"giget": "^3.1.
|
|
182
|
-
"graphql-config": "^5.1.
|
|
181
|
+
"giget": "^3.1.2",
|
|
182
|
+
"graphql-config": "^5.1.6",
|
|
183
183
|
"graphql-scalars": "^1.25.0",
|
|
184
184
|
"knitwork": "^1.3.0",
|
|
185
|
-
"mlly": "^1.8.
|
|
185
|
+
"mlly": "^1.8.1",
|
|
186
186
|
"ofetch": "^2.0.0-alpha.3",
|
|
187
187
|
"ohash": "^2.0.11",
|
|
188
|
-
"oxc-parser": "^0.
|
|
188
|
+
"oxc-parser": "^0.120.0",
|
|
189
189
|
"pathe": "^2.0.3",
|
|
190
190
|
"perfect-debounce": "^2.1.0",
|
|
191
|
-
"srvx": "^0.
|
|
191
|
+
"srvx": "^0.11.12",
|
|
192
192
|
"tinyglobby": "^0.2.15"
|
|
193
193
|
},
|
|
194
194
|
"devDependencies": {
|
|
195
|
-
"@antfu/eslint-config": "^7.
|
|
195
|
+
"@antfu/eslint-config": "^7.7.3",
|
|
196
196
|
"@napi-rs/cli": "^3.5.1",
|
|
197
|
-
"@nuxt/kit": "
|
|
198
|
-
"@nuxt/schema": "
|
|
199
|
-
"@types/node": "^25.0
|
|
197
|
+
"@nuxt/kit": "npm:@nuxt/kit-nightly@5x",
|
|
198
|
+
"@nuxt/schema": "npm:@nuxt/schema-nightly@5x",
|
|
199
|
+
"@types/node": "^25.5.0",
|
|
200
200
|
"@types/ws": "^8.18.1",
|
|
201
201
|
"@typescript/native-preview": "latest",
|
|
202
|
-
"@vitejs/devtools": "^0.
|
|
203
|
-
"@vitest/coverage-v8": "^4.0
|
|
204
|
-
"@vitest/ui": "^4.0
|
|
205
|
-
"bumpp": "^
|
|
202
|
+
"@vitejs/devtools": "^0.1.3",
|
|
203
|
+
"@vitest/coverage-v8": "^4.1.0",
|
|
204
|
+
"@vitest/ui": "^4.1.0",
|
|
205
|
+
"bumpp": "^11.0.1",
|
|
206
206
|
"changelogen": "^0.6.2",
|
|
207
207
|
"crossws": "^0.4.4",
|
|
208
|
-
"eslint": "^
|
|
209
|
-
"graphql": "^16.
|
|
210
|
-
"graphql-yoga": "^5.18.
|
|
211
|
-
"nitro": "^3.0.
|
|
212
|
-
"nuxt": "
|
|
213
|
-
"tsdown": "^0.
|
|
208
|
+
"eslint": "^10.0.3",
|
|
209
|
+
"graphql": "^16.13.1",
|
|
210
|
+
"graphql-yoga": "^5.18.1",
|
|
211
|
+
"nitro": "^3.0.260311-beta",
|
|
212
|
+
"nuxt": "npm:nuxt-nightly@5x",
|
|
213
|
+
"tsdown": "^0.21.4",
|
|
214
214
|
"typescript": "^5.9.3",
|
|
215
|
-
"vite": "8.0.0
|
|
216
|
-
"vitepress-plugin-llms": "^1.
|
|
217
|
-
"vitest": "^4.0
|
|
215
|
+
"vite": "^8.0.0",
|
|
216
|
+
"vitepress-plugin-llms": "^1.11.1",
|
|
217
|
+
"vitest": "^4.1.0",
|
|
218
218
|
"ws": "^8.19.0"
|
|
219
219
|
},
|
|
220
220
|
"overrides": {
|
|
221
|
-
"graphql": "^16.
|
|
222
|
-
"nitro": "^3.0.
|
|
221
|
+
"graphql": "^16.13.1",
|
|
222
|
+
"nitro": "^3.0.260311-beta"
|
|
223
223
|
},
|
|
224
224
|
"resolutions": {
|
|
225
|
-
"graphql": "^16.
|
|
226
|
-
"nitro": "^3.0.
|
|
225
|
+
"graphql": "^16.13.1",
|
|
226
|
+
"nitro": "^3.0.260311-beta",
|
|
227
227
|
"nitro-graphql": "link:."
|
|
228
228
|
},
|
|
229
229
|
"optionalDependencies": {
|
|
@@ -237,8 +237,8 @@
|
|
|
237
237
|
"build": "pnpm build:native && tsdown",
|
|
238
238
|
"build:native": "cd native && napi build --platform --release --esm",
|
|
239
239
|
"dev": "tsdown --watch",
|
|
240
|
-
"bumpp": "bumpp package.json native/package.json",
|
|
241
|
-
"release": "
|
|
240
|
+
"bumpp": "bumpp package.json native/package.json native/npm/*/package.json",
|
|
241
|
+
"release": "tsdown && pnpm bumpp",
|
|
242
242
|
"playground:nitro": "cd playgrounds/nitro && pnpm install && pnpm dev",
|
|
243
243
|
"playground:nuxt": "cd playgrounds/nuxt && pnpm install && pnpm dev",
|
|
244
244
|
"playground:federation": "cd playgrounds/federation && pnpm install && pnpm dev",
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { buildCommand } from "./build.mjs";
|
|
2
|
-
import { generateAll, generateClient, generateServer } from "./generate.mjs";
|
|
3
|
-
import { init } from "./init.mjs";
|
|
4
|
-
import { validate } from "./validate.mjs";
|
|
5
|
-
export { buildCommand, generateAll, generateClient, generateServer, init, validate };
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { init } from "./init.mjs";
|
|
2
|
-
import { generateAll, generateClient, generateServer } from "./generate.mjs";
|
|
3
|
-
import { validate } from "./validate.mjs";
|
|
4
|
-
import { buildCommand } from "./build.mjs";
|
|
5
|
-
|
|
6
|
-
export { buildCommand, generateAll, generateClient, generateServer, init, validate };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Source } from "@graphql-tools/utils";
|
|
2
|
-
import { GraphQLSchema } from "graphql";
|
|
3
|
-
|
|
4
|
-
//#region src/core/codegen/plugin.d.ts
|
|
5
|
-
/**
|
|
6
|
-
* Plugin to add prepend comments to generated files
|
|
7
|
-
* Used by both server and client codegen
|
|
8
|
-
*/
|
|
9
|
-
declare function pluginContent(_schema: GraphQLSchema, _documents: Source[], _config: Record<string, unknown> | undefined, _info: Record<string, unknown> | undefined): {
|
|
10
|
-
prepend: string[];
|
|
11
|
-
content: string;
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* Generate the prepend header for generated files
|
|
15
|
-
* Can be used when creating files manually without codegen
|
|
16
|
-
*/
|
|
17
|
-
declare const GENERATED_FILE_HEADER = "// THIS FILE IS GENERATED, DO NOT EDIT!\n/* eslint-disable eslint-comments/no-unlimited-disable */\n/* tslint:disable */\n/* eslint-disable */\n/* prettier-ignore */\n";
|
|
18
|
-
//#endregion
|
|
19
|
-
export { GENERATED_FILE_HEADER, pluginContent };
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
//#region src/core/codegen/plugin.ts
|
|
2
|
-
/**
|
|
3
|
-
* Plugin to add prepend comments to generated files
|
|
4
|
-
* Used by both server and client codegen
|
|
5
|
-
*/
|
|
6
|
-
function pluginContent(_schema, _documents, _config, _info) {
|
|
7
|
-
return {
|
|
8
|
-
prepend: [
|
|
9
|
-
"// THIS FILE IS GENERATED, DO NOT EDIT!",
|
|
10
|
-
"/* eslint-disable eslint-comments/no-unlimited-disable */",
|
|
11
|
-
"/* tslint:disable */",
|
|
12
|
-
"/* eslint-disable */",
|
|
13
|
-
"/* prettier-ignore */"
|
|
14
|
-
],
|
|
15
|
-
content: ""
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Generate the prepend header for generated files
|
|
20
|
-
* Can be used when creating files manually without codegen
|
|
21
|
-
*/
|
|
22
|
-
const GENERATED_FILE_HEADER = `// THIS FILE IS GENERATED, DO NOT EDIT!
|
|
23
|
-
/* eslint-disable eslint-comments/no-unlimited-disable */
|
|
24
|
-
/* tslint:disable */
|
|
25
|
-
/* eslint-disable */
|
|
26
|
-
/* prettier-ignore */
|
|
27
|
-
`;
|
|
28
|
-
|
|
29
|
-
//#endregion
|
|
30
|
-
export { GENERATED_FILE_HEADER, pluginContent };
|
package/dist/core/config.d.mts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { CoreConfig, CoreContext, CoreGraphQLOptions, CoreLogger } from "./types/config.mjs";
|
|
2
|
-
import { ScanContext } from "./types/scanning.mjs";
|
|
3
|
-
|
|
4
|
-
//#region src/core/config.d.ts
|
|
5
|
-
/**
|
|
6
|
-
* Options for creating a CoreConfig
|
|
7
|
-
*/
|
|
8
|
-
interface CreateCoreConfigOptions {
|
|
9
|
-
/** Root directory of the project */
|
|
10
|
-
rootDir: string;
|
|
11
|
-
/** Build directory (optional, defaults based on framework) */
|
|
12
|
-
buildDir?: string;
|
|
13
|
-
/** Server GraphQL directory (optional) */
|
|
14
|
-
serverDir?: string;
|
|
15
|
-
/** Client GraphQL directory (optional) */
|
|
16
|
-
clientDir?: string;
|
|
17
|
-
/** Whether running in Nuxt context */
|
|
18
|
-
isNuxt?: boolean;
|
|
19
|
-
/** Whether running in development mode */
|
|
20
|
-
isDev?: boolean;
|
|
21
|
-
/** GraphQL options */
|
|
22
|
-
graphqlOptions?: CoreGraphQLOptions;
|
|
23
|
-
/** Custom logger */
|
|
24
|
-
logger?: CoreLogger;
|
|
25
|
-
/** Patterns to ignore */
|
|
26
|
-
ignorePatterns?: string[];
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Create a CoreConfig with sensible defaults
|
|
30
|
-
*/
|
|
31
|
-
declare function createCoreConfig(options: CreateCoreConfigOptions): CoreConfig;
|
|
32
|
-
/**
|
|
33
|
-
* Create a CoreContext from CoreConfig
|
|
34
|
-
*/
|
|
35
|
-
declare function createCoreContext(config: CoreConfig): CoreContext;
|
|
36
|
-
/**
|
|
37
|
-
* Create a ScanContext from CoreConfig
|
|
38
|
-
*/
|
|
39
|
-
declare function createScanContext(config: CoreConfig): ScanContext;
|
|
40
|
-
/**
|
|
41
|
-
* Merge GraphQL options with defaults
|
|
42
|
-
*/
|
|
43
|
-
declare function mergeGraphQLOptions(options: Partial<CoreGraphQLOptions>, defaults?: Partial<CoreGraphQLOptions>): CoreGraphQLOptions;
|
|
44
|
-
//#endregion
|
|
45
|
-
export { CreateCoreConfigOptions, createCoreConfig, createCoreContext, createScanContext, mergeGraphQLOptions };
|
package/dist/core/config.mjs
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { DIR_APP_GRAPHQL, DIR_BUILD_NITRO, DIR_CLIENT_GRAPHQL, DIR_SERVER_GRAPHQL, GRAPHQL_FRAMEWORK_YOGA } from "./constants.mjs";
|
|
2
|
-
import { createLogger } from "./utils/logger.mjs";
|
|
3
|
-
import { relative, resolve } from "pathe";
|
|
4
|
-
|
|
5
|
-
//#region src/core/config.ts
|
|
6
|
-
/**
|
|
7
|
-
* Create a CoreConfig with sensible defaults
|
|
8
|
-
*/
|
|
9
|
-
function createCoreConfig(options) {
|
|
10
|
-
const { rootDir, isNuxt = false, isDev = process.env.NODE_ENV !== "production", graphqlOptions = {}, logger = createLogger(), ignorePatterns = [] } = options;
|
|
11
|
-
const framework = graphqlOptions.framework || GRAPHQL_FRAMEWORK_YOGA;
|
|
12
|
-
const buildDir = options.buildDir || resolve(rootDir, isNuxt ? ".nuxt" : DIR_BUILD_NITRO);
|
|
13
|
-
return {
|
|
14
|
-
rootDir,
|
|
15
|
-
buildDir,
|
|
16
|
-
serverDir: options.serverDir || resolve(rootDir, DIR_SERVER_GRAPHQL),
|
|
17
|
-
clientDir: options.clientDir || resolve(rootDir, isNuxt ? DIR_APP_GRAPHQL : DIR_CLIENT_GRAPHQL),
|
|
18
|
-
typesDir: resolve(buildDir, "types"),
|
|
19
|
-
framework,
|
|
20
|
-
isNuxt,
|
|
21
|
-
isDev,
|
|
22
|
-
graphqlOptions,
|
|
23
|
-
logger,
|
|
24
|
-
ignorePatterns
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Create a CoreContext from CoreConfig
|
|
29
|
-
*/
|
|
30
|
-
function createCoreContext(config) {
|
|
31
|
-
return {
|
|
32
|
-
config,
|
|
33
|
-
graphqlBuildDir: resolve(config.buildDir, "graphql"),
|
|
34
|
-
watchDirs: [],
|
|
35
|
-
dir: {
|
|
36
|
-
build: relative(config.rootDir, config.buildDir),
|
|
37
|
-
client: relative(config.rootDir, config.clientDir),
|
|
38
|
-
server: relative(config.rootDir, config.serverDir)
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Create a ScanContext from CoreConfig
|
|
44
|
-
*/
|
|
45
|
-
function createScanContext(config) {
|
|
46
|
-
return {
|
|
47
|
-
rootDir: config.rootDir,
|
|
48
|
-
serverDir: config.serverDir,
|
|
49
|
-
clientDir: config.clientDir,
|
|
50
|
-
ignorePatterns: config.ignorePatterns,
|
|
51
|
-
isDev: config.isDev,
|
|
52
|
-
logger: config.logger
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Merge GraphQL options with defaults
|
|
57
|
-
*/
|
|
58
|
-
function mergeGraphQLOptions(options, defaults = {}) {
|
|
59
|
-
return {
|
|
60
|
-
...defaults,
|
|
61
|
-
...options,
|
|
62
|
-
codegen: {
|
|
63
|
-
...defaults.codegen,
|
|
64
|
-
...options.codegen
|
|
65
|
-
},
|
|
66
|
-
security: {
|
|
67
|
-
...defaults.security,
|
|
68
|
-
...options.security
|
|
69
|
-
},
|
|
70
|
-
paths: {
|
|
71
|
-
...defaults.paths,
|
|
72
|
-
...options.paths
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
//#endregion
|
|
78
|
-
export { createCoreConfig, createCoreContext, createScanContext, mergeGraphQLOptions };
|
package/dist/nitro/codegen.d.mts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Nitro } from "nitro/types";
|
|
2
|
-
|
|
3
|
-
//#region src/nitro/codegen.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* Generate server-side resolver types
|
|
6
|
-
*/
|
|
7
|
-
declare function generateServerTypes(nitro: Nitro, options?: {
|
|
8
|
-
silent?: boolean;
|
|
9
|
-
}): Promise<void>;
|
|
10
|
-
/**
|
|
11
|
-
* Generate client-side operation types
|
|
12
|
-
*/
|
|
13
|
-
declare function generateClientTypes(nitro: Nitro, options?: {
|
|
14
|
-
silent?: boolean;
|
|
15
|
-
isInitial?: boolean;
|
|
16
|
-
}): Promise<void>;
|
|
17
|
-
//#endregion
|
|
18
|
-
export { generateClientTypes, generateServerTypes };
|
package/dist/nitro/codegen.mjs
DELETED
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
import { LOG_TAG } from "../core/constants.mjs";
|
|
2
|
-
import { loadGraphQLDocuments } from "../core/codegen/document-loader.mjs";
|
|
3
|
-
import { writeFile } from "../core/utils/file-io.mjs";
|
|
4
|
-
import { downloadAndSaveSchema, loadExternalSchema } from "../core/codegen/schema-loader.mjs";
|
|
5
|
-
import { generateClientTypesCore, generateExternalClientTypesCore, generateSubscriptionBuilder } from "../core/codegen/client.mjs";
|
|
6
|
-
import { generateServerTypesCore } from "../core/codegen/server.mjs";
|
|
7
|
-
import { validateNoDuplicateTypes } from "../core/codegen/validation.mjs";
|
|
8
|
-
import { loadFederationSupport } from "../core/schema/federation.mjs";
|
|
9
|
-
import { subscribeClientTemplate } from "../core/utils/subscribe-templates.mjs";
|
|
10
|
-
import { getDefaultPaths, getSdkConfig, getTypesConfig, resolveFilePath, shouldGenerateTypes } from "./paths.mjs";
|
|
11
|
-
import consola from "consola";
|
|
12
|
-
import { join, resolve } from "pathe";
|
|
13
|
-
import { printSchemaWithDirectives } from "@graphql-tools/utils";
|
|
14
|
-
import { parse, print } from "graphql";
|
|
15
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
16
|
-
import { mergeTypeDefs } from "@graphql-tools/merge";
|
|
17
|
-
import { makeExecutableSchema } from "@graphql-tools/schema";
|
|
18
|
-
import { loadFilesSync } from "@graphql-tools/load-files";
|
|
19
|
-
|
|
20
|
-
//#region src/nitro/codegen.ts
|
|
21
|
-
const logger = consola.withTag(LOG_TAG);
|
|
22
|
-
async function buildSchemaFromString(source, federation) {
|
|
23
|
-
if (federation) {
|
|
24
|
-
const buildSubgraph = await loadFederationSupport();
|
|
25
|
-
if (!buildSubgraph) throw new Error("Federation enabled but @apollo/subgraph not installed");
|
|
26
|
-
return buildSubgraph([{ typeDefs: parse(source) }]);
|
|
27
|
-
}
|
|
28
|
-
return makeExecutableSchema({ typeDefs: source });
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Generate server-side resolver types
|
|
32
|
-
*/
|
|
33
|
-
async function generateServerTypes(nitro, options = {}) {
|
|
34
|
-
if (!shouldGenerateTypes(nitro)) return;
|
|
35
|
-
const schemas = nitro.scanSchemas || [];
|
|
36
|
-
if (!schemas.length) {
|
|
37
|
-
if (!options.silent) consola.info("No GraphQL schemas found");
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
try {
|
|
41
|
-
const allStrings = loadFilesSync(schemas).map((s) => typeof s === "string" ? s : s.loc?.source?.body || "");
|
|
42
|
-
const validSchemas = [];
|
|
43
|
-
const strings = [];
|
|
44
|
-
schemas.forEach((schema, i) => {
|
|
45
|
-
if (allStrings[i]) {
|
|
46
|
-
validSchemas.push(schema);
|
|
47
|
-
strings.push(allStrings[i]);
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
const directiveSchemas = nitro.graphql.directiveSchemas;
|
|
51
|
-
if (directiveSchemas) {
|
|
52
|
-
validSchemas.push("<directives>");
|
|
53
|
-
strings.push(directiveSchemas);
|
|
54
|
-
}
|
|
55
|
-
if (!validateNoDuplicateTypes(validSchemas, strings)) return;
|
|
56
|
-
const mergedSchemaString = print(mergeTypeDefs([strings.join("\n\n")], {
|
|
57
|
-
throwOnConflict: true,
|
|
58
|
-
sort: true
|
|
59
|
-
}));
|
|
60
|
-
const federation = nitro.options.graphql?.federation?.enabled === true;
|
|
61
|
-
const sortedSchemaString = printSchemaWithDirectives(await buildSchemaFromString(mergedSchemaString, federation));
|
|
62
|
-
const result = await generateServerTypesCore({
|
|
63
|
-
framework: nitro.options.graphql?.framework || "graphql-yoga",
|
|
64
|
-
schemaString: sortedSchemaString,
|
|
65
|
-
config: nitro.options.graphql?.codegen?.server,
|
|
66
|
-
federationEnabled: federation
|
|
67
|
-
});
|
|
68
|
-
writeFile(resolve(nitro.graphql.buildDir, "schema.graphql"), sortedSchemaString);
|
|
69
|
-
const placeholders = getDefaultPaths(nitro);
|
|
70
|
-
const typesConfig = getTypesConfig(nitro);
|
|
71
|
-
const typesPath = resolveFilePath(typesConfig.server, typesConfig.enabled, true, "{typesDir}/nitro-graphql-server.d.ts", placeholders);
|
|
72
|
-
if (typesPath) {
|
|
73
|
-
writeFile(typesPath, result.types);
|
|
74
|
-
if (!options.silent) logger.success(`Server types: ${typesPath}`);
|
|
75
|
-
}
|
|
76
|
-
} catch (error) {
|
|
77
|
-
logger.error("Server type generation failed:", error);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Generate client-side operation types
|
|
82
|
-
*/
|
|
83
|
-
async function generateClientTypes(nitro, options = {}) {
|
|
84
|
-
try {
|
|
85
|
-
if (nitro.scanSchemas?.length) await generateMainClientTypes(nitro, options);
|
|
86
|
-
if (nitro.options.graphql?.externalServices?.length) await generateExternalTypes(nitro, options);
|
|
87
|
-
} catch (error) {
|
|
88
|
-
logger.error("Client type generation failed:", error);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
async function generateMainClientTypes(nitro, options = {}) {
|
|
92
|
-
const schemaPath = join(nitro.graphql.buildDir, "schema.graphql");
|
|
93
|
-
if (!existsSync(schemaPath)) {
|
|
94
|
-
if (!options.silent) consola.info("Schema not ready for client types");
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
const docs = await loadGraphQLDocuments(nitro.scanDocuments);
|
|
98
|
-
const schemaString = readFileSync(schemaPath, "utf-8");
|
|
99
|
-
const serverScalars = nitro.options.graphql?.codegen?.server?.scalars;
|
|
100
|
-
const clientConfig = nitro.options.graphql?.codegen?.client || {};
|
|
101
|
-
const types = await generateClientTypesCore({
|
|
102
|
-
schemaString,
|
|
103
|
-
documents: docs,
|
|
104
|
-
config: {
|
|
105
|
-
...clientConfig,
|
|
106
|
-
scalars: clientConfig.scalars ?? serverScalars
|
|
107
|
-
},
|
|
108
|
-
sdkConfig: nitro.options.graphql?.codegen?.clientSDK,
|
|
109
|
-
options
|
|
110
|
-
});
|
|
111
|
-
if (types === false) return;
|
|
112
|
-
const placeholders = getDefaultPaths(nitro);
|
|
113
|
-
const typesConfig = getTypesConfig(nitro);
|
|
114
|
-
const sdkConfig = getSdkConfig(nitro);
|
|
115
|
-
const subscriptionsEnabled = nitro.options.graphql?.subscriptions?.enabled ?? false;
|
|
116
|
-
const clientPath = resolveFilePath(typesConfig.client, typesConfig.enabled, true, "{typesDir}/nitro-graphql-client.d.ts", placeholders);
|
|
117
|
-
if (clientPath) {
|
|
118
|
-
writeFile(clientPath, types.types);
|
|
119
|
-
if (!options.silent) logger.success(`Client types: ${clientPath}`);
|
|
120
|
-
}
|
|
121
|
-
const subscriptionCode = generateSubscriptionBuilder(docs, subscriptionsEnabled);
|
|
122
|
-
const sdkPath = resolveFilePath(sdkConfig.main, sdkConfig.enabled, true, "{clientDir}/default/sdk.ts", placeholders);
|
|
123
|
-
if (sdkPath) {
|
|
124
|
-
writeFile(sdkPath, subscriptionCode ? types.sdk + subscriptionCode : types.sdk);
|
|
125
|
-
if (!options.silent) logger.success(`SDK: ${sdkPath}`);
|
|
126
|
-
}
|
|
127
|
-
if (subscriptionsEnabled) {
|
|
128
|
-
const subscribePath = resolveFilePath(true, true, true, "{clientDir}/default/subscribe.ts", placeholders);
|
|
129
|
-
if (subscribePath && !existsSync(subscribePath)) {
|
|
130
|
-
writeFile(subscribePath, subscribeClientTemplate);
|
|
131
|
-
if (!options.silent) logger.success(`Subscribe config: ${subscribePath}`);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
async function generateExternalTypes(nitro, options = {}) {
|
|
136
|
-
for (const service of nitro.options.graphql?.externalServices || []) try {
|
|
137
|
-
if (!options.silent) consola.info(`[${service.name}] Processing external service`);
|
|
138
|
-
await downloadAndSaveSchema(service, nitro.options.buildDir);
|
|
139
|
-
const schema = await loadExternalSchema(service, nitro.options.buildDir);
|
|
140
|
-
if (!schema) {
|
|
141
|
-
consola.warn(`[${service.name}] Failed to load schema`);
|
|
142
|
-
continue;
|
|
143
|
-
}
|
|
144
|
-
const docs = service.documents?.length ? await loadGraphQLDocuments(service.documents).catch(() => []) : [];
|
|
145
|
-
if (service.documents?.length && !docs.length) {
|
|
146
|
-
consola.warn(`[${service.name}] No documents found`);
|
|
147
|
-
continue;
|
|
148
|
-
}
|
|
149
|
-
const types = await generateExternalClientTypesCore(service, schema, docs);
|
|
150
|
-
if (types === false) continue;
|
|
151
|
-
const placeholders = {
|
|
152
|
-
...getDefaultPaths(nitro),
|
|
153
|
-
serviceName: service.name
|
|
154
|
-
};
|
|
155
|
-
const typesConfig = getTypesConfig(nitro);
|
|
156
|
-
const sdkConfig = getSdkConfig(nitro);
|
|
157
|
-
const typesPath = resolveFilePath(service.paths?.types ?? typesConfig.external, typesConfig.enabled, true, "{typesDir}/nitro-graphql-client-{serviceName}.d.ts", placeholders);
|
|
158
|
-
if (typesPath) {
|
|
159
|
-
writeFile(typesPath, types.types);
|
|
160
|
-
if (!options.silent) consola.success(`[${service.name}] Types: ${typesPath}`);
|
|
161
|
-
}
|
|
162
|
-
const sdkPath = resolveFilePath(service.paths?.sdk ?? sdkConfig.external, sdkConfig.enabled, true, "{clientDir}/{serviceName}/sdk.ts", placeholders);
|
|
163
|
-
if (sdkPath) {
|
|
164
|
-
writeFile(sdkPath, types.sdk);
|
|
165
|
-
if (!options.silent) consola.success(`[${service.name}] SDK: ${sdkPath}`);
|
|
166
|
-
}
|
|
167
|
-
} catch (error) {
|
|
168
|
-
consola.error(`[${service.name}] External service failed:`, error);
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
//#endregion
|
|
173
|
-
export { generateClientTypes, generateServerTypes };
|
package/dist/nitro/config.d.mts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { NitroGraphQLOptions } from "./types.mjs";
|
|
2
|
-
|
|
3
|
-
//#region src/nitro/config.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* Default type generation configuration
|
|
6
|
-
*/
|
|
7
|
-
declare const DEFAULT_TYPES_CONFIG: {
|
|
8
|
-
readonly server: ".graphql/nitro-graphql-server.d.ts";
|
|
9
|
-
readonly client: ".graphql/nitro-graphql-client.d.ts";
|
|
10
|
-
readonly enabled: true;
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* Default runtime GraphQL configuration
|
|
14
|
-
*/
|
|
15
|
-
declare const DEFAULT_RUNTIME_CONFIG: NitroGraphQLOptions;
|
|
16
|
-
/**
|
|
17
|
-
* Default ignore patterns for file watching
|
|
18
|
-
*/
|
|
19
|
-
declare const DEFAULT_IGNORE_PATTERNS: string[];
|
|
20
|
-
/**
|
|
21
|
-
* Default SDK configuration
|
|
22
|
-
*/
|
|
23
|
-
declare const DEFAULT_SDK_CONFIG: {
|
|
24
|
-
readonly enabled: true;
|
|
25
|
-
readonly main: true;
|
|
26
|
-
readonly external: true;
|
|
27
|
-
};
|
|
28
|
-
/**
|
|
29
|
-
* Default paths configuration
|
|
30
|
-
* These are used as placeholders and resolved based on framework
|
|
31
|
-
*/
|
|
32
|
-
declare const DEFAULT_PATHS_CONFIG: {
|
|
33
|
-
readonly serverDir: "server/graphql";
|
|
34
|
-
readonly clientDir: null;
|
|
35
|
-
readonly typesDir: null;
|
|
36
|
-
};
|
|
37
|
-
/**
|
|
38
|
-
* Default TypeScript strict mode setting
|
|
39
|
-
*/
|
|
40
|
-
declare const DEFAULT_TYPESCRIPT_STRICT: true;
|
|
41
|
-
/**
|
|
42
|
-
* Default watcher persistence setting
|
|
43
|
-
*/
|
|
44
|
-
declare const DEFAULT_WATCHER_PERSISTENT: true;
|
|
45
|
-
/**
|
|
46
|
-
* Default watcher ignore initial setting
|
|
47
|
-
*/
|
|
48
|
-
declare const DEFAULT_WATCHER_IGNORE_INITIAL: true;
|
|
49
|
-
//#endregion
|
|
50
|
-
export { DEFAULT_IGNORE_PATTERNS, DEFAULT_PATHS_CONFIG, DEFAULT_RUNTIME_CONFIG, DEFAULT_SDK_CONFIG, DEFAULT_TYPESCRIPT_STRICT, DEFAULT_TYPES_CONFIG, DEFAULT_WATCHER_IGNORE_INITIAL, DEFAULT_WATCHER_PERSISTENT };
|
package/dist/nitro/config.mjs
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { DEFAULT_CLIENT_TYPES_PATH, DEFAULT_SERVER_TYPES_PATH, ENDPOINT_GRAPHQL, ENDPOINT_HEALTH } from "../core/constants.mjs";
|
|
2
|
-
|
|
3
|
-
//#region src/nitro/config.ts
|
|
4
|
-
/**
|
|
5
|
-
* Default type generation configuration
|
|
6
|
-
*/
|
|
7
|
-
const DEFAULT_TYPES_CONFIG = {
|
|
8
|
-
server: DEFAULT_SERVER_TYPES_PATH,
|
|
9
|
-
client: DEFAULT_CLIENT_TYPES_PATH,
|
|
10
|
-
enabled: true
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* Default runtime GraphQL configuration
|
|
14
|
-
*/
|
|
15
|
-
const DEFAULT_RUNTIME_CONFIG = {
|
|
16
|
-
endpoint: {
|
|
17
|
-
graphql: ENDPOINT_GRAPHQL,
|
|
18
|
-
healthCheck: ENDPOINT_HEALTH
|
|
19
|
-
},
|
|
20
|
-
playground: true
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* Default ignore patterns for file watching
|
|
24
|
-
*/
|
|
25
|
-
const DEFAULT_IGNORE_PATTERNS = [];
|
|
26
|
-
/**
|
|
27
|
-
* Default SDK configuration
|
|
28
|
-
*/
|
|
29
|
-
const DEFAULT_SDK_CONFIG = {
|
|
30
|
-
enabled: true,
|
|
31
|
-
main: true,
|
|
32
|
-
external: true
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* Default paths configuration
|
|
36
|
-
* These are used as placeholders and resolved based on framework
|
|
37
|
-
*/
|
|
38
|
-
const DEFAULT_PATHS_CONFIG = {
|
|
39
|
-
serverDir: "server/graphql",
|
|
40
|
-
clientDir: null,
|
|
41
|
-
typesDir: null
|
|
42
|
-
};
|
|
43
|
-
/**
|
|
44
|
-
* Default TypeScript strict mode setting
|
|
45
|
-
*/
|
|
46
|
-
const DEFAULT_TYPESCRIPT_STRICT = true;
|
|
47
|
-
/**
|
|
48
|
-
* Default watcher persistence setting
|
|
49
|
-
*/
|
|
50
|
-
const DEFAULT_WATCHER_PERSISTENT = true;
|
|
51
|
-
/**
|
|
52
|
-
* Default watcher ignore initial setting
|
|
53
|
-
*/
|
|
54
|
-
const DEFAULT_WATCHER_IGNORE_INITIAL = true;
|
|
55
|
-
|
|
56
|
-
//#endregion
|
|
57
|
-
export { DEFAULT_IGNORE_PATTERNS, DEFAULT_PATHS_CONFIG, DEFAULT_RUNTIME_CONFIG, DEFAULT_SDK_CONFIG, DEFAULT_TYPESCRIPT_STRICT, DEFAULT_TYPES_CONFIG, DEFAULT_WATCHER_IGNORE_INITIAL, DEFAULT_WATCHER_PERSISTENT };
|