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(icons-react): fix exports in individual icon TypeScript declarations #15032

Merged

Conversation

lewandom
Copy link
Contributor

Fixes the problem raised in #14714 (comment): improper typescript type exports in individual icons TypeScript declaration file (.d.ts).

Changelog

Changed

  • changed variable export to default export in individual icons TypeScript declaration file (.d.ts) to match the actual JS code

Testing / Reviewing

Tested in TypeScript project by linking the patched Carbon version. Can import individual icon using default import.

@lewandom lewandom requested a review from a team as a code owner October 26, 2023 14:55
@lewandom
Copy link
Contributor Author

@metonym FYI.

@netlify
Copy link

netlify bot commented Oct 26, 2023

Deploy Preview for v11-carbon-react ready!

Name Link
🔨 Latest commit b9f3d13
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/654010e326ae9c0008d19c59
😎 Deploy Preview https://deploy-preview-15032--v11-carbon-react.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.

@netlify
Copy link

netlify bot commented Oct 26, 2023

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit b9f3d13
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/654010e3b0af120009b08341
😎 Deploy Preview https://deploy-preview-15032--carbon-elements.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.

m.name +
': CarbonIconType;\n';
`const ${m.name}: CarbonIconType;\n` +
`export default ${m.name}\n`;
Copy link
Collaborator

Choose a reason for hiding this comment

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

FYI, I see this locally when copying/pasting this change to my local environment:

Screenshot 2023-10-26 at 8 30 35 AM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@metonym thanks for spotting! I added the missing declare keyword and it seems to be better now. Please confirm if this also helps in your setup.

Copy link
Collaborator

Choose a reason for hiding this comment

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

LGTM

m.name +
': CarbonIconType;\n';
`const ${m.name}: CarbonIconType;\n` +
`export default ${m.name}\n`;
Copy link
Collaborator

Choose a reason for hiding this comment

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

LGTM

@github-actions github-actions bot added this pull request to the merge queue Nov 1, 2023
@tay1orjones tay1orjones removed this pull request from the merge queue due to a manual request Nov 1, 2023
github-merge-queue bot pushed a commit that referenced this pull request Nov 1, 2023
…ons (#15032)

* fix(icons-react): fix exports in individual icon TypeScript declarations

* fix(icon-build-helpers): add missing declare keyword in TS builder

---------

Co-authored-by: TJ Egan <[email protected]>
@tay1orjones tay1orjones merged commit 2319ad3 into carbon-design-system:main Nov 1, 2023
16 checks passed
tay1orjones pushed a commit to tay1orjones/carbon that referenced this pull request Nov 1, 2023
…ons (carbon-design-system#15032)

* fix(icons-react): fix exports in individual icon TypeScript declarations

* fix(icon-build-helpers): add missing declare keyword in TS builder

---------

Co-authored-by: TJ Egan <[email protected]>
@lewandom lewandom deleted the ts-icons-fix-individual-export branch November 1, 2023 18:19
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.

5 participants