Follow the directions here to install pnpm.
Globally install the rimraf
package via:
pnpm i -g rimraf
Install playwright
browser binaries:
npx playwright install
Install husky hooks:
Note: pnpm
should automatically run prepare
when installing
pnpm prepare
Create an nx
account here.
Create an NX_CLOUD_ACCESS_TOKEN
token here with Read
permissions by going to your repo and then go to Settings
-> Manage Tokens
.
Create an nx-cloud.env
file at the project root to enable cloud caching locally:
NX_CLOUD_ACCESS_TOKEN=your-token
Set up NX_CLOUD_ACCESS_TOKEN
in GitHub via Settings
-> Secrets
-> Actions
to enable cloud caching via GitHub Actions.
Follow the directions to set up a GITHUB_TOKEN
here with permissions of repo:public_repo
scope to allow Lerna to create GitHub tags and releases.
Next, set up GITHUB_TOKEN
as an environment variable in your operating system so you can run Lerna commands via the terminal such as lerna version --dry-run --yes
.
Create an NPM_TOKEN
here with permissions of type Automation
via the Access Tokens
section to allow Lerna to publish packages to NPM.
Set up your NPM_TOKEN
in GitHub via Settings
-> Secrets
-> Actions
.
Enable read and write workflow permissions in your repo via Settings
-> Actions
-> General
-> Workflow permissions
-> read and write permissions
.
Follow the directions here to set up Renovate.
Create an automerge
PR label. Renovate will apply this label on PRs for Kodiak to merge automatically.
Follow the directions here to enable dependabot alerts.
Create a security
PR label. Renovate will automatically create a PR and apply this label when Dependabot detects a security alert.
Follow the directions here to set up Kodiak. Make sure to configure GitHub branch protection. Setup required status checks to prevent failing PRs from being merged.
Create a wip
PR label. When you set the wip
label on a PR, Kodiak will not merge it.
Create a conflict
PR label. When you set the conflict
label on a PR, Kodiak will update the PR when it is out-of-date with the main branch. Renovate will typically rebase a branch so this label isn't typically needed.
Lerna does not support automation of initial version 1 packages. Follow the directions below to set up a manual version/changelog and publish:
- Commit as you normally would by adding
fix
,feat
, etc. with descriptive messaging. - Add a commit (type of
chore
) changing the version inpackage.json
for your package from0.x.x
to1.0.0-1
as per this comment - Graduate them to a release with
npx lerna version --conventional-graduate my-package
(will create release notes etc on GitHub) - Publish them to NPM with
npx lerna publish from-package
- Note: You can disregard the changes made to
package.json
when runninglerna publish
using git if applicable - Repeat the process for your other packages
-
Follow the directions here to set up NX Distributed Task Execution (DTE).
-
Follow the directions here to set up NX Version Control Integration (VCS).
Note: This repo's CICD is not configured to support DTE and VCS.