Skip to content

Commit 8b62982

Browse files
committed
fix: remove exports map anti-pattern, use deep path imports per Constructive standard
The Constructive dist-folder publishing pattern (publishConfig.directory: dist) makes deep nested imports work naturally — no exports map needed. - Remove exports + typesVersions from graphql-codegen/package.json - Remove exports from graphql-query/package.json - Revert cli-e2e.test.ts to deep path imports (core/codegen/cli, core/codegen/orm) - Update codegen-helper.ts to deep path import (core/codegen/orm)
1 parent 39b5612 commit 8b62982

4 files changed

Lines changed: 3 additions & 38 deletions

File tree

graphql/codegen/package.json

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -29,29 +29,6 @@
2929
"main": "index.js",
3030
"module": "index.mjs",
3131
"types": "index.d.ts",
32-
"exports": {
33-
".": {
34-
"import": "./esm/index.js",
35-
"require": "./index.js",
36-
"types": "./index.d.ts"
37-
},
38-
"./orm": {
39-
"import": "./esm/core/codegen/orm/index.js",
40-
"require": "./core/codegen/orm/index.js",
41-
"types": "./core/codegen/orm/index.d.ts"
42-
},
43-
"./cli": {
44-
"import": "./esm/core/codegen/cli/index.js",
45-
"require": "./core/codegen/cli/index.js",
46-
"types": "./core/codegen/cli/index.d.ts"
47-
}
48-
},
49-
"typesVersions": {
50-
"*": {
51-
"orm": ["core/codegen/orm/index.d.ts"],
52-
"cli": ["core/codegen/cli/index.d.ts"]
53-
}
54-
},
5532
"bin": {
5633
"graphql-codegen": "cli/index.js"
5734
},

graphql/query/package.json

Lines changed: 0 additions & 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-
"import": "./esm/index.js",
12-
"require": "./index.js",
13-
"types": "./index.d.ts"
14-
},
15-
"./runtime": {
16-
"import": "./esm/runtime/index.js",
17-
"require": "./runtime/index.js",
18-
"types": "./runtime/index.d.ts"
19-
}
20-
},
219
"homepage": "https://github.com/constructive-io/constructive",
2210
"license": "MIT",
2311
"publishConfig": {

graphql/server-test/__tests__/cli-e2e.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ import * as ts from 'typescript';
3131
import { getConnections, seed } from '../src';
3232
import type { ServerInfo } from '../src/types';
3333
import type { Table } from '@constructive-io/graphql-codegen';
34-
import { generateCli } from '@constructive-io/graphql-codegen/cli';
35-
import { generateOrm } from '@constructive-io/graphql-codegen/orm';
34+
import { generateCli } from '@constructive-io/graphql-codegen/core/codegen/cli';
35+
import { generateOrm } from '@constructive-io/graphql-codegen/core/codegen/orm';
3636

3737
jest.setTimeout(120000);
3838

graphql/test/src/codegen-helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import {
3232
} from '@constructive-io/graphql-query';
3333
import type { Table } from '@constructive-io/graphql-query';
3434

35-
import { generateOrm } from '@constructive-io/graphql-codegen/orm';
35+
import { generateOrm } from '@constructive-io/graphql-codegen/core/codegen/orm';
3636

3737
export interface CodegenResult {
3838
/** Factory function to create an ORM client from a GraphQLAdapter */

0 commit comments

Comments
 (0)