Skip to content

Commit

Permalink
chore(deps): Deduplicate yarn.lock (#14968)
Browse files Browse the repository at this point in the history
  • Loading branch information
nwalters512 authored Jan 20, 2025
1 parent 199a146 commit 82adfbb
Show file tree
Hide file tree
Showing 2 changed files with 406 additions and 2,734 deletions.
17 changes: 15 additions & 2 deletions dev-packages/node-integration-tests/scripts/use-ts-3_8.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
/* eslint-disable no-console */
const { execSync } = require('child_process');
const { join } = require('path');
const { writeFileSync } = require('fs');
const { readFileSync, writeFileSync } = require('fs');

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

// Newer versions of the Express types use syntax that isn't supported by TypeScript 3.8.
// We'll pin to the last version of those types that are compatible.
console.log('Pinning Express types to old versions...');

const packageJsonPath = join(cwd, 'package.json');
const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8'));

if (!packageJson.resolutions) packageJson.resolutions = {};
packageJson.resolutions['@types/express'] = '4.17.13';
packageJson.resolutions['@types/express-serve-static-core'] = '4.17.30';

writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2));

const tsVersion = '3.8';

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

const tsConfig = require(baseTscConfigPath);

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

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

0 comments on commit 82adfbb

Please sign in to comment.