-
Notifications
You must be signed in to change notification settings - Fork 21
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
Upgrade deps to 2.0 and Generate icons from @phosphor/core #33
Conversation
Remove svg files from repo
@jhhayashi can you check this ? |
Would love to see this merged!!!! |
In the meantime I published this npm package https://www.npmjs.com/package/@mrkpatchaa/phosphor-react-native with the latests updates. |
sick thanks dude you're a king |
@mrkpatchaa I might just be an idiot, does your package require other dependencies? I'm seeing this |
Oh let me check. The typescript types are not pushed to npm. |
@jacesimons14 can you check version 2.0.1? I fixed the types issue. I also updated this PR with the fixes. |
@mrkpatchaa npm says there hasn't been a new version for 4 days |
still 2.0.0 |
@jacesimons14 maybe cache? This is the latest version on npm. |
Ah I see it now, thank you, works great so far! |
Would love this. Have been running into issues where some icons are not available here but they are for the web package so this would be great |
Hey there! I'm not affiliated with this repo, but happy to help where I can. This PR is a little too large to review. Would it be possible to split it into a few smaller ones? |
@jhhayashi it's only "large" because of the deleted files that are not needed anymore. I am generating icons directly from phospor/core. You can filter them out in the view. |
This reverts commit 09aa89b.
@jhhayashi I just pushed a new commit to revert the deletions. |
I just created the companion PR for this. #35 |
@daxaxelrod You can use the npm package I published as a temporary solution... |
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.
lgtm, but i am not affiliated with the repo
|
||
const filePath = path.join( | ||
svgsDir, | ||
`${Case.capital(weight)}/${iconName}.svg` |
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.
`${Case.capital(weight)}/${iconName}.svg` | |
`${Case.pascal(weight)}/${iconName}.svg` |
might as well guarantee that there aren't spaces
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 have control over the folder structure. In cases there are spaces We'd need to change more logic I think. Not only this line.
componentName: componentNameMap[componentName] || componentName, | ||
}).then((tsCode) => { | ||
tsCode = tsCode | ||
.replace('SvgProps, ', '') | ||
.replace('function', "import { IconProps } from '../lib'\n\nfunction") | ||
.replace('const', "import { IconProps } from '../lib'\n\nconst") |
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.
maybe better to just insert the import at the beginning of the string instead of hardcoding the first non-import line prefix?
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.
Making the replace helps keep the import after React import.
generator/generate-svg.js
Outdated
const srcDir = path.join(__dirname, '../src'); | ||
|
||
svgr(svgCode, options, { | ||
transform(svgCode, options, { | ||
componentName: componentNameMap[componentName] || componentName, | ||
}).then((tsCode) => { | ||
tsCode = tsCode | ||
.replace('SvgProps, ', '') |
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.
this line can be removed (superseded by the .replace(/import type .*;\n/g, '')
line)
generator/generate-svg.js
Outdated
fs.rmSync(srcDir + '/' + folders[index], { | ||
recursive: true, | ||
force: true, | ||
}); |
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.
looks like https://github.com/jprichardson/node-fs-extra/blob/HEAD/docs/remove-sync.md can save you a few lines
@duongdev @Joeao @kingdavidmartins @bkdev98 are you guys able to check this and merge? |
I'm using your library meanwhile this PR is accepted. I've founded that you maybe forgot to import FileSearch icon... I'm using this icon but when I change to your library I can't see it. |
@DavidP-B I just checked and file-search is an alias for file-magnifying-glass -> https://github.com/phosphor-icons/core/blob/main/bin/index.js |
Thank you @mrkpatchaa @DavidP-B and @jacesimons14 for your contribution. I am not currently work with React Native but your efforts on this library is so incredible! |
Hi @duongdev and happy to finally hear from you 😄 |
Hey @mrkpatchaa! @duongdev got me set up on this repo (see #34), so I'll now be able to help out with the maintenance. I have an active project that depends on this library, so I'll make sure to keep things maintained |
Understood @jhhayashi . I also have an active project using it. |
Thanks for the patience; v2.0.0 has been released on npm |
I will then remove @mrkpatchaa/phosphor-react-native from npm. |
This will help in reducing number of files in this repo + upgrade to the most recent versions of icons.