Skip to content

Commit

Permalink
Merge pull request #34 from joshuanianji/automated-documentation-upda…
Browse files Browse the repository at this point in the history
…te-7380631354

Automated documentation update
  • Loading branch information
joshuanianji authored Jan 1, 2024
2 parents 594c7c2 + a42356e commit c783f3f
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/mount-pnpm-store/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# Mount PNPM Store (mount-pnpm-store)
# Mount pnpm Store (mount-pnpm-store)

Mounts the pnpm store to a volume to share between multiple devcontainers, and sets pnpm store to ~/.pnpm-store. Fails if pnpm is not installed.
Mounts the pnpm store to a volume to share between multiple devcontainers, and sets pnpm store to ~/.pnpm-store.

## Example Usage

Expand All @@ -19,9 +19,13 @@ Mounts the pnpm store to a volume to share between multiple devcontainers, and s

## Important Implementation Details

### Ensuring PNPM is installed
### pnpm `store-dir`

This feature does not install PNPM by itself and expects `pnpm` to be installed already, either by a base image or by a feature. It fails quietly if pnpm is not installed.
This is opinionated, but I dislike the pnpm store being in the workspace along with your code as it adds clutter. This feature sets the pnpm `store-dir` config to `~/.pnpm-store`, so it's out of sight. The home directory will be based on the `remoteUser` of the base image you have.

### Ensuring pnpm is installed

This feature does not install pnpm by itself and expects `pnpm` to be installed already, either by a base image or by a feature. If pnpm is not installed, it just gives a warning (you'll have a random ~/.pnpm-store folder in your home directory and the pnpm `store-dir` config will not be set) but does not fail.

If you are installing pnpm with a feature, you may need to ensure it is run **before** `mount-pnpm-store`. To make this work, use the [`overrideFeatureInstallOrder` property](https://containers.dev/implementors/features/#overrideFeatureInstallOrder), since the default feature installation order is based on ID (alphanumerically i think). Here is an example using `features/node`:

Expand Down Expand Up @@ -51,7 +55,7 @@ The volume mount is called `global-devcontainer-pnpm-store`, so ensure that no o

## References

- [PNPM Devcontainer Setup by PatrickChoDev](https://gist.github.com/PatrickChoDev/81d36159aca4dc687b8c89983e64da2e)
- [Pnpm Devcontainer Setup by PatrickChoDev](https://gist.github.com/PatrickChoDev/81d36159aca4dc687b8c89983e64da2e)


---
Expand Down

0 comments on commit c783f3f

Please sign in to comment.