Add VitePress support to framework auto-port-injection#276
Open
alistair3149 wants to merge 1 commit intovercel-labs:mainfrom
Open
Add VitePress support to framework auto-port-injection#276alistair3149 wants to merge 1 commit intovercel-labs:mainfrom
alistair3149 wants to merge 1 commit intovercel-labs:mainfrom
Conversation
VitePress's CLI ignores the PORT env var and binds to its own default
(5173), so portless's allocated port goes unused and the proxy returns
404. VitePress wraps Vite's dev server (createServer destructures the
parsed argv and spreads it into Vite's server config), so --port,
--strictPort, and --host all flow through to Vite untouched.
Adds vitepress: { strictPort: true } to FRAMEWORKS_NEEDING_PORT,
matching the existing vite and vp entries. SvelteKit-style indirection
is not needed because vitepress is invoked as its own CLI command,
which is what findFrameworkBasename matches.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
@alistair3149 is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
vitepressto theFRAMEWORKS_NEEDING_PORTmap so portless auto-injects--port,--strictPort, and--hostfor VitePress dev servers, matching the existing behavior for plain Vite.Why
VitePress's CLI ignores the
PORTenv var and binds to its own default (5173), so the random port portless allocates goes unused and proxy requests return 404. Concretely, in a VitePress project:VitePress wraps Vite's dev server. In
vitepress/dist/node/chunk-*.js:Parsed argv flows through to Vite's
serverconfig unchanged, so--port,--strictPort, and--hostall behave the same as they do for plain Vite. SvelteKit-style indirection isn't needed here becausevitepressis the actual CLI basename;findFrameworkBasenamematches it directly.Changes
packages/portless/src/cli-utils.ts: addvitepress: { strictPort: true }to the framework map (one line)packages/portless/src/cli-utils.test.ts: add a unit test mirroring thevptestpackages/portless/src/cli.ts: list VitePress in the--helpframework enumerationREADME.mdandskills/portless/SKILL.md: list VitePress alongside Vite/VitePlus per AGENTS.md docs-update rulesTest plan
pnpm -C packages/portless exec vitest run src/cli-utils.test.tspasses (102 tests)injects ... for vitepress commandtest asserts the exact arg arraypnpm exec prettier --checkpasses on all modified filesvitepress@2.0.0-alpha.17: without this change, portless allocates a port that VitePress ignores and the proxy 404s; with this change applied locally, the named URL serves the dev server end-to-end