Skip to content

Commit

Permalink
docs: Prefix every nx call with pnpm in the docs (#373)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkleszcz committed Aug 9, 2023
1 parent 9b65dd9 commit 46bbafc
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 52 deletions.
26 changes: 13 additions & 13 deletions packages/internal/docs/docs/api-reference/backend/commands.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,59 +8,59 @@ import RunOnCICautionPartial from '../../shared/partials/_run-on-ci-caution.mdx'
This page contains a list of CLI commands that you can use within the `backend` package context.


### `nx run backend:compose-build-image`
### `pnpm nx run backend:compose-build-image`

Builds a backend Docker image by running `nx run core:docker-login` and `docker-compose build backend`.
Builds a backend Docker image by running `pnpm nx run core:docker-login` and `docker-compose build backend`.

<RunOnCICautionPartial />

---


### `nx run backend:test`
### `pnpm nx run backend:test`

Runs tests (`scripts/run_tests.sh` script) inside Docker container using `docker-compose`.

---


### `nx run backend:build`
### `pnpm nx run backend:build`

Runs `scripts/build.sh` script.

Depends on: [`nx run backend:test`](#nx-run-backendtest)
Depends on: [`pnpm nx run backend:test`](#pnpm-nx-run-backendtest)

---


### `nx run backend:deploy:api`
### `pnpm nx run backend:deploy:api`

Runs `nx cdk:deploy:api` along with `nx run tools:upload-service-version api "url=https://${SB_DOMAIN_API}"`
Runs `pnpm nx cdk:deploy:api` along with `pnpm nx run tools:upload-service-version api "url=https://${SB_DOMAIN_API}"`


---


### `nx run backend:deploy:migrations`
### `pnpm nx run backend:deploy:migrations`

Runs following commands:
```bash
nx cdk:deploy:migrations
nx run trigger-migrations-job
nx run tools:upload-service-version migrations
pnpm nx cdk:deploy:migrations
pnpm nx run trigger-migrations-job
pnpm nx run tools:upload-service-version migrations
```

---

### `make test`

Alias command for [`nx test`](#nx-run-backendtest).
Alias command for [`pnpm nx test`](#pnpm-nx-run-backendtest).

---

### `make build`

Alias command for [`nx build`](#nx-run-backendbuild).
Alias command for [`pnpm nx build`](#pnpm-nx-run-backendbuild).

---

Expand Down
12 changes: 6 additions & 6 deletions packages/internal/docs/docs/api-reference/tools/commands.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@ This page contains a list of CLI commands that you can use within the `tools` pa

## Generators

### `nx g @sb/tools:webapp-lib`
### `pnpm nx g @sb/tools:webapp-lib`

Generates a project structure for a new webapp library that you can import from other webapp libraries or webapp
package.


```shell title="Example usage"
nx g @sb/tools:webapp-lib --directory webapp-libs mylib
pnpm nx g @sb/tools:webapp-lib --directory webapp-libs mylib
```

To learn more about creating a new webapp library check out the
[How to create a new webapp library package?](../../working-with-sb/project-structure/create-web-lib) guide.

## Other commands

### `nx run tools:upload-version SERVICES`
### `pnpm nx run tools:upload-version SERVICES`

<RunOnCICautionPartial />

Expand All @@ -36,12 +36,12 @@ Arguments:
- `SERVICES`: comma separated list of services that are deployed during environment update

```bash title="Example usage"
nx run tools:upload-version migrations,api,workers,webapp
pnpm nx run tools:upload-version migrations,api,workers,webapp
```

---

### `nx run tools:upload-service-version SERVICE [ADDITIONAL_DATA]`
### `pnpm nx run tools:upload-service-version SERVICE [ADDITIONAL_DATA]`

<RunOnCICautionPartial />

Expand All @@ -55,5 +55,5 @@ Arguments:
Used for example to pass the `url` data of the deployed service

```bash title="Example usage"
nx run tools:upload-service-version workers
pnpm nx run tools:upload-service-version workers
```
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ description: Commands within `webapp-api-cient` package context

This page contains a list of CLI commands that you can use within the `webapp-api-client` package context.

### `nx run webapp-api-client:graphql:generate-types`
### `pnpm nx run webapp-api-client:graphql:generate-types`

Generate TypeScript types from GraphQL schema

---

### `nx run webapp-api-client:graphql:generate-types:watch`
### `pnpm nx run webapp-api-client:graphql:generate-types:watch`
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This page contains a list of CLI commands that you can use within the `webapp-em

### `pnpm run build`

Alias for [`nx run webapp-emails:build-vite`](#nx-webapp-emailsbuild-vite)
Alias for [`pnpm nx run webapp-emails:build-vite`](#pnpm-nx-webapp-emailsbuild-vite)

---

Expand Down Expand Up @@ -35,12 +35,12 @@ Runs `jest` with `--watch` flag. Useful for development purpose.

---

### `nx webapp-emails:build-vite`
### `pnpm nx webapp-emails:build-vite`

Runs [`vite build`](https://vitejs.dev/guide/cli.html#build) with the correct configuration and builds web application.

---

### `nx run webapp-emails:build-for-env`
### `pnpm nx run webapp-emails:build-for-env`

It is used in CI pipeline and runs `nx webapp-emails:build-vite` inside `webapp` environment context using `chamber`.
It is used in CI pipeline and runs `pnpm nx webapp-emails:build-vite` inside `webapp` environment context using `chamber`.
38 changes: 19 additions & 19 deletions packages/internal/docs/docs/api-reference/webapp/commands.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ This page contains a list of CLI commands that you can use within the `webapp` p

Start webapp development server

Alias for [`nx start:app`](#nx-startapp). It starts [Vite](https://vitejs.dev/) web
application development server along with `nx webapp:graphql:generate-types:watch`.
Alias for [`pnpm nx start:app`](#pnpm-nx-startapp). It starts [Vite](https://vitejs.dev/) web
application development server along with `pnpm nx webapp:graphql:generate-types:watch`.

---

### `pnpm run build`

Alias for [`nx run webapp:build-vite`](#nx-run-webappbuild-vite)
Alias for [`pnpm nx run webapp:build-vite`](#pnpm-nx-run-webappbuild-vite)

---

Expand Down Expand Up @@ -58,64 +58,64 @@ Find more about plop generator in the [devtools section](../../working-with-sb/d

Run and build storybooks

It runs `start-storybook` script along with [`nx run webapp-emails:vite-build`](../webapp-emails/commands#build-emails)
It runs `start-storybook` script along with [`pnpm nx run webapp-emails:vite-build`](../webapp-emails/commands#build-emails)
which will prebuild email templates.

Storybook server will start on port `5002`.

---

### `nx start:app`
### `pnpm nx start:app`

It will start [Vite](https://vitejs.dev/) web application development server along with
[`nx webapp:graphql:generate-types:watch`](#nx-run-webappgraphqlgenerate-typeswatch).
[`pnpm nx webapp:graphql:generate-types:watch`](#pnpm-nx-run-webappgraphqlgenerate-typeswatch).

---

### `nx run webapp:graphql:download-schema`
### `pnpm nx run webapp:graphql:download-schema`

It downloads and saves GraphQL schemas from back-end API and Contentful API. This should be run after every API schema
change and before generating TypeScript types by calling
[`nx run webapp:graphql:generate-types`](#nx-run-webappgraphqlgenerate-types).
[`pnpm nx run webapp:graphql:generate-types`](#pnpm-nx-run-webappgraphqlgenerate-types).

You can find more about updating GraphQL schema [here](../../working-with-sb/graphql/web-app/update-schema)

---

### `nx run webapp:graphql:generate-types`
### `pnpm nx run webapp:graphql:generate-types`

### `nx run webapp:graphql:generate-types:watch`
### `pnpm nx run webapp:graphql:generate-types:watch`

Alias commands for [`nx run webapp-api-client:graphql:generate-types`](../webapp-api-client/commands#nx-run-webapp-api-clientgraphqlgenerate-types) and
[`nx run webapp-api-client:graphql:generate-types:watch`](../webapp-api-client/commands#nx-run-webapp-api-clientgraphqlgenerate-typeswatch)
Alias commands for [`pnpm nx run webapp-api-client:graphql:generate-types`](../webapp-api-client/commands#pnpm-nx-run-webapp-api-clientgraphqlgenerate-types) and
[`pnpm nx run webapp-api-client:graphql:generate-types:watch`](../webapp-api-client/commands#pnpm-nx-run-webapp-api-clientgraphqlgenerate-typeswatch)

---

### `nx run webapp:build-vite`
### `pnpm nx run webapp:build-vite`


Regenerate types by calling [`nx run webapp:graphql:generate-types`](#nx-run-webappgraphqlgenerate-types) and
Regenerate types by calling [`pnpm nx run webapp:graphql:generate-types`](#pnpm-nx-run-webappgraphqlgenerate-types) and
builds the web application using [`vite build`](https://vitejs.dev/guide/cli.html#build) with the correct configuration.

---

### `nx run webapp:build-with-env`
### `pnpm nx run webapp:build-with-env`

It is used in CI pipeline and runs `nx webapp:build-vite` inside `webapp` environment context using `chamber`.
It is used in CI pipeline and runs `pnpm nx webapp:build-vite` inside `webapp` environment context using `chamber`.

To find more about using `chamber` in the project check [How to configure environment variables on AWS?](../../aws/deploy-to-aws/create-runtime-env-vars) guide.

---

### `make test`

Alias command for [`nx test`](#pnpm-run-test).
Alias command for [`pnpm nx test`](#pnpm-run-test).

---

### `make build`

Alias command for [`nx build`](#nx-run-webappbuild-vite).
Alias command for [`pnpm nx build`](#pnpm-nx-run-webappbuild-vite).

---

Expand All @@ -133,7 +133,7 @@ This command should be called only after `make set-env ENV_STAGE=<STAGE_NAME>` c

---

### `nx run extract-intl`
### `pnpm nx run extract-intl`

It extracts all [`formatjs`](https://formatjs.io/) messages from the `webapp` and `webapp-libs` packages using
[`formatjs extract`](https://formatjs.io/docs/getting-started/message-extraction/#extraction) command to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ You can configure version matrix via AWS SSM Parameter Store. You can find the d

Deployment of the version matrix service contains two steps. First, you need to run build command:
```shell
nx run status-dashboard:build
pnpm nx run status-dashboard:build
```

After successful build you can run AWS deployment script:

```shell
nx run status-dashboard:deploy
pnpm nx run status-dashboard:deploy
```

:::caution
Expand All @@ -47,11 +47,11 @@ This command should be called only after `make set-env ENV_STAGE=<STAGE_NAME>` c
## Updating version on CI pipeline

Application environment version and individual services versions are updated automatically on the CI/CD pipeline using
`nx run tools:upload-version` and `nx run tools:upload-service-version` commands.
`pnpm nx run tools:upload-version` and `pnpm nx run tools:upload-service-version` commands.

:::info

Find more about `nx run tools:upload-version` and `nx run tools:upload-service-version` commands in the
Find more about `pnpm nx run tools:upload-version` and `pnpm nx run tools:upload-service-version` commands in the
[`tools` package API Reference](../../api-reference/tools/commands).

:::
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ To update types in the webapp application code, two steps need to be taken:

To download the GraphQL schemas, run the command:
```bash
nx run webapp:graphql:download-schema
pnpm nx run webapp:graphql:download-schema
```
This command will introspect
and save both schemas (main back-end API and Contentful API) to files located at
Expand All @@ -42,7 +42,7 @@ To update types in the webapp application code, two steps need to be taken:

To generate the types based on the downloaded GraphQL schemas, run the following command:
```bash
nx run webapp:graphql:generate-types
pnpm nx run webapp:graphql:generate-types
```
This command uses the [`graphql-codegen`](https://the-guild.dev/graphql/codegen) tool and a special configuration
defined in `packages/webapp-libs/webapp-api-client/graphql/codegen.ts`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ If you want to learn more about creating mutations check out
You can either restart the dev server or run the following command to re-generate GraphQL types:

```shell
nx run webapp:graphql:generate-types
pnpm nx run webapp:graphql:generate-types
```

### Create payment intent in web app
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ A new webapp library needs a few different files, so SaaS Boilerplate comes with
Run the following command to generate basic scaffold:

```shell
nx g @sb/tools:webapp-lib --directory webapp-libs mylib
pnpm nx g @sb/tools:webapp-lib --directory webapp-libs mylib
```

- `mylib` should be the name of your library
Expand Down

0 comments on commit 46bbafc

Please sign in to comment.