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: include aliases in icon type definitions and hash calculation #250

Merged

Conversation

harukats
Copy link
Contributor

Currently, the generated icon type definitions (.astro/icon.d.ts) do not include aliases from IconifyJSON.

In my case, I am using Material Design Icons as <Icon name="mdi:external-link" /> and adding /// <reference path="../.astro/icon.d.ts" /> to src/env.d.ts. However, astro check fails due to a type error. This is because "mdi:external-link" is an alias of "mdi:open-in-new" and the alias is not recognized in the type definitions.

This fix updates the icon type generation process to include aliases from IconifyJSON, allowing type checking to recognize both original names and their aliases. Additionally, the hash calculation has been adjusted to account for these aliases.

Copy link

changeset-bot bot commented Nov 11, 2024

🦋 Changeset detected

Latest commit: 0b298a1

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

This PR includes changesets to release 1 package
Name Type
astro-icon 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

vercel bot commented Nov 11, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
api-astroicon ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 23, 2024 3:30am
astroicon ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 23, 2024 3:30am

Copy link
Owner

@natemoo-re natemoo-re left a comment

Choose a reason for hiding this comment

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

Thank you for the fix!

.changeset/chilled-fans-beg.md Outdated Show resolved Hide resolved
@natemoo-re natemoo-re merged commit 41218fa into natemoo-re:main Nov 23, 2024
5 checks passed
This was referenced Nov 23, 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