-
Notifications
You must be signed in to change notification settings - Fork 146
Add update-available notifications across the CLI, web shell, and desktop app #1182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
3a74723
Add update-available notifications to the CLI and desktop app
RhysSullivan e5fe757
Serve the update endpoint on Cloudflare and Docker self-host
RhysSullivan 392add7
Show the update card in the multiplayer shell (self-host, Cloudflare,…
RhysSullivan 8f4e7aa
Upgrade affordance per deployment, not npm everywhere
RhysSullivan aab73a1
Address review: fix update-status race, guard fake seam, negative-cac…
RhysSullivan a39e290
Merge remote-tracking branch 'origin/main' into feat/cli-update-notice
RhysSullivan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| --- | ||
| "executor": minor | ||
| "@executor-js/desktop": minor | ||
| "@executor-js/api": minor | ||
| "@executor-js/react": minor | ||
| --- | ||
|
|
||
| Notify when a newer Executor is published. The CLI now prints an "update available" line under its ready banner, and the web shell's sidebar update card works for real (a new `/v1/app/npm/dist-tags` endpoint backs it). In the desktop app the card shows a native "Restart to update" action wired to the in-app updater instead of the npm command. The check is best-effort and offline-safe, and can be disabled with `EXECUTOR_DISABLE_UPDATE_CHECK`. |
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| // Wire contract for the desktop auto-update status the main process pushes to | ||
| // the renderer (and the renderer's "install now" request back). The web shell | ||
| // shows a desktop-native UpdateCard from this instead of the npm command it | ||
| // shows on web/CLI installs, because the desktop updates via electron-updater | ||
| // (GitHub releases, swapped in place), not `npm i -g`. | ||
| // | ||
| // The renderer carries a structurally identical view of this union at | ||
| // `@executor-js/react/hooks/desktop-update` (the IPC boundary is plain JSON, so | ||
| // each side owns its own copy rather than reaching across package roots). | ||
|
|
||
| export type DesktopUpdateStatus = | ||
| | { readonly state: "idle" } | ||
| | { readonly state: "available"; readonly version: string } | ||
| | { readonly state: "downloading"; readonly version: string; readonly percent: number } | ||
| | { readonly state: "downloaded"; readonly version: string } | ||
| | { readonly state: "installing"; readonly version: string }; | ||
|
|
||
| /** Push channel: main → renderer, whenever the update status changes. */ | ||
| export const UPDATE_STATUS_CHANNEL = "executor:updates:status" as const; | ||
| /** Invoke channel: renderer → main, read the current status once on mount. */ | ||
| export const UPDATE_STATUS_GET_CHANNEL = "executor:updates:status:get" as const; | ||
| /** Invoke channel: renderer → main, apply a downloaded update and restart. */ | ||
| export const UPDATE_INSTALL_CHANNEL = "executor:updates:quit-and-install" as const; |
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| // Cloudflare-only: the update card paints on the Cloudflare-served web shell | ||
| // (Workers Static Assets + the Worker route). See ../src/update-card-render.ts | ||
| // for the shared body. | ||
| import { registerUpdateCardRenderScenario } from "../src/update-card-render"; | ||
|
|
||
| registerUpdateCardRenderScenario( | ||
| "Cloudflare · the web shell sidebar surfaces the update-available card", | ||
| ); |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| // Cloudflare-only: the update check's `/v1/app/npm/dist-tags` must reach the | ||
| // Worker and answer JSON. On Cloudflare the SPA is served by Workers Static | ||
| // Assets, which return index.html for any path NOT in `run_worker_first` | ||
| // (wrangler.jsonc) — so without `/v1/*` listed there, this path 200s with HTML | ||
| // and the client's JSON parse fails (the sidebar UpdateCard stays dark). This | ||
| // pins that the asset layer forwards `/v1/*` to the Worker. The body is the live | ||
| // dist-tags (possibly empty); reachability is the contract here. | ||
| import { expect } from "@effect/vitest"; | ||
| import { Effect } from "effect"; | ||
|
|
||
| import { scenario } from "../src/scenario"; | ||
| import { Target } from "../src/services"; | ||
|
|
||
| scenario( | ||
| "Cloudflare · the update dist-tags endpoint answers JSON, not the SPA fallback", | ||
| { timeout: 60_000 }, | ||
| Effect.gen(function* () { | ||
| const target = yield* Target; | ||
| const res = yield* Effect.promise(() => fetch(`${target.baseUrl}/v1/app/npm/dist-tags`)); | ||
| expect(res.status, "the endpoint responds 200").toBe(200); | ||
| expect( | ||
| res.headers.get("content-type") ?? "", | ||
| "forwarded to the Worker (run_worker_first), not the SPA index.html", | ||
| ).toContain("application/json"); | ||
| const body = (yield* Effect.promise(() => res.json())) as Record<string, unknown>; | ||
| expect(typeof body, "the body is a JSON object of dist-tags").toBe("object"); | ||
| }), | ||
| ); |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.