@ptdgrp/typedgql 1.0.0-beta.8
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/LICENSE +45 -0
- package/README.md +121 -0
- package/README.zh-CN.md +113 -0
- package/dist/index.cjs +911 -0
- package/dist/index.d.cts +299 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +299 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +896 -0
- package/dist/index.mjs.map +1 -0
- package/dist/node.cjs +6 -0
- package/dist/node.d.cts +41 -0
- package/dist/node.d.cts.map +1 -0
- package/dist/node.d.mts +41 -0
- package/dist/node.d.mts.map +1 -0
- package/dist/node.mjs +3 -0
- package/dist/options-CaWo97vV.d.cts +99 -0
- package/dist/options-CaWo97vV.d.cts.map +1 -0
- package/dist/options-D2L-tv7C.d.mts +99 -0
- package/dist/options-D2L-tv7C.d.mts.map +1 -0
- package/dist/schema-loader-BeukhrkU.cjs +1915 -0
- package/dist/schema-loader-CYFTxUkG.mjs +1899 -0
- package/dist/schema-loader-CYFTxUkG.mjs.map +1 -0
- package/dist/vite.cjs +148 -0
- package/dist/vite.d.cts +61 -0
- package/dist/vite.d.cts.map +1 -0
- package/dist/vite.d.mts +61 -0
- package/dist/vite.d.mts.map +1 -0
- package/dist/vite.mjs +148 -0
- package/dist/vite.mjs.map +1 -0
- package/package.json +87 -0
package/dist/vite.mjs
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { n as loadRemoteSchema, r as Generator, t as loadLocalSchema } from "./schema-loader-CYFTxUkG.mjs";
|
|
2
|
+
import { readFile, realpath } from "node:fs/promises";
|
|
3
|
+
import { createHash } from "node:crypto";
|
|
4
|
+
import { resolve } from "node:path";
|
|
5
|
+
import { normalizePath } from "vite";
|
|
6
|
+
|
|
7
|
+
//#region src/vite-plugin.ts
|
|
8
|
+
/**
|
|
9
|
+
* Vite plugin for @ptdgrp/typedgql — runs codegen automatically.
|
|
10
|
+
*/
|
|
11
|
+
function isRemote(schema) {
|
|
12
|
+
return /^https?:\/\//.test(schema);
|
|
13
|
+
}
|
|
14
|
+
function makeSchemaLoader(schema, headers) {
|
|
15
|
+
return isRemote(schema) ? () => loadRemoteSchema(schema, headers) : () => loadLocalSchema(schema);
|
|
16
|
+
}
|
|
17
|
+
function resolveDevDependencyHmr(option) {
|
|
18
|
+
if (!option) return void 0;
|
|
19
|
+
if (option === true) return { strategy: "reload" };
|
|
20
|
+
return { strategy: option.strategy ?? "reload" };
|
|
21
|
+
}
|
|
22
|
+
function buildNegatedWatchPattern(packageName) {
|
|
23
|
+
return `!**/node_modules/${packageName}/**`;
|
|
24
|
+
}
|
|
25
|
+
const DEV_DEP_HMR_PACKAGE_NAME = "@ptdgrp/typedgql";
|
|
26
|
+
const DEV_DEP_HMR_WATCH_DIRS = ["dist"];
|
|
27
|
+
async function hashFile(path) {
|
|
28
|
+
try {
|
|
29
|
+
const content = await readFile(path);
|
|
30
|
+
return createHash("sha256").update(content).digest("hex");
|
|
31
|
+
} catch {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Vite plugin that runs typedgql codegen automatically.
|
|
37
|
+
*
|
|
38
|
+
* - **Local schema** — runs once on startup, then watches for file changes.
|
|
39
|
+
* - **Remote schema** — runs on every `vite dev` / `vite build` invocation.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* // vite.config.ts
|
|
44
|
+
* import { typedgql } from "@ptdgrp/typedgql/vite";
|
|
45
|
+
*
|
|
46
|
+
* export default defineConfig({
|
|
47
|
+
* plugins: [
|
|
48
|
+
* // local file
|
|
49
|
+
* typedgql({ schema: "./schema.graphql" }),
|
|
50
|
+
* // or remote endpoint
|
|
51
|
+
* typedgql({ schema: "http://localhost:4000/graphql" }),
|
|
52
|
+
* ],
|
|
53
|
+
* });
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
function typedgql(options) {
|
|
57
|
+
const { schema, schemaHeaders, devDependencyHmr, ...generatorOptions } = options;
|
|
58
|
+
const remote = isRemote(schema);
|
|
59
|
+
const depHmr = resolveDevDependencyHmr(devDependencyHmr);
|
|
60
|
+
const codegenOptions = {
|
|
61
|
+
...generatorOptions,
|
|
62
|
+
schemaLoader: makeSchemaLoader(schema, schemaHeaders)
|
|
63
|
+
};
|
|
64
|
+
let isRunning = false;
|
|
65
|
+
let isDependencyRefreshRunning = false;
|
|
66
|
+
let lastSchemaHash;
|
|
67
|
+
let initSchemaHashPromise;
|
|
68
|
+
let resolvedConfig;
|
|
69
|
+
let logger;
|
|
70
|
+
async function runCodegen(trigger) {
|
|
71
|
+
if (isRunning) return;
|
|
72
|
+
isRunning = true;
|
|
73
|
+
const label = `\x1b[36m[typedgql:${trigger}]\x1b[0m`;
|
|
74
|
+
try {
|
|
75
|
+
await new Generator(codegenOptions).generate();
|
|
76
|
+
} catch (err) {
|
|
77
|
+
logger.error(`${label} failed: ${err}`);
|
|
78
|
+
} finally {
|
|
79
|
+
isRunning = false;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
name: "vite-plugin-typedgql",
|
|
84
|
+
config(config) {
|
|
85
|
+
if (!depHmr) return;
|
|
86
|
+
const negatedPattern = buildNegatedWatchPattern(DEV_DEP_HMR_PACKAGE_NAME);
|
|
87
|
+
const exclude = new Set(config.optimizeDeps?.exclude ?? []);
|
|
88
|
+
exclude.add(DEV_DEP_HMR_PACKAGE_NAME);
|
|
89
|
+
const watchIgnored = config.server?.watch?.ignored;
|
|
90
|
+
const mergedIgnored = Array.isArray(watchIgnored) ? [...watchIgnored, negatedPattern] : watchIgnored === void 0 ? [negatedPattern] : watchIgnored;
|
|
91
|
+
return {
|
|
92
|
+
optimizeDeps: { exclude: Array.from(exclude) },
|
|
93
|
+
server: { watch: { ignored: mergedIgnored } }
|
|
94
|
+
};
|
|
95
|
+
},
|
|
96
|
+
configResolved(cfg) {
|
|
97
|
+
resolvedConfig = cfg;
|
|
98
|
+
logger = cfg.logger;
|
|
99
|
+
},
|
|
100
|
+
async buildStart() {
|
|
101
|
+
await runCodegen(resolvedConfig?.command === "build" ? "build" : "start");
|
|
102
|
+
},
|
|
103
|
+
configureServer(server) {
|
|
104
|
+
if (depHmr) {
|
|
105
|
+
const packageRoot = normalizePath(resolve(server.config.root, "node_modules", DEV_DEP_HMR_PACKAGE_NAME));
|
|
106
|
+
const watchedDirs = DEV_DEP_HMR_WATCH_DIRS.map((dir) => normalizePath(resolve(packageRoot, dir)));
|
|
107
|
+
for (const dir of watchedDirs) server.watcher.add(dir);
|
|
108
|
+
server.watcher.on("change", async (file) => {
|
|
109
|
+
const changedPath = normalizePath(file);
|
|
110
|
+
if (!watchedDirs.some((dir) => changedPath.startsWith(dir))) return;
|
|
111
|
+
if (isDependencyRefreshRunning) return;
|
|
112
|
+
isDependencyRefreshRunning = true;
|
|
113
|
+
try {
|
|
114
|
+
if (depHmr.strategy === "restart") await server.restart();
|
|
115
|
+
else server.ws.send({ type: "full-reload" });
|
|
116
|
+
} finally {
|
|
117
|
+
isDependencyRefreshRunning = false;
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
if (remote) return;
|
|
122
|
+
const root = server.config.root;
|
|
123
|
+
const schemaPath = normalizePath(resolve(root, schema));
|
|
124
|
+
let realSchemaPath = schemaPath;
|
|
125
|
+
realpath(schemaPath).then((actualPath) => {
|
|
126
|
+
realSchemaPath = normalizePath(actualPath);
|
|
127
|
+
}).catch(() => {});
|
|
128
|
+
server.watcher.add(schemaPath);
|
|
129
|
+
initSchemaHashPromise = hashFile(schemaPath).then((hash) => {
|
|
130
|
+
lastSchemaHash = hash;
|
|
131
|
+
});
|
|
132
|
+
server.watcher.on("change", async (file) => {
|
|
133
|
+
const changedPath = normalizePath(file);
|
|
134
|
+
if (changedPath !== schemaPath && changedPath !== realSchemaPath) return;
|
|
135
|
+
await initSchemaHashPromise;
|
|
136
|
+
const nextHash = await hashFile(schemaPath);
|
|
137
|
+
if (nextHash && nextHash === lastSchemaHash) return;
|
|
138
|
+
await runCodegen("watch");
|
|
139
|
+
if (nextHash) lastSchemaHash = nextHash;
|
|
140
|
+
server.ws.send({ type: "full-reload" });
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
//#endregion
|
|
147
|
+
export { typedgql };
|
|
148
|
+
//# sourceMappingURL=vite.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite.mjs","names":[],"sources":["../src/vite-plugin.ts"],"sourcesContent":["/**\n * Vite plugin for @ptdgrp/typedgql — runs codegen automatically.\n */\n\nimport { realpath } from \"node:fs/promises\";\nimport { createHash } from \"node:crypto\";\nimport { readFile } from \"node:fs/promises\";\nimport { resolve } from \"node:path\";\nimport type { Plugin, ResolvedConfig, Logger, UserConfig } from \"vite\";\nimport { normalizePath } from \"vite\";\nimport { Generator } from \"./codegen/generator\";\nimport { loadLocalSchema, loadRemoteSchema } from \"./codegen/schema-loader\";\nimport type { CodegenOptions } from \"./codegen/options\";\n\nexport interface DevDependencyHmrOptions {\n /**\n * How to refresh dev server when watched dependency files change.\n *\n * - \"reload\": send full page reload\n * - \"restart\": restart Vite dev server\n *\n * @default \"reload\"\n */\n strategy?: \"reload\" | \"restart\";\n}\n\nexport interface TypedGqlPluginOptions extends Omit<\n CodegenOptions,\n \"schemaLoader\"\n> {\n /**\n * GraphQL schema source.\n * - Local file path: `\"./schema.graphql\"`\n * - Remote endpoint: `\"http://localhost:4000/graphql\"`\n *\n * Local file → codegen runs on startup, then re-runs on every file change.\n * Remote URL → codegen runs on every `vite dev` / `vite build` invocation.\n */\n schema: string;\n /**\n * HTTP headers forwarded when fetching a remote schema.\n * Only used when `schema` is a URL.\n */\n schemaHeaders?: Record<string, string>;\n /**\n * Optional dev-time watcher for dependency files in node_modules.\n * Useful when developing typedgql as an installed package rather than workspace source.\n */\n devDependencyHmr?: boolean | DevDependencyHmrOptions;\n}\n\nfunction isRemote(schema: string): boolean {\n return /^https?:\\/\\//.test(schema);\n}\n\nfunction makeSchemaLoader(\n schema: string,\n headers?: Record<string, string>,\n): () => Promise<import(\"graphql\").GraphQLSchema> {\n return isRemote(schema)\n ? () => loadRemoteSchema(schema, headers)\n : () => loadLocalSchema(schema);\n}\n\nfunction resolveDevDependencyHmr(\n option: boolean | DevDependencyHmrOptions | undefined,\n): { strategy: \"reload\" | \"restart\" } | undefined {\n if (!option) return undefined;\n if (option === true) {\n return { strategy: \"reload\" };\n }\n return { strategy: option.strategy ?? \"reload\" };\n}\n\nfunction buildNegatedWatchPattern(packageName: string): string {\n return `!**/node_modules/${packageName}/**`;\n}\n\nconst DEV_DEP_HMR_PACKAGE_NAME = \"@ptdgrp/typedgql\";\nconst DEV_DEP_HMR_WATCH_DIRS = [\"dist\"] as const;\n\nasync function hashFile(path: string): Promise<string | undefined> {\n try {\n const content = await readFile(path);\n return createHash(\"sha256\").update(content).digest(\"hex\");\n } catch {\n return undefined;\n }\n}\n\n/**\n * Vite plugin that runs typedgql codegen automatically.\n *\n * - **Local schema** — runs once on startup, then watches for file changes.\n * - **Remote schema** — runs on every `vite dev` / `vite build` invocation.\n *\n * @example\n * ```ts\n * // vite.config.ts\n * import { typedgql } from \"@ptdgrp/typedgql/vite\";\n *\n * export default defineConfig({\n * plugins: [\n * // local file\n * typedgql({ schema: \"./schema.graphql\" }),\n * // or remote endpoint\n * typedgql({ schema: \"http://localhost:4000/graphql\" }),\n * ],\n * });\n * ```\n */\nexport function typedgql(options: TypedGqlPluginOptions): Plugin {\n const { schema, schemaHeaders, devDependencyHmr, ...generatorOptions } = options;\n const remote = isRemote(schema);\n const depHmr = resolveDevDependencyHmr(devDependencyHmr);\n\n const codegenOptions: CodegenOptions = {\n ...generatorOptions,\n schemaLoader: makeSchemaLoader(schema, schemaHeaders),\n };\n\n let isRunning = false;\n let isDependencyRefreshRunning = false;\n let lastSchemaHash: string | undefined;\n let initSchemaHashPromise: Promise<void> | undefined;\n let resolvedConfig: ResolvedConfig;\n let logger: Logger;\n\n async function runCodegen(trigger: string) {\n if (isRunning) return;\n isRunning = true;\n const label = `\\x1b[36m[typedgql:${trigger}]\\x1b[0m`;\n try {\n // logger.info(`${label} running codegen (schema: ${schema})`);\n const generator = new Generator(codegenOptions);\n await generator.generate();\n // logger.info(`${label} done`);\n } catch (err) {\n logger.error(`${label} failed: ${err}`);\n } finally {\n isRunning = false;\n }\n }\n\n return {\n name: \"vite-plugin-typedgql\",\n\n config(config): UserConfig | void {\n if (!depHmr) return;\n const negatedPattern = buildNegatedWatchPattern(DEV_DEP_HMR_PACKAGE_NAME);\n const exclude = new Set(config.optimizeDeps?.exclude ?? []);\n exclude.add(DEV_DEP_HMR_PACKAGE_NAME);\n const watchIgnored = config.server?.watch?.ignored;\n const mergedIgnored = Array.isArray(watchIgnored)\n ? [...watchIgnored, negatedPattern]\n : watchIgnored === undefined\n ? [negatedPattern]\n : watchIgnored;\n return {\n optimizeDeps: {\n exclude: Array.from(exclude),\n },\n server: {\n watch: {\n ignored: mergedIgnored,\n },\n },\n };\n },\n\n configResolved(cfg) {\n resolvedConfig = cfg;\n logger = cfg.logger;\n },\n\n /**\n * Runs on every `vite build` and on `vite dev` startup.\n * For remote schemas this is the only trigger.\n * For local schemas this handles the initial run; the watcher handles subsequent ones.\n */\n async buildStart() {\n const trigger = resolvedConfig?.command === \"build\" ? \"build\" : \"start\";\n await runCodegen(trigger);\n },\n\n /**\n * Dev-only: watch the local schema file and re-run on change.\n * Not registered for remote schemas — those re-run on the next dev/build start.\n */\n configureServer(server) {\n if (depHmr) {\n const packageRoot = normalizePath(\n resolve(server.config.root, \"node_modules\", DEV_DEP_HMR_PACKAGE_NAME),\n );\n const watchedDirs = DEV_DEP_HMR_WATCH_DIRS.map((dir) =>\n normalizePath(resolve(packageRoot, dir)),\n );\n for (const dir of watchedDirs) {\n server.watcher.add(dir);\n }\n server.watcher.on(\"change\", async (file) => {\n const changedPath = normalizePath(file);\n if (!watchedDirs.some((dir) => changedPath.startsWith(dir))) return;\n if (isDependencyRefreshRunning) return;\n isDependencyRefreshRunning = true;\n try {\n if (depHmr.strategy === \"restart\") {\n await server.restart();\n } else {\n server.ws.send({ type: \"full-reload\" });\n }\n } finally {\n isDependencyRefreshRunning = false;\n }\n });\n }\n\n if (remote) return;\n\n const root = server.config.root;\n const schemaPath = normalizePath(resolve(root, schema));\n let realSchemaPath = schemaPath;\n void realpath(schemaPath)\n .then((actualPath) => {\n realSchemaPath = normalizePath(actualPath);\n })\n .catch(() => {\n // Ignore when schema path is not resolvable yet.\n });\n\n server.watcher.add(schemaPath);\n initSchemaHashPromise = hashFile(schemaPath).then((hash) => {\n lastSchemaHash = hash;\n });\n server.watcher.on(\"change\", async (file) => {\n const changedPath = normalizePath(file);\n if (changedPath !== schemaPath && changedPath !== realSchemaPath) return;\n await initSchemaHashPromise;\n const nextHash = await hashFile(schemaPath);\n if (nextHash && nextHash === lastSchemaHash) return;\n await runCodegen(\"watch\");\n if (nextHash) {\n lastSchemaHash = nextHash;\n }\n server.ws.send({ type: \"full-reload\" });\n });\n },\n };\n}\n"],"mappings":";;;;;;;;;;AAmDA,SAAS,SAAS,QAAyB;AACzC,QAAO,eAAe,KAAK,OAAO;;AAGpC,SAAS,iBACP,QACA,SACgD;AAChD,QAAO,SAAS,OAAO,SACb,iBAAiB,QAAQ,QAAQ,SACjC,gBAAgB,OAAO;;AAGnC,SAAS,wBACP,QACgD;AAChD,KAAI,CAAC,OAAQ,QAAO;AACpB,KAAI,WAAW,KACb,QAAO,EAAE,UAAU,UAAU;AAE/B,QAAO,EAAE,UAAU,OAAO,YAAY,UAAU;;AAGlD,SAAS,yBAAyB,aAA6B;AAC7D,QAAO,oBAAoB,YAAY;;AAGzC,MAAM,2BAA2B;AACjC,MAAM,yBAAyB,CAAC,OAAO;AAEvC,eAAe,SAAS,MAA2C;AAC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,87 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ptdgrp/typedgql",
|
|
3
|
+
"version": "1.0.0-beta.8",
|
|
4
|
+
"description": "Strongly typed GraphQL client code generator and runtime",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"author": "tonitrnel",
|
|
7
|
+
"contributors": [
|
|
8
|
+
{
|
|
9
|
+
"name": "ChenTao",
|
|
10
|
+
"url": "https://github.com/babyfish-ct"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "https://github.com/tonitrnel/typedgql"
|
|
17
|
+
},
|
|
18
|
+
"main": "./dist/index.cjs",
|
|
19
|
+
"module": "./dist/index.mjs",
|
|
20
|
+
"types": "./index.ts",
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"import": {
|
|
24
|
+
"types": "./index.ts",
|
|
25
|
+
"default": "./index.ts"
|
|
26
|
+
},
|
|
27
|
+
"require": {
|
|
28
|
+
"types": "./dist/index.d.cts",
|
|
29
|
+
"default": "./dist/index.cjs"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"./vite": {
|
|
33
|
+
"import": {
|
|
34
|
+
"types": "./dist/vite.d.mts",
|
|
35
|
+
"default": "./dist/vite.mjs"
|
|
36
|
+
},
|
|
37
|
+
"require": {
|
|
38
|
+
"types": "./dist/vite.d.cts",
|
|
39
|
+
"default": "./dist/vite.cjs"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"./node": {
|
|
43
|
+
"import": {
|
|
44
|
+
"types": "./dist/node.d.mts",
|
|
45
|
+
"default": "./dist/node.mjs"
|
|
46
|
+
},
|
|
47
|
+
"require": {
|
|
48
|
+
"types": "./dist/node.d.cts",
|
|
49
|
+
"default": "./dist/node.cjs"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"files": [
|
|
54
|
+
"/dist"
|
|
55
|
+
],
|
|
56
|
+
"engines": {
|
|
57
|
+
"node": ">=18"
|
|
58
|
+
},
|
|
59
|
+
"scripts": {
|
|
60
|
+
"build": "tsdown",
|
|
61
|
+
"dev": "tsdown --watch",
|
|
62
|
+
"test": "vitest --run",
|
|
63
|
+
"test:coverage": "vitest --run --coverage"
|
|
64
|
+
},
|
|
65
|
+
"peerDependencies": {
|
|
66
|
+
"graphql": ">=15.0.0",
|
|
67
|
+
"typescript": ">=5.0.0",
|
|
68
|
+
"vite": ">=5.0.0"
|
|
69
|
+
},
|
|
70
|
+
"peerDependenciesMeta": {
|
|
71
|
+
"vite": {
|
|
72
|
+
"optional": true
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"devDependencies": {
|
|
76
|
+
"@types/node": "^25.3.0",
|
|
77
|
+
"@vitest/coverage-v8": "^4.0.18",
|
|
78
|
+
"fast-check": "^4.5.3",
|
|
79
|
+
"graphql": "^16.0.0",
|
|
80
|
+
"tsdown": "0.20.3",
|
|
81
|
+
"typescript": "^5.8.0",
|
|
82
|
+
"vitest": "^4.0.18"
|
|
83
|
+
},
|
|
84
|
+
"dependencies": {
|
|
85
|
+
"tsd": "^0.33.0"
|
|
86
|
+
}
|
|
87
|
+
}
|