refactor: upgrade to TypeScript 6 with source-first monorepo resolution#422
Merged
gaomeng1900 merged 3 commits intomainfrom Apr 11, 2026
Merged
refactor: upgrade to TypeScript 6 with source-first monorepo resolution#422gaomeng1900 merged 3 commits intomainfrom
gaomeng1900 merged 3 commits intomainfrom
Conversation
438203e to
d4d2c53
Compare
d4d2c53 to
4d27d49
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Upgrades the repo to TypeScript 6.0.2 and shifts workspace packages to “source-first” resolution (dev entrypoints point at .ts source), with publish-time scripts to swap manifests back to dist artifacts for npm publishing. This removes prior per-package TS project references/path mappings and Vite alias workarounds.
Changes:
- Add a unified root
tsconfig.typecheck.jsonand rootnpm run typecheckthat checks libs + extension. - Convert internal packages to source-first
main/types/exportswithpublishConfig+prepare-publish/restore-devscripts for publish lifecycle. - Simplify package tsconfigs and Vite configs by removing monorepo alias/path/reference workarounds; update TypeScript version to
^6.0.2.
Reviewed changes
Copilot reviewed 32 out of 35 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tsconfig.typecheck.json | New unified typecheck project for libs/website packages. |
| tsconfig.json | Removes root project references tsconfig previously used for IDE. |
| tsconfig.base.json | Updates shared compiler options for TS6 + bundler-mode assumptions. |
| scripts/prepare-publish.js | New script to swap dev entrypoints → publish entrypoints and copy LICENSE/README as needed. |
| scripts/restore-dev.js | New script to restore dev entrypoints post-publish and clean up copied files. |
| packages/website/vite.config.js | Removes monorepo package alias overrides; keeps @ self-alias. |
| packages/website/tsconfig.json | Removes references/paths workaround; keeps only @/* mapping. |
| packages/website/package.json | Removes per-workspace typecheck script (now handled at root). |
| packages/ui/vite.config.js | Switches dts generation away from tsconfig.dts.json to inline compiler options. |
| packages/ui/tsconfig.json | Simplifies tsconfig (drops redundant emit/outDir/baseUrl settings). |
| packages/ui/tsconfig.dts.json | Removes dts-specific tsconfig workaround. |
| packages/ui/package.json | Source-first entrypoints + publishConfig; use shared publish swap scripts. |
| packages/page-controller/vite.config.js | Switches dts generation to inline compiler options. |
| packages/page-controller/tsconfig.json | Simplifies tsconfig (drops redundant emit/outDir/baseUrl settings). |
| packages/page-controller/tsconfig.dts.json | Removes dts-specific tsconfig workaround. |
| packages/page-controller/src/dom/dom_tree/index.d.ts | Adds typings for JS dom_tree entrypoint. |
| packages/page-controller/package.json | Source-first entrypoints + publishConfig; use shared publish swap scripts. |
| packages/page-agent/vite.iife.config.js | Removes monorepo alias overrides for IIFE demo build. |
| packages/page-agent/vite.config.js | Switches dts generation to inline compiler options. |
| packages/page-agent/tsconfig.json | Simplifies tsconfig (drops references/paths workarounds). |
| packages/page-agent/tsconfig.dts.json | Removes dts-specific tsconfig workaround. |
| packages/page-agent/package.json | Source-first entrypoints + publishConfig; use shared publish swap scripts. |
| packages/llms/vite.config.js | Switches dts generation to inline compiler options. |
| packages/llms/tsconfig.json | Simplifies tsconfig (drops redundant emit/outDir/baseUrl settings). |
| packages/llms/tsconfig.dts.json | Removes dts-specific tsconfig workaround. |
| packages/llms/package.json | Source-first entrypoints + publishConfig; use shared publish swap scripts. |
| packages/extension/tsconfig.json | Simplifies extension tsconfig; adjusts types and @/* mapping. |
| packages/extension/src/agent/TabsController.ts | Refines port field to use undefined instead of null. |
| packages/core/vite.config.js | Switches dts generation to inline compiler options. |
| packages/core/tsconfig.json | Simplifies tsconfig (drops references/paths workarounds). |
| packages/core/tsconfig.dts.json | Removes dts-specific tsconfig workaround. |
| packages/core/package.json | Source-first entrypoints + publishConfig; use shared publish swap scripts. |
| package.json | Adds root typecheck command; upgrades TypeScript to ^6.0.2; expands cleanup. |
| package-lock.json | Locks TypeScript to 6.0.2. |
| AGENTS.md | Updates command description to reflect current lint behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a2ce04c to
ca197d1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Upgrade to TypeScript 6.0.2 and switch every internal package to source-first resolution —
main/types/exportspoint to.tssource in dev; aprepublishOnly/postpublishscript pair swaps them to dist for npm publish. This eliminates per-packagecomposite/references/paths, alltsconfig.dts.jsonfiles, and the Vite alias workarounds.Type
Testing
Requirements / 要求