Open mfulton26 opened 1 year ago
In here we introduced useDeclarationFileForTypegenData
setting that should help you here.
Nice. Thank you @Andarist. I can confirm that enabling xstate.useDeclarationFileForTypegenData
works and creates a declaration file which works with Deno.
I was originally thinking of suggesting some Deno workspace detection logic (e.g. looking for "deno.enable": true
in .vscode/settings.json
, etc.) but now that I wonder if emitting a declaration file for typegen could be made teh default behavior as it works more universally.
That way anyone using Node, Bun, Deno, or some other environment will be able to use typegen without needing to change default settings.
but now that I wonder if emitting a declaration file for typegen could be made teh default behavior as it works more universally.
That's the plan :) I'll take another look at the state of things before doing this because I need to confirm that declaration files can be emitted from projects using this. I have a vague recollection of Andrew Branch from the TS team mentioning that this pattern might sometimes not work for that but I don't recall the details
XState VSCode's Typegen functionality does not currently work with TypeScript code when using Deno because Typegen does not insert the generated module's path using its extension. This is required when using Deno. From Modules | Manual | Deno:
I would like for VSCode to detect Deno usage and generate imports differently. e.g. By checking
.vscode/settings.json
and/or detecting that the Deno Language Server is being used for the current TypeScript file.Current
Desired
Diff