Skip to content

chore: adopt TypeScript 7, extend type-check coverage, align versions - #176

Merged
dmythro merged 2 commits into
mainfrom
chore/typescript-7-tooling
Jul 14, 2026
Merged

chore: adopt TypeScript 7, extend type-check coverage, align versions#176
dmythro merged 2 commits into
mainfrom
chore/typescript-7-tooling

Conversation

@dmythro

@dmythro dmythro commented Jul 14, 2026

Copy link
Copy Markdown
Member

Summary

Upgrades TypeScript 6.0.3 → 7.0.2 and fixes the fallout the bump exposed, plus some version/tooling alignment.

TS 7 removed the baseUrl option, and its stricter rootDir handling surfaced errors that were previously masked — errors in packages that CI never type-checked. So the upgrade comes with real fixes, not just a version number.

Changes

TypeScript 7 + type-check coverage

  • Drop baseUrl (removed in TS 7) and the dead outDir from the shared packages/tsconfig/tsconfig.json, keeping the shared base runtime-neutral.
  • Declare types: ["node", "bun"] in the scripts and test-js configs — the consumers that actually target those runtimes — so node/Bun globals resolve, rather than injecting them from the shared base.
  • Remove the now-invalid baseUrl from packages/scripts/tsconfig.json.
  • Add the with { type: "json" } import attribute required under NodeNext (countries.emoji.ts).
  • Extend check-types to cover the scripts and test-js packages — previously only the countries package was type-checked in CI; the others were checked solely by the IDE, where a rootDir error masked genuine failures.

Version / tooling alignment

  • Bump the root workspace version 3.2.0 → 3.4.0 to match the released package, and update the version script so it keeps the root in sync going forward.
  • Set packageManager to bun@1.3.14.

Verification

  • bun run ci — lint + check-types (all 3 packages) + build + test: pass (16 tests)
  • Build produces no dist/ changes
  • Local CodeRabbit review: 0 findings

Upgrade TypeScript 6.0.3 -> 7.0.2. TS 7 removed the `baseUrl` option and
its rootDir handling was masking real errors in packages that CI never
type-checked, so several fixes come along with the bump:

- Drop `baseUrl` (removed in TS 7) and the dead `outDir` from the shared
  tsconfig; add explicit `types: [node, bun]` so globals resolve.
- Add the `type: "json"` import attribute required under NodeNext.
- Extend `check-types` to cover the scripts and test-js packages, which
  were previously only checked by the IDE (and masked by a rootDir error).

Also align version metadata:

- Bump the root workspace version 3.2.0 -> 3.4.0 to match the release, and
  have the version script keep it in sync going forward.
- Set packageManager to bun@1.3.14.
@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The root package version changes to 3.4.0, with updated Bun and TypeScript versions and expanded type-checking coverage. TypeScript configurations remove baseUrl and outDir, add Bun types, and retain NodeNext settings. The countries emoji data import uses a JSON import attribute. The version script now updates the root package.json alongside existing generated package files.

Possibly related PRs

Poem

I’m a rabbit with config in flight,
Hopping through versions crisp and bright.
Bun bells ring, TypeScript grows,
JSON wears a proper coat of clothes.
The root package joins the dance—
Squeak hooray for version advance!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly matches the main changes: TypeScript 7 upgrade, expanded type-checking, and version/tooling alignment.
Description check ✅ Passed The description covers the required summary, changes, and verification, but it omits the template's Issue # and data-source fields.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/typescript-7-tooling

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
packages/tsconfig/tsconfig.json (1)

22-23: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Keep Node/Bun globals out of the shared browser configuration.

packages/test-js/tsconfig.json extends this file and includes DOM libraries, so these entries expose server-runtime globals to browser-oriented typechecks. Move them to the Node/Bun-specific configuration unless every consumer is intentionally targeting those runtimes.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/tsconfig/tsconfig.json` around lines 22 - 23, Remove the Node/Bun
entries from the shared tsconfig configuration so browser-oriented consumers
extending it do not receive server-runtime globals. Add the corresponding types
configuration to the Node/Bun-specific tsconfig instead, preserving those
globals only for runtime-specific typechecks.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@packages/tsconfig/tsconfig.json`:
- Around line 22-23: Remove the Node/Bun entries from the shared tsconfig
configuration so browser-oriented consumers extending it do not receive
server-runtime globals. Add the corresponding types configuration to the
Node/Bun-specific tsconfig instead, preserving those globals only for
runtime-specific typechecks.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9904b5fe-eda2-49dc-bbc4-78a7117f25f6

📥 Commits

Reviewing files that changed from the base of the PR and between 6d3ffc5 and a9a2a09.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • package.json
  • packages/countries/src/data/countries.emoji.ts
  • packages/scripts/tsconfig.json
  • packages/scripts/version.ts
  • packages/tsconfig/tsconfig.json
💤 Files with no reviewable changes (1)
  • packages/scripts/tsconfig.json

Keep the shared config runtime-neutral: declare `types: [node, bun]` in
the scripts and test-js configs that actually target those runtimes,
instead of the shared base that a browser-oriented consumer could extend.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR upgrades the workspace to TypeScript 7.0.2, tightens type-checking by expanding CI coverage to additional packages, and aligns workspace/tooling versions to match the latest release.

Changes:

  • Update TypeScript to 7.0.2 and remove now-invalid baseUrl/dead outDir config from shared tsconfig.
  • Expand check-types to run tsc for countries, scripts, and test-js.
  • Align versions/tooling: bump workspace version to 3.4.0, update version script to keep root package.json in sync, and set packageManager to bun@1.3.14.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/tsconfig/tsconfig.json Removes deprecated/unused compiler options while keeping shared NodeNext defaults and path mappings.
packages/test-js/tsconfig.json Adds explicit types to improve global type resolution under TS 7 and aligns trailing commas/style.
packages/scripts/version.ts Updates the version bump script to also write the root package.json version.
packages/scripts/tsconfig.json Removes invalid baseUrl and adds explicit types for node/bun environments.
packages/countries/src/data/countries.emoji.ts Updates JSON import to use the required import attribute under NodeNext/TS 7.
package.json Bumps workspace/tool versions and extends check-types to cover more packages.
bun.lock Updates lockfile to reflect the TypeScript/workspace version changes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/tsconfig/tsconfig.json
@dmythro
dmythro merged commit 3e19734 into main Jul 14, 2026
5 checks passed
@dmythro
dmythro deleted the chore/typescript-7-tooling branch July 14, 2026 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants