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

Add prebundle to bundle command to force update the i18n localization files #3423

Merged
merged 2 commits into from Apr 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion .circleci/config.yml
Expand Up @@ -304,7 +304,9 @@ jobs:
- npm-install
- run:
name: Build JavaScript Bundle
command: npm run bundle:android
command: |
npm run core prebundle
Copy link
Contributor Author

@fluiddot fluiddot Apr 27, 2021

Choose a reason for hiding this comment

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

We also have to update the localization files when publishing the bundle for Android.

npm run bundle:android
# The job can take a long time, so let's bump the no_output_timeout
# to more than the default 10m
no_output_timeout: 20m
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -61,7 +61,7 @@
"prern-bundle": "patch-package --patch-dir gutenberg/packages/react-native-editor/metro-patch",
"rn-bundle": "react-native bundle",
"postrn-bundle": "patch-package --reverse --patch-dir gutenberg/packages/react-native-editor/metro-patch",
"bundle": "npm run clean; npm run bundle:js && npm run genstrings",
"bundle": "npm run clean; npm run core prebundle && npm run bundle:js && npm run genstrings",
Copy link
Member

Choose a reason for hiding this comment

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

Good catch! I suppose the pre scripts we have in place (e.g. prebundle) were not correctly running because we many of our bundle scripts have suffixes (e.g. :js, :android) which causes the pre script to not execute.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, besides the prebundle command is defined in packages/react-native-editor and we usually run the bundle command on the root (GB-mobile).

"bundle:js": "npm run bundle:android && npm run bundle:ios",
"bundle:android": "npm run bundle:android:text && npm run bundle:android:bytecode",
"bundle:android:text": "mkdir -p bundle/android && npm run rn-bundle -- --platform android --dev false --entry-file ./index.js --assets-dest ./bundle/android --bundle-output ./bundle/android/App.text.js --sourcemap-output ./bundle/android/App.text.js.map",
Expand Down