nitro-graphql 2.0.0-beta.67 → 2.0.0-beta.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/adapter.d.mts +0 -1
- package/dist/cli/commands/build.d.mts +7 -8
- package/dist/cli/commands/dev.d.mts +22 -23
- package/dist/cli/commands/generate.d.mts +0 -1
- package/dist/cli/commands/generate.mjs +5 -5
- package/dist/cli/commands/init.d.mts +0 -1
- package/dist/cli/commands/validate.d.mts +0 -1
- package/dist/cli/completions.d.mts +0 -1
- package/dist/cli/config.d.mts +0 -1
- package/dist/cli/index.d.mts +0 -2
- package/dist/cli/server/debug-handler.d.mts +0 -1
- package/dist/cli/server/dev-server.d.mts +0 -1
- package/dist/cli/server/dev-server.mjs +1 -1
- package/dist/cli/server/graphql-handler.d.mts +0 -1
- package/dist/cli/server/loader.d.mts +0 -1
- package/dist/cli/server/watcher.d.mts +0 -1
- package/dist/cli/server/ws-handler.d.mts +0 -1
- package/dist/core/codegen/client.d.mts +0 -1
- package/dist/core/codegen/client.mjs +3 -3
- package/dist/core/codegen/document-loader.d.mts +0 -1
- package/dist/core/codegen/plugin.d.mts +0 -1
- package/dist/core/codegen/runtime.d.mts +0 -1
- package/dist/core/codegen/schema-loader.d.mts +0 -1
- package/dist/core/codegen/server.d.mts +0 -1
- package/dist/core/config.d.mts +0 -1
- package/dist/core/extend/loader.d.mts +0 -1
- package/dist/core/scanning/ast-scanner.d.mts +0 -1
- package/dist/core/scanning/common.d.mts +0 -1
- package/dist/core/scanning/directives.d.mts +0 -1
- package/dist/core/scanning/documents.d.mts +0 -1
- package/dist/core/scanning/documents.mjs +1 -1
- package/dist/core/scanning/resolvers.d.mts +0 -1
- package/dist/core/scanning/schemas.d.mts +0 -1
- package/dist/core/schema/builder.d.mts +0 -1
- package/dist/core/schema/builder.mjs +1 -1
- package/dist/core/schema/federation.d.mts +0 -1
- package/dist/core/server/types.d.mts +0 -1
- package/dist/core/server/yoga.d.mts +0 -1
- package/dist/core/types/adapter.d.mts +0 -1
- package/dist/core/types/codegen.d.mts +0 -1
- package/dist/core/types/config.d.mts +0 -1
- package/dist/core/types/define.d.mts +0 -1
- package/dist/core/types/scanning.d.mts +0 -1
- package/dist/core/utils/logger.d.mts +0 -1
- package/dist/core/utils/runtime.d.mts +0 -1
- package/dist/core/watcher/index.d.mts +0 -1
- package/dist/define.d.mts +0 -1
- package/dist/nitro/adapter.d.mts +0 -1
- package/dist/nitro/codegen.d.mts +0 -1
- package/dist/nitro/config.d.mts +0 -1
- package/dist/nitro/index.d.mts +0 -1
- package/dist/nitro/paths.d.mts +0 -1
- package/dist/nitro/rollup.mjs +5 -5
- package/dist/nitro/routes/apollo-server-ws.d.mts +0 -1
- package/dist/nitro/routes/apollo-server.d.mts +2 -2
- package/dist/nitro/routes/debug.d.mts +2 -3
- package/dist/nitro/routes/graphql-yoga-ws.d.mts +2 -3
- package/dist/nitro/routes/graphql-yoga.d.mts +0 -1
- package/dist/nitro/routes/health.d.mts +2 -2
- package/dist/nitro/setup/extend-loader.d.mts +0 -1
- package/dist/nitro/setup/file-watcher.d.mts +0 -1
- package/dist/nitro/setup/logging.d.mts +0 -1
- package/dist/nitro/setup/rollup-integration.d.mts +0 -1
- package/dist/nitro/setup/routes.d.mts +4 -1
- package/dist/nitro/setup/routes.mjs +20 -9
- package/dist/nitro/setup/scanner.d.mts +0 -1
- package/dist/nitro/setup/ts-config.d.mts +0 -1
- package/dist/nitro/setup.d.mts +0 -1
- package/dist/nitro/types.d.mts +4 -9
- package/dist/nitro/virtual/generators.d.mts +0 -1
- package/dist/nuxt.mjs +10 -10
- package/native/index.js +52 -52
- package/package.json +53 -21
- package/dist/_virtual/rolldown_runtime.mjs +0 -7
- package/dist/node_modules/.pnpm/crossws@0.4.1_srvx@0.10.0/node_modules/crossws/dist/adapters/node.mjs +0 -123
- package/dist/node_modules/.pnpm/crossws@0.4.1_srvx@0.10.0/node_modules/crossws/dist/server/node.mjs +0 -29
- package/dist/node_modules/.pnpm/crossws@0.4.1_srvx@0.10.0/node_modules/crossws/dist/shared/crossws.B31KJMcF.mjs +0 -82
- package/dist/node_modules/.pnpm/crossws@0.4.1_srvx@0.10.0/node_modules/crossws/dist/shared/crossws.By9qWDAI.mjs +0 -10
- package/dist/node_modules/.pnpm/crossws@0.4.1_srvx@0.10.0/node_modules/crossws/dist/shared/crossws.CPlNx7g8.mjs +0 -84
- package/dist/node_modules/.pnpm/crossws@0.4.1_srvx@0.10.0/node_modules/crossws/dist/shared/crossws.CipVM6lf.mjs +0 -3551
- package/dist/node_modules/.pnpm/crossws@0.4.1_srvx@0.10.0/node_modules/crossws/dist/shared/crossws.WpyOHUXc.mjs +0 -232
package/dist/cli/adapter.d.mts
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import * as citty0 from "citty";
|
|
2
2
|
|
|
3
3
|
//#region src/cli/commands/build.d.ts
|
|
4
|
-
|
|
5
4
|
/**
|
|
6
5
|
* CLI Build Command
|
|
7
6
|
*
|
|
8
7
|
* Builds GraphQL types and validates schemas for production.
|
|
9
8
|
*/
|
|
10
9
|
declare const buildCommand: citty0.CommandDef<{
|
|
11
|
-
cwd: {
|
|
12
|
-
type: "string";
|
|
13
|
-
description:
|
|
10
|
+
readonly cwd: {
|
|
11
|
+
readonly type: "string";
|
|
12
|
+
readonly description: "Working directory";
|
|
14
13
|
};
|
|
15
|
-
skipValidation: {
|
|
16
|
-
type: "boolean";
|
|
17
|
-
description:
|
|
18
|
-
default: false;
|
|
14
|
+
readonly skipValidation: {
|
|
15
|
+
readonly type: "boolean";
|
|
16
|
+
readonly description: "Skip schema validation";
|
|
17
|
+
readonly default: false;
|
|
19
18
|
};
|
|
20
19
|
}>;
|
|
21
20
|
//#endregion
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as citty0 from "citty";
|
|
2
2
|
|
|
3
3
|
//#region src/cli/commands/dev.d.ts
|
|
4
|
-
|
|
5
4
|
/**
|
|
6
5
|
* Dev Command
|
|
7
6
|
*
|
|
@@ -9,32 +8,32 @@ import * as citty0 from "citty";
|
|
|
9
8
|
* Runtime-agnostic: works on Node.js, Bun, and Deno.
|
|
10
9
|
*/
|
|
11
10
|
declare const devCommand: citty0.CommandDef<{
|
|
12
|
-
cwd: {
|
|
13
|
-
type: "string";
|
|
14
|
-
description:
|
|
11
|
+
readonly cwd: {
|
|
12
|
+
readonly type: "string";
|
|
13
|
+
readonly description: "Working directory";
|
|
15
14
|
};
|
|
16
|
-
port: {
|
|
17
|
-
type: "string";
|
|
18
|
-
alias:
|
|
19
|
-
default:
|
|
20
|
-
description:
|
|
15
|
+
readonly port: {
|
|
16
|
+
readonly type: "string";
|
|
17
|
+
readonly alias: "p";
|
|
18
|
+
readonly default: "4000";
|
|
19
|
+
readonly description: "Server port";
|
|
21
20
|
};
|
|
22
|
-
host: {
|
|
23
|
-
type: "string";
|
|
24
|
-
alias:
|
|
25
|
-
default:
|
|
26
|
-
description:
|
|
21
|
+
readonly host: {
|
|
22
|
+
readonly type: "string";
|
|
23
|
+
readonly alias: "H";
|
|
24
|
+
readonly default: "localhost";
|
|
25
|
+
readonly description: "Server host";
|
|
27
26
|
};
|
|
28
|
-
open: {
|
|
29
|
-
type: "boolean";
|
|
30
|
-
alias:
|
|
31
|
-
description:
|
|
27
|
+
readonly open: {
|
|
28
|
+
readonly type: "boolean";
|
|
29
|
+
readonly alias: "o";
|
|
30
|
+
readonly description: "Open browser";
|
|
32
31
|
};
|
|
33
|
-
watch: {
|
|
34
|
-
type: "boolean";
|
|
35
|
-
alias:
|
|
36
|
-
default: true;
|
|
37
|
-
description:
|
|
32
|
+
readonly watch: {
|
|
33
|
+
readonly type: "boolean";
|
|
34
|
+
readonly alias: "w";
|
|
35
|
+
readonly default: true;
|
|
36
|
+
readonly description: "Enable file watching for hot reload";
|
|
38
37
|
};
|
|
39
38
|
}>;
|
|
40
39
|
//#endregion
|
|
@@ -9,7 +9,7 @@ import { scanSchemasCore } from "../../core/scanning/schemas.mjs";
|
|
|
9
9
|
import { buildGraphQLSchema } from "../../core/schema/builder.mjs";
|
|
10
10
|
import { existsSync_, mkdirSync_, onSignal, readFileSync_, writeFileSync_ } from "../../core/utils/runtime.mjs";
|
|
11
11
|
import consola from "consola";
|
|
12
|
-
import { dirname, join, relative, resolve } from "pathe";
|
|
12
|
+
import { dirname, join, relative, resolve as resolve$1 } from "pathe";
|
|
13
13
|
|
|
14
14
|
//#region src/cli/commands/generate.ts
|
|
15
15
|
const logger = consola.withTag(LOG_TAG);
|
|
@@ -67,7 +67,7 @@ async function generateServer(ctx, options = {}) {
|
|
|
67
67
|
writeFileSync_(schemaPath, result.schemaString);
|
|
68
68
|
const typesConfig = ctx.config.types;
|
|
69
69
|
let typesPath;
|
|
70
|
-
if (typesConfig && typeof typesConfig === "object" && typeof typesConfig.server === "string") typesPath = resolve(ctx.config.rootDir, typesConfig.server);
|
|
70
|
+
if (typesConfig && typeof typesConfig === "object" && typeof typesConfig.server === "string") typesPath = resolve$1(ctx.config.rootDir, typesConfig.server);
|
|
71
71
|
else typesPath = join(ctx.config.typesDir, "nitro-graphql-server.d.ts");
|
|
72
72
|
mkdirSync_(dirname(typesPath));
|
|
73
73
|
writeFileSync_(typesPath, result.types);
|
|
@@ -104,7 +104,7 @@ async function generateClient(ctx, options = {}) {
|
|
|
104
104
|
}
|
|
105
105
|
const typesConfig = ctx.config.types;
|
|
106
106
|
let typesPath;
|
|
107
|
-
if (typesConfig && typeof typesConfig === "object" && typeof typesConfig.client === "string") typesPath = resolve(ctx.config.rootDir, typesConfig.client);
|
|
107
|
+
if (typesConfig && typeof typesConfig === "object" && typeof typesConfig.client === "string") typesPath = resolve$1(ctx.config.rootDir, typesConfig.client);
|
|
108
108
|
else typesPath = join(ctx.config.typesDir, "nitro-graphql-client.d.ts");
|
|
109
109
|
mkdirSync_(dirname(typesPath));
|
|
110
110
|
writeFileSync_(typesPath, result.types);
|
|
@@ -163,8 +163,8 @@ async function watchAndRegenerate(ctx, options = {}) {
|
|
|
163
163
|
],
|
|
164
164
|
persistent: true
|
|
165
165
|
});
|
|
166
|
-
await new Promise((resolve
|
|
167
|
-
watcher.on("ready", resolve
|
|
166
|
+
await new Promise((resolve) => {
|
|
167
|
+
watcher.on("ready", resolve);
|
|
168
168
|
watcher.on("error", (error) => logger.error("Watcher error:", error));
|
|
169
169
|
});
|
|
170
170
|
const relPath = (p) => relative(ctx.config.rootDir, p) || ".";
|
package/dist/cli/config.d.mts
CHANGED
package/dist/cli/index.d.mts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
1
|
import { NitroGraphQLOptions } from "../nitro/types.mjs";
|
|
3
2
|
import { CLIConfig, defineConfig } from "./config.mjs";
|
|
4
3
|
|
|
5
4
|
//#region src/cli/index.d.ts
|
|
6
|
-
|
|
7
5
|
/**
|
|
8
6
|
* CLI context with resolved configuration
|
|
9
7
|
* Uses NitroGraphQLOptions directly as CLI and module options are now unified
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { plugin } from "../../node_modules/.pnpm/crossws@0.4.1_srvx@0.10.0/node_modules/crossws/dist/server/node.mjs";
|
|
2
1
|
import { createDebugHandler } from "./debug-handler.mjs";
|
|
3
2
|
import { createGraphQLHandler, getServerInstance, reloadGraphQLHandler } from "./graphql-handler.mjs";
|
|
4
3
|
import { createHealthHandler } from "./health-handler.mjs";
|
|
5
4
|
import { createSandboxHandler } from "./sandbox-handler.mjs";
|
|
6
5
|
import { createWebSocketPlugin } from "./ws-handler.mjs";
|
|
7
6
|
import consola from "consola";
|
|
7
|
+
import { plugin } from "crossws/server";
|
|
8
8
|
import { serve } from "srvx";
|
|
9
9
|
|
|
10
10
|
//#region src/cli/server/dev-server.ts
|
|
@@ -124,10 +124,10 @@ async function generateClientTypesCore(input) {
|
|
|
124
124
|
});
|
|
125
125
|
return {
|
|
126
126
|
types: output,
|
|
127
|
-
sdk: (await Promise.all(sdkOutput.map(async (config
|
|
127
|
+
sdk: (await Promise.all(sdkOutput.map(async (config) => {
|
|
128
128
|
return {
|
|
129
|
-
file: config
|
|
130
|
-
content: await codegen(config
|
|
129
|
+
file: config.filename,
|
|
130
|
+
content: await codegen(config)
|
|
131
131
|
};
|
|
132
132
|
})))[0]?.content || ""
|
|
133
133
|
};
|
package/dist/core/config.d.mts
CHANGED
|
@@ -17,7 +17,7 @@ async function scanDocumentsCore(ctx, options = {}) {
|
|
|
17
17
|
return {
|
|
18
18
|
items: allFiles.filter((f) => !f.path.startsWith("external/")).filter((f) => {
|
|
19
19
|
const relativePath = f.path;
|
|
20
|
-
for (const pattern of externalPatterns) if (pattern.replace(
|
|
20
|
+
for (const pattern of externalPatterns) if (pattern.replace(new RegExp(`^${clientDirRelative.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}/`), "").split("/")[0] === relativePath.split("/")[0]) return false;
|
|
21
21
|
return true;
|
|
22
22
|
}).map((f) => f.fullPath),
|
|
23
23
|
warnings,
|
|
@@ -13,7 +13,7 @@ import { makeExecutableSchema } from "@graphql-tools/schema";
|
|
|
13
13
|
async function createMergedSchema(options) {
|
|
14
14
|
const { schemas, resolvers, directives, moduleConfig } = options;
|
|
15
15
|
try {
|
|
16
|
-
const typeDefs = mergeTypeDefs([schemas.map((schema
|
|
16
|
+
const typeDefs = mergeTypeDefs([schemas.map((schema) => schema.def).join("\n\n")], {
|
|
17
17
|
throwOnConflict: true,
|
|
18
18
|
commentDescriptions: true,
|
|
19
19
|
sort: true
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { GraphQLSchema } from "graphql";
|
|
2
2
|
|
|
3
3
|
//#region src/core/types/define.d.ts
|
|
4
|
-
|
|
5
4
|
type Flatten<T> = T extends infer U ? { [K in keyof U]: U[K] } : never;
|
|
6
5
|
type DirectiveLocationName = 'QUERY' | 'MUTATION' | 'SUBSCRIPTION' | 'FIELD' | 'FRAGMENT_DEFINITION' | 'FRAGMENT_SPREAD' | 'INLINE_FRAGMENT' | 'VARIABLE_DEFINITION' | 'SCHEMA' | 'SCALAR' | 'OBJECT' | 'FIELD_DEFINITION' | 'ARGUMENT_DEFINITION' | 'INTERFACE' | 'UNION' | 'ENUM' | 'ENUM_VALUE' | 'INPUT_OBJECT' | 'INPUT_FIELD_DEFINITION';
|
|
7
6
|
type GraphQLScalarType = 'String' | 'Int' | 'Float' | 'Boolean' | 'ID' | 'JSON' | 'DateTime';
|
package/dist/define.d.mts
CHANGED
package/dist/nitro/adapter.d.mts
CHANGED
package/dist/nitro/codegen.d.mts
CHANGED
package/dist/nitro/config.d.mts
CHANGED
package/dist/nitro/index.d.mts
CHANGED
|
@@ -6,7 +6,6 @@ import { NitroModule } from "nitro/types";
|
|
|
6
6
|
import { Plugin } from "vite";
|
|
7
7
|
|
|
8
8
|
//#region src/nitro/index.d.ts
|
|
9
|
-
|
|
10
9
|
/**
|
|
11
10
|
* Vite plugin to load GraphQL files as strings AND auto-register Nitro module
|
|
12
11
|
* This prevents Vite from trying to parse .graphql/.gql files as JavaScript
|
package/dist/nitro/paths.d.mts
CHANGED
package/dist/nitro/rollup.mjs
CHANGED
|
@@ -6,11 +6,11 @@ import { parse } from "graphql";
|
|
|
6
6
|
//#region src/nitro/rollup.ts
|
|
7
7
|
async function rollupConfig(nitro) {
|
|
8
8
|
registerAllVirtualModules(nitro);
|
|
9
|
-
nitro.hooks.hook("rollup:before", (_, rollupConfig
|
|
10
|
-
rollupConfig
|
|
9
|
+
nitro.hooks.hook("rollup:before", (_, rollupConfig) => {
|
|
10
|
+
rollupConfig.plugins = rollupConfig.plugins || [];
|
|
11
11
|
const { include = /\.(?:graphql|gql)$/i, exclude, validate = false } = nitro.options.graphql?.loader || {};
|
|
12
|
-
if (Array.isArray(rollupConfig
|
|
13
|
-
rollupConfig
|
|
12
|
+
if (Array.isArray(rollupConfig.plugins)) {
|
|
13
|
+
rollupConfig.plugins.push({
|
|
14
14
|
name: "nitro-graphql",
|
|
15
15
|
resolveId: {
|
|
16
16
|
order: "pre",
|
|
@@ -35,7 +35,7 @@ async function rollupConfig(nitro) {
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
|
-
if (nitro.options.dev) rollupConfig
|
|
38
|
+
if (nitro.options.dev) rollupConfig.plugins.push({
|
|
39
39
|
name: "nitro-graphql-watcher",
|
|
40
40
|
buildStart: {
|
|
41
41
|
order: "pre",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as nitro_h33 from "nitro/h3";
|
|
2
2
|
|
|
3
3
|
//#region src/nitro/routes/apollo-server.d.ts
|
|
4
|
-
declare const _default:
|
|
4
|
+
declare const _default: nitro_h33.EventHandlerWithFetch<nitro_h33.EventHandlerRequest, Promise<any>>;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { _default as default };
|