Skip to content

Commit 982a701

Browse files
authored
Revert "Add message that we only support TS >= 4.1.0 (#3319)"
This reverts commit 7c6bf48.
1 parent a745361 commit 982a701

File tree

2 files changed

+2
-29
lines changed

2 files changed

+2
-29
lines changed

package.json

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,7 @@
66
"private": true,
77
"main": "index",
88
"module": "index.mjs",
9-
"types": "NotSupportedTSVersion.d.ts",
10-
"typesVersions": {
11-
">=4.1.0": {
12-
"*": [
13-
"index.d.ts"
14-
],
15-
"*/*": [
16-
"*/index.d.ts"
17-
],
18-
"*/*/*": [
19-
"*/*"
20-
]
21-
}
22-
},
9+
"types": "index.d.ts",
2310
"sideEffects": false,
2411
"homepage": "https://github.com/graphql/graphql-js",
2512
"bugs": {

resources/build-npm.js

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ if (require.main === module) {
1818
fs.rmSync('./npmDist', { recursive: true, force: true });
1919
fs.mkdirSync('./npmDist');
2020

21-
const packageJSON = buildPackageJSON();
22-
2321
const srcFiles = readdirRecursive('./src', { ignoreDir: /^__.*__$/ });
2422
for (const filepath of srcFiles) {
2523
const srcPath = path.join('./src', filepath);
@@ -50,23 +48,11 @@ if (require.main === module) {
5048
'Fail to generate `*.d.ts` files, please run `npm run check`',
5149
);
5250

53-
assert(packageJSON.types, 'Missing "types".');
54-
const supportedTSVersions = Object.keys(packageJSON.typesVersions);
55-
assert(
56-
supportedTSVersions.length === 1,
57-
'Property "typesVersions" should have exactly one key.',
58-
);
59-
// TODO: revisit once TS implements https://github.com/microsoft/TypeScript/issues/44795
60-
fs.writeFileSync(
61-
path.join('./npmDist', packageJSON.types),
62-
// Provoke syntax error to show this message
63-
`"Package 'graphql' support only TS versions that are ${supportedTSVersions[0]}".`,
64-
);
65-
6651
fs.copyFileSync('./LICENSE', './npmDist/LICENSE');
6752
fs.copyFileSync('./README.md', './npmDist/README.md');
6853

6954
// Should be done as the last step so only valid packages can be published
55+
const packageJSON = buildPackageJSON();
7056
writeGeneratedFile('./npmDist/package.json', JSON.stringify(packageJSON));
7157

7258
showDirStats('./npmDist');

0 commit comments

Comments
 (0)