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

chore(vue): add vue typescript support #726

Merged
merged 2 commits into from
Oct 3, 2023
Merged

Conversation

AykutSarac
Copy link
Member

@AykutSarac AykutSarac commented Oct 2, 2023

This PR brings official TypeScript declerations support for projects with Vue 2.7 and above.
Added docs to storybook.

Output:

import type * as Baklava from '@trendyol/baklava/dist/baklava'

declare module 'vue' {
  export interface GlobalComponents {
    BlAlert: import("vue").Component<Baklava.BlAlert>
    BlBadge: import("vue").Component<Baklava.BlBadge>
    BlButton: import("vue").Component<Baklava.BlButton>
    BlCheckboxGroup: import("vue").Component<Baklava.BlCheckboxGroup>
    BlDialog: import("vue").Component<Baklava.BlDialog>
    BlDrawer: import("vue").Component<Baklava.BlDrawer>
    BlDropdown: import("vue").Component<Baklava.BlDropdown>
    BlIcon: import("vue").Component<Baklava.BlIcon>
    BlInput: import("vue").Component<Baklava.BlInput>
    BlPagination: import("vue").Component<Baklava.BlPagination>
    BlPopover: import("vue").Component<Baklava.BlPopover>
    BlProgressIndicator: import("vue").Component<Baklava.BlProgressIndicator>
    BlRadioGroup: import("vue").Component<Baklava.BlRadioGroup>
    BlSelect: import("vue").Component<Baklava.BlSelect>
    BlSwitch: import("vue").Component<Baklava.BlSwitch>
    BlTabGroup: import("vue").Component<Baklava.BlTabGroup>
    BlTextarea: import("vue").Component<Baklava.BlTextarea>
    BlTooltip: import("vue").Component<Baklava.BlTooltip>
  }
}

Copy link
Contributor

@muratcorlu muratcorlu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds cool! Could you manage to test this?

@AykutSarac
Copy link
Member Author

Sounds cool! Could you manage to test this?

I've tested it and works fine. If you mean writing tests, a snapshot test would be good to have along with React in a separate PR.

@AykutSarac
Copy link
Member Author

It was reading the src/components directory earlier and causing missing types. Now it imports all components fyi.

@AykutSarac AykutSarac merged commit f4170f2 into next Oct 3, 2023
4 checks passed
@AykutSarac AykutSarac deleted the chore/vue-typescript branch October 3, 2023 07:31
@github-actions
Copy link

github-actions bot commented Oct 3, 2023

🎉 This PR is included in version 2.3.0-beta.10 🎉

The release is available on:

Your semantic-release bot 📦🚀

@AykutSarac AykutSarac mentioned this pull request Oct 12, 2023
@github-actions
Copy link

🎉 This PR is included in version 2.3.0 🎉

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants