Skip to content

refactor: upgrade to TypeScript 6 with source-first monorepo resolution#422

Merged
gaomeng1900 merged 3 commits intomainfrom
refactor/typescript-6
Apr 11, 2026
Merged

refactor: upgrade to TypeScript 6 with source-first monorepo resolution#422
gaomeng1900 merged 3 commits intomainfrom
refactor/typescript-6

Conversation

@gaomeng1900
Copy link
Copy Markdown
Collaborator

@gaomeng1900 gaomeng1900 commented Apr 8, 2026

What

Upgrade to TypeScript 6.0.2 and switch every internal package to source-first resolution — main/types/exports point to .ts source in dev; a prepublishOnly/postpublish script pair swaps them to dist for npm publish. This eliminates per-package composite/references/paths, all tsconfig.dts.json files, and the Vite alias workarounds.

Type

  • Breaking change
  • Bug fix
  • Feature / Improvement
  • Refactor / Chores
  • Documentation / Website / Demo / Testing

Testing

  • Tested in modern browsers
  • No console errors
  • Types/doc added

Requirements / 要求

  • I have read and follow the Code of Conduct and Contributing Guide . / 我已阅读并遵守行为准则。
  • This PR is NOT generated by a bot or AI agent acting autonomously. I have authored or meaningfully reviewed every change. / 此 PR 不是由 bot 或 AI 自主生成的,我已亲自编写或充分审查了每一处变更。

@gaomeng1900 gaomeng1900 force-pushed the refactor/typescript-6 branch from 438203e to d4d2c53 Compare April 11, 2026 18:01
@gaomeng1900 gaomeng1900 changed the title refactor(setup): upgrade TypeScript to 6.0.2 refactor: upgrade TypeScript 6, unify typecheck, source-first dev entrypoints Apr 11, 2026
@gaomeng1900 gaomeng1900 force-pushed the refactor/typescript-6 branch from d4d2c53 to 4d27d49 Compare April 11, 2026 18:04
@gaomeng1900 gaomeng1900 changed the title refactor: upgrade TypeScript 6, unify typecheck, source-first dev entrypoints refactor(setup): upgrade to TypeScript 6 with source-first monorepo resolution Apr 11, 2026
@gaomeng1900 gaomeng1900 self-assigned this Apr 11, 2026
@gaomeng1900 gaomeng1900 requested a review from Copilot April 11, 2026 18:07
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.json and root npm run typecheck that checks libs + extension.
  • Convert internal packages to source-first main/types/exports with publishConfig + prepare-publish/restore-dev scripts 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.

@gaomeng1900 gaomeng1900 changed the title refactor(setup): upgrade to TypeScript 6 with source-first monorepo resolution refactor: upgrade to TypeScript 6 with source-first monorepo resolution Apr 11, 2026
@gaomeng1900 gaomeng1900 force-pushed the refactor/typescript-6 branch from a2ce04c to ca197d1 Compare April 11, 2026 19:17
@gaomeng1900 gaomeng1900 merged commit b5ec9c4 into main Apr 11, 2026
5 checks passed
@gaomeng1900 gaomeng1900 deleted the refactor/typescript-6 branch April 11, 2026 19:28
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