Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: add explicit vercel build command #2

Open
wants to merge 2 commits into
base: feature/rtc-v1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions doc/adr/0011-components-preview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# 10. Components Preview

Date: 2021-09-09

## Status

Approved.

Uses [10. JS Components](0010-js-components.md).


## Context

We'd like to be able to see changes in our JS Components without having to build and serve the PR that introduced those changes.

A common way to do this in GitHub projects is to add CD automation to push PR builds to preview domains.

We could roll our own automation to do this over the free github pages domain but it is likely that this is tricky work.

Vercel is a popular provider of preview builds that the team already has experience with.


## Decision

Use Vercel with a single member team to reduce costs.

Use a `vercel-build` npm script to enable developers to change the build step without having access to the Vercel settings.

Set the [Production Branch](https://vercel.com/docs/git#production-branch) to `feature/rtc-v1` while that's the main development branch, and afterwards set it to `main`.

Set the Vercel [Build & Development Settings](https://vercel.com/docs/build-step#build-&-development-settings) to:
- Build command: `yarn vercel-build`
- Output directory: `storybook-static`
- Install command: `yarn install`


## Consequences

Negative consequences:
* We have to pay for Vercel teams with at least 1 member because of the athensresearch org
* We might be able to avail of the [Vercel OSS sponsorship](https://vercel.com/support/articles/can-vercel-sponsor-my-open-source-project)
* The preview domain is deployed even if there's no changes to the JS components build
* Customizing the [Ignored Build Step](https://vercel.com/docs/platform/projects#ignored-build-step) might enable this, but seems error-prone
* Vercel will comment on every PR once, adding some spam to notifications'
* Vercel only allows for a single auto-deploy target branch that we have to change when we have a new major development branch
* Vercel does not allow in-repo file config for build or branch settings

Positive consequences:
* We can see and show others the components build
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"clean": "rm -rf resources/public/**/*.js target .shadow-cljs ./src/stories/**/*.js",
"dist": "electron-builder -p always",
"storybook:watch": "start-storybook -p 6006",
"storybook": "build-storybook"
"storybook": "build-storybook",
"vercel-build": "yarn storybook"
},
"main": "resources/main.js",
"build": {
Expand Down