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

Upgrade deps to 2.0 and Generate icons from @phosphor/core #33

Merged
merged 15 commits into from
Oct 5, 2023

Conversation

mrkpatchaa
Copy link
Contributor

@mrkpatchaa mrkpatchaa commented Jul 31, 2023

This will help in reducing number of files in this repo + upgrade to the most recent versions of icons.

@mrkpatchaa
Copy link
Contributor Author

@jhhayashi can you check this ?

This was referenced Aug 1, 2023
@jacesimons14
Copy link

Would love to see this merged!!!!

@mrkpatchaa
Copy link
Contributor Author

In the meantime I published this npm package https://www.npmjs.com/package/@mrkpatchaa/phosphor-react-native with the latests updates.
I'll take id down once this PR is merged.

@jacesimons14
Copy link

sick thanks dude you're a king

@jacesimons14
Copy link

@mrkpatchaa I might just be an idiot, does your package require other dependencies? I'm seeing this
image

@mrkpatchaa
Copy link
Contributor Author

Oh let me check. The typescript types are not pushed to npm.

@mrkpatchaa
Copy link
Contributor Author

@jacesimons14 can you check version 2.0.1? I fixed the types issue.
Old version (this package)
Screenshot 2023-08-10 at 12 20 52

Current version (my package)
Screenshot 2023-08-10 at 12 20 58

I also updated this PR with the fixes.

@jacesimons14
Copy link

@mrkpatchaa npm says there hasn't been a new version for 4 days

@jacesimons14
Copy link

still 2.0.0

@mrkpatchaa
Copy link
Contributor Author

@jacesimons14 maybe cache? This is the latest version on npm.
You can install the package again or run npm update to get the last version.

Screenshot 2023-08-11 at 10 03 49

@jacesimons14
Copy link

Ah I see it now, thank you, works great so far!

@daxaxelrod
Copy link

daxaxelrod commented Aug 22, 2023

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

@jhhayashi
Copy link
Collaborator

@jhhayashi can you check this ?

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?

@mrkpatchaa
Copy link
Contributor Author

@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.
If you wish I can put them back and make the cleanup afterwards.

@mrkpatchaa
Copy link
Contributor Author

@jhhayashi I just pushed a new commit to revert the deletions.
I will create another one for the deletion.

@mrkpatchaa
Copy link
Contributor Author

I just created the companion PR for this. #35

@mrkpatchaa
Copy link
Contributor Author

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

@daxaxelrod You can use the npm package I published as a temporary solution...
#33 (comment)

Copy link
Collaborator

@jhhayashi jhhayashi left a 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`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`${Case.capital(weight)}/${iconName}.svg`
`${Case.pascal(weight)}/${iconName}.svg`

might as well guarantee that there aren't spaces

Copy link
Contributor Author

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")
Copy link
Collaborator

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?

Copy link
Contributor Author

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.

const srcDir = path.join(__dirname, '../src');

svgr(svgCode, options, {
transform(svgCode, options, {
componentName: componentNameMap[componentName] || componentName,
}).then((tsCode) => {
tsCode = tsCode
.replace('SvgProps, ', '')
Copy link
Collaborator

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)

Comment on lines 236 to 239
fs.rmSync(srcDir + '/' + folders[index], {
recursive: true,
force: true,
});
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mrkpatchaa
Copy link
Contributor Author

@duongdev @Joeao @kingdavidmartins @bkdev98 are you guys able to check this and merge?
I created another npm package as a temporary solution but might be interesting to update this repo.

@DavidP-B
Copy link

DavidP-B commented Oct 4, 2023

In the meantime I published this npm package https://www.npmjs.com/package/@mrkpatchaa/phosphor-react-native with the latests updates. I'll take id down once this PR is merged.

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.

@mrkpatchaa
Copy link
Contributor Author

@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
Maybe it would be interresting to add this as well in this PR. I'll try to find some time to do it this week.
Anyway, seems like the repo is not maintained anymore. I couldn't get anyone to merge this 😕

@duongdev
Copy link
Owner

duongdev commented Oct 5, 2023

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!

@duongdev duongdev merged commit cefe427 into duongdev:main Oct 5, 2023
1 check passed
@mrkpatchaa
Copy link
Contributor Author

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 😄
What are the plans to continue maintaining the project? I can help if you want.
In the meantime, with the new approach, it will require less work to maintain.
Think also about the option of moving it to @Phospor community?

@jhhayashi
Copy link
Collaborator

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

@mrkpatchaa
Copy link
Contributor Author

Understood @jhhayashi . I also have an active project using it.
Feel free to let me know if you need help on something.
Good luck mate.

@jhhayashi
Copy link
Collaborator

Thanks for the patience; v2.0.0 has been released on npm

@mrkpatchaa
Copy link
Contributor Author

I will then remove @mrkpatchaa/phosphor-react-native from npm.
Thanks.

@mrkpatchaa mrkpatchaa mentioned this pull request Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update to last release v2.0.0 Add a classname to an icon
6 participants