viewer: fix pre-existing build breakage

The viewer no longer compiled (bitrot surfaced by vue 2.7 + typescript 4.9 +
pnpm 11 strict hoisting):

- delete shims-tsx.d.ts: vue 2.7 ships its own JSX typings, ours duplicated
  the IntrinsicElements index signature
- type UIData.dragged structurally (Vue & { pieceType, pieceId }) instead of
  using a .vue module import as a type, which TS 4.9 rejects
- add csstype (vue's types import it; no longer hoisted) and @types/node +
  'node' in tsconfig types (self-contained.ts uses process.env)
This commit is contained in:
coyotte508 2026-08-16 20:58:01 +00:00
commit f805997466
5 changed files with 12 additions and 16 deletions

6
pnpm-lock.yaml generated
View file

@ -123,6 +123,9 @@ importers:
'@types/mocha':
specifier: ^5.2.4
version: 5.2.7
'@types/node':
specifier: ^13.13.52
version: 13.13.52
'@typescript-eslint/parser':
specifier: ^4.26.1
version: 4.33.0(eslint@7.32.0(supports-color@6.1.0))(supports-color@6.1.0)(typescript@4.9.5)
@ -144,6 +147,9 @@ importers:
chai:
specifier: ^4.1.2
version: 4.5.0
csstype:
specifier: ^3.2.3
version: 3.2.3
eslint:
specifier: ^7.28.0
version: 7.32.0(supports-color@6.1.0)

View file

@ -29,6 +29,7 @@
"@types/events": "^3.0.0",
"@types/lodash": "^4.14.154",
"@types/mocha": "^5.2.4",
"@types/node": "^13.13.52",
"@typescript-eslint/parser": "^4.26.1",
"@vue/cli-plugin-babel": "~4.4.0",
"@vue/cli-plugin-typescript": "~4.4.0",
@ -36,6 +37,7 @@
"@vue/cli-service": "~4.4.0",
"@vue/test-utils": "^1.0.3",
"chai": "^4.1.2",
"csstype": "^3.2.3",
"eslint": "^7.28.0",
"eslint-plugin-vue": "^7.11.0",
"sass": "^1.26.5",

View file

@ -1,13 +0,0 @@
import Vue, { VNode } from 'vue';
declare global {
namespace JSX {
// tslint:disable no-empty-interface
interface Element extends VNode {}
// tslint:disable no-empty-interface
interface ElementClass extends Vue {}
interface IntrinsicElements {
[elem: string]: any;
}
}
}

View file

@ -1,8 +1,9 @@
import { ContainerPiece, ShipPosition } from 'container-engine/src/gamestate';
import PieceComponent from '../components/pieces/Piece.vue';
import Vue from 'vue';
export interface UIData {
dragged?: PieceComponent | null;
/** The Piece component instance (Piece.vue) currently being dragged, if any */
dragged?: (Vue & { pieceType: PieceType; pieceId: string }) | null;
waitingAnimations: number;
}

View file

@ -13,7 +13,7 @@
"sourceMap": true,
"resolveJsonModule": true,
"baseUrl": ".",
"types": ["webpack-env", "mocha", "chai"],
"types": ["webpack-env", "mocha", "chai", "node"],
"paths": {
"@/*": ["src/*"]
},