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

Revert "Unify non-icon exports in svg/font indices" #696

Merged
Merged
Show file tree
Hide file tree
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
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
Loading