hey-api / openapi-ts

✨ Turn your OpenAPI specification into a beautiful TypeScript client

Home Page:https://heyapi.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

can't generate a node16 moduleResolution compatible package

omridevk opened this issue · comments

commented

Description

When using "moduleResolution": "node16" or "nodenext" in tsconfig, you need to import files with extensions, like import {Api} from 'test.js'
I think there's a need for config to allow the generator to generate the right imports.
Maybe I missed a config

OpenAPI specification (optional)

No response

Configuration

npx @hey-api/openapi-ts -i api.yaml -o src/client

System information (optional)

No response

commented

see a similar issue filed in panda-css package:
chakra-ui/panda#1236 (comment)

Nope, you didn't miss a config. The only thing you missed is checking for duplicate issues #478

commented

sorry, missed it :)

commented

do you want me to take a crack at it? it should be a trivial change

If you'd like, I'd appreciate it! Just needs some tests too

How do you plan to add this? Supply an optional tsconfig? Try to read it automatically?

commented

not sure actually, I am trying to figure out if there's a way to use ts.factory smartly that it would know, but I am trying to run the repo locally but having some issues.

commented

will probably start here: