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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ async function writeModuleTypes(modules, outDir) {
templates.banner +
'\n' +
"import type { CarbonIconType } from './CarbonIcon';\n" +
'export const ' +
m.name +
': CarbonIconType;\n';
`declare 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

const filename = path.resolve(outDir, m.filepath.replace(/\.js$/, '.d.ts'));
await fs.writeFile(filename, content);
}
Expand Down
Loading