Skip to content

Commit 65b829b

Browse files
yyyyaaaclaude
andcommitted
fix(graphql-query): address PR review (drop .js, use @constructive-io/fetch, drop exports)
Three review comments from pyramation: 1. graphql/query/src/runtime/index.ts — drop `.js` extensions from relative re-exports; the monorepo is CJS, not ESM. 2. graphql/query/src/runtime/localhost-fetch.ts — replace with @constructive-io/fetch (the shipped, single-purpose package from constructive-io/dev-utils). Identical createFetch / FetchFunction surface; same fix for *.localhost DNS + Host header. File deleted in favor of the dependency. 3. graphql/query/package.json — drop the `exports` map; monorepo convention is main/module/types only. Sub-path `@constructive-io/graphql-query/runtime` still resolves via filesystem walk under classic moduleResolution: node. Verified: graphql/query builds and tests pass (18 tests, 29 snapshots); constructive-sdk builds clean and `require.resolve` resolves the sub-path correctly without `exports`. Pre-existing ESLint v9 config issue unchanged. Lockfile intentionally not updated to keep this PR's diff focused — CI uses non-frozen `pnpm install` and will pick up @constructive-io/fetch on install. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 815edac commit 65b829b

3 files changed

Lines changed: 6 additions & 171 deletions

File tree

graphql/query/package.json

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,6 @@
66
"main": "index.js",
77
"module": "esm/index.js",
88
"types": "index.d.ts",
9-
"exports": {
10-
".": {
11-
"types": "./index.d.ts",
12-
"import": "./esm/index.js",
13-
"require": "./index.js"
14-
},
15-
"./runtime": {
16-
"types": "./runtime/index.d.ts",
17-
"import": "./esm/runtime/index.js",
18-
"require": "./runtime/index.js"
19-
}
20-
},
219
"homepage": "https://github.com/constructive-io/constructive",
2210
"license": "MIT",
2311
"publishConfig": {
@@ -42,6 +30,7 @@
4230
},
4331
"dependencies": {
4432
"@0no-co/graphql.web": "^1.1.2",
33+
"@constructive-io/fetch": "^1.0.0",
4534
"@constructive-io/graphql-types": "workspace:^",
4635
"ajv": "^8.18.0",
4736
"gql-ast": "workspace:^",

graphql/query/src/runtime/index.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
*
44
* Generated ORM clients need runtime dependencies at execution time.
55
* This module re-exports so generated code can consolidate imports:
6-
* - @0no-co/graphql.web — parseType, print
7-
* - @constructive-io/graphql-types — GraphQLAdapter, GraphQLError, QueryResult
8-
* - ./localhost-fetch — createFetch (isomorphic *.localhost-aware fetch)
6+
* - @0no-co/graphql.web — parseType, print
7+
* - @constructive-io/graphql-types — GraphQLAdapter, GraphQLError, QueryResult
8+
* - @constructive-io/fetch — createFetch (isomorphic *.localhost-aware fetch)
99
*
1010
* gql-ast is intentionally NOT re-exported here because the templates
1111
* use `import * as t from 'gql-ast'` — mixing it into this namespace
@@ -17,12 +17,9 @@
1717
* import type { GraphQLAdapter } from '@constructive-io/graphql-query/runtime';
1818
*/
1919

20-
// From @0no-co/graphql.web — GraphQL parsing/printing
2120
export { parseType, print } from '@0no-co/graphql.web';
2221

23-
// From @constructive-io/graphql-types — adapter interface + result types
2422
export type { GraphQLAdapter, GraphQLError, QueryResult } from '@constructive-io/graphql-types';
2523

26-
// Isomorphic fetch with *.localhost DNS + Host header fix for Node.js
27-
export { createFetch } from './localhost-fetch.js';
28-
export type { FetchFunction } from './localhost-fetch.js';
24+
export { createFetch } from '@constructive-io/fetch';
25+
export type { FetchFunction } from '@constructive-io/fetch';

graphql/query/src/runtime/localhost-fetch.ts

Lines changed: 0 additions & 151 deletions
This file was deleted.

0 commit comments

Comments
 (0)