Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.{bats,sh,yml,yaml}]
indent_size = 2
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
tests/ export-ignore
.github/ export-ignore
.gitattributes export-ignore
.editorconfig export-ignore
10 changes: 7 additions & 3 deletions commands/web/pnpm
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ fi

# If a $PNPM_DIRECTORY is set, run our PNPM commands in that directory
if [ -n "$PNPM_DIRECTORY" ]; then
pnpm --dir "$PNPM_DIRECTORY" "$@"
else
pnpm "$@"
mkdir -p "$DDEV_APPROOT/$PNPM_DIRECTORY"
cd "$DDEV_APPROOT/$PNPM_DIRECTORY" || {
echo "Error: Failed to change directory to '$DDEV_APPROOT/$PNPM_DIRECTORY'." >&2
exit 1
}
fi

pnpm "$@"
6 changes: 3 additions & 3 deletions tests/test.bats
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ health_checks() {
assert_file_exist package.json
fi

run ddev pnpm link
run ddev pnpm link .
assert_success
}

Expand Down Expand Up @@ -126,7 +126,7 @@ teardown() {
# Verify is-odd@3.0.1 is stored in the global cache after installing
run ddev pnpm install
assert_success
run ddev exec bash -c "grep -r 'is-odd' /mnt/ddev-global-cache/pnpm 2>/dev/null | grep '3.0.1'"
run ddev exec bash -c "grep -R 'is-odd' /mnt/ddev-global-cache/pnpm 2>/dev/null | grep '3.0.1'"
assert_success

# Install the same package version from a second directory and verify it is reused from cache
Expand All @@ -141,7 +141,7 @@ teardown() {
run ddev exec bash -c "cd /var/www/html/third && pnpm install"
assert_success

run ddev exec bash -c "grep -r 'is-odd' /mnt/ddev-global-cache/pnpm 2>/dev/null | grep '2.0.0'"
run ddev exec bash -c "grep -R 'is-odd' /mnt/ddev-global-cache/pnpm 2>/dev/null | grep '2.0.0'"
assert_success

run ddev exec bash -c "node -e \"console.log(require('/var/www/html/third/node_modules/is-odd/package.json').version)\""
Expand Down
1 change: 0 additions & 1 deletion tests/testdata/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"keywords": [],
"author": "",
"license": "ISC",
"packageManager": "pnpm@10.5.2",
"dependencies": {
"is-odd": "3.0.1"
}
Expand Down
4 changes: 2 additions & 2 deletions web-build/Dockerfile.pnpm
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ RUN (command -v pnpm >/dev/null 2>&1 || npm install --global pnpm) && \
PNPM_SCRIPT=$(printf '%s\n' \
'export PNPM_HOME="/mnt/ddev-global-cache/pnpm"' \
'case ":$PATH:" in' \
' *":$PNPM_HOME:"*) ;;' \
' *) PATH="$PNPM_HOME:$PATH" ;;' \
' *":$PNPM_HOME/bin:"*) ;;' \
' *) PATH="$PNPM_HOME/bin:$PATH" ;;' \
'esac' \
'export PATH') && \
echo "$PNPM_SCRIPT" >> /etc/bash.bashrc && \
Expand Down