diff --git a/docs/cloud/reference/manifest.mdx b/docs/cloud/reference/manifest.mdx index 60413c45..dac65ff5 100644 --- a/docs/cloud/reference/manifest.mdx +++ b/docs/cloud/reference/manifest.mdx @@ -38,6 +38,7 @@ Specifies the way the squid is built into a docker image. |:-----------------:|:-----------------------------:|----------------------:| | `node_version` | `18 \| 20 \| 21` | `20` | | `package_manager` | `auto \| npm \| pnpm \| yarn` | `auto` | +| [`install`](#install) | list | | For a successful build the following files and folders **must** be present in the root folder of the squid: @@ -52,6 +53,17 @@ Under the hood, Cloud builds a Docker image and runs a docker container for each See [Self-hosting](/sdk/resources/basics/self-hosting) for instructions on how to build and run the Docker image locally. Even though the squid services (`api`, `processor`, `migrate`) use the same single container image, the exec command is different and can is defined by the `deploy:` section as explained below. +### `install:` + +Enables overriding the dependencies installation command, e.g. +```yaml +build: + install: + - npm + - install +``` +The default is to use a shrinkwrap-based installation command appropriate for the detected package manager (e.g. `npm ci`). + ## `deploy:` The `deploy` section may define: diff --git a/docs/cloud/resources/monorepo.md b/docs/cloud/resources/monorepo.md new file mode 100644 index 00000000..540921dd --- /dev/null +++ b/docs/cloud/resources/monorepo.md @@ -0,0 +1,19 @@ +--- +sidebar_position: 65 +title: Working with monorepos +description: Custom build command + external lock files +--- + +# Working with monorepos + +When a squid is a part of some large project it is often convenient to keep it in a monorepo. These setups typically keep [shrinkwrap](https://nodejs.org/en/blog/npm/managing-node-js-dependencies-with-shrinkwrap) files such as `package-lock.json` in some centralized location. + +By default, [`sqd deploy`](/squid-cli/deploy) relies on shrinkwrap-based installation commands such as `npm ci`. These expect to find a shrinkwrap file in the root folder of the squid, so not having it there may complicate the deployment. + +Circumvent the issue by overriding the dependency installation command in your squid's [manifest](/cloud/reference/manifest/#install). The quick-and-dirty solution is to just ask for a fresh install, e.g.: +```yaml +build: + install: + - pnpm + - install +```