Skip to content

Commit 82adfbb

Browse files
authored
chore(deps): Deduplicate yarn.lock (#14968)
1 parent 199a146 commit 82adfbb

File tree

2 files changed

+406
-2734
lines changed

2 files changed

+406
-2734
lines changed

dev-packages/node-integration-tests/scripts/use-ts-3_8.js

+15-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,23 @@
11
/* eslint-disable no-console */
22
const { execSync } = require('child_process');
33
const { join } = require('path');
4-
const { writeFileSync } = require('fs');
4+
const { readFileSync, writeFileSync } = require('fs');
55

66
const cwd = join(__dirname, '../../..');
77

8+
// Newer versions of the Express types use syntax that isn't supported by TypeScript 3.8.
9+
// We'll pin to the last version of those types that are compatible.
10+
console.log('Pinning Express types to old versions...');
11+
12+
const packageJsonPath = join(cwd, 'package.json');
13+
const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8'));
14+
15+
if (!packageJson.resolutions) packageJson.resolutions = {};
16+
packageJson.resolutions['@types/express'] = '4.17.13';
17+
packageJson.resolutions['@types/express-serve-static-core'] = '4.17.30';
18+
19+
writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2));
20+
821
const tsVersion = '3.8';
922

1023
console.log(`Installing typescript@${tsVersion}, and @types/node@14...`);
@@ -20,7 +33,7 @@ const baseTscConfigPath = join(cwd, 'packages/typescript/tsconfig.json');
2033

2134
const tsConfig = require(baseTscConfigPath);
2235

23-
// TS 3.8 fails build when it encounteres a config option it does not understand, so we remove it :(
36+
// TS 3.8 fails build when it encounters a config option it does not understand, so we remove it :(
2437
delete tsConfig.compilerOptions.noUncheckedIndexedAccess;
2538

2639
writeFileSync(baseTscConfigPath, JSON.stringify(tsConfig, null, 2));

0 commit comments

Comments
 (0)