Skip to content

Commit 2a518a7

Browse files
committed
ref: Fix ts version properly for tests
1 parent 255e0d5 commit 2a518a7

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -896,15 +896,15 @@ jobs:
896896

897897
- name: Overwrite typescript version
898898
if: matrix.typescript
899-
run: yarn add --dev --ignore-workspace-root-check typescript@${{ matrix.typescript }}
899+
run: node ./scripts/overwrite-typescript-version.js ${{ matrix.typescript }}
900+
working-directory: dev-packages/node-integration-tests
900901

901902
- name: Run integration tests
902903
env:
903904
NODE_VERSION: ${{ matrix.node }}
904905
TS_VERSION: ${{ matrix.typescript }}
905-
run: |
906-
cd dev-packages/node-integration-tests
907-
yarn test
906+
working-directory: dev-packages/node-integration-tests
907+
run: yarn test
908908

909909
job_remix_integration_tests:
910910
name: Remix v${{ matrix.remix }} (Node ${{ matrix.node }}) Tests
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/* eslint-disable no-console */
2+
const { execSync } = require('child_process');
3+
const { join } = require('path');
4+
const { writeFileSync } = require('fs');
5+
6+
const cwd = join(__dirname, '../../..');
7+
8+
const tsVersion = process.argv[2] || '3.8';
9+
10+
console.log(`Installing typescript@${tsVersion}...`);
11+
12+
execSync(`yarn add --dev --ignore-workspace-root-check typescript@${tsVersion}`, { stdio: 'inherit', cwd });
13+
14+
console.log('Removing unsupported tsconfig options...');
15+
16+
const baseTscConfigPath = join(cwd, 'packages/typescript/tsconfig.json');
17+
18+
const tsConfig = require(baseTscConfigPath);
19+
20+
// TS 3.8 fails build when it encounteres a config option it does not understand, so we remove it :(
21+
delete tsConfig.compilerOptions.noUncheckedIndexedAccess;
22+
23+
writeFileSync(baseTscConfigPath, JSON.stringify(tsConfig, null, 2));

0 commit comments

Comments
 (0)