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

feat(typescript): ability to use custom typescript program #502

Closed
dmcgoughpax8 opened this issue Jan 11, 2023 · 2 comments · Fixed by #542
Closed

feat(typescript): ability to use custom typescript program #502

dmcgoughpax8 opened this issue Jan 11, 2023 · 2 comments · Fixed by #542
Labels
area: Typescript Plugin ✨ enhancement New feature or request good first issue Good for newcomers released on @canary Typescript Typescript package identifier

Comments

@dmcgoughpax8
Copy link
Contributor

Description

As a Vue dev, I would like to be able to generate declarations for exposed .vue files.

Possible Solution

Add customProgram option to config that accepts a function that returns a ts program instance.

new FederatedTypesPlugin({
  ...
  customProgram: (files, options, host) => vueTSC.createProgram({ ... });
  ...
})

In compiler.generateDeclarationFiles

...
const createProgram = this.options.customProgram || typescript.createProgram;

const program = createProgram([...filesToCompile], this.compilerOptions, host)
...
@pavandv
Copy link
Contributor

pavandv commented Jan 12, 2023

By having a customProgram option, every dev has to manually implement the vueTSC which would be an un-necessary additional step to use the plugin for vue.

I would much rather like to have this feature in-built either by an option (say generateVueFiles) or automatically detect the vue env and generate the files.

@pavandv pavandv added ✨ enhancement New feature or request good first issue Good for newcomers Typescript Typescript package identifier area: Typescript Plugin labels Jan 12, 2023
pavandv added a commit that referenced this issue Jan 29, 2023
pavandv added a commit that referenced this issue Jan 29, 2023
* feat(typescript): support vue typescript compiler
* chore: move vue-tsc to peer deps
* refactor: compiler option doesn't need a explicit setting
* docs: update ReadMe

closes #502
Copy link
Contributor

🎉 This issue has been resolved in version 1.0.0-canary.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Typescript Plugin ✨ enhancement New feature or request good first issue Good for newcomers released on @canary Typescript Typescript package identifier
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants