@corpdk/codegen-cli 2026.10.0-alpha.3 → 2026.10.0-alpha.5

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.
@@ -0,0 +1,3 @@
1
+ import type { OperationDescriptor } from "./schema-utils.js";
2
+ import type { Config } from "./index.js";
3
+ export declare function generateCli(ops: OperationDescriptor[], config: Config): string;
@@ -0,0 +1,2 @@
1
+ import type { OperationDescriptor } from "./schema-utils.js";
2
+ export declare function generateInfo(ops: OperationDescriptor[]): string;
@@ -0,0 +1,2 @@
1
+ import type { OperationDescriptor } from "./schema-utils.js";
2
+ export declare function generateMan(ops: OperationDescriptor[]): string;
package/dist/index.d.ts CHANGED
@@ -1,11 +1,8 @@
1
- import { Types } from '@graphql-codegen/plugin-helpers';
2
-
3
- interface Config {
1
+ import type { Types } from "@graphql-codegen/plugin-helpers";
2
+ export interface Config {
4
3
  /** Name of the env var that holds the HTTP endpoint. Default: DS_HTTP_URL */
5
4
  httpUrlEnvVar?: string;
6
5
  /** Name of the env var that holds the WebSocket endpoint. Default: DS_WS_URL */
7
6
  wsUrlEnvVar?: string;
8
7
  }
9
- declare const preset: Types.OutputPreset<Config>;
10
-
11
- export { type Config, preset };
8
+ export declare const preset: Types.OutputPreset<Config>;
package/dist/index.js CHANGED
@@ -354,7 +354,7 @@ function generateCli(ops, config) {
354
354
  "#!/usr/bin/env node",
355
355
  "// @generated \u2014 do not edit manually",
356
356
  "// Regenerate by running: pnpm codegen (in your DS package)",
357
- "// Requires Node 18+ (fetch) and Node 22+ (WebSocket)",
357
+ "// Requires Node 24+ (fetch, WebSocket)",
358
358
  "",
359
359
  'import { parseArgs } from "node:util";',
360
360
  'import { readFileSync } from "node:fs";',
@@ -0,0 +1,24 @@
1
+ import { type GraphQLSchema } from "graphql";
2
+ export type OperationType = "query" | "mutation" | "subscription";
3
+ export interface ArgDescriptor {
4
+ name: string;
5
+ /** Full GraphQL type string, e.g. "ID!", "String", "[Item!]!" */
6
+ graphqlType: string;
7
+ /** Type for node:util parseArgs — scalars other than Boolean become "string" */
8
+ parseType: "string" | "boolean";
9
+ description: string;
10
+ required: boolean;
11
+ }
12
+ export interface OperationDescriptor {
13
+ operationType: OperationType;
14
+ /** camelCase field name from the schema, e.g. "createItem" */
15
+ fieldName: string;
16
+ /** kebab-case command name for the CLI, e.g. "create-item" */
17
+ commandName: string;
18
+ description: string;
19
+ args: ArgDescriptor[];
20
+ /** Ready-to-execute GraphQL document string */
21
+ document: string;
22
+ }
23
+ /** Extract all query/mutation/subscription operations from a GraphQLSchema. */
24
+ export declare function extractOperations(schema: GraphQLSchema): OperationDescriptor[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corpdk/codegen-cli",
3
- "version": "2026.10.0-alpha.3",
3
+ "version": "2026.10.0-alpha.5",
4
4
  "description": "GraphQL Code Generator plugin for resolver types and TypedDocumentNode SDK output",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -16,9 +16,13 @@
16
16
  "dist",
17
17
  "README.md"
18
18
  ],
19
+ "types": "./dist/index.d.ts",
19
20
  "main": "./dist/index.js",
20
21
  "exports": {
21
- ".": "./dist/index.js"
22
+ ".": {
23
+ "types": "./dist/index.d.ts",
24
+ "import": "./dist/index.js"
25
+ }
22
26
  },
23
27
  "devDependencies": {
24
28
  "@graphql-codegen/plugin-helpers": "^6.2.0",
@@ -30,8 +34,11 @@
30
34
  "graphql": "^16.0.0"
31
35
  },
32
36
  "license": "MIT",
37
+ "engines": {
38
+ "node": ">=24.0.0"
39
+ },
33
40
  "scripts": {
34
- "build": "tsup src/index.ts --format esm --dts",
41
+ "build": "tsup src/index.ts --format esm && pnpm exec tsc -p tsconfig.json --emitDeclarationOnly",
35
42
  "clean": "rm -rf dist node_modules .turbo *.tsbuildinfo"
36
43
  }
37
44
  }