Skip to content

Commit

Permalink
Revert "Unify non-icon exports in svg/font indices (#693)" (#696)
Browse files Browse the repository at this point in the history
This reverts commit f1e39c3.
  • Loading branch information
layershifter authored Feb 22, 2024
1 parent a17e130 commit 4e0eab7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
12 changes: 0 additions & 12 deletions packages/react-icons/addRexportsToIndex.js

This file was deleted.

11 changes: 9 additions & 2 deletions packages/react-icons/convert-font.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ const mkdirp = require('mkdirp');
const { promisify } = require('util');
const { option } = require("yargs");
const glob = promisify(require('glob'));
const addRexportsToIndex = require('./addRexportsToIndex');

// @ts-ignore
const SRC_PATH = argv.source;
Expand Down Expand Up @@ -70,7 +69,15 @@ async function processFiles(src, dest) {

const indexPath = path.join(dest, 'index.tsx')
// Finally add the interface definition and then write out the index.
addRexportsToIndex(indexContents, '..');
indexContents.push('export { FluentIconsProps } from \'../utils/FluentIconsProps.types\'');
indexContents.push('export { default as wrapIcon } from \'../utils/wrapIcon\'');
indexContents.push('export { default as bundleIcon } from \'../utils/bundleIcon\'');
indexContents.push('export { createFluentFontIcon } from \'../utils/fonts/createFluentFontIcon\'');
indexContents.push('export type { FluentIcon } from \'../utils/createFluentIcon\'');
indexContents.push('export * from \'../utils/useIconState\'');
indexContents.push('export * from \'../utils/constants\'');
indexContents.push('export { IconDirectionContextProvider, useIconContext } from \'../contexts/index\'');
indexContents.push('export type { IconDirectionContextValue } from \'../contexts/index\'');


await fs.writeFile(indexPath, indexContents.join('\n'));
Expand Down
12 changes: 10 additions & 2 deletions packages/react-icons/convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const fs = require("fs");
const path = require("path");
const argv = require("yargs").boolean("selector").default("selector", false).argv;
const _ = require("lodash");
const addRexportsToIndex = require('./addRexportsToIndex');

const SRC_PATH = argv.source;
const DEST_PATH = argv.dest;
Expand Down Expand Up @@ -69,11 +68,20 @@ function processFiles(src, dest) {

const indexPath = path.join(dest, 'index.tsx')
// Finally add the interface definition and then write out the index.
addRexportsToIndex(indexContents);
indexContents.push('export { FluentIconsProps } from \'./utils/FluentIconsProps.types\'');
indexContents.push('export { default as wrapIcon } from \'./utils/wrapIcon\'');
indexContents.push('export { default as bundleIcon } from \'./utils/bundleIcon\'');
indexContents.push('export { createFluentIcon } from \'./utils/createFluentIcon\'');
indexContents.push('export type { FluentIcon } from \'./utils/createFluentIcon\'');
indexContents.push('export * from \'./utils/useIconState\'');
indexContents.push('export * from \'./utils/constants\'');
indexContents.push('export { IconDirectionContextProvider, useIconContext } from \'./contexts/index\'');
indexContents.push('export type { IconDirectionContextValue } from \'./contexts/index\'');

fs.writeFileSync(indexPath, indexContents.join('\n'), (err) => {
if (err) throw err;
});

}

/**
Expand Down

0 comments on commit 4e0eab7

Please sign in to comment.