Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate normal .d.ts extension #1316

Open
danielbayley opened this issue Jul 10, 2024 · 2 comments
Open

Generate normal .d.ts extension #1316

danielbayley opened this issue Jul 10, 2024 · 2 comments
Labels
bug Something isn't working plugin/integration Integrating Civet with other tools typescript TypeScript compatibility or extensions

Comments

@danielbayley
Copy link
Contributor

civet --emit-declaration always seems to produce e.g index.civet.d.ts files, but do we not ideally want to generate index.d.ts for release?

Otherwise, should it at least respect --js or --output to produce index.d.ts?

@edemaine
Copy link
Collaborator

The idea is to match the default extension for compiled output, index.civet.[jt]sx. I don't quite recall why that's the default but I think it's so that index.civet might resolve correctly with implicit extensions...

If you specify an alternative extension via say --output .ts then I would have expected the dts to be index.d.ts. If that's not the case, I think it's a bug.

Not sure how --js would matter; you can't have .d.js files can you?

@danielbayley
Copy link
Contributor Author

The idea is to match the default extension for compiled output, index.civet.[jt]sx.

Cool, but then surely it should also change along with any specified change from that default.

If you specify an alternative extension via say --output .ts then I would have expected the dts to be index.d.ts. If that's not the case, I think it's a bug.

Yeah, if I do civet --compile index.civet --emit-declaration --output .ts, it still produces index.civet.d.ts.

Not sure how --js would matter; you can't have .d.js files can you?

Ha no, I just meant in that case we are most likely compiling the final *.js files, and so would want the corresponding generated type definition files correctly named as *.d.ts, rather than ending up with e.g index.js and index.civet.d.ts, right?

@edemaine edemaine added bug Something isn't working typescript TypeScript compatibility or extensions plugin/integration Integrating Civet with other tools labels Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working plugin/integration Integrating Civet with other tools typescript TypeScript compatibility or extensions
Projects
None yet
Development

No branches or pull requests

2 participants