Skip to content

Commit c38a5df

Browse files
authored
Merge pull request #539 from Hack23/copilot/move-project-to-typescript-6-0-2
Upgrade TypeScript 5.9.3 → 6.0.2 with TS6 breaking change fixes and documentation updates
2 parents 98f668a + f80129b commit c38a5df

15 files changed

Lines changed: 153 additions & 22 deletions

.github/release-drafter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ template: |
9292
## Game Development Stack
9393
- ⚡ **Vite** - Fast build tool and dev server
9494
- ⚛️ **React 19** - Modern React with hooks
95-
- 🔷 **TypeScript** - Strict typing with latest standards
95+
- 🔷 **TypeScript 6** - Strict typing with latest standards
9696
- 🎮 **Three.js** - High-performance 3D WebGL renderer
9797
- 🎨 **@react-three/fiber** - React renderer for Three.js
9898
- 🧪 **Vitest** - Fast unit testing with coverage

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ For complete security policy mapping and detailed compliance information, see:
4444

4545
-**Vite** - Fast build tool and dev server
4646
- ⚛️ **React 19** - Modern React with hooks
47-
- 🔷 **TypeScript** - Strict typing with latest standards
47+
- 🔷 **TypeScript 6** - Strict typing with latest standards
4848
- 🧪 **Vitest** - Fast unit testing with coverage
4949
- 🌲 **Cypress** - Reliable E2E testing
5050
- 📦 **ESLint** - Code linting with TypeScript rules

cypress/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"esModuleInterop": true,
1313
"allowSyntheticDefaultImports": true,
1414
"resolveJsonModule": true,
15+
"ignoreDeprecations": "6.0",
1516
"types": ["cypress", "node"]
1617
},
1718
"include": ["**/*.ts", "**/*.tsx", "../src/types/**/*"],

docs/End-of-Life-Strategy.md

Lines changed: 68 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
# Node.js End-of-Life Strategy
1+
# Runtime & Toolchain End-of-Life Strategy
22

33
## Overview
44

5-
This document defines the strategy for managing Node.js runtime versions in the **game** project, ensuring we stay on actively maintained releases and plan upgrades proactively. All version decisions align with the [Hack23 ISMS Secure Development Policy](https://github.com/Hack23/ISMS-PUBLIC).
5+
This document defines the strategy for managing Node.js runtime and TypeScript compiler versions in the **game** project, ensuring we stay on actively maintained releases and plan upgrades proactively. All version decisions align with the [Hack23 ISMS Secure Development Policy](https://github.com/Hack23/ISMS-PUBLIC).
66

77
---
88

99
## Current Status (March 2026)
1010

11+
### Node.js
12+
1113
| Node.js | Release Date | Status | Bug Fixes Until | Security Fixes Until |
1214
|---------|-------------|--------|-----------------|----------------------|
1315
| **25 (Current)** | Oct 15, 2025 |**Active — in use** | Apr 1, 2026 | Jun 1, 2026 |
@@ -17,6 +19,16 @@ This document defines the strategy for managing Node.js runtime versions in the
1719

1820
> **Note:** Node.js 25 is an odd-numbered "Current" release, meaning it does **not** receive LTS status. It is supported for approximately 6 months before reaching end-of-life. We use it to validate readiness for Node.js 26.
1921
22+
### TypeScript
23+
24+
| TypeScript | Release Date | Status | Support Until |
25+
|-----------|-------------|--------|---------------|
26+
| **6.0.2** | Mar 2026 |**Active — in use** | Until 7.0 release (~12 months) |
27+
| 5.9.x | Feb 2026 | Previous stable | Limited — security patches only |
28+
| 5.8.x | Dec 2025 | End of life | ❌ No support |
29+
30+
> **Note:** TypeScript 6.0 is a major release with breaking changes including stricter module resolution with `moduleResolution: "bundler"`, removal of implicit `global` namespace, and stricter `NodeJS` namespace handling. The project uses `@typescript-eslint 8.58.0` which supports `typescript >=4.8.4 <6.1.0`.
31+
2032
---
2133

2234
## Node.js Release Cadence
@@ -41,6 +53,42 @@ Node 28 | Apr 2027 | ~6 mo | Oct 2027 | Oct 2028 | Apr 2030
4153

4254
---
4355

56+
## TypeScript Release Cadence
57+
58+
Microsoft publishes TypeScript on a roughly quarterly schedule:
59+
60+
- **Major versions** (e.g., 5.0 → 6.0) ship approximately once per year with breaking changes
61+
- **Minor versions** (e.g., 6.0 → 6.1) ship every 2–3 months with new features
62+
- **Patch versions** (e.g., 6.0.1 → 6.0.2) ship as needed for bug fixes
63+
64+
```
65+
Version | Release | Status | @typescript-eslint Support
66+
---------|-----------|----------------|---------------------------
67+
TS 5.8 | Dec 2025 | End of life | 8.x (>=4.8.4 <6.1.0)
68+
TS 5.9 | Feb 2026 | Previous | 8.x (>=4.8.4 <6.1.0)
69+
TS 6.0 | Mar 2026 | Current ✅ | 8.x (>=4.8.4 <6.1.0)
70+
TS 6.1 | ~Jun 2026 | Planned | Requires @typescript-eslint update
71+
TS 7.0 | ~2027 | Future | Requires @typescript-eslint update
72+
```
73+
74+
### TypeScript Upgrade Policy
75+
76+
1. **Upgrade to new patch versions immediately** — bug fixes only, no breaking changes.
77+
2. **Upgrade to new minor versions within 2 weeks** — validate `tsc -b`, ESLint, and all tests pass.
78+
3. **Upgrade to new major versions within 1 month** — major versions may require code changes and `@typescript-eslint` compatibility updates.
79+
4. **Never use TypeScript versions unsupported by `@typescript-eslint`** — this would disable type-aware linting.
80+
81+
### TypeScript Upgrade Triggers
82+
83+
| Trigger | Action | Timeline |
84+
|---------|--------|----------|
85+
| New patch release (e.g., 6.0.3) | Update `package.json`, run full CI | Within 1 week |
86+
| New minor release (e.g., 6.1.0) | Verify `@typescript-eslint` compatibility first | Within 2 weeks |
87+
| New major release (e.g., 7.0.0) | Full compatibility assessment, dedicated PR | Within 1 month |
88+
| `@typescript-eslint` drops support | Upgrade `@typescript-eslint` or pin TypeScript | Within 24 hours |
89+
90+
---
91+
4492
## Version Upgrade Policy
4593

4694
### Principles
@@ -94,7 +142,9 @@ Node.js 24 reaches end-of-life in April 2028. By this date, all workflows and de
94142

95143
## Version Matrix
96144

97-
The project maintains two parallel test workflows:
145+
The project maintains two parallel test workflows and tracks toolchain versions:
146+
147+
### Node.js
98148

99149
| Workflow | Purpose | Current Node Version |
100150
|----------|---------|----------------------|
@@ -106,6 +156,15 @@ When a new Node.js version is released:
106156
2. Once validated (typically within the same sprint), update `test-and-report.yml`
107157
3. Update all other workflows (`release.yml`, `codeql.yml`, copilot setup) together
108158

159+
### TypeScript & Toolchain
160+
161+
| Tool | Current Version | Peer Constraint | Upgrade Path |
162+
|------|----------------|-----------------|--------------|
163+
| TypeScript | **6.0.2** || Follow quarterly releases |
164+
| @typescript-eslint | **8.58.0** | `typescript >=4.8.4 <6.1.0` | Must update before TS 6.1 |
165+
| Vite | **8.0.3** || Follow major releases |
166+
| Vitest | **4.1.2** || Keep aligned with Vite |
167+
109168
---
110169

111170
## Risk Assessment
@@ -116,13 +175,19 @@ When a new Node.js version is released:
116175
| Incompatible npm packages | Medium | High | Run tests on new version early |
117176
| Breaking API changes | Low | High | Test on Current release before it becomes primary |
118177
| CI/CD downtime during upgrade | Low | Medium | Upgrade in dedicated PR with rollback plan |
178+
| TypeScript major upgrade breaks build | Medium | High | Test with `tsc -b`, lint, and full test suite before merging |
179+
| @typescript-eslint drops TypeScript version support | Medium | High | Monitor peer dependency ranges; pin TypeScript if needed |
180+
| TypeScript strictness regression in new version | Low | Medium | Use project references and separate tsconfigs for app/test/node |
119181

120182
---
121183

122184
## References
123185

124186
- [Node.js Release Schedule](https://nodejs.org/en/about/previous-releases)
125187
- [Node.js End-of-Life Dates — endoflife.date](https://endoflife.date/nodejs)
188+
- [TypeScript Release Notes](https://devblogs.microsoft.com/typescript/)
189+
- [TypeScript End-of-Life Dates — endoflife.date](https://endoflife.date/typescript)
190+
- [@typescript-eslint Supported TypeScript Versions](https://typescript-eslint.io/users/dependency-versions/)
126191
- [Hack23 ISMS Secure Development Policy](https://github.com/Hack23/ISMS-PUBLIC)
127192
- [WORKFLOWS.md](./WORKFLOWS.md) — Current CI/CD workflow documentation
128193
- [FUTURE_WORKFLOWS.md](./FUTURE_WORKFLOWS.md) — Planned Node.js 26 upgrade

docs/FUTURE_WORKFLOWS.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ sed -i 's/"version": "25"/"version": "26"/' .devcontainer/devcontainer.json
9898
| `vite` | May ship Node.js 26 support update | Check release notes |
9999
| `cypress` | Historically supports new Node quickly | Verify with `npx cypress verify` |
100100
| `vitest` | Tracks Vite compatibility | Validate test suite passes |
101-
| `typescript` | Generally Node-agnostic | No action expected |
101+
| `typescript` | Currently 6.0.2; generally Node-agnostic | No action expected |
102+
| `@typescript-eslint` | Currently supports `typescript <6.1.0` | Must update before TS 6.1 |
102103

103104
### V8 Engine Changes (Node.js 26)
104105

@@ -142,6 +143,33 @@ The project can safely remain on Node.js 25 until **June 1, 2026** (security EOL
142143

143144
---
144145

146+
## TypeScript Upgrade Planning
147+
148+
### Current State
149+
150+
TypeScript **6.0.2** is in use. The `@typescript-eslint 8.58.0` peer dependency constraint is `typescript >=4.8.4 <6.1.0`.
151+
152+
### TypeScript 6.1 Upgrade (Expected ~June 2026)
153+
154+
When TypeScript 6.1 is released:
155+
156+
1. **Check `@typescript-eslint` compatibility** — version 8.58.0 requires `<6.1.0`; a newer release will be needed
157+
2. **Update `@typescript-eslint`** to a version supporting TS 6.1
158+
3. **Update `package.json`** — change `typescript` to the new version
159+
4. **Run full validation**`npm run build`, `npm run lint`, `npm run test`
160+
5. **Review breaking changes** — consult [TypeScript release notes](https://devblogs.microsoft.com/typescript/)
161+
162+
### TypeScript 7.0 Upgrade (Expected ~2027)
163+
164+
Major version upgrades may require:
165+
166+
- Code changes for stricter type checking
167+
- `tsconfig.json` updates for new compiler options
168+
- `@typescript-eslint` major version upgrade
169+
- Dedicated PR with full test suite validation
170+
171+
---
172+
145173
## Related Documents
146174

147175
- [End-of-Life-Strategy.md](./End-of-Life-Strategy.md) — Full Node.js lifecycle policy

docs/WORKFLOWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
This document describes all GitHub Actions workflows in the **game** project. All workflows follow the security-first principles defined in the [Hack23 ISMS Secure Development Policy](https://github.com/Hack23/ISMS-PUBLIC) and use hardened runners via `step-security/harden-runner`.
66

77
**Current Node.js version: 25**
8+
**Current TypeScript version: 6.0.2**
89

910
---
1011

eslint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export default tseslint.config(
1515
project: [
1616
"./tsconfig.app.json",
1717
"./tsconfig.node.json",
18+
"./tsconfig.test.json",
1819
"./cypress/tsconfig.json",
1920
],
2021
tsconfigRootDir: import.meta.dirname,

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"jsdom": "29.0.1",
5353
"license-compliance": "3.0.1",
5454
"start-server-and-test": "3.0.0",
55-
"typescript": "5.9.3",
55+
"typescript": "6.0.2",
5656
"typescript-eslint": "8.58.0",
5757
"vite": "8.0.3",
5858
"vitest": "4.1.2"

src/hooks/useAudioManager.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ class MockAudioContext {
3636
sampleRate = 48000;
3737
}
3838

39-
global.AudioContext = MockAudioContext as unknown as typeof AudioContext;
40-
global.URL.createObjectURL = vi.fn().mockReturnValue("mock-blob-url");
39+
globalThis.AudioContext = MockAudioContext as unknown as typeof AudioContext;
40+
globalThis.URL.createObjectURL = vi.fn().mockReturnValue("mock-blob-url");
4141

4242
describe("useAudioManager", () => {
4343
beforeEach(() => {

0 commit comments

Comments
 (0)