clockworklabs / SpacetimeDB

Multiplayer at the speed of light
https://spacetimedb.com
Other
4.41k stars 110 forks source link

[TypeScript] spacetime generate should generate .js files, not .ts #1976

Open bfops opened 1 week ago

bfops commented 1 week ago

If a user is working with a non-typescript project, they simply cannot use the bindings generated by spacetimedb. Hence, we should generate .js files as bindings. We can type the files in 2 ways:

Best of both worlds

We scan through user's files and if we see .ts files, we generate .ts by default. Otherwise switch to .js(or .js+.d.ts). Can be overriden by a CLI flag (--use-typescript)