-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat: a backendless demo build of the console, for shipvoice.dev/demo #7
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
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
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 |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| node_modules | ||
| dist | ||
| dist-demo | ||
| coverage | ||
| .env | ||
| .env.local | ||
|
|
||
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,25 @@ | ||
| # The public preview of the console: `pnpm build:demo`, which is | ||
| # `vite build --mode demo`. Loaded only in that mode, so `pnpm dev` and | ||
| # `pnpm build` are untouched by everything here. | ||
| # | ||
| # Committed on purpose, and it holds no secret: the preview has no backend, no | ||
| # database and no LiveKit project. Nothing in the built bundle makes a request. | ||
|
|
||
| # Swaps src/api.ts for src/demo/fixtures.ts (see vite.config.ts) and turns on | ||
| # the hash router, the preview banner, and the disabled test call. | ||
| VITE_DEMO=true | ||
|
|
||
| # Where the bundle is served from. Assets resolve against it, so the preview can | ||
| # be moved without touching code. | ||
| VITE_DEMO_BASE=/demo/console/ | ||
|
|
||
| # Pinned, so a developer's own frontend/.env cannot leak into a published | ||
| # preview: the agent name has to match the fixture agent, or the console draws a | ||
| # "names differ" warning about a worker that does not exist. | ||
| # | ||
| # VITE_TOKEN_ENDPOINT and VITE_API_BASE_URL are deliberately NOT set here. Both | ||
| # default to a localhost address, and neither default survives into this build: | ||
| # src/api.ts is not resolved at all, and src/lib/token-source.ts takes its | ||
| # refusing branch. Leaving them unset keeps "no localhost in dist-demo" a true | ||
| # test of that, instead of a fact about this file. | ||
| VITE_AGENT_NAME=assistant |
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,29 @@ | ||
| /** | ||
| * The one error type the console branches on. | ||
| * | ||
| * It lives apart from api.ts because it carries no URL and makes no request, | ||
| * and both the real client and the demo build's fixtures raise it. Two copies | ||
| * of the class would make `e instanceof ApiError` answer false across the seam, | ||
| * which is the check every page uses to tell a refusal from an outage. | ||
| */ | ||
| export class ApiError extends Error { | ||
| readonly status: number; | ||
|
|
||
| constructor(status: number, message: string) { | ||
| super(message); | ||
| this.name = "ApiError"; | ||
| this.status = status; | ||
| } | ||
|
|
||
| get isForbidden(): boolean { | ||
| return this.status === 401 || this.status === 403; | ||
| } | ||
|
|
||
| get isUnreachable(): boolean { | ||
| return this.status === 0 || this.status >= 500; | ||
| } | ||
|
|
||
| get isMissing(): boolean { | ||
| return this.status === 404; | ||
| } | ||
| } |
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Make the documented preview URL match the configured base path.
Line 46 states that the preview is served at
shipvoice.dev/demo.frontend/.env.demosetsVITE_DEMO_BASE=/demo/console/. If the site serves the documented path, the bundle requests assets from a different prefix.Update the documentation and deployment link to
/demo/console/, or changeVITE_DEMO_BASEand all deployment configuration together.🤖 Prompt for AI Agents