Skip to content

feat: Fix formatting issues, add image-size dependency and asset update script #3626

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

Conversation

devin-ai-integration[bot]
Copy link
Contributor

Description

This PR fixes formatting issues, adds image-size dependency to package.json, and adds an update-web-assets script for automatically generating web-specific index files with image dimensions.

Changelog

Assets - Fix formatting issues and add script for updating web assets

Additional Info

Related to PR #3618

Link to Devin run: https://app.devin.ai/sessions/3115fcb58d474cbeaadcaa51a8b24e15
Requested by: [email protected]

Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add "(aside)" to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@@ -0,0 +1,47 @@
export const icons = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is the separation for index.web file is because the web file contain dimensions?

package.json Outdated
@@ -14,6 +14,7 @@
"url": "https://github.com/wix/react-native-ui-lib"
},
"scripts": {
"update-web-assets": "node scripts/assets/extract-dimensions.ts",
Copy link
Collaborator

Choose a reason for hiding this comment

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

When do we need to run this script?

Copy link
Contributor Author

Yes, the separation for index.web files is specifically to include dimensions for web platform usage. When using the web platform, these files will be used instead of the regular index files, providing both the image URI and its dimensions in a single object.

Copy link
Contributor Author

The 'update-web-assets' script should be run whenever new assets are added to the internal assets directories. Specifically, you would run this script after adding new PNG files to the src/assets/internal/icons or src/assets/internal/images directories to automatically generate the web-specific index files with dimensions for those assets.

@ethanshar
Copy link
Collaborator

@adids1221
See my comments, let's fix it
I don't think we need to separate the index.web we can have dimensions for both

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants