Skip to content

Commit

Permalink
feat(setup.md): move setup section from readme to docs folder
Browse files Browse the repository at this point in the history
  • Loading branch information
waldronmatt committed Oct 15, 2023
1 parent c197ba0 commit c516ef2
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 38 deletions.
38 changes: 1 addition & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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`
Expand All @@ -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).
Expand Down
20 changes: 20 additions & 0 deletions docs/repo/COMMANDS.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 3 additions & 1 deletion docs/repo/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Monorepo Documentation

[Additional Commands](COMMANDS.md)

[Architecture](ARCHITECTURE.md)

[Additional Commands](COMMANDS.md)
[Setup](SETUP.md)

[Workspace Commands](WORKSPACE.md)
37 changes: 37 additions & 0 deletions docs/repo/SETUP.md
Original file line number Diff line number Diff line change
@@ -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).

0 comments on commit c516ef2

Please sign in to comment.