-
Notifications
You must be signed in to change notification settings - Fork 14
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
feat(PPDSC-1958): stop exporting emotion icons #281
Conversation
You can preview these changes on: |
export { | ||
/* istanbul ignore next */ | ||
Svg, | ||
/* istanbul ignore next */ | ||
toNewsKitIcon, | ||
/* istanbul ignore next */ | ||
customToNewsKitIcon, | ||
/* istanbul ignore next */ | ||
IndeterminateProgressIndicator, | ||
} from './icons'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any ideas on how to fix this Istanbul coverage?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might need to update http://localhost:8081/theme/foundation/iconography/#library as well
lib/codemod/README.md
Outdated
``` | ||
|
||
```sh | ||
npx @newskit/codemod emotion-icons <path> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we give some hints about the path?
const transform = require('../../emotion-icons'); | ||
const {readFile} = require('../utils'); | ||
|
||
function read(fileName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it worth moving this to utils?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its worth, but not possible, moving it to another file __dirname
will return different value
lib/codemod/README.md
Outdated
|
||
```diff | ||
- import { IconFilledAccountTree } from 'newskit'; | ||
+ import {AccountTree as AccountTreeFilled} from '@emotion-icons/material/AccountTree'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Icon has the convention of Icon {Set} {Name}
. To make it consistent, shall we follow {set} {name}
for renaming, so it will be FilledAccountTree
?
<Code> | ||
{` | ||
import {toNewsKitIcon} from 'newskit'; | ||
import {AccountTree} from '@emotion-icons/material/AccountTree'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's AccountTreeFilled
in the other example. If we were to follow the convention, it should be FilledAccountTree
site/pages/components/icons.mdx
Outdated
IconFilledYoutube, | ||
IconFilledFigma, | ||
} from 'newskit'; | ||
import {IconFilledFacebook} from '../../components/icons/icon-filled-facebook.tsx'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we importing those?
```diff | ||
- import { IconFilledAccountTree } from 'newskit'; | ||
+ import {AccountTree as FilledAccountTree} from '@emotion-icons/material/AccountTree'; | ||
+ const IconFilledAccountTree = toNewsKitIcon(FilledAccountTree); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also need an import for toNewsKitIcon
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
lib/codemod/README.md
Outdated
@@ -26,3 +26,25 @@ Link this package in your global `node_modules` by running: | |||
cd lib/codemod | |||
yarn link |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need a yarn
step here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
lib/codemod/README.md
Outdated
@@ -26,3 +26,25 @@ Link this package in your global `node_modules` by running: | |||
cd lib/codemod | |||
yarn link | |||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add the run command for a local codemod: newskit-codemod [codemod] [paths]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
* feat(PPDSC-1958): update emotion icons * feat(PPDSC-1958): update docs * feat(PPDSC-1958): do not export icons * feat(PPDSC-1958): update tests * feat(PPDSC-1958): add codemode for emotion-icons * feat(PPDSC-1958): add icons * feat(PPDSC-1958): fix tests * feat(PPDSC-1958): update snapshots * feat(PPDSC-1958): fix unit tests * feat(PPDSC-1958): linting * feat(PPDSC-1958): updatae codemod readme * feat(PPDSC-1958): update docs * feat(PPDSC-1958): fix stories * feat(PPDSC-1958): fix typo * feat(PPDSC-1958): clean * feat(PPDSC-1958): adjust codemod * feat(PPDSC-1958): fix icons names * feat(PPDSC-1958): cleanup * feat(PPDSC-1958): jest test * feat(PPDSC-1958): debug jest * feat(PPDSC-1958): reverse changes * feat(PPDSC-1958): update docs * feat(PPDSC-1958): update codemod readme * feat(PPDSC-1958): update readme
PPDSC-1958
What
I have done:
I have tested manually:
Before:
After:
Who should review this PR:
How to test: