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 TypeScript dependencies #5933

Merged

Conversation

remcohaszing
Copy link
Contributor

📑 Summary

The Mermaid type definitions depend on @types/d3 and @types/dompurify. Without these dependencies, the Mermaid types cause a type error for users.

Resolves N/A

📏 Design Decisions

I moved the dependencies from devDependencies to dependencies and ran pnpm install.

📋 Tasks

Make sure you

  • 📖 have read the contribution guidelines
  • 💻 have added necessary unit/e2e tests.
  • 📓 have added documentation. Make sure MERMAID_RELEASE_VERSION is used for all new features.
  • 🦋 If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.

The Mermaid type definitions depend on `@types/d3` and
`@types/dompurify`. Without these dependencies, the Mermaid types cause
a type error for users.
Copy link

changeset-bot bot commented Oct 4, 2024

🦋 Changeset detected

Latest commit: 72d60d2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
mermaid Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

netlify bot commented Oct 4, 2024

Deploy Preview for mermaid-js ready!

Name Link
🔨 Latest commit 72d60d2
🔍 Latest deploy log https://app.netlify.com/sites/mermaid-js/deploys/67000773aa2901000890e25d
😎 Deploy Preview https://deploy-preview-5933--mermaid-js.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.

Copy link

pkg-pr-new bot commented Oct 4, 2024

Open in Stackblitz

pnpm add https://pkg.pr.new/mermaid-js/mermaid@5933
pnpm add https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/mermaid-zenuml@5933
pnpm add https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/layout-elk@5933
pnpm add https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/parser@5933

commit: 72d60d2

Copy link

codecov bot commented Oct 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 4.67%. Comparing base (ddf18dd) to head (72d60d2).
Report is 11 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           develop   #5933      +/-   ##
==========================================
- Coverage     4.67%   4.67%   -0.01%     
==========================================
  Files          372     373       +1     
  Lines        51669   51680      +11     
  Branches       611     586      -25     
==========================================
  Hits          2414    2414              
- Misses       49255   49266      +11     
Flag Coverage Δ
unit 4.67% <ø> (-0.01%) ⬇️

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

see 1 file with indirect coverage changes

Copy link

argos-ci bot commented Oct 4, 2024

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - Oct 4, 2024, 3:42 PM

@sidharthv96
Copy link
Member

Is there a better way for us to handle this? Adding @types to dependencies seems counterintuitive. Perhaps bundling the required types, or something else?

@remcohaszing
Copy link
Contributor Author

Why is it counterintuitive to you? A lot of packages have dependencies purely for their types. Especially a dependency on @types/x is common if you depend on x.

@sidharthv96
Copy link
Member

sidharthv96 commented Oct 8, 2024

My mental model was dependencies only need runtime libraries. But that's not true for libraries. Thank you!

microsoft/types-publisher#81 (comment)

@sidharthv96 sidharthv96 merged commit b83b778 into mermaid-js:develop Oct 8, 2024
21 checks passed
@remcohaszing remcohaszing deleted the fix-types-dependencies branch October 8, 2024 07:50
@github-actions github-actions bot mentioned this pull request Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants