Skip to content

Commit 73f74c5

Browse files
authored
Merge pull request #36 from DrSkillIssue/opencode/sunny-wolf
refactor: Prepare the toolchain for TypeScript 6 and TS-next validation
2 parents af46b8c + a4a4678 commit 73f74c5

25 files changed

Lines changed: 776 additions & 319 deletions

.github/workflows/ci.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,53 @@ concurrency:
3333

3434
jobs:
3535
check:
36+
name: >-
37+
CI (${{ matrix.typescript-label }})
3638
runs-on: ubuntu-latest
3739
timeout-minutes: 15
40+
continue-on-error: ${{ matrix.experimental }}
41+
strategy:
42+
fail-fast: false
43+
matrix:
44+
include:
45+
- typescript-label: ts-latest-6
46+
typescript-spec: ^6
47+
experimental: false
48+
- typescript-label: ts-6.0.2
49+
typescript-spec: 6.0.2
50+
experimental: false
51+
- typescript-label: ts-next
52+
typescript-spec: next
53+
experimental: true
3854
steps:
3955
- uses: actions/checkout@v6
4056

4157
- uses: ./.github/actions/setup
4258

59+
- name: Resolve TypeScript version
60+
id: resolve-typescript
61+
shell: bash
62+
env:
63+
TYPESCRIPT_SPEC: ${{ matrix.typescript-spec }}
64+
run: |
65+
VERSION=$(node <<'NODE'
66+
const { execSync } = require('node:child_process');
67+
68+
const spec = process.env.TYPESCRIPT_SPEC;
69+
if (!spec) {
70+
throw new Error('TYPESCRIPT_SPEC is required');
71+
}
72+
73+
const version = execSync(`npm view "typescript@${spec}" version`, {
74+
encoding: 'utf8',
75+
}).trim();
76+
77+
process.stdout.write(version);
78+
NODE
79+
)
80+
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
81+
82+
- name: Set TypeScript version
83+
run: bun add --dev --exact typescript@${{ steps.resolve-typescript.outputs.version }}
84+
4385
- run: bun run ci

bun.lock

Lines changed: 29 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

eslint.config.mjs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
// @ts-check
2-
import path from "node:path";
32
// @ts-ignore
43
import js from "@eslint/js";
54
import globals from "globals";
65
import tseslint from "typescript-eslint";
76
import stylistic from "@stylistic/eslint-plugin";
87
import solid from "@drskillissue/ganko/eslint-plugin";
98

10-
const tsconfigPath = path.resolve("tsconfig.json");
11-
129
export default [
1310
{
1411
ignores: [
@@ -38,7 +35,8 @@ export default [
3835
sourceType: "module",
3936
parser: tseslint.parser,
4037
parserOptions: {
41-
project: tsconfigPath,
38+
projectService: true,
39+
tsconfigRootDir: import.meta.dirname,
4240
},
4341
globals: globals.node,
4442
},

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88
],
99
"scripts": {
1010
"build": "bun run --cwd packages/shared build && bun run --cwd packages/ganko build && bun run --cwd packages/lsp build && bun run --cwd packages/vscode build",
11+
"smoke:pack:ganko": "bun run scripts/smoke-test-ganko-package.ts",
1112
"test": "bun run --cwd packages/ganko test && bun run --cwd packages/lsp test",
1213
"tsc": "bun run --cwd packages/shared tsc && bun run --cwd packages/ganko tsc && bun run --cwd packages/lsp tsc && bun run --cwd packages/vscode tsc",
1314
"lint": "eslint --max-warnings=0",
14-
"ci": "bun run build && bun run tsc && bun run lint && bun run test && bun run --cwd packages/ganko generate:check",
15+
"ci": "bun run build && bun run smoke:pack:ganko && bun run tsc && bun run lint && bun run test && bun run --cwd packages/ganko generate:check",
1516
"clean": "bun -e \"import { readdir, rm } from 'node:fs/promises'; import { resolve } from 'node:path'; const root = process.cwd(); const entries = await readdir(resolve(root, 'packages'), { withFileTypes: true }); for (const entry of entries) { if (!entry.isDirectory()) continue; await rm(resolve(root, 'packages', entry.name, 'dist'), { recursive: true, force: true }); }\"",
1617
"rebuild": "bun run clean && bun install && bun run build",
1718
"package": "bun run build && bun run --cwd packages/vscode package",
@@ -23,13 +24,13 @@
2324
"@tsconfig/bun": "^1.0.10",
2425
"@types/bun": "^1.3.10",
2526
"@types/node": "25.5.0",
26-
"@typescript-eslint/utils": "^8.57.1",
27+
"@typescript-eslint/utils": "^8.57.2",
2728
"eslint": "^10.0.3",
2829
"globals": "^17.4.0",
2930
"@drskillissue/ganko": "workspace:^",
3031
"tsup": "^8.5.1",
31-
"typescript": "^5.9.3",
32-
"typescript-eslint": "^8.57.1",
32+
"typescript": "^6.0.0",
33+
"typescript-eslint": "^8.57.2",
3334
"vitest": "^4.1.0",
3435
"zod": "^4.3.6"
3536
},

0 commit comments

Comments
 (0)