chore(ts7): adopt the TypeScript 7 native compiler (tsgo)
Make the editor packages compatible with, and benefit from, the native Go
compiler (TypeScript 7 / tsgo) while keeping the npm publish path on stable tsc.
- Add @typescript/native-preview (pinned 7.0.0-dev.20260624.1). tsgo coexists
with typescript@6, which Next typegen and the IDE plugin still need until the
TS 7.1 programmatic API ships.
- Fix two react-three-fiber JSX augmentations the native checker rejects but
tsc tolerated:
- viewer: map only LineBasicNodeMaterial (the one webgpu node material used as
a JSX tag) instead of the whole three/webgpu namespace (TS2320/TS2590).
- plane-box-select-tool: drop the redundant `IntrinsicElements extends
ThreeElements` block — it duplicated R3F's global augmentation and, by
referencing @react-three/fiber's ThreeElements directly, hit a bun peer-dep
variant-directory duplicate under tsgo (TS2320). r3f.d.ts already covers
those JSX intrinsics. Types-only — no runtime change.
- check-types -> tsgo --noEmit (editor, @repo/ui, editor app, ifc-converter app)
- emit-package dev watch -> tsgo --build --watch
- build/publish stay tsc --build (prepublishOnly + release.yml unchanged;
emitted .d.ts is byte-identical to tsc output)
- bump next 16.2.6 -> 16.2.9
tsc remains the source of truth and fallback. Published artifacts unchanged.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
d3c3c0517b
commit
1b4c656901
@@ -58,7 +58,7 @@
|
||||
],
|
||||
"scripts": {
|
||||
"build": "tsc --build",
|
||||
"dev": "tsc --build --watch",
|
||||
"dev": "tsgo --build --watch",
|
||||
"test": "bun test",
|
||||
"bench:registry": "bun run src/registry/__bench__/relations-resolver.bench.ts",
|
||||
"prepublishOnly": "npm run build"
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
"./catalog": "./src/components/ui/item-catalog/catalog-items.tsx"
|
||||
},
|
||||
"scripts": {
|
||||
"check-types": "tsc --noEmit"
|
||||
"check-types": "tsgo --noEmit"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@pascal-app/core": "^0.9.1",
|
||||
|
||||
@@ -10,7 +10,6 @@ import {
|
||||
type ZoneNode,
|
||||
} from '@pascal-app/core'
|
||||
import { useViewer } from '@pascal-app/viewer'
|
||||
import type { ThreeElements } from '@react-three/fiber'
|
||||
import { useThree } from '@react-three/fiber'
|
||||
import { useCallback, useEffect, useRef } from 'react'
|
||||
import {
|
||||
@@ -34,12 +33,6 @@ import { CursorSphere } from '../shared/cursor-sphere'
|
||||
import { isBoxSelectPointerSuppressed, markBoxSelectHandled } from './box-select-state'
|
||||
import { collectSelectableCandidateIds } from './select-candidates'
|
||||
|
||||
declare module 'react/jsx-runtime' {
|
||||
namespace JSX {
|
||||
interface IntrinsicElements extends ThreeElements {}
|
||||
}
|
||||
}
|
||||
|
||||
type Bounds = { minX: number; maxX: number; minZ: number; maxZ: number }
|
||||
|
||||
const BOX_SELECT_ACCENT_COLOR = '#818cf8'
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
],
|
||||
"scripts": {
|
||||
"build": "tsc --build",
|
||||
"dev": "tsc --build --watch",
|
||||
"dev": "tsgo --build --watch",
|
||||
"prepublishOnly": "npm run build"
|
||||
},
|
||||
"dependencies": {
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
],
|
||||
"scripts": {
|
||||
"build": "tsc --build",
|
||||
"dev": "tsc --build --watch",
|
||||
"dev": "tsgo --build --watch",
|
||||
"start": "bun dist/bin/pascal-mcp.js",
|
||||
"test": "bun test",
|
||||
"smoke": "bun run scripts/smoke.ts",
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
],
|
||||
"scripts": {
|
||||
"build": "tsc --build",
|
||||
"dev": "tsc --build --watch",
|
||||
"dev": "tsgo --build --watch",
|
||||
"test": "bun test",
|
||||
"prepublishOnly": "bun run build && bun test"
|
||||
},
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
"scripts": {
|
||||
"lint": "eslint . --max-warnings 0",
|
||||
"generate:component": "turbo gen react-component",
|
||||
"check-types": "tsc --noEmit"
|
||||
"check-types": "tsgo --noEmit"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@repo/eslint-config": "*",
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
],
|
||||
"scripts": {
|
||||
"build": "tsc --build",
|
||||
"dev": "tsc --build --watch",
|
||||
"dev": "tsgo --build --watch",
|
||||
"prepublishOnly": "npm run build"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
sceneRegistry,
|
||||
useScene,
|
||||
} from '@pascal-app/core'
|
||||
import { Canvas, extend, type ThreeToJSXElements, useFrame, useThree } from '@react-three/fiber'
|
||||
import { Canvas, extend, type ThreeElement, useFrame, useThree } from '@react-three/fiber'
|
||||
import {
|
||||
forwardRef,
|
||||
useEffect,
|
||||
@@ -38,7 +38,15 @@ import { SelectionManager } from './selection-manager'
|
||||
import { ViewerCamera } from './viewer-camera'
|
||||
|
||||
declare module '@react-three/fiber' {
|
||||
interface ThreeElements extends ThreeToJSXElements<typeof THREE> {}
|
||||
// The TS 7 native compiler (tsgo) rejects mapping the entire `three/webgpu`
|
||||
// namespace into JSX — `ThreeToJSXElements<typeof THREE>` triggers a TS2320
|
||||
// heritage conflict with R3F's core-three base plus a TS2590 "union too
|
||||
// complex". tsc 6 tolerates it; tsgo does not. R3F's base ThreeElements
|
||||
// already covers core three, so we extract only the webgpu/TSL node materials
|
||||
// we actually use as JSX (see r3f.docs.pmnd.rs/api/typescript).
|
||||
interface ThreeElements {
|
||||
lineBasicNodeMaterial: ThreeElement<typeof THREE.LineBasicNodeMaterial>
|
||||
}
|
||||
}
|
||||
|
||||
extend(THREE as any)
|
||||
|
||||
Reference in New Issue
Block a user