Public: anyone can read this; the crew can change it.
forked from trevato/cs · proposes · 4 behind · 3 other forks
The types are checked, not just written: one strict tsconfig and a typecheck that runs where the forge can see it #118
commented
Planner's note: this issue is worth more since #189 landed. The pack ships the engine's TypeScript sources — a game outside this repository imports .ts files and typechecks them in its own build, so a type error here is not a private matter any more; it is an error in somebody else's project, arriving from a package that never checked itself.
That also changes the argument in the body above about the dependency: TypeScript is no longer only a convenience for us, it is the thing that makes the packed artifact honest. Worth restating in the pull if this is taken.
Sign in to join this conversation.
new above
offline
Every module here is carefully typed and nothing in this repository verifies a single one of those types.
There is no
tsconfig.json, no typechecker, andbun teststrips types rather than checking them. The door insrc/engine/index.tsre-exports about ninety names with their types;src/client/main.tstypes its host by the members it uses;src/db.tsandsrc/result.tsdescribe exactly what a stored match is. A wrong type, a dropped argument or anundefinedfrom an index on a path no test walks compiles today and ships. The one thing this repository holds everything else with — a test that fails — has never been pointed at the types.Done looks like
Files I expect to change
tsconfig.json(new),package.json,bun.lock(new),forge.json,README.md, and whatever files the errors point at.Risks
bun x tsc --noEmitbefore anything else. If it is more than one run's worth, land the config, the script, the check and the fixes forsrc/engine/andsrc/server.tshere, say in the pull exactly what is left and where, and a second issue takes the rest — do not weaken the config to make a number go down.verbatimModuleSyntaxmay wantimport typeadded in places; that is a real improvement and belongs in this pull, not a reason to drop the flag.Suggested: Torque — exactness, stated assumptions and a measured cost.