typescript-go-sync
Keeps ttsc's compiler-target shims synchronized with TypeScript-Go and complete for plugin authors. Use before adding a shim re-export, bumping a target's compiler, changing the shim audit or generators, or chasing a missing compiler API.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-14
- Stars
- ★ 21
- Forks
- 2
01 前言 Front Matter
- name
- typescript-go-sync
- description
- Keeps ttsc's compiler-target shims synchronized with TypeScript-Go and complete for plugin authors. Use before adding a shim re-export, bumping a target's compiler, changing the shim audit or generators, or chasing a missing compiler API.
03 SKILL.md 正文
TypeScript-Go Shim
The shims are the only compiler surface plugins can use, one tree per compiler target. A missing re-export of an API in unmodified upstream is a ttsc bug.
| Target | Shims | Compiler module | Generator and audit flags |
|---|---|---|---|
| 7.0 | packages/ttsc/shim/<name>, modules github.com/microsoft/typescript-go/shim/<name> |
github.com/microsoft/typescript-go |
defaults; tools/shim_audit/baseline.json |
| 7.1 | bridges packages/ttsc/targets/7.1/bridge/<name>, modules github.com/microsoft/TypeScript/tsc/shim/<name>, and generated facades targets/7.1/facade/<name> at the 7.0 module paths |
github.com/microsoft/TypeScript/tsc |
-shim ./targets/7.1/bridge -internal github.com/microsoft/TypeScript/tsc/internal/; baseline-7.1.json |
Go admits an import of a module's internal/ tree only from a path rooted at that module, so 7.1 code that reaches the compiler lives in the bridges, and the facades only alias them. The 7.1 modules are standalone: run their Go commands with GOWORK=off.
Adding An API
- Find the symbol under the target's compiler module in
$(go env GOMODCACHE). - If the generator derives it, run
go run '-modfile=tools/gen_shims/go.mod' ./tools/gen_shims/main.goinpackages/ttscwith the target's flags; generated files are never edited, and-checkreports drift. Otherwise list it in the directory'sextra-shim.json, or write it in a file marked// gen_shims:hand-maintained, where an unexported symbol takes a bodiless//go:linknamedeclaration withimport _ "unsafe". - After a 7.1 bridge changes, regenerate its facades with
pnpm --filter ttsc shim:facade.
Bumping A Compiler
- Update the identical compiler
requireline in every shim or bridge of the target and in each consumer that pins it, and refresh sums through the real module or workspace resolution. Never add permanent absolute replacements.go work synccan succeed while leaving a module stale; then set its requirements withgo mod edit -requireand rungo mod download. - Run the generator with
GOWORK=off, thenpnpm --filter ttsc shim:audit -fix, and regenerate 7.1 facades. - For the 7.1 target, set the version in
tests/test-e2e/fixtures/ttsc/compiler-target-probe/typescript-7.1.jsonto thetypescriptnightly whosegitHeadis the new commit. The installation E2E and the 7.1 E2E lane install it. - Fix hand-maintained files and
extra-shim.jsonfor upstream renames, signature changes, and export flips, keep previously exported enum families, and document public migrations in the AST and Checker guide.
Audit
CI runs pnpm --filter ttsc shim:audit, which audits every target and checks each bodiless go:linkname declaration against its target's signature. It also runs the first-party Go suites on each target, through pnpm run test:go for 7.0 and pnpm run test:go:7.1 for 7.1, plus an E2E lane on the pinned 7.1 nightly. Accept a new gap into the target's baseline with -write-baseline only on purpose, and give every producer_exemptions entry a rationale. The audit proves only that code compiles, so add a runtime probe in packages/lint/linthost/ that walks a Checker loaded through loadProgram for each new graph-walk operation.
Consumer Validation
A shim change is proven only by a downstream plugin passing against it. Build and pack with your platform package, install the tarballs into ../typia or another consumer, and run a test that uses the API:
pnpm --filter ttsc --filter @ttsc/unplugin --filter ./packages/ttsc-linux-x64 -r --workspace-concurrency=1 build
pnpm --filter ttsc --filter @ttsc/unplugin --filter ./packages/ttsc-linux-x64 exec pnpm pack --out "../../experimental/tarballs/%s.tgz"
04 同仓库更多 Skills
contracts
Defines self-acknowledgments for production declarations and tests. Use when implementing or reviewing maintained source, unit tests or E2E tests, or selecting Evidence checklists.
prompting
Writes and trims ttsc's prompts for agents, namely AGENTS.md, CLAUDE.md, and the skills under .agents/skills. Use before changing any of them, together with the documentation skill's writing rules.
contracts
Defines the @evidence checklists every maintained ttsc declaration and test answers, and their evidence.config.json wiring. Use when writing or reviewing maintained source or tests, or changing Evidence selection.
alchemy-domain
Build backends with @alchemy.run/domain (domain-driven design on Effect) - turn requirements into aggregates, commands, events, rejections, views, policies, sagas, projections, streams, queries, external systems and Apis; lay them out in a monorepo (domain / server / web packages, kind-suffixed files); test them with stories; host them on Durable Objects (Cloudflare, Rivet or Effect Cluster) with alchemy; and drive them from a foldkit frontend. Use when designing or changing an @alchemy.run/domain model, adding a building block, wiring hosting or a frontend, or reviewing such code.
alchemy-provider
暂无简介
write-docs
暂无简介