nitro-graphql 2.0.0-beta.7 → 2.0.0-beta.72
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 +31 -1196
- package/dist/cli/adapter.d.mts +13 -0
- package/dist/cli/adapter.mjs +67 -0
- package/dist/cli/commands/build.d.mts +21 -0
- package/dist/cli/commands/build.mjs +50 -0
- package/dist/cli/commands/dev.d.mts +40 -0
- package/dist/cli/commands/dev.mjs +74 -0
- package/dist/cli/commands/generate.d.mts +25 -0
- package/dist/cli/commands/generate.mjs +198 -0
- package/dist/cli/commands/index.d.mts +5 -0
- package/dist/cli/commands/index.mjs +5 -0
- package/dist/cli/commands/init.d.mts +45 -0
- package/dist/cli/commands/init.mjs +195 -0
- package/dist/cli/commands/validate.d.mts +9 -0
- package/dist/cli/commands/validate.mjs +65 -0
- package/dist/cli/completions.d.mts +6 -0
- package/dist/cli/completions.mjs +32 -0
- package/dist/cli/config.d.mts +18 -0
- package/dist/cli/config.mjs +19 -0
- package/dist/cli/index.d.mts +26 -0
- package/dist/cli/index.mjs +315 -0
- package/dist/cli/server/debug-handler.d.mts +9 -0
- package/dist/cli/server/debug-handler.mjs +68 -0
- package/dist/cli/server/dev-server.d.mts +29 -0
- package/dist/cli/server/dev-server.mjs +62 -0
- package/dist/cli/server/graphql-handler.d.mts +21 -0
- package/dist/cli/server/graphql-handler.mjs +43 -0
- package/dist/cli/server/health-handler.d.mts +12 -0
- package/dist/cli/server/health-handler.mjs +29 -0
- package/dist/cli/server/loader.d.mts +33 -0
- package/dist/cli/server/loader.mjs +144 -0
- package/dist/cli/server/sandbox-handler.d.mts +12 -0
- package/dist/cli/server/sandbox-handler.mjs +17 -0
- package/dist/cli/server/watcher.d.mts +20 -0
- package/dist/cli/server/watcher.mjs +64 -0
- package/dist/cli/server/ws-handler.d.mts +28 -0
- package/dist/cli/server/ws-handler.mjs +48 -0
- package/dist/config.d.mts +2 -0
- package/dist/config.mjs +2 -0
- package/dist/core/codegen/client.d.mts +42 -0
- package/dist/core/codegen/client.mjs +551 -0
- package/dist/core/codegen/document-loader.d.mts +9 -0
- package/dist/core/codegen/document-loader.mjs +16 -0
- package/dist/core/codegen/index.d.mts +8 -0
- package/dist/core/codegen/index.mjs +8 -0
- package/dist/core/codegen/plugin.d.mts +19 -0
- package/dist/core/codegen/plugin.mjs +29 -0
- package/dist/core/codegen/runtime.d.mts +17 -0
- package/dist/core/codegen/runtime.mjs +61 -0
- package/dist/core/codegen/schema-loader.d.mts +27 -0
- package/dist/core/codegen/schema-loader.mjs +126 -0
- package/dist/core/codegen/server.d.mts +27 -0
- package/dist/core/codegen/server.mjs +142 -0
- package/dist/core/codegen/validation.d.mts +17 -0
- package/dist/core/codegen/validation.mjs +33 -0
- package/dist/core/config.d.mts +45 -0
- package/dist/core/config.mjs +76 -0
- package/dist/core/constants.d.mts +188 -0
- package/dist/core/constants.mjs +208 -0
- package/dist/core/debug/index.d.mts +2 -0
- package/dist/core/debug/index.mjs +2 -0
- package/dist/core/debug/template.d.mts +52 -0
- package/dist/core/debug/template.mjs +384 -0
- package/dist/core/extend/index.d.mts +2 -0
- package/dist/core/extend/index.mjs +2 -0
- package/dist/core/extend/loader.d.mts +40 -0
- package/dist/core/extend/loader.mjs +196 -0
- package/dist/core/index.d.mts +33 -0
- package/dist/core/index.mjs +28 -0
- package/dist/core/manifest.d.mts +56 -0
- package/dist/core/manifest.mjs +100 -0
- package/dist/core/pubsub/index.d.mts +109 -0
- package/dist/core/pubsub/index.mjs +146 -0
- package/dist/core/scanning/ast-scanner.d.mts +27 -0
- package/dist/core/scanning/ast-scanner.mjs +114 -0
- package/dist/core/scanning/common.d.mts +25 -0
- package/dist/core/scanning/common.mjs +57 -0
- package/dist/core/scanning/directives.d.mts +13 -0
- package/dist/core/scanning/directives.mjs +28 -0
- package/dist/core/scanning/documents.d.mts +20 -0
- package/dist/core/scanning/documents.mjs +36 -0
- package/dist/core/scanning/index.d.mts +7 -0
- package/dist/core/scanning/index.mjs +7 -0
- package/dist/core/scanning/resolvers.d.mts +14 -0
- package/dist/core/scanning/resolvers.mjs +58 -0
- package/dist/core/scanning/schemas.d.mts +13 -0
- package/dist/core/scanning/schemas.mjs +50 -0
- package/dist/core/schema/builder.d.mts +59 -0
- package/dist/core/schema/builder.mjs +76 -0
- package/dist/core/schema/federation.d.mts +33 -0
- package/dist/core/schema/federation.mjs +38 -0
- package/dist/core/schema/index.d.mts +3 -0
- package/dist/core/schema/index.mjs +3 -0
- package/dist/core/server/index.d.mts +4 -0
- package/dist/core/server/index.mjs +3 -0
- package/dist/core/server/sandbox.d.mts +18 -0
- package/dist/core/server/sandbox.mjs +38 -0
- package/dist/core/server/types.d.mts +54 -0
- package/dist/core/server/types.mjs +1 -0
- package/dist/core/server/yoga.d.mts +42 -0
- package/dist/core/server/yoga.mjs +87 -0
- package/dist/core/types/adapter.d.mts +55 -0
- package/dist/core/types/adapter.mjs +1 -0
- package/dist/core/types/codegen.d.mts +136 -0
- package/dist/core/types/codegen.mjs +1 -0
- package/dist/core/types/config.d.mts +188 -0
- package/dist/core/types/config.mjs +1 -0
- package/dist/{utils/define.d.ts → core/types/define.d.mts} +2 -30
- package/dist/core/types/define.mjs +1 -0
- package/dist/core/types/index.d.mts +5 -0
- package/dist/core/types/index.mjs +1 -0
- package/dist/core/types/scanning.d.mts +64 -0
- package/dist/core/types/scanning.mjs +1 -0
- package/dist/{utils/directive-parser.d.ts → core/utils/directive-parser.d.mts} +18 -4
- package/dist/{utils/directive-parser.js → core/utils/directive-parser.mjs} +29 -36
- package/dist/core/utils/errors.d.mts +77 -0
- package/dist/core/utils/errors.mjs +91 -0
- package/dist/core/utils/file-io.d.mts +24 -0
- package/dist/core/utils/file-io.mjs +45 -0
- package/dist/core/utils/imports.d.mts +15 -0
- package/dist/core/utils/imports.mjs +24 -0
- package/dist/core/utils/index.d.mts +7 -0
- package/dist/core/utils/index.mjs +7 -0
- package/dist/core/utils/logger.d.mts +18 -0
- package/dist/core/utils/logger.mjs +36 -0
- package/dist/core/utils/ofetch-templates.d.mts +30 -0
- package/dist/core/utils/ofetch-templates.mjs +134 -0
- package/dist/core/utils/runtime.d.mts +74 -0
- package/dist/core/utils/runtime.mjs +109 -0
- package/dist/core/utils/subscribe-templates.d.mts +8 -0
- package/dist/core/utils/subscribe-templates.mjs +58 -0
- package/dist/core/validation/external-services.d.mts +11 -0
- package/dist/core/validation/external-services.mjs +33 -0
- package/dist/core/validation/index.d.mts +2 -0
- package/dist/core/validation/index.mjs +2 -0
- package/dist/core/watcher/index.d.mts +107 -0
- package/dist/core/watcher/index.mjs +140 -0
- package/dist/define.d.mts +294 -0
- package/dist/define.mjs +323 -0
- package/dist/index.d.mts +6 -0
- package/dist/index.mjs +5 -0
- package/dist/nitro/adapter.d.mts +28 -0
- package/dist/nitro/adapter.mjs +90 -0
- package/dist/{utils/apollo.d.ts → nitro/apollo.d.mts} +3 -3
- package/dist/nitro/apollo.mjs +57 -0
- package/dist/nitro/codegen.d.mts +18 -0
- package/dist/nitro/codegen.mjs +171 -0
- package/dist/nitro/config.d.mts +50 -0
- package/dist/nitro/config.mjs +55 -0
- package/dist/nitro/index.d.mts +45 -0
- package/dist/nitro/index.mjs +63 -0
- package/dist/{utils/path-resolver.d.ts → nitro/paths.d.mts} +8 -25
- package/dist/nitro/paths.mjs +97 -0
- package/dist/nitro/rollup.d.mts +6 -0
- package/dist/nitro/rollup.mjs +52 -0
- package/dist/nitro/routes/apollo-sandbox-script.d.mts +6 -0
- package/dist/nitro/routes/apollo-sandbox-script.mjs +12 -0
- package/dist/nitro/routes/apollo-server-ws.d.mts +15 -0
- package/dist/nitro/routes/apollo-server-ws.mjs +50 -0
- package/dist/nitro/routes/apollo-server.d.mts +6 -0
- package/dist/nitro/routes/apollo-server.mjs +69 -0
- package/dist/{routes/debug.d.ts → nitro/routes/debug.d.mts} +12 -19
- package/dist/nitro/routes/debug.mjs +98 -0
- package/dist/nitro/routes/graphql-yoga-ws.d.mts +12 -0
- package/dist/nitro/routes/graphql-yoga-ws.mjs +50 -0
- package/dist/nitro/routes/graphql-yoga.d.mts +12 -0
- package/dist/nitro/routes/graphql-yoga.mjs +39 -0
- package/dist/nitro/routes/health.d.mts +10 -0
- package/dist/{routes/health.js → nitro/routes/health.mjs} +5 -6
- package/dist/nitro/setup/extend-loader.d.mts +16 -0
- package/dist/nitro/setup/extend-loader.mjs +80 -0
- package/dist/nitro/setup/file-watcher.d.mts +18 -0
- package/dist/nitro/setup/file-watcher.mjs +62 -0
- package/dist/nitro/setup/logging.d.mts +16 -0
- package/dist/nitro/setup/logging.mjs +64 -0
- package/dist/nitro/setup/rollup-integration.d.mts +24 -0
- package/dist/nitro/setup/rollup-integration.mjs +64 -0
- package/dist/nitro/setup/routes.d.mts +13 -0
- package/dist/nitro/setup/routes.mjs +69 -0
- package/dist/nitro/setup/scanner.d.mts +59 -0
- package/dist/nitro/setup/scanner.mjs +118 -0
- package/dist/nitro/setup/ts-config.d.mts +10 -0
- package/dist/nitro/setup/ts-config.mjs +67 -0
- package/dist/nitro/setup.d.mts +11 -0
- package/dist/nitro/setup.mjs +189 -0
- package/dist/nitro/types.d.mts +549 -0
- package/dist/nitro/types.mjs +1 -0
- package/dist/nitro/virtual/generators.d.mts +38 -0
- package/dist/nitro/virtual/generators.mjs +190 -0
- package/dist/nitro/virtual/stubs.d.mts +21 -0
- package/dist/nitro/virtual/stubs.mjs +31 -0
- package/dist/{ecosystem/nuxt.d.ts → nuxt.d.mts} +1 -1
- package/dist/nuxt.mjs +111 -0
- package/dist/{graphql/server.d.ts → stubs/index.d.mts} +5 -1
- package/dist/stubs/index.mjs +1 -0
- package/dist/subscribe/index.d.mts +78 -0
- package/dist/subscribe/index.mjs +205 -0
- package/native/index.d.ts +20 -0
- package/native/index.js +585 -0
- package/package.json +202 -112
- package/dist/ecosystem/nuxt.js +0 -67
- package/dist/graphql/index.d.ts +0 -5
- package/dist/graphql/index.js +0 -1
- package/dist/graphql/server.js +0 -1
- package/dist/index.d.ts +0 -8
- package/dist/index.js +0 -318
- package/dist/rollup.js +0 -277
- package/dist/routes/apollo-server.d.ts +0 -6
- package/dist/routes/apollo-server.js +0 -89
- package/dist/routes/debug.js +0 -449
- package/dist/routes/graphql-yoga.d.ts +0 -6
- package/dist/routes/graphql-yoga.js +0 -91
- package/dist/routes/health.d.ts +0 -10
- package/dist/types/index.d.ts +0 -246
- package/dist/types/standard-schema.d.ts +0 -59
- package/dist/utils/apollo.js +0 -61
- package/dist/utils/client-codegen.d.ts +0 -38
- package/dist/utils/client-codegen.js +0 -290
- package/dist/utils/define.js +0 -57
- package/dist/utils/file-generator.d.ts +0 -37
- package/dist/utils/file-generator.js +0 -72
- package/dist/utils/index.d.ts +0 -39
- package/dist/utils/index.js +0 -278
- package/dist/utils/path-resolver.js +0 -127
- package/dist/utils/server-codegen.d.ts +0 -7
- package/dist/utils/server-codegen.js +0 -136
- package/dist/utils/type-generation.d.ts +0 -7
- package/dist/utils/type-generation.js +0 -360
- package/dist/virtual/debug-info.d.ts +0 -9
- package/dist/virtual/debug-info.js +0 -26
- package/dist/virtual/graphql-config.d.ts +0 -9
- package/dist/virtual/graphql-config.js +0 -10
- package/dist/virtual/module-config.d.ts +0 -9
- package/dist/virtual/module-config.js +0 -10
- package/dist/virtual/server-directives.d.ts +0 -11
- package/dist/virtual/server-directives.js +0 -10
- package/dist/virtual/server-resolvers.d.ts +0 -11
- package/dist/virtual/server-resolvers.js +0 -10
- package/dist/virtual/server-schemas.d.ts +0 -11
- package/dist/virtual/server-schemas.js +0 -10
- package/dist/vite.d.ts +0 -25
- package/dist/vite.js +0 -40
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { isAbsolute, resolve } from "pathe";
|
|
2
|
+
//#region src/nitro/paths.ts
|
|
3
|
+
const SERVICE_NAME_RE = /\{serviceName\}/g;
|
|
4
|
+
const BUILD_DIR_RE = /\{buildDir\}/g;
|
|
5
|
+
const ROOT_DIR_RE = /\{rootDir\}/g;
|
|
6
|
+
const FRAMEWORK_RE = /\{framework\}/g;
|
|
7
|
+
const TYPES_DIR_RE = /\{typesDir\}/g;
|
|
8
|
+
const SERVER_DIR_RE = /\{serverDir\}/g;
|
|
9
|
+
const CLIENT_DIR_RE = /\{clientDir\}/g;
|
|
10
|
+
/**
|
|
11
|
+
* Replace placeholders in a path string
|
|
12
|
+
* Supports: {serviceName}, {buildDir}, {rootDir}, {framework}, {typesDir}, {serverDir}, {clientDir}
|
|
13
|
+
*/
|
|
14
|
+
function replacePlaceholders(path, placeholders) {
|
|
15
|
+
return path.replace(SERVICE_NAME_RE, placeholders.serviceName || "default").replace(BUILD_DIR_RE, placeholders.buildDir).replace(ROOT_DIR_RE, placeholders.rootDir).replace(FRAMEWORK_RE, placeholders.framework).replace(TYPES_DIR_RE, placeholders.typesDir).replace(SERVER_DIR_RE, placeholders.serverDir).replace(CLIENT_DIR_RE, placeholders.clientDir);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Get default paths based on framework and user configuration
|
|
19
|
+
*/
|
|
20
|
+
function getDefaultPaths(nitro) {
|
|
21
|
+
const isNuxt = nitro.options.framework?.name === "nuxt";
|
|
22
|
+
const rootDir = nitro.options.rootDir;
|
|
23
|
+
const buildDir = nitro.options.buildDir;
|
|
24
|
+
const graphqlConfig = nitro.options.graphql || {};
|
|
25
|
+
const defaultServerDir = graphqlConfig.serverDir ? resolve(rootDir, graphqlConfig.serverDir) : resolve(rootDir, "server", "graphql");
|
|
26
|
+
const defaultClientDir = graphqlConfig.clientDir ? resolve(rootDir, graphqlConfig.clientDir) : resolve(rootDir, isNuxt ? "app/graphql" : "graphql");
|
|
27
|
+
const defaultTypesDir = graphqlConfig.typesDir ? resolve(rootDir, graphqlConfig.typesDir) : resolve(buildDir, "types");
|
|
28
|
+
return {
|
|
29
|
+
serviceName: "default",
|
|
30
|
+
buildDir,
|
|
31
|
+
rootDir,
|
|
32
|
+
framework: isNuxt ? "nuxt" : "nitro",
|
|
33
|
+
typesDir: defaultTypesDir,
|
|
34
|
+
serverDir: defaultServerDir,
|
|
35
|
+
clientDir: defaultClientDir
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Check if a file should be generated based on config
|
|
40
|
+
* Returns: true if should generate, false if should skip
|
|
41
|
+
*/
|
|
42
|
+
function shouldGenerateFile(config, categoryEnabled, topLevelEnabled) {
|
|
43
|
+
if (config === false) return false;
|
|
44
|
+
if (config === true || typeof config === "string") return true;
|
|
45
|
+
if (categoryEnabled === false) return false;
|
|
46
|
+
if (categoryEnabled === true) return true;
|
|
47
|
+
return topLevelEnabled;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Resolve the file path based on configuration
|
|
51
|
+
* Returns: resolved absolute path or null if file should not be generated
|
|
52
|
+
*/
|
|
53
|
+
function resolveFilePath(config, categoryEnabled, topLevelEnabled, defaultPath, placeholders) {
|
|
54
|
+
if (!shouldGenerateFile(config, categoryEnabled, topLevelEnabled)) return null;
|
|
55
|
+
if (typeof config === "string") {
|
|
56
|
+
const customPath = replacePlaceholders(config, placeholders);
|
|
57
|
+
return isAbsolute(customPath) ? customPath : resolve(placeholders.rootDir, customPath);
|
|
58
|
+
}
|
|
59
|
+
const resolvedDefault = replacePlaceholders(defaultPath, placeholders);
|
|
60
|
+
return resolve(placeholders.rootDir, resolvedDefault);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Check if SDK files should be generated (category-level check)
|
|
64
|
+
*/
|
|
65
|
+
function shouldGenerateSdk(nitro) {
|
|
66
|
+
const sdkConfig = nitro.options.graphql?.sdk;
|
|
67
|
+
if (sdkConfig === false) return false;
|
|
68
|
+
if (sdkConfig && sdkConfig.enabled === false) return false;
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Get SDK configuration (handles false case)
|
|
73
|
+
*/
|
|
74
|
+
function getSdkConfig(nitro) {
|
|
75
|
+
const sdkConfig = nitro.options.graphql?.sdk;
|
|
76
|
+
if (sdkConfig === false) return { enabled: false };
|
|
77
|
+
return sdkConfig || {};
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Check if type files should be generated (category-level check)
|
|
81
|
+
*/
|
|
82
|
+
function shouldGenerateTypes(nitro) {
|
|
83
|
+
const typesConfig = nitro.options.graphql?.types;
|
|
84
|
+
if (typesConfig === false) return false;
|
|
85
|
+
if (typesConfig && typesConfig.enabled === false) return false;
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Get types configuration (handles false case)
|
|
90
|
+
*/
|
|
91
|
+
function getTypesConfig(nitro) {
|
|
92
|
+
const typesConfig = nitro.options.graphql?.types;
|
|
93
|
+
if (typesConfig === false) return { enabled: false };
|
|
94
|
+
return typesConfig || {};
|
|
95
|
+
}
|
|
96
|
+
//#endregion
|
|
97
|
+
export { getDefaultPaths, getSdkConfig, getTypesConfig, replacePlaceholders, resolveFilePath, shouldGenerateFile, shouldGenerateSdk, shouldGenerateTypes };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { NitroAdapter } from "./adapter.mjs";
|
|
2
|
+
import { registerAllVirtualModules } from "./virtual/generators.mjs";
|
|
3
|
+
import { readFile } from "node:fs/promises";
|
|
4
|
+
import { parse } from "graphql";
|
|
5
|
+
//#region src/nitro/rollup.ts
|
|
6
|
+
const GRAPHQL_FILE_RE = /\.(?:graphql|gql)$/i;
|
|
7
|
+
async function rollupConfig(nitro) {
|
|
8
|
+
registerAllVirtualModules(nitro);
|
|
9
|
+
nitro.hooks.hook("rollup:before", (_, rollupConfig) => {
|
|
10
|
+
rollupConfig.plugins = rollupConfig.plugins || [];
|
|
11
|
+
const { include = GRAPHQL_FILE_RE, exclude, validate = false } = nitro.options.graphql?.loader || {};
|
|
12
|
+
if (Array.isArray(rollupConfig.plugins)) {
|
|
13
|
+
rollupConfig.plugins.push({
|
|
14
|
+
name: "nitro-graphql",
|
|
15
|
+
resolveId: {
|
|
16
|
+
order: "pre",
|
|
17
|
+
handler(id) {
|
|
18
|
+
if (GRAPHQL_FILE_RE.test(id)) return null;
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
load: {
|
|
22
|
+
order: "pre",
|
|
23
|
+
async handler(id) {
|
|
24
|
+
if (exclude?.test?.(id)) return null;
|
|
25
|
+
if (!include.test(id)) return null;
|
|
26
|
+
try {
|
|
27
|
+
const content = await readFile(id, "utf-8");
|
|
28
|
+
if (validate) parse(content);
|
|
29
|
+
return `export default ${JSON.stringify(content)}`;
|
|
30
|
+
} catch (error) {
|
|
31
|
+
if (error && typeof error === "object" && "code" in error && error.code === "ENOENT") return null;
|
|
32
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
33
|
+
this.error(`Failed to read GraphQL file ${id}: ${message}`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
if (nitro.options.dev) rollupConfig.plugins.push({
|
|
39
|
+
name: "nitro-graphql-watcher",
|
|
40
|
+
buildStart: {
|
|
41
|
+
order: "pre",
|
|
42
|
+
async handler() {
|
|
43
|
+
const result = await NitroAdapter.scanGraphql(nitro);
|
|
44
|
+
for (const file of result.items) this.addWatchFile(file);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
//#endregion
|
|
52
|
+
export { rollupConfig };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createSandboxResponse } from "../../core/server/sandbox.mjs";
|
|
2
|
+
import { defineEventHandler } from "nitro/h3";
|
|
3
|
+
//#region src/nitro/routes/apollo-sandbox-script.ts
|
|
4
|
+
/**
|
|
5
|
+
* Proxy route for Apollo Sandbox script with long cache headers
|
|
6
|
+
* Uses core sandbox handler for consistency with CLI.
|
|
7
|
+
*/
|
|
8
|
+
var apollo_sandbox_script_default = defineEventHandler(async () => {
|
|
9
|
+
return createSandboxResponse();
|
|
10
|
+
});
|
|
11
|
+
//#endregion
|
|
12
|
+
export { apollo_sandbox_script_default as default };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as nitro_h30 from "nitro/h3";
|
|
2
|
+
|
|
3
|
+
//#region src/nitro/routes/apollo-server-ws.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Apollo Server WebSocket handler for subscriptions
|
|
6
|
+
* Uses graphql-ws library with crossws adapter for proper protocol handling
|
|
7
|
+
*
|
|
8
|
+
* Note: This handler works independently from Apollo Server for subscriptions,
|
|
9
|
+
* as Apollo Server v5 requires separate WebSocket handling.
|
|
10
|
+
*
|
|
11
|
+
* @see https://github.com/enisdenjo/graphql-ws
|
|
12
|
+
*/
|
|
13
|
+
declare const _default: nitro_h30.EventHandler<nitro_h30.EventHandlerRequest, unknown>;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { _default as default };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { createMergedSchema } from "../../core/schema/builder.mjs";
|
|
2
|
+
import { defineWebSocketHandler } from "nitro/h3";
|
|
3
|
+
import { handleProtocols } from "graphql-ws";
|
|
4
|
+
import { makeHooks } from "graphql-ws/use/crossws";
|
|
5
|
+
import { importedConfig } from "#nitro-graphql/graphql-config";
|
|
6
|
+
import { moduleConfig } from "#nitro-graphql/module-config";
|
|
7
|
+
import { directives } from "#nitro-graphql/server-directives";
|
|
8
|
+
import { resolvers } from "#nitro-graphql/server-resolvers";
|
|
9
|
+
import { schemas } from "#nitro-graphql/server-schemas";
|
|
10
|
+
//#region src/nitro/routes/apollo-server-ws.ts
|
|
11
|
+
let schema = null;
|
|
12
|
+
/**
|
|
13
|
+
* Get or create the merged GraphQL schema
|
|
14
|
+
*/
|
|
15
|
+
async function getSchema() {
|
|
16
|
+
if (!schema) schema = await createMergedSchema({
|
|
17
|
+
schemas,
|
|
18
|
+
resolvers,
|
|
19
|
+
directives,
|
|
20
|
+
moduleConfig
|
|
21
|
+
});
|
|
22
|
+
return schema;
|
|
23
|
+
}
|
|
24
|
+
var apollo_server_ws_default = defineWebSocketHandler({
|
|
25
|
+
upgrade(request) {
|
|
26
|
+
const selected = handleProtocols(request.headers.get("sec-websocket-protocol") || "");
|
|
27
|
+
if (selected) return { headers: { "Sec-WebSocket-Protocol": selected } };
|
|
28
|
+
return {};
|
|
29
|
+
},
|
|
30
|
+
...makeHooks({
|
|
31
|
+
schema: () => getSchema(),
|
|
32
|
+
context: async (ctx) => {
|
|
33
|
+
const baseContext = { connectionParams: ctx.connectionParams };
|
|
34
|
+
if (typeof importedConfig.context === "function") {
|
|
35
|
+
const userContext = await importedConfig.context(baseContext);
|
|
36
|
+
return {
|
|
37
|
+
...baseContext,
|
|
38
|
+
...userContext
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
if (importedConfig.context && typeof importedConfig.context === "object") return {
|
|
42
|
+
...baseContext,
|
|
43
|
+
...importedConfig.context
|
|
44
|
+
};
|
|
45
|
+
return baseContext;
|
|
46
|
+
}
|
|
47
|
+
})
|
|
48
|
+
});
|
|
49
|
+
//#endregion
|
|
50
|
+
export { apollo_server_ws_default as default };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { createMergedSchema } from "../../core/schema/builder.mjs";
|
|
2
|
+
import defu from "defu";
|
|
3
|
+
import { ApolloServer } from "@apollo/server";
|
|
4
|
+
import { defineEventHandler } from "nitro/h3";
|
|
5
|
+
import { importedConfig } from "#nitro-graphql/graphql-config";
|
|
6
|
+
import { moduleConfig } from "#nitro-graphql/module-config";
|
|
7
|
+
import { directives } from "#nitro-graphql/server-directives";
|
|
8
|
+
import { resolvers } from "#nitro-graphql/server-resolvers";
|
|
9
|
+
import { schemas } from "#nitro-graphql/server-schemas";
|
|
10
|
+
import { ApolloServerPluginLandingPageDisabled } from "@apollo/server/plugin/disabled";
|
|
11
|
+
import { ApolloServerPluginLandingPageLocalDefault } from "@apollo/server/plugin/landingPage/default";
|
|
12
|
+
import { startServerAndCreateH3Handler } from "nitro-graphql/apollo";
|
|
13
|
+
//#region src/nitro/routes/apollo-server.ts
|
|
14
|
+
let apolloServer = null;
|
|
15
|
+
let serverStarted = false;
|
|
16
|
+
async function createApolloServer() {
|
|
17
|
+
if (!apolloServer) {
|
|
18
|
+
const schema = await createMergedSchema({
|
|
19
|
+
schemas,
|
|
20
|
+
resolvers,
|
|
21
|
+
directives,
|
|
22
|
+
moduleConfig
|
|
23
|
+
});
|
|
24
|
+
const securityConfig = moduleConfig.security || {
|
|
25
|
+
introspection: true,
|
|
26
|
+
playground: true,
|
|
27
|
+
maskErrors: false,
|
|
28
|
+
disableSuggestions: false
|
|
29
|
+
};
|
|
30
|
+
const plugins = [];
|
|
31
|
+
if (securityConfig.playground) plugins.push(ApolloServerPluginLandingPageLocalDefault({ embed: true }));
|
|
32
|
+
else plugins.push(ApolloServerPluginLandingPageDisabled());
|
|
33
|
+
const userFacingCodes = [
|
|
34
|
+
"BAD_USER_INPUT",
|
|
35
|
+
"GRAPHQL_VALIDATION_FAILED",
|
|
36
|
+
"UNAUTHENTICATED",
|
|
37
|
+
"FORBIDDEN",
|
|
38
|
+
"BAD_REQUEST"
|
|
39
|
+
];
|
|
40
|
+
apolloServer = new ApolloServer(defu({
|
|
41
|
+
schema,
|
|
42
|
+
introspection: securityConfig.introspection,
|
|
43
|
+
plugins,
|
|
44
|
+
formatError: securityConfig.maskErrors ? (formattedError, _error) => {
|
|
45
|
+
const code = formattedError?.extensions?.code;
|
|
46
|
+
if (code && userFacingCodes.includes(code)) return formattedError;
|
|
47
|
+
return {
|
|
48
|
+
message: "Internal server error",
|
|
49
|
+
extensions: { code: "INTERNAL_SERVER_ERROR" }
|
|
50
|
+
};
|
|
51
|
+
} : void 0
|
|
52
|
+
}, importedConfig));
|
|
53
|
+
if (!serverStarted) {
|
|
54
|
+
await apolloServer.start();
|
|
55
|
+
serverStarted = true;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return apolloServer;
|
|
59
|
+
}
|
|
60
|
+
let serverPromise = null;
|
|
61
|
+
var apollo_server_default = defineEventHandler(async (event) => {
|
|
62
|
+
if (!serverPromise) serverPromise = createApolloServer();
|
|
63
|
+
return startServerAndCreateH3Handler(await serverPromise, {
|
|
64
|
+
context: async () => ({ event }),
|
|
65
|
+
serverAlreadyStarted: true
|
|
66
|
+
})(event);
|
|
67
|
+
});
|
|
68
|
+
//#endregion
|
|
69
|
+
export { apollo_server_default as default };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
|
|
3
|
-
//#region src/routes/debug.d.ts
|
|
1
|
+
import * as nitro_h30 from "nitro/h3";
|
|
4
2
|
|
|
3
|
+
//#region src/nitro/routes/debug.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* Debug endpoint for inspecting virtual modules and GraphQL setup
|
|
7
6
|
* Only available in development mode
|
|
@@ -10,7 +9,7 @@ import * as h31 from "h3";
|
|
|
10
9
|
* - /_nitro/graphql/debug - HTML dashboard
|
|
11
10
|
* - /_nitro/graphql/debug?format=json - JSON API
|
|
12
11
|
*/
|
|
13
|
-
declare const _default:
|
|
12
|
+
declare const _default: nitro_h30.EventHandlerWithFetch<nitro_h30.EventHandlerRequest, Promise<string | {
|
|
14
13
|
timestamp: string;
|
|
15
14
|
environment: {
|
|
16
15
|
dev: any;
|
|
@@ -31,30 +30,24 @@ declare const _default: h31.EventHandlerWithFetch<h31.EventHandlerRequest, Promi
|
|
|
31
30
|
documentFiles: any;
|
|
32
31
|
};
|
|
33
32
|
runtime: {
|
|
34
|
-
loadedResolvers:
|
|
35
|
-
loadedSchemas:
|
|
36
|
-
loadedDirectives:
|
|
33
|
+
loadedResolvers: any;
|
|
34
|
+
loadedSchemas: any;
|
|
35
|
+
loadedDirectives: any;
|
|
37
36
|
};
|
|
38
37
|
virtualModules: any;
|
|
39
38
|
virtualModuleSamples: {
|
|
40
39
|
'server-resolvers': {
|
|
41
|
-
resolverCount:
|
|
42
|
-
sample:
|
|
43
|
-
hasResolver: boolean;
|
|
44
|
-
resolverKeys: string[];
|
|
45
|
-
}[];
|
|
40
|
+
resolverCount: any;
|
|
41
|
+
sample: any;
|
|
46
42
|
};
|
|
47
43
|
'server-schemas': {
|
|
48
|
-
schemaCount:
|
|
49
|
-
sample:
|
|
50
|
-
defLength: number;
|
|
51
|
-
defPreview: string;
|
|
52
|
-
}[];
|
|
44
|
+
schemaCount: any;
|
|
45
|
+
sample: any;
|
|
53
46
|
};
|
|
54
47
|
'server-directives': {
|
|
55
|
-
directiveCount:
|
|
48
|
+
directiveCount: any;
|
|
56
49
|
};
|
|
57
|
-
'module-config':
|
|
50
|
+
'module-config': any;
|
|
58
51
|
};
|
|
59
52
|
}>>;
|
|
60
53
|
//#endregion
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { generateDebugHtml } from "../../core/debug/template.mjs";
|
|
2
|
+
import { defineEventHandler, getQuery } from "nitro/h3";
|
|
3
|
+
import { moduleConfig } from "#nitro-graphql/module-config";
|
|
4
|
+
import { directives } from "#nitro-graphql/server-directives";
|
|
5
|
+
import { resolvers } from "#nitro-graphql/server-resolvers";
|
|
6
|
+
import { schemas } from "#nitro-graphql/server-schemas";
|
|
7
|
+
import { debugInfo } from "#nitro-graphql/debug-info";
|
|
8
|
+
//#region src/nitro/routes/debug.ts
|
|
9
|
+
/**
|
|
10
|
+
* Debug endpoint for inspecting virtual modules and GraphQL setup
|
|
11
|
+
* Only available in development mode
|
|
12
|
+
*
|
|
13
|
+
* Routes:
|
|
14
|
+
* - /_nitro/graphql/debug - HTML dashboard
|
|
15
|
+
* - /_nitro/graphql/debug?format=json - JSON API
|
|
16
|
+
*/
|
|
17
|
+
var debug_default = defineEventHandler(async (event) => {
|
|
18
|
+
const format = getQuery(event).format || "html";
|
|
19
|
+
const processedResolverFiles = debugInfo.scanned.resolverFiles.map((r) => {
|
|
20
|
+
return {
|
|
21
|
+
file: r.specifier.split("/").at(-1),
|
|
22
|
+
fullPath: r.specifier,
|
|
23
|
+
exports: r.imports.map((i) => ({
|
|
24
|
+
name: i.name,
|
|
25
|
+
type: i.type,
|
|
26
|
+
as: i.as
|
|
27
|
+
}))
|
|
28
|
+
};
|
|
29
|
+
});
|
|
30
|
+
const processedDirectiveFiles = debugInfo.scanned.directiveFiles.map((d) => {
|
|
31
|
+
return {
|
|
32
|
+
file: d.specifier.split("/").at(-1),
|
|
33
|
+
fullPath: d.specifier,
|
|
34
|
+
exports: d.imports.map((i) => ({
|
|
35
|
+
name: i.name,
|
|
36
|
+
type: i.type,
|
|
37
|
+
as: i.as
|
|
38
|
+
}))
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
const fullDebugInfo = {
|
|
42
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
43
|
+
environment: {
|
|
44
|
+
dev: debugInfo.isDev,
|
|
45
|
+
framework: debugInfo.framework
|
|
46
|
+
},
|
|
47
|
+
graphql: {
|
|
48
|
+
framework: debugInfo.graphqlFramework ?? null,
|
|
49
|
+
federation: debugInfo.federation
|
|
50
|
+
},
|
|
51
|
+
scanned: {
|
|
52
|
+
schemas: debugInfo.scanned.schemas,
|
|
53
|
+
schemaFiles: debugInfo.scanned.schemaFiles.map((s) => {
|
|
54
|
+
return s.split("/").slice(-3).join("/");
|
|
55
|
+
}),
|
|
56
|
+
resolvers: debugInfo.scanned.resolvers,
|
|
57
|
+
resolverFiles: processedResolverFiles,
|
|
58
|
+
directives: debugInfo.scanned.directives,
|
|
59
|
+
directiveFiles: processedDirectiveFiles,
|
|
60
|
+
documents: debugInfo.scanned.documents,
|
|
61
|
+
documentFiles: debugInfo.scanned.documentFiles.map((d) => {
|
|
62
|
+
return d.split("/").slice(-3).join("/");
|
|
63
|
+
})
|
|
64
|
+
},
|
|
65
|
+
runtime: {
|
|
66
|
+
loadedResolvers: resolvers.length,
|
|
67
|
+
loadedSchemas: schemas.length,
|
|
68
|
+
loadedDirectives: directives.length
|
|
69
|
+
},
|
|
70
|
+
virtualModules: debugInfo.virtualModules || {},
|
|
71
|
+
virtualModuleSamples: {
|
|
72
|
+
"server-resolvers": {
|
|
73
|
+
resolverCount: resolvers.length,
|
|
74
|
+
sample: resolvers.slice(0, 3).map((r) => ({
|
|
75
|
+
hasResolver: !!r.resolver,
|
|
76
|
+
resolverKeys: r.resolver ? Object.keys(r.resolver) : []
|
|
77
|
+
}))
|
|
78
|
+
},
|
|
79
|
+
"server-schemas": {
|
|
80
|
+
schemaCount: schemas.length,
|
|
81
|
+
sample: schemas.slice(0, 2).map((s) => ({
|
|
82
|
+
defLength: s.def?.length || 0,
|
|
83
|
+
defPreview: s.def?.substring(0, 100) || "Empty"
|
|
84
|
+
}))
|
|
85
|
+
},
|
|
86
|
+
"server-directives": { directiveCount: directives.length },
|
|
87
|
+
"module-config": moduleConfig
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
if (format === "json") {
|
|
91
|
+
event.res.headers.set("Content-Type", "application/json");
|
|
92
|
+
return fullDebugInfo;
|
|
93
|
+
}
|
|
94
|
+
event.res.headers.set("Content-Type", "text/html");
|
|
95
|
+
return generateDebugHtml(fullDebugInfo);
|
|
96
|
+
});
|
|
97
|
+
//#endregion
|
|
98
|
+
export { debug_default as default };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as nitro_h30 from "nitro/h3";
|
|
2
|
+
|
|
3
|
+
//#region src/nitro/routes/graphql-yoga-ws.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* GraphQL Yoga WebSocket handler for subscriptions
|
|
6
|
+
* Uses graphql-ws library with crossws adapter for proper protocol handling
|
|
7
|
+
*
|
|
8
|
+
* @see https://github.com/enisdenjo/graphql-ws
|
|
9
|
+
*/
|
|
10
|
+
declare const _default: nitro_h30.EventHandler<nitro_h30.EventHandlerRequest, unknown>;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { _default as default };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { createMergedSchema } from "../../core/schema/builder.mjs";
|
|
2
|
+
import { defineWebSocketHandler } from "nitro/h3";
|
|
3
|
+
import { handleProtocols } from "graphql-ws";
|
|
4
|
+
import { makeHooks } from "graphql-ws/use/crossws";
|
|
5
|
+
import { importedConfig } from "#nitro-graphql/graphql-config";
|
|
6
|
+
import { moduleConfig } from "#nitro-graphql/module-config";
|
|
7
|
+
import { directives } from "#nitro-graphql/server-directives";
|
|
8
|
+
import { resolvers } from "#nitro-graphql/server-resolvers";
|
|
9
|
+
import { schemas } from "#nitro-graphql/server-schemas";
|
|
10
|
+
//#region src/nitro/routes/graphql-yoga-ws.ts
|
|
11
|
+
let schema = null;
|
|
12
|
+
/**
|
|
13
|
+
* Get or create the merged GraphQL schema
|
|
14
|
+
*/
|
|
15
|
+
async function getSchema() {
|
|
16
|
+
if (!schema) schema = await createMergedSchema({
|
|
17
|
+
schemas,
|
|
18
|
+
resolvers,
|
|
19
|
+
directives,
|
|
20
|
+
moduleConfig
|
|
21
|
+
});
|
|
22
|
+
return schema;
|
|
23
|
+
}
|
|
24
|
+
var graphql_yoga_ws_default = defineWebSocketHandler({
|
|
25
|
+
upgrade(request) {
|
|
26
|
+
const selected = handleProtocols(request.headers.get("sec-websocket-protocol") || "");
|
|
27
|
+
if (selected) return { headers: { "Sec-WebSocket-Protocol": selected } };
|
|
28
|
+
return {};
|
|
29
|
+
},
|
|
30
|
+
...makeHooks({
|
|
31
|
+
schema: () => getSchema(),
|
|
32
|
+
context: async (ctx) => {
|
|
33
|
+
const baseContext = { connectionParams: ctx.connectionParams };
|
|
34
|
+
if (typeof importedConfig.context === "function") {
|
|
35
|
+
const userContext = await importedConfig.context(baseContext);
|
|
36
|
+
return {
|
|
37
|
+
...baseContext,
|
|
38
|
+
...userContext
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
if (importedConfig.context && typeof importedConfig.context === "object") return {
|
|
42
|
+
...baseContext,
|
|
43
|
+
...importedConfig.context
|
|
44
|
+
};
|
|
45
|
+
return baseContext;
|
|
46
|
+
}
|
|
47
|
+
})
|
|
48
|
+
});
|
|
49
|
+
//#endregion
|
|
50
|
+
export { graphql_yoga_ws_default as default };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as nitro_h30 from "nitro/h3";
|
|
2
|
+
|
|
3
|
+
//#region src/nitro/routes/graphql-yoga.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* GraphQL Yoga Route Handler
|
|
6
|
+
*
|
|
7
|
+
* Nitro/H3 wrapper around the core GraphQL Yoga server.
|
|
8
|
+
* Uses virtual modules to load schemas, resolvers, and directives.
|
|
9
|
+
*/
|
|
10
|
+
declare const _default: nitro_h30.EventHandlerWithFetch<nitro_h30.EventHandlerRequest, Promise<Response>>;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { _default as default };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { BASE_SCHEMA, createYogaServer } from "../../core/server/yoga.mjs";
|
|
2
|
+
import { defineEventHandler, getQuery } from "nitro/h3";
|
|
3
|
+
import { importedConfig } from "#nitro-graphql/graphql-config";
|
|
4
|
+
import { moduleConfig } from "#nitro-graphql/module-config";
|
|
5
|
+
import { directives } from "#nitro-graphql/server-directives";
|
|
6
|
+
import { resolvers } from "#nitro-graphql/server-resolvers";
|
|
7
|
+
import { schemas } from "#nitro-graphql/server-schemas";
|
|
8
|
+
//#region src/nitro/routes/graphql-yoga.ts
|
|
9
|
+
const PLAYGROUND_CACHE_HEADER = "public, max-age=2592000, stale-while-revalidate=86400";
|
|
10
|
+
let server = null;
|
|
11
|
+
var graphql_yoga_default = defineEventHandler(async (event) => {
|
|
12
|
+
if (!server) server = await createYogaServer({
|
|
13
|
+
schemas: [BASE_SCHEMA, ...schemas],
|
|
14
|
+
resolvers,
|
|
15
|
+
directives,
|
|
16
|
+
moduleConfig,
|
|
17
|
+
endpoint: "/api/graphql",
|
|
18
|
+
security: moduleConfig.security,
|
|
19
|
+
importedConfig
|
|
20
|
+
});
|
|
21
|
+
const response = await server.fetch(event.req, event);
|
|
22
|
+
const isPlaygroundRequest = event.req.method === "GET" && !getQuery(event).query;
|
|
23
|
+
if (event.res.status && event.res.status !== 200) return new Response(response.body, {
|
|
24
|
+
...response,
|
|
25
|
+
status: event.res.status
|
|
26
|
+
});
|
|
27
|
+
if (isPlaygroundRequest && response.headers.get("content-type")?.includes("text/html")) {
|
|
28
|
+
const headers = new Headers(response.headers);
|
|
29
|
+
headers.set("cache-control", PLAYGROUND_CACHE_HEADER);
|
|
30
|
+
return new Response(response.body, {
|
|
31
|
+
status: response.status,
|
|
32
|
+
statusText: response.statusText,
|
|
33
|
+
headers
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
return new Response(response.body, response);
|
|
37
|
+
});
|
|
38
|
+
//#endregion
|
|
39
|
+
export { graphql_yoga_default as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as nitro_h30 from "nitro/h3";
|
|
2
|
+
|
|
3
|
+
//#region src/nitro/routes/health.d.ts
|
|
4
|
+
declare const _default: nitro_h30.EventHandlerWithFetch<nitro_h30.EventHandlerRequest, Promise<{
|
|
5
|
+
status: string;
|
|
6
|
+
message: string;
|
|
7
|
+
timestamp: string;
|
|
8
|
+
}>>;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { _default as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineEventHandler } from "h3";
|
|
2
|
-
import { useRuntimeConfig } from "nitro/runtime";
|
|
3
|
-
|
|
4
|
-
//#region src/routes/health.ts
|
|
1
|
+
import { defineEventHandler } from "nitro/h3";
|
|
2
|
+
import { useRuntimeConfig } from "nitro/runtime-config";
|
|
3
|
+
import { $fetch } from "ofetch";
|
|
4
|
+
//#region src/nitro/routes/health.ts
|
|
5
5
|
var health_default = defineEventHandler(async (event) => {
|
|
6
6
|
const runtime = useRuntimeConfig();
|
|
7
7
|
if (!runtime.graphql || !runtime.graphql.endpoint?.graphql) {
|
|
@@ -41,6 +41,5 @@ var health_default = defineEventHandler(async (event) => {
|
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
43
|
});
|
|
44
|
-
|
|
45
44
|
//#endregion
|
|
46
|
-
export { health_default as default };
|
|
45
|
+
export { health_default as default };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Nitro } from "nitro/types";
|
|
2
|
+
|
|
3
|
+
//#region src/nitro/setup/extend-loader.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Resolve extend directories for file watching
|
|
6
|
+
*/
|
|
7
|
+
declare function resolveExtendDirs(nitro: Nitro): Promise<string[]>;
|
|
8
|
+
interface ResolveExtendOptions {
|
|
9
|
+
silent?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Resolve extend configuration and add files to Nitro scan results
|
|
13
|
+
*/
|
|
14
|
+
declare function resolveExtendConfig(nitro: Nitro, options?: ResolveExtendOptions): Promise<void>;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { resolveExtendConfig, resolveExtendDirs };
|