AI vibe coding disclaimer: this repo was written entirely by AI (ZCode, GLM 5.3) as a quick probe of the content mapper protocol's capabilities — it will not be further developed or maintained.
- A demo Vue SFC content mapper for the typescript-go content mapper protocol (PR #4712), letting
tsgotype-check.vuefiles natively. - Uses only
@vue/compiler-sfc— no vue-language-tools. - Checks script setup, props/models/emits/slots, template expressions, v-for, v-model, event handlers, and Options API components.
- Maps diagnostics back to original positions through verbatim, atom, and alias spans, with
@vue-expect-error/@vue-ignoredirectives. - An exploration of the protocol, not production tooling.
pnpm install.- Build a tsgo from source (the protocol merged after 7.0.2):
git clone --depth 1 https://github.com/microsoft/typescript-go /tmp/typescript-go && cd /tmp/typescript-go && go build -o /tmp/tsgo ./cmd/tsgo. pnpm build(orpnpm play:preparefor a fast stub build).pnpm playruns tsgo over the playground fixtures; setTSGO_BINif the binary is not at/tmp/tsgo.pnpm testruns the suite including real-tsgo e2e when the binary exists;pnpm lint/pnpm typecheckfor the rest.- In your own project, add a
contentMappersentry to tsconfig and runtsgo --noEmit --runExternalCode.
- Only components imported from relative
.vuespecifiers get prop/slot/model/event types; library components fall back toany. - Cross-file props types degrade to permissive
anynames,v-ifdoes not narrow,this.*in option bodies is untyped, and generic components are unsupported. - Template diagnostics render with the supplemental virtual file name (
.vue.0.ts) though coordinates are original — current typescript-go behavior. --watchdoes not recompile on file changes in the current tsgo dev build (upstream issue, not a mapper defect).
- Per-feature span masks are unused — every span enables all language service features.
- CSS, custom blocks, and
<style>handling are ignored. - Declaration maps are unsupported by the protocol itself.
- No editor integration — the VS Code
registerContentMappersAPI is not wired, so only the CLI experience exists.
Published under MIT License.
0 comments
log in to comment.