From f6a0cb80abafdd24a773d27f90083134d5d98a73 Mon Sep 17 00:00:00 2001 From: Jordan Eldredge Date: Thu, 2 Apr 2026 10:35:00 -0700 Subject: [PATCH 1/6] chore: make typescript a peerDependency Co-authored-by: James Cleveland --- package.json | 7 +++++-- pnpm-lock.yaml | 6 +++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 6810eaf1..75a9a71e 100644 --- a/package.json +++ b/package.json @@ -22,10 +22,13 @@ "dependencies": { "commander": "^14.0.1", "graphql": "^16.11.0", - "semver": "^7.7.2", - "typescript": "5.9.2" + "semver": "^7.7.2" + }, + "peerDependencies": { + "typescript": ">=5.5" }, "devDependencies": { + "typescript": "5.9.2", "@eslint/eslintrc": "^3.3.1", "@eslint/js": "^9.36.0", "@types/node": "^24.5.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ab4196b0..4389fab1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -17,9 +17,6 @@ importers: semver: specifier: ^7.7.2 version: 7.7.2 - typescript: - specifier: 5.9.2 - version: 5.9.2 devDependencies: '@eslint/eslintrc': specifier: ^3.3.1 @@ -63,6 +60,9 @@ importers: tsx: specifier: ^4.19.0 version: 4.21.0 + typescript: + specifier: 5.9.2 + version: 5.9.2 examples/apollo-server: dependencies: From 8ff7bb54d2d6da63bc24155555771e0a146ba52e Mon Sep 17 00:00:00 2001 From: Jordan Eldredge Date: Thu, 2 Apr 2026 10:35:32 -0700 Subject: [PATCH 2/6] Add TypeScript version matrix to CI --- .github/workflows/ci.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 02da9d0b..30ad6cdc 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -17,6 +17,10 @@ jobs: - 20.x # LTS - 22.x # LTS - 24.x # LTS + typescript-version: &typescript-versions + - "5.5" + - "5.7" + - "~5.9" steps: - uses: actions/checkout@v3 - uses: pnpm/action-setup@v2 @@ -29,6 +33,8 @@ jobs: cache: "pnpm" - name: Install dependencies run: pnpm install + - name: Install TypeScript ${{ matrix.typescript-version }} + run: pnpm add -D typescript@${{ matrix.typescript-version }} - name: Build run: pnpm run build - name: Install dependencies @@ -56,6 +62,7 @@ jobs: strategy: matrix: node-version: *node-versions + typescript-version: *typescript-versions steps: - uses: actions/checkout@v3 - uses: pnpm/action-setup@v2 @@ -68,6 +75,8 @@ jobs: cache: "pnpm" - name: Install dependencies run: pnpm install + - name: Install TypeScript ${{ matrix.typescript-version }} + run: pnpm add -D typescript@${{ matrix.typescript-version }} - name: Build # Integration tests depend upon having .js versions created by tsc run: pnpm run build - name: Unit Tests From 25e88e0dd291dcf3a8f79b16daa28b36cd34e7f4 Mon Sep 17 00:00:00 2001 From: Jordan Eldredge Date: Thu, 2 Apr 2026 10:37:31 -0700 Subject: [PATCH 3/6] Fix pnpm workspace root flag for TypeScript install step --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 30ad6cdc..b4210a46 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -34,7 +34,7 @@ jobs: - name: Install dependencies run: pnpm install - name: Install TypeScript ${{ matrix.typescript-version }} - run: pnpm add -D typescript@${{ matrix.typescript-version }} + run: pnpm add -wD typescript@${{ matrix.typescript-version }} - name: Build run: pnpm run build - name: Install dependencies @@ -76,7 +76,7 @@ jobs: - name: Install dependencies run: pnpm install - name: Install TypeScript ${{ matrix.typescript-version }} - run: pnpm add -D typescript@${{ matrix.typescript-version }} + run: pnpm add -wD typescript@${{ matrix.typescript-version }} - name: Build # Integration tests depend upon having .js versions created by tsc run: pnpm run build - name: Unit Tests From eb49c0e3d50c495bf53af0fcddb85297cb561942 Mon Sep 17 00:00:00 2001 From: Jordan Eldredge Date: Thu, 2 Apr 2026 10:44:12 -0700 Subject: [PATCH 4/6] Only run TypeScript version matrix on test job The build job's "assert no files changed" step checks generated output against what's committed, which is version-specific. The TS matrix belongs only on the test (unit test) job. --- .github/workflows/ci.yaml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b4210a46..d8ad27fe 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -17,10 +17,6 @@ jobs: - 20.x # LTS - 22.x # LTS - 24.x # LTS - typescript-version: &typescript-versions - - "5.5" - - "5.7" - - "~5.9" steps: - uses: actions/checkout@v3 - uses: pnpm/action-setup@v2 @@ -33,8 +29,6 @@ jobs: cache: "pnpm" - name: Install dependencies run: pnpm install - - name: Install TypeScript ${{ matrix.typescript-version }} - run: pnpm add -wD typescript@${{ matrix.typescript-version }} - name: Build run: pnpm run build - name: Install dependencies @@ -62,7 +56,10 @@ jobs: strategy: matrix: node-version: *node-versions - typescript-version: *typescript-versions + typescript-version: + - "5.5" + - "5.7" + - "~5.9" steps: - uses: actions/checkout@v3 - uses: pnpm/action-setup@v2 From 1cf373a34fe9f1fcc844bdf3fc3f4cd93d36d920 Mon Sep 17 00:00:00 2001 From: Jordan Eldredge Date: Fri, 3 Apr 2026 12:43:59 -0700 Subject: [PATCH 5/6] Add TypeScript 6.0 support and pin CI versions - Remove deprecated `downlevelIteration`, add explicit `types: ["node"]` for TS 6's stricter type resolution - Fix catch clauses and implicit any for TS 6 compatibility - Add TS 6.0.2 to CI matrix and pin all TS versions to exact patches - Update changelog Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/ci.yaml | 7 ++++--- package.json | 4 ++-- src/Extractor.ts | 2 +- src/tests/TestRunner.ts | 2 +- src/tests/test.ts | 4 ++-- src/utils/visitor.ts | 2 +- tsconfig.json | 2 +- website/docs/07-changelog/index.md | 4 ++++ 8 files changed, 16 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d8ad27fe..17cfa401 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -57,9 +57,10 @@ jobs: matrix: node-version: *node-versions typescript-version: - - "5.5" - - "5.7" - - "~5.9" + - "5.5.4" + - "5.7.3" + - "5.9.3" + - "6.0.2" steps: - uses: actions/checkout@v3 - uses: pnpm/action-setup@v2 diff --git a/package.json b/package.json index 75a9a71e..0808b855 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,6 @@ "typescript": ">=5.5" }, "devDependencies": { - "typescript": "5.9.2", "@eslint/eslintrc": "^3.3.1", "@eslint/js": "^9.36.0", "@types/node": "^24.5.2", @@ -42,7 +41,8 @@ "path-browserify": "^1.0.1", "prettier": "^3.6.2", "process": "^0.11.10", - "tsx": "^4.19.0" + "tsx": "^4.19.0", + "typescript": "5.9.2" }, "prettier": { "trailingComma": "all" diff --git a/src/Extractor.ts b/src/Extractor.ts index b31ca193..0c2d9d3d 100644 --- a/src/Extractor.ts +++ b/src/Extractor.ts @@ -3046,7 +3046,7 @@ function graphQLNameValidationMessage(name: string): string | null { try { assertName(name); return null; - } catch (e) { + } catch (e: any) { return e.message; } } diff --git a/src/tests/TestRunner.ts b/src/tests/TestRunner.ts index 0bf906a4..6bb54202 100644 --- a/src/tests/TestRunner.ts +++ b/src/tests/TestRunner.ts @@ -189,7 +189,7 @@ export default class TestRunner { async transform(code: string, filename: string): Promise { try { return await this._transformer(code, filename); - } catch (e) { + } catch (e: any) { console.error(e); return { kind: "ERROR", err: e.message }; } diff --git a/src/tests/test.ts b/src/tests/test.ts index 491540f3..e13d0143 100644 --- a/src/tests/test.ts +++ b/src/tests/test.ts @@ -126,7 +126,7 @@ const testDirs: TestDir[] = [ ); } parsed = parsedResult.value; - } catch (e) { + } catch (e: any) { return err(e.message); } console.warn = consoleWarn; @@ -191,7 +191,7 @@ const testDirs: TestDir[] = [ ); } parsedOptions = parsedOptionsResult.value; - } catch (e) { + } catch (e: any) { return err(e.message); } diff --git a/src/utils/visitor.ts b/src/utils/visitor.ts index b556093d..b28f53ce 100644 --- a/src/utils/visitor.ts +++ b/src/utils/visitor.ts @@ -59,7 +59,7 @@ export function visitDefinitions(doc: DocumentNode, visitors: Visitor) { }); } -const emptyArray = []; +const emptyArray: never[] = []; /** * Simplified, more performant, version of graphql-js's visit function that only diff --git a/tsconfig.json b/tsconfig.json index aedd5027..2dbe7973 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,10 +4,10 @@ }, "compilerOptions": { "skipLibCheck": true, + "types": ["node"], "lib": ["es2020"], "experimentalDecorators": true, "outDir": "dist", - "downlevelIteration": true, "strictNullChecks": true, "declaration": true, "resolveJsonModule": true, diff --git a/website/docs/07-changelog/index.md b/website/docs/07-changelog/index.md index 7e8eb5e7..3e640b5c 100644 --- a/website/docs/07-changelog/index.md +++ b/website/docs/07-changelog/index.md @@ -6,6 +6,10 @@ Changes in this section are not yet released. If you need access to these change - **Features** - Added support for deriving `@gqlEnum` from const arrays (`(typeof X)[number]`) and const objects (`(typeof X)[keyof typeof X]`). This allows defining enums with runtime-accessible values without using TypeScript's `enum` syntax. The const declaration must immediately precede the type alias. See [enum docs](../04-docblock-tags/07-enums.mdx#runtime-accessible-enums) for details. +- **Improvements** + - `typescript` is now a peer dependency (`>=5.5`) instead of a direct dependency, allowing you to use your own TypeScript version. ([PR](https://github.com/captbaritone/grats/pull/228)) + - Added support for TypeScript 6.0. ([PR](https://github.com/captbaritone/grats/pull/228)) + - CI now tests against TypeScript 5.5, 5.7, 5.9, and 6.0. ## 0.0.36 From d27ed60d5ff8a45e2206735055810d35253fa272 Mon Sep 17 00:00:00 2001 From: Jordan Eldredge Date: Fri, 3 Apr 2026 12:55:46 -0700 Subject: [PATCH 6/6] Update generated llm-docs for changelog entry Co-Authored-By: Claude Opus 4.6 (1M context) --- llm-docs/changelog.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/llm-docs/changelog.md b/llm-docs/changelog.md index 2884f743..393558ab 100644 --- a/llm-docs/changelog.md +++ b/llm-docs/changelog.md @@ -6,6 +6,10 @@ Changes in this section are not yet released. If you need access to these change - **Features** - Added support for deriving `@gqlEnum` from const arrays (`(typeof X)[number]`) and const objects (`(typeof X)[keyof typeof X]`). This allows defining enums with runtime-accessible values without using TypeScript's `enum` syntax. The const declaration must immediately precede the type alias. See [enum docs](./docblock-tags/enums.md#runtime-accessible-enums) for details. +- **Improvements** + - `typescript` is now a peer dependency (`>=5.5`) instead of a direct dependency, allowing you to use your own TypeScript version. ([PR](https://github.com/captbaritone/grats/pull/228)) + - Added support for TypeScript 6.0. ([PR](https://github.com/captbaritone/grats/pull/228)) + - CI now tests against TypeScript 5.5, 5.7, 5.9, and 6.0. ## 0.0.36