Skip to content

coilhq/web-monetization-projects

main
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.

Web Monetization Projects

Prettier Renovate

Development Process

Ultimately we want main branch to be in a 'good' state at all times, with good test coverage, so we can practice CD, publishing the extensions to dev channels automatically.

Currently, we mostly rely on puppeteer tests which don't cover all the test scenarios. Therefore, we must do manual testing before release, as it's too much of an impediment to run through the full manual release checklist on each PR/commit.

It's a good practice to do manual testing, as often bugs can be found with fresh eyes, if one is carefully going through the steps. Also, doing so helps to keep the various features freshly in mind, so when adding new features or fixing old ones, mistakes can be avoided.

So:

  • do not assume the main branch is in a good state !

Setting up dev environment

The Web-Monetization monorepo uses yarn (2), so you need to install it using npm or your package manager:

npm install -g yarn
# OR
brew install yarn

Clone and setup the dev env.

git clone git@github.com:coilhq/web-monetization-projects.git
yarn

Node >= 16

The TypeScript is compiled into es2020 and the CI only tests 16 (currently the LTS) and on. See nvm for an easy way to manage multiple versions

Visual Studio Code

This repository is using yarn 2 pnp, so VSCode needs zipfs support to be able to navigate to 3rd party dependencies.

Why Vanilla Prettier ?

We used prettier-standard (based on prettierx, a fork of prettier) but found that it was easier to find up-to-date editor/eslint integrations for the mainline prettier and just set the .prettierrc options to match prettier-standard as closely as possible (no semicolon, single-quoted strings etc).

The one main difference is the lack of a space before parentheses in function declarations. e.g.

function prettierStandard () {}

vs

function prettier() {}

This is not a big deal when prettier is run before commit and enforced in the CI etc.

Repository Structure

This repository is managed using yarn workspaces and typescript project references, with some custom code to generate consistent package.json/tsconfig.build.json/etc and src/test folder structure. See the coil-monorepo-upkeep folder for details.

Development workflow

The root tsconfig.json has all the paths configured so refactoring/navigation works across package boundaries, going directly to the source files rather than the declarations.

It looks at the entire monorepo as one set of sources, yet is configured to not actually emit any source. It is purely for the purposes of the IDE.

It is intended that the whole monorepo be opened in the editor/IDE.

To build the source, one must use each individual package's tsconfig.build.json. The root has a tsconfig.references.json which has {"path": "...} links to all the project leaf nodes. Each package with dependencies on other packages also has these links automatically generated by yarn upkeep via data output from the (custom plugin) yarn workspaces list-with-dependencies command. For example, check the coil-extension tsconfig.build.json

Dependencies

We practice rolling versioning of updates, with dependabot configured to send pull requests as new (release, not beta) versions come in. This practice makes it more likely the CI is able to catch the exact version a dependency starts to cause a break without manual bisection. After the initial hurdle of getting the software into an up-to-date state this requires only scant daily attention, reading the release logs while waiting for CI.

Note that we run through the release-checklist.md before every release, and we catch bugs there as well as with CI.