feat(nextjs): Add scripts to allow deploying a branch to vercel #3624
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While building the
nextjs
SDK, multiple times we've run into the problem of having something work locally which then fails or breaks entirely when deployed to Vercel. Testing on Vercel is hard, though, because up until now if we wanted to test an SDK change, we've had to publish a beta to npm. Not only is this a lot of work just to be able to test a small change (especially if we're debugging and have to make a lot of small changes in a row), it's also not something most of us have the power to do.This fixes that problem by adding scripts to the repo which, when used in a test app, allow you to use a repo branch rather than a published package as the SDK in your app, by simply mimicking what we do on our own machines: cloning the repo, building the SDK, and then using that built copy in the test app.
More specifically, this PR adds four files to the repo:
On Vercel, it adds the built SDK as a file dependency (rather than linking it) to avoid any of the relative path problems which have come up when testing locally, and also because that way, yarn manages the SDK's dependencies alongside the project's.