Skip to content

Commit 3ff6cea

Browse files
authored
RN: Update Codepush instructions to use a separate dir for sourcemaps (#15141)
<!-- Use this checklist to make sure your PR is ready for merge. You may delete any sections you don't need. --> ## DESCRIBE YOUR PR *Tell us what you're changing and why. If your PR **resolves an issue**, please link it so it closes automatically.* Fixes getsentry/sentry-react-native#5148 Updates Codepush instructions to use a separate dir for sourcemaps to avoid including them in releases ## IS YOUR CHANGE URGENT? Help us prioritize incoming PRs by letting us know when the change needs to go live. - [ ] Urgent deadline (GA date, etc.): <!-- ENTER DATE HERE --> - [ ] Other deadline: <!-- ENTER DATE HERE --> - [x] None: Not urgent, can wait up to 1 week+ ## SLA - Teamwork makes the dream work, so please add a reviewer to your PRs. - Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it. Thanks in advance for your help! ## PRE-MERGE CHECKLIST *Make sure you've checked the following before merging your changes:* - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) ## LEGAL BOILERPLATE <!-- Sentry employees and contractors can delete or ignore this section. --> Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms. ## EXTRA RESOURCES - [Sentry Docs contributor guide](https://docs.sentry.io/contributing/)
1 parent 1eacd44 commit 3ff6cea

File tree

1 file changed

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

1 file changed

+10
-10
lines changed

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,30 +23,30 @@ export default codePush(Sentry.wrap(App));
2323

2424
## Create CodePush Release
2525

26-
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.
26+
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 in a separate directory. This allows you to upload these files to Sentry in the next step.
2727

2828
```bash {tabTitle:JSC (Standalone)}
2929
code-push-standalone release-react \
3030
"${APP_NAME}" \
3131
"${PLATFORM}" \
3232
--deploymentName "${DEPLOYMENT_NAME}" \
3333
--outputDir ./build \
34-
--sourcemapOutput ./build
34+
--sourcemapOutput ./sourcemaps
3535
```
3636

3737
```bash {tabTitle:Hermes (Standalone)}
38-
rm -rf ./build
38+
rm -rf ./build ./sourcemaps
3939
CODEPUSH_COMMAND="code-push-standalone release-react \
4040
\"${APP_NAME}\" \
4141
\"${PLATFORM}\" \
4242
--deploymentName \"${DEPLOYMENT_NAME}\" \
4343
--useHermes \
4444
--outputDir ./build \
45-
--sourcemapOutput ./build"
45+
--sourcemapOutput ./sourcemaps"
4646

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

49-
MAP_FILE=$(find ./build -name "*.map" -type f)
49+
MAP_FILE=$(find ./sourcemaps -name "*.map" -type f)
5050
jq -c ". + {\"debug_id\": \"${DEBUG_ID}\"}" "${MAP_FILE}" > "${MAP_FILE}.tmp"
5151
mv "${MAP_FILE}.tmp" "${MAP_FILE}"
5252
```
@@ -56,21 +56,21 @@ appcenter codepush release-react \
5656
--app "${APP_NAME}" \
5757
--deployment-name "${DEPLOYMENT_NAME}" \
5858
--output-dir ./build \
59-
--sourcemap-output-dir ./build
59+
--sourcemap-output-dir ./sourcemaps
6060
```
6161

6262
```bash {tabTitle:Hermes (AppCenter)}
63-
rm -rf ./build
63+
rm -rf ./build ./sourcemaps
6464
CODEPUSH_COMMAND="appcenter codepush release-react \
6565
--app \"${APP_NAME}\" \
6666
--deployment-name \"${DEPLOYMENT_NAME}\" \
6767
--use-hermes \
6868
--output-dir ./build \
69-
--sourcemap-output-dir ./build"
69+
--sourcemap-output-dir ./sourcemaps"
7070

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

73-
MAP_FILE=$(find ./build -name "*.map" -type f)
73+
MAP_FILE=$(find ./sourcemaps -name "*.map" -type f)
7474
jq -c ". + {\"debug_id\": \"${DEBUG_ID}\"}" "${MAP_FILE}" > "${MAP_FILE}.tmp"
7575
mv "${MAP_FILE}.tmp" "${MAP_FILE}"
7676
```
@@ -97,7 +97,7 @@ To upload source maps for your CodePush release, use the `sourcemaps upload` com
9797
npx sentry-cli sourcemaps upload \
9898
--debug-id-reference \
9999
--strip-prefix /path/to/project/root \
100-
./build
100+
./sourcemaps
101101
```
102102

103103
## Notes

0 commit comments

Comments
 (0)