1
- ### To prepare branch for deploying on Vercel:
1
+ # Testing an SDK Branch on Vercel
2
+
3
+ Follow the instructions below to test a branch of the SDK against a test app deployed to Vercel. This assumes you
4
+ already have such an app set up, and modifies both it and the SDK branch such that the dependency installation process
5
+ run on Vercel includes cloning the repo, building the current branch of the SDK, and setting the test app's
6
+ ` @sentry/next ` dependency to point to the newly-built local version.
7
+
8
+ (The clone-build-link step is necessary because you can't point a ` package.json ` dependency to a sub-folder of a git
9
+ repo, only a full repo itself. Since we run a monorepo, this won't work in our case.)
10
+
11
+ ### To prepare your SDK branch for deploying on Vercel
2
12
3
13
From ` packages/nextjs ` , run
4
14
@@ -7,7 +17,7 @@ From `packages/nextjs`, run
7
17
This will delete unneeded packages (angular, vue, etc) in order to speed up deployment. It will then commit that change.
8
18
When your branch is ready to PR, just rebase and drop that commit.
9
19
10
- ### To prepare test app for using current branch:
20
+ ### To prepare your test app for using current SDK branch
11
21
12
22
First, make sure the branch you want to test is checked out in your ` sentry-javascript ` repo, and that all changes you
13
23
want to test are pushed to GitHub.
@@ -16,9 +26,10 @@ From `packages/nextjs`, run
16
26
17
27
` yarn vercel:project <path/to/testapp> ` .
18
28
19
- This will copy a script into a ` .sentry ` folder at the root level of your test app,and create a second one. (The first
20
- script is the one you'll run on Vercel. The second is a helper to the first, so that it knows which branch to use.) It
21
- will then commit (but not push) this change.
29
+ This will copy the ` install-sentry-from-branch.sh ` script into a ` .sentry ` folder at the root level of your test app,
30
+ and create a ` set-branch-name.sh ` script in the same location. (The first script is the one you'll run on Vercel. The
31
+ second is called by the first, and just sets an environment variable with the current (SDK) branch name.) It will then
32
+ commit (but not push) this change.
22
33
23
34
Go into your project settings on Vercel and change the install command to
24
35
@@ -30,9 +41,12 @@ If you're using bundle analyzer, change the build command to
30
41
31
42
The bundle visualizations will be available on your deployed site at ` /client.html ` and ` /server.html ` .
32
43
33
- ### To test the SDK:
44
+ NOTE: You don't need to change the ` @sentry/nextjs ` dependency in your project's ` package.json ` file. That will happen
45
+ on the fly each time your app is deployed.
46
+
47
+ ### To test the SDK
34
48
35
- Once you have pushed the changes made by ` yarn vercel:project ` to GitHub, just make changes and push, and Vercel will
36
- always use the latest version of both the SDK and your test app. Pushing changes to your test app will trigger a new
37
- build in Vercel; for changes to the SDK, you'll need to manually redeploy, either by kicking off a new build or simply
38
- choosing 'Redeploy' on your most recent existing build.
49
+ Once you have pushed the changes made by ` yarn vercel:project ` to GitHub, just make changes (either to the SDK or your
50
+ test app) and push them. Vercel will always use the latest version of both the SDK and your test app each time it
51
+ deploys. Pushing changes to your test app will trigger a new build in Vercel; for changes to the SDK, you'll need to
52
+ manually redeploy, either by kicking off a new build or simply choosing 'Redeploy' on your most recent existing build.
0 commit comments