diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index f060f10..a8edeef 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -13,7 +13,6 @@ jobs: matrix: features: - shared-pnpm-store - - mount-pnpm-store baseImage: - debian:latest - ubuntu:latest @@ -33,7 +32,6 @@ jobs: matrix: features: - shared-pnpm-store - - mount-pnpm-store steps: - uses: actions/checkout@v4 diff --git a/LICENSE b/LICENSE index f5ec218..e851bd1 100644 --- a/LICENSE +++ b/LICENSE @@ -1,8 +1,6 @@ MIT License Copyright (c) 2026 ITplusX -Portions Copyright (c) 2023 Joshua Ji -(src/mount-pnpm-store, copied from https://github.com/joshuanianji/devcontainer-features) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 6acdafb..8f59693 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,9 @@ Custom [Dev Container Features](https://containers.dev/implementors/features/) m | Feature | Description | | ------- | ----------- | -| [`shared-pnpm-store`](./src/shared-pnpm-store) | Mounts a shared Docker volume as the pnpm store directory via `containerEnv`. Never invokes pnpm. **Recommended.** | -| [`mount-pnpm-store`](./src/mount-pnpm-store) | **Deprecated** — use `shared-pnpm-store` instead. Sets the pnpm store to `~/.pnpm-store` and mounts it to a shared volume. Patched copy of [joshuanianji/devcontainer-features](https://github.com/joshuanianji/devcontainer-features) that works with pnpm >= 9 in non-interactive lifecycle shells. | +| [`shared-pnpm-store`](./src/shared-pnpm-store) | Mounts a shared Docker volume as the pnpm store directory via `containerEnv`. Never invokes pnpm. | + +> The former `mount-pnpm-store` feature has been removed. Use `shared-pnpm-store` instead. ## Usage @@ -45,4 +46,4 @@ The initial implementation of `shared-pnpm-store` was developed locally by [@sch ## License -MIT — see [LICENSE](./LICENSE). The `mount-pnpm-store` feature contains code Copyright (c) 2023 Joshua Ji (MIT). +MIT — see [LICENSE](./LICENSE). diff --git a/src/mount-pnpm-store/NOTES.md b/src/mount-pnpm-store/NOTES.md deleted file mode 100644 index 5d56264..0000000 --- a/src/mount-pnpm-store/NOTES.md +++ /dev/null @@ -1,96 +0,0 @@ -> [!WARNING] -> **This feature is deprecated.** Use -> [`shared-pnpm-store`](https://github.com/itplusx/devcontainer-features/tree/main/src/shared-pnpm-store) -> instead. It achieves the same shared-store goal with `containerEnv` only — it -> never invokes pnpm, so it avoids the `PNPM_HOME` / PATH / non-interactive-shell -> patching this feature needs. `mount-pnpm-store` will not receive further -> updates. -> -> **Migration:** replace the feature reference in your `devcontainer.json`: -> -> ```json -> "features": { -> "ghcr.io/itplusx/devcontainer-features/shared-pnpm-store:1": {} -> } -> ``` -> -> The two features use different volume names -> (`global-devcontainer-pnpm-store` vs `devcontainer-shared-pnpm-store`), so the -> first `pnpm install` after switching re-populates the new store from the -> registry. Any `PNPM_HOME`/`PATH` workaround you added in `devcontainer.json` -> for this feature can be removed. - -## Origin - -This feature is a patched copy of [`joshuanianji/devcontainer-features/mount-pnpm-store`](https://github.com/joshuanianji/devcontainer-features/tree/main/src/mount-pnpm-store) (MIT, Copyright (c) 2023 Joshua Ji), copied at upstream version `1.0.2` (commit `e91be54`). - -**The patch:** pnpm hard-fails any `--global` command when its global bin directory is not in `PATH`. The expected directory differs by version: `$PNPM_HOME` for pnpm <= 8, `$PNPM_HOME/bin` for pnpm >= 9 (default `~/.local/share/pnpm[/bin]`). The feature's `onCreateCommand` script runs in a non-interactive shell where rc-file exports are not loaded, so `pnpm config set store-dir --global` killed the container build (see [upstream issue #80](https://github.com/joshuanianji/devcontainer-features/issues/80) and [devcontainers-extra/features#218](https://github.com/devcontainers-extra/features/issues/218)). `oncreate.sh` now exports `PNPM_HOME` (defaulting to `~/.local/share/pnpm`) and prepends both `$PNPM_HOME/bin` and `$PNPM_HOME` to `PATH` before invoking pnpm. The feature is therefore self-sufficient — no `remoteEnv`/`containerEnv` workaround is needed in the consuming `devcontainer.json`, and project-local `pnpm install` works out of the box. - -### Global pnpm commands in your own shells - -The patch only fixes the environment for this feature's own script. If *you* run pnpm global commands (`pnpm add -g ...`) in container terminals or your own lifecycle scripts, those shells need the same environment. Declare it in your `devcontainer.json` (adjust the home directory to your `remoteUser`): - -```json -"containerEnv": { - "PNPM_HOME": "/home/vscode/.local/share/pnpm" -}, -"remoteEnv": { - "PATH": "/home/vscode/.local/share/pnpm/bin:${containerEnv:PATH}" -} -``` - -> [!WARNING] -> The `PATH` entry must go in `remoteEnv`, **not** `containerEnv`: the `${containerEnv:VAR}` substitution is only resolved in `remoteEnv`. Putting it in `containerEnv` sets the container's `PATH` to the literal unresolved string, which breaks every binary lookup (`sleep`, `sed`, ...) and makes the container exit immediately after start. - -## OS and Architecture Support - -Architectures: `amd` and `arm` - -OS: `ubuntu`, `debian` - -Shells: `bash`, `zsh`, `fish` - -## Important Implementation Details - -### pnpm `store-dir` - -This is opinionated, but having the pnpm store in the workspace along with your code 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`. There is a soft dependency on `ghcr.io/devcontainers/features/node` already, but if it is any other feature that installs pnpm you might need to put some extra work. - -To make this work, use the [`overrideFeatureInstallOrder` property](https://containers.dev/implementors/features/#overrideFeatureInstallOrder), since the default feature installation order is based on ID. Here is an example using a fake `unknown-install-pnpm`: - -```json - "image": "mcr.microsoft.com/devcontainers/base:bullseye", - "features": { - "ghcr.io/random-user/devcontainer-features/unknown-install-pnpm:1": {}, - "ghcr.io/itplusx/devcontainer-features/mount-pnpm-store:1": {} - }, - "overrideFeatureInstallOrder": [ - "ghcr.io/random-user/devcontainer-features/unknown-install-pnpm", - "ghcr.io/itplusx/devcontainer-features/mount-pnpm-store" - ] -``` - -### Volume Mount Naming - -The volume mount is called `global-devcontainer-pnpm-store` (same name as upstream, so the store is shared with containers using the upstream feature). Ensure that no other docker volumes match this name. - -## Changelog - -| Version | Notes | -| ------- | ---------------------------------------------------------------------------------- | -| 1.2.0 | Deprecated in favor of `shared-pnpm-store` | -| 1.1.0 | Copy to itplusx namespace; fix `oncreate.sh` for the pnpm global bin dir check | -| 1.0.2 | (upstream) Move onCreate lifecycle script to `oncreate.sh` | -| 1.0.1 | (upstream) Fix Docs | -| 1.0.0 | (upstream) Support zsh + refactor | - -## References - -- [Upstream feature by Joshua Ji](https://github.com/joshuanianji/devcontainer-features/tree/main/src/mount-pnpm-store) -- [Pnpm Devcontainer Setup by PatrickChoDev](https://gist.github.com/PatrickChoDev/81d36159aca4dc687b8c89983e64da2e) diff --git a/src/mount-pnpm-store/README.md b/src/mount-pnpm-store/README.md deleted file mode 100644 index 7c19a86..0000000 --- a/src/mount-pnpm-store/README.md +++ /dev/null @@ -1,120 +0,0 @@ - -# Mount pnpm Store (mount-pnpm-store) - -[DEPRECATED — use shared-pnpm-store instead] Sets pnpm store to ~/.pnpm-store and mounts it to a volume to share between multiple devcontainers. Patched fork of joshuanianji/devcontainer-features that works with pnpm >= 9 in non-interactive lifecycle shells. - -## Example Usage - -```json -"features": { - "ghcr.io/itplusx/devcontainer-features/mount-pnpm-store:1": {} -} -``` - -## Options - -| Options Id | Description | Type | Default Value | -|-----|-----|-----|-----| - - -> [!WARNING] -> **This feature is deprecated.** Use -> [`shared-pnpm-store`](https://github.com/itplusx/devcontainer-features/tree/main/src/shared-pnpm-store) -> instead. It achieves the same shared-store goal with `containerEnv` only — it -> never invokes pnpm, so it avoids the `PNPM_HOME` / PATH / non-interactive-shell -> patching this feature needs. `mount-pnpm-store` will not receive further -> updates. -> -> **Migration:** replace the feature reference in your `devcontainer.json`: -> -> ```json -> "features": { -> "ghcr.io/itplusx/devcontainer-features/shared-pnpm-store:1": {} -> } -> ``` -> -> The two features use different volume names -> (`global-devcontainer-pnpm-store` vs `devcontainer-shared-pnpm-store`), so the -> first `pnpm install` after switching re-populates the new store from the -> registry. Any `PNPM_HOME`/`PATH` workaround you added in `devcontainer.json` -> for this feature can be removed. - -## Origin - -This feature is a patched copy of [`joshuanianji/devcontainer-features/mount-pnpm-store`](https://github.com/joshuanianji/devcontainer-features/tree/main/src/mount-pnpm-store) (MIT, Copyright (c) 2023 Joshua Ji), copied at upstream version `1.0.2` (commit `e91be54`). - -**The patch:** pnpm hard-fails any `--global` command when its global bin directory is not in `PATH`. The expected directory differs by version: `$PNPM_HOME` for pnpm <= 8, `$PNPM_HOME/bin` for pnpm >= 9 (default `~/.local/share/pnpm[/bin]`). The feature's `onCreateCommand` script runs in a non-interactive shell where rc-file exports are not loaded, so `pnpm config set store-dir --global` killed the container build (see [upstream issue #80](https://github.com/joshuanianji/devcontainer-features/issues/80) and [devcontainers-extra/features#218](https://github.com/devcontainers-extra/features/issues/218)). `oncreate.sh` now exports `PNPM_HOME` (defaulting to `~/.local/share/pnpm`) and prepends both `$PNPM_HOME/bin` and `$PNPM_HOME` to `PATH` before invoking pnpm. The feature is therefore self-sufficient — no `remoteEnv`/`containerEnv` workaround is needed in the consuming `devcontainer.json`, and project-local `pnpm install` works out of the box. - -### Global pnpm commands in your own shells - -The patch only fixes the environment for this feature's own script. If *you* run pnpm global commands (`pnpm add -g ...`) in container terminals or your own lifecycle scripts, those shells need the same environment. Declare it in your `devcontainer.json` (adjust the home directory to your `remoteUser`): - -```json -"containerEnv": { - "PNPM_HOME": "/home/vscode/.local/share/pnpm" -}, -"remoteEnv": { - "PATH": "/home/vscode/.local/share/pnpm/bin:${containerEnv:PATH}" -} -``` - -> [!WARNING] -> The `PATH` entry must go in `remoteEnv`, **not** `containerEnv`: the `${containerEnv:VAR}` substitution is only resolved in `remoteEnv`. Putting it in `containerEnv` sets the container's `PATH` to the literal unresolved string, which breaks every binary lookup (`sleep`, `sed`, ...) and makes the container exit immediately after start. - -## OS and Architecture Support - -Architectures: `amd` and `arm` - -OS: `ubuntu`, `debian` - -Shells: `bash`, `zsh`, `fish` - -## Important Implementation Details - -### pnpm `store-dir` - -This is opinionated, but having the pnpm store in the workspace along with your code 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`. There is a soft dependency on `ghcr.io/devcontainers/features/node` already, but if it is any other feature that installs pnpm you might need to put some extra work. - -To make this work, use the [`overrideFeatureInstallOrder` property](https://containers.dev/implementors/features/#overrideFeatureInstallOrder), since the default feature installation order is based on ID. Here is an example using a fake `unknown-install-pnpm`: - -```json - "image": "mcr.microsoft.com/devcontainers/base:bullseye", - "features": { - "ghcr.io/random-user/devcontainer-features/unknown-install-pnpm:1": {}, - "ghcr.io/itplusx/devcontainer-features/mount-pnpm-store:1": {} - }, - "overrideFeatureInstallOrder": [ - "ghcr.io/random-user/devcontainer-features/unknown-install-pnpm", - "ghcr.io/itplusx/devcontainer-features/mount-pnpm-store" - ] -``` - -### Volume Mount Naming - -The volume mount is called `global-devcontainer-pnpm-store` (same name as upstream, so the store is shared with containers using the upstream feature). Ensure that no other docker volumes match this name. - -## Changelog - -| Version | Notes | -| ------- | ---------------------------------------------------------------------------------- | -| 1.2.0 | Deprecated in favor of `shared-pnpm-store` | -| 1.1.0 | Copy to itplusx namespace; fix `oncreate.sh` for the pnpm global bin dir check | -| 1.0.2 | (upstream) Move onCreate lifecycle script to `oncreate.sh` | -| 1.0.1 | (upstream) Fix Docs | -| 1.0.0 | (upstream) Support zsh + refactor | - -## References - -- [Upstream feature by Joshua Ji](https://github.com/joshuanianji/devcontainer-features/tree/main/src/mount-pnpm-store) -- [Pnpm Devcontainer Setup by PatrickChoDev](https://gist.github.com/PatrickChoDev/81d36159aca4dc687b8c89983e64da2e) - - ---- - -_Note: This file was auto-generated from the [devcontainer-feature.json](https://github.com/itplusx/devcontainer-features/blob/main/src/mount-pnpm-store/devcontainer-feature.json). Add additional notes to a `NOTES.md`._ diff --git a/src/mount-pnpm-store/devcontainer-feature.json b/src/mount-pnpm-store/devcontainer-feature.json deleted file mode 100644 index 13bba2b..0000000 --- a/src/mount-pnpm-store/devcontainer-feature.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "Mount pnpm Store", - "id": "mount-pnpm-store", - "version": "1.2.0", - "deprecated": true, - "documentationURL": "https://github.com/itplusx/devcontainer-features/tree/main/src/mount-pnpm-store", - "description": "[DEPRECATED — use shared-pnpm-store instead] Sets pnpm store to ~/.pnpm-store and mounts it to a volume to share between multiple devcontainers. Patched fork of joshuanianji/devcontainer-features that works with pnpm >= 9 in non-interactive lifecycle shells.", - "options": {}, - "mounts": [ - { - "source": "global-devcontainer-pnpm-store", - "target": "/dc/mounted-pnpm-store", - "type": "volume" - } - ], - "installsAfter": [ - "ghcr.io/devcontainers/features/node", - "ghcr.io/devcontainers/features/common-utils", - "ghcr.io/meaningful-ooo/devcontainer-features/fish" - ], - "onCreateCommand": { - "mount-pnpm-store-setup": "/usr/local/share/mount-pnpm-store/scripts/oncreate.sh" - } -} diff --git a/src/mount-pnpm-store/install.sh b/src/mount-pnpm-store/install.sh deleted file mode 100755 index e6560c7..0000000 --- a/src/mount-pnpm-store/install.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/sh - -USERNAME=${USERNAME:-${_REMOTE_USER}} -FEATURE_ID="mount-pnpm-store" -LIFECYCLE_SCRIPTS_DIR="/usr/local/share/${FEATURE_ID}/scripts" - -set -e - -create_cache_dir() { - if [ -d "$1" ]; then - echo "Cache directory $1 already exists. Skip creation..." - else - echo "Create cache directory $1..." - mkdir -p "$1" - fi - - if [ -z "$2" ]; then - echo "No username provided. Skip chown..." - else - echo "Change owner of $1 to $2..." - chown -R "$2:$2" "$1" - fi -} - -create_symlink_dir() { - local local_dir=$1 - local cache_dir=$2 - local username=$3 - - runuser -u "$username" -- mkdir -p "$(dirname "$local_dir")" - runuser -u "$username" -- mkdir -p "$cache_dir" - - # if the folder we want to symlink already exists, the ln -s command will create a folder inside the existing folder - if [ -e "$local_dir" ]; then - echo "Moving existing $local_dir folder to $local_dir-old" - mv "$local_dir" "$local_dir-old" - fi - - echo "Symlink $local_dir to $cache_dir for $username..." - runuser -u "$username" -- ln -s "$cache_dir" "$local_dir" -} - -create_cache_dir "/dc/mounted-pnpm-store" "${USERNAME}" -create_symlink_dir "$_REMOTE_USER_HOME/.pnpm-store" "/dc/mounted-pnpm-store" "${USERNAME}" - -# Set Lifecycle scripts -if [ -f oncreate.sh ]; then - mkdir -p "${LIFECYCLE_SCRIPTS_DIR}" - cp oncreate.sh "${LIFECYCLE_SCRIPTS_DIR}/oncreate.sh" -fi - -echo "Finished installing $FEATURE_ID" diff --git a/src/mount-pnpm-store/oncreate.sh b/src/mount-pnpm-store/oncreate.sh deleted file mode 100755 index e210d46..0000000 --- a/src/mount-pnpm-store/oncreate.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh - -set -e - -# pnpm refuses --global commands (exit 1) when its global bin directory is -# not in PATH. This script runs as onCreateCommand in a non-interactive shell -# where rc-file exports are never loaded, so provide the environment here. -# The expected directory differs by pnpm version ($PNPM_HOME for pnpm <= 8, -# $PNPM_HOME/bin for pnpm >= 9), so put both on PATH; neither needs to exist -# for the check to pass. -export PNPM_HOME="${PNPM_HOME:-$HOME/.local/share/pnpm}" -export PATH="$PNPM_HOME/bin:$PNPM_HOME:$PATH" - -# set pnpm config (if it's installed) -if type pnpm >/dev/null 2>&1; then - echo "Setting pnpm store location to $HOME/.pnpm-store" - pnpm config set store-dir ~/.pnpm-store --global -else - echo "WARN: pnpm is not installed! Please ensure pnpm is installed and in your PATH." - echo "WARN: pnpm store location will not be set." -fi - -# if the user is not root, chown /dc/mounted-pnpm-store to the user -if [ "$(id -u)" != "0" ]; then - echo "Running post-start.sh for user $USER" - sudo chown -R "$USER:$USER" /dc/mounted-pnpm-store -fi diff --git a/src/shared-pnpm-store/NOTES.md b/src/shared-pnpm-store/NOTES.md index 7c2319c..2455017 100644 --- a/src/shared-pnpm-store/NOTES.md +++ b/src/shared-pnpm-store/NOTES.md @@ -19,8 +19,8 @@ It does this with four declarative pieces and **no pnpm invocation**: non-root user on every container create. Because pnpm is never invoked, this feature avoids the `pnpm config set --global` -/ `PNPM_HOME` / PATH / non-interactive-shell problems that `mount-pnpm-store` has -to patch. It is a simpler alternative; the two features are independent. +/ `PNPM_HOME` / PATH / non-interactive-shell problems that arise when a feature +has to configure pnpm from a non-interactive lifecycle shell. ## Ownership of the shared store @@ -56,9 +56,7 @@ depend on the interactive shell) ## Volume Mount Naming The volume is named `devcontainer-shared-pnpm-store`. Ensure no other Docker -volume collides with this name. (This is a different volume from -`mount-pnpm-store`'s `global-devcontainer-pnpm-store`, so the two features do -not share a store with each other.) +volume collides with this name. ## Changelog diff --git a/src/shared-pnpm-store/README.md b/src/shared-pnpm-store/README.md index 528ac14..af1a76e 100644 --- a/src/shared-pnpm-store/README.md +++ b/src/shared-pnpm-store/README.md @@ -38,8 +38,8 @@ It does this with four declarative pieces and **no pnpm invocation**: non-root user on every container create. Because pnpm is never invoked, this feature avoids the `pnpm config set --global` -/ `PNPM_HOME` / PATH / non-interactive-shell problems that `mount-pnpm-store` has -to patch. It is a simpler alternative; the two features are independent. +/ `PNPM_HOME` / PATH / non-interactive-shell problems that arise when a feature +has to configure pnpm from a non-interactive lifecycle shell. ## Ownership of the shared store @@ -75,9 +75,7 @@ depend on the interactive shell) ## Volume Mount Naming The volume is named `devcontainer-shared-pnpm-store`. Ensure no other Docker -volume collides with this name. (This is a different volume from -`mount-pnpm-store`'s `global-devcontainer-pnpm-store`, so the two features do -not share a store with each other.) +volume collides with this name. ## Changelog diff --git a/test/mount-pnpm-store/_default.sh b/test/mount-pnpm-store/_default.sh deleted file mode 100755 index 0beadc9..0000000 --- a/test/mount-pnpm-store/_default.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -set -e - -# Default test script that tests everything -# It is not run as a scenario, but is run by other test scripts. - -# Optional: Import test library -source dev-container-features-test-lib - -# user is `node` in dev container - -echo "User: $(whoami)" -pnpm config list - -# check that `pnpm config get store-dir` equals ~/.pnpm-store -pnpmConfig=$(pnpm config get store-dir) -echo "pnpm config get store-dir: '$pnpmConfig'" -check "config" test $pnpmConfig = "$(echo ~)/.pnpm-store" - -# check that the folders are owned by the user -# https://askubuntu.com/a/175060 -echo "Checking ownership of /dc/mounted-pnpm-store (ensure it is owned by $USER)" - -check "/dc/mounted-pnpm-store owned by user" bash -c "test \"$(stat -c "%U" /dc/mounted-pnpm-store)\" = $USER" - -# Report result -reportResults diff --git a/test/mount-pnpm-store/fish_shell.sh b/test/mount-pnpm-store/fish_shell.sh deleted file mode 100755 index ace33be..0000000 --- a/test/mount-pnpm-store/fish_shell.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -set -e - -# tests installing pnpm after zsh shell - -./_default.sh diff --git a/test/mount-pnpm-store/node_v2.sh b/test/mount-pnpm-store/node_v2.sh deleted file mode 100755 index 4acda07..0000000 --- a/test/mount-pnpm-store/node_v2.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -set -e - -# Regression test for the pnpm >= 9 global bin dir check: -# node feature v2 installs latest pnpm by default, which made the -# unpatched oncreate.sh fail the container build with -# "The configured global bin directory ... is not in PATH". -# Reaching this script at all proves onCreateCommand survived. - -# The test shell is non-interactive too, so it needs the same env -# the patched oncreate.sh provides for itself. -export PNPM_HOME="${PNPM_HOME:-$HOME/.local/share/pnpm}" -export PATH="$PNPM_HOME/bin:$PATH" - -./_default.sh diff --git a/test/mount-pnpm-store/pnpm_from_feature.sh b/test/mount-pnpm-store/pnpm_from_feature.sh deleted file mode 100755 index e9d42a7..0000000 --- a/test/mount-pnpm-store/pnpm_from_feature.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -set -e - -# tests installing pnpm through a feature - -./_default.sh diff --git a/test/mount-pnpm-store/root_user.sh b/test/mount-pnpm-store/root_user.sh deleted file mode 100755 index f6888a5..0000000 --- a/test/mount-pnpm-store/root_user.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -set -e - -# tests running as remoteUser=root - -source dev-container-features-test-lib - -# As root, oncreate.sh intentionally skips the chown, and the shared volume -# keeps whatever ownership a previous (non-root) container gave it — so the -# ownership check from _default.sh does not apply here. -pnpmConfig=$(pnpm config get store-dir) -echo "pnpm config get store-dir: '$pnpmConfig'" -check "config" test "$pnpmConfig" = "$(echo ~)/.pnpm-store" -check "store dir writable" test -w /dc/mounted-pnpm-store - -reportResults diff --git a/test/mount-pnpm-store/scenarios.json b/test/mount-pnpm-store/scenarios.json deleted file mode 100644 index d80c511..0000000 --- a/test/mount-pnpm-store/scenarios.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "with_node": { - "image": "mcr.microsoft.com/devcontainers/javascript-node:1-18", - "features": { - "mount-pnpm-store": {} - } - }, - "pnpm_from_feature": { - "image": "mcr.microsoft.com/devcontainers/base:bullseye", - "features": { - "ghcr.io/devcontainers/features/node:1": {}, - "mount-pnpm-store": {} - } - }, - "node_v2": { - "image": "mcr.microsoft.com/devcontainers/base:debian-12", - "features": { - "ghcr.io/devcontainers/features/node:2": {}, - "mount-pnpm-store": {} - } - }, - "zsh_shell": { - "image": "mcr.microsoft.com/devcontainers/javascript-node:1-18", - "features": { - "ghcr.io/devcontainers/features/common-utils:2": { - "configureZshAsDefaultShell": true - }, - "mount-pnpm-store": {} - } - }, - "fish_shell": { - "image": "mcr.microsoft.com/devcontainers/javascript-node:1-18", - "features": { - "ghcr.io/meaningful-ooo/devcontainer-features/fish:1": {}, - "mount-pnpm-store": {} - } - }, - "root_user": { - "image": "mcr.microsoft.com/devcontainers/javascript-node:1-18", - "features": { - "mount-pnpm-store": {} - }, - "remoteUser": "root" - } -} diff --git a/test/mount-pnpm-store/test.sh b/test/mount-pnpm-store/test.sh deleted file mode 100755 index 5b1a104..0000000 --- a/test/mount-pnpm-store/test.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -set -e - -# Optional: Import test library -source dev-container-features-test-lib - -# NOTE: this is an "auto-generated" test, which means it will be -# executed against an auto-generated devcontainer.json that -# includes the 'mount-pnpm-store' feature with no options. -# -# https://github.com/devcontainers/cli/blob/main/docs/features/test.md -# -# From my tests, this means the `pnpm` CLI will not be installed - -# check that `~/.pnpm-store` and `/dc/mounted-pnpm-store` exist` -check "config" bash -c "ls -la ~ | grep '.pnpm-store'" -check "dc" bash -c "ls -la /dc | grep 'mounted-pnpm-store'" - -# check that `~/.pnpm-store` is a symlink -# https://unix.stackexchange.com/a/96910 -check "~/.pnpm-store is a symlink" bash -c "test -L ~/.pnpm-store && test -d ~/.pnpm-store" - -# Report result -reportResults diff --git a/test/mount-pnpm-store/with_node.sh b/test/mount-pnpm-store/with_node.sh deleted file mode 100755 index 2f6c9ea..0000000 --- a/test/mount-pnpm-store/with_node.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -set -e - -# tests installing pnpm mount when pnpm is already installed in the base image - -./_default.sh diff --git a/test/mount-pnpm-store/zsh_shell.sh b/test/mount-pnpm-store/zsh_shell.sh deleted file mode 100755 index ace33be..0000000 --- a/test/mount-pnpm-store/zsh_shell.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -set -e - -# tests installing pnpm after zsh shell - -./_default.sh