Skip to content

chore(ZMS): add husky git hooks#1872

Merged
ThomasAFink merged 30 commits into
mainfrom
chore-zmskvr-add-husky-git-hook
Jun 3, 2026
Merged

chore(ZMS): add husky git hooks#1872
ThomasAFink merged 30 commits into
mainfrom
chore-zmskvr-add-husky-git-hook

Conversation

@Fabinatix97
Copy link
Copy Markdown
Member

@Fabinatix97 Fabinatix97 commented Jan 29, 2026

Pull Request Checklist (Feature Branch to next):

  • Ich habe die neuesten Änderungen aus dem next Branch in meinen Feature-Branch gemergt.
  • Das Code-Review wurde abgeschlossen.
  • Fachliche Tests wurden durchgeführt und sind abgeschlossen.

Summary by CodeRabbit

  • New Features

    • Enforces conventional commit-message format and blocks invalid commits.
    • Runs pre-commit checks (Vue lint, docs formatting, PHP code checks) with clear pass/fail/skip messaging.
  • Documentation

    • Added comprehensive Git hooks (Husky) guides and updated README and localized docs with setup, troubleshooting, and examples.
  • Chores

    • Added Husky setup and a one-time prepare script to enable hooks.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 29, 2026

Review Change Stack

Warning

Review limit reached

@ThomasAFink, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 21 minutes and 29 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2db09b53-6763-4f0a-be82-0715a06682a0

📥 Commits

Reviewing files that changed from the base of the PR and between a5f2abc and 1b856c2.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (9)
  • .gitignore
  • .husky/README.md
  • .husky/commit-msg
  • .husky/pre-commit
  • .husky/validate-commit-message.sh
  • README.md
  • docs/de/setup-and-development/git-hooks.md
  • docs/en/setup-and-development/git-hooks.md
  • package.json
📝 Walkthrough

Walkthrough

Adds Husky hooks and onboarding: commit-msg validation, pre-commit Vue lint + docs format + PHPCS container checks, package.json prepare/devDependency, README and localized docs/sidebar updates.

Changes

Husky Git Hooks

Layer / File(s) Summary
Prepare script and devDependency; README note
zmscitizenview/package.json, README.md, .husky/README.md
Adds prepare script and husky@^9.1.7 to zmscitizenview package.json and documents an optional one-time npm run prepare step in README; adds .husky/README.md onboarding.
Commit message enforcement hook
.husky/commit-msg
Adds POSIX commit-msg hook validating the first-line subject (merge commits exempt) against type(PROJECT[-ticket]?): <message> where type ∈ {feat,fix,clean,chore,docs} and PROJECT ∈ {ZMS,ZMSKVR,MPDZBS,MUXDBS,GH}; prints colorized guidance on failure.
Pre-commit checks: Vue lint + docs formatting + PHPCS
.husky/pre-commit
Adds pre-commit script that runs npm run lint in zmscitizenview, runs npm run format:check in docs/, detects zms-web container (podman/docker) and runs PHPCS inside it, fails commit on lint/format/PHPCS errors, and skips PHP checks with a warning when no container is found.
Sidebar and documentation
docs/.vitepress/config.mjs, docs/*
Adds localized sidebar entry for Git Hooks and full English/German docs for git-hooks, updates code-formatting and commit-message-convention pages to describe Husky behavior and optional ticket suffix in subjects.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped through hooks and README lines,
Prepared the repo for tidy signs,
Subjects checked and linting run,
Containers probed before commit's done,
A happy rabbit—code in fine designs!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding Husky git hooks to the repository. It is specific, clear, and concise.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore-zmskvr-add-husky-git-hook

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In @.husky/commit-msg:
- Around line 7-15: The script currently tests the entire commit message stored
in commit_msg against pattern, which lets a matching body line bypass an invalid
subject; change it to validate only the first line by reading the commit subject
(e.g., replace how commit_msg is populated with a read of only the first line
such as using head -n1 or sed -n '1p') and then run the grep -qE "$pattern"
check against that subject variable (keep pattern, commit_msg_file, and the
existing grep check names intact).

In @.husky/pre-commit:
- Around line 24-33: The script currently treats any non-zero exit from the
PHPCS container exec as a container failure because it uses `if !
phpcs_output=...; then`; change this to capture both the command output and its
exit code (e.g., assign `phpcs_output` from the exec and then save the exit
status in a variable like `phpcs_exit=$?`) and only consider it a container
execution error when the exit code indicates a real exec failure (3 or greater).
Allow PHPCS-specific exit codes 1 and 2 to proceed so `total_error_count`
(computed from `phpcs_output`) can be parsed and handled, and only print the raw
output and `exit 1` for unexpected exec errors (phpcs_exit >= 3). Ensure you
reference and update the `phpcs_output` and `phpcs_exit` handling around the
`container_engine exec zms-web ... "vendor/bin/phpcs ..."` invocation and keep
the subsequent `total_error_count` logic intact.

Comment thread .husky/commit-msg Outdated
Comment thread .husky/pre-commit Outdated
@ThomasAFink ThomasAFink changed the base branch from next to main February 2, 2026 11:50
@ThomasAFink ThomasAFink changed the title chore(ZMSKVR): add husky git hooks chore(ZMS): add husky git hooks May 22, 2026
Resolve README, zmscitizenview package, and lockfile conflicts.
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
README.md (1)

140-140: ⚡ Quick win

Consider adding a brief explanation of what Husky hooks do.

The instruction tells users HOW to enable Husky but not WHAT it does or WHY they should enable it. Developers may skip this step without understanding its value (automatic pre-commit linting that prevents committing code with style violations).

📝 Suggested enhancement for clarity
-- Run once to enable husky hooks (optional): `npm run prepare`
+- Run once to enable Git hooks (optional): `npm run prepare`
+  - Enables automatic pre-commit linting to catch code style issues before committing

or alternatively:

-- Run once to enable husky hooks (optional): `npm run prepare`
+- (Optional) Enable Husky Git hooks: `npm run prepare`
+  - Automatically runs lint checks before each commit to maintain code quality

As per coding guidelines, documentation should explain intent and be clear. The Clean Code principles emphasize that "code can be read and enhanced by a developer other than its original author" - this applies to documentation as well, where explanatory context helps developers understand the purpose of optional setup steps.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` at line 140, Update the README line about Husky (the "npm run
prepare" step) to include a short explanation of what Husky hooks do and why you
should enable them—for example, state that Husky installs Git hooks that run
pre-commit/pre-push tasks (automatic linting, tests, or formatters) to prevent
committing broken or nonconforming code; keep it brief and include that the step
is optional but recommended.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@README.md`:
- Line 140: Update the README line about Husky (the "npm run prepare" step) to
include a short explanation of what Husky hooks do and why you should enable
them—for example, state that Husky installs Git hooks that run
pre-commit/pre-push tasks (automatic linting, tests, or formatters) to prevent
committing broken or nonconforming code; keep it brief and include that the step
is optional but recommended.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 0a300bca-78d1-42e0-83ad-6e865aba9e47

📥 Commits

Reviewing files that changed from the base of the PR and between 8f0f239 and cf1794a.

📒 Files selected for processing (1)
  • README.md

Fabinatix97 and others added 16 commits June 2, 2026 13:36
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* chore(deps): bump jsdom from 26.1.0 to 29.1.1 in /zmscitizenview

Bumps [jsdom](https://github.com/jsdom/jsdom) from 26.1.0 to 29.1.1.
- [Release notes](https://github.com/jsdom/jsdom/releases)
- [Commits](jsdom/jsdom@v26.1.0...v29.1.1)

---
updated-dependencies:
- dependency-name: jsdom
  dependency-version: 29.1.1
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix(zmscitizenview): resolve SVG icon lookup for jsdom 29 selectors

Query use elements by xlink:href attribute instead of a CSS selector with
an unescaped colon, which jsdom 29 rejects as invalid syntax.

* fix(ZMS): type DOM queries in AppointmentPreview tests for strict TS

Cast wrapper.element to HTMLElement and annotate querySelector callbacks
so jsdom 29 icon lookup stays valid under strict TypeScript checking.

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: thomasafink <thomas.fink@muenchen.de>
Co-authored-by: Tom Fink <53316058+ThomasAFink@users.noreply.github.com>
Bumps [picomatch](https://github.com/micromatch/picomatch) from 2.3.2 to 4.0.4.
- [Release notes](https://github.com/micromatch/picomatch/releases)
- [Changelog](https://github.com/micromatch/picomatch/blob/master/CHANGELOG.md)
- [Commits](micromatch/picomatch@2.3.2...4.0.4)

---
updated-dependencies:
- dependency-name: picomatch
  dependency-version: 4.0.4
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
)

Bumps [@muenchen/muc-patternlab-vue](https://github.com/it-at-m/muc-patternlab-vue) from 9.0.2 to 10.0.0.
- [Release notes](https://github.com/it-at-m/muc-patternlab-vue/releases)
- [Commits](it-at-m/muc-patternlab-vue@v9.0.2...v10.0.0)

---
updated-dependencies:
- dependency-name: "@muenchen/muc-patternlab-vue"
  dependency-version: 10.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Parcel 2 cannot resolve the exports-only package layout; point imports at
dist/react-to-print.js so the CI Docker build succeeds after the 3.3.0 bump.
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…2503)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…tag to v9.8-1779886953 (#2504)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Drop legacy slim-psr7 and parcel-bundler-v2 GitLab sources so CI installs from Packagist/GitHub like the other modules.
Show the latest main zmsautomation GitHub Actions badge instead of dead GitLab pipeline badges per module.
ThomasAFink and others added 2 commits June 2, 2026 15:43
Replace Berlin GitLab badges and install instructions with current GitHub CI, coverage links, and monorepo setup steps.
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@zmscitizenview/package.json`:
- Line 22: The package.json currently lists "jsdom" as a runtime dependency;
move "jsdom": "^29.1.1" from dependencies to devDependencies so it’s only
installed for development/testing. Update zmscitizenview/package.json to remove
the jsdom entry under "dependencies" and add it under "devDependencies" instead,
keeping the same version string; this matches its usage in
zmscitizenview/vitest.config.ts where environment: "jsdom" is used and prevents
shipping jsdom to consumers.
- Line 16: Update package.json so the "prepare" script no longer fails when
devDependencies are omitted: guard the husky invocation in the "prepare" script
(currently "husky .husky") so it only runs if the husky binary is available
(e.g., short-circuit or check for command existence) and otherwise no-op; also
move "jsdom" from "dependencies" into "devDependencies" since it's only used for
Vitest setup/config and not runtime. Ensure you edit the "prepare" script and
the "dependencies"/"devDependencies" sections to reflect these changes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f81a5307-533d-4f74-bc2d-a063eb0d1019

📥 Commits

Reviewing files that changed from the base of the PR and between cf1794a and d665fb7.

⛔ Files ignored due to path filters (1)
  • zmscitizenview/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (3)
  • .husky/commit-msg
  • .husky/pre-commit
  • zmscitizenview/package.json
🚧 Files skipped from review as they are similar to previous changes (2)
  • .husky/commit-msg
  • .husky/pre-commit

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@zmscitizenview/package.json`:
- Line 22: The package.json currently lists "jsdom" as a runtime dependency;
move "jsdom": "^29.1.1" from dependencies to devDependencies so it’s only
installed for development/testing. Update zmscitizenview/package.json to remove
the jsdom entry under "dependencies" and add it under "devDependencies" instead,
keeping the same version string; this matches its usage in
zmscitizenview/vitest.config.ts where environment: "jsdom" is used and prevents
shipping jsdom to consumers.
- Line 16: Update package.json so the "prepare" script no longer fails when
devDependencies are omitted: guard the husky invocation in the "prepare" script
(currently "husky .husky") so it only runs if the husky binary is available
(e.g., short-circuit or check for command existence) and otherwise no-op; also
move "jsdom" from "dependencies" into "devDependencies" since it's only used for
Vitest setup/config and not runtime. Ensure you edit the "prepare" script and
the "dependencies"/"devDependencies" sections to reflect these changes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f81a5307-533d-4f74-bc2d-a063eb0d1019

📥 Commits

Reviewing files that changed from the base of the PR and between cf1794a and d665fb7.

⛔ Files ignored due to path filters (1)
  • zmscitizenview/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (3)
  • .husky/commit-msg
  • .husky/pre-commit
  • zmscitizenview/package.json
🚧 Files skipped from review as they are similar to previous changes (2)
  • .husky/commit-msg
  • .husky/pre-commit
🛑 Comments failed to post (2)
zmscitizenview/package.json (2)

16-16: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

Does npm execute the preparelifecycle duringnpm ci --omit=dev, and what does Husky recommend for projects where huskyis only a devDependency in a nestedpackage.json?

💡 Result:

Yes. npm runs the prepare lifecycle during npm ci, and --omit=dev does not disable lifecycle scripts—it only omits devDependencies from being installed on disk (while still affecting NODE_ENV=production for lifecycle scripts when dev is omitted) [1][2][3]. For Husky: Husky recommends avoiding installing/configuring husky in multiple nested package.json files, and instead using a single source of truth at the repository root (install husky only in the root package.json) [4]. If your project is in a subdirectory, Husky’s workaround is to create a root package.json (with husky and devDependencies.husky) and put hooks there so they are installed once for the whole repo, rather than relying on a nested package.json where husky might be omitted in production-only installs [4].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== package.json (relevant parts) =="
FILE="zmscitizenview/package.json"
if [ -f "$FILE" ]; then
  nl -ba "$FILE" | sed -n '1,120p'
else
  echo "Missing $FILE"
fi

echo
echo "== scripts.prepare occurrences =="
rg -n "\"prepare\"\\s*:" -S zmscitizenview/package.json || true

echo
echo "== husky and jsdom usage =="
rg -n "\\bhusky\\b|\\bjsdom\\b" -S zmscitizenview || true

Repository: it-at-m/eappointment

Length of output: 161


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== package.json (relevant parts) =="
FILE="zmscitizenview/package.json"
if [ -f "$FILE" ]; then
  nl -ba "$FILE" | sed -n '1,120p'
else
  echo "Missing $FILE"
fi

echo
echo "== scripts.prepare occurrences =="
rg -n "\"prepare\"\\s*:" -S zmscitizenview/package.json || true

echo
echo "== husky and jsdom usage (in zmscitizenview) =="
rg -n "\\bhusky\\b|\\bjsdom\\b" -S zmscitizenview || true

Repository: it-at-m/eappointment

Length of output: 161


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== check path =="
ls -la zmscitizenview/package.json || true
echo

echo "== show first 120 lines with line numbers =="
python3 - <<'PY'
path="zmscitizenview/package.json"
with open(path, "r", encoding="utf-8") as f:
    for i, line in enumerate(f, start=1):
        if i > 120: break
        print(f"{i:4d}\t{line.rstrip()}")
PY
echo

echo "== extract scripts.prepare exact line(s) =="
python3 - <<'PY'
import re
path="zmscitizenview/package.json"
with open(path, "r", encoding="utf-8") as f:
    for i, line in enumerate(f, start=1):
        if re.search(r'"prepare"\s*:', line):
            print(f"{i:4d}\t{line.rstrip()}")
PY
echo

echo "== rg: prepare / husky / jsdom (zmscitizenview) =="
rg -n "\"prepare\"\\s*:" zmscitizenview/package.json || true
rg -n "\\bhusky\\b|\\bjsdom\\b" zmscitizenview || true

Repository: it-at-m/eappointment

Length of output: 3942


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== root package.json (if exists) =="
ls -ლა package.json 2>/dev/null || true
if [ -f package.json ]; then
  python3 - <<'PY'
import json
p="package.json"
with open(p,encoding="utf-8") as f:
    data=json.load(f)
print("name:",data.get("name"))
print("scripts.prepare:", (data.get("scripts") or {}).get("prepare"))
print("devDependencies.husky:", (data.get("devDependencies") or {}).get("husky"))
print("dependencies.husky:", (data.get("dependencies") or {}).get("husky"))
print("workspaces:", data.get("workspaces"))
PY
fi

echo
echo "== jsdom import / JSDOM usage in zmscitizenview =="
rg -n "from ['\"]jsdom['\"]|require\\(['\"]jsdom['\"]\\)|new JSDOM\\b|\\bJSDOM\\b" zmscitizenview --hidden || true

echo
echo "== jsdom mentions in tests/config only (context) =="
rg -n "environment:\\s*['\"]jsdom['\"]|jsdom" zmscitizenview/vitest.config.ts zmscitizenview/tests/setup --hidden || true

Repository: it-at-m/eappointment

Length of output: 389


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== top-level .husky directory =="
ls -la .husky 2>/dev/null || echo "no .husky at repo root"
echo

echo "== any .husky directories (maxdepth 3) =="
find . -maxdepth 3 -type d -name ".husky" -print || true
echo

echo "== package.json files (maxdepth 3) =="
find . -maxdepth 3 -name package.json -print
echo

echo "== jsdom mentions in zmscitizenview (beyond vitest config/setup) =="
rg -n "\\bjsdom\\b|JSDOM" zmscitizenview --hidden --glob '!**/package-lock.json' || true

echo
echo "== husky mentions in repo =="
rg -n "\\bhusky\\b|\\.husky" . --hidden --glob '!**/node_modules/**' --glob '!**/dist/**' || true

Repository: it-at-m/eappointment

Length of output: 2131


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== husky refs in any package.json =="
rg -n "\"husky\"\\s*:|\\bhusky\\b" -S --glob '**/package.json' . || true
echo

echo "== prepare lifecycle scripts in any package.json =="
rg -n "\"prepare\"\\s*:" -S --glob '**/package.json' . || true

Repository: it-at-m/eappointment

Length of output: 354


Guard Husky hook bootstrap in prepare (and move jsdom to devDependencies)

  • zmscitizenview/package.json line 16 runs cd .. && husky .husky, but husky is only in devDependencies (line 39); npm ci --omit=dev still executes lifecycle scripts, so this install can fail when the husky binary isn’t present.
  • jsdom is in dependencies (line 22) but only referenced for Vitest setup/config, not in runtime imports—move it to devDependencies to avoid bloating consumers.
Possible localized fix
-    "prepare": "cd .. && husky .husky"
+    "prepare": "command -v husky >/dev/null 2>&1 && (cd .. && husky .husky) || true"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

    "prepare": "command -v husky >/dev/null 2>&1 && (cd .. && husky .husky) || true"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@zmscitizenview/package.json` at line 16, Update package.json so the "prepare"
script no longer fails when devDependencies are omitted: guard the husky
invocation in the "prepare" script (currently "husky .husky") so it only runs if
the husky binary is available (e.g., short-circuit or check for command
existence) and otherwise no-op; also move "jsdom" from "dependencies" into
"devDependencies" since it's only used for Vitest setup/config and not runtime.
Ensure you edit the "prepare" script and the "dependencies"/"devDependencies"
sections to reflect these changes.

22-22: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify whether jsdom is imported outside tests/tooling before moving it.
rg -n -C2 \
  --glob '!**/*.{test,spec}.{js,jsx,ts,tsx,mjs,cjs,vue}' \
  --glob '!**/test/**' \
  --glob '!**/tests/**' \
  --glob '!**/vitest.*' \
  --glob '!**/vite.config.*' \
  --glob '!**/package.json' \
  '\bfrom\s+["'\'']jsdom["'\'']|\brequire\(\s*["'\'']jsdom["'\'']\s*\)' \
  zmscitizenview .

Repository: it-at-m/eappointment

Length of output: 46


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== zmscitizenview/package.json (around jsdom) =="
# Print a small window around the jsdom entry
nl -ba zmscitizenview/package.json | sed -n '1,120p' | rg -n '"jsdom"' -n -C 3 || true
echo

echo "== Raw jsdom occurrences in zmscitizenview (excluding node_modules) =="
rg -n --hidden --no-ignore-vcs --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**' "jsdom" zmscitizenview . || true

echo
echo "== Look for other import/usage forms outside tests =="
# Catch dynamic require/import() patterns too; still exclude common test/tooling dirs/files
rg -n -C2 \
  --glob '!**/*.{test,spec}.{js,jsx,ts,tsx,mjs,cjs,vue}' \
  --glob '!**/test/**' \
  --glob '!**/tests/**' \
  --glob '!**/vitest.*' \
  --glob '!**/vite.config.*' \
  --glob '!**/package.json' \
  'jsdom' zmscitizenview . || true

Repository: it-at-m/eappointment

Length of output: 50437


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== jsdom line(s) in package.json =="
rg -n '"jsdom"\s*:' zmscitizenview/package.json

echo
echo "== Show top of package.json through devDependencies/dependencies area =="
# Print a bounded window around the jsdom line number range.
# Using sed; avoid `nl` (not available in sandbox).
sed -n '1,90p' zmscitizenview/package.json | rg -n '^|dependencies|devDependencies|jsdom' -n || true

echo
echo "== Wider context around jsdom line region (approx) =="
# jsdom was at line 22 per previous rg output
sed -n '10,60p' zmscitizenview/package.json

Repository: it-at-m/eappointment

Length of output: 4035


🏁 Script executed:

#!/bin/bash
set -euo pipefail
# Focus on the likely runtime source folder
rg -n --hidden --no-ignore-vcs --glob '!**/node_modules/**' \
  'jsdom' zmscitizenview/src zmscitizenview/*.ts zmscitizenview/*.tsx zmscitizenview/*.vue zmscitizenview/**/*.ts zmscitizenview/**/*.tsx zmscitizenview/**/*.vue \
  --glob '!**/tests/**' --glob '!**/test/**' --glob '!**/vitest.*' --glob '!**/vite.config.*' || true

Repository: it-at-m/eappointment

Length of output: 329


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Top-level entries in zmscitizenview =="
ls -la zmscitizenview

echo
echo "== Directories under zmscitizenview (maxdepth 2) =="
find zmscitizenview -maxdepth 2 -type d | sed 's|^\./||'

echo
echo "== jsdom references in zmscitizenview excluding tests + package.json + *.map =="
rg -n --hidden --no-ignore-vcs \
  'jsdom' zmscitizenview \
  --glob '!**/tests/**' --glob '!**/test/**' --glob '!**/package*.json' --glob '!**/*.map' || true

echo
echo "== Explicit jsdom import/require forms (excluding tests + package.json + config) =="
rg -n -C2 \
  --glob '!**/node_modules/**' \
  --glob '!**/tests/**' --glob '!**/test/**' \
  --glob '!**/package.json' \
  --glob '!**/vitest.*' \
  --glob '!**/vite.config.*' \
  '\bfrom\s+["'\''"]jsdom["'\''"]|\brequire\(\s*["'\''"]jsdom["'\''"]\s*\)|\bimport\s*\(\s*["'\''"]jsdom["'\''"]\s*\)' \
  zmscitizenview || true

Repository: it-at-m/eappointment

Length of output: 2944


Move jsdom to devDependencies (it’s only needed for tests)

zmscitizenview/package.json lists "jsdom": "^29.1.1" under dependencies, but runtime code doesn’t import jsdom; it’s only used by zmscitizenview/vitest.config.ts via environment: "jsdom" (Vitest DOM environment). Keep jsdom in devDependencies to avoid unnecessary runtime baggage for consumers.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@zmscitizenview/package.json` at line 22, The package.json currently lists
"jsdom" as a runtime dependency; move "jsdom": "^29.1.1" from dependencies to
devDependencies so it’s only installed for development/testing. Update
zmscitizenview/package.json to remove the jsdom entry under "dependencies" and
add it under "devDependencies" instead, keeping the same version string; this
matches its usage in zmscitizenview/vitest.config.ts where environment: "jsdom"
is used and prevents shipping jsdom to consumers.

@Fabinatix97 Fabinatix97 requested a review from ThomasAFink June 2, 2026 14:08
ThomasAFink
ThomasAFink previously approved these changes Jun 3, 2026
@ThomasAFink ThomasAFink merged commit 1b856c2 into main Jun 3, 2026
49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants