From c516ef246cb93232ebd88ddfee2f23e3e8ac6091 Mon Sep 17 00:00:00 2001 From: waldronmatt Date: Sat, 14 Oct 2023 22:48:42 -0400 Subject: [PATCH] feat(setup.md): move setup section from readme to docs folder --- README.md | 38 +------------------------------------- docs/repo/COMMANDS.md | 20 ++++++++++++++++++++ docs/repo/README.md | 4 +++- docs/repo/SETUP.md | 37 +++++++++++++++++++++++++++++++++++++ 4 files changed, 61 insertions(+), 38 deletions(-) create mode 100644 docs/repo/SETUP.md diff --git a/README.md b/README.md index 16d5f472..9fe6ae8c 100644 --- a/README.md +++ b/README.md @@ -18,19 +18,7 @@ pnpm prepare ## Setup -Follow the directions [here](https://nx.dev/nx-cloud/intro/what-is-nx-cloud) to set up an nx account and access token. - -Create an `nx-cloud.env` file with the following to enable cloud caching: - -```bash -NX_CLOUD_ACCESS_TOKEN=your-token -``` - -Create a `GH_TOKEN` personal access token [here](https://github.com/settings/tokens) and create an `NPM_TOKEN` [here](https://www.npmjs.com/login) via the `Access Tokens` section. - -Set up your `NPM_TOKEN` and `NX_CLOUD_ACCESS_TOKEN` via `Settings` -> `Secrets` -> `Actions`. - -Enable read and write workflow permissions in your repo via `Settings` -> `Actions` -> `General` -> `Workflow permissions` -> `read and write permissions`. +Token setup and repository settings can be [found here](docs/repo/SETUP.md). ## Getting Started @@ -54,12 +42,6 @@ Run tests with coverage: pnpm test ``` -Run tests in watch mode: - -```bash -pnpm test:watch -``` - Compile files and build bundle: **Note**: It is recommended to run `pnpm clean` before `pnpm build` @@ -74,24 +56,6 @@ Clean up bundle artifacts: pnpm clean ``` -Starts local servers that serves the `build` outputs from their respective output folders: - -**Note**: Run `pnpm build` first. - -```bash -pnpm preview -``` - -Stub `dist` for project linking without needing to watch and rebuild: - -```bash -pnpm stub -``` - -## NX Distributed Caching - -To enable nx distributed caching, refactor the `.github/workflows/release.yml` file via the directions [here](https://nx.dev/recipes/ci/monorepo-ci-github-actions#distributed-ci-with-nx-cloud). - ## Additional Documentation Additional monorepo documentation can be [found here](docs/repo/README.md). diff --git a/docs/repo/COMMANDS.md b/docs/repo/COMMANDS.md index 2ed032e7..43af42e0 100644 --- a/docs/repo/COMMANDS.md +++ b/docs/repo/COMMANDS.md @@ -1,5 +1,25 @@ # Additional Commands +Run tests in watch mode: + +```bash +pnpm test:watch +``` + +Starts local servers that serves the `build` outputs from their respective output folders: + +**Note**: Run `pnpm build` first. + +```bash +pnpm preview +``` + +Stub `dist` for project linking without needing to watch and rebuild: + +```bash +pnpm stub +``` + Commit changes using conventional changelog: ```bash diff --git a/docs/repo/README.md b/docs/repo/README.md index f974c1a5..24567a0b 100644 --- a/docs/repo/README.md +++ b/docs/repo/README.md @@ -1,7 +1,9 @@ # Monorepo Documentation +[Additional Commands](COMMANDS.md) + [Architecture](ARCHITECTURE.md) -[Additional Commands](COMMANDS.md) +[Setup](SETUP.md) [Workspace Commands](WORKSPACE.md) diff --git a/docs/repo/SETUP.md b/docs/repo/SETUP.md new file mode 100644 index 00000000..39211150 --- /dev/null +++ b/docs/repo/SETUP.md @@ -0,0 +1,37 @@ +# Repository Setup + +## Tokens + +### NX + +Follow the directions [here](https://nx.dev/nx-cloud/set-up) to set up an `nx` account. + +Follow the directions [here](https://nx.dev/nx-cloud/account/access-tokens) to set up an `nx` access token. + +Create an `nx-cloud.env` file with the following to enable cloud caching: + +```bash +NX_CLOUD_ACCESS_TOKEN=your-token +``` + +### Github and NPM + +Create a `GH_TOKEN` personal access token [here](https://github.com/settings/tokens) and create an `NPM_TOKEN` [here](https://www.npmjs.com/login) via the `Access Tokens` section. + +Set up your `NPM_TOKEN` and `NX_CLOUD_ACCESS_TOKEN` via `Settings` -> `Secrets` -> `Actions`. + +## Repository Permissions + +### Github + +Enable read and write workflow permissions in your repo via `Settings` -> `Actions` -> `General` -> `Workflow permissions` -> `read and write permissions`. + +### Renovate + +Go to `Option` and activate at least `Allow auto-merge` and `Automatically delete head branches` + +Go to `Branches` and add a branch protection rule for your `main` branch. Activate `Require status checks to pass before merging` and `Require branches to be up to date before merging` + +## NX Distributed Caching + +To enable nx distributed caching, refactor the `.github/workflows/release.yml` file via the directions [here](https://nx.dev/recipes/ci/monorepo-ci-github-actions#distributed-ci-with-nx-cloud).