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

fix(build): add volar types export #844

Merged
merged 3 commits into from
Mar 9, 2024

Conversation

mlmoravek
Copy link
Member

Fixes #839

Proposed Changes

  • add type to package.json export
  • update docs

@mlmoravek mlmoravek added the bug Something isn't working label Mar 7, 2024
Copy link

netlify bot commented Mar 7, 2024

Deploy Preview for oruga-documentation-preview ready!

Name Link
🔨 Latest commit 78d8fe2
🔍 Latest deploy log https://app.netlify.com/sites/oruga-documentation-preview/deploys/65e99be7ff2b570008eeb890
😎 Deploy Preview https://deploy-preview-844--oruga-documentation-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@mlmoravek
Copy link
Member Author

@messenjer could you give me assign if this is the right implementation?

Copy link

codecov bot commented Mar 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 0.20%. Comparing base (484cfe8) to head (78d8fe2).
Report is 12 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #844       +/-   ##
===========================================
- Coverage    56.71%   0.20%   -56.51%     
===========================================
  Files           30     108       +78     
  Lines         1511    5291     +3780     
  Branches       544    1921     +1377     
===========================================
- Hits           857      11      -846     
- Misses         654    4165     +3511     
- Partials         0    1115     +1115     
Flag Coverage Δ
oruga-next 0.20% <ø> (-56.51%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@messenjer
Copy link
Contributor

Hello,

It's not working with

"types": ["@oruga-ui/oruga-next"]

You need to change it to:

"types": ["@oruga-ui/oruga-next/types"]

If I do it, and I use it with vue-tsc, and I expressly add an error variant boolean, it's working.

> vue-tsc --build --force

src/App.vue:8:52 - error TS2322: Type 'boolean' is not assignable to type 'string'.

8     <o-button label="Launch loading" size="medium" :variant="true" />
                                                     ~~~~~~~~

  node_modules/@oruga-ui/oruga-next/dist/types/components/button/Button.vue.d.ts:352:5
    352     variant: string;
            ~~~~~~~
    The expected type comes from property 'variant' which is declared here on type 'Partial<{ label: string; size: string; override: boolean; iconPack: string; variant: string; rootClass: ComponentClass; labelClass: ComponentClass; expanded: boolean; ... 22 more ...; variantClass: ComponentClass; }> & Omit<...> & Record<...>'

Found 1 error.

For me the best solution should be, in tsconfig

"types": ["@oruga-ui/oruga-next/volar"]

And in package.json

    "./*": "./*",
    "./volar": {
      "types": "./volar.d.ts"
    }

Copy link
Contributor

@messenjer messenjer left a comment

Choose a reason for hiding this comment

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

Here is my suggestion

packages/docs/documentation/index.md Outdated Show resolved Hide resolved
packages/oruga/package.json Outdated Show resolved Hide resolved
Co-authored-by: Mathieu Laurent <mathieu.laurent@gmail.com>
@mlmoravek mlmoravek merged commit 4b31d5e into oruga-ui:develop Mar 9, 2024
8 of 9 checks passed
@mlmoravek mlmoravek deleted the fix/type-definition branch March 9, 2024 13:51
mlmoravek added a commit to mlmoravek/oruga that referenced this pull request Mar 9, 2024
Co-authored-by: Mathieu Laurent <mathieu.laurent@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error TS2688: Cannot find type definition file for '@oruga-ui/oruga-next/volar'.
2 participants