Skip to content

Commit b5ba706

Browse files
authored
Fix/icons types (#6215)
* fix(react-icons): add dist/esm/icons/index.d.ts * fix(react-tokens): add dist/esm/index.d.ts * maths
1 parent dda6cb6 commit b5ba706

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/react-icons/scripts/writeIcons.js

+1
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ function writeIcons(icons) {
9292
.sort()
9393
.join('\n');
9494
outputFileSync(join(outDir, 'esm', 'icons/index.js'), esmIndexString);
95+
outputFileSync(join(outDir, 'esm', 'icons/index.d.ts'), esmIndexString);
9596
outputFileSync(join(outDir, 'js', 'icons/index.d.ts'), esmIndexString);
9697
outputFileSync(
9798
join(outDir, 'js', 'icons/index.js'),

packages/react-tokens/scripts/writeTokens.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ const componentIndex = [];
4040
const outputIndex = (index, indexFile) => {
4141
const esmIndexString = index.map(file => `export { ${file} } from './${file}';`).join('\n');
4242
outputFileSync(join(outDir, 'esm', indexFile), esmIndexString);
43-
outputFileSync(join(outDir, 'js', indexFile.replace('.js', '.d.ts')), esmIndexString);
4443
outputFileSync(
4544
join(outDir, 'js', indexFile),
4645
`
@@ -52,6 +51,8 @@ exports.__esModule = true;
5251
${index.map(file => `__export(require('./${file}'));`).join('\n')}
5352
`.trim()
5453
);
54+
outputFileSync(join(outDir, 'esm', indexFile.replace('.js', '.d.ts')), esmIndexString);
55+
outputFileSync(join(outDir, 'js', indexFile.replace('.js', '.d.ts')), esmIndexString);
5556
};
5657

5758
/**
@@ -92,7 +93,7 @@ function writeTokens(tokens) {
9293
outputIndex(componentIndex, 'componentIndex.js');
9394

9495
// eslint-disable-next-line no-console
95-
console.log('Wrote', Object.keys(allIndex).length * 3 + 3, 'token files');
96+
console.log('Wrote', Object.keys(allIndex).length * 4 + 4, 'token files');
9697
}
9798

9899
writeTokens(generateTokens());

0 commit comments

Comments
 (0)