Skip to content

Commit 5f47fbb

Browse files
chore(v8/deps): Deduplicate yarn.lock (#15094)
The `use-ts-version` script was only ever used for TypeScript 3.8, so to keep things simple, I copied back the entire script and its usage from the `develop` branch. --------- Co-authored-by: Abhijeet Prasad <[email protected]>
1 parent 8b870ba commit 5f47fbb

File tree

5 files changed

+294
-2760
lines changed

5 files changed

+294
-2760
lines changed

.github/workflows/build.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -738,8 +738,8 @@ jobs:
738738
node_version: ${{ matrix.node == 14 && '14' || '' }}
739739

740740
- name: Overwrite typescript version
741-
if: matrix.typescript
742-
run: node ./scripts/use-ts-version.js ${{ matrix.typescript }}
741+
if: matrix.typescript == '3.8'
742+
run: node ./scripts/use-ts-3_8.js
743743
working-directory: dev-packages/node-integration-tests
744744

745745
- name: Run integration tests

.size-limit.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ module.exports = [
5454
path: 'packages/browser/build/npm/esm/index.js',
5555
import: createImport('init', 'browserTracingIntegration', 'replayIntegration'),
5656
gzip: true,
57-
limit: '68 KB',
57+
limit: '68.5 KB',
5858
modifyWebpackConfig: function (config) {
5959
const webpack = require('webpack');
6060
const TerserPlugin = require('terser-webpack-plugin');
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/* eslint-disable no-console */
2+
const { execSync } = require('child_process');
3+
const { join } = require('path');
4+
const { readFileSync, writeFileSync } = require('fs');
5+
6+
const cwd = join(__dirname, '../../..');
7+
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+
21+
const tsVersion = '3.8';
22+
23+
console.log(`Installing typescript@${tsVersion}, and @types/node@14...`);
24+
25+
execSync(`yarn add --dev --ignore-workspace-root-check typescript@${tsVersion} @types/node@^14`, {
26+
stdio: 'inherit',
27+
cwd,
28+
});
29+
30+
console.log('Removing unsupported tsconfig options...');
31+
32+
const baseTscConfigPath = join(cwd, 'packages/typescript/tsconfig.json');
33+
34+
const tsConfig = require(baseTscConfigPath);
35+
36+
// TS 3.8 fails build when it encounters a config option it does not understand, so we remove it :(
37+
delete tsConfig.compilerOptions.noUncheckedIndexedAccess;
38+
39+
writeFileSync(baseTscConfigPath, JSON.stringify(tsConfig, null, 2));

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

-23
This file was deleted.

0 commit comments

Comments
 (0)