feat(CC-icons): added support scripts#11794
feat(CC-icons): added support scripts#11794mattnolting wants to merge 5 commits intopatternfly:mainfrom
Conversation
3a3df97 to
3b8fe71
Compare
|
Preview: https://patternfly-react-pr-11794.surge.sh A11y report: https://patternfly-react-pr-11794-a11y.surge.sh |
| 'Font size - 2XL': 'font-size---2xl', | ||
| 'Font size - 3XL': 'font-size---3xl', | ||
| 'Font size - 4XL': 'font-size---4xl' | ||
| }) |
There was a problem hiding this comment.
Add the children prop as the actual icon displayed is passed as a child of the component.
| }) | |
| }), | |
| children: figma.children('*') |
There was a problem hiding this comment.
Talking about changing this from children to instance...
| // Read the existing icons data | ||
| let config; | ||
| try { | ||
| const configPath = path.resolve(process.cwd(), 'codeConnect/config.json'); |
There was a problem hiding this comment.
This file doesn't exist so the code always falls to the catch, should this file be part of this PR?
There was a problem hiding this comment.
No extra file needed - we'll open follow-up issue to review & potentially remove this unused code.
| const importStatement = `import React from "react"; | ||
| import { | ||
| ${componentNames.join(',\n ')} | ||
| } from "@patternfly/react-icons/dist/esm/icons"; |
There was a problem hiding this comment.
FYI running the script, this imports all icons from this one import path as seen below:
WindowsIcon,
WrenchIcon,
ZoneIcon
} from "@patternfly/react-icons/dist/esm/icons";
The existing icons.figma.tsx file in this PR has separate imports as so:
import WindowsIcon from './@patternfly/react-icons/dist/esm/icons/windows-icon';
import WrenchIcon from './@patternfly/react-icons/dist/esm/icons/wrench-icon';
import ZoneIcon from './@patternfly/react-icons/dist/esm/icons/zone-icon';
|
Mostly small changes that should be quick, but we should also make the FYI - for this PR the API call to fetch icons is erroring out, I can confirm this was working previously but for now we can use the hard-coded icons data that you've included and address this in a follow-up enhancement. |
| @@ -0,0 +1,31 @@ | |||
| import figma from '@figma/code-connect'; | |||
There was a problem hiding this comment.
Not this line but the file name - missed earlier that the file can be renamed from "IconWrapper" to just "Icon" to match the component name.
|
This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
closes: #11620
Installation instructions
Then copy the token and save somewhere safe.
This PR provides all necessary files to:
iconsData.jsonIn following PRs: