GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Add global binary `vp` and delegate to `vite-plus` by webpro · Pull Request #4 · voidzero-dev/vite-plus Conversation
webpro
commented
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using built-in arg parser is "good enough" imho, and would also work with e.g. Bun.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's revisit this when we want to proxy help messages from the tools.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
webpro
commented
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using the built-in arg parser is nice for zero-dependencies in global package.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
webpro
force-pushed
the
feat/add-global-cli
branch
from
4d2efaf to
40fd91b
Compare
sxzz
reviewed
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure the compatibility of pnpm
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
wan9chi
reviewed
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is our dev experience for vite+? Should we start it directly from the source with
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great point, using verdaccio I was only doing the "real" thing. How about having
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's revisit this when we want to proxy help messages from the tools.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
webpro
commented
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is just dummy "task orchestrator", can only handle one task from CLI e.g.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great point, using verdaccio I was only doing the "real" thing. How about having
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
wan9chi
approved these changes
fengmk2
added a commit
that referenced
this pull request
- Update status from "Draft" to "Implemented" - Fix Code Sharing table: all install functions are in vite_setup::install, not separate submodules - Fix Dependency Graph: remove junction (indirect via vite_setup), add actual deps (vite_path, owo-colors) - Fix Customization submenu to match code (numbered items, no install dir) - Replace winreg code sample with raw FFI description (matches implementation) - Replace windows_sys DLL sample with raw FFI (matches implementation) - Remove winreg from Binary Size Budget, add raw FFI note - Fix Alternatives #4: raw FFI, not winreg - Fix CI snippets: rename vite-init to vp-setup, update test workflow to match actual test-vp-setup-exe job - Mark Implementation Phases 1-3 as done, Phase 4 as future
fengmk2
added a commit
that referenced
this pull request
- Update status from "Draft" to "Implemented" - Fix Code Sharing table: all install functions are in vite_setup::install, not separate submodules - Fix Dependency Graph: remove junction (indirect via vite_setup), add actual deps (vite_path, owo-colors) - Fix Customization submenu to match code (numbered items, no install dir) - Replace winreg code sample with raw FFI description (matches implementation) - Replace windows_sys DLL sample with raw FFI (matches implementation) - Remove winreg from Binary Size Budget, add raw FFI note - Fix Alternatives #4: raw FFI, not winreg - Fix CI snippets: rename vite-init to vp-setup, update test workflow to match actual test-vp-setup-exe job - Mark Implementation Phases 1-3 as done, Phase 4 as future
fengmk2
added a commit
that referenced
this pull request
- Update status from "Draft" to "Implemented" - Fix Code Sharing table: all install functions are in vite_setup::install, not separate submodules - Fix Dependency Graph: remove junction (indirect via vite_setup), add actual deps (vite_path, owo-colors) - Fix Customization submenu to match code (numbered items, no install dir) - Replace winreg code sample with raw FFI description (matches implementation) - Replace windows_sys DLL sample with raw FFI (matches implementation) - Remove winreg from Binary Size Budget, add raw FFI note - Fix Alternatives #4: raw FFI, not winreg - Fix CI snippets: rename vite-init to vp-setup, update test workflow to match actual test-vp-setup-exe job - Mark Implementation Phases 1-3 as done, Phase 4 as future
fengmk2
added a commit
that referenced
this pull request
- Update status from "Draft" to "Implemented" - Fix Code Sharing table: all install functions are in vite_setup::install, not separate submodules - Fix Dependency Graph: remove junction (indirect via vite_setup), add actual deps (vite_path, owo-colors) - Fix Customization submenu to match code (numbered items, no install dir) - Replace winreg code sample with raw FFI description (matches implementation) - Replace windows_sys DLL sample with raw FFI (matches implementation) - Remove winreg from Binary Size Budget, add raw FFI note - Fix Alternatives #4: raw FFI, not winreg - Fix CI snippets: rename vite-init to vp-setup, update test workflow to match actual test-vp-setup-exe job - Mark Implementation Phases 1-3 as done, Phase 4 as future
fengmk2
added a commit
that referenced
this pull request
- Update status from "Draft" to "Implemented" - Fix Code Sharing table: all install functions are in vite_setup::install, not separate submodules - Fix Dependency Graph: remove junction (indirect via vite_setup), add actual deps (vite_path, owo-colors) - Fix Customization submenu to match code (numbered items, no install dir) - Replace winreg code sample with raw FFI description (matches implementation) - Replace windows_sys DLL sample with raw FFI (matches implementation) - Remove winreg from Binary Size Budget, add raw FFI note - Fix Alternatives #4: raw FFI, not winreg - Fix CI snippets: rename vite-init to vp-setup, update test workflow to match actual test-vp-setup-exe job - Mark Implementation Phases 1-3 as done, Phase 4 as future
fengmk2
added a commit
that referenced
this pull request
- Update status from "Draft" to "Implemented" - Fix Code Sharing table: all install functions are in vite_setup::install, not separate submodules - Fix Dependency Graph: remove junction (indirect via vite_setup), add actual deps (vite_path, owo-colors) - Fix Customization submenu to match code (numbered items, no install dir) - Replace winreg code sample with raw FFI description (matches implementation) - Replace windows_sys DLL sample with raw FFI (matches implementation) - Remove winreg from Binary Size Budget, add raw FFI note - Fix Alternatives #4: raw FFI, not winreg - Fix CI snippets: rename vite-init to vp-setup, update test workflow to match actual test-vp-setup-exe job - Mark Implementation Phases 1-3 as done, Phase 4 as future
fengmk2
added a commit
that referenced
this pull request
- Update status from "Draft" to "Implemented" - Fix Code Sharing table: all install functions are in vite_setup::install, not separate submodules - Fix Dependency Graph: remove junction (indirect via vite_setup), add actual deps (vite_path, owo-colors) - Fix Customization submenu to match code (numbered items, no install dir) - Replace winreg code sample with raw FFI description (matches implementation) - Replace windows_sys DLL sample with raw FFI (matches implementation) - Remove winreg from Binary Size Budget, add raw FFI note - Fix Alternatives #4: raw FFI, not winreg - Fix CI snippets: rename vite-init to vp-setup, update test workflow to match actual test-vp-setup-exe job - Mark Implementation Phases 1-3 as done, Phase 4 as future
Brooooooklyn
added a commit
that referenced
this pull request
…tability #3 (migrator): a monorepo root injects vite-plus before rewritePackageJson, so existingVitePlus is truthy and a root with a vitest-adjacent dep (e.g. vitest-browser-svelte, whose vitest peer is non-optional) never got a direct vitest pin — unresolvable under pnpm strict / Yarn PnP. Fold isVitestAdjacent into needDirectVitest so the pin is added independent of vite-plus presence. Flip the stale "stays undefined" test, add a genuine-normalize-pass test, and add a migration-monorepo-root-vitest-adjacent fixture. #1 (snap masking): replaceUnstableOutput only masked @/slash/whitespace-prefixed semver, so JSON "vitest": "4.1.9" (bun catalog, devDeps) churned on every daily bump while YAML vitest: 4.1.9 was already masked. Mask vitest-family JSON pins to <semver>, but only major >= 4 (the migrator-supported range) so unsupported pre-4 echoes like "vitest": "3.2.4" stay visible to prove a refused migration left package.json untouched. Exclude @vitest/coverage-* (user-owned peers vite-plus never pins; define-config.ts guards their exact version). #2 (upgrade-deps): the daily bump rewrote VITEST_VERSION, the catalog, and the vp-create workflow but left README.md's hardcoded manual-migration vitest pins stale. Add updateReadmeVitestPins (root + cli mirror), asserting exactly 2 JSON + 1 YAML pins per file so a reworded section fails loudly like the other updaters. #4 (upgrade.md): document that after upgrading vite-plus users must re-pin vitest to the bundled version (vp --version) or rerun vp migrate, and where the pin lives per package manager (incl. the package.json pnpm.overrides case). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
fengmk2
added a commit
that referenced
this pull request
#### Problem `HttpClient::get_bytes` read the response body (`response.bytes().await`) **outside** the retry. The retry only wrapped request setup (`send().await?.error_for_status()`), which resolves as soon as the response *headers* arrive — so a connection dropped mid-body (a response truncated relative to its advertised `Content-Length`) surfaced as a hard error that was **never retried**. `download_file` already handles this by streaming the body inside its retry and checking `Content-Length`. `get_bytes` is the download path for the **platform tarball** in: - `vp upgrade` — `crates/vite_global_cli/src/commands/upgrade` - the standalone installer — `crates/vite_installer` So a transient mid-body drop (flaky wifi, a proxy/CDN closing the connection early) failed the upgrade/install outright with `… end of file before message length reached`, even though a single retry would usually succeed. Node-runtime and package-manager tarball downloads (which go through `download_file`) already retried. #### Fix Read the body **inside** the retried closure — one send+body unit, mirroring `download_file` — so a mid-body drop is retried. The now-unused private `get` / `get_with_accept` helpers are removed (`get_with_accept` was only ever called with `accept = None`). #### Test `test_get_bytes_retries_on_truncated_body`: a raw `tokio` TCP server truncates the first response (advertises the full `Content-Length`, sends half the body, drops the connection) and serves the full body on the retry. Against the old code it fails with hyper `IncompleteBody` after **1** attempt; with the fix it succeeds after **2**. #### Reproduce end-to-end with `vp upgrade` A mock registry truncates the platform tarball on **every** request. The fixed `get_bytes` retries (4 tarball hits); the old one gives up after 1. ```bash # build vp from this branch cargo build -p vite_global_cli # terminal A — truncating mock registry (script below) node mock-registry.js # terminal B — a real upgrade against it # NO_PROXY is needed if you run a local/system HTTP proxy, so loopback isn't intercepted NO_PROXY=127.0.0.1,localhost target/debug/vp upgrade --registry http://127.0.0.1:8911 --force ``` Watch terminal A's `[tarball] hit #N`: | build | terminal A | result | | --- | --- | --- | | this branch (fixed) | `hit #1 #2 #3 #4` — retried | `Failed to download platform package: … end of file before message length reached` | | before the fix | `hit #1` — no retry | same error | Both end with the same error (the mock always truncates); the **hit count** is the difference — on a real flaky network the retry usually succeeds on attempt 2–4. <details> <summary><code>mock-registry.js</code></summary> ```js // Truncates the platform tarball on every request (advertises a full // Content-Length, sends a few bytes, drops the connection). Fixed get_bytes // retries -> 4 tarball hits; the buggy one does not -> 1 hit. const http = require('http'); const PORT = Number(process.env.PORT || 8911); const VERSION = '9.9.9'; const FULL = 4096; // advertised Content-Length const SENT = 100; // bytes actually sent before the drop let tarballHits = 0; function meta(tarballPath) { return JSON.stringify({ version: VERSION, dist: { tarball: `http://127.0.0.1:${PORT}${tarballPath}`, integrity: 'sha512-AAAA', // never reached: the download always fails first }, }); } const server = http.createServer((req, res) => { const url = req.url; // Platform tarball: truncate every time. if (url === '/platform.tgz') { tarballHits += 1; console.log(`[tarball] hit #${tarballHits} -> send ${SENT}/${FULL} bytes then drop the connection`); const sock = res.socket; sock.write( 'HTTP/1.1 200 OK\r\n' + 'Content-Type: application/octet-stream\r\n' + `Content-Length: ${FULL}\r\n` + 'Connection: close\r\n' + '\r\n', ); sock.write(Buffer.alloc(SENT, 0x41)); setTimeout(() => sock.destroy(), 80); // flush, then mid-body connection drop return; } console.log(`[meta] ${req.method} ${url}`); // Platform package metadata: /@voidzero-dev/vite-plus-cli-<suffix>/<version> if (url.includes('/vite-plus-cli-')) { res.writeHead(200, { 'content-type': 'application/json' }); res.end(meta('/platform.tgz')); return; } // Main package metadata: /vite-plus/<tag-or-version> if (url.startsWith('/vite-plus/')) { res.writeHead(200, { 'content-type': 'application/json' }); res.end(meta('/main.tgz')); return; } res.writeHead(404, { 'content-type': 'text/plain' }); res.end('not found'); }); server.listen(PORT, '127.0.0.1', () => { console.log(`mock registry listening on http://127.0.0.1:${PORT}`); }); ``` </details> 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: MK (fengmk2) <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reviewers+1 more reviewerUh oh!
There was an error while loading. Please reload this page. AssigneesLabels
None yet
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. 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. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||