Skip to content

Commit fc33b4d

Browse files
Add CodePush Standalone commands (#12349)
1 parent b786fb9 commit fc33b4d

File tree

1 file changed

+28
-3
lines changed
  • docs/platforms/react-native/sourcemaps/uploading

1 file changed

+28
-3
lines changed

docs/platforms/react-native/sourcemaps/uploading/codepush.mdx

+28-3
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,41 @@ export default codePush(Sentry.wrap(App));
2525

2626
To ensure Sentry can symbolicate events from your CodePush releases, you need to generate and upload the necessary assets. When creating a CodePush release, include the `--sourcemap-output-dir` flag to generate source maps. This allows you to upload these files to Sentry in the next step.
2727

28-
```bash {tabTitle:JSC}
28+
```bash {tabTitle:JSC (Standalone)}
29+
code-push-standalone release-react \
30+
"${APP_NAME}" \
31+
"${PLATFORM}" \
32+
--deploymentName "${DEPLOYMENT_NAME}" \
33+
--outputDir ./build \
34+
--sourcemapOutput ./build
35+
```
36+
37+
```bash {tabTitle:Hermes (Standalone)}
38+
rm -rf ./build
39+
CODEPUSH_COMMAND="code-push-standalone release-react \
40+
\"${APP_NAME}\" \
41+
\"${PLATFORM}\" \
42+
--deploymentName \"${DEPLOYMENT_NAME}\" \
43+
--useHermes \
44+
--outputDir ./build \
45+
--sourcemapOutput ./build"
46+
47+
DEBUG_ID=$(eval "$CODEPUSH_COMMAND" | tee /dev/tty | grep -o 'Bundle Debug ID: [0-9a-f-]*' | sed 's/Bundle Debug ID: //')
48+
49+
MAP_FILE=$(find ./build -name "*.map" -type f)
50+
jq -c ". + {\"debug_id\": \"${DEBUG_ID}\"}" "${MAP_FILE}" > "${MAP_FILE}.tmp"
51+
mv "${MAP_FILE}.tmp" "${MAP_FILE}"
52+
```
53+
54+
```bash {tabTitle:JSC (AppCenter)}
2955
appcenter codepush release-react \
3056
--app "${APP_NAME}" \
3157
--deployment-name "${DEPLOYMENT_NAME}" \
3258
--output-dir ./build \
3359
--sourcemap-output-dir ./build
3460
```
3561

36-
```bash {tabTitle:Hermes}
62+
```bash {tabTitle:Hermes (AppCenter)}
3763
rm -rf ./build
3864
CODEPUSH_COMMAND="appcenter codepush release-react \
3965
--app \"${APP_NAME}\" \
@@ -44,7 +70,6 @@ CODEPUSH_COMMAND="appcenter codepush release-react \
4470

4571
DEBUG_ID=$(eval "$CODEPUSH_COMMAND" | tee /dev/tty | grep -o 'Bundle Debug ID: [0-9a-f-]*' | sed 's/Bundle Debug ID: //')
4672

47-
# Find the .map file and add the debug_id to it
4873
MAP_FILE=$(find ./build -name "*.map" -type f)
4974
jq -c ". + {\"debug_id\": \"${DEBUG_ID}\"}" "${MAP_FILE}" > "${MAP_FILE}.tmp"
5075
mv "${MAP_FILE}.tmp" "${MAP_FILE}"

0 commit comments

Comments
 (0)