Skip to content

Commit a24135f

Browse files
committed
remove types field
1 parent db79ea3 commit a24135f

File tree

7 files changed

+15
-17
lines changed

7 files changed

+15
-17
lines changed

integrationTests/conditions/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ childProcess.execSync(
2626

2727
console.log('Testing on deno (moduleSync: false) ...');
2828
childProcess.execSync(
29-
`docker run --rm --volume "$PWD":/usr/src/app -w /usr/src/app --env MODULE_SYNC=false denoland/deno:2.4.0 deno run --allow-read --allow-env ./check.mjs`,
29+
`docker run --rm --volume "$PWD":/usr/src/app -w /usr/src/app --env MODULE_SYNC=false denoland/alpine-2.4.1 deno run --allow-read --allow-env ./check.mjs`,
3030
{ stdio: 'inherit' },
3131
);

integrationTests/ts/esm.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const queryType: GraphQLObjectType = new GraphQLObjectType({
1818
default: { value: 'World' },
1919
},
2020
},
21-
resolve(_root, args: { who: string }) {
21+
resolve(_root: unknown, args: { who: string }) {
2222
return 'Hello ' + args.who;
2323
},
2424
},

integrationTests/ts/extensions-test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ interface SomeExtension {
55
meaningOfLife: 42;
66
}
77

8+
// Import added to support deno, which does not scan node_modules automatically.
9+
import 'graphql';
810
declare module 'graphql' {
911
interface GraphQLObjectTypeExtensions<_TSource, _TContext> {
1012
someObjectExtension?: SomeExtension;
@@ -32,7 +34,8 @@ const queryType: GraphQLObjectType = new GraphQLObjectType({
3234
},
3335
},
3436
},
35-
resolve: (_root, args) => 'Hello ' + (args.who || 'World'),
37+
resolve: (_root: unknown, args: { who: string }) =>
38+
'Hello ' + (args.who || 'World'),
3639
extensions: {
3740
someFieldExtension: { meaningOfLife: 42 },
3841
},

integrationTests/ts/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"dependencies": {
99
"graphql": "file:../graphql.tgz",
1010
"graphql-esm": "file:../graphql-esm.tgz",
11+
"@types/node": "~24.0.10",
1112
"typescript-4.9": "npm:[email protected]",
1213
"typescript-5.0": "npm:[email protected]",
1314
"typescript-5.1": "npm:[email protected]",

integrationTests/ts/test.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,16 @@ const tsVersions = Object.keys(dependencies)
99
.sort((a, b) => b.localeCompare(a));
1010

1111
for (const version of tsVersions) {
12-
console.log(`Testing on ${version} ...`);
12+
console.log(`Testing on node ${version} ...`);
1313
childProcess.execSync(tscPath(version), { stdio: 'inherit' });
1414
}
1515

16+
console.log('Testing on deno ...');
17+
childProcess.execSync(
18+
`docker run --rm --volume "${process.cwd()}:/usr/src/app" -w /usr/src/app denoland/deno:alpine-2.4.1 deno check`,
19+
{ stdio: 'inherit' },
20+
);
21+
1622
function tscPath(version) {
1723
return path.join('node_modules', version, 'bin', 'tsc');
1824
}

resources/build-npm.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -205,14 +205,6 @@ function buildExports(filepath: string): ConditionalExports {
205205
const { dir, name } = path.parse(filepath);
206206
const base = `./${path.join(dir, name)}`;
207207
return {
208-
types: {
209-
module: `${base}.d.mts`,
210-
'module-sync': `${base}.d.mts`,
211-
bun: `${base}.d.mts`,
212-
node: `${base}.d.ts`,
213-
require: `${base}.d.ts`,
214-
default: `${base}.d.mts`,
215-
},
216208
module: `${base}.mjs`,
217209
bun: `${base}.mjs`,
218210
'module-sync': `${base}.mjs`,

resources/utils.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -245,11 +245,7 @@ interface PackageJSON {
245245
module?: string;
246246
}
247247

248-
export interface ConditionalExports extends BaseExports {
249-
types: BaseExports;
250-
}
251-
252-
interface BaseExports {
248+
export interface ConditionalExports {
253249
module: string;
254250
bun: string;
255251
'module-sync': string;

0 commit comments

Comments
 (0)