Skip to content

Makefile: resolve vp from the repo - #36671

Merged
naltatis merged 2 commits into
evcc-io:masterfrom
PeterPablo:pr/make-vp
Nov 28, 2026
Merged

naltatis merged 2 commits into
evcc-io:masterfrom
PeterPablo:pr/make-vp

Conversation

@PeterPablo

@PeterPablo PeterPablo commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Hardening for a fresh checkout. vp is a devDependency (package.json), so npm ci is all a clone needs — yet every ui recipe called bare vp, and check-vp answered a missing binary with "vp is not Vite+, see https://viteplus.dev/guide/#install-vp".

On a fresh clone that message is simply wrong: the tool is installed, in node_modules/.bin, where make does not look. Measured 2026-11-06 on macOS: make ui failed that way with node_modules present and a valid vp inside it.

Change. Resolve once — prefer node_modules/.bin/vp, fall back to a global install — and use it in every recipe. check-vp now names npm ci first, with the global install as the alternative.
#AI-ASSISTED (DeepSeek V4.1 Flash)

@github-actions github-actions Bot added the infrastructure Basic functionality label Nov 28, 2026

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="Makefile" line_range="72" />
<code_context>

 openapi::
-	vp run openapi
+	$(VP) run openapi

 # update the embedded IEEE vendor registry, the registry rejects the Go http client
</code_context>
<issue_to_address>
**Some tasks lose install guidance**

When neither `node_modules/.bin/vp` nor a global `vp` is available, `openapi`, `lint-ui`, `license-ui`, and `test-ui` invoke `$(VP)` without depending on `check-vp`, so the missing-tool case produces a shell command-not-found error instead of the new `npm ci` guidance.

Add `check-vp` as a prerequisite to every Make target that invokes `$(VP)`.

Also at `Makefile:93`, `Makefile:108`, `Makefile:111`.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread Makefile Resolved
vp is a devDependency, so npm ci is all a fresh clone needs, yet the ui recipes
called bare vp and check-vp answered a missing binary by pointing at the global
install page. Resolve it once (node_modules/.bin/vp first, global fallback), use
it in every recipe, and give every target that needs it the check-vp
prerequisite so the guidance is reached instead of a plain command-not-found.
@naltatis naltatis changed the title make: resolve vp from the repo, and name the right remedy Makefile: resolve vp from the repo Nov 28, 2026
@naltatis

Copy link
Copy Markdown
Member

Thanks. Resolving the repo-local vp first matches the Vite+ docs, which treat the global CLI as optional.

I pushed a small follow-up:

  • error message back to a single line
  • separate messages for "vp not found" and "not Vite+"

Tested in a clean node:26 container without a global vp: npm ci, make install-ui and make ui all work, and both error cases print the right message. Also checked with make 3.81 on macOS.

🤖 Generated with Claude Code

@naltatis
naltatis enabled auto-merge (squash) November 28, 2026 19:09
@naltatis
naltatis merged commit 7431d17 into evcc-io:master Nov 28, 2026
14 checks passed
ElJeffe pushed a commit to ElJeffe/evcc that referenced this pull request Dec 4, 2026
Co-authored-by: PeterPablo <4340267+PeterPablo@users.noreply.github.com>
Co-authored-by: Michael Geers <michael@geers.tv>
@TobiasHuber1980

Copy link
Copy Markdown
Contributor

make ui fails on Windows since #36671.

Before the change the recipe was vp run build, which worked for me (make found the global vp via PATH). Now it runs node_modules/.bin/vp run build and fails as soon as node_modules/.bin/vp exists:

$ GOOS=linux GOARCH=arm64 make
node_modules/.bin/vp run build
Der Befehl "node_modules" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
make: *** [Makefile:62: ui] Error 1

(German cmd.exe message: 'node_modules' is not recognized as an internal or external command.)

Setup: Windows, GNU Make 4.4.1 (Chocolatey), started from Git Bash, dependencies installed via make install-ui. The default target runs ui first, so a plain make stops there. check-vp passes (it uses ||, so it runs through sh). Only the plain $(VP) run build line fails.

What I found: for a line without shell operators, make looks the program up as .exe, .cmd, .bat, then without extension. In node_modules/.bin it therefore finds vp.cmd, which Windows runs through cmd.exe, and cmd.exe reads the / in node_modules/.bin/vp as a switch. The same happens with a plain foo.cmd in any directory. A .exe with forward slashes works, and so does node_modules\.bin\vp with backslashes. A line containing && runs through sh and works too. The other plain $(VP) ... lines (install-ui, openapi, lint-ui, license-ui, test-ui) should be affected the same way, I only tried ui.

Workaround: with a global vp installed, this works:

GOOS=linux GOARCH=arm64 make VP=vp

Would it make sense to use backslashes for the repo-local path on Windows, or is overriding VP the intended workaround?

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infrastructure Basic functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants