Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Add message that we only support TS >= 4.1.0" #3338

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 1 addition & 14 deletions package.json
Expand Up @@ -6,20 +6,7 @@
"private": true,
"main": "index",
"module": "index.mjs",
"types": "NotSupportedTSVersion.d.ts",
"typesVersions": {
">=4.1.0": {
"*": [
"index.d.ts"
],
"*/*": [
"*/index.d.ts"
],
"*/*/*": [
"*/*"
]
}
},
"types": "index.d.ts",
"sideEffects": false,
"homepage": "https://github.com/graphql/graphql-js",
"bugs": {
Expand Down
16 changes: 1 addition & 15 deletions resources/build-npm.js
Expand Up @@ -18,8 +18,6 @@ if (require.main === module) {
fs.rmSync('./npmDist', { recursive: true, force: true });
fs.mkdirSync('./npmDist');

const packageJSON = buildPackageJSON();

const srcFiles = readdirRecursive('./src', { ignoreDir: /^__.*__$/ });
for (const filepath of srcFiles) {
const srcPath = path.join('./src', filepath);
Expand Down Expand Up @@ -50,23 +48,11 @@ if (require.main === module) {
'Fail to generate `*.d.ts` files, please run `npm run check`',
);

assert(packageJSON.types, 'Missing "types".');
const supportedTSVersions = Object.keys(packageJSON.typesVersions);
assert(
supportedTSVersions.length === 1,
'Property "typesVersions" should have exactly one key.',
);
// TODO: revisit once TS implements https://github.com/microsoft/TypeScript/issues/44795
fs.writeFileSync(
path.join('./npmDist', packageJSON.types),
// Provoke syntax error to show this message
`"Package 'graphql' support only TS versions that are ${supportedTSVersions[0]}".`,
);

fs.copyFileSync('./LICENSE', './npmDist/LICENSE');
fs.copyFileSync('./README.md', './npmDist/README.md');

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

showDirStats('./npmDist');
Expand Down