Typegen with Deno
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:
Deno by default standardizes the way modules are imported in both JavaScript and TypeScript using the ECMAScript 6
import/exportstandard.It adopts browser-like module resolution, meaning that file names must be specified in full. You may not omit the file extension…
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
/* demo.ts */
import { createMachine } from "npm:[email protected]";
createMachine({
tsTypes: {} as import("./demo.typegen").Typegen0,
});
Desired
/* demo.ts */
import { createMachine } from "npm:[email protected]";
createMachine({
tsTypes: {} as import("./demo.typegen.ts").Typegen0,
});
Diff
@@ -2,5 +2,5 @@
import { createMachine } from "npm:[email protected]";
createMachine({
- tsTypes: {} as import("./demo.typegen").Typegen0,
+ tsTypes: {} as import("./demo.typegen.ts").Typegen0,
});