statelyai / xstate-tools

Public monorepo for XState tooling
183 stars 36 forks source link

Proposal: rename typegen file to `.d.ts` #241

Open TheDutchCoder opened 1 year ago

TheDutchCoder commented 1 year ago

The typegen file for machine is currently called [machine].typegen.ts. Because this file only contains typings, it might be better to rename it to [machine].typegen.d.ts.

I ran into this being an issue while using Nuxt, which processes .ts files, but not .d.ts files for this exact reason.

In the end it wasn't a huge deal, I have moved the machine and typegen file out of the folder that auto-imports .ts files, but might be better to be safe than sorry.

WebMechanic commented 1 year ago

I second and third that. TL;DR it's the standard file extension for TypeScript definition files according to Microsoft documentation and tools.

JetBrains IDEs also treat .d.ts as TypeScript definition files (modules), so do bundlers, testing tools ... everybody. It's also what one gets from services like DefinitelyTyped. It's what tsc creates if you ask for it or Microsoft's dts-gen.

davidkpiano commented 1 year ago

That's a great idea (cc. @Andarist)