Skip to content

Commit 4df7474

Browse files
committed
fix: resolve jq syntax error and improve DDEV user detection
- Fix jq syntax error in package.json generation (remove parentheses around variable assignments) - Add vitest and @vitest/coverage-v8 to devDependencies blacklist - Improve DDEV user ID detection in git hooks to support macOS correctly - Rebuild integrate_booster.sh
1 parent 70a3114 commit 4df7474

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

booster/.husky/shared/core.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,13 +184,12 @@ async function getExecCommand(command: string[], type: string): Promise<string[]
184184
const containerPath = '/var/www/html'
185185

186186
// Determine User ID
187-
// On Linux, we use the host UID so file permissions match.
188-
// On macOS/Windows, DDEV handles permissions via filesystem mounts (VirtioFS/Mutagen),
189-
// so we use the default container user (1000) to ensure tools like Composer work correctly.
187+
// On Linux and macOS, we use the host UID so file permissions match.
188+
// On Windows, DDEV handles permissions via filesystem mounts, so we use default 1000.
190189
let uid = 1000
191190
let gid = 1000
192191

193-
if (process.platform === 'linux') {
192+
if (process.platform !== 'win32') {
194193
uid = process.getuid ? process.getuid() : 1000
195194
gid = process.getgid ? process.getgid() : 1000
196195
}

booster/integrate_booster.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -638,8 +638,8 @@ function update_package_json() {
638638
log "'$project_pkg' not found. Copying from booster..."
639639
# Filter scripts using whitelist and devDependencies using blacklist when creating new package.json
640640
jq '
641-
(["commit", "generate:api-doc:html", "prepare"] as $script_whitelist) |
642-
(["vitest"] as $dev_blacklist) |
641+
["commit", "generate:api-doc:html", "prepare"] as $script_whitelist |
642+
["vitest", "@vitest/coverage-v8"] as $dev_blacklist |
643643
.scripts |= with_entries(select(.key as $k | $script_whitelist | index($k))) |
644644
.devDependencies |= with_entries(select(.key as $k | ($dev_blacklist | index($k) | not)))
645645
' "$booster_pkg" > "$project_pkg" || error "Failed to create package.json using jq."
@@ -650,8 +650,8 @@ function update_package_json() {
650650
# This merges top-level objects like scripts, devDependencies
651651
jq -s '
652652
.[0] as $proj | .[1] as $booster |
653-
(["commit", "generate:api-doc:html", "prepare"] as $script_whitelist) |
654-
(["vitest"] as $dev_blacklist) |
653+
["commit", "generate:api-doc:html", "prepare"] as $script_whitelist |
654+
["vitest", "@vitest/coverage-v8"] as $dev_blacklist |
655655
656656
($booster.scripts // {} | with_entries(select(.key as $k | $script_whitelist | index($k)))) as $booster_scripts |
657657
($booster.devDependencies // {} | with_entries(select(.key as $k | ($dev_blacklist | index($k) | not)))) as $booster_dev_deps |
@@ -687,7 +687,7 @@ function update_package_json() {
687687
# Prefer pnpm-lock.dist.yaml (clean version without internal dev deps) if available
688688
local booster_pnpm_lock="${BOOSTER_INTERNAL_PATH}/pnpm-lock.yaml"
689689
local booster_dist_lock="${BOOSTER_INTERNAL_PATH}/pnpm-lock.dist.yaml"
690-
690+
691691
if [ -f "$booster_dist_lock" ]; then
692692
booster_pnpm_lock="$booster_dist_lock"
693693
fi

booster/src/lib/files.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ function update_package_json() {
156156
log "'$project_pkg' not found. Copying from booster..."
157157
# Filter scripts using whitelist and devDependencies using blacklist when creating new package.json
158158
jq '
159-
(["commit", "generate:api-doc:html", "prepare"] as $script_whitelist) |
160-
(["vitest"] as $dev_blacklist) |
159+
["commit", "generate:api-doc:html", "prepare"] as $script_whitelist |
160+
["vitest", "@vitest/coverage-v8"] as $dev_blacklist |
161161
.scripts |= with_entries(select(.key as $k | $script_whitelist | index($k))) |
162162
.devDependencies |= with_entries(select(.key as $k | ($dev_blacklist | index($k) | not)))
163163
' "$booster_pkg" > "$project_pkg" || error "Failed to create package.json using jq."
@@ -168,8 +168,8 @@ function update_package_json() {
168168
# This merges top-level objects like scripts, devDependencies
169169
jq -s '
170170
.[0] as $proj | .[1] as $booster |
171-
(["commit", "generate:api-doc:html", "prepare"] as $script_whitelist) |
172-
(["vitest"] as $dev_blacklist) |
171+
["commit", "generate:api-doc:html", "prepare"] as $script_whitelist |
172+
["vitest", "@vitest/coverage-v8"] as $dev_blacklist |
173173
174174
($booster.scripts // {} | with_entries(select(.key as $k | $script_whitelist | index($k)))) as $booster_scripts |
175175
($booster.devDependencies // {} | with_entries(select(.key as $k | ($dev_blacklist | index($k) | not)))) as $booster_dev_deps |

0 commit comments

Comments
 (0)