@@ -18,8 +18,6 @@ if (require.main === module) {
18
18
fs . rmSync ( './npmDist' , { recursive : true , force : true } ) ;
19
19
fs . mkdirSync ( './npmDist' ) ;
20
20
21
- const packageJSON = buildPackageJSON ( ) ;
22
-
23
21
const srcFiles = readdirRecursive ( './src' , { ignoreDir : / ^ _ _ .* _ _ $ / } ) ;
24
22
for ( const filepath of srcFiles ) {
25
23
const srcPath = path . join ( './src' , filepath ) ;
@@ -50,23 +48,11 @@ if (require.main === module) {
50
48
'Fail to generate `*.d.ts` files, please run `npm run check`' ,
51
49
) ;
52
50
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
-
66
51
fs . copyFileSync ( './LICENSE' , './npmDist/LICENSE' ) ;
67
52
fs . copyFileSync ( './README.md' , './npmDist/README.md' ) ;
68
53
69
54
// Should be done as the last step so only valid packages can be published
55
+ const packageJSON = buildPackageJSON ( ) ;
70
56
writeGeneratedFile ( './npmDist/package.json' , JSON . stringify ( packageJSON ) ) ;
71
57
72
58
showDirStats ( './npmDist' ) ;
0 commit comments