Skip to content

Commit

Permalink
S-67419 Move Base to not be exported from icons package- README requi…
Browse files Browse the repository at this point in the history
…ring Base for API docs moved to icons package- We need to delete all *.js files in the icons/src directory before building new icons in order to remove old and/or deleted icons from being exported in index.js
  • Loading branch information
andrew-codes committed Feb 14, 2019
1 parent 9525764 commit 4f412ae
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -11,7 +11,7 @@ cypress/videos
**/dist
packages/components/src/index.js
packages/icons/src/*.*
!packages/icons/src/Base.js
!packages/icons/src/*.mdx

# Components must live within their own directory. There should not be any loose files in the source directory.
packages/components/src/*.*
5 changes: 3 additions & 2 deletions packages/icons/package.json
Expand Up @@ -19,9 +19,10 @@
"LICENSE.md"
],
"scripts": {
"pregenerate:main": "rm -f src/*.js",
"generate:main": "svgr -d src src/svg",
"postgenerate:main": "rm -f src/index.js && generate-main-icons",
"prebuild": "yarn generate:main",
"postgenerate:main": "generate-main-icons",
"prebuild": "yarn generate:main && rm -rf dist",
"build": "babel --root-mode upward src --out-dir ./dist"
},
"publishConfig": {
Expand Down
5 changes: 3 additions & 2 deletions docs/icons/README.mdx → packages/icons/src/README.mdx
Expand Up @@ -4,7 +4,8 @@ route: /icons
menu: Icons
---

import { BaseIcon, DeleteIcon } from '@versionone/icons';
import { DeleteIcon } from './';
import { Base } from './utils/Base';
import { Playground, PropsTable } from '@versionone/docz';

# Icons
Expand All @@ -25,4 +26,4 @@ Prior to adding in an icon, make sure the icon file is named without the word "i

## API

<PropsTable of={BaseIcon} />
<PropsTable of={Base} />
Expand Up @@ -24,4 +24,4 @@ Base.defaultProps = {
color: '#000',
size: 24,
};
export default Base;
export { Base };
2 changes: 1 addition & 1 deletion packages/icons/src/utils/withIconProps.js
@@ -1,5 +1,5 @@
import React from 'react';
import Base from '../Base';
import { Base } from './Base';

const withIconProps = Component => props => (
<Base {...props} icon={Component} />
Expand Down

0 comments on commit 4f412ae

Please sign in to comment.