Skip to content

Commit

Permalink
Generate composed source map after creating bundles
Browse files Browse the repository at this point in the history
  • Loading branch information
fluiddot committed Feb 26, 2024
1 parent d0b3119 commit 6a50374
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
12 changes: 3 additions & 9 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,25 +143,19 @@ steps:
echo "--- :android: Build Android bundle"
npm run bundle:android
echo "--- :arrow_up: Upload Android bundle artifact"
echo "--- :arrow_up: Upload Android bundle and source map artifacts"
buildkite-agent artifact upload bundle/android/App.js
echo "--- :arrow_up: Upload Android source map"
node gutenberg/node_modules/react-native/scripts/compose-source-maps.js bundle/android/App.text.js.map bundle/android/App.js.map -o bundle/android/App.composed.js.map
buildkite-agent artifact upload bundle/android/App.composed.js.map
echo "--- :ios: Build iOS bundle"
npm run bundle:ios
echo "--- :arrow_up: Upload iOS bundle artifact"
echo "--- :arrow_up: Upload iOS bundle and source map artifacts"
buildkite-agent artifact upload bundle/ios/App.js
buildkite-agent artifact upload bundle/ios/App.composed.js.map
tar -czvf ios-assets.tar.gz -C ios-xcframework/Gutenberg/Resources assets/
buildkite-agent artifact upload ios-assets.tar.gz
echo "--- :arrow_up: Upload iOS source map"
node gutenberg/node_modules/react-native/scripts/compose-source-maps.js bundle/ios/App.text.js.map bundle/ios/App.js.map -o bundle/ios/App.composed.js.map
buildkite-agent artifact upload bundle/ios/App.composed.js.map
- label: "Build Android RN Aztec & Publish to S3"
depends_on:
- lint
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@
"bundle": "npm run clean && npm run bundle:js",
"prebundle:js": "npm run i18n:update",
"bundle:js": "npm run bundle:android && npm run bundle:ios",
"bundle:android": "npm run bundle:android:text && npm run bundle:android:bytecode",
"bundle:android": "npm run bundle:android:text && npm run bundle:android:bytecode && node gutenberg/node_modules/react-native/scripts/compose-source-maps.js bundle/android/App.text.js.map bundle/android/App.js.map -o bundle/android/App.composed.js.map",
"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",
"bundle:android:bytecode": "./gutenberg/node_modules/react-native/sdks/hermesc/`node -e \"const platform=require('os').platform();console.log(platform === 'darwin' ? 'osx-bin' : (platform === 'linux' ? 'linux64-bin' : (platform === 'win32' ? 'win64-bin' : 'unsupported-os')));\"`/hermesc -emit-binary -O -out bundle/android/App.js bundle/android/App.text.js -output-source-map",
"bundle:ios": "npm run bundle:ios:text && npm run bundle:ios:bytecode",
"bundle:ios": "npm run bundle:ios:text && npm run bundle:ios:bytecode && node gutenberg/node_modules/react-native/scripts/compose-source-maps.js bundle/ios/App.text.js.map bundle/ios/App.js.map -o bundle/ios/App.composed.js.map",
"bundle:ios:text": "mkdir -p bundle/ios && npm run rn-bundle -- --platform ios --dev false --entry-file ./index.js --assets-dest ./ios-xcframework/Gutenberg/Resources --bundle-output ./bundle/ios/App.text.js --sourcemap-output ./bundle/ios/App.text.js.map",
"bundle:ios:bytecode": "./gutenberg/node_modules/react-native/sdks/hermesc/`node -e \"const platform=require('os').platform();console.log(platform === 'darwin' ? 'osx-bin' : (platform === 'linux' ? 'linux64-bin' : (platform === 'win32' ? 'win64-bin' : 'unsupported-os')));\"`/hermesc -emit-binary -O -out bundle/ios/App.js bundle/ios/App.text.js -output-source-map",
"prewpandroid": "rm -Rf $TMPDIR/gbmobile-wpandroidfakernroot && mkdir $TMPDIR/gbmobile-wpandroidfakernroot && ln -s $(cd \"$(dirname \"../../../\")\"; pwd) $TMPDIR/gbmobile-wpandroidfakernroot/android",
Expand Down

0 comments on commit 6a50374

Please sign in to comment.