Skip to content

chore: migrate core/platforma to TypeScript 7#1764

Open
AStaroverov wants to merge 3 commits into
mainfrom
chore/typescript-7-migration
Open

chore: migrate core/platforma to TypeScript 7#1764
AStaroverov wants to merge 3 commits into
mainfrom
chore/typescript-7-migration

Conversation

@AStaroverov

@AStaroverov AStaroverov commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

What

Migrates the monorepo to TypeScript 7.0.2 (the native compiler). The whole
repo type-checks and builds green on TS7.

Why it's not just a version bump

TS7 is the native (Go) compiler and no longer ships the classic JS Compiler
API
(ts.createProgram, ts.sys, typescript/lib/tsc, …). Tooling that
embeds the compiler — Volar (vue-tsc), vite-plugin-dts, rolldown-plugin-dts,
@vue/compiler-sfc — depends on that API.

Per Microsoft's transition guidance (TS 7.0 release notes) and
vuejs/language-tools#5381,
embedded-compiler tools use the official @typescript/typescript6 bridge
(classic API packaged from TS6) until TS 7.1 ships a stable native API and Volar
adopts it. Node code uses the native tsc; Vue type-checking uses the bridge.

Changes

Versions

  • typescript ~5.9.3 → 7.0.2; add @typescript/typescript6@6.0.2
  • vite-plugin-dts ^4.5.3 → ^5.0.3, rolldown-plugin-dts ^0.26 → ^0.27.13,
    vue-tsc 3.3.5 → 3.3.8, openapi-typescript ^7.10 → ^7.13
  • @microsoft/api-extractor's typescript pinned to the bridge via override

ts-builder

  • bin/vue-tsc-ts6.cjs (new): runs vue-tsc against @typescript/typescript6
    (vue-tsc ≥3.3.8 redirects the alias to its bundled TS6). Browser targets use it.
  • --customConditions "default" instead of a bare "," — TS7's CLI parses ,
    as a source-file positional (TS5042), which broke every node type-check.
  • Provide an explicit fs to @vitejs/plugin-vue's SFC compiler —
    @vue/compiler-sfc fell back to ts.sys (gone on TS7) to resolve types
    imported into SFC macros.
  • dts moduleResolution NodeJs → Bundler so exports subpath types resolve
    (e.g. @vueuse/integrations/useSortable).

ui-vue

  • AnnotationsSidebar / FilterSidebar: handlers accept string | undefined,
    matching PlEditableTitle's defineModel<string>() (no default) emit type.

Verification

  • pnpm turbo run types:check172/172 tasks green across the whole repo,
    confirmed with --force (no cache).
  • Vue package builds (declaration emit) green on TS7.

Notes

  • Vue packages are type-checked with the TS6 classic compiler via the bridge
    (not TS7). This is the intended interim state until TS 7.1 + a Volar update;
    no .vue source changes required.
  • vue intentionally left at 3.5.24 (bumping to 3.5.40 introduced
    defineModel typing regressions).
  • No changesets added — infra/toolchain change; add version bumps if the release
    flow requires them.
  • Not verified in this PR: pnpm test and the full pnpm build (software
    packaging).

Greptile Summary

Migrates the monorepo’s TypeScript and Vue build pipeline to the TypeScript 7 native compiler while retaining the TypeScript 6 compatibility bridge for tools that require the classic Compiler API.

  • TypeScript 7 — the native Go-based compiler used for ordinary TypeScript checks; upgraded to 7.0.2 and paired with a valid non-source custom condition.
  • TypeScript 6 bridge@typescript/typescript6, which supplies the classic JavaScript Compiler API absent from TypeScript 7; added for Vue and declaration tooling.
  • vue-tsc shim — a packaged executable that starts vue-tsc with the bridge compiler; browser, browser-library, and block-UI checks now use it.
  • Custom conditions — conditional-export selectors used to choose source or built package entries; non-source checking now uses default instead of the TS7-invalid comma argument.
  • SFC filesystem — the file-access interface used when Vue resolves imported types in single-file-component macros; Vite Vue configurations now provide explicit Node filesystem operations.
  • Declaration resolution — module resolution used while emitting library typings; declaration builds now consistently use Bundler resolution.
  • Editable annotation titles — annotation and filter title handlers now accept the component’s possible undefined emission and normalize it to an empty string.
  • Updates the associated compiler-dependent packages, lockfile, workspace catalog, and API Extractor override.

Confidence Score: 5/5

The PR appears safe to merge, with no concrete changed-code defect identified.

The target-specific compiler routing, conditional-export override, explicit Vue filesystem integration, declaration-resolution update, and nullable title handling are internally consistent with the migration.

Important Files Changed

Filename Overview
pnpm-workspace.yaml Upgrades the compiler/tooling catalog and introduces the pinned TypeScript 6 compatibility bridge.
tools/ts-builder/bin/vue-tsc-ts6.cjs Adds the packaged Vue type-check entry point that explicitly starts vue-tsc with the classic TypeScript 6 compiler.
tools/ts-builder/src/commands/types.ts Replaces the invalid empty custom-condition workaround with a valid non-source export condition.
tools/ts-builder/src/commands/utils/executable-resolver.ts Routes Vue-capable targets through the compatibility shim while retaining native tsc for other targets.
tools/ts-builder/src/configs/utils/createViteDevConfig.ts Supplies Vue’s SFC compiler with explicit Node filesystem functions under TypeScript 7.
tools/ts-builder/src/configs/utils/createViteLibConfig.ts Uses Bundler module resolution consistently during declaration generation.
sdk/ui-vue/src/components/PlAnnotations/components/AnnotationsSidebar.vue Normalizes an undefined editable-title update to the annotation model’s required string representation.
sdk/ui-vue/src/components/PlAnnotations/components/FilterSidebar.vue Normalizes an undefined editable-label update to the filter model’s required string representation.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[ts-builder type-check] --> B{Target}
  B -->|Node and model| C[TypeScript 7 native tsc]
  B -->|Browser, browser-lib, block-ui| D[vue-tsc TS6 shim]
  D --> E[TypeScript 6 classic Compiler API bridge]
  F[Vite Vue build] --> G[Explicit SFC filesystem]
  F --> H[Bundler declaration resolution]
  C --> I[Type-check result]
  E --> I
  G --> J[Vue build output]
  H --> J
Loading

Reviews (1): Last reviewed commit: "chore: migrate core/platforma to TypeScr..." | Re-trigger Greptile

Context used (3)

Bump the workspace to typescript@7.0.2 (the native compiler) and adapt the
build toolchain so the whole repo type-checks and builds green on TS7.

TypeScript 7 no longer ships the classic JS Compiler API, which Volar-based
tooling (vue-tsc, vite-plugin-dts) still requires. Following Microsoft's
transition guidance, embedded-compiler tools now use the official
@typescript/typescript6 bridge, while node code uses the native tsc.

Toolchain / versions:
- catalog: typescript 7.0.2; add @typescript/typescript6 6.0.2;
  vite-plugin-dts ^5.0.3; vue-tsc 3.3.8; openapi-typescript ^7.13
- ts-builder: rolldown-plugin-dts ^0.27.13 (TS7-capable dts for node builds)

ts-builder adaptations:
- run vue-tsc against @typescript/typescript6 via bin/vue-tsc-ts6.cjs shim
- type-check: pass --customConditions "default" instead of a bare ","
  (TS7's CLI parses "," as a source-file positional -> TS5042)
- provide an explicit fs to @vitejs/plugin-vue's SFC compiler
  (@vue/compiler-sfc fell back to ts.sys, which TS7 no longer exposes)
- dts moduleResolution NodeJs -> Bundler (resolve package exports subpaths)

ui-vue:
- AnnotationsSidebar/FilterSidebar handlers accept string | undefined, as
  PlEditableTitle's defineModel<string>() (no default) emits string | undefined
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@changeset-bot

changeset-bot Bot commented Jul 24, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 70188e8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@milaboratories/ts-builder Patch
@milaboratories/build-configs Patch
@platforma-sdk/ui-vue Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 53.65%. Comparing base (7e54fd7) to head (1c41c8d).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1764      +/-   ##
==========================================
- Coverage   53.72%   53.65%   -0.08%     
==========================================
  Files         366      366              
  Lines       19679    19679              
  Branches     4341     4341              
==========================================
- Hits        10573    10558      -15     
- Misses       7804     7817      +13     
- Partials     1302     1304       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

vitest Vue tests compile SFCs via @vitejs/plugin-vue too, and @vue/compiler-sfc
fell back to ts.sys to resolve types imported into SFC macros. TS7 removed
ts.sys, so tests failed with "No fs option provided ... non-Node environment"
(e.g. @platforma-sdk/ui-vue compiling uikit's PlProgressCell.vue).

Mirror the createViteDevConfig fix: pass an explicit Node fs to the vue plugin
in createVitestVueConfig.
function updateTitle(title: string | undefined) {
produceAnnotationUpdate((draft) => {
draft.title = title;
draft.title = title ?? "";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why these changes appeared? and only 2 such things for all platforma?

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