diff --git a/.agents/skills/dashboard-screenshots/SKILL.md b/.agents/skills/dashboard-screenshots/SKILL.md new file mode 100644 index 0000000000..8b3b8cb362 --- /dev/null +++ b/.agents/skills/dashboard-screenshots/SKILL.md @@ -0,0 +1,139 @@ +--- +name: dashboard-screenshots +description: One-shot recapture of Aspire dashboard screenshots for aspire.dev. Builds the dashboard from microsoft/aspire, runs a demo AppHost, drives playwright-cli to discover the existing images and capture each one in both themes, adds red callouts, and verifies framing and theme pairs. Use when the dashboard UX changed and the images under src/frontend/src/assets/dashboard need refreshing. +--- + +# Dashboard screenshots + +Regenerates dashboard images in place (same file names) so MDX needs no changes except for fixes reported by the verify step. + +## Run it + +```powershell +cd .agents\skills\dashboard-screenshots +bun install +bun scripts/run.ts +``` + +Prerequisites: git, bun, node, Edge, and `@playwright/cli` installed globally (`npm i -g @playwright/cli`). The script clones microsoft/aspire into `%TEMP%\aspire-dashboard-shots`, builds the demo AppHost in `demo\`, starts it, captures, verifies, writes a report, and tears everything down. + +Flags: + +| Flag | Meaning | +| --- | --- | +| `--branch ` | aspire branch to build. Default `main`: release branches may show an older dashboard UX. Confirm visually (e.g. the resources table has no left "Select all" pane). | +| `--only ` | capture only these shot ids | +| `--attach` | reuse an already running dashboard at http://localhost:17170 | +| `--keep` | do not tear down the dashboard or browser | +| `--inventory` | only write `inventory.csv` of existing images (size, theme, name) | + +## Discovery and recipes (no committed manifest) + +Every run starts with a discovery phase: it inventories `src/frontend/src/assets/dashboard`, scans the docs for who embeds each image, joins the images with the capture recipes in `scripts/recipes.ts`, and writes an ephemeral `shots.json` to the work dir (`%TEMP%\aspire-dashboard-shots\w`). The file is deleted when the run ends (kept only with `--keep`) and must never be committed. Discovery reports **UNMAPPED** images (exist, no recipe), **NEW** shots (recipe, no image yet) and **UNREFERENCED** images (no doc embeds them); resolve each before capturing. Add or fix recipes in `scripts/recipes.ts`, which holds only how to capture, not which images exist. + +Viewport 1280x800 at 2x, padding 16. Each shot has `id`, `out.dark`/`out.light`, `route`, optional `steps`, `callout`, `height`, `clip`, `autoCrop`, `keepAlerts`. + +Step types: `click` (text), `clickSel`, `hover`, `hoverSel`, `fill`, `press`, `wait`, `closeDialog`, `js` (raw playwright code with `page` in scope). `{{Theme}}` inside any step is replaced with `Dark` or `Light` for the current capture, so a single recipe can pick an explicit theme. Shot options: `also` (extra file names for the same capture), `thumb` (resized copy), `legacyLight` (skip the `-light` naming check when docs already use a different light filename). + +Runner behaviour: the cached clone is refreshed to the tip of `--branch` on every run; `--only a,b` matches each comma-separated id as a substring; failed attempts never reuse stale PNGs; `--keep` leaves the AppHost and the `shots` browser session open; cleanup only closes the `shots` session, never other playwright-cli sessions. + +## UX audit (do this BEFORE capturing) + +Recapturing is not enough: the UX may have gained surfaces the docs never showed (e.g. the Help dialog now has Documentation / Keyboard shortcuts / AI agents tabs; Settings gained new options). Run the audit against the live dashboard and treat it as the source of truth for what the docs should cover: + +1. `bun scripts/audit-ux.ts` writes `ux-audit.json` / `ux-audit.md` to the work dir: main tabs, header buttons, and for the Help, Settings and Recordings dialogs every tab plus its headings, switches, selects and buttons. +2. Compare against the previous release (run the audit on the old dashboard or read the old images) and list **new, removed and renamed** UI: tabs, dialog tabs, settings, toolbar buttons, graph controls. +3. For every new surface add a recipe to `scripts/recipes.ts` (one per dialog tab, one per new settings section, both themes) and a `ThemeImage` in the docs. +4. For every changed or replaced image, open the MDX that embeds it (`grep` for the filename) and re-read the surrounding prose, alt text and step lists. Fix anything that no longer matches the UI (button names, tab order, menu paths, removed features). Record each fix in the PR body under "UX changes". +5. Settings and Help are drawers/dialogs; audit tabs via `fluent-drawer-body` and `[role=tab]`/`fluent-tab`. Scroll long Settings content and capture each section. + +## Rules + +- **Themes**: capture every shot once per theme. Naming is `-.png` for dark (the default, never a `-dark` suffix) and `--light.png` for light only. Docs must use `` from `@components/ThemeImage.astro`; verify flags pages that reference only one theme. Fix those in MDX. +- **Alerts**: before each capture the script dismisses banners, toasts, welcome and update messages (`.dashboard-message-bar-dismiss`). Bars can arrive late or reappear after steps, so a final dismiss pass (plus a CSS hide of the message-bar provider) runs immediately before callouts and the screenshot. Always scan contact sheets (`sheet.ts`) for leftover bars, and sidebar drag/resize applies only to Graph and telemetry pages. Set `keepAlerts: true` only when the alert is the subject. The Notifications panel is not closed by Escape; use a fresh navigation. +- **Callouts**: red (`#e8212e`, ~3px) rectangles around the selector in `callout`, matching old images that had them. +- **Framing**: avoid large blank areas. Use `autoCrop` (not a small `height`) to trim trailing blank space, `clip` for regions. Keep resolution consistent. +- **Graph view**: Settings > Overview layout > Graph, close dialog, click the Overview tab. +- Row action buttons only appear on hover; hover first. + +## Windows playwright-cli quirks + +- Invoke `node \@playwright\cli\playwright-cli.js -s= run-code ""`. +- Screenshot paths must be absolute with forward slashes. +- Use `--browser=msedge`. No ffmpeg, so GIFs cannot be regenerated; report them as skipped. + +## Review phase (mandatory, after capturing, before committing) + +Scripted checks (`verify()`) are not enough. Look at every image and judge it: + +1. Build contact sheets (`bun scripts/sheet.ts `) and view each shot next to its original (`git show origin/release/17.0:`). +2. For each, answer: Does it show the same UI the docs' alt text and surrounding prose describe (right page, dialog, menu, state)? Is it the right theme for its filename? Are all message bars dismissed? Is it framed well (no big blank areas, not squashed, similar size to the original)? Should the sidebar be collapsed to give the content room (for example traces and landing console)? +3. Adjust the manifest (steps, route, callouts, `autoCrop`, collapse step) and recapture only the failing ids with `--attach --keep --only`. +4. Repeat until every image passes. Record anything you could not make right in the report. + +Review checklist per image: same subject as the original and the docs' alt text (compare against `git show origin/release/17.0:`); sidebar collapsed (`"collapseSidebar": true` or an explicit collapse step) unless the sidebar is the subject; no message bars or toasts; filters, menus and selections visible when the doc describes them; content rich enough (no trivial one-span traces or empty tables); no large blank areas; correct theme; `landing/*` exactly 2560x1600. + +## Rich demo telemetry + +The demo AppHost's `inventoryservice` exposes `/orders/{id}` with nested redis, postgres and rabbitmq spans, and the web traffic generator calls it regularly. Trace shots must open one of those traces (click the traces-list row `inventoryservice (6)`, then select a span via a `js` step using `getByText(...).locator('visible=true')`), not the default 2-span `/weatherforecast` trace. Wait about a minute after demo start for telemetry to accumulate. + +Capture-script lessons: reset `localStorage` only after navigating to the dashboard origin and before setting the theme cookie (otherwise `SecurityError` or a theme mismatch); fluent text fields cannot be `fill`ed, click then type; `--only` takes comma-separated id substrings and "trace" also matches `landing-trace-detail`, `traces-*` and `trace-view-*`. + +## Report + +The run prints captured/failed counts and lists unreproducible or skipped images (old UX concepts, terminals, Copilot/MCP dialogs, GIFs). Review captured images visually before committing. Never run `bun run build`; `git restore` any `.starlight-icons` churn. + +## Known selectors and gotchas + +- Console log "Download logs" lives in the log pane's settings (sliders) menu: `fluent-button.toolbar-button[aria-label='Settings']` (last). There is no toolbar Download button. +- Row actions: hover the row, then force-click `[aria-label='Actions for ']`; pick items with `getByRole('menuitem',{name})` and `click({force:true})`. Notifications bell is `getByRole('button',{name:'Notifications'})`. +- Resource sidebar: drag `.resource-pane-resizer`; collapse via "Collapse resource list", then use `.resource-picker-button` (Filter box, All resources, Ctrl+click multi-select, Shift+click range). +- Aspire Outage: `[aria-label='Play Aspire Outage']`; modes `.resource-graph-game-button` (Normal) / `.resource-graph-game-hardcore` (Hard); Esc exits. +- A final dismiss pass runs before every capture; message bars can reappear, so never capture without it. +- Error badge counts grow over time; recapture soon after startup. + +## Not captured by this manifest + +- Needs replicas (`console-logs-with-replicas`, `telemetry-resource-filter`): add `WithReplicas(2)` to the demo temporarily. +- Needs other setups: login, terminals, copilot, mcp-dialog, standalone, dashboard-run-selector, `trace-view-filter-advanced`, `trace-page-from-exemplars`, `project-graphs`, `settings-manage-telemetry`. +- Not dashboard captures: architecture diagrams, `.excalidraw` files, GIFs. + +## Dashboard images outside `assets/dashboard` (manual, starter-based) + +These are captured ad hoc against real starters, not the demo AppHost: + +- `assets/get-started/{csharp,javascript}-aspire-dashboard(-light).png`: `aspire new aspire-starter` / `aspire-ts-starter` with `--non-interactive --use-config-source false`, then `aspire run --non-interactive` (run it in the background; it blocks). Capture `/resources` at 1100x300 (C#) or 1100x400 (JS), 2x, message bars hidden. +- `assets/fundamentals/dashboard-unresolved-parameters-message(-light).png`: add `addParameter("api-key", { secret: true })` with no value; 1000x520 @2x, hide the feedback bar with `.dashboard-message-bar.intent-info{display:none!important}`. +- `assets/fundamentals/health-checks-dashboard-status(-light).png`: add `.withHttpHealthCheck({ path: "/health" })`, select the resource, clip 1100x345 so the Status card shows Health state. +- Still old UI and unrefreshed: `whats-new/dashboard-update-notification` (needs a newer-version "Update now" bar), `integrations/custom-integrations/*` (need the MailDev/MailKit sample apps), `integrations/efcore/dashboard-post-migration-*`. Version-specific `whats-new/aspire-9.x` images stay historical. + +## Theme gotcha + +The dashboard persists its theme in the `currentTheme` cookie (`Dark`/`Light`), which `localStorage.clear()` does not reset. `run.ts` clears cookies and sets the cookie per shot, and treats a capture as failed unless `documentElement.dataset.theme` matches the requested theme. After a run, scan mean luminance: `-light` files should be bright, all others dark. + + +## Do not shrink the viewport + +Never set a small per-shot `height` (under ~700): the dashboard footer and layout collapse and the capture shows cut-off content. Use `autoCrop` (trims trailing blank space) or `clip` (element crop). `verify` flags any non-clip image under half the viewport height; open every flagged image and check it shows the intended UI. + +## Intent lessons from review + +- Quote comma lists: `--only "a,b"` (unquoted PowerShell splits it and captures nothing). +- `js` steps run in Playwright, not the page; use `page.evaluate` for DOM access. +- Notifications only appear after an action: trigger Rebuild on `webfrontend` (wait ~15s) before opening the bell or View response. +- Error logs and traces come from `apiservice` (`/forecast/unavailable`), not `webfrontend`. +- Metrics filters: use `webfrontend` > `Microsoft.AspNetCore.Hosting` > `http.server.request.duration`, and open a filter that exists (`http.response.status_code`). +- `sidebar-grayed-resources` shows dimmed resources that have no data for the current page. +- **Metrics instrument detail:** never `scrollIntoViewIfNeeded` (it scrolls the chart out of view) and do not collapse the sidebar (a wide chart leaves a blank band above Filters). Load the instrument by URL (`?meter=...&instrument=...&duration=5`), use `height: 1000` so chart + Filters + open filter menu all fit. +- **Structured logs:** errors come from `inventoryservice`; `traceId` is a URL param; row menus use `td.log-row-error fluent-button[aria-label='Actions']`; the Add filter flyout is `.filter-dialog-form`. + +## Process lessons (apply on every run) + +- **Judge by intent, not file existence.** Several early "successful" captures showed the wrong UI (e.g. the Add filter flyout in place of health status, empty notification flyouts). For every image, read the doc that embeds it, open the old image, and compare what it was meant to show. +- **Find every consumer before renaming.** Search `src/frontend/src` for each asset name (en and `ja` docs, `DashboardCarousel.astro`) and update imports in the same commit. Naming: bare name = dark, `-light` = light, never `-dark`. +- **Audit the whole site, not just `assets/dashboard`.** Grep all of `src/frontend/src/assets` for dashboard captures (get-started, fundamentals, integrations, whats-new) and the landing carousel; see the manual section above. +- **Add new UI to docs and carousel in the same pass.** New dashboard features (density, overview panels, metrics filters, show-empty-panels toggle) need doc prose plus shots; landing images are 2560x1600 so never `autoCrop` them. +- **Keep PRs split:** skill and manifest on one branch, generated images and MDX on another; push manifest changes first, then move the PNGs. +- **Match the product version.** Record which dashboard build was used (demo AppHost on release/17.0 vs. the installed CLI's bundled dashboard) in the PR body. +- **CI quirks:** frontend build ~9 min, E2E 10-20 min; rerun only failed jobs for flakes. Never run a local site build. +- **Tooling quirks:** `aspire run` blocks (start it hidden/background); `run-code` screenshot paths must be inline forward-slash absolute paths; the `view` tool needs a copy to a fresh temp name; the playwright session can die, so re-running `--only` reopens it. diff --git a/.agents/skills/dashboard-screenshots/bun.lock b/.agents/skills/dashboard-screenshots/bun.lock new file mode 100644 index 0000000000..07c7acaa14 --- /dev/null +++ b/.agents/skills/dashboard-screenshots/bun.lock @@ -0,0 +1,73 @@ +{ + "lockfileVersion": 2, + "configVersion": 1, + "workspaces": { + "": { + "name": "dashboard-screenshots-skill", + "dependencies": { + "sharp": "^0.34.0", + }, + }, + }, + "packages": { + "@emnapi/runtime": ["@emnapi/runtime@1.11.3", "https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@emnapi/runtime/-/runtime-1.11.3.tgz", { "dependencies": { "tslib": "^2.4.0" } }, "sha1-hCV647BTHrKuwf+iPXBwDaAHupU="], + + "@img/colour": ["@img/colour@1.1.0", "https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/colour/-/colour-1.1.0.tgz", {}, "sha1-sMLC+mYa33Xv/WtJZEl82AAQu50="], + + "@img/sharp-darwin-arm64": ["@img/sharp-darwin-arm64@0.34.5", "https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.34.5.tgz", { "optionalDependencies": { "@img/sharp-libvips-darwin-arm64": "1.2.4" }, "os": "darwin", "cpu": "arm64" }, "sha1-bgcy3K3hJrZnCveqFwYLkmg16oY="], + + "@img/sharp-darwin-x64": ["@img/sharp-darwin-x64@0.34.5", "https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.34.5.tgz", { "optionalDependencies": { "@img/sharp-libvips-darwin-x64": "1.2.4" }, "os": "darwin", "cpu": "x64" }, "sha1-Gbwd1uum1alig0mLnJ9AEYDunHs="], + + "@img/sharp-libvips-darwin-arm64": ["@img/sharp-libvips-darwin-arm64@1.2.4", "https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.2.4.tgz", { "os": "darwin", "cpu": "arm64" }, "sha1-KJTAy4fUInbDiJlC6OLbUXpJLEM="], + + "@img/sharp-libvips-darwin-x64": ["@img/sharp-libvips-darwin-x64@1.2.4", "https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.2.4.tgz", { "os": "darwin", "cpu": "x64" }, "sha1-5jaB9FOalK+c0XJG7YiBc0OG+Mw="], + + "@img/sharp-libvips-linux-arm": ["@img/sharp-libvips-linux-arm@1.2.4", "https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.2.4.tgz", { "os": "linux", "cpu": "arm", "libc": "glibc" }, "sha1-uSYN0evm+eO9vL3KydKsEl81hS0="], + + "@img/sharp-libvips-linux-arm64": ["@img/sharp-libvips-linux-arm64@1.2.4", "https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.2.4.tgz", { "os": "linux", "cpu": "arm64", "libc": "glibc" }, "sha1-sbKIs2hks7zlRa2R+m2tzxpK0xg="], + + "@img/sharp-libvips-linux-ppc64": ["@img/sharp-libvips-linux-ppc64@1.2.4", "https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.2.4.tgz", { "os": "linux", "cpu": "ppc64", "libc": "glibc" }, "sha1-S4Ps8qgpBXIis4hIx7Ai57TQeqc="], + + "@img/sharp-libvips-linux-riscv64": ["@img/sharp-libvips-linux-riscv64@1.2.4", "https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.2.4.tgz", { "os": "linux", "cpu": "none", "libc": "glibc" }, "sha1-iAtGeACeWiCArxkjMrALCq+KSN4="], + + "@img/sharp-libvips-linux-s390x": ["@img/sharp-libvips-linux-s390x@1.2.4", "https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.2.4.tgz", { "os": "linux", "cpu": "s390x", "libc": "glibc" }, "sha1-dPNDyOEPrYIbOPdc7TBIiTncWew="], + + "@img/sharp-libvips-linux-x64": ["@img/sharp-libvips-linux-x64@1.2.4", "https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.2.4.tgz", { "os": "linux", "cpu": "x64", "libc": "glibc" }, "sha1-30GD6L2EEPfWG2aFmjXt6rClMc4="], + + "@img/sharp-libvips-linuxmusl-arm64": ["@img/sharp-libvips-linuxmusl-arm64@1.2.4", "https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.2.4.tgz", { "os": "linux", "cpu": "arm64", "libc": "musl" }, "sha1-yNa0ghHfZxN1QQB+6NG3sfjKjgY="], + + "@img/sharp-libvips-linuxmusl-x64": ["@img/sharp-libvips-linuxmusl-x64@1.2.4", "https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.2.4.tgz", { "os": "linux", "cpu": "x64", "libc": "musl" }, "sha1-vhHHW+5bCAy+4xoVOod5RI+Rn3U="], + + "@img/sharp-linux-arm": ["@img/sharp-linux-arm@0.34.5", "https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-linux-arm/-/sharp-linux-arm-0.34.5.tgz", { "optionalDependencies": { "@img/sharp-libvips-linux-arm": "1.2.4" }, "os": "linux", "cpu": "arm", "libc": "glibc" }, "sha1-X7DDaV3RJSLTnD/3pryBZGF4Cg0="], + + "@img/sharp-linux-arm64": ["@img/sharp-linux-arm64@0.34.5", "https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.34.5.tgz", { "optionalDependencies": { "@img/sharp-libvips-linux-arm64": "1.2.4" }, "os": "linux", "cpu": "arm64", "libc": "glibc" }, "sha1-eqd2TvnAAfFeYQVG1C/OVpEXkMw="], + + "@img/sharp-linux-ppc64": ["@img/sharp-linux-ppc64@0.34.5", "https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.34.5.tgz", { "optionalDependencies": { "@img/sharp-libvips-linux-ppc64": "1.2.4" }, "os": "linux", "cpu": "ppc64", "libc": "glibc" }, "sha1-nCE6gVIKIMr2aXjz1MB0Vv8uCBM="], + + "@img/sharp-linux-riscv64": ["@img/sharp-linux-riscv64@0.34.5", "https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.34.5.tgz", { "optionalDependencies": { "@img/sharp-libvips-linux-riscv64": "1.2.4" }, "os": "linux", "cpu": "none", "libc": "glibc" }, "sha1-zdKBgndOrb4E9iZ1oWqrvMuDP2A="], + + "@img/sharp-linux-s390x": ["@img/sharp-linux-s390x@0.34.5", "https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.34.5.tgz", { "optionalDependencies": { "@img/sharp-libvips-linux-s390x": "1.2.4" }, "os": "linux", "cpu": "s390x", "libc": "glibc" }, "sha1-k+rGAbnzKbsnkX4OGQmMci1jDfc="], + + "@img/sharp-linux-x64": ["@img/sharp-linux-x64@0.34.5", "https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-linux-x64/-/sharp-linux-x64-0.34.5.tgz", { "optionalDependencies": { "@img/sharp-libvips-linux-x64": "1.2.4" }, "os": "linux", "cpu": "x64", "libc": "glibc" }, "sha1-VavHzXVP/KUAK2wrcZq9/IRoGag="], + + "@img/sharp-linuxmusl-arm64": ["@img/sharp-linuxmusl-arm64@0.34.5", "https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.34.5.tgz", { "optionalDependencies": { "@img/sharp-libvips-linuxmusl-arm64": "1.2.4" }, "os": "linux", "cpu": "arm64", "libc": "musl" }, "sha1-1lFe6XG7YvcwAaSCm52GWhG3cIY="], + + "@img/sharp-linuxmusl-x64": ["@img/sharp-linuxmusl-x64@0.34.5", "https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.34.5.tgz", { "optionalDependencies": { "@img/sharp-libvips-linuxmusl-x64": "1.2.4" }, "os": "linux", "cpu": "x64", "libc": "musl" }, "sha1-2Xl4rsfFIS+ZlxTy9bc2RX4S7p8="], + + "@img/sharp-wasm32": ["@img/sharp-wasm32@0.34.5", "https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-wasm32/-/sharp-wasm32-0.34.5.tgz", { "dependencies": { "@emnapi/runtime": "^1.7.0" }, "cpu": "none" }, "sha1-LxWAOqYm+MWd18nQu8dm8atSz6A="], + + "@img/sharp-win32-arm64": ["@img/sharp-win32-arm64@0.34.5", "https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.34.5.tgz", { "os": "win32", "cpu": "arm64" }, "sha1-Nwbp46w1/d/ByH+U6Enxt1MHzgo="], + + "@img/sharp-win32-ia32": ["@img/sharp-win32-ia32@0.34.5", "https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.34.5.tgz", { "os": "win32", "cpu": "ia32" }, "sha1-C3EWZZmwSeAy8IX7kmPgL05HiN4="], + + "@img/sharp-win32-x64": ["@img/sharp-win32-x64@0.34.5", "https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-win32-x64/-/sharp-win32-x64-0.34.5.tgz", { "os": "win32", "cpu": "x64" }, "sha1-qB/7AOaSZ80KHWJurtuKhDCysvg="], + + "detect-libc": ["detect-libc@2.1.2", "https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/detect-libc/-/detect-libc-2.1.2.tgz", {}, "sha1-aJxdzcGQDvVYOky59te0c3QgdK0="], + + "semver": ["semver@7.8.6", "https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/semver/-/semver-7.8.6.tgz", { "bin": { "semver": "bin/semver.js" } }, "sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw=="], + + "sharp": ["sharp@0.34.5", "https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/sharp/-/sharp-0.34.5.tgz", { "dependencies": { "@img/colour": "^1.0.0", "detect-libc": "^2.1.2", "semver": "^7.7.3" }, "optionalDependencies": { "@img/sharp-darwin-arm64": "0.34.5", "@img/sharp-darwin-x64": "0.34.5", "@img/sharp-libvips-darwin-arm64": "1.2.4", "@img/sharp-libvips-darwin-x64": "1.2.4", "@img/sharp-libvips-linux-arm": "1.2.4", "@img/sharp-libvips-linux-arm64": "1.2.4", "@img/sharp-libvips-linux-ppc64": "1.2.4", "@img/sharp-libvips-linux-riscv64": "1.2.4", "@img/sharp-libvips-linux-s390x": "1.2.4", "@img/sharp-libvips-linux-x64": "1.2.4", "@img/sharp-libvips-linuxmusl-arm64": "1.2.4", "@img/sharp-libvips-linuxmusl-x64": "1.2.4", "@img/sharp-linux-arm": "0.34.5", "@img/sharp-linux-arm64": "0.34.5", "@img/sharp-linux-ppc64": "0.34.5", "@img/sharp-linux-riscv64": "0.34.5", "@img/sharp-linux-s390x": "0.34.5", "@img/sharp-linux-x64": "0.34.5", "@img/sharp-linuxmusl-arm64": "0.34.5", "@img/sharp-linuxmusl-x64": "0.34.5", "@img/sharp-wasm32": "0.34.5", "@img/sharp-win32-arm64": "0.34.5", "@img/sharp-win32-ia32": "0.34.5", "@img/sharp-win32-x64": "0.34.5" }, "hasInstallScript": true }, "sha1-tvFI5LjGHxeXveEanRz+u64sV7A="], + + "tslib": ["tslib@2.9.1", "https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/tslib/-/tslib-2.9.1.tgz", {}, "sha512-a4Ux9VKuIMHsOS7ENbEq6hK2ZGYIT27Rtl0E4eD9KqwxhKiQeMZE/9xb3IdYwWaSOyIBQLExhQgXDTYoiCxnWA=="], + } +} diff --git a/.agents/skills/dashboard-screenshots/demo/AspireApp.ApiService/AspireApp.ApiService.csproj b/.agents/skills/dashboard-screenshots/demo/AspireApp.ApiService/AspireApp.ApiService.csproj new file mode 100644 index 0000000000..9db9da4f69 --- /dev/null +++ b/.agents/skills/dashboard-screenshots/demo/AspireApp.ApiService/AspireApp.ApiService.csproj @@ -0,0 +1,13 @@ + + + + $(DefaultTargetFramework) + enable + enable + + + + + + + diff --git a/.agents/skills/dashboard-screenshots/demo/AspireApp.ApiService/Program.cs b/.agents/skills/dashboard-screenshots/demo/AspireApp.ApiService/Program.cs new file mode 100644 index 0000000000..4f3f939389 --- /dev/null +++ b/.agents/skills/dashboard-screenshots/demo/AspireApp.ApiService/Program.cs @@ -0,0 +1,95 @@ +using System.Diagnostics.Metrics; + +var builder = WebApplication.CreateBuilder(args); + +builder.AddServiceDefaults(); +builder.Services.AddOpenTelemetry() + .WithMetrics(m => m.AddMeter("AspireApp.ApiService")) + .WithTracing(t => t.AddSource("AspireApp.ApiService")); + +var app = builder.Build(); +app.MapDefaultEndpoints(); + +var source = new System.Diagnostics.ActivitySource("AspireApp.ApiService"); + +// Multi-span trace (cache, database, message broker) so trace detail views look like a real workload. +app.MapGet("/orders/{id:int}", async (int id, ILogger logger) => +{ + using (var a = source.StartActivity("GET orders:cache", System.Diagnostics.ActivityKind.Client)) + { + a?.SetTag("db.system", "redis"); + a?.SetTag("db.operation", "GET"); + a?.SetTag("db.statement", $"GET order:{id}"); + a?.SetTag("server.address", "cache"); + a?.SetTag("server.port", 6379); + await Task.Delay(Random.Shared.Next(2, 6)); + a?.AddEvent(new("cache.miss")); + } + using (var a = source.StartActivity("SELECT orders", System.Diagnostics.ActivityKind.Client)) + { + a?.SetTag("db.system", "postgresql"); + a?.SetTag("db.name", "orders"); + a?.SetTag("db.operation", "SELECT"); + a?.SetTag("db.statement", "SELECT id, customer_id, total, status FROM orders WHERE id = @id"); + a?.SetTag("server.address", "db"); + a?.SetTag("server.port", 5432); + await Task.Delay(Random.Shared.Next(15, 40)); + } + using (var a = source.StartActivity("SELECT order_items", System.Diagnostics.ActivityKind.Client)) + { + a?.SetTag("db.system", "postgresql"); + a?.SetTag("db.name", "orders"); + a?.SetTag("db.operation", "SELECT"); + a?.SetTag("db.statement", "SELECT sku, quantity, price FROM order_items WHERE order_id = @id"); + a?.SetTag("server.address", "db"); + a?.SetTag("server.port", 5432); + await Task.Delay(Random.Shared.Next(8, 20)); + } + using (var a = source.StartActivity("SET orders:cache", System.Diagnostics.ActivityKind.Client)) + { + a?.SetTag("db.system", "redis"); + a?.SetTag("db.operation", "SET"); + a?.SetTag("db.statement", $"SET order:{id}"); + a?.SetTag("server.address", "cache"); + a?.SetTag("server.port", 6379); + await Task.Delay(Random.Shared.Next(2, 5)); + } + using (var a = source.StartActivity("orders publish", System.Diagnostics.ActivityKind.Producer)) + { + a?.SetTag("messaging.system", "rabbitmq"); + a?.SetTag("messaging.destination.name", "order-viewed"); + a?.SetTag("messaging.operation", "publish"); + a?.SetTag("server.address", "messaging"); + a?.SetTag("server.port", 5672); + await Task.Delay(Random.Shared.Next(4, 10)); + } + logger.LogInformation("Loaded order {OrderId}", id); + return new { Id = id, Status = "Shipped", Total = 42.5m + id }; +}); + +var meter = new Meter("AspireApp.ApiService"); +var forecasts = meter.CreateCounter("weather.forecasts.served", description: "Forecasts returned"); +var summaries = new[] { "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" }; + +app.MapGet("/weatherforecast", (ILogger logger) => +{ + logger.LogInformation("Generating weather forecast for {Days} days", 5); + var items = Enumerable.Range(1, 5).Select(i => new + { + Date = DateOnly.FromDateTime(DateTime.Now.AddDays(i)), + TemperatureC = Random.Shared.Next(-20, 55), + Summary = summaries[Random.Shared.Next(summaries.Length)] + }).ToArray(); + forecasts.Add(items.Length, new KeyValuePair("region", "us-west")); + return items; +}); + +// Always fails so the dashboard has error logs, failed spans and a failing trace to show. +app.MapGet("/forecast/unavailable", (ILogger logger) => +{ + logger.LogWarning("Upstream weather provider timed out, retrying"); + logger.LogError("Weather provider unavailable for region {Region}", "eu-central"); + throw new InvalidOperationException("Weather provider unavailable."); +}); + +app.Run(); diff --git a/.agents/skills/dashboard-screenshots/demo/AspireApp.ApiService/Properties/launchSettings.json b/.agents/skills/dashboard-screenshots/demo/AspireApp.ApiService/Properties/launchSettings.json new file mode 100644 index 0000000000..bff0bee6e2 --- /dev/null +++ b/.agents/skills/dashboard-screenshots/demo/AspireApp.ApiService/Properties/launchSettings.json @@ -0,0 +1,13 @@ +{ + "$schema": "https://json.schemastore.org/launchsettings.json", + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "applicationUrl": "http://localhost:17180", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/.agents/skills/dashboard-screenshots/demo/AspireApp.AppHost/AppHost.cs b/.agents/skills/dashboard-screenshots/demo/AspireApp.AppHost/AppHost.cs new file mode 100644 index 0000000000..69813b6304 --- /dev/null +++ b/.agents/skills/dashboard-screenshots/demo/AspireApp.AppHost/AppHost.cs @@ -0,0 +1,27 @@ +// Demo AppHost used only to produce documentation screenshots. Resource names mirror the +// `aspire-starter` template so the images match the docs narrative. +var builder = DistributedApplication.CreateBuilder(args); + +// Containers give container-specific screenshots (container logs, type filters) a subject. +// The original docs images showed 5-8 resources, so the demo mirrors that scale. +builder.AddContainer("cache", "redis", "7.4"); +builder.AddContainer("db", "postgres", "17") + .WithEnvironment("POSTGRES_PASSWORD", "demo-only"); +builder.AddContainer("messaging", "rabbitmq", "4"); + +var apiservice = builder.AddDotnetProject("apiservice", "../AspireApp.ApiService") + .WithHttpHealthCheck("/health"); + +// Extra backends reuse the same project; they only exist to populate the dashboard. +builder.AddDotnetProject("inventoryservice", "../AspireApp.ApiService") + .WithHttpHealthCheck("/health"); +builder.AddDotnetProject("orderservice", "../AspireApp.ApiService") + .WithHttpHealthCheck("/health"); + +builder.AddDotnetProject("webfrontend", "../AspireApp.Web") + .WithExternalHttpEndpoints() + .WithHttpHealthCheck("/health") + .WithReference(apiservice) + .WaitFor(apiservice); + +builder.Build().Run(); diff --git a/.agents/skills/dashboard-screenshots/demo/AspireApp.AppHost/AspireApp.AppHost.csproj b/.agents/skills/dashboard-screenshots/demo/AspireApp.AppHost/AspireApp.AppHost.csproj new file mode 100644 index 0000000000..8dd47eaea7 --- /dev/null +++ b/.agents/skills/dashboard-screenshots/demo/AspireApp.AppHost/AspireApp.AppHost.csproj @@ -0,0 +1,16 @@ + + + + Exe + $(DefaultTargetFramework) + enable + enable + true + + + + + + + + diff --git a/.agents/skills/dashboard-screenshots/demo/AspireApp.AppHost/Properties/launchSettings.json b/.agents/skills/dashboard-screenshots/demo/AspireApp.AppHost/Properties/launchSettings.json new file mode 100644 index 0000000000..5da2c1bc7e --- /dev/null +++ b/.agents/skills/dashboard-screenshots/demo/AspireApp.AppHost/Properties/launchSettings.json @@ -0,0 +1,19 @@ +{ + "$schema": "https://json.schemastore.org/launchsettings.json", + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": false, + "applicationUrl": "http://localhost:17170", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development", + "DOTNET_ENVIRONMENT": "Development", + "ASPIRE_ALLOW_UNSECURED_TRANSPORT": "true", + "ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:17171", + "ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL": "http://localhost:17172", + "ASPIRE_DASHBOARD_UNSECURED_ALLOW_ANONYMOUS": "true" + } + } + } +} diff --git a/.agents/skills/dashboard-screenshots/demo/AspireApp.AppHost/aspire.config.json b/.agents/skills/dashboard-screenshots/demo/AspireApp.AppHost/aspire.config.json new file mode 100644 index 0000000000..8bc496491d --- /dev/null +++ b/.agents/skills/dashboard-screenshots/demo/AspireApp.AppHost/aspire.config.json @@ -0,0 +1,5 @@ +{ + "appHost": { + "path": "AspireApp.AppHost.csproj" + } +} diff --git a/.agents/skills/dashboard-screenshots/demo/AspireApp.Web/AspireApp.Web.csproj b/.agents/skills/dashboard-screenshots/demo/AspireApp.Web/AspireApp.Web.csproj new file mode 100644 index 0000000000..9db9da4f69 --- /dev/null +++ b/.agents/skills/dashboard-screenshots/demo/AspireApp.Web/AspireApp.Web.csproj @@ -0,0 +1,13 @@ + + + + $(DefaultTargetFramework) + enable + enable + + + + + + + diff --git a/.agents/skills/dashboard-screenshots/demo/AspireApp.Web/Program.cs b/.agents/skills/dashboard-screenshots/demo/AspireApp.Web/Program.cs new file mode 100644 index 0000000000..32c4fe03f3 --- /dev/null +++ b/.agents/skills/dashboard-screenshots/demo/AspireApp.Web/Program.cs @@ -0,0 +1,40 @@ +var builder = WebApplication.CreateBuilder(args); + +builder.AddServiceDefaults(); +builder.Services.AddHttpClient("apiservice", c => c.BaseAddress = new("https+http://apiservice")); +builder.Services.AddHostedService(); + +var app = builder.Build(); +app.MapDefaultEndpoints(); + +app.MapGet("/", async (IHttpClientFactory factory) => + await factory.CreateClient("apiservice").GetStringAsync("/weatherforecast")); + +app.Run(); + +// Produces a steady stream of traces, logs and metrics, including periodic failures. +sealed class TrafficGenerator(IHttpClientFactory factory, ILogger logger) : BackgroundService +{ + protected override async Task ExecuteAsync(CancellationToken stoppingToken) + { + var client = factory.CreateClient("apiservice"); + await Task.Delay(TimeSpan.FromSeconds(5), stoppingToken); + for (var i = 0; !stoppingToken.IsCancellationRequested; i++) + { + try + { + // Only a few early failures so error badges stay small and realistic. + var path = i is 5 or 17 or 29 ? "/forecast/unavailable" + : i % 3 == 0 ? $"/orders/{1000 + i}" : "/weatherforecast"; + using var response = await client.GetAsync(path, stoppingToken); + logger.LogInformation("GET {Path} returned {StatusCode}", path, (int)response.StatusCode); + response.EnsureSuccessStatusCode(); + } + catch (HttpRequestException ex) + { + logger.LogError(ex, "Request to apiservice failed"); + } + await Task.Delay(TimeSpan.FromSeconds(2), stoppingToken); + } + } +} diff --git a/.agents/skills/dashboard-screenshots/demo/AspireApp.Web/Properties/launchSettings.json b/.agents/skills/dashboard-screenshots/demo/AspireApp.Web/Properties/launchSettings.json new file mode 100644 index 0000000000..5a19fad3f8 --- /dev/null +++ b/.agents/skills/dashboard-screenshots/demo/AspireApp.Web/Properties/launchSettings.json @@ -0,0 +1,13 @@ +{ + "$schema": "https://json.schemastore.org/launchsettings.json", + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "applicationUrl": "http://localhost:17181", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/.agents/skills/dashboard-screenshots/package.json b/.agents/skills/dashboard-screenshots/package.json new file mode 100644 index 0000000000..50f6101571 --- /dev/null +++ b/.agents/skills/dashboard-screenshots/package.json @@ -0,0 +1,13 @@ +{ + "name": "dashboard-screenshots-skill", + "private": true, + "type": "module", + "description": "Scripts for the dashboard-screenshots skill. Install with `bun install` in this folder.", + "scripts": { + "run": "bun scripts/run.ts", + "inventory": "bun scripts/run.ts --inventory" + }, + "dependencies": { + "sharp": "^0.34.0" + } +} diff --git a/.agents/skills/dashboard-screenshots/scripts/audit-ux.ts b/.agents/skills/dashboard-screenshots/scripts/audit-ux.ts new file mode 100644 index 0000000000..340af2a994 --- /dev/null +++ b/.agents/skills/dashboard-screenshots/scripts/audit-ux.ts @@ -0,0 +1,64 @@ +// Walks a running dashboard (default http://localhost:17170) and records its UX surface: main tabs, header dialogs +// (Help, Settings, ...), every tab inside each dialog, and visible headings/controls. The output (ux-audit.json and +// ux-audit.md in the work dir) is diffed against the docs so new UX gets screenshots and stale prose gets fixed. +// Usage: bun scripts/audit-ux.ts [--url http://localhost:17170] [--out ] +import { existsSync, mkdirSync, writeFileSync } from "node:fs"; +import { join } from "node:path"; +import { tmpdir } from "node:os"; + +const arg = (n: string, d: string) => { const i = process.argv.indexOf(`--${n}`); return i > 0 ? process.argv[i + 1] : d; }; +const url = arg("url", "http://localhost:17170"); +const out = arg("out", join(tmpdir(), "aspire-dashboard-shots", "w")); +mkdirSync(out, { recursive: true }); + +const sh = (cmd: string[]) => { const r = Bun.spawnSync(cmd, { stdout: "pipe", stderr: "pipe" }); return r.stdout.toString() + r.stderr.toString(); }; +const root = sh(["npm", "root", "-g"]).trim(); +const entry = join(root, "@playwright", "cli", "playwright-cli.js"); +const pw = (...a: string[]) => existsSync(entry) ? sh(["node", entry, "-s=audit", ...a]) : sh(["playwright-cli", "-s=audit", ...a]); + +// Reads visible text of the current dialog/page region: tabs, headings, buttons, switches, selects, labels. +const READ = `const read=async()=>page.evaluate(()=>{ + const vis=e=>!!(e.offsetWidth||e.offsetHeight); + const t=s=>[...document.querySelectorAll(s)].filter(vis).map(e=>(e.getAttribute('aria-label')||e.textContent||'').trim().replace(/\\s+/g,' ')).filter(Boolean); + const scope=[...document.querySelectorAll('fluent-drawer-body, [role=dialog], fluent-dialog[open]')].filter(vis).pop()||document.body; + const q=s=>[...scope.querySelectorAll(s)].filter(vis).map(e=>(e.getAttribute('aria-label')||e.textContent||'').trim().replace(/\\s+/g,' ')).filter(Boolean); + return {tabs:q('[role=tab],fluent-tab'),headings:q('h1,h2,h3,h4,[role=heading]'),buttons:q('button,fluent-button'),switches:q('[role=switch],fluent-switch,fluent-checkbox'),selects:q('select,fluent-select,fluent-combobox'),links:q('a[href]'),lines:(scope.innerText||'').split(/\\n/).map(s=>s.trim()).filter(Boolean)}; +});`; + +const MAIN = `async page => { ${READ} +const res={mainTabs:[],headerButtons:[],dialogs:{}}; +await page.goto(${JSON.stringify(url)},{waitUntil:'networkidle'}).catch(()=>{}); +const base=await read(); const sub=(r)=>Object.fromEntries(Object.entries(r).map(([k,v])=>[k,v.filter(x=>!base[k].includes(x))])); res.mainTabs=await page.locator('[role=tab]').allInnerTexts(); +res.headerButtons=await page.locator('header button[aria-label], fluent-button[aria-label]').evaluateAll(e=>e.map(x=>x.getAttribute('aria-label'))); +for(const name of ['Help','Settings','Recordings']){ + const b=page.getByRole('button',{name:new RegExp('^'+name,'i')}).first(); + if(!await b.count())continue; + await b.click({timeout:3000}).catch(()=>{}); + await page.waitForTimeout(800); + const d={base:sub(await read()),tabs:{}}; + const tabs=await page.locator('fluent-drawer-body [role=tab], fluent-drawer-body fluent-tab, [role=dialog] [role=tab], fluent-dialog [role=tab], fluent-dialog fluent-tab').all(); + for(const t of tabs){const n=(await t.innerText()).trim();await t.click().catch(()=>{});await page.waitForTimeout(500);d.tabs[n]=sub(await read());} + res.dialogs[name]=d; + await page.keyboard.press('Escape');await page.waitForTimeout(400); + await page.goto(${JSON.stringify(url)},{waitUntil:'networkidle'}).catch(()=>{}); +} +return JSON.stringify(res); }`.replace(/\r?\n/g, " "); + +pw("open", url, "--browser=msedge"); +const raw = pw("run-code", MAIN); +pw("close"); +const line = raw.split(/\r?\n/).find((l) => l.startsWith('"{')); +if (!line) { console.error("audit failed:\n" + raw.slice(-1500)); process.exit(1); } +const data = JSON.parse(JSON.parse(line)); +writeFileSync(join(out, "ux-audit.json"), JSON.stringify(data, null, 2)); + +const md: string[] = ["# Dashboard UX audit", "", `Main tabs: ${data.mainTabs.join(", ")}`, `Header buttons: ${data.headerButtons.join(", ")}`, ""]; +for (const [name, d] of Object.entries(data.dialogs)) { + md.push(`## ${name} dialog`, "", `New text: ${(d.base.lines || []).slice(0, 80).join(" / ") || "(none)"}`, "", `Tabs (${Object.keys(d.tabs).length}): ${Object.keys(d.tabs).join(" | ") || "(none)"}`, ""); + for (const [tab, c] of Object.entries(d.tabs)) md.push(`- **${tab}** text: ${(c.lines || []).slice(0, 60).join(" / ")}`); + for (const [tab, c] of Object.entries(d.tabs)) md.push(`- **${tab}**: headings [${c.headings.join("; ")}], switches [${c.switches.join("; ")}], selects [${c.selects.join("; ")}], buttons [${c.buttons.join("; ")}]`); + md.push(""); +} +writeFileSync(join(out, "ux-audit.md"), md.join("\n")); +console.log(md.join("\n")); +console.log(`\nWrote ${join(out, "ux-audit.json")} and ux-audit.md`); diff --git a/.agents/skills/dashboard-screenshots/scripts/find-callouts.ts b/.agents/skills/dashboard-screenshots/scripts/find-callouts.ts new file mode 100644 index 0000000000..d4048f1a13 --- /dev/null +++ b/.agents/skills/dashboard-screenshots/scripts/find-callouts.ts @@ -0,0 +1,15 @@ +// Lists images that contain red callout borders (pixels near #e8212e) so recaptures can reproduce them. +import { readdirSync, statSync } from "node:fs"; +import { join, resolve } from "node:path"; +import sharp from "sharp"; + +const assets = resolve(import.meta.dir, "../../../../src/frontend/src/assets/dashboard"); +const files: string[] = []; +const walk = (d: string) => readdirSync(d).forEach((f) => { const p = join(d, f); statSync(p).isDirectory() ? walk(p) : /\.png$/.test(f) && files.push(p); }); +walk(assets); +for (const f of files) { + const { data, info } = await sharp(f).removeAlpha().raw().toBuffer({ resolveWithObject: true }); + let n = 0; + for (let i = 0; i < data.length; i += 3) if (data[i] > 200 && data[i + 1] < 70 && data[i + 2] < 80 && data[i] - data[i + 1] > 150) n++; + if (n > info.width * 2) console.log(`${f.slice(assets.length + 1).replace(/\\/g, "/")}\t${n}`); +} diff --git a/.agents/skills/dashboard-screenshots/scripts/recipes.ts b/.agents/skills/dashboard-screenshots/scripts/recipes.ts new file mode 100644 index 0000000000..a5f6f5614e --- /dev/null +++ b/.agents/skills/dashboard-screenshots/scripts/recipes.ts @@ -0,0 +1,82 @@ +// Capture recipes (how to produce each known image). This is NOT a manifest: run.ts discovers the +// images that exist, joins them with these recipes, and writes an ephemeral shots.json to the work +// dir that is deleted when the run finishes. +export default { + "viewport": { "width": 1280, "height": 800, "deviceScaleFactor": 2 }, + "padding": 16, + "notes": "Extra step type: js (raw playwright code, page in scope). also.dark/also.light = extra file names to write; thumb = {dark, width} resized copy. out.dark / out.light are paths relative to src/frontend/src/assets/dashboard. Steps: click(text) clickSel(css) hover(text) fill([css,value]) press(key) wait(ms). clip = css selector (cropped with padding). callouts = css selectors outlined in red.", + "shots": [ + { "id": "landing-resources", "out": { "dark": "landing/resources-table.png", "light": "landing/resources-table-light.png" }, "route": "resources" }, + { "id": "landing-graph", "out": { "dark": "landing/resources-graph.png", "light": "landing/resources-graph-light.png" }, "route": "resources", "steps": [{ "clickSel": "[aria-label*='Settings' i]" }, { "wait": 600 }, { "click": "Graph" }, { "wait": 600 }, { "closeDialog": true }, { "wait": 800 }, { "click": "Overview" }, { "wait": 1500 }, { "dragSel": ".resource-pane-resizer", "dragTo": 150 }, { "wait": 800 }] }, + { "id": "landing-console", "out": { "dark": "landing/console.png", "light": "landing/console-light.png" }, "route": "consolelogs/resource/apiservice", "steps": [{ "clickSel": "[aria-label='Collapse resource list']" }, { "wait": 900 }] }, + { "id": "landing-structured", "out": { "dark": "landing/structured-logs.png", "light": "landing/structured-logs-light.png" }, "collapseSidebar": true, "route": "structuredlogs" }, + { "id": "landing-traces", "out": { "dark": "landing/traces.png", "light": "landing/traces-light.png" }, "route": "traces", "steps": [{ "clickSel": "[aria-label='Collapse resource list']" }, { "wait": 900 }] }, + { "id": "landing-trace-detail", "out": { "dark": "landing/trace-detail.png", "light": "landing/trace-detail-light.png" }, "collapseSidebar": true, "route": "traces", "steps": [{ "click": "inventoryservice (6)" }, { "wait": 2500 }, { "js": "await page.getByText('postgresql SELECT orders').locator('visible=true').first().click({force:true})" }, { "wait": 1800 }] }, + { "id": "landing-metrics", "out": { "dark": "landing/metrics.png", "light": "landing/metrics-light.png" }, "route": "metrics/resource/apiservice", "steps": [{ "clickSel": "[aria-label='Collapse resource list']" }, { "wait": 900 }] }, + { "id": "landing-aspire-outage-modes", "out": { "dark": "landing/aspire-outage-modes.png", "light": "landing/aspire-outage-modes-light.png" }, "route": "resources", "steps": [{ "clickSel": "[aria-label*='Settings' i]" }, { "wait": 700 }, { "click": "Graph" }, { "wait": 500 }, { "closeDialog": true }, { "wait": 800 }, { "click": "Overview" }, { "wait": 1500 }, { "dragSel": ".resource-pane-resizer", "dragTo": 150 }, { "wait": 800 }, { "clickSel": "[aria-label='Play Aspire Outage']" }, { "wait": 1500 }] }, + { "id": "landing-aspire-outage-gameplay", "out": { "dark": "landing/aspire-outage-gameplay.png", "light": "landing/aspire-outage-gameplay-light.png" }, "route": "resources", "steps": [{ "clickSel": "[aria-label*='Settings' i]" }, { "wait": 700 }, { "click": "Graph" }, { "wait": 500 }, { "closeDialog": true }, { "wait": 800 }, { "click": "Overview" }, { "wait": 1500 }, { "dragSel": ".resource-pane-resizer", "dragTo": 150 }, { "wait": 800 }, { "clickSel": "[aria-label='Play Aspire Outage']" }, { "wait": 1200 }, { "clickSel": ".resource-graph-game-button:not(.resource-graph-game-hardcore)" }, { "wait": 800 }, { "js": "await page.keyboard.down('ArrowLeft'); await page.keyboard.press('Space'); await page.waitForTimeout(700); await page.keyboard.up('ArrowLeft'); await page.keyboard.down('ArrowRight'); for(let i=0;i<6;i++){await page.keyboard.press('Space'); await page.waitForTimeout(450);} await page.keyboard.up('ArrowRight'); await page.evaluate(() => document.querySelectorAll('*').forEach(e => { e.scrollTop = 0 }))" }, { "wait": 300 }] }, + + { "id": "projects", "autoCrop": true, "out": { "dark": "explore/projects.png", "light": "explore/projects-light.png" }, "route": "resources" }, + { "id": "resources-filters", "height": 720, "out": { "dark": "explore/resources-filters.png", "light": "explore/resources-filters-light.png" }, "route": "resources", "steps": [{ "clickSel": "[aria-label='Filters']" }, { "wait": 800 }], "callouts": ["[aria-label='Filters']"] }, + { "id": "resources-group-menu", "autoCrop": true, "out": { "dark": "explore/resources-group-menu.png", "light": "explore/resources-group-menu-light.png" }, "route": "resources", "steps": [{ "clickSel": "[aria-label='Group resources']" }, { "wait": 800 }], "callouts": ["[aria-label='Group resources']"] }, + { "id": "resources-grouped", "height": 700, "out": { "dark": "explore/resources-grouped.png", "light": "explore/resources-grouped-light.png" }, "route": "resources", "steps": [{ "clickSel": "[aria-label='Group resources']" }, { "wait": 600 }, { "click": "Resource type" }, { "wait": 1000 }] }, + { "id": "resource-list-collapse", "autoCrop": true, "out": { "dark": "explore/resource-list-collapse.png", "light": "explore/resource-list-collapse-light.png" }, "route": "metrics/resource/apiservice", "callouts": ["[aria-label='Collapse resource list']"] }, + { "id": "resource-list-collapsed", "autoCrop": true, "out": { "dark": "explore/resource-list-collapsed.png", "light": "explore/resource-list-collapsed-light.png" }, "route": "metrics/resource/apiservice", "steps": [{ "clickSel": "[aria-label='Collapse resource list']" }, { "wait": 900 }] }, + { "id": "resource-picker-dropdown", "autoCrop": true, "out": { "dark": "explore/resource-picker-dropdown.png", "light": "explore/resource-picker-dropdown-light.png" }, "route": "metrics/resource/apiservice", "steps": [{ "clickSel": "[aria-label='Collapse resource list']" }, { "wait": 900 }, { "clickSel": ".resource-picker-button" }, { "wait": 900 }], "callouts": [".resource-picker-button"] }, + { "id": "resource-select-single", "autoCrop": true, "out": { "dark": "explore/resource-select-single.png", "light": "explore/resource-select-single-light.png" }, "route": "structuredlogs/resource/apiservice", "callouts": [".resource-row:has-text('apiservice')"] }, + { "id": "resource-select-multiple", "autoCrop": true, "out": { "dark": "explore/resource-select-multiple.png", "light": "explore/resource-select-multiple-light.png" }, "route": "structuredlogs/resource/apiservice", "steps": [{ "js": "await page.locator('.resource-row').filter({hasText:'webfrontend'}).first().click({modifiers:['Control']})" }, { "wait": 1200 }], "callouts": [".resource-row:has-text('apiservice')", ".resource-row:has-text('webfrontend')"] }, + { "id": "resource-select-all", "autoCrop": true, "out": { "dark": "explore/resource-select-all.png", "light": "explore/resource-select-all-light.png" }, "route": "structuredlogs", "callouts": ["text=All resources"] }, + { "id": "metrics-group-menu", "autoCrop": true, "out": { "dark": "explore/metrics-group-menu.png", "light": "explore/metrics-group-menu-light.png" }, "collapseSidebar": true, "route": "metrics/resource/apiservice", "steps": [{ "clickSel": "[aria-label='Group instruments']" }, { "wait": 700 }], "callouts": ["[aria-label='Group instruments']"] }, + { "id": "metrics-sort-menu", "autoCrop": true, "out": { "dark": "explore/metrics-sort-menu.png", "light": "explore/metrics-sort-menu-light.png" }, "collapseSidebar": true, "route": "metrics/resource/apiservice", "steps": [{ "clickSel": "[aria-label='Sort instruments']" }, { "wait": 700 }], "callouts": ["[aria-label='Sort instruments']"] }, + { "id": "resource-details", "out": { "dark": "explore/resource-details.png", "light": "explore/resource-details-light.png" }, "route": "resources", "thumb": { "dark": "explore/resource-details-thumb.png", "width": 1117 }, "steps": [{ "click": "apiservice" }, { "wait": 1500 }] }, + { "id": "resource-actions", "out": { "dark": "explore/resource-actions.png", "light": "explore/resource-actions-light.png" }, "route": "resources", "steps": [{ "hoverSel": ".resource-row:has-text('apiservice')" }, { "wait": 400 }, { "clickSel": "[aria-label='Actions for apiservice']" }, { "wait": 600 }], "callouts": ["[role=menu]"] }, + { "id": "project-logs", "out": { "dark": "explore/project-logs.png", "light": "explore/project-logs-light.png" }, "route": "consolelogs/resource/apiservice", "steps": [{ "clickSel": "[aria-label='Collapse resource list']" }, { "wait": 900 }] }, + { "id": "structured-logs", "out": { "dark": "explore/structured-logs.png", "light": "explore/structured-logs-light.png" }, "collapseSidebar": true, "route": "structuredlogs" }, + { "id": "structured-logs-errors", "autoCrop": true, "out": { "dark": "explore/structured-logs-errors.png", "light": "explore/structured-logs-errors-light.png" }, "thumb": { "dark": "explore/structured-logs-errors-view-thumb.png", "width": 1285 }, "collapseSidebar": true, "route": "structuredlogs?logLevel=error", "steps": [{ "js": "const id = await page.evaluate(()=>[...document.querySelectorAll('a')].find(a=>a.href.includes('/traces/detail/')).href.split('/traces/detail/')[1].split('?')[0]); await page.goto(page.url().split('/structuredlogs')[0]+'/structuredlogs?logLevel=error&traceId='+id)" }, { "wait": 2500 }, { "js": "await page.locator(\"td.log-row-error fluent-button[aria-label='Actions']\").first().click()" }, { "wait": 1000 }], "callouts": ["[role=menu]"] }, + { "id": "traces", "out": { "dark": "explore/traces.png", "light": "explore/traces-light.png" }, "route": "traces", "steps": [{ "clickSel": "[aria-label='Collapse resource list']" }, { "wait": 900 }] }, + { "id": "trace", "autoCrop": true, "out": { "dark": "explore/trace.png", "light": "explore/trace-light.png" }, "collapseSidebar": true, "route": "traces", "steps": [{ "click": "inventoryservice (6)" }, { "wait": 2500 }] }, + { "id": "sidebar-grayed-resources", "out": { "dark": "explore/sidebar-grayed-resources.png", "light": "explore/sidebar-grayed-resources-light.png" }, "route": "metrics/resource/apiservice", "steps": [{ "wait": 1500 }] }, + { "id": "metrics-view", "out": { "dark": "explore/metrics-view.png", "light": "explore/metrics-view-light.png" }, "route": "metrics/resource/apiservice", "steps": [{ "clickSel": "[aria-label='Collapse resource list']" }, { "wait": 900 }] }, + { "id": "dashboard-help", "out": { "dark": "explore/dashboard-help.png", "light": "explore/dashboard-help-light.png" }, "route": "resources", "steps": [{ "clickSel": "[aria-label*='Help' i]" }, { "wait": 800 }] }, + { "id": "notification-center-open", "out": { "dark": "explore/notification-center-open.png", "light": "explore/notification-center-open-light.png" }, "route": "resources", "steps": [{ "wait": 2500 }, { "hoverSel": ".resource-row:has-text('webfrontend')" }, { "js": "await page.locator(\"[aria-label='Actions for webfrontend']\").first().click({force:true})" }, { "wait": 600 }, { "js": "await page.getByRole('menuitem',{name:'Rebuild'}).click({force:true})" }, { "wait": 15000 }, { "js": "await page.getByRole('button',{name:'Notifications'}).first().click({force:true})" }, { "wait": 1000 }] }, + { "id": "theme-selection-system", "legacyLight": true, "out": { "dark": "explore/theme-selection-system.png", "light": "explore/theme-selection-system-light.png" }, "route": "resources", "steps": [{ "clickSel": "[aria-label*='Settings' i]" }, { "wait": 800 }] }, + { "id": "theme-selection-explicit", "legacyLight": true, "out": { "dark": "explore/theme-selection-explicit.png", "light": "explore/theme-selection-explicit-light.png" }, "route": "resources", "steps": [{ "clickSel": "[aria-label*='Settings' i]" }, { "wait": 800 }, { "js": "await page.getByText('{{Theme}}', {exact:true}).first().click()" }, { "wait": 800 }] }, + { "id": "manage-data", "out": { "dark": "explore/manage-data-dialog.png", "light": "explore/manage-data-dialog-light.png" }, "route": "resources", "steps": [{ "clickSel": "[aria-label*='Settings' i]" }, { "wait": 600 }, { "click": "Manage" }, { "wait": 800 }] }, + { "id": "projects-errors", "autoCrop": true, "out": { "dark": "explore/projects-errors.png", "light": "explore/projects-errors-light.png" }, "route": "resources", "callouts": [".resource-row:has-text('apiservice')"] }, + { "id": "project-logs-error", "out": { "dark": "explore/project-logs-error.png", "light": "explore/project-logs-error-light.png" }, "collapseSidebar": true, "route": "consolelogs/resource/apiservice", "steps": [{ "wait": 3000 }] }, + { "id": "container-logs", "out": { "dark": "explore/container-logs.png", "light": "explore/container-logs-light.png" }, "collapseSidebar": true, "route": "consolelogs/resource/cache" }, + { "id": "structured-logs-filtered", "out": { "dark": "explore/structured-logs-filtered.png", "light": "explore/structured-logs-filtered-light.png" }, "collapseSidebar": true, "route": "structuredlogs", "steps": [{ "clickSel": "fluent-button[aria-label='Add filter']" }, { "wait": 1500 }], "callouts": [".filter-dialog-form"] }, + { "id": "traces-filtering", "out": { "dark": "explore/traces-filtering.png", "light": "explore/traces-filtering-light.png" }, "collapseSidebar": true, "route": "traces", "steps": [{ "js": "await page.locator('fluent-text-input[placeholder=\"Filter...\"]:not([name=resource-pane-search])').last().click(); await page.waitForTimeout(900); await page.keyboard.type('webfrontend: GET', {delay:60}); await page.waitForTimeout(500); await page.locator('h1, .main-header, [class*=header-title]').first().click({force:true}).catch(()=>{}); await page.mouse.move(640,500)" }, { "wait": 1200 }], "callouts": ["fluent-text-input[placeholder='Filter...']:not([name=resource-pane-search])"] }, + { "id": "traces-errors", "out": { "dark": "explore/traces-errors.png", "light": "explore/traces-errors-light.png" }, "route": "traces", "steps": [{ "clickSel": "[aria-label='Collapse resource list']" }, { "wait": 900 }] }, + { "id": "trace-span-details", "out": { "dark": "explore/trace-span-details.png", "light": "explore/trace-span-details-light.png" }, "collapseSidebar": true, "route": "traces", "steps": [{ "click": "inventoryservice (6)" }, { "wait": 2500 }, { "js": "await page.getByText('postgresql SELECT orders').locator('visible=true').first().click({force:true})" }, { "wait": 1800 }] }, + { "id": "pause-telemetry", "out": { "dark": "explore/pause-telemetry.png", "light": "explore/pause-telemetry-light.png" }, "collapseSidebar": true, "route": "structuredlogs", "steps": [{ "hoverSel": "[aria-label='Pause incoming data']" }, { "wait": 500 }], "callouts": ["[aria-label='Pause incoming data']"] }, + { "id": "remove-telemetry-data", "out": { "dark": "explore/remove-telemetry-data.png", "light": "explore/remove-telemetry-data-light.png" }, "thumb": { "dark": "explore/remove-telemetry-data-thumb.png", "width": 987 }, "collapseSidebar": true, "route": "structuredlogs", "steps": [{ "clickSel": "[aria-label='Remove data']" }, { "wait": 600 }], "callouts": ["[role=menu]"] }, + { "id": "select-resource-type", "autoCrop": true, "out": { "dark": "explore/select-resource-type.png", "light": "explore/select-resource-type-light.png" }, "route": "resources", "steps": [{ "clickSel": "[aria-label='Filters']" }, { "wait": 700 }], "callouts": ["[role=dialog], [role=menu], .fluent-popover"] }, + { "id": "resource-submenu-actions", "autoCrop": true, "out": { "dark": "explore/resource-submenu-actions.png", "light": "explore/resource-submenu-actions-light.png" }, "route": "resources", "steps": [{ "hover": "cache" }, { "wait": 400 }, { "clickSel": "[aria-label='Actions for cache']" }, { "wait": 600 }], "callouts": ["[role=menu]"] }, + { "id": "help-dialog-documentation", "out": { "dark": "explore/help-dialog-documentation.png", "light": "explore/help-dialog-documentation-light.png" }, "route": "resources", "steps": [{ "clickSel": "[aria-label*='Help' i]" }, { "wait": 900 }] }, + { "id": "help-dialog-keyboard-shortcuts", "out": { "dark": "explore/help-dialog-keyboard-shortcuts.png", "light": "explore/help-dialog-keyboard-shortcuts-light.png" }, "route": "resources", "steps": [{ "clickSel": "[aria-label*='Help' i]" }, { "wait": 800 }, { "click": "Keyboard shortcuts" }, { "wait": 800 }] }, + { "id": "settings-dialog", "out": { "dark": "explore/settings-dialog.png", "light": "explore/settings-dialog-light.png" }, "route": "resources", "steps": [{ "clickSel": "[aria-label*='Settings' i]" }, { "wait": 900 }], "callouts": ["text=Resource list density", "text=Overview layout"] }, + { "id": "recordings-dialog", "out": { "dark": "explore/recordings-dialog.png", "light": "explore/recordings-dialog-light.png" }, "route": "resources", "steps": [{ "clickSel": "[aria-label^='Recordings' i]" }, { "wait": 900 }] }, + { "id": "aspire-outage-start", "out": { "dark": "explore/aspire-outage-start.png", "light": "explore/aspire-outage-start-light.png" }, "route": "resources", "steps": [{ "clickSel": "[aria-label*='Settings' i]" }, { "wait": 700 }, { "click": "Graph" }, { "wait": 500 }, { "closeDialog": true }, { "wait": 800 }, { "click": "Overview" }, { "wait": 1500 }, { "dragSel": ".resource-pane-resizer", "dragTo": 150 }, { "wait": 800 }], "callouts": ["[aria-label='Play Aspire Outage']"] }, + { "id": "aspire-outage-modes", "out": { "dark": "explore/aspire-outage-modes.png", "light": "explore/aspire-outage-modes-light.png" }, "route": "resources", "steps": [{ "clickSel": "[aria-label*='Settings' i]" }, { "wait": 700 }, { "click": "Graph" }, { "wait": 500 }, { "closeDialog": true }, { "wait": 800 }, { "click": "Overview" }, { "wait": 1500 }, { "dragSel": ".resource-pane-resizer", "dragTo": 150 }, { "wait": 800 }, { "clickSel": "[aria-label='Play Aspire Outage']" }, { "wait": 1500 }], "callouts": [".resource-graph-game-button:not(.resource-graph-game-hardcore)"] }, + { "id": "aspire-outage-gameplay", "out": { "dark": "explore/aspire-outage-gameplay.png", "light": "explore/aspire-outage-gameplay-light.png" }, "route": "resources", "steps": [{ "clickSel": "[aria-label*='Settings' i]" }, { "wait": 700 }, { "click": "Graph" }, { "wait": 500 }, { "closeDialog": true }, { "wait": 800 }, { "click": "Overview" }, { "wait": 1500 }, { "dragSel": ".resource-pane-resizer", "dragTo": 150 }, { "wait": 800 }, { "clickSel": "[aria-label='Play Aspire Outage']" }, { "wait": 1200 }, { "clickSel": ".resource-graph-game-button:not(.resource-graph-game-hardcore)" }, { "wait": 800 }, { "js": "await page.keyboard.down('ArrowLeft'); await page.keyboard.press('Space'); await page.waitForTimeout(700); await page.keyboard.up('ArrowLeft'); await page.keyboard.down('ArrowRight'); for(let i=0;i<6;i++){await page.keyboard.press('Space'); await page.waitForTimeout(450);} await page.keyboard.up('ArrowRight'); await page.evaluate(() => document.querySelectorAll('*').forEach(e => { e.scrollTop = 0 }))" }, { "wait": 300 }] }, + { "id": "ai-agents-dialog", "out": { "dark": "ai-coding-agents/ai-agents-dialog.png", "light": "ai-coding-agents/ai-agents-dialog-light.png" }, "route": "resources", "steps": [{ "clickSel": "[aria-label*='Help' i]" }, { "wait": 800 }, { "click": "AI agents" }, { "wait": 800 }] }, + { "id": "metrics-table-view", "out": { "dark": "explore/metrics-table-view.png", "light": "explore/metrics-table-view-light.png" }, "collapseSidebar": true, "route": "metrics/resource/webfrontend", "steps": [{ "js": "await page.getByText('Microsoft.AspNetCore.Hosting').first().click()" }, { "wait": 1200 }, { "js": "await page.getByText('http.server.request.duration').first().click()" }, { "wait": 1200 }, { "click": "Table" }, { "wait": 1200 }] }, + { "id": "resource-stop-action", "autoCrop": true, "out": { "dark": "explore/resource-stop-action.png", "light": "explore/resource-stop-action-light.png" }, "route": "resources", "steps": [{ "js": "const b=page.locator(\"[aria-label='Start cache']\"); if(await b.count()){ await b.first().click({force:true}); await page.waitForTimeout(8000); }" }, { "hoverSel": ".resource-row:has-text('cache')" }, { "wait": 400 }], "callouts": ["[aria-label='Stop cache']"] }, + { "id": "resource-stopped-action", "autoCrop": true, "out": { "dark": "explore/resource-stopped-action.png", "light": "explore/resource-stopped-action-light.png" }, "route": "resources", "steps": [{ "js": "const b=page.locator(\"[aria-label='Start cache']\"); if(await b.count()){ await b.first().click({force:true}); await page.waitForTimeout(8000); }" }, { "js": "await page.locator('.resource-row:has-text(\"cache\")').first().hover(); await page.locator(\"[aria-label='Stop cache']\").first().click({force:true}); await page.waitForTimeout(6000)" }, { "hoverSel": ".resource-row:has-text('cache')" }, { "wait": 400 }], "callouts": ["[aria-label='Start cache']"] }, + { "id": "resource-started-action", "autoCrop": true, "out": { "dark": "explore/resource-started-action.png", "light": "explore/resource-started-action-light.png" }, "route": "resources", "steps": [{ "js": "const b=page.locator(\"[aria-label='Start cache']\"); if(await b.count()){ await b.first().click({force:true}); await page.waitForTimeout(8000); }" }, { "hoverSel": ".resource-row:has-text('cache')" }, { "wait": 400 }], "callouts": ["[aria-label='Restart cache']"] }, + { "id": "resources-filtered-containers", "autoCrop": true, "out": { "dark": "explore/resources-filtered-containers.png", "light": "explore/resources-filtered-containers-light.png" }, "route": "resources", "steps": [{ "clickSel": "[aria-label='Filters']" }, { "wait": 600 }, { "js": "for (const n of ['Project','Executable','Telemetry sources']) await page.getByRole('checkbox',{name:n}).first().click({force:true})" }, { "wait": 300 }, { "click": "OK" }, { "wait": 800 }] }, + { "id": "notification-center-bell", "autoCrop": true, "out": { "dark": "explore/notification-center-bell.png", "light": "explore/notification-center-bell-light.png" }, "route": "resources", "callouts": ["[aria-label*='Notification' i]"] }, + { "id": "notification-center-response", "out": { "dark": "explore/notification-center-response.png", "light": "explore/notification-center-response-light.png" }, "route": "resources", "steps": [{ "wait": 2500 }, { "hoverSel": ".resource-row:has-text('webfrontend')" }, { "js": "await page.locator(\"[aria-label='Actions for webfrontend']\").first().click({force:true})" }, { "wait": 600 }, { "js": "await page.getByRole('menuitem',{name:'Rebuild'}).click({force:true})" }, { "wait": 15000 }, { "js": "await page.getByRole('button',{name:'Notifications'}).first().click({force:true})" }, { "wait": 1000 }, { "js": "await page.getByText('View response').first().click({force:true})" }, { "wait": 1200 }] }, + { "id": "text-visualizer-resources", "out": { "dark": "explore/text-visualizer-resources.png", "light": "explore/text-visualizer-resources-light.png" }, "route": "resources/cache", "steps": [{ "wait": 2500 }, { "js": "await page.locator(\"[aria-label='Open in text visualizer']\").nth(1).click({force:true})" }, { "wait": 1000 }] }, + { "id": "text-visualizer-selection-menu", "out": { "dark": "explore/text-visualizer-selection-menu.png", "light": "explore/text-visualizer-selection-menu-light.png" }, "route": "resources/cache", "steps": [{ "wait": 2500 }, { "js": "await page.locator(\"[aria-label='Open in text visualizer']\").nth(1).click({force:true})" }, { "wait": 1000 }, { "js": "await page.getByRole('combobox').last().click()" }, { "wait": 500 }] }, + { "id": "structured-logs-trace-errors", "autoCrop": true, "out": { "dark": "explore/structured-logs-trace-errors.png", "light": "explore/structured-logs-trace-errors-light.png" }, "thumb": { "dark": "explore/structured-logs-errors-view-thumb.png", "width": 1285 }, "collapseSidebar": true, "route": "structuredlogs?logLevel=error", "steps": [{ "js": "const id = await page.evaluate(()=>[...document.querySelectorAll('a')].find(a=>a.href.includes('/traces/detail/')).href.split('/traces/detail/')[1].split('?')[0]); await page.goto(page.url().split('/structuredlogs')[0]+'/structuredlogs?traceId='+id)" }, { "wait": 2500 }] }, + { "id": "trace-view-errors", "autoCrop": true, "out": { "dark": "explore/trace-view-errors.png", "light": "explore/trace-view-errors-light.png" }, "collapseSidebar": true, "route": "traces", "steps": [{ "js": "await page.locator('[role=row]').filter({hasText:'webfrontend: GET'}).nth(2).click()" }, { "wait": 2000 }] }, + { "id": "trace-view-filter", "autoCrop": true, "also": { "dark": ["explore/filter-spans-trace-details.png"], "light": ["explore/filter-spans-trace-details-light.png"] }, "out": { "dark": "explore/trace-view-filter.png", "light": "explore/trace-view-filter-light.png" }, "collapseSidebar": true, "route": "traces", "steps": [{ "click": "inventoryservice (6)" }, { "wait": 2500 }, { "js": "await page.getByPlaceholder('Filter...').last().click(); await page.waitForTimeout(600); await page.keyboard.type('redis', {delay:60})" }, { "wait": 800 }] }, + { "id": "metrics-view-count", "out": { "dark": "explore/metrics-view-count.png", "light": "explore/metrics-view-count-light.png" }, "collapseSidebar": true, "route": "metrics/resource/apiservice", "steps": [{ "js": "await page.getByText('Microsoft.AspNetCore.Hosting').first().click()" }, { "wait": 1500 }] }, + { "id": "metrics-page-exemplars", "out": { "dark": "explore/metrics-page-exemplars.png", "light": "explore/metrics-page-exemplars-light.png" }, "collapseSidebar": true, "route": "metrics/resource/webfrontend", "steps": [{ "js": "await page.getByText('Microsoft.AspNetCore.Hosting').first().click()" }, { "wait": 1200 }, { "js": "await page.getByText('http.server.request.duration').first().click()" }, { "wait": 1500 }] }, + { "id": "download-console-logs", "out": { "dark": "explore/download-console-logs.png", "light": "explore/download-console-logs-light.png" }, "collapseSidebar": true, "route": "consolelogs/resource/apiservice", "steps": [{ "js": "await page.locator(\"fluent-button.toolbar-button[aria-label='Settings']\").last().click()" }, { "wait": 600 }] }, + { "id": "trace-span-event-details", "height": 800, "out": { "dark": "explore/trace-span-event-details.png", "light": "explore/trace-span-event-details-light.png" }, "collapseSidebar": true, "route": "traces", "steps": [{ "js": "await page.locator('[role=row]').filter({hasText:'webfrontend: GET'}).nth(2).click()" }, { "wait": 2000 }, { "js": "await page.getByText('HTTP GET 200').first().click()" }, { "wait": 1200 }, { "js": "await page.getByText('Events', {exact:true}).last().click({timeout:2000}).catch(()=>{})" }, { "wait": 800 }] }, + { "id": "manage-data-expanded", "out": { "dark": "explore/manage-data-expanded.png", "light": "explore/manage-data-expanded-light.png" }, "route": "resources", "steps": [{ "clickSel": "[aria-label*='Settings' i]" }, { "wait": 600 }, { "click": "Manage" }, { "wait": 800 }, { "js": "await page.locator('fluent-dialog [role=row], [role=dialog] [role=row]').filter({hasText:'apiservice'}).first().locator('svg').first().click({force:true})" }, { "wait": 800 }] }, + { "id": "metrics-view-filtered", "out": { "dark": "explore/metrics-view-filtered.png", "light": "explore/metrics-view-filtered-light.png" }, "collapseSidebar": false, "height": 1000, "route": "metrics/resource/webfrontend?meter=Microsoft.AspNetCore.Hosting&instrument=http.server.request.duration&duration=5", "steps": [{ "wait": 3000 }, { "js": "const r=page.locator('[role=row], tr').filter({hasText:'http.response.status_code'}).first(); await r.locator('fluent-button, button, [role=button]').last().click({force:true})" }, { "wait": 800 }] } + ]} \ No newline at end of file diff --git a/.agents/skills/dashboard-screenshots/scripts/run.ts b/.agents/skills/dashboard-screenshots/scripts/run.ts new file mode 100644 index 0000000000..ad34ea428c --- /dev/null +++ b/.agents/skills/dashboard-screenshots/scripts/run.ts @@ -0,0 +1,316 @@ +// One-shot orchestrator: bun scripts/run.ts [--branch release/17.0] [--only ] [--inventory] [--verify] [--keep] +import { existsSync, mkdirSync, cpSync, readFileSync, writeFileSync, readdirSync, statSync, rmSync } from "node:fs"; +import { join, dirname, resolve } from "node:path"; +import { tmpdir } from "node:os"; +import sharp from "sharp"; +import recipeLib from "./recipes"; + +const args = process.argv.slice(2); +const opt = (n: string, d?: string) => { const i = args.indexOf(`--${n}`); return i >= 0 ? (args[i + 1]?.startsWith("--") || i + 1 >= args.length ? "true" : args[i + 1]) : d; }; +const branch = opt("branch", "main")!; +const only = opt("only"); +const skillDir = resolve(import.meta.dir, ".."); +const repoRoot = resolve(skillDir, "..", "..", ".."); +const assets = join(repoRoot, "src/frontend/src/assets/dashboard"); +const work = join(tmpdir(), "aspire-dashboard-shots"); +const clone = join(work, "aspire"); +const scratch = join(work, "w"); +const port = 17170; +let manifest: any; +const docsRoot = join(repoRoot, "src/frontend/src/content/docs"); +const log = (m: string) => console.log(`[dashboard-shots] ${m}`); + +// Discovery: inventory the images that exist, join them with the capture recipes, and write an +// ephemeral shots.json in the work dir. Nothing is committed; the file is removed after the run. +async function discover() { + const existing = new Set(); + const walk = (d: string) => readdirSync(d).forEach((f) => { + const p = join(d, f); + if (statSync(p).isDirectory()) return walk(p); + if (/\.png$/i.test(f)) existing.add(p.slice(assets.length + 1).replaceAll("\\", "/")); + }); + walk(assets); + const mdx: { file: string; text: string }[] = []; + const walkDocs = (d: string) => readdirSync(d).forEach((f) => { + const p = join(d, f); + if (statSync(p).isDirectory()) return walkDocs(p); + if (/\.mdx?$/.test(f)) mdx.push({ file: p, text: readFileSync(p, "utf8") }); + }); + if (existsSync(docsRoot)) walkDocs(docsRoot); + + const claimed = new Set(); + const recipes = (recipeLib as any).shots as any[]; + for (const s of recipes) for (const o of [s.out.dark, s.out.light, ...(s.also?.dark ?? []), ...(s.also?.light ?? []), s.thumb?.dark, s.thumb?.light]) if (o) claimed.add(o); + const unmapped = [...existing].filter((f) => !claimed.has(f)).sort(); + const isNew = recipes.filter((s) => !existing.has(s.out.dark)).map((s) => s.id); + const unreferenced = [...existing].filter((f) => !f.startsWith("landing/") && !mdx.some((m) => m.text.includes(f.split("/").pop()!.replace(/\.png$/, "")))).sort(); + + const resolved = { ...recipeLib, shots: recipes, discovered: { existing: existing.size, unmapped, newShots: isNew, unreferenced } }; + mkdirSync(scratch, { recursive: true }); + writeFileSync(join(scratch, "shots.json"), JSON.stringify(resolved, null, 2)); + log(`discovered ${existing.size} images, ${recipes.length} recipes`); + if (unmapped.length) log(`UNMAPPED images (no recipe; add one in scripts/recipes.ts or drop the image): ${unmapped.join(", ")}`); + if (isNew.length) log(`NEW shots (recipe exists, image missing; will be created): ${isNew.join(", ")}`); + if (unreferenced.length) log(`UNREFERENCED images (no doc embeds them): ${unreferenced.join(", ")}`); + manifest = JSON.parse(readFileSync(join(scratch, "shots.json"), "utf8")); +} +function removeManifest() { + if (!opt("keep")) rmSync(join(scratch, "shots.json"), { force: true }); +} +const sh = (cmd: string[], o: { cwd?: string; env?: Record; quiet?: boolean } = {}) => { + const r = Bun.spawnSync(cmd, { cwd: o.cwd, env: { ...process.env, ...o.env }, stdout: "pipe", stderr: "pipe" }); + return { ok: r.exitCode === 0, out: r.stdout.toString() + r.stderr.toString() }; +}; +// playwright-cli is a .cmd shim on Windows, which rejects code strings containing cmd special characters; run its node entry directly. +const pwEntry = (() => { + const root = sh(["npm", "root", "-g"]).out.trim(); + const js = join(root, "@playwright", "cli", "playwright-cli.js"); + return existsSync(js) ? js : undefined; +})(); +const pw = (session: string, ...a: string[]) => pwEntry ? sh(["node", pwEntry, `-s=${session}`, ...a]) : sh(["playwright-cli", `-s=${session}`, ...a]); + +async function inventory() { + const rows: string[] = ["file,width,height"]; + const walk = (d: string) => readdirSync(d).forEach((f) => { + const p = join(d, f); + if (statSync(p).isDirectory()) return walk(p); + return rows.push(`${p.slice(assets.length + 1)}`); + }); + walk(assets); + const out: string[] = []; + for (const r of rows.slice(1)) { + if (!/\.(png|jpg|webp)$/i.test(r)) { out.push(`${r},,`); continue; } + const m = await sharp(join(assets, r)).metadata(); + out.push(`${r},${m.width},${m.height}`); + } + mkdirSync(scratch, { recursive: true }); + writeFileSync(join(scratch, "inventory.csv"), ["file,width,height", ...out].join("\n")); + log(`inventory: ${out.length} files -> ${join(scratch, "inventory.csv")}`); +} + +function preflight() { + for (const t of ["git", "playwright-cli"]) if (!sh([process.platform === "win32" ? "where" : "which", t]).ok) throw new Error(`missing tool: ${t}`); +} + +function dotnetEnv() { + const dn = join(clone, ".dotnet"); + return { PATH: `${dn}${process.platform === "win32" ? ";" : ":"}${process.env.PATH}`, DOTNET_ROOT: dn, DOTNET_MULTILEVEL_LOOKUP: "0", DOTNET_NOLOGO: "1" }; +} + +function setup() { + mkdirSync(work, { recursive: true }); + if (!existsSync(clone)) { + log(`cloning microsoft/aspire@${branch}`); + if (!sh(["git", "clone", "--depth", "1", "--branch", branch, "https://github.com/microsoft/aspire.git", clone]).ok) throw new Error("clone failed"); + } else { + // The clone is cached between runs; always move it to the tip of the requested branch. + log(`refreshing cached clone to origin/${branch}`); + if (!sh(["git", "fetch", "--depth", "1", "origin", branch], { cwd: clone }).ok) throw new Error(`fetch of ${branch} failed`); + if (!sh(["git", "checkout", "--force", "FETCH_HEAD"], { cwd: clone }).ok) throw new Error(`checkout of ${branch} failed`); + } + const restore = process.platform === "win32" ? ["cmd", "/c", "restore.cmd"] : ["bash", "./restore.sh"]; + if (!existsSync(join(clone, ".dotnet"))) { log("restoring SDK (slow)"); if (!sh(restore, { cwd: clone }).ok) throw new Error("restore failed"); } + const dest = join(clone, "playground", "DashboardShots"); + cpSync(join(skillDir, "demo"), dest, { recursive: true }); + const dotnet = join(clone, ".dotnet", process.platform === "win32" ? "dotnet.exe" : "dotnet"); + log("building demo AppHost"); + const b = sh([dotnet, "build", join(dest, "AspireApp.AppHost")], { cwd: dest, env: dotnetEnv() }); + if (!b.ok) throw new Error("demo build failed:\n" + b.out.slice(-2000)); + return { dotnet, dest }; +} + +function startApp(dotnet: string, dest: string) { + const win = process.platform === "win32"; + const dllPath = win + ? sh(["powershell", "-NoProfile", "-Command", `(Get-ChildItem -Recurse '${clone}\\artifacts\\bin\\AspireApp.AppHost' -Filter AspireApp.AppHost.dll | select -First 1).FullName`]).out.trim() + : sh(["bash", "-c", `find ${clone}/artifacts/bin/AspireApp.AppHost -name AspireApp.AppHost.dll | head -1`]).out.trim(); + if (!dllPath) throw new Error("AspireApp.AppHost.dll not found after build"); + log(`starting AppHost on :${port}`); + return Bun.spawn([dotnet, dllPath], { + cwd: join(dest, "AspireApp.AppHost"), stdout: "ignore", stderr: "ignore", + env: { ...process.env, ...dotnetEnv(), ASPNETCORE_ENVIRONMENT: "Development", DOTNET_ENVIRONMENT: "Development", ASPNETCORE_URLS: `http://localhost:${port}`, ASPIRE_ALLOW_UNSECURED_TRANSPORT: "true", ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL: "http://localhost:17171", ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL: "http://localhost:17172", ASPIRE_DASHBOARD_UNSECURED_ALLOW_ANONYMOUS: "true" }, + }); +} + +async function waitReady() { + const until = Date.now() + 180_000; + let up = false; + while (Date.now() < until && !up) { + try { up = (await fetch(`http://localhost:${port}/`)).ok; } catch {} + if (!up) await Bun.sleep(2000); + } + if (!up) throw new Error(`dashboard did not respond on :${port} within 180s`); + log("dashboard up; letting telemetry accumulate (60s)"); + await Bun.sleep(60_000); +} + +const q = (s: string) => JSON.stringify(s); + +// Clears everything that is not the subject of a shot: top message bars (update, unsecured endpoint, +// feedback), toasts, and open popups. Runs after navigation and after every step unless a shot sets keepAlerts. +const DISMISS_JS = `const dismiss=async(move=true)=>{ + for(let i=0;i<10;i++){ + const bar=page.locator('.dashboard-message-bar-dismiss, .dashboard-message-bar [aria-label*="Dismiss" i]').first(); + const toast=page.locator('fluent-toast [aria-label*="Dismiss" i], fluent-toast [aria-label*="Close" i], .fluent-toast-provider button[aria-label*="Close" i]').first(); + let hit=false; + for(const t of [bar,toast]){ if(await t.count()){ await t.click({timeout:1500}).catch(()=>{}); hit=true; await page.waitForTimeout(250);} } + if(!hit)break; + } + if(move) await page.mouse.move(0,0); +};`; +function shotCode(shot: any, theme: "dark" | "light", file: string) { + const pad = manifest.padding; + const clear = shot.keepAlerts ? "" : "await dismiss();"; + const keepMouse = shot.keepAlerts ? "" : "await dismiss(false);"; + const final = shot.keepAlerts ? "" : "await dismiss(false); await page.waitForTimeout(600); await dismiss(false); await page.addStyleTag({content:'.top-messagebar,.fluent-message-bar-provider,.messagebar-container{display:none!important}'}); await page.waitForTimeout(200);"; + const steps = (shot.steps ?? []).map((s: any) => + (s.click ? `await page.getByText(${q(s.click)}).first().click();` : + s.closeDialog ? `await page.getByRole("button",{name:"Close",exact:true}).last().click();` : + s.clickSel ? `await page.locator(${q(s.clickSel)}).first().click();` : + s.hover ? `await page.getByText(${q(s.hover)}).first().hover();` : + s.hoverSel ? `await page.locator(${q(s.hoverSel)}).first().hover();` : + s.dragSel ? `{const bb = await page.locator(${q(s.dragSel)}).first().boundingBox(); await page.mouse.move(bb.x + bb.width / 2, bb.y + 300); await page.mouse.down(); await page.mouse.move(${Number(s.dragTo ?? 0)}, bb.y + 300, {steps: 10}); await page.mouse.up(); await page.mouse.move(1000, 2);}` : + s.fill ? `await page.locator(${q(s.fill[0])}).first().fill(${q(s.fill[1])});` : + s.press ? `await page.keyboard.press(${q(s.press)});` : + s.js ? `${s.js};` : + s.wait ? `await page.waitForTimeout(${s.wait});` : "") + (s.wait ? "" : keepMouse)).join("").replaceAll("{{Theme}}", theme === "dark" ? "Dark" : "Light"); + const callouts = (shot.callouts ?? []).map((c: string) => `{const e=page.locator(${q(c)}).first(); const b=await e.boundingBox(); if(b) await page.evaluate(b=>{const d=document.createElement('div');d.style.cssText='position:fixed;z-index:99999;pointer-events:none;border:3px solid #e8212e;left:'+(b.x-3)+'px;top:'+(b.y-3)+'px;width:'+(b.width+6)+'px;height:'+(b.height+6)+'px';document.body.appendChild(d);},b);}`).join(""); + const shoot = shot.clip + ? `const e=page.locator(${q(shot.clip)}).first(); const b=await e.boundingBox(); await page.screenshot({path:${q(file)},clip:{x:Math.max(0,b.x-${pad}),y:Math.max(0,b.y-${pad}),width:Math.min(${manifest.viewport.width},b.width+${pad * 2}),height:Math.min(${manifest.viewport.height},b.height+${pad * 2})}});` + : `await page.screenshot({path:${q(file)}});`; + return `async page => { ${DISMISS_JS} await page.setViewportSize({width:${manifest.viewport.width},height:${shot.height ?? manifest.viewport.height}}); await page.emulateMedia({colorScheme:${q(theme)}}); await page.goto(\x27http://localhost:${port}/\x27).catch(()=>{}); await page.evaluate(()=>localStorage.clear()).catch(()=>{}); await page.context().clearCookies(); await page.context().addCookies([{name:'currentTheme',value:'${theme === "dark" ? "Dark" : "Light"}',url:'http://localhost:${port}'}]); await page.goto('http://localhost:${port}/${shot.route}'); await page.waitForTimeout(3500); ${clear} await page.waitForTimeout(500); ${shot.collapseSidebar ? "{const c=page.locator(\"[aria-label=\x27Collapse resource list\x27]\").first(); if(await c.count()){await c.click({force:true}); await page.waitForTimeout(900);} await dismiss(false);}" : ""} ${steps} ${final} ${callouts} ${shoot} return 'ok:' + (await page.evaluate(()=>document.documentElement.dataset.theme)); }`.replace(/\r?\n/g, " "); +} + +// Crops trailing blank page area (keeping padding) so sparse pages like Resources do not ship as half-empty images. +async function autoCrop(file: string): Promise { + const { data, info } = await sharp(file).removeAlpha().raw().toBuffer({ resolveWithObject: true }); + const s = manifest.viewport.deviceScaleFactor; + const footer = 100 * s / 2; // fixed status bar at the bottom of every page + const limit = info.height - footer; + const at = (x: number, y: number) => (y * info.width + x) * 3; + const bg = at(8, limit - 8); + let last = 0; + for (let y = limit - 1; y > 0 && !last; y--) + for (let x = 0; x < info.width; x += 2) { + const i = at(x, y); + if (Math.abs(data[i] - data[bg]) + Math.abs(data[i + 1] - data[bg + 1]) + Math.abs(data[i + 2] - data[bg + 2]) > 24) { last = y; break; } + } + const height = Math.min(info.height, Math.max(Math.round(info.height * 0.5), last + manifest.padding * s * 2)); + return sharp(file).extract({ left: 0, top: 0, width: info.width, height }).png({ compressionLevel: 9 }).toBuffer(); +} + +async function capture() { + mkdirSync(scratch, { recursive: true }); + const cfg = join(scratch, "cfg.json"); + writeFileSync(cfg, JSON.stringify({ browser: { contextOptions: { viewport: { width: manifest.viewport.width, height: manifest.viewport.height }, deviceScaleFactor: manifest.viewport.deviceScaleFactor } } })); + pw("shots", "close"); + let o = pw("shots", "open", `http://localhost:${port}`, "--browser=msedge", `--config=${cfg}`); + if (!o.ok) o = pw("shots", "open", `http://localhost:${port}`, `--config=${cfg}`); + const failed: string[] = []; + const done: string[] = []; + for (const shot of manifest.shots.filter((s: any) => !only || only.split(",").some((o: string) => s.id.includes(o)))) { + for (const theme of ["dark", "light"] as const) { + const base = join(scratch, `${shot.id}-${theme}`); + let tmp = ""; + let ok = false; + for (let attempt = 0; attempt < 2 && !ok; attempt++) { + tmp = `${base}-${Date.now()}-${attempt}.png`; + const r = pw("shots", "run-code", shotCode(shot, theme, tmp.replace(/\\/g, "/"))); + ok = r.ok && existsSync(tmp) && !/### Error/.test(r.out) && r.out.includes(`ok:${theme}`); + if (!ok) console.error(`${shot.id}/${theme} attempt ${attempt}: ${r.out.split("\n").filter((l: string) => /Error|error/.test(l)).slice(0, 3).join(" | ")}`); + } + if (!ok) { failed.push(`${shot.id}/${theme}`); continue; } + const dest = join(assets, shot.out[theme]); + mkdirSync(dirname(dest), { recursive: true }); + const buf = shot.clip || shot.autoCrop !== true ? await sharp(tmp).png({ compressionLevel: 9 }).toBuffer() : await autoCrop(tmp); + await sharp(buf).toFile(dest); + done.push(shot.out[theme]); + // Extra file names that docs reference for the same capture (e.g. legacy "-dark" duplicates). + for (const extra of shot.also?.[theme] ?? []) { await sharp(buf).toFile(join(assets, extra)); done.push(extra); } + // Reduced-size copy for thumbnails. + if (shot.thumb?.[theme]) { await sharp(buf).resize({ width: shot.thumb.width }).png({ compressionLevel: 9 }).toFile(join(assets, shot.thumb[theme])); done.push(shot.thumb[theme]); } + } + } + if (!opt("keep")) pw("shots", "close"); + return { done, failed }; +} + +// Theme contract: every shot is captured once per theme (dark = the bare name, light = "-light"; a "-dark" suffix is never used), +// and docs must reference both through so the right one shows per site theme. +function checkThemePairs(): string[] { + const issues: string[] = []; + const docs = join(repoRoot, "src/frontend/src"); + const text: { file: string; body: string }[] = []; + const walk = (d: string) => readdirSync(d).forEach((f) => { + const p = join(d, f); + if (statSync(p).isDirectory()) return f === "node_modules" || f === "assets" ? undefined : walk(p); + if (/\.(mdx|astro)$/.test(f)) text.push({ file: p, body: readFileSync(p, "utf8") }); + }); + walk(docs); + for (const s of manifest.shots) { + const { dark, light } = s.out; + if (/-dark\.[a-z]+$/.test(dark) || (s.also?.dark ?? []).some((d) => /-dark\.[a-z]+$/.test(d))) issues.push(`${s.id}: dark names must not use a "-dark" suffix`); + const expected = dark.replace(/\.png$/, "-light.png"); + if (light !== expected && !s.legacyLight) issues.push(`${s.id}: light "${light}" should be "${expected}"`); + for (const f of [dark, light]) if (!existsSync(join(assets, f))) issues.push(`${s.id}: missing ${f}`); + const darks = [dark, ...(s.also?.dark ?? [])]; + const refs = text.filter((t) => darks.some((d) => t.body.includes(`/${d}`)) || t.body.includes(`/${light}`)); + for (const r of refs) { + const both = darks.some((d) => r.body.includes(`/${d}`)) && r.body.includes(`/${light}`); + const themed = r.body.includes("ThemeImage") || r.body.includes("theme-image") || r.body.includes("darkImage"); + if (!both) issues.push(`${s.id}: ${r.file.slice(repoRoot.length + 1)} references only one theme`); + else if (!themed) issues.push(`${s.id}: ${r.file.slice(repoRoot.length + 1)} should use `); + } + } + return issues; +} + +async function verify(done: string[]) { + const issues: string[] = checkThemePairs(); + for (const f of done) { + const { data, info } = await sharp(join(assets, f)).raw().toBuffer({ resolveWithObject: true }); + if (info.width < 1000) issues.push(`${f}: narrow ${info.width}px`); + // Shrinking the viewport squeezes the dashboard layout (footer overlaps content), so a short full-page image is a bad capture. + const isClip = manifest.shots.some((s: any) => s.clip && [s.out.dark, s.out.light, ...(s.also?.dark ?? []), ...(s.also?.light ?? []), s.thumb?.dark, s.thumb?.light].includes(f)); + const isThumb = manifest.shots.some((s: any) => s.thumb && [s.thumb.dark, s.thumb.light].includes(f)); + if (!isClip && !isThumb && info.height < manifest.viewport.height * manifest.viewport.deviceScaleFactor * 0.5) issues.push(`${f}: too short (${info.height}px) - do not set a small "height"; use autoCrop or clip`); + // fraction of pixels equal to the dominant background colour in the bottom third + let same = 0, total = 0; + const ref = data.subarray(((info.height - 1) * info.width + Math.floor(info.width / 2)) * info.channels, ((info.height - 1) * info.width + Math.floor(info.width / 2)) * info.channels + 3); + for (let y = Math.floor(info.height * 0.6); y < info.height; y += 4) + for (let x = 0; x < info.width; x += 4) { const i = (y * info.width + x) * info.channels; total++; if (Math.abs(data[i] - ref[0]) + Math.abs(data[i + 1] - ref[1]) + Math.abs(data[i + 2] - ref[2]) < 6) same++; } + if (same / total > 0.9) issues.push(`${f}: bottom 40% is ${(100 * same / total).toFixed(0)}% blank - consider clip`); + } + return issues; +} + +async function main() { + if (opt("inventory")) { await inventory(); await discover(); return removeManifest(); } + preflight(); + await inventory(); + await discover(); + if (opt("attach")) { + const { done, failed } = await capture(); + const issues = await verify(done); + removeManifest(); + return log(`attached: captured ${done.length}, failed ${failed.length} ${failed.join(" ")}\n${issues.join("\n")}`); + } + const { dotnet, dest } = setup(); + const app = startApp(dotnet, dest); + try { + await waitReady(); + const { done, failed } = await capture(); + const issues = await verify(done); + const report = [`captured: ${done.length}`, `failed: ${failed.length}`, ...failed.map((f) => ` FAIL ${f}`), `issues: ${issues.length}`, ...issues.map((i) => ` WARN ${i}`)].join("\n"); + writeFileSync(join(scratch, "report.md"), report); + log("\n" + report); + } finally { + removeManifest(); + if (!opt("keep")) { + sh(process.platform === "win32" ? ["taskkill", "/PID", String(app.pid), "/T", "/F"] : ["kill", String(app.pid)]); + // Child resources can outlive the AppHost; stop anything still running from the clone's build output. + if (process.platform === "win32") sh(["powershell", "-NoProfile", "-Command", `Get-Process | ? { $_.Path -like '${clone}\\artifacts\\*' } | Stop-Process -Force`]); + } + } +} +main(); diff --git a/.agents/skills/dashboard-screenshots/scripts/sheet.ts b/.agents/skills/dashboard-screenshots/scripts/sheet.ts new file mode 100644 index 0000000000..9033693d39 --- /dev/null +++ b/.agents/skills/dashboard-screenshots/scripts/sheet.ts @@ -0,0 +1,18 @@ +// Review aid: bun scripts/sheet.ts +// Tiles the given images (downscaled, in order, 3 per row) into one PNG so many captures can be checked at a glance. +import { join, resolve } from "node:path"; +import sharp from "sharp"; + +const [out, ...files] = process.argv.slice(2); +const assets = resolve(import.meta.dir, "../../../../src/frontend/src/assets/dashboard"); +const cols = 3, cell = 640; +const tiles = await Promise.all(files.map(async (f) => { + const img = sharp(join(assets, f)).resize({ width: cell, height: cell, fit: "inside", background: "#888" }); + return { input: await img.toBuffer() }; +})); +const rows = Math.ceil(tiles.length / cols); +const rowH = cell; +await sharp({ create: { width: cols * (cell + 8), height: rows * (rowH + 8), channels: 3, background: "#777" } }) + .composite(tiles.map((t, i) => ({ ...t, left: (i % cols) * (cell + 8), top: Math.floor(i / cols) * (rowH + 8) }))) + .png().toFile(out); +console.log(`${files.length} tiles -> ${out}`); diff --git a/.agents/skills/doc-pr-reviewer/SKILL.md b/.agents/skills/doc-pr-reviewer/SKILL.md index ff1c4d8c8b..f3e2ff93dc 100644 --- a/.agents/skills/doc-pr-reviewer/SKILL.md +++ b/.agents/skills/doc-pr-reviewer/SKILL.md @@ -94,7 +94,7 @@ The docs site provides placeholders for current-version values: Flag hard-coded Aspire versions as a review finding when they appear in current copy/paste guidance that should track the active release, including: -- `Aspire.AppHost.Sdk` declarations in project files or file-based apps. +- `Aspire.Hosting.*` package references in AppHost project files. - `#:package Aspire.*@...` file-based app package directives. - Aspire CLI or AppHost sample output that reports the current CLI/AppHost version. @@ -117,6 +117,16 @@ Do **not** require placeholders for intentionally fixed versions, including: If the intent is ambiguous, leave a `COMMENT` asking whether the version should track the current release instead of requesting changes outright. +## Legacy .NET project API review + +Flag new or edited evergreen AppHost samples that use the obsolete +`AddProject`/`addProject`, `AddCSharpApp`/`addCSharpApp`, `Projects.*` types, +`Aspire.AppHost.Sdk`, or `#:sdk` directives. Current samples use +`AddDotnetProject("name", "path")` from `Aspire.Hosting.Dotnet`, and C# AppHosts +use `Microsoft.NET.Sdk` with package references. Don't flag historical +what's-new pages, the [migration guide](/integrations/dotnet/migrate-dotnet-project-resource/), +or diagnostics that describe the legacy APIs. + ## Phase A artifact When Phase A finishes, write down (in memory) a frozen Phase A result containing: diff --git a/.agents/skills/doc-writer/SKILL.md b/.agents/skills/doc-writer/SKILL.md index 6b84f2070d..3701341183 100644 --- a/.agents/skills/doc-writer/SKILL.md +++ b/.agents/skills/doc-writer/SKILL.md @@ -410,7 +410,7 @@ Always include a descriptive title: ```csharp title="AppHost.cs" var builder = DistributedApplication.CreateBuilder(args); -var api = builder.AddProject("api"); +var api = builder.AddDotnetProject("api", "../Api/Api.csproj"); // After adding all resources, run the app... builder.Build().Run(); @@ -423,7 +423,7 @@ import { createBuilder } from "./.aspire/modules/aspire.mjs"; const builder = await createBuilder(); -const api = await builder.addProject("api", "../Api/Api.csproj"); +const api = await builder.addDotnetProject("api", "../Api/Api.csproj"); await builder.build().run(); ``` @@ -455,21 +455,21 @@ For client/library packages: ``` -## AppHost Language Parity (TypeScript and C#) +## AppHost Language Parity (TypeScript, C#, and Go) -Aspire supports both **TypeScript AppHosts** (`apphost.mts`) and **C# AppHosts** (`AppHost.cs`). Documentation must treat both languages as first-class citizens. **Always show both TypeScript and C# code samples for AppHost code unless the feature is genuinely language-specific or TypeScript support does not exist yet.** Never write AppHost or hosting-integration documentation with a C#-only bias. +Aspire supports **TypeScript AppHosts** (`apphost.mts`), **C# AppHosts** (`AppHost.cs`), and **Go AppHosts** (`apphost.go`). Documentation must treat all three languages as first-class citizens. **Always show TypeScript, C#, and Go code samples for AppHost code unless the feature is genuinely language-specific or support for a language does not exist yet.** Never write AppHost or hosting-integration documentation with a C#-only bias. ### Core Principles -1. **Always show both languages**: Every AppHost-focused example, walkthrough, and AppHost code sample must include both TypeScript and C# variants unless the feature is genuinely language-specific. -2. **Show implementations, not availability notes**: When a TypeScript AppHost API exists, demonstrate it in a complete TypeScript tab beside the C# example. A note or callout that only names the available TypeScript methods does not satisfy language parity. -3. **Use neutral framing**: Write prose that applies to both languages. Say "In your AppHost" not "In your C# project". Say "Add a Redis resource" not "Call `builder.AddRedis()`". -4. **Default to TypeScript**: Put the TypeScript tab first so `apphost.mts` is on the left and selected for readers without a saved preference. Keep C# as an equal peer and preserve the reader's explicit language selection. -5. **Verify TypeScript APIs exist**: Before writing a TypeScript example, confirm the API exists in the TypeScript AppHost SDK. Do not invent TypeScript samples — if you are unsure whether an API is available, flag it for review. +1. **Always show every language**: Every AppHost-focused example, walkthrough, and AppHost code sample must include TypeScript, C#, and Go variants unless the feature is genuinely language-specific. +2. **Show implementations, not availability notes**: When a TypeScript or Go AppHost API exists, demonstrate it in a complete tab beside the C# example. A note or callout that only names the available methods does not satisfy language parity. +3. **Use neutral framing**: Write prose that applies to every language. Say "In your AppHost" not "In your C# project". Say "Add a Redis resource" not "Call `builder.AddRedis()`". +4. **Default to TypeScript**: Put the TypeScript tab first so `apphost.mts` is on the left and selected for readers without a saved preference. Keep C# and Go as equal peers, in the order TypeScript, C#, Go, and preserve the reader's explicit language selection. +5. **Verify APIs exist**: Before writing a TypeScript or Go example, confirm the API exists in that language's AppHost SDK (the generated API data under `src/frontend/src/data/ts-modules` and `go-modules`, or a compile check against a real Go AppHost). Do not invent samples — if you are unsure whether an API is available, flag it for review. Go samples must compile: unused variables fail, ports are `*int` (`aspire.IntPtr`), and options are structs such as `&aspire.WithHttpEndpointOptions{...}`. ### AppHost tabs pattern for AppHost content -Use synced `Tabs` for AppHost-specific content that changes between TypeScript and C#. Each AppHost code snippet should provide its own language tabs, list TypeScript first, and use `syncKey='aspire-lang'` so the user's language choice stays synchronized across snippets on the page. +Use synced `Tabs` for AppHost-specific content that changes between languages. Each AppHost code snippet should provide its own language tabs, list TypeScript first, and use `syncKey='aspire-lang'` so the user's language choice stays synchronized across snippets on the page. ````mdx import { Tabs, TabItem } from "@astrojs/starlight/components"; @@ -484,7 +484,7 @@ const builder = await createBuilder(); const cache = await builder.addRedis("cache"); -const api = await builder.addProject("api", "../Api/Api.csproj"); +const api = await builder.addDotnetProject("api", "../Api/Api.csproj"); await api.withReference(cache); await builder.build().run(); @@ -498,17 +498,49 @@ var builder = DistributedApplication.CreateBuilder(args); var cache = builder.AddRedis("cache"); -builder.AddProject("api") +builder.AddDotnetProject("api", "../Api/Api.csproj") .WithReference(cache); builder.Build().Run(); ``` + + + +```go title="apphost.go" +package main + +import ( + "log" + + "apphost/modules/aspire" +) + +func main() { + builder, err := aspire.CreateBuilder() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + + cache := builder.AddRedis("cache") + builder.AddDotnetProject("api", "../Api/Api.csproj"). + WithReference(cache) + + app, err := builder.Build() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + if err := app.Run(); err != nil { + log.Fatal(aspire.FormatError(err)) + } +} +``` + ```` -Use the same synced tabs pattern for more than code blocks when needed. Entire paragraphs, lists, asides, or multi-step sections can live inside the `csharp` and `typescript` tab items when the workflows differ. +Use the same synced tabs pattern for more than code blocks when needed. Entire paragraphs, lists, asides, or multi-step sections can live inside the `csharp`, `typescript`, and `go` tab items when the workflows differ. Use different `syncKey` values for other concerns such as CLI vs IDE, deployment targets, platform choices, or package managers. For AppHost language tabs, use exactly `syncKey='aspire-lang'`. @@ -516,15 +548,24 @@ If a section heading should appear in the **On this page** table of contents, ke ### Conventions -| Aspect | TypeScript | C# | -| ---------------- | ------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------- | -| File title | `title="apphost.mts"` | `title="AppHost.cs"` | -| Tab wrapper | Shared `` container | Shared `` container | -| Tab item | `` | `` | -| Builder creation | `import { createBuilder } from './.aspire/modules/aspire.mjs';` then newline for space followed by `await createBuilder();` | `DistributedApplication.CreateBuilder(args)` | -| Method casing | camelCase (`addRedis`) | PascalCase (`AddRedis`) | -| Async pattern | `await` each builder call | Synchronous fluent calls | -| Build & run | `await builder.build().run()` | `builder.Build().Run()` | +| Aspect | TypeScript | C# | Go | +| ---------------- | ------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------- | -------------------------------------------------------- | +| File title | `title="apphost.mts"` | `title="AppHost.cs"` | `title="apphost.go"` | +| Tab wrapper | Shared `` container | Shared `` container | Shared `` container | +| Tab item | `` | `` | `` | +| Builder creation | `import { createBuilder } from './.aspire/modules/aspire.mjs';` then newline for space followed by `await createBuilder();` | `DistributedApplication.CreateBuilder(args)` | `aspire.CreateBuilder()` (returns `builder, err`) | +| Method casing | camelCase (`addRedis`) | PascalCase (`AddRedis`) | PascalCase (`AddRedis`) | +| Async pattern | `await` each builder call | Synchronous fluent calls | Synchronous fluent calls; errors surface at `Build()` | +| Build & run | `await builder.build().run()` | `builder.Build().Run()` | `app, err := builder.Build()` then `app.Run()` | + +### .NET projects in AppHost samples + +Add .NET projects with `AddDotnetProject("name", "path")` (`addDotnetProject` in TypeScript and `AddDotnetProject` in Go) from the `Aspire.Hosting.Dotnet` integration. The path can be a `.csproj` file, a directory containing one project, or a file-based `.cs` app. + +- Do **not** use the obsolete `AddProject()`, `AddProject("name", "path")`, `addProject`, `AddCSharpApp`, or `addCSharpApp` APIs in new or updated evergreen docs. They return the legacy `ProjectResource`. +- Do **not** show `Aspire.AppHost.Sdk` in project files or `#:sdk` in file-based apps. C# AppHosts use `Microsoft.NET.Sdk` with `Aspire.Hosting.AppHost` and `Aspire.Hosting.Dotnet` package references (`#:package` directives in file-based apps). +- When a page needs to mention the legacy APIs, keep it to a short `:::note[Upgrading to Aspire 17?]` that links to [Migrate to the new DotnetProjectResource](/integrations/dotnet/migrate-dotnet-project-resource/). Don't add history to evergreen pages. +- Historical what's-new pages and diagnostics about the legacy APIs (such as `ASPIRE012` and `ASPIRECSHARPAPPS001`) are the exceptions. ### Prose Guidelines @@ -537,9 +578,9 @@ When writing narrative text around AppHost examples: When a concept differs between languages (e.g., configuration files, async patterns), explain both within the AppHost language tabs or in language-neutral prose above the tabs. -### When TypeScript Is Not Yet Supported +### When a Language Is Not Yet Supported -If a hosting integration does not yet have TypeScript AppHost support, show only the C# example without language tabs and add a note: +If a hosting integration does not yet have TypeScript or Go AppHost support, omit that language's tab and add a note naming it (for example, "Go AppHost support for this integration is not yet available."): ```mdx ``` -Do **not** wrap a single language in a single-language `` component — that creates a misleading UI suggesting another option exists. +Do **not** wrap a single language in a single-language `` component — that creates a misleading UI suggesting another option exists. Integration cards show the Go link only when the target article has a `("api") + builder.AddDotnetProject("api", "../Api/Api.csproj") .WithReference(redis) .WithExternalHttpEndpoints(); ``` @@ -27,7 +27,7 @@ The following rules are derived from common feedback patterns in documentation P ❌ Incorrect (aligned indentation): ```csharp - builder.AddProject("api") + builder.AddDotnetProject("api", "../Api/Api.csproj") .WithReference(redis) .WithExternalHttpEndpoints(); ``` diff --git a/.agents/skills/doc-writer/references/integration-documentation.md b/.agents/skills/doc-writer/references/integration-documentation.md index f8b9be0e52..c29e4918d0 100644 --- a/.agents/skills/doc-writer/references/integration-documentation.md +++ b/.agents/skills/doc-writer/references/integration-documentation.md @@ -76,6 +76,36 @@ var tech = builder.AddTechnology("tech"); builder.Build().Run(); ``` + + + +```go title="apphost.go" +package main + +import ( + "log" + + "apphost/modules/aspire" +) + +func main() { + builder, err := aspire.CreateBuilder() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + + tech := builder.AddTechnology("tech") + + app, err := builder.Build() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + if err := app.Run(); err != nil { + log.Fatal(aspire.FormatError(err)) + } +} +``` + @@ -110,7 +140,7 @@ const builder = await createBuilder(); const tech = await builder.addTechnology("tech"); -const api = await builder.addProject("api", "../Api/Api.csproj"); +const api = await builder.addDotnetProject("api", "../Api/Api.csproj"); await api.withReference(tech); await builder.build().run(); @@ -124,12 +154,44 @@ var builder = DistributedApplication.CreateBuilder(args); var tech = builder.AddTechnology("tech"); -builder.AddProject("api") +builder.AddDotnetProject("api", "../Api/Api.csproj") .WithReference(tech); builder.Build().Run(); ``` + + + +```go title="apphost.go" +package main + +import ( + "log" + + "apphost/modules/aspire" +) + +func main() { + builder, err := aspire.CreateBuilder() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + + tech := builder.AddTechnology("tech") + builder.AddDotnetProject("api", "../Api/Api.csproj"). + WithReference(tech) + + app, err := builder.Build() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + if err := app.Run(); err != nil { + log.Fatal(aspire.FormatError(err)) + } +} +``` + diff --git a/.agents/skills/update-integrations/SKILL.md b/.agents/skills/update-integrations/SKILL.md index 31736e2022..9322e7e0a8 100644 --- a/.agents/skills/update-integrations/SKILL.md +++ b/.agents/skills/update-integrations/SKILL.md @@ -7,8 +7,7 @@ description: Update integration documentation links and API reference data by sy This skill synchronizes the integration package catalog with documentation URL mappings and generates per-package API reference schemas. It ensures every NuGet package listed in the integrations data file has a corresponding documentation link and an up-to-date API reference JSON file. -> **Automation note:** The scheduled `update-integration-data` workflow (`.github/workflows/update-integration-data.yml`) runs this update deterministically — no agent/LLM. It executes `src/frontend/scripts/update-integration-data.ps1`, which runs `bun run update:all`, detects `"version":` changes in `src/frontend/src/data/aspire-integrations.json`, and — only when a version actually moves — runs the C# and TypeScript API regeneration (and the twoslash bundle) before opening or refreshing a PR via the Aspire bot GitHub App. That PR is approved and squash-merged automatically by `.github/policies/auto-merge.yml` once the required `ci-gate` check passes; removing its `:octocat: auto-merge` label holds it for manual review. You can reproduce the full flow locally with `pwsh src/frontend/scripts/update-integration-data.ps1` (add `-SkipRegen` for a fast data-only run). Use this skill for **manual or one-off runs that need judgment** — for example: adding a new integration, reconciling `integration-docs.json`, validating release-branch feed resolution, troubleshooting a regen failure flagged by the workflow's PR, or regenerating data outside the scheduled cadence. - +> **Automation note:** The scheduled `update-integration-data` workflow (`.github/workflows/update-integration-data.yml`) runs this update deterministically — no agent/LLM. It executes `src/frontend/scripts/update-integration-data.ps1`, which runs `bun run update:all`, detects `"version":` changes in `src/frontend/src/data/aspire-integrations.json`, and — only when a version actually moves — runs the C#, TypeScript, and Go API regeneration (and the twoslash bundle) before opening or refreshing a PR via the Aspire bot GitHub App. That PR is approved and squash-merged automatically by `.github/policies/auto-merge.yml` once the required `ci-gate` check passes; removing its `:octocat: auto-merge` label holds it for manual review. You can reproduce the full flow locally with `pwsh src/frontend/scripts/update-integration-data.ps1` (add `-SkipRegen` for a fast data-only run). Use this skill for **manual or one-off runs that need judgment** — for example: adding a new integration, reconciling `integration-docs.json`, validating release-branch feed resolution, troubleshooting a regen failure flagged by the workflow's PR, or regenerating data outside the scheduled cadence. ## Overview The automated flow also reconciles documentation mappings and runs `bun run test:unit:structured-data` before API regeneration or PR creation. This uses a data-only Vitest configuration so validation does not rewrite Astro's generated assets. Mapping changes are included in the generated PR. @@ -19,9 +18,10 @@ The aspire.dev site maintains three key data locations: - **`src/frontend/src/data/integration-docs.json`** — Mappings from package names to site-relative documentation URLs. - **`src/frontend/src/data/pkgs/`** — Per-package API reference JSON files (e.g. `Aspire.Hosting.Redis.13.1.2.json`) generated by the `PackageJsonGenerator` tool. These feed the auto-generated API reference pages at `/reference/api/`. - **`src/frontend/src/data/ts-modules/`** — Per-package TypeScript API reference JSON files (e.g. `Aspire.Hosting.Redis.13.2.0.json`) generated by the `AtsJsonGenerator` tool. These feed the auto-generated TypeScript API reference pages at `/reference/api/typescript/`. +- **`src/frontend/src/data/go-modules/`** — Per-package Go API reference JSON files (e.g. `Aspire.Hosting.Redis.13.2.0.json`) generated by the `AtsJsonGenerator` tool in Go mode. These feed the auto-generated Go API reference pages at `/reference/api/go/`. - **`src/frontend/src/data/twoslash/aspire.d.ts`** — A single consolidated TypeScript declaration bundle generated from the `ts-modules` JSON by `scripts/generate-twoslash-types.ts`. Consumed by `expressive-code-twoslash` to provide hover tooltips for TypeScript code samples in the docs. **Source-controlled** — commit the diff whenever `ts-modules` changes. -This skill keeps the documentation mappings in sync with the package catalog and regenerates both the C# and TypeScript API reference data. +This skill keeps the documentation mappings in sync with the package catalog and regenerates the C#, TypeScript, and Go API reference data. ## Prerequisites @@ -290,6 +290,18 @@ After the JSON is refreshed, `update-ts-api` automatically chains `generate-twos cd src/frontend && bun run twoslash-types ``` +### 5b. Generate Go API reference data + +After the TypeScript data is refreshed, regenerate the Go API reference JSON files from the same package set: + +```bash +cd src/frontend && bun run update:go-api +``` + +`update-go-api.ts` runs the same `generate-ts-api-json.ps1` script as `update:ts-api`, with `-Language go`. Each package is dumped with `aspire sdk dump` exactly as for TypeScript, and the `AtsJsonGenerator` Go mode then renders the dump with the names and signatures that `aspire sdk generate --language go` produces: a flat `aspire` package, `...*Options` structs for optional parameters, and `(T, error)` returns. Package selection, parallelism, retries, tolerated scanner diagnostics, and stale-version cleanup behave as described in 5a. Set `ASPIRE_API_GO_MODULES_DIR` to redirect the output; the orchestrator uses it to stage the output before publishing. Capabilities that have no concrete Go type are skipped, and the generator output lists them. There is no twoslash bundle for Go. + +The generated Go JSON is normalized with `normalize-generated-api-data.ts`, like the other generated API data. See the `AtsJsonGenerator` README for the Go output format and its known limitations. + ### 6. Verify all links For every entry in the updated `integration-docs.json`: diff --git a/.gitattributes b/.gitattributes index 9356b622c6..a341c2e83b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -12,6 +12,9 @@ bun.lock text eol=lf src/frontend/public/.well-known/agent-skills/**/*.md text eol=lf src/frontend/public/.well-known/agent-skills/index.json text eol=lf +# Keep the upstream brand snapshot byte-stable for artwork provenance checks. +src/frontend/public/brand/** text eol=lf + # Explicitly mark binary files to avoid corruption *.png binary *.jpg binary diff --git a/.github/agents/release-verifier.agent.md b/.github/agents/release-verifier.agent.md index 4350052b67..65a62108c5 100644 --- a/.github/agents/release-verifier.agent.md +++ b/.github/agents/release-verifier.agent.md @@ -210,10 +210,10 @@ grep -rnE '%ASPIRE_VERSION%-(preview|alpha|beta|rc)(\.[0-9A-Za-z-]+)+' src/front --exclude-dir="whats-new" ``` -Also search for stale SDK version references: +Also search for stale AppHost package and legacy SDK version references: ```bash -grep -rn 'Aspire.AppHost.Sdk.*Version="{PRIOR_NUGET_VERSION}"' src/frontend/src/content/docs/ \ +grep -rnE '(Aspire\.Hosting\.AppHost|Aspire\.AppHost\.Sdk).*Version="{PRIOR_NUGET_VERSION}"' src/frontend/src/content/docs/ \ --include="*.md" \ --include="*.mdx" ``` diff --git a/.github/instructions/astro.instructions.md b/.github/instructions/astro.instructions.md index a095af0763..ab3cb0aa01 100644 --- a/.github/instructions/astro.instructions.md +++ b/.github/instructions/astro.instructions.md @@ -148,6 +148,7 @@ Defined in `src/content.config.ts`: - **i18n** — Starlight i18n loader for 15 locales - **packages** — auto-generated API reference JSON from `src/data/pkgs/` - **tsModules** — auto-generated TypeScript API reference JSON from `src/data/ts-modules/` +- **goModules** — auto-generated Go API reference JSON from `src/data/go-modules/` Preserve Starlight's `docsLoader()`, `i18nLoader()`, `docsSchema()`, and `i18nSchema()` when extending content. Use `glob()` or `file()` from `astro/loaders` for additional file-backed collections, and query entries with type-safe `getCollection()` and `getEntry()` from `astro:content`. Import `z` from `astro/zod`, not `astro:content`; use Zod 4 helpers such as `z.email()` and `z.url()` for new email and URL schemas. diff --git a/.github/workflows/update-integration-data.yml b/.github/workflows/update-integration-data.yml index 14b6b7f408..0af7ede166 100644 --- a/.github/workflows/update-integration-data.yml +++ b/.github/workflows/update-integration-data.yml @@ -30,7 +30,10 @@ jobs: update: name: Update integration data runs-on: ubuntu-latest - timeout-minutes: 45 + # Three generation passes (C#, TypeScript, Go) each scan every package, so + # the runtime scales with the number of languages. The TypeScript pass alone + # takes about ten minutes on a hosted runner. + timeout-minutes: 75 permissions: contents: read issues: write @@ -121,6 +124,7 @@ jobs: src/frontend/src/assets/samples \ src/frontend/src/data/pkgs \ src/frontend/src/data/ts-modules \ + src/frontend/src/data/go-modules \ src/frontend/src/data/twoslash/aspire.d.ts if git diff --cached --quiet; then diff --git a/src/frontend/.starlight-icons/safelist.json b/src/frontend/.starlight-icons/safelist.json index 8b9037434c..20f8fa07f8 100644 --- a/src/frontend/.starlight-icons/safelist.json +++ b/src/frontend/.starlight-icons/safelist.json @@ -40,8 +40,11 @@ "i-material-icon-theme:folder-src-open", "i-material-icon-theme:folder-template", "i-material-icon-theme:folder-template-open", + "i-material-icon-theme:folder-vscode", + "i-material-icon-theme:folder-vscode-open", "i-material-icon-theme:git", "i-material-icon-theme:go", + "i-material-icon-theme:go-mod", "i-material-icon-theme:gradle", "i-material-icon-theme:html", "i-material-icon-theme:http", diff --git a/src/frontend/config/apphost-examples.mjs b/src/frontend/config/apphost-examples.mjs index 1e42a27ae0..e60f5b6b58 100644 --- a/src/frontend/config/apphost-examples.mjs +++ b/src/frontend/config/apphost-examples.mjs @@ -16,7 +16,7 @@ export function deferAppHostExamples(html) { '[data-apphost-builder] [data-code-lang="typescript"] [data-variant="frontend"]', tree ); - if (!builder || groups.length !== 2 || !initial) { + if (!builder || groups.length !== 3 || !initial) { throw new Error('Cannot defer AppHost examples: missing builder or default example.'); } diff --git a/src/frontend/config/aspire-versions.mjs b/src/frontend/config/aspire-versions.mjs index d040055168..f7b6145a04 100644 --- a/src/frontend/config/aspire-versions.mjs +++ b/src/frontend/config/aspire-versions.mjs @@ -1,8 +1,8 @@ -export const currentAspireMajorMinorVersion = '13.6'; -export const currentAspireVersion = '13.6.0'; +export const currentAspireMajorMinorVersion = '17.0'; +export const currentAspireVersion = '17.0.0'; // Release date (YYYY-MM-DD) of currentAspireVersion; update together with the version. -export const currentAspireReleaseDate = '2026-09-29'; -export const currentAspirePreviewVersion = '13.6.0-preview.1.26479.8'; +export const currentAspireReleaseDate = '2026-11-17'; +export const currentAspirePreviewVersion = '17.0.0-preview.1.26480.6'; export const aspireVersionPlaceholders = Object.freeze({ '%ASPIRE_VERSION_MAJOR_MINOR%': currentAspireMajorMinorVersion, diff --git a/src/frontend/config/sidebar/community.topics.ts b/src/frontend/config/sidebar/community.topics.ts index 25c9d04380..167162ffc8 100644 --- a/src/frontend/config/sidebar/community.topics.ts +++ b/src/frontend/config/sidebar/community.topics.ts @@ -22,11 +22,11 @@ export const communityTopics: StarlightSidebarTopicsUserConfig = { icon: 'heart', items: [ { - label: 'Aspire Community', + label: 'Aspire community', translations: { da: 'Aspire-fællesskab', de: 'Aspire-Gemeinschaft', - en: 'Aspire Community', + en: 'Aspire community', es: 'Comunidad de Aspire', fr: 'Communauté Aspire', hi: 'Aspire समुदाय', @@ -149,6 +149,133 @@ export const communityTopics: StarlightSidebarTopicsUserConfig = { }, ], }, + { + label: 'Brand assets', + translations: { + da: 'Brandmaterialer', + de: 'Markenmaterialien', + en: 'Brand assets', + es: 'Recursos de marca', + fr: 'Ressources de marque', + hi: 'ब्रांड संसाधन', + id: 'Aset merek', + it: 'Risorse del marchio', + ja: 'ブランドアセット', + ko: '브랜드 자산', + 'pt-BR': 'Recursos da marca', + ru: 'Материалы бренда', + tr: 'Marka kaynakları', + uk: 'Матеріали бренду', + 'zh-CN': '品牌资源', + }, + items: [ + { + label: 'Overview', + translations: { + da: 'Oversigt', + de: 'Übersicht', + en: 'Overview', + es: 'Resumen', + fr: 'Aperçu', + hi: 'अवलोकन', + id: 'Ikhtisar', + it: 'Panoramica', + ja: '概要', + ko: '개요', + 'pt-BR': 'Visão geral', + ru: 'Обзор', + tr: 'Genel Bakış', + uk: 'Огляд', + 'zh-CN': '概述', + }, + slug: 'community/brand', + }, + { + label: 'Logos and icons', + translations: { + da: 'Logoer og ikoner', + de: 'Logos und Symbole', + en: 'Logos and icons', + es: 'Logotipos e iconos', + fr: 'Logos et icônes', + hi: 'लोगो और आइकन', + id: 'Logo dan ikon', + it: 'Loghi e icone', + ja: 'ロゴとアイコン', + ko: '로고 및 아이콘', + 'pt-BR': 'Logotipos e ícones', + ru: 'Логотипы и значки', + tr: 'Logolar ve simgeler', + uk: 'Логотипи та значки', + 'zh-CN': '徽标和图标', + }, + slug: 'community/brand/logos', + }, + { + label: 'Colors', + translations: { + da: 'Farver', + de: 'Farben', + en: 'Colors', + es: 'Colores', + fr: 'Couleurs', + hi: 'रंग', + id: 'Warna', + it: 'Colori', + ja: '色', + ko: '색상', + 'pt-BR': 'Cores', + ru: 'Цвета', + tr: 'Renkler', + uk: 'Кольори', + 'zh-CN': '颜色', + }, + slug: 'community/brand/colors', + }, + { + label: 'Typography', + translations: { + da: 'Typografi', + de: 'Typografie', + en: 'Typography', + es: 'Tipografía', + fr: 'Typographie', + hi: 'टाइपोग्राफी', + id: 'Tipografi', + it: 'Tipografia', + ja: 'タイポグラフィ', + ko: '타이포그래피', + 'pt-BR': 'Tipografia', + ru: 'Типографика', + tr: 'Tipografi', + uk: 'Типографіка', + 'zh-CN': '排版', + }, + slug: 'community/brand/typography', + }, + { + label: 'Usage guidance', + translations: { + da: 'Brugsvejledning', + de: 'Nutzungshinweise', + en: 'Usage guidance', + es: 'Guía de uso', + fr: "Conseils d'utilisation", + hi: 'उपयोग मार्गदर्शन', + id: 'Panduan penggunaan', + it: "Linee guida per l'uso", + ja: '使用ガイド', + ko: '사용 지침', + 'pt-BR': 'Orientações de uso', + ru: 'Рекомендации по использованию', + tr: 'Kullanım rehberi', + uk: 'Рекомендації щодо використання', + 'zh-CN': '使用指南', + }, + slug: 'community/brand/usage', + }, + ], + }, { label: 'Live Streams', translations: { diff --git a/src/frontend/config/sidebar/deployment.topics.ts b/src/frontend/config/sidebar/deployment.topics.ts index 5826b9a6cf..4958f53266 100644 --- a/src/frontend/config/sidebar/deployment.topics.ts +++ b/src/frontend/config/sidebar/deployment.topics.ts @@ -23,11 +23,11 @@ export const deploymentTopics: StarlightSidebarTopicsUserConfig = { icon: 'rocket', items: [ { - label: 'Aspire Deployment', + label: 'Aspire deployment', translations: { da: 'Aspire-udrulning', de: 'Aspire-Bereitstellung', - en: 'Aspire Deployment', + en: 'Aspire deployment', es: 'Despliegue de Aspire', fr: 'Déploiement Aspire', hi: 'Aspire तैनाती', @@ -106,6 +106,27 @@ export const deploymentTopics: StarlightSidebarTopicsUserConfig = { label: 'Deployment state caching', slug: 'deployment/deployment-state-caching', }, + { + label: 'Detect output drift', + translations: { + da: 'Registrer afvigelser i output', + de: 'Abweichungen in der Ausgabe erkennen', + en: 'Detect output drift', + es: 'Detectar desviaciones en la salida', + fr: 'Détecter la dérive de la sortie', + hi: 'आउटपुट ड्रिफ्ट का पता लगाएं', + id: 'Deteksi penyimpangan output', + it: "Rileva la deriva dell'output", + ja: '出力のドリフトを検出', + ko: '출력 드리프트 감지', + 'pt-BR': 'Detectar desvios na saída', + ru: 'Обнаружение расхождений в выходных данных', + tr: 'Çıktı sapmasını algılama', + uk: 'Виявлення розбіжностей у вихідних даних', + 'zh-CN': '检测输出偏差', + }, + slug: 'deployment/output-diffing', + }, ], }, { @@ -126,6 +147,10 @@ export const deploymentTopics: StarlightSidebarTopicsUserConfig = { label: 'JavaScript apps', slug: 'deployment/javascript-apps', }, + { + label: 'Go apps', + slug: 'deployment/go-apps', + }, { label: 'Docker Compose', slug: 'deployment/docker-compose', diff --git a/src/frontend/config/sidebar/docs.topics.ts b/src/frontend/config/sidebar/docs.topics.ts index 5658de5f3f..5085b76fa6 100644 --- a/src/frontend/config/sidebar/docs.topics.ts +++ b/src/frontend/config/sidebar/docs.topics.ts @@ -1,6 +1,6 @@ import type { StarlightSidebarTopicsUserConfig } from 'starlight-sidebar-topics'; -export const docsTopics: StarlightSidebarTopicsUserConfig = { +export const docsTopics = { label: { da: 'Grundlag', de: 'Grundlagen', @@ -91,32 +91,8 @@ export const docsTopics: StarlightSidebarTopicsUserConfig = { collapsed: true, items: [ { - label: 'Aspire 13.6', - slug: 'whats-new/aspire-13-6', - }, - { - label: 'Aspire 13.5', - slug: 'whats-new/aspire-13-5', - }, - { - label: 'Aspire 13.4', - slug: 'whats-new/aspire-13-4', - }, - { - label: 'Aspire 13.3', - slug: 'whats-new/aspire-13-3', - }, - { - label: 'Aspire 13.2', - slug: 'whats-new/aspire-13-2', - }, - { - label: 'Aspire 13.1', - slug: 'whats-new/aspire-13-1', - }, - { - label: 'Aspire 13.0', - slug: 'whats-new/aspire-13', + label: 'Aspire 17.0', + slug: 'whats-new/aspire-17', }, { label: 'Previous versions', @@ -140,28 +116,68 @@ export const docsTopics: StarlightSidebarTopicsUserConfig = { }, items: [ { - label: 'Aspire 9.5', - slug: 'whats-new/aspire-9-5', - }, - { - label: 'Aspire 9.4', - slug: 'whats-new/aspire-9-4', - }, - { - label: 'Aspire 9.3', - slug: 'whats-new/aspire-9-3', - }, - { - label: 'Aspire 9.2', - slug: 'whats-new/aspire-9-2', - }, - { - label: 'Aspire 9.1', - slug: 'whats-new/aspire-9-1', + label: 'Aspire 13.x', + collapsed: true, + items: [ + { + label: 'Aspire 13.6', + slug: 'whats-new/aspire-13-6', + }, + { + label: 'Aspire 13.5', + slug: 'whats-new/aspire-13-5', + }, + { + label: 'Aspire 13.4', + slug: 'whats-new/aspire-13-4', + }, + { + label: 'Aspire 13.3', + slug: 'whats-new/aspire-13-3', + }, + { + label: 'Aspire 13.2', + slug: 'whats-new/aspire-13-2', + }, + { + label: 'Aspire 13.1', + slug: 'whats-new/aspire-13-1', + }, + { + label: 'Aspire 13.0', + slug: 'whats-new/aspire-13', + }, + ], }, { - label: 'Aspire 9.0', - slug: 'whats-new/aspire-9', + label: 'Aspire 9.x', + collapsed: true, + items: [ + { + label: 'Aspire 9.5', + slug: 'whats-new/aspire-9-5', + }, + { + label: 'Aspire 9.4', + slug: 'whats-new/aspire-9-4', + }, + { + label: 'Aspire 9.3', + slug: 'whats-new/aspire-9-3', + }, + { + label: 'Aspire 9.2', + slug: 'whats-new/aspire-9-2', + }, + { + label: 'Aspire 9.1', + slug: 'whats-new/aspire-9-1', + }, + { + label: 'Aspire 9.0', + slug: 'whats-new/aspire-9', + }, + ], }, ], }, @@ -1000,7 +1016,7 @@ export const docsTopics: StarlightSidebarTopicsUserConfig = { collapsed: false, items: [ { - label: 'Aspire SDK', + label: 'AppHost project configuration', slug: 'get-started/aspire-sdk', }, { @@ -1034,6 +1050,20 @@ export const docsTopics: StarlightSidebarTopicsUserConfig = { label: 'TypeScript', slug: 'app-host/typescript-apphost', }, + { + label: 'Go', + collapsed: false, + items: [ + { + label: 'Get started', + slug: 'app-host/go-apphost', + }, + { + label: 'API conventions', + slug: 'app-host/go-apphost-conventions', + }, + ], + }, ], }, { @@ -1134,6 +1164,11 @@ export const docsTopics: StarlightSidebarTopicsUserConfig = { label: 'Multi-language integrations', slug: 'extensibility/multi-language-integration-authoring', }, + { + label: 'TypeScript hosting integrations', + slug: 'extensibility/typescript-hosting-integrations', + badge: 'Experimental', + }, ], }, { @@ -1470,4 +1505,4 @@ export const docsTopics: StarlightSidebarTopicsUserConfig = { ], }, ], -}; +} satisfies StarlightSidebarTopicsUserConfig[number]; diff --git a/src/frontend/config/sidebar/integrations.topics.ts b/src/frontend/config/sidebar/integrations.topics.ts index 840a4435bf..a1e9480952 100644 --- a/src/frontend/config/sidebar/integrations.topics.ts +++ b/src/frontend/config/sidebar/integrations.topics.ts @@ -437,6 +437,44 @@ export const integrationTopics: StarlightSidebarTopicsUserConfig = { }, ], }, + { + label: 'Azure API Management', + collapsed: true, + items: [ + { + label: 'Get started', + slug: 'integrations/cloud/azure/azure-api-management/azure-api-management-get-started', + }, + { + label: 'APIs and operations', + slug: 'integrations/cloud/azure/azure-api-management/azure-api-management-apis', + }, + { + label: 'OpenAPI import', + slug: 'integrations/cloud/azure/azure-api-management/azure-api-management-openapi', + }, + { + label: 'Backends and pools', + slug: 'integrations/cloud/azure/azure-api-management/azure-api-management-backends', + }, + { + label: 'Policies and named values', + slug: 'integrations/cloud/azure/azure-api-management/azure-api-management-policies', + }, + { + label: 'Products and subscriptions', + slug: 'integrations/cloud/azure/azure-api-management/azure-api-management-products', + }, + { + label: 'Service configuration', + slug: 'integrations/cloud/azure/azure-api-management/azure-api-management-service', + }, + { + label: 'Networking', + slug: 'integrations/cloud/azure/azure-api-management/azure-api-management-networking', + }, + ], + }, { label: 'Azure App Configuration', collapsed: true, @@ -1478,9 +1516,13 @@ export const integrationTopics: StarlightSidebarTopicsUserConfig = { label: 'Set up C# apps by path in the AppHost', slug: 'integrations/frameworks/dotnet/dotnet-host', }, - { label: 'Project resources', slug: 'integrations/dotnet/project-resources' }, { label: 'C# file-based apps', slug: 'integrations/dotnet/csharp-file-based-apps' }, { label: 'Launch profiles', slug: 'integrations/dotnet/launch-profiles' }, + { + label: 'Migrate to DotnetProjectResource', + slug: 'integrations/dotnet/migrate-dotnet-project-resource', + }, + { label: 'Legacy project resources', slug: 'integrations/dotnet/project-resources' }, { label: '.NET tool resources', slug: 'integrations/dotnet/dotnet-tool-resources' }, { label: 'Blazor', @@ -1889,6 +1931,48 @@ export const integrationTopics: StarlightSidebarTopicsUserConfig = { ], }, { label: 'Keycloak', slug: 'integrations/security/keycloak' }, + { + label: 'Microsoft Entra ID', + collapsed: true, + items: [ + { + label: 'Overview', + slug: 'integrations/security/microsoft-entra-id', + }, + { + label: 'Secure a web app and API', + slug: 'integrations/security/microsoft-entra-id/secure-web-and-api', + }, + { + label: 'Redirect URIs and sign-in', + slug: 'integrations/security/microsoft-entra-id/redirect-uris-and-sign-in', + }, + { + label: 'Client credentials', + slug: 'integrations/security/microsoft-entra-id/client-credentials', + }, + { + label: 'Expose and call APIs', + slug: 'integrations/security/microsoft-entra-id/expose-and-call-apis', + }, + { + label: 'Application roles', + slug: 'integrations/security/microsoft-entra-id/app-roles', + }, + { + label: 'Existing registrations', + slug: 'integrations/security/microsoft-entra-id/existing-registrations', + }, + { + label: 'Customize infrastructure', + slug: 'integrations/security/microsoft-entra-id/customize-infrastructure', + }, + { + label: 'Lifecycle and permissions', + slug: 'integrations/security/microsoft-entra-id/lifecycle-and-permissions', + }, + ], + }, { label: 'Logto', collapsed: true, diff --git a/src/frontend/config/sidebar/reference.topics.ts b/src/frontend/config/sidebar/reference.topics.ts index 8c60d3374c..8675f88e4c 100644 --- a/src/frontend/config/sidebar/reference.topics.ts +++ b/src/frontend/config/sidebar/reference.topics.ts @@ -23,11 +23,11 @@ export const referenceTopics: StarlightSidebarTopicsUserConfig[number] = { icon: 'seti:json', items: [ { - label: 'Aspire Reference', + label: 'Aspire reference', translations: { da: 'Aspire-reference', de: 'Aspire-Referenz', - en: 'Aspire Reference', + en: 'Aspire reference', es: 'Referencia de Aspire', fr: 'Référence Aspire', hi: 'Aspire संदर्भ', @@ -170,6 +170,27 @@ export const referenceTopics: StarlightSidebarTopicsUserConfig[number] = { }, link: '/reference/api/typescript/', }, + { + label: 'Search Go APIs', + translations: { + da: "Søg i Go API'er", + de: 'Go APIs durchsuchen', + en: 'Search Go APIs', + es: 'Buscar API de Go', + fr: 'Rechercher les API Go', + hi: 'Go एपीआई खोजें', + id: 'Cari API Go', + it: 'Cerca API Go', + ja: 'Go APIを検索する', + ko: 'Go API 검색', + 'pt-BR': 'Pesquisar APIs Go', + ru: 'Поиск Go API', + tr: "Go API'leri Arayın", + uk: 'Пошук Go API', + 'zh-CN': '搜索 Go API', + }, + link: '/reference/api/go/', + }, ], }, { @@ -577,6 +598,32 @@ export const referenceTopics: StarlightSidebarTopicsUserConfig[number] = { slug: 'reference/cli/commands/aspire-start', }, { label: 'aspire stop', slug: 'reference/cli/commands/aspire-stop' }, + { + label: 'aspire template', + collapsed: true, + items: [ + { + label: 'aspire template', + slug: 'reference/cli/commands/aspire-template', + }, + { + label: 'aspire template source', + slug: 'reference/cli/commands/aspire-template-source', + }, + { + label: 'aspire template source add', + slug: 'reference/cli/commands/aspire-template-source-add', + }, + { + label: 'aspire template source list', + slug: 'reference/cli/commands/aspire-template-source-list', + }, + { + label: 'aspire template source remove', + slug: 'reference/cli/commands/aspire-template-source-remove', + }, + ], + }, { label: 'aspire terminal', collapsed: true, @@ -603,6 +650,24 @@ export const referenceTopics: StarlightSidebarTopicsUserConfig[number] = { }, ], }, + { + label: 'aspire tray', + collapsed: true, + items: [ + { + label: 'aspire tray', + slug: 'reference/cli/commands/aspire-tray', + }, + { + label: 'aspire tray start', + slug: 'reference/cli/commands/aspire-tray-start', + }, + { + label: 'aspire tray stop', + slug: 'reference/cli/commands/aspire-tray-stop', + }, + ], + }, { label: 'aspire update', slug: 'reference/cli/commands/aspire-update', @@ -646,6 +711,8 @@ export const referenceTopics: StarlightSidebarTopicsUserConfig[number] = { { label: 'ASPIRE003', link: '/diagnostics/aspire003' }, { label: 'ASPIRE004', link: '/diagnostics/aspire004' }, { label: 'ASPIRE010', link: '/diagnostics/aspire010' }, + { label: 'ASPIRE012', link: '/diagnostics/aspire012' }, + { label: 'ASPIRE014', link: '/diagnostics/aspire014' }, { label: 'ASPIREEXPORT005', link: '/diagnostics/aspireexport005', @@ -682,6 +749,10 @@ export const referenceTopics: StarlightSidebarTopicsUserConfig[number] = { label: 'ASPIREACANAMING001', link: '/diagnostics/aspireacanaming001', }, + { + label: 'ASPIREAZUREFUNCTIONS001', + link: '/diagnostics/aspireazurefunctions001', + }, { label: 'ASPIREBLAZOR001', link: '/diagnostics/aspireblazor001', @@ -805,6 +876,7 @@ export const referenceTopics: StarlightSidebarTopicsUserConfig[number] = { { label: 'ASPIRE008', link: '/diagnostics/aspire008' }, { label: 'ASPIRE009', link: '/diagnostics/aspire009' }, { label: 'ASPIRE011', link: '/diagnostics/aspire011' }, + { label: 'ASPIRE013', link: '/diagnostics/aspire013' }, { label: 'ASPIREACADOMAIN001', link: '/diagnostics/aspireacadomains001', @@ -866,6 +938,10 @@ export const referenceTopics: StarlightSidebarTopicsUserConfig[number] = { label: 'ASPIREPIPELINES003', link: '/diagnostics/aspirepipelines003', }, + { + label: 'ASPIREPIPELINES005', + link: '/diagnostics/aspirepipelines005', + }, { label: 'ASPIREPROXYENDPOINTS001', link: '/diagnostics/aspireproxyendpoints001', @@ -877,6 +953,10 @@ export const referenceTopics: StarlightSidebarTopicsUserConfig[number] = { { label: 'ASPIREAZURE001', link: '/diagnostics/aspireazure001' }, { label: 'ASPIREAZURE002', link: '/diagnostics/aspireazure002' }, { label: 'ASPIREAZURE003', link: '/diagnostics/aspireazure003' }, + { label: 'ASPIREAZURE004', link: '/diagnostics/aspireazure004' }, + { label: 'ASPIREAZURE005', link: '/diagnostics/aspireazure005' }, + { label: 'ASPIREAZURE006', link: '/diagnostics/aspireazure006' }, + { label: 'ASPIREAZURE007', link: '/diagnostics/aspireazure007' }, { label: 'ASPIREBROWSERLOGS001', link: '/diagnostics/aspirebrowserlogs001', diff --git a/src/frontend/package.json b/src/frontend/package.json index 3d62d51c78..e256cd57bc 100644 --- a/src/frontend/package.json +++ b/src/frontend/package.json @@ -37,6 +37,7 @@ "test:unit:api-reference": "vitest run --config vitest.config.ts tests/unit/api-reference.vitest.test.ts", "test:unit:api-markdown": "vitest run --config vitest.config.ts tests/unit/api-markdown.vitest.test.ts", "test:unit:ts-api": "vitest run --config vitest.config.ts tests/unit/api-reference-routes.vitest.test.ts tests/unit/browser-storage.vitest.test.ts tests/unit/locale-routes.vitest.test.ts tests/unit/ts-api-routes.vitest.test.ts tests/unit/ts-api-search.vitest.test.ts tests/unit/ts-api-sidebar.vitest.test.ts", + "test:unit:go-api": "vitest run --config vitest.config.ts tests/unit/api-reference-routes.vitest.test.ts tests/unit/browser-storage.vitest.test.ts tests/unit/locale-routes.vitest.test.ts tests/unit/go-api-routes.vitest.test.ts tests/unit/go-api-route-catalog.vitest.test.ts tests/unit/go-api-search.vitest.test.ts tests/unit/go-api-sidebar.vitest.test.ts tests/unit/go-api-markdown.vitest.test.ts tests/unit/go-modules.vitest.test.ts tests/unit/go-modules-cache.vitest.test.ts tests/unit/go-member-card.vitest.test.ts tests/unit/go-doc-text.vitest.test.ts tests/unit/go-doc-refs.vitest.test.ts tests/unit/go-doc-text-component.vitest.test.ts", "test:unit:twoslash-types": "vitest run --config vitest.config.ts tests/unit/twoslash-types-generator.vitest.test.ts", "test:unit:twoslash-blocks": "vitest run --config vitest.config.ts tests/unit/twoslash-blocks.vitest.test.ts", "test:unit:contracts": "vitest run --config vitest.config.ts tests/unit/analytics-script-contracts.vitest.test.ts tests/unit/redirects.vitest.test.ts", @@ -57,6 +58,7 @@ "update:schemas": "tsx ./scripts/update-schemas.ts", "update:integrations": "tsx ./scripts/update-integrations.ts", "update:ts-api": "tsx ./scripts/update-ts-api.ts", + "update:go-api": "tsx ./scripts/update-go-api.ts", "update:github-stats": "tsx ./scripts/update-github-stats.ts", "update:contributors": "tsx ./scripts/update-contributors.ts", "update:release-contributors": "tsx ./scripts/update-release-contributors.ts", diff --git a/src/frontend/public/brand/aspire-icon-256.svg b/src/frontend/public/brand/aspire-icon-256.svg new file mode 100644 index 0000000000..8119728471 --- /dev/null +++ b/src/frontend/public/brand/aspire-icon-256.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/frontend/public/brand/aspire-icon-32.svg b/src/frontend/public/brand/aspire-icon-32.svg new file mode 100644 index 0000000000..89fe2a3fc8 --- /dev/null +++ b/src/frontend/public/brand/aspire-icon-32.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/frontend/public/brand/aspire-logo-dark-horizontal.svg b/src/frontend/public/brand/aspire-logo-dark-horizontal.svg new file mode 100644 index 0000000000..46e6b9f8fe --- /dev/null +++ b/src/frontend/public/brand/aspire-logo-dark-horizontal.svg @@ -0,0 +1,8 @@ +Aspire horizontal logo (dark lettering) + + + + + + + diff --git a/src/frontend/public/brand/aspire-logo-dark-vertical.svg b/src/frontend/public/brand/aspire-logo-dark-vertical.svg new file mode 100644 index 0000000000..4413fe025b --- /dev/null +++ b/src/frontend/public/brand/aspire-logo-dark-vertical.svg @@ -0,0 +1,8 @@ +Aspire vertical logo (dark lettering) + + + + + + + diff --git a/src/frontend/public/brand/aspire-logo-light-horizontal.svg b/src/frontend/public/brand/aspire-logo-light-horizontal.svg new file mode 100644 index 0000000000..5bc37b391b --- /dev/null +++ b/src/frontend/public/brand/aspire-logo-light-horizontal.svg @@ -0,0 +1,8 @@ +Aspire horizontal logo (light lettering) + + + + + + + diff --git a/src/frontend/public/brand/aspire-logo-light-vertical.svg b/src/frontend/public/brand/aspire-logo-light-vertical.svg new file mode 100644 index 0000000000..f1e144b72f --- /dev/null +++ b/src/frontend/public/brand/aspire-logo-light-vertical.svg @@ -0,0 +1,8 @@ +Aspire vertical logo (light lettering) + + + + + + + diff --git a/src/frontend/public/brand/developer-tools/aspire-line.svg b/src/frontend/public/brand/developer-tools/aspire-line.svg new file mode 100644 index 0000000000..5ad70ad6cd --- /dev/null +++ b/src/frontend/public/brand/developer-tools/aspire-line.svg @@ -0,0 +1 @@ + diff --git a/src/frontend/public/brand/developer-tools/aspire-original.svg b/src/frontend/public/brand/developer-tools/aspire-original.svg new file mode 100644 index 0000000000..483809d1bd --- /dev/null +++ b/src/frontend/public/brand/developer-tools/aspire-original.svg @@ -0,0 +1 @@ + diff --git a/src/frontend/public/brand/developer-tools/aspire-plain.svg b/src/frontend/public/brand/developer-tools/aspire-plain.svg new file mode 100644 index 0000000000..2ebd4ac88b --- /dev/null +++ b/src/frontend/public/brand/developer-tools/aspire-plain.svg @@ -0,0 +1 @@ + diff --git a/src/frontend/public/og/aspire-brand-assets.png b/src/frontend/public/og/aspire-brand-assets.png new file mode 100644 index 0000000000..8365c1984e Binary files /dev/null and b/src/frontend/public/og/aspire-brand-assets.png differ diff --git a/src/frontend/scripts/generate-brand-wordmarks.mjs b/src/frontend/scripts/generate-brand-wordmarks.mjs new file mode 100644 index 0000000000..6d60c14fd3 --- /dev/null +++ b/src/frontend/scripts/generate-brand-wordmarks.mjs @@ -0,0 +1,76 @@ +import { createHash } from 'node:crypto'; +import { readFileSync, writeFileSync } from 'node:fs'; +import { createRequire } from 'node:module'; +import satori from 'satori'; + +const require = createRequire(import.meta.url); +const brandDirectory = new URL('../public/brand/', import.meta.url); +const icon = svgBody(readFileSync(new URL('aspire-icon-256.svg', brandDirectory), 'utf8')); +const font = readFileSync( + require.resolve('@fontsource/poppins/files/poppins-latin-600-normal.woff') +); + +function svgBody(svg) { + const match = svg.match(/]*>([\s\S]*)<\/svg>\s*$/); + if (!match) throw new Error('Expected a complete SVG document.'); + return match[1]; +} + +for (const [tone, color] of [ + ['dark', '#1f1e31'], + ['light', '#f9f8ff'], +]) { + for (const layout of ['horizontal', 'vertical']) { + const lettering = svgBody( + await satori( + { + type: 'div', + props: { + style: { + display: 'flex', + width: '100%', + height: '100%', + alignItems: 'center', + justifyContent: 'center', + fontFamily: 'Poppins', + fontWeight: 600, + fontSize: layout === 'vertical' ? 72 : 96, + lineHeight: 1, + color, + }, + children: 'Aspire', + }, + }, + { + width: 328, + height: 128, + embedFont: true, + fonts: [{ name: 'Poppins', data: font, weight: 600, style: 'normal' }], + } + ) + ); + + const width = layout === 'horizontal' ? 512 : 400; + const height = layout === 'horizontal' ? 160 : 320; + const iconX = layout === 'horizontal' ? 16 : 136; + const textX = layout === 'horizontal' ? 168 : 36; + const textY = layout === 'horizontal' ? 16 : 160; + const file = `aspire-logo-${tone}-${layout}.svg`; + const svg = [ + ``, + `Aspire ${layout} logo (${tone} lettering)`, + `${icon}`, + `${lettering}`, + '\n', + ].join(''); + if (/; + /** + * Sets or replaces the value for this parameter + */ + setValueAsync(options?: { value?: string | null }): Promise; }`, `export interface ComposeFile { /** diff --git a/src/frontend/scripts/normalize-generated-api-data.ts b/src/frontend/scripts/normalize-generated-api-data.ts index 10332bdbf2..a4ab2c8616 100644 --- a/src/frontend/scripts/normalize-generated-api-data.ts +++ b/src/frontend/scripts/normalize-generated-api-data.ts @@ -1,9 +1,10 @@ /** * normalize-generated-api-data.ts — Enforces Aspire terminology in the generated - * C#/TypeScript API reference JSON (`src/data/pkgs/*.json`, `src/data/ts-modules/*.json`). + * C#/TypeScript/Go API reference JSON (`src/data/pkgs/*.json`, `src/data/ts-modules/*.json`, + * `src/data/go-modules/*.json`). * - * The C# API JSON is produced by the .NET `PackageJsonGenerator`; the TS API JSON - * by `AtsJsonGenerator`. Both copy XML/JSDoc documentation text verbatim from the + * The C# API JSON is produced by the .NET `PackageJsonGenerator`; the TS and Go API + * JSON by `AtsJsonGenerator`. All copy XML/JSDoc documentation text verbatim from the * upstream packages, so deprecated Aspire terminology leaks into the committed * data and trips the Forbidden Words CI check (see `.github/forbidden-words.json`). * This pass rewrites only prose fields, reusing the single source of truth in @@ -18,9 +19,10 @@ * escaped string content yields exactly the correctly-escaped normalized value. * * Usage: - * tsx ./scripts/normalize-generated-api-data.ts # both areas + * tsx ./scripts/normalize-generated-api-data.ts # all areas * tsx ./scripts/normalize-generated-api-data.ts --pkgs # C# API only * tsx ./scripts/normalize-generated-api-data.ts --ts-modules # TS API only + * tsx ./scripts/normalize-generated-api-data.ts --go-modules # Go API only */ import fs from 'fs'; @@ -33,6 +35,7 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url)); const DATA_DIR = path.resolve(__dirname, '..', 'src', 'data'); export const PKGS_DIR = path.join(DATA_DIR, 'pkgs'); export const TS_MODULES_DIR = path.join(DATA_DIR, 'ts-modules'); +export const GO_MODULES_DIR = path.join(DATA_DIR, 'go-modules'); // Per-line matcher (multiline) for EITHER a documentation node's `kind` marker // OR a prose string field. Groups: @@ -133,7 +136,8 @@ export function normalizeApiDir(dir: string): { function main(): void { const args = process.argv.slice(2); - const explicit = args.includes('--pkgs') || args.includes('--ts-modules'); + const explicit = + args.includes('--pkgs') || args.includes('--ts-modules') || args.includes('--go-modules'); const targets: Array<{ label: string; dir: string }> = []; if (!explicit || args.includes('--pkgs')) { targets.push({ @@ -151,6 +155,14 @@ function main(): void { : TS_MODULES_DIR, }); } + if (!explicit || args.includes('--go-modules')) { + targets.push({ + label: 'go-modules', + dir: process.env.ASPIRE_API_GO_MODULES_DIR + ? path.resolve(process.env.ASPIRE_API_GO_MODULES_DIR) + : GO_MODULES_DIR, + }); + } let total = 0; for (const { label, dir } of targets) { diff --git a/src/frontend/scripts/update-go-api.ts b/src/frontend/scripts/update-go-api.ts new file mode 100644 index 0000000000..8cdf20fde8 --- /dev/null +++ b/src/frontend/scripts/update-go-api.ts @@ -0,0 +1,107 @@ +/** + * update-go-api.ts — Regenerates Go API reference data. + * + * Runs the AtsJsonGenerator tool in Go mode against the aspire sdk dump output. + * Requires: dotnet SDK and aspire CLI. + * Set ASPIRE_CLI_PATH to use an installed Aspire CLI that is not on PATH. + * + * By default, reads the generated C# package JSON files and generates + * data for the matching Aspire.Hosting* and CommunityToolkit.Aspire.Hosting* + * package/version sets, the same sets that update-ts-api.ts generates. + * + * Optionally pass an Aspire repo clone path to discover packages from source: + * tsx ./scripts/update-go-api.ts /path/to/aspire + * ASPIRE_REPO_PATH=../../../aspire tsx ./scripts/update-go-api.ts + * + * Usage: + * tsx ./scripts/update-go-api.ts # auto-detect from C# package JSON + * tsx ./scripts/update-go-api.ts /path/aspire # from repo clone + */ + +import { execFileSync } from 'child_process'; +import { existsSync } from 'fs'; +import { dirname, resolve } from 'path'; +import { fileURLToPath } from 'url'; + +import { GO_MODULES_DIR, normalizeApiDir } from './normalize-generated-api-data'; + +const __dirname = dirname(fileURLToPath(import.meta.url)); +// The generator script serves both languages; -Language selects the output. +const SCRIPT_PATH = resolve( + __dirname, + '..', + '..', + 'tools', + 'AtsJsonGenerator', + 'generate-ts-api-json.ps1' +); + +function getErrorMessage(error: unknown): string { + return error instanceof Error ? error.message : String(error); +} + +function checkPrerequisite(cmd: string, args: string[], name: string): boolean { + try { + execFileSync(cmd, args, { stdio: 'pipe' }); + return true; + } catch { + console.error(`❌ ${name} not found. Please install it first.`); + return false; + } +} + +function main(): void { + const aspireRepoPath = process.argv[2] ?? process.env.ASPIRE_REPO_PATH; + const aspireCliPath = process.env.ASPIRE_CLI_PATH?.trim() || 'aspire'; + + if (!checkPrerequisite('dotnet', ['--version'], 'dotnet SDK')) { + process.exit(1); + } + if (!checkPrerequisite(aspireCliPath, ['--version'], 'Aspire CLI')) { + process.exit(1); + } + + const psArgs = [ + '-NoProfile', + '-ExecutionPolicy', + 'Bypass', + '-File', + SCRIPT_PATH, + '-Language', + 'go', + ]; + if (aspireRepoPath) { + const resolvedPath = resolve(aspireRepoPath); + if (!existsSync(resolvedPath)) { + console.error(`❌ Aspire repo not found at: ${resolvedPath}`); + process.exit(1); + } + console.log(`🔄 Generating Go API reference data from ${resolvedPath}...`); + psArgs.push('-AspireRepoPath', resolvedPath); + } else { + console.log('🔄 Generating Go API reference data from installed Aspire CLI...'); + } + + const outputDir = process.env.ASPIRE_API_GO_MODULES_DIR + ? resolve(process.env.ASPIRE_API_GO_MODULES_DIR) + : GO_MODULES_DIR; + if (process.env.ASPIRE_API_GO_MODULES_DIR) { + psArgs.push('-OutputDir', outputDir); + } + + try { + execFileSync('pwsh', psArgs, { stdio: 'inherit', cwd: resolve(__dirname, '..') }); + console.log('✅ Go API reference data updated.'); + } catch (error: unknown) { + console.error('❌ Generation failed:', getErrorMessage(error)); + process.exit(1); + } + + // The generated JSON copies upstream XML documentation verbatim, so enforce + // Aspire terminology before it is committed (see normalize-generated-api-data.ts). + console.log('🔄 Normalizing Aspire terminology in go-modules JSON...'); + const { changes } = normalizeApiDir(outputDir); + console.log(`✅ Normalized ${changes} occurrence(s) in go-modules JSON.`); +} + +main(); diff --git a/src/frontend/scripts/update-integration-data.ps1 b/src/frontend/scripts/update-integration-data.ps1 index feae0332ab..8be23b3906 100644 --- a/src/frontend/scripts/update-integration-data.ps1 +++ b/src/frontend/scripts/update-integration-data.ps1 @@ -5,7 +5,7 @@ .DESCRIPTION Refreshes the aspire.dev integration data and, when integration package - versions change, regenerates the C#/TypeScript API reference JSON and the + versions change, regenerates the C#/TypeScript/Go API reference JSON and the twoslash bundle. Replaces the former `gh aw` agentic workflow with plain, reliable scripting that runs identically in CI and locally. @@ -21,6 +21,7 @@ a. generate-package-json.ps1 -> src/data/pkgs/*.json (C# API) b. bun run update:ts-api -> src/data/ts-modules/*.json (TS API) + chains twoslash aspire.d.ts bundle + c. bun run update:go-api -> src/data/go-modules/*.json (Go API) 4. Semantic validation — cross-checks generated identities, provenance, DTO optionality, inheritance, options shapes, and attribute payloads. 5. Scope check — the working tree must only contain allowed data files. @@ -29,7 +30,7 @@ Exit codes: 0 success (whether or not there were changes) - 1 a required phase failed (data update/validation, TS API regen, out-of-scope diff). + 1 a required phase failed (data update/validation, TS/Go API regen, out-of-scope diff). The caller must NOT open a PR on a non-zero exit. Package failures retain last-good API data and are recorded for retry and @@ -85,6 +86,7 @@ $AllowedPaths = @( 'src/frontend/src/assets/samples/', 'src/frontend/src/data/pkgs/', 'src/frontend/src/data/ts-modules/', + 'src/frontend/src/data/go-modules/', 'src/frontend/src/data/twoslash/aspire.d.ts' ) @@ -203,6 +205,7 @@ function Restore-ApiEnvironment { foreach ($name in @( 'ASPIRE_API_PKGS_DIR', 'ASPIRE_API_TS_MODULES_DIR', + 'ASPIRE_API_GO_MODULES_DIR', 'ASPIRE_API_TWOSLASH_FILE', 'ASPIRE_TS_API_CARRY_FORWARD' )) { @@ -242,6 +245,7 @@ function Publish-GeneratedApiData { param( [Parameter(Mandatory)][string]$PackageSource, [Parameter(Mandatory)][string]$ModuleSource, + [Parameter(Mandatory)][string]$GoModuleSource, [Parameter(Mandatory)][string]$TwoslashSource ) @@ -256,6 +260,11 @@ function Publish-GeneratedApiData { Destination = Join-Path $DataDir 'ts-modules' Backup = Join-Path $script:ApiStageRoot 'backup-ts-modules' }, + [PSCustomObject]@{ + Source = $GoModuleSource + Destination = Join-Path $DataDir 'go-modules' + Backup = Join-Path $script:ApiStageRoot 'backup-go-modules' + }, [PSCustomObject]@{ Source = $TwoslashSource Destination = Join-Path $DataDir 'twoslash' 'aspire.d.ts' @@ -447,6 +456,9 @@ $tsApiSummary = '' $tsSkippedPackages = '' $tsToleratedPackages = '' $tsToleratedDiagnostics = [System.Collections.Generic.List[string]]::new() +$goApiSummary = '' +$goSkippedPackages = '' +$goToleratedPackages = '' $twoslashSummary = '' $semanticSummary = '' @@ -457,6 +469,7 @@ if (($versionsChanged -or $pendingApiFailures.Count -gt 0) -and -not $SkipRegen) New-Item -ItemType Directory -Path $script:ApiStageRoot -Force | Out-Null $pkgStageDir = Join-Path $script:ApiStageRoot 'pkgs' $tsStageDir = Join-Path $script:ApiStageRoot 'ts-modules' + $goStageDir = Join-Path $script:ApiStageRoot 'go-modules' $twoslashStageFile = Join-Path $script:ApiStageRoot 'twoslash' 'aspire.d.ts' foreach ($directory in @('pkgs', 'ts-modules')) { $destination = Join-Path $script:ApiStageRoot $directory @@ -467,6 +480,7 @@ if (($versionsChanged -or $pendingApiFailures.Count -gt 0) -and -not $SkipRegen) foreach ($name in @( 'ASPIRE_API_PKGS_DIR', 'ASPIRE_API_TS_MODULES_DIR', + 'ASPIRE_API_GO_MODULES_DIR', 'ASPIRE_API_TWOSLASH_FILE', 'ASPIRE_TS_API_CARRY_FORWARD' )) { @@ -474,6 +488,7 @@ if (($versionsChanged -or $pendingApiFailures.Count -gt 0) -and -not $SkipRegen) } $env:ASPIRE_API_PKGS_DIR = $pkgStageDir $env:ASPIRE_API_TS_MODULES_DIR = $tsStageDir + $env:ASPIRE_API_GO_MODULES_DIR = $goStageDir $env:ASPIRE_API_TWOSLASH_FILE = $twoslashStageFile $env:ASPIRE_TS_API_CARRY_FORWARD = '1' @@ -619,11 +634,58 @@ if (($versionsChanged -or $pendingApiFailures.Count -gt 0) -and -not $SkipRegen) $twoslashSummary = 'succeeded' + # 3c. Go API JSON. The Go projection reads the same Aspire CLI dumps as the + # TS pass and only changes how they are rendered, so a failure here is fatal + # for the same reason: never publish a partially regenerated API reference. + Write-Host "→ bun run update:go-api (Go API → go-modules/)" -ForegroundColor Cyan + Push-Location $FrontendDir + try { + $goLog = & bun run update:go-api 2>&1 | Tee-Object -Variable goTeed | Out-String + $goExit = $LASTEXITCODE + } + finally { + Pop-Location + } + if ($goExit -ne 0) { + Stop-ApiRegeneration "Go API generation failed.`n$goLog`nAborting; no PR will be opened." + } + + $goApiDone = ($goLog -split "`n" | + Where-Object { $_ -match 'Complete:\s+\d+\s+succeeded,\s+\d+\s+failed,\s+\d+\s+skipped' } | + Select-Object -First 1) + if (-not $goApiDone -or + $goApiDone -notmatch 'Complete:\s+(?\d+)\s+succeeded,\s+(?\d+)\s+failed,\s+(?\d+)\s+skipped') { + Stop-ApiRegeneration "Go API generation did not emit a valid completion summary. Aborting; no PR will be opened." + } + $goApiSummary = "$($Matches.Succeeded) succeeded, $($Matches.Failed) failed, $($Matches.Skipped) skipped" + if ([int]$Matches.Failed -gt 0) { + Stop-ApiRegeneration "Go API generation reported $($Matches.Failed) package failure(s). Aborting; no PR will be opened." + } + $goSkippedLine = ($goLog -split "`n" | + Where-Object { $_ -match '^\s*Skipped packages:' } | + Select-Object -First 1) + $goSkippedPackages = if ($goSkippedLine) { + ($goSkippedLine -replace '^\s*Skipped packages:\s*', '').Trim() + } + else { '' } + $goToleratedLine = ($goLog -split "`n" | + Where-Object { $_ -match '^\s*Packages with tolerated ATS diagnostics:' } | + Select-Object -First 1) + if ($goToleratedLine) { + $goToleratedPackages = ($goToleratedLine -replace '^\s*Packages with tolerated ATS diagnostics:\s*', '').Trim() + $goToleratedWarning = "Go modules were generated despite known ATS scanner diagnostics for: $goToleratedPackages. " + + "Their APIs may be incomplete until the Aspire CLI includes microsoft/aspire#20443; review them before merging." + Write-Warning $goToleratedWarning + if ($IsCI) { + Write-Host "::warning title=Tolerated ATS scanner diagnostics (Go)::$goToleratedWarning" + } + } + # Only a complete generation pass may clear a previously reported failure. Set-Output 'regen_ran' 'true' Set-Output 'api_failures_checked' 'true' - # 3c. Cross-artifact semantic validation. This runs only after every + # 3d. Cross-artifact semantic validation. This runs only after every # generator has completed and must pass before the workflow can publish. Write-Host "→ bun run validate:api-data (semantic regression gate)" -ForegroundColor Cyan Push-Location $FrontendDir @@ -643,6 +705,7 @@ if (($versionsChanged -or $pendingApiFailures.Count -gt 0) -and -not $SkipRegen) Publish-GeneratedApiData ` -PackageSource $pkgStageDir ` -ModuleSource $tsStageDir ` + -GoModuleSource $goStageDir ` -TwoslashSource $twoslashStageFile } catch { @@ -712,6 +775,7 @@ function Get-AreaCounts { $pkgsCounts = Get-AreaCounts -Prefix 'src/frontend/src/data/pkgs/' $tsModulesCounts = Get-AreaCounts -Prefix 'src/frontend/src/data/ts-modules/' +$goModulesCounts = Get-AreaCounts -Prefix 'src/frontend/src/data/go-modules/' $twoslashChanged = @(Invoke-Git @('diff', '--name-only', 'HEAD', '--', 'src/frontend/src/data/twoslash/aspire.d.ts') | Where-Object { $_ -and $_.Trim().Length -gt 0 }).Count -gt 0 @@ -739,7 +803,7 @@ $sb = [System.Text.StringBuilder]::new() [void]$sb.AppendLine("### API reference regeneration") [void]$sb.AppendLine("") if ($regenRan) { - [void]$sb.AppendLine("The C# and TypeScript API reference data and twoslash bundle were regenerated for version changes or to retry previously failed packages:") + [void]$sb.AppendLine("The C#, TypeScript, and Go API reference data and twoslash bundle were regenerated for version changes or to retry previously failed packages:") [void]$sb.AppendLine("") $shown = 0 foreach ($change in $versionChanges) { @@ -755,12 +819,14 @@ if ($regenRan) { [void]$sb.AppendLine("|---|---|---|---|") [void]$sb.AppendLine("| ``src/frontend/src/data/pkgs/**`` | $($pkgsCounts.Added) | $($pkgsCounts.Modified) | $($pkgsCounts.Removed) |") [void]$sb.AppendLine("| ``src/frontend/src/data/ts-modules/**`` | $($tsModulesCounts.Added) | $($tsModulesCounts.Modified) | $($tsModulesCounts.Removed) |") + [void]$sb.AppendLine("| ``src/frontend/src/data/go-modules/**`` | $($goModulesCounts.Added) | $($goModulesCounts.Modified) | $($goModulesCounts.Removed) |") [void]$sb.AppendLine("| ``src/frontend/src/data/twoslash/aspire.d.ts`` | — | $(if ($twoslashChanged) { 'yes' } else { 'no' }) | — |") [void]$sb.AppendLine("") [void]$sb.AppendLine("Generator summary:") [void]$sb.AppendLine("") [void]$sb.AppendLine("- C# API JSON (``generate-package-json.ps1`` → ``pkgs/``): $pkgSummary") [void]$sb.AppendLine("- TS API JSON (``update:ts-api`` → ``ts-modules/``): $tsApiSummary") + [void]$sb.AppendLine("- Go API JSON (``update:go-api`` → ``go-modules/``): $goApiSummary") [void]$sb.AppendLine("- Twoslash bundle (``twoslash/aspire.d.ts``): $twoslashSummary") [void]$sb.AppendLine("- Semantic generated-data validation: $semanticSummary") if ($pkgSkippedPackages) { @@ -769,6 +835,12 @@ if ($regenRan) { if ($tsSkippedPackages) { [void]$sb.AppendLine("- TypeScript packages skipped because they export no ATS functions: ``$tsSkippedPackages``") } + if ($goSkippedPackages) { + [void]$sb.AppendLine("- Go packages skipped because they export no ATS functions: ``$goSkippedPackages``") + } + if ($goToleratedPackages) { + [void]$sb.AppendLine("- :warning: Go modules were generated despite tolerated ATS scanner diagnostics for: ``$goToleratedPackages``") + } if ($pkgFailedPackages -or $tsFailedPackages) { [void]$sb.AppendLine("") [void]$sb.AppendLine("### :warning: API generation failures") @@ -817,11 +889,14 @@ if ($iconWarnings) { [void]$sb.AppendLine("- [ ] Package counts and versions updated appropriately") [void]$sb.AppendLine("- [ ] Official Aspire package icons still use package-specific NuGet icon URLs") if ($regenRan) { - [void]$sb.AppendLine("- [ ] New/removed ``pkgs/`` and ``ts-modules/`` files match the version changes") + [void]$sb.AppendLine("- [ ] New/removed ``pkgs/``, ``ts-modules/``, and ``go-modules/`` files match the version changes") [void]$sb.AppendLine("- [ ] ``src/frontend/src/data/twoslash/aspire.d.ts`` is included in the diff") if ($tsToleratedPackages) { [void]$sb.AppendLine("- [ ] TypeScript modules generated with tolerated ATS scanner diagnostics were reviewed") } + if ($goToleratedPackages) { + [void]$sb.AppendLine("- [ ] Go modules generated with tolerated ATS scanner diagnostics were reviewed") + } } $prBody = $sb.ToString() diff --git a/src/frontend/scripts/validate-generated-api-data.ts b/src/frontend/scripts/validate-generated-api-data.ts index 939039142c..656a220120 100644 --- a/src/frontend/scripts/validate-generated-api-data.ts +++ b/src/frontend/scripts/validate-generated-api-data.ts @@ -2,6 +2,7 @@ import { spawnSync } from 'child_process'; import fs from 'fs'; import path from 'path'; import { fileURLToPath } from 'url'; +import ts from 'typescript'; import { readEnumDeclarations } from './supplement-ats-enums'; interface CatalogEntry { @@ -366,6 +367,33 @@ function resolveBaseHierarchy( return hierarchy; } +export function hasNestedSingleDtoOptionsWrapper(declarations: string): boolean { + const sourceFile = ts.createSourceFile('aspire.d.ts', declarations, ts.ScriptTarget.Latest); + const visit = (node: ts.Node): boolean => { + if ( + ts.isParameter(node) && + node.questionToken && + ts.isIdentifier(node.name) && + node.name.text === 'options' && + node.type && + ts.isTypeLiteralNode(node.type) && + node.type.members.length === 1 + ) { + const member = node.type.members[0]; + if ( + ts.isPropertySignature(member) && + member.questionToken && + ts.isIdentifier(member.name) && + member.name.text === 'options' + ) { + return true; + } + } + return ts.forEachChild(node, visit) ?? false; + }; + return visit(sourceFile); +} + export function validateGeneratedApiData(input: ValidationInput): ValidationResult { const errors: string[] = []; const catalogByName = new Map(); @@ -585,7 +613,7 @@ export function validateGeneratedApiData(input: ValidationInput): ValidationResu } } - if (/options\?:\s*\{\s*options\?:/s.test(input.declarations)) { + if (hasNestedSingleDtoOptionsWrapper(input.declarations)) { errors.push('Twoslash declarations contain a nested single-DTO options wrapper.'); } diff --git a/src/frontend/src/assets/dashboard/ai-coding-agents/ai-agents-dialog-dark.png b/src/frontend/src/assets/dashboard/ai-coding-agents/ai-agents-dialog-dark.png deleted file mode 100644 index 88d3101d64..0000000000 Binary files a/src/frontend/src/assets/dashboard/ai-coding-agents/ai-agents-dialog-dark.png and /dev/null differ diff --git a/src/frontend/src/assets/dashboard/ai-coding-agents/ai-agents-dialog-light.png b/src/frontend/src/assets/dashboard/ai-coding-agents/ai-agents-dialog-light.png index 2165b9864a..1cc198a4f6 100644 Binary files a/src/frontend/src/assets/dashboard/ai-coding-agents/ai-agents-dialog-light.png and b/src/frontend/src/assets/dashboard/ai-coding-agents/ai-agents-dialog-light.png differ diff --git a/src/frontend/src/assets/dashboard/ai-coding-agents/ai-agents-dialog.png b/src/frontend/src/assets/dashboard/ai-coding-agents/ai-agents-dialog.png new file mode 100644 index 0000000000..0e2d785276 Binary files /dev/null and b/src/frontend/src/assets/dashboard/ai-coding-agents/ai-agents-dialog.png differ diff --git a/src/frontend/src/assets/dashboard/architecture-diagram-dark.svg b/src/frontend/src/assets/dashboard/architecture-diagram.svg similarity index 100% rename from src/frontend/src/assets/dashboard/architecture-diagram-dark.svg rename to src/frontend/src/assets/dashboard/architecture-diagram.svg diff --git a/src/frontend/src/assets/dashboard/explore/aspire-outage-gameplay-light.png b/src/frontend/src/assets/dashboard/explore/aspire-outage-gameplay-light.png new file mode 100644 index 0000000000..94719b43be Binary files /dev/null and b/src/frontend/src/assets/dashboard/explore/aspire-outage-gameplay-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/aspire-outage-gameplay.png b/src/frontend/src/assets/dashboard/explore/aspire-outage-gameplay.png new file mode 100644 index 0000000000..47bdc7a441 Binary files /dev/null and b/src/frontend/src/assets/dashboard/explore/aspire-outage-gameplay.png differ diff --git a/src/frontend/src/assets/dashboard/explore/aspire-outage-modes-light.png b/src/frontend/src/assets/dashboard/explore/aspire-outage-modes-light.png new file mode 100644 index 0000000000..2313ab99ee Binary files /dev/null and b/src/frontend/src/assets/dashboard/explore/aspire-outage-modes-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/aspire-outage-modes.png b/src/frontend/src/assets/dashboard/explore/aspire-outage-modes.png new file mode 100644 index 0000000000..4321dce2e4 Binary files /dev/null and b/src/frontend/src/assets/dashboard/explore/aspire-outage-modes.png differ diff --git a/src/frontend/src/assets/dashboard/explore/aspire-outage-start-light.png b/src/frontend/src/assets/dashboard/explore/aspire-outage-start-light.png new file mode 100644 index 0000000000..600681b682 Binary files /dev/null and b/src/frontend/src/assets/dashboard/explore/aspire-outage-start-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/aspire-outage-start.png b/src/frontend/src/assets/dashboard/explore/aspire-outage-start.png new file mode 100644 index 0000000000..a3d055210e Binary files /dev/null and b/src/frontend/src/assets/dashboard/explore/aspire-outage-start.png differ diff --git a/src/frontend/src/assets/dashboard/explore/container-logs-light.png b/src/frontend/src/assets/dashboard/explore/container-logs-light.png index 3286b3486c..534f418eb1 100644 Binary files a/src/frontend/src/assets/dashboard/explore/container-logs-light.png and b/src/frontend/src/assets/dashboard/explore/container-logs-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/container-logs.png b/src/frontend/src/assets/dashboard/explore/container-logs.png index 46dc39fff3..40b4c0598c 100644 Binary files a/src/frontend/src/assets/dashboard/explore/container-logs.png and b/src/frontend/src/assets/dashboard/explore/container-logs.png differ diff --git a/src/frontend/src/assets/dashboard/explore/dashboard-help-light.png b/src/frontend/src/assets/dashboard/explore/dashboard-help-light.png index 378c5b450a..7128dd39cc 100644 Binary files a/src/frontend/src/assets/dashboard/explore/dashboard-help-light.png and b/src/frontend/src/assets/dashboard/explore/dashboard-help-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/dashboard-help.png b/src/frontend/src/assets/dashboard/explore/dashboard-help.png index 32ad75c461..8d8b3ebf40 100644 Binary files a/src/frontend/src/assets/dashboard/explore/dashboard-help.png and b/src/frontend/src/assets/dashboard/explore/dashboard-help.png differ diff --git a/src/frontend/src/assets/dashboard/explore/download-console-logs-light.png b/src/frontend/src/assets/dashboard/explore/download-console-logs-light.png index 65771d1b41..009e5f690e 100644 Binary files a/src/frontend/src/assets/dashboard/explore/download-console-logs-light.png and b/src/frontend/src/assets/dashboard/explore/download-console-logs-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/download-console-logs.png b/src/frontend/src/assets/dashboard/explore/download-console-logs.png index b3d440bdba..00b3ce7d16 100644 Binary files a/src/frontend/src/assets/dashboard/explore/download-console-logs.png and b/src/frontend/src/assets/dashboard/explore/download-console-logs.png differ diff --git a/src/frontend/src/assets/dashboard/explore/filter-spans-trace-details-light.png b/src/frontend/src/assets/dashboard/explore/filter-spans-trace-details-light.png index 7886dfc163..9956b26abe 100644 Binary files a/src/frontend/src/assets/dashboard/explore/filter-spans-trace-details-light.png and b/src/frontend/src/assets/dashboard/explore/filter-spans-trace-details-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/filter-spans-trace-details.png b/src/frontend/src/assets/dashboard/explore/filter-spans-trace-details.png index fa6e6dce2c..cb4cf94b4d 100644 Binary files a/src/frontend/src/assets/dashboard/explore/filter-spans-trace-details.png and b/src/frontend/src/assets/dashboard/explore/filter-spans-trace-details.png differ diff --git a/src/frontend/src/assets/dashboard/explore/help-dialog-documentation-light.png b/src/frontend/src/assets/dashboard/explore/help-dialog-documentation-light.png new file mode 100644 index 0000000000..1e2da8ef59 Binary files /dev/null and b/src/frontend/src/assets/dashboard/explore/help-dialog-documentation-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/help-dialog-documentation.png b/src/frontend/src/assets/dashboard/explore/help-dialog-documentation.png new file mode 100644 index 0000000000..c10b9d8a8e Binary files /dev/null and b/src/frontend/src/assets/dashboard/explore/help-dialog-documentation.png differ diff --git a/src/frontend/src/assets/dashboard/explore/help-dialog-keyboard-shortcuts-light.png b/src/frontend/src/assets/dashboard/explore/help-dialog-keyboard-shortcuts-light.png new file mode 100644 index 0000000000..599d734007 Binary files /dev/null and b/src/frontend/src/assets/dashboard/explore/help-dialog-keyboard-shortcuts-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/help-dialog-keyboard-shortcuts.png b/src/frontend/src/assets/dashboard/explore/help-dialog-keyboard-shortcuts.png new file mode 100644 index 0000000000..b63ef0d493 Binary files /dev/null and b/src/frontend/src/assets/dashboard/explore/help-dialog-keyboard-shortcuts.png differ diff --git a/src/frontend/src/assets/dashboard/explore/manage-data-dialog-light.png b/src/frontend/src/assets/dashboard/explore/manage-data-dialog-light.png index b93cdd3105..1ac80065ee 100644 Binary files a/src/frontend/src/assets/dashboard/explore/manage-data-dialog-light.png and b/src/frontend/src/assets/dashboard/explore/manage-data-dialog-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/manage-data-dialog.png b/src/frontend/src/assets/dashboard/explore/manage-data-dialog.png index 7934c11df2..2baab0018f 100644 Binary files a/src/frontend/src/assets/dashboard/explore/manage-data-dialog.png and b/src/frontend/src/assets/dashboard/explore/manage-data-dialog.png differ diff --git a/src/frontend/src/assets/dashboard/explore/manage-data-expanded-light.png b/src/frontend/src/assets/dashboard/explore/manage-data-expanded-light.png index b6d7ea765d..41c774162e 100644 Binary files a/src/frontend/src/assets/dashboard/explore/manage-data-expanded-light.png and b/src/frontend/src/assets/dashboard/explore/manage-data-expanded-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/manage-data-expanded.png b/src/frontend/src/assets/dashboard/explore/manage-data-expanded.png index 2e3765d0d5..48e58500d1 100644 Binary files a/src/frontend/src/assets/dashboard/explore/manage-data-expanded.png and b/src/frontend/src/assets/dashboard/explore/manage-data-expanded.png differ diff --git a/src/frontend/src/assets/dashboard/explore/metrics-group-menu-light.png b/src/frontend/src/assets/dashboard/explore/metrics-group-menu-light.png new file mode 100644 index 0000000000..166ec46322 Binary files /dev/null and b/src/frontend/src/assets/dashboard/explore/metrics-group-menu-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/metrics-group-menu.png b/src/frontend/src/assets/dashboard/explore/metrics-group-menu.png new file mode 100644 index 0000000000..3075d68a49 Binary files /dev/null and b/src/frontend/src/assets/dashboard/explore/metrics-group-menu.png differ diff --git a/src/frontend/src/assets/dashboard/explore/metrics-page-exemplars-light.png b/src/frontend/src/assets/dashboard/explore/metrics-page-exemplars-light.png index 9702286fcc..31e4b3fd8c 100644 Binary files a/src/frontend/src/assets/dashboard/explore/metrics-page-exemplars-light.png and b/src/frontend/src/assets/dashboard/explore/metrics-page-exemplars-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/metrics-page-exemplars.png b/src/frontend/src/assets/dashboard/explore/metrics-page-exemplars.png index 610d677d6c..7ce79c3e79 100644 Binary files a/src/frontend/src/assets/dashboard/explore/metrics-page-exemplars.png and b/src/frontend/src/assets/dashboard/explore/metrics-page-exemplars.png differ diff --git a/src/frontend/src/assets/dashboard/explore/metrics-sort-menu-light.png b/src/frontend/src/assets/dashboard/explore/metrics-sort-menu-light.png new file mode 100644 index 0000000000..e0a5cf00be Binary files /dev/null and b/src/frontend/src/assets/dashboard/explore/metrics-sort-menu-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/metrics-sort-menu.png b/src/frontend/src/assets/dashboard/explore/metrics-sort-menu.png new file mode 100644 index 0000000000..d85a7c255b Binary files /dev/null and b/src/frontend/src/assets/dashboard/explore/metrics-sort-menu.png differ diff --git a/src/frontend/src/assets/dashboard/explore/metrics-table-view-light.png b/src/frontend/src/assets/dashboard/explore/metrics-table-view-light.png index 56ddf4707f..ee6cc8ccff 100644 Binary files a/src/frontend/src/assets/dashboard/explore/metrics-table-view-light.png and b/src/frontend/src/assets/dashboard/explore/metrics-table-view-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/metrics-table-view.png b/src/frontend/src/assets/dashboard/explore/metrics-table-view.png index 9d81f9b478..1e9934a32f 100644 Binary files a/src/frontend/src/assets/dashboard/explore/metrics-table-view.png and b/src/frontend/src/assets/dashboard/explore/metrics-table-view.png differ diff --git a/src/frontend/src/assets/dashboard/explore/metrics-view-count-light.png b/src/frontend/src/assets/dashboard/explore/metrics-view-count-light.png index a732f35eb7..d3f4a435e2 100644 Binary files a/src/frontend/src/assets/dashboard/explore/metrics-view-count-light.png and b/src/frontend/src/assets/dashboard/explore/metrics-view-count-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/metrics-view-count.png b/src/frontend/src/assets/dashboard/explore/metrics-view-count.png index 860695b433..d26c828b04 100644 Binary files a/src/frontend/src/assets/dashboard/explore/metrics-view-count.png and b/src/frontend/src/assets/dashboard/explore/metrics-view-count.png differ diff --git a/src/frontend/src/assets/dashboard/explore/metrics-view-filtered-light.png b/src/frontend/src/assets/dashboard/explore/metrics-view-filtered-light.png index 9d10af4796..524993be36 100644 Binary files a/src/frontend/src/assets/dashboard/explore/metrics-view-filtered-light.png and b/src/frontend/src/assets/dashboard/explore/metrics-view-filtered-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/metrics-view-filtered.png b/src/frontend/src/assets/dashboard/explore/metrics-view-filtered.png index 1ecc807711..8026f5ff7f 100644 Binary files a/src/frontend/src/assets/dashboard/explore/metrics-view-filtered.png and b/src/frontend/src/assets/dashboard/explore/metrics-view-filtered.png differ diff --git a/src/frontend/src/assets/dashboard/explore/metrics-view-light.png b/src/frontend/src/assets/dashboard/explore/metrics-view-light.png index 063ac40758..835435ac52 100644 Binary files a/src/frontend/src/assets/dashboard/explore/metrics-view-light.png and b/src/frontend/src/assets/dashboard/explore/metrics-view-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/metrics-view.png b/src/frontend/src/assets/dashboard/explore/metrics-view.png index a6972a8672..c51401d138 100644 Binary files a/src/frontend/src/assets/dashboard/explore/metrics-view.png and b/src/frontend/src/assets/dashboard/explore/metrics-view.png differ diff --git a/src/frontend/src/assets/dashboard/explore/notification-center-bell-light.png b/src/frontend/src/assets/dashboard/explore/notification-center-bell-light.png index fb0a5e7407..d78d96280c 100644 Binary files a/src/frontend/src/assets/dashboard/explore/notification-center-bell-light.png and b/src/frontend/src/assets/dashboard/explore/notification-center-bell-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/notification-center-bell.png b/src/frontend/src/assets/dashboard/explore/notification-center-bell.png index 3bc5fbf258..e47f3a7c5a 100644 Binary files a/src/frontend/src/assets/dashboard/explore/notification-center-bell.png and b/src/frontend/src/assets/dashboard/explore/notification-center-bell.png differ diff --git a/src/frontend/src/assets/dashboard/explore/notification-center-open-light.png b/src/frontend/src/assets/dashboard/explore/notification-center-open-light.png index 88ac6ac27c..e16ac54bfe 100644 Binary files a/src/frontend/src/assets/dashboard/explore/notification-center-open-light.png and b/src/frontend/src/assets/dashboard/explore/notification-center-open-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/notification-center-open.png b/src/frontend/src/assets/dashboard/explore/notification-center-open.png index 92102034e6..b5777b4ee8 100644 Binary files a/src/frontend/src/assets/dashboard/explore/notification-center-open.png and b/src/frontend/src/assets/dashboard/explore/notification-center-open.png differ diff --git a/src/frontend/src/assets/dashboard/explore/notification-center-response-light.png b/src/frontend/src/assets/dashboard/explore/notification-center-response-light.png index 7f6dc2476d..350368354f 100644 Binary files a/src/frontend/src/assets/dashboard/explore/notification-center-response-light.png and b/src/frontend/src/assets/dashboard/explore/notification-center-response-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/notification-center-response.png b/src/frontend/src/assets/dashboard/explore/notification-center-response.png index 16e22fcfe2..299638b956 100644 Binary files a/src/frontend/src/assets/dashboard/explore/notification-center-response.png and b/src/frontend/src/assets/dashboard/explore/notification-center-response.png differ diff --git a/src/frontend/src/assets/dashboard/explore/pause-telemetry-light.png b/src/frontend/src/assets/dashboard/explore/pause-telemetry-light.png index 8d94610ecb..2acfc470d4 100644 Binary files a/src/frontend/src/assets/dashboard/explore/pause-telemetry-light.png and b/src/frontend/src/assets/dashboard/explore/pause-telemetry-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/pause-telemetry.png b/src/frontend/src/assets/dashboard/explore/pause-telemetry.png index fe5ee481e3..c84a35ccba 100644 Binary files a/src/frontend/src/assets/dashboard/explore/pause-telemetry.png and b/src/frontend/src/assets/dashboard/explore/pause-telemetry.png differ diff --git a/src/frontend/src/assets/dashboard/explore/project-logs-light.png b/src/frontend/src/assets/dashboard/explore/project-logs-light.png index 8c6c0abf5b..1b65406361 100644 Binary files a/src/frontend/src/assets/dashboard/explore/project-logs-light.png and b/src/frontend/src/assets/dashboard/explore/project-logs-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/project-logs.png b/src/frontend/src/assets/dashboard/explore/project-logs.png index 6aab0d4242..6d05d93f04 100644 Binary files a/src/frontend/src/assets/dashboard/explore/project-logs.png and b/src/frontend/src/assets/dashboard/explore/project-logs.png differ diff --git a/src/frontend/src/assets/dashboard/explore/projects-dark.png b/src/frontend/src/assets/dashboard/explore/projects-dark.png deleted file mode 100644 index 155e47613d..0000000000 Binary files a/src/frontend/src/assets/dashboard/explore/projects-dark.png and /dev/null differ diff --git a/src/frontend/src/assets/dashboard/explore/projects-errors-light.png b/src/frontend/src/assets/dashboard/explore/projects-errors-light.png index 8c47c5e6f5..0c5c5eb83c 100644 Binary files a/src/frontend/src/assets/dashboard/explore/projects-errors-light.png and b/src/frontend/src/assets/dashboard/explore/projects-errors-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/projects-errors.png b/src/frontend/src/assets/dashboard/explore/projects-errors.png index af4e429e88..8339434fc5 100644 Binary files a/src/frontend/src/assets/dashboard/explore/projects-errors.png and b/src/frontend/src/assets/dashboard/explore/projects-errors.png differ diff --git a/src/frontend/src/assets/dashboard/explore/projects-light.png b/src/frontend/src/assets/dashboard/explore/projects-light.png index 184bb6dd0c..f693bb09ff 100644 Binary files a/src/frontend/src/assets/dashboard/explore/projects-light.png and b/src/frontend/src/assets/dashboard/explore/projects-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/projects.png b/src/frontend/src/assets/dashboard/explore/projects.png index 65fc0ef928..a90283bb48 100644 Binary files a/src/frontend/src/assets/dashboard/explore/projects.png and b/src/frontend/src/assets/dashboard/explore/projects.png differ diff --git a/src/frontend/src/assets/dashboard/explore/recordings-dialog-light.png b/src/frontend/src/assets/dashboard/explore/recordings-dialog-light.png new file mode 100644 index 0000000000..a442b49fcd Binary files /dev/null and b/src/frontend/src/assets/dashboard/explore/recordings-dialog-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/recordings-dialog.png b/src/frontend/src/assets/dashboard/explore/recordings-dialog.png new file mode 100644 index 0000000000..7373a4120d Binary files /dev/null and b/src/frontend/src/assets/dashboard/explore/recordings-dialog.png differ diff --git a/src/frontend/src/assets/dashboard/explore/remove-telemetry-data-light.png b/src/frontend/src/assets/dashboard/explore/remove-telemetry-data-light.png index 2d0be1e6db..6b9c967cfe 100644 Binary files a/src/frontend/src/assets/dashboard/explore/remove-telemetry-data-light.png and b/src/frontend/src/assets/dashboard/explore/remove-telemetry-data-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/remove-telemetry-data-thumb.png b/src/frontend/src/assets/dashboard/explore/remove-telemetry-data-thumb.png index c7e3fad237..987ec7384f 100644 Binary files a/src/frontend/src/assets/dashboard/explore/remove-telemetry-data-thumb.png and b/src/frontend/src/assets/dashboard/explore/remove-telemetry-data-thumb.png differ diff --git a/src/frontend/src/assets/dashboard/explore/remove-telemetry-data.png b/src/frontend/src/assets/dashboard/explore/remove-telemetry-data.png index 7198aed5b2..56afd0f7a1 100644 Binary files a/src/frontend/src/assets/dashboard/explore/remove-telemetry-data.png and b/src/frontend/src/assets/dashboard/explore/remove-telemetry-data.png differ diff --git a/src/frontend/src/assets/dashboard/explore/resource-actions-light.png b/src/frontend/src/assets/dashboard/explore/resource-actions-light.png index 6e3ca1a5f1..dd08d50674 100644 Binary files a/src/frontend/src/assets/dashboard/explore/resource-actions-light.png and b/src/frontend/src/assets/dashboard/explore/resource-actions-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/resource-actions.png b/src/frontend/src/assets/dashboard/explore/resource-actions.png index 0f9004c176..eacc5fe9e0 100644 Binary files a/src/frontend/src/assets/dashboard/explore/resource-actions.png and b/src/frontend/src/assets/dashboard/explore/resource-actions.png differ diff --git a/src/frontend/src/assets/dashboard/explore/resource-details-light.png b/src/frontend/src/assets/dashboard/explore/resource-details-light.png index 347cc924a6..c31a5ee946 100644 Binary files a/src/frontend/src/assets/dashboard/explore/resource-details-light.png and b/src/frontend/src/assets/dashboard/explore/resource-details-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/resource-details-thumb.png b/src/frontend/src/assets/dashboard/explore/resource-details-thumb.png index 71adbd4d66..df025c8a8d 100644 Binary files a/src/frontend/src/assets/dashboard/explore/resource-details-thumb.png and b/src/frontend/src/assets/dashboard/explore/resource-details-thumb.png differ diff --git a/src/frontend/src/assets/dashboard/explore/resource-details.png b/src/frontend/src/assets/dashboard/explore/resource-details.png index 58039e3827..cfff29205a 100644 Binary files a/src/frontend/src/assets/dashboard/explore/resource-details.png and b/src/frontend/src/assets/dashboard/explore/resource-details.png differ diff --git a/src/frontend/src/assets/dashboard/explore/resource-list-collapse-light.png b/src/frontend/src/assets/dashboard/explore/resource-list-collapse-light.png new file mode 100644 index 0000000000..f6cb7aa236 Binary files /dev/null and b/src/frontend/src/assets/dashboard/explore/resource-list-collapse-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/resource-list-collapse.png b/src/frontend/src/assets/dashboard/explore/resource-list-collapse.png new file mode 100644 index 0000000000..e50f44aa23 Binary files /dev/null and b/src/frontend/src/assets/dashboard/explore/resource-list-collapse.png differ diff --git a/src/frontend/src/assets/dashboard/explore/resource-list-collapsed-light.png b/src/frontend/src/assets/dashboard/explore/resource-list-collapsed-light.png new file mode 100644 index 0000000000..e66b4de208 Binary files /dev/null and b/src/frontend/src/assets/dashboard/explore/resource-list-collapsed-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/resource-list-collapsed.png b/src/frontend/src/assets/dashboard/explore/resource-list-collapsed.png new file mode 100644 index 0000000000..dbc1fd609b Binary files /dev/null and b/src/frontend/src/assets/dashboard/explore/resource-list-collapsed.png differ diff --git a/src/frontend/src/assets/dashboard/explore/resource-picker-dropdown-light.png b/src/frontend/src/assets/dashboard/explore/resource-picker-dropdown-light.png new file mode 100644 index 0000000000..8040387aac Binary files /dev/null and b/src/frontend/src/assets/dashboard/explore/resource-picker-dropdown-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/resource-picker-dropdown.png b/src/frontend/src/assets/dashboard/explore/resource-picker-dropdown.png new file mode 100644 index 0000000000..bd00c2362b Binary files /dev/null and b/src/frontend/src/assets/dashboard/explore/resource-picker-dropdown.png differ diff --git a/src/frontend/src/assets/dashboard/explore/resource-select-all-light.png b/src/frontend/src/assets/dashboard/explore/resource-select-all-light.png new file mode 100644 index 0000000000..d2213ff789 Binary files /dev/null and b/src/frontend/src/assets/dashboard/explore/resource-select-all-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/resource-select-all.png b/src/frontend/src/assets/dashboard/explore/resource-select-all.png new file mode 100644 index 0000000000..498fcf9fe0 Binary files /dev/null and b/src/frontend/src/assets/dashboard/explore/resource-select-all.png differ diff --git a/src/frontend/src/assets/dashboard/explore/resource-select-multiple-light.png b/src/frontend/src/assets/dashboard/explore/resource-select-multiple-light.png new file mode 100644 index 0000000000..6f3fc9a9d7 Binary files /dev/null and b/src/frontend/src/assets/dashboard/explore/resource-select-multiple-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/resource-select-multiple.png b/src/frontend/src/assets/dashboard/explore/resource-select-multiple.png new file mode 100644 index 0000000000..b6726910b6 Binary files /dev/null and b/src/frontend/src/assets/dashboard/explore/resource-select-multiple.png differ diff --git a/src/frontend/src/assets/dashboard/explore/resource-select-single-light.png b/src/frontend/src/assets/dashboard/explore/resource-select-single-light.png new file mode 100644 index 0000000000..f4b94ed5cb Binary files /dev/null and b/src/frontend/src/assets/dashboard/explore/resource-select-single-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/resource-select-single.png b/src/frontend/src/assets/dashboard/explore/resource-select-single.png new file mode 100644 index 0000000000..e2d40b2fae Binary files /dev/null and b/src/frontend/src/assets/dashboard/explore/resource-select-single.png differ diff --git a/src/frontend/src/assets/dashboard/explore/resource-started-action-light.png b/src/frontend/src/assets/dashboard/explore/resource-started-action-light.png index 1c004cc000..e63ba27907 100644 Binary files a/src/frontend/src/assets/dashboard/explore/resource-started-action-light.png and b/src/frontend/src/assets/dashboard/explore/resource-started-action-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/resource-started-action.png b/src/frontend/src/assets/dashboard/explore/resource-started-action.png index 4cd0753a24..8c171e8cbb 100644 Binary files a/src/frontend/src/assets/dashboard/explore/resource-started-action.png and b/src/frontend/src/assets/dashboard/explore/resource-started-action.png differ diff --git a/src/frontend/src/assets/dashboard/explore/resource-stop-action-light.png b/src/frontend/src/assets/dashboard/explore/resource-stop-action-light.png index 63213e7cd7..d743cd9a2c 100644 Binary files a/src/frontend/src/assets/dashboard/explore/resource-stop-action-light.png and b/src/frontend/src/assets/dashboard/explore/resource-stop-action-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/resource-stop-action.png b/src/frontend/src/assets/dashboard/explore/resource-stop-action.png index 5640a04bac..32665cb9d8 100644 Binary files a/src/frontend/src/assets/dashboard/explore/resource-stop-action.png and b/src/frontend/src/assets/dashboard/explore/resource-stop-action.png differ diff --git a/src/frontend/src/assets/dashboard/explore/resource-stopped-action-light.png b/src/frontend/src/assets/dashboard/explore/resource-stopped-action-light.png index f7a90cdbad..d77c97655f 100644 Binary files a/src/frontend/src/assets/dashboard/explore/resource-stopped-action-light.png and b/src/frontend/src/assets/dashboard/explore/resource-stopped-action-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/resource-stopped-action.png b/src/frontend/src/assets/dashboard/explore/resource-stopped-action.png index bafc94e5a5..3fbaf43224 100644 Binary files a/src/frontend/src/assets/dashboard/explore/resource-stopped-action.png and b/src/frontend/src/assets/dashboard/explore/resource-stopped-action.png differ diff --git a/src/frontend/src/assets/dashboard/explore/resource-submenu-actions-light.png b/src/frontend/src/assets/dashboard/explore/resource-submenu-actions-light.png index 52260fd2e4..2bd47b6a7a 100644 Binary files a/src/frontend/src/assets/dashboard/explore/resource-submenu-actions-light.png and b/src/frontend/src/assets/dashboard/explore/resource-submenu-actions-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/resource-submenu-actions.png b/src/frontend/src/assets/dashboard/explore/resource-submenu-actions.png index 7b2b4b649f..7c29f15187 100644 Binary files a/src/frontend/src/assets/dashboard/explore/resource-submenu-actions.png and b/src/frontend/src/assets/dashboard/explore/resource-submenu-actions.png differ diff --git a/src/frontend/src/assets/dashboard/explore/resources-filtered-containers-light.png b/src/frontend/src/assets/dashboard/explore/resources-filtered-containers-light.png index 21e51d87ef..e1e223a865 100644 Binary files a/src/frontend/src/assets/dashboard/explore/resources-filtered-containers-light.png and b/src/frontend/src/assets/dashboard/explore/resources-filtered-containers-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/resources-filtered-containers.png b/src/frontend/src/assets/dashboard/explore/resources-filtered-containers.png index f640fbd5f3..4356bcf6e1 100644 Binary files a/src/frontend/src/assets/dashboard/explore/resources-filtered-containers.png and b/src/frontend/src/assets/dashboard/explore/resources-filtered-containers.png differ diff --git a/src/frontend/src/assets/dashboard/explore/resources-filters-light.png b/src/frontend/src/assets/dashboard/explore/resources-filters-light.png new file mode 100644 index 0000000000..a319a727b3 Binary files /dev/null and b/src/frontend/src/assets/dashboard/explore/resources-filters-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/resources-filters.png b/src/frontend/src/assets/dashboard/explore/resources-filters.png new file mode 100644 index 0000000000..602f04abe3 Binary files /dev/null and b/src/frontend/src/assets/dashboard/explore/resources-filters.png differ diff --git a/src/frontend/src/assets/dashboard/explore/resources-group-menu-light.png b/src/frontend/src/assets/dashboard/explore/resources-group-menu-light.png new file mode 100644 index 0000000000..b638ba1e31 Binary files /dev/null and b/src/frontend/src/assets/dashboard/explore/resources-group-menu-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/resources-group-menu.png b/src/frontend/src/assets/dashboard/explore/resources-group-menu.png new file mode 100644 index 0000000000..a13c08d530 Binary files /dev/null and b/src/frontend/src/assets/dashboard/explore/resources-group-menu.png differ diff --git a/src/frontend/src/assets/dashboard/explore/resources-grouped-light.png b/src/frontend/src/assets/dashboard/explore/resources-grouped-light.png new file mode 100644 index 0000000000..83e0fb1d87 Binary files /dev/null and b/src/frontend/src/assets/dashboard/explore/resources-grouped-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/resources-grouped.png b/src/frontend/src/assets/dashboard/explore/resources-grouped.png new file mode 100644 index 0000000000..b3beed7f2b Binary files /dev/null and b/src/frontend/src/assets/dashboard/explore/resources-grouped.png differ diff --git a/src/frontend/src/assets/dashboard/explore/select-resource-type-light.png b/src/frontend/src/assets/dashboard/explore/select-resource-type-light.png index 6f987de2bb..801c4acc5d 100644 Binary files a/src/frontend/src/assets/dashboard/explore/select-resource-type-light.png and b/src/frontend/src/assets/dashboard/explore/select-resource-type-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/select-resource-type.png b/src/frontend/src/assets/dashboard/explore/select-resource-type.png index e5a1fd9ed2..10c796201d 100644 Binary files a/src/frontend/src/assets/dashboard/explore/select-resource-type.png and b/src/frontend/src/assets/dashboard/explore/select-resource-type.png differ diff --git a/src/frontend/src/assets/dashboard/explore/settings-dialog-light.png b/src/frontend/src/assets/dashboard/explore/settings-dialog-light.png new file mode 100644 index 0000000000..1551906917 Binary files /dev/null and b/src/frontend/src/assets/dashboard/explore/settings-dialog-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/settings-dialog.png b/src/frontend/src/assets/dashboard/explore/settings-dialog.png new file mode 100644 index 0000000000..d1ef190d96 Binary files /dev/null and b/src/frontend/src/assets/dashboard/explore/settings-dialog.png differ diff --git a/src/frontend/src/assets/dashboard/explore/sidebar-grayed-resources-light.png b/src/frontend/src/assets/dashboard/explore/sidebar-grayed-resources-light.png new file mode 100644 index 0000000000..8a91ace024 Binary files /dev/null and b/src/frontend/src/assets/dashboard/explore/sidebar-grayed-resources-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/sidebar-grayed-resources.png b/src/frontend/src/assets/dashboard/explore/sidebar-grayed-resources.png new file mode 100644 index 0000000000..f32e08d7b7 Binary files /dev/null and b/src/frontend/src/assets/dashboard/explore/sidebar-grayed-resources.png differ diff --git a/src/frontend/src/assets/dashboard/explore/structured-logs-errors-light.png b/src/frontend/src/assets/dashboard/explore/structured-logs-errors-light.png index 4b13ca039f..f421afcd0e 100644 Binary files a/src/frontend/src/assets/dashboard/explore/structured-logs-errors-light.png and b/src/frontend/src/assets/dashboard/explore/structured-logs-errors-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/structured-logs-errors-view-thumb.png b/src/frontend/src/assets/dashboard/explore/structured-logs-errors-view-thumb.png index cfe186b0e1..d52d0b24e6 100644 Binary files a/src/frontend/src/assets/dashboard/explore/structured-logs-errors-view-thumb.png and b/src/frontend/src/assets/dashboard/explore/structured-logs-errors-view-thumb.png differ diff --git a/src/frontend/src/assets/dashboard/explore/structured-logs-errors.png b/src/frontend/src/assets/dashboard/explore/structured-logs-errors.png index f4eb44936a..0b43890bed 100644 Binary files a/src/frontend/src/assets/dashboard/explore/structured-logs-errors.png and b/src/frontend/src/assets/dashboard/explore/structured-logs-errors.png differ diff --git a/src/frontend/src/assets/dashboard/explore/structured-logs-filtered-dark.png b/src/frontend/src/assets/dashboard/explore/structured-logs-filtered-dark.png deleted file mode 100644 index d072d472fc..0000000000 Binary files a/src/frontend/src/assets/dashboard/explore/structured-logs-filtered-dark.png and /dev/null differ diff --git a/src/frontend/src/assets/dashboard/explore/structured-logs-filtered-light.png b/src/frontend/src/assets/dashboard/explore/structured-logs-filtered-light.png index e4cd76477c..9a2d48a1f9 100644 Binary files a/src/frontend/src/assets/dashboard/explore/structured-logs-filtered-light.png and b/src/frontend/src/assets/dashboard/explore/structured-logs-filtered-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/structured-logs-filtered.png b/src/frontend/src/assets/dashboard/explore/structured-logs-filtered.png index 601cbca692..334a2c4100 100644 Binary files a/src/frontend/src/assets/dashboard/explore/structured-logs-filtered.png and b/src/frontend/src/assets/dashboard/explore/structured-logs-filtered.png differ diff --git a/src/frontend/src/assets/dashboard/explore/structured-logs-light.png b/src/frontend/src/assets/dashboard/explore/structured-logs-light.png index 033aca9328..907daf0e9c 100644 Binary files a/src/frontend/src/assets/dashboard/explore/structured-logs-light.png and b/src/frontend/src/assets/dashboard/explore/structured-logs-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/structured-logs-trace-errors-light.png b/src/frontend/src/assets/dashboard/explore/structured-logs-trace-errors-light.png index 0e7c2e44de..91c5822356 100644 Binary files a/src/frontend/src/assets/dashboard/explore/structured-logs-trace-errors-light.png and b/src/frontend/src/assets/dashboard/explore/structured-logs-trace-errors-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/structured-logs-trace-errors.png b/src/frontend/src/assets/dashboard/explore/structured-logs-trace-errors.png index 1b249939c0..caddcee621 100644 Binary files a/src/frontend/src/assets/dashboard/explore/structured-logs-trace-errors.png and b/src/frontend/src/assets/dashboard/explore/structured-logs-trace-errors.png differ diff --git a/src/frontend/src/assets/dashboard/explore/structured-logs.png b/src/frontend/src/assets/dashboard/explore/structured-logs.png index 640b60f1a1..b1b997e5c2 100644 Binary files a/src/frontend/src/assets/dashboard/explore/structured-logs.png and b/src/frontend/src/assets/dashboard/explore/structured-logs.png differ diff --git a/src/frontend/src/assets/dashboard/explore/text-visualizer-resources-light.png b/src/frontend/src/assets/dashboard/explore/text-visualizer-resources-light.png index 4565dc290f..40faddfa35 100644 Binary files a/src/frontend/src/assets/dashboard/explore/text-visualizer-resources-light.png and b/src/frontend/src/assets/dashboard/explore/text-visualizer-resources-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/text-visualizer-resources.png b/src/frontend/src/assets/dashboard/explore/text-visualizer-resources.png index 05bd6c875a..758cbceae0 100644 Binary files a/src/frontend/src/assets/dashboard/explore/text-visualizer-resources.png and b/src/frontend/src/assets/dashboard/explore/text-visualizer-resources.png differ diff --git a/src/frontend/src/assets/dashboard/explore/text-visualizer-selection-menu-light.png b/src/frontend/src/assets/dashboard/explore/text-visualizer-selection-menu-light.png index d7c071f2a0..95d7883ef5 100644 Binary files a/src/frontend/src/assets/dashboard/explore/text-visualizer-selection-menu-light.png and b/src/frontend/src/assets/dashboard/explore/text-visualizer-selection-menu-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/text-visualizer-selection-menu.png b/src/frontend/src/assets/dashboard/explore/text-visualizer-selection-menu.png index a9ecca0f71..9da138a309 100644 Binary files a/src/frontend/src/assets/dashboard/explore/text-visualizer-selection-menu.png and b/src/frontend/src/assets/dashboard/explore/text-visualizer-selection-menu.png differ diff --git a/src/frontend/src/assets/dashboard/explore/theme-selection-explicit-dark.png b/src/frontend/src/assets/dashboard/explore/theme-selection-explicit-dark.png deleted file mode 100644 index 6f11cd40f9..0000000000 Binary files a/src/frontend/src/assets/dashboard/explore/theme-selection-explicit-dark.png and /dev/null differ diff --git a/src/frontend/src/assets/dashboard/explore/theme-selection-explicit-light.png b/src/frontend/src/assets/dashboard/explore/theme-selection-explicit-light.png new file mode 100644 index 0000000000..e53346af64 Binary files /dev/null and b/src/frontend/src/assets/dashboard/explore/theme-selection-explicit-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/theme-selection-explicit.png b/src/frontend/src/assets/dashboard/explore/theme-selection-explicit.png new file mode 100644 index 0000000000..270cb1df5b Binary files /dev/null and b/src/frontend/src/assets/dashboard/explore/theme-selection-explicit.png differ diff --git a/src/frontend/src/assets/dashboard/explore/theme-selection-light.png b/src/frontend/src/assets/dashboard/explore/theme-selection-light.png deleted file mode 100644 index 7e1e5fae9d..0000000000 Binary files a/src/frontend/src/assets/dashboard/explore/theme-selection-light.png and /dev/null differ diff --git a/src/frontend/src/assets/dashboard/explore/theme-selection-system-light.png b/src/frontend/src/assets/dashboard/explore/theme-selection-system-light.png index fab238b1e9..e53346af64 100644 Binary files a/src/frontend/src/assets/dashboard/explore/theme-selection-system-light.png and b/src/frontend/src/assets/dashboard/explore/theme-selection-system-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/theme-selection-system.png b/src/frontend/src/assets/dashboard/explore/theme-selection-system.png new file mode 100644 index 0000000000..270cb1df5b Binary files /dev/null and b/src/frontend/src/assets/dashboard/explore/theme-selection-system.png differ diff --git a/src/frontend/src/assets/dashboard/explore/theme-selection.png b/src/frontend/src/assets/dashboard/explore/theme-selection.png deleted file mode 100644 index fc0348d5d4..0000000000 Binary files a/src/frontend/src/assets/dashboard/explore/theme-selection.png and /dev/null differ diff --git a/src/frontend/src/assets/dashboard/explore/trace-light.png b/src/frontend/src/assets/dashboard/explore/trace-light.png index 4ad53d4a51..b9a1420ea5 100644 Binary files a/src/frontend/src/assets/dashboard/explore/trace-light.png and b/src/frontend/src/assets/dashboard/explore/trace-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/trace-span-details-light.png b/src/frontend/src/assets/dashboard/explore/trace-span-details-light.png index e1ef028017..f47e94dae5 100644 Binary files a/src/frontend/src/assets/dashboard/explore/trace-span-details-light.png and b/src/frontend/src/assets/dashboard/explore/trace-span-details-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/trace-span-details.png b/src/frontend/src/assets/dashboard/explore/trace-span-details.png index 2abffa3de1..ba475aba34 100644 Binary files a/src/frontend/src/assets/dashboard/explore/trace-span-details.png and b/src/frontend/src/assets/dashboard/explore/trace-span-details.png differ diff --git a/src/frontend/src/assets/dashboard/explore/trace-span-event-details-light.png b/src/frontend/src/assets/dashboard/explore/trace-span-event-details-light.png index b06435381a..d9a5e5df46 100644 Binary files a/src/frontend/src/assets/dashboard/explore/trace-span-event-details-light.png and b/src/frontend/src/assets/dashboard/explore/trace-span-event-details-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/trace-span-event-details.png b/src/frontend/src/assets/dashboard/explore/trace-span-event-details.png index d9d13a62d0..d2e4cd8d5e 100644 Binary files a/src/frontend/src/assets/dashboard/explore/trace-span-event-details.png and b/src/frontend/src/assets/dashboard/explore/trace-span-event-details.png differ diff --git a/src/frontend/src/assets/dashboard/explore/trace-view-errors-light.png b/src/frontend/src/assets/dashboard/explore/trace-view-errors-light.png index cabfde3cba..c9ae3470ff 100644 Binary files a/src/frontend/src/assets/dashboard/explore/trace-view-errors-light.png and b/src/frontend/src/assets/dashboard/explore/trace-view-errors-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/trace-view-errors.png b/src/frontend/src/assets/dashboard/explore/trace-view-errors.png index 9374a0598f..960cf92bf1 100644 Binary files a/src/frontend/src/assets/dashboard/explore/trace-view-errors.png and b/src/frontend/src/assets/dashboard/explore/trace-view-errors.png differ diff --git a/src/frontend/src/assets/dashboard/explore/trace-view-filter-light.png b/src/frontend/src/assets/dashboard/explore/trace-view-filter-light.png index c3c4fd4d6c..9956b26abe 100644 Binary files a/src/frontend/src/assets/dashboard/explore/trace-view-filter-light.png and b/src/frontend/src/assets/dashboard/explore/trace-view-filter-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/trace-view-filter.png b/src/frontend/src/assets/dashboard/explore/trace-view-filter.png index fd83c54555..cb4cf94b4d 100644 Binary files a/src/frontend/src/assets/dashboard/explore/trace-view-filter.png and b/src/frontend/src/assets/dashboard/explore/trace-view-filter.png differ diff --git a/src/frontend/src/assets/dashboard/explore/trace.png b/src/frontend/src/assets/dashboard/explore/trace.png index d8ba844e14..a4440d6543 100644 Binary files a/src/frontend/src/assets/dashboard/explore/trace.png and b/src/frontend/src/assets/dashboard/explore/trace.png differ diff --git a/src/frontend/src/assets/dashboard/explore/traces-errors-light.png b/src/frontend/src/assets/dashboard/explore/traces-errors-light.png index 9d283a28ae..7552b1b4b2 100644 Binary files a/src/frontend/src/assets/dashboard/explore/traces-errors-light.png and b/src/frontend/src/assets/dashboard/explore/traces-errors-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/traces-errors.png b/src/frontend/src/assets/dashboard/explore/traces-errors.png index d2d6f5633a..5d78f891dc 100644 Binary files a/src/frontend/src/assets/dashboard/explore/traces-errors.png and b/src/frontend/src/assets/dashboard/explore/traces-errors.png differ diff --git a/src/frontend/src/assets/dashboard/explore/traces-filtering-dark.png b/src/frontend/src/assets/dashboard/explore/traces-filtering-dark.png deleted file mode 100644 index f2dd0ea765..0000000000 Binary files a/src/frontend/src/assets/dashboard/explore/traces-filtering-dark.png and /dev/null differ diff --git a/src/frontend/src/assets/dashboard/explore/traces-filtering-light.png b/src/frontend/src/assets/dashboard/explore/traces-filtering-light.png index 4c3a97ac8d..67fac1598b 100644 Binary files a/src/frontend/src/assets/dashboard/explore/traces-filtering-light.png and b/src/frontend/src/assets/dashboard/explore/traces-filtering-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/traces-filtering.png b/src/frontend/src/assets/dashboard/explore/traces-filtering.png index 015cfc8b44..0d6a929da5 100644 Binary files a/src/frontend/src/assets/dashboard/explore/traces-filtering.png and b/src/frontend/src/assets/dashboard/explore/traces-filtering.png differ diff --git a/src/frontend/src/assets/dashboard/explore/traces-light.png b/src/frontend/src/assets/dashboard/explore/traces-light.png index 319931d67a..c6acb21de7 100644 Binary files a/src/frontend/src/assets/dashboard/explore/traces-light.png and b/src/frontend/src/assets/dashboard/explore/traces-light.png differ diff --git a/src/frontend/src/assets/dashboard/explore/traces.png b/src/frontend/src/assets/dashboard/explore/traces.png index fc022f08af..2ff1a465a7 100644 Binary files a/src/frontend/src/assets/dashboard/explore/traces.png and b/src/frontend/src/assets/dashboard/explore/traces.png differ diff --git a/src/frontend/src/assets/dashboard/landing/aspire-outage-gameplay-light.png b/src/frontend/src/assets/dashboard/landing/aspire-outage-gameplay-light.png new file mode 100644 index 0000000000..7efd9aa67c Binary files /dev/null and b/src/frontend/src/assets/dashboard/landing/aspire-outage-gameplay-light.png differ diff --git a/src/frontend/src/assets/dashboard/landing/aspire-outage-gameplay.png b/src/frontend/src/assets/dashboard/landing/aspire-outage-gameplay.png new file mode 100644 index 0000000000..742ada770f Binary files /dev/null and b/src/frontend/src/assets/dashboard/landing/aspire-outage-gameplay.png differ diff --git a/src/frontend/src/assets/dashboard/landing/aspire-outage-modes-light.png b/src/frontend/src/assets/dashboard/landing/aspire-outage-modes-light.png new file mode 100644 index 0000000000..afa2226a47 Binary files /dev/null and b/src/frontend/src/assets/dashboard/landing/aspire-outage-modes-light.png differ diff --git a/src/frontend/src/assets/dashboard/landing/aspire-outage-modes.png b/src/frontend/src/assets/dashboard/landing/aspire-outage-modes.png new file mode 100644 index 0000000000..09afd8f348 Binary files /dev/null and b/src/frontend/src/assets/dashboard/landing/aspire-outage-modes.png differ diff --git a/src/frontend/src/assets/dashboard/landing/console-dark.png b/src/frontend/src/assets/dashboard/landing/console-dark.png deleted file mode 100644 index 78b539a12b..0000000000 Binary files a/src/frontend/src/assets/dashboard/landing/console-dark.png and /dev/null differ diff --git a/src/frontend/src/assets/dashboard/landing/console-light.png b/src/frontend/src/assets/dashboard/landing/console-light.png index b91b90820e..1b65406361 100644 Binary files a/src/frontend/src/assets/dashboard/landing/console-light.png and b/src/frontend/src/assets/dashboard/landing/console-light.png differ diff --git a/src/frontend/src/assets/dashboard/landing/console.png b/src/frontend/src/assets/dashboard/landing/console.png new file mode 100644 index 0000000000..6d05d93f04 Binary files /dev/null and b/src/frontend/src/assets/dashboard/landing/console.png differ diff --git a/src/frontend/src/assets/dashboard/landing/metrics-dark.png b/src/frontend/src/assets/dashboard/landing/metrics-dark.png deleted file mode 100644 index b12da3ea7d..0000000000 Binary files a/src/frontend/src/assets/dashboard/landing/metrics-dark.png and /dev/null differ diff --git a/src/frontend/src/assets/dashboard/landing/metrics-light.png b/src/frontend/src/assets/dashboard/landing/metrics-light.png index 71ba292a59..b813b77655 100644 Binary files a/src/frontend/src/assets/dashboard/landing/metrics-light.png and b/src/frontend/src/assets/dashboard/landing/metrics-light.png differ diff --git a/src/frontend/src/assets/dashboard/landing/metrics.png b/src/frontend/src/assets/dashboard/landing/metrics.png new file mode 100644 index 0000000000..a5599e8fb4 Binary files /dev/null and b/src/frontend/src/assets/dashboard/landing/metrics.png differ diff --git a/src/frontend/src/assets/dashboard/landing/resources-graph-dark.png b/src/frontend/src/assets/dashboard/landing/resources-graph-dark.png deleted file mode 100644 index 3346a25b56..0000000000 Binary files a/src/frontend/src/assets/dashboard/landing/resources-graph-dark.png and /dev/null differ diff --git a/src/frontend/src/assets/dashboard/landing/resources-graph-light.png b/src/frontend/src/assets/dashboard/landing/resources-graph-light.png index aa35b3c23b..31162db5c7 100644 Binary files a/src/frontend/src/assets/dashboard/landing/resources-graph-light.png and b/src/frontend/src/assets/dashboard/landing/resources-graph-light.png differ diff --git a/src/frontend/src/assets/dashboard/landing/resources-graph.png b/src/frontend/src/assets/dashboard/landing/resources-graph.png new file mode 100644 index 0000000000..1f175408d8 Binary files /dev/null and b/src/frontend/src/assets/dashboard/landing/resources-graph.png differ diff --git a/src/frontend/src/assets/dashboard/landing/resources-table-dark.png b/src/frontend/src/assets/dashboard/landing/resources-table-dark.png deleted file mode 100644 index 5add353c0b..0000000000 Binary files a/src/frontend/src/assets/dashboard/landing/resources-table-dark.png and /dev/null differ diff --git a/src/frontend/src/assets/dashboard/landing/resources-table-light.png b/src/frontend/src/assets/dashboard/landing/resources-table-light.png index 09e9900f76..741ad22a01 100644 Binary files a/src/frontend/src/assets/dashboard/landing/resources-table-light.png and b/src/frontend/src/assets/dashboard/landing/resources-table-light.png differ diff --git a/src/frontend/src/assets/dashboard/landing/resources-table.png b/src/frontend/src/assets/dashboard/landing/resources-table.png new file mode 100644 index 0000000000..f5797e3c85 Binary files /dev/null and b/src/frontend/src/assets/dashboard/landing/resources-table.png differ diff --git a/src/frontend/src/assets/dashboard/landing/structured-logs-dark.png b/src/frontend/src/assets/dashboard/landing/structured-logs-dark.png deleted file mode 100644 index 00c6af7425..0000000000 Binary files a/src/frontend/src/assets/dashboard/landing/structured-logs-dark.png and /dev/null differ diff --git a/src/frontend/src/assets/dashboard/landing/structured-logs-light.png b/src/frontend/src/assets/dashboard/landing/structured-logs-light.png index 3fc3ab07d4..cbe62d127a 100644 Binary files a/src/frontend/src/assets/dashboard/landing/structured-logs-light.png and b/src/frontend/src/assets/dashboard/landing/structured-logs-light.png differ diff --git a/src/frontend/src/assets/dashboard/landing/structured-logs.png b/src/frontend/src/assets/dashboard/landing/structured-logs.png new file mode 100644 index 0000000000..d47f88f0c7 Binary files /dev/null and b/src/frontend/src/assets/dashboard/landing/structured-logs.png differ diff --git a/src/frontend/src/assets/dashboard/landing/trace-detail-dark.png b/src/frontend/src/assets/dashboard/landing/trace-detail-dark.png deleted file mode 100644 index d5731c421f..0000000000 Binary files a/src/frontend/src/assets/dashboard/landing/trace-detail-dark.png and /dev/null differ diff --git a/src/frontend/src/assets/dashboard/landing/trace-detail-light.png b/src/frontend/src/assets/dashboard/landing/trace-detail-light.png index 43b9067521..29fff028ad 100644 Binary files a/src/frontend/src/assets/dashboard/landing/trace-detail-light.png and b/src/frontend/src/assets/dashboard/landing/trace-detail-light.png differ diff --git a/src/frontend/src/assets/dashboard/landing/trace-detail.png b/src/frontend/src/assets/dashboard/landing/trace-detail.png new file mode 100644 index 0000000000..10ca71f6ae Binary files /dev/null and b/src/frontend/src/assets/dashboard/landing/trace-detail.png differ diff --git a/src/frontend/src/assets/dashboard/landing/traces-dark.png b/src/frontend/src/assets/dashboard/landing/traces-dark.png deleted file mode 100644 index ec7d8823c3..0000000000 Binary files a/src/frontend/src/assets/dashboard/landing/traces-dark.png and /dev/null differ diff --git a/src/frontend/src/assets/dashboard/landing/traces-light.png b/src/frontend/src/assets/dashboard/landing/traces-light.png index 5376122962..57c64d7ec5 100644 Binary files a/src/frontend/src/assets/dashboard/landing/traces-light.png and b/src/frontend/src/assets/dashboard/landing/traces-light.png differ diff --git a/src/frontend/src/assets/dashboard/landing/traces.png b/src/frontend/src/assets/dashboard/landing/traces.png new file mode 100644 index 0000000000..fc4e2af9a5 Binary files /dev/null and b/src/frontend/src/assets/dashboard/landing/traces.png differ diff --git a/src/frontend/src/assets/dashboard/terminals/terminal-detached-dark.png b/src/frontend/src/assets/dashboard/terminals/terminal-detached.png similarity index 100% rename from src/frontend/src/assets/dashboard/terminals/terminal-detached-dark.png rename to src/frontend/src/assets/dashboard/terminals/terminal-detached.png diff --git a/src/frontend/src/assets/dashboard/terminals/terminal-dock-dark.png b/src/frontend/src/assets/dashboard/terminals/terminal-dock.png similarity index 100% rename from src/frontend/src/assets/dashboard/terminals/terminal-dock-dark.png rename to src/frontend/src/assets/dashboard/terminals/terminal-dock.png diff --git a/src/frontend/src/assets/dashboard/terminals/terminal-interaction-dark.png b/src/frontend/src/assets/dashboard/terminals/terminal-interaction.png similarity index 100% rename from src/frontend/src/assets/dashboard/terminals/terminal-interaction-dark.png rename to src/frontend/src/assets/dashboard/terminals/terminal-interaction.png diff --git a/src/frontend/src/assets/dashboard/terminals/terminal-resource-dark.png b/src/frontend/src/assets/dashboard/terminals/terminal-resource.png similarity index 100% rename from src/frontend/src/assets/dashboard/terminals/terminal-resource-dark.png rename to src/frontend/src/assets/dashboard/terminals/terminal-resource.png diff --git a/src/frontend/src/assets/fundamentals/dashboard-unresolved-parameters-message-light.png b/src/frontend/src/assets/fundamentals/dashboard-unresolved-parameters-message-light.png index 8351eb2ed7..5c2d6e4375 100644 Binary files a/src/frontend/src/assets/fundamentals/dashboard-unresolved-parameters-message-light.png and b/src/frontend/src/assets/fundamentals/dashboard-unresolved-parameters-message-light.png differ diff --git a/src/frontend/src/assets/fundamentals/dashboard-unresolved-parameters-message.png b/src/frontend/src/assets/fundamentals/dashboard-unresolved-parameters-message.png index 5241c97b76..15e9d551b8 100644 Binary files a/src/frontend/src/assets/fundamentals/dashboard-unresolved-parameters-message.png and b/src/frontend/src/assets/fundamentals/dashboard-unresolved-parameters-message.png differ diff --git a/src/frontend/src/assets/fundamentals/health-checks-dashboard-status-light.png b/src/frontend/src/assets/fundamentals/health-checks-dashboard-status-light.png index 18187f8267..8f6b26db2a 100644 Binary files a/src/frontend/src/assets/fundamentals/health-checks-dashboard-status-light.png and b/src/frontend/src/assets/fundamentals/health-checks-dashboard-status-light.png differ diff --git a/src/frontend/src/assets/fundamentals/health-checks-dashboard-status.png b/src/frontend/src/assets/fundamentals/health-checks-dashboard-status.png index 7b351e4836..d6d45a8133 100644 Binary files a/src/frontend/src/assets/fundamentals/health-checks-dashboard-status.png and b/src/frontend/src/assets/fundamentals/health-checks-dashboard-status.png differ diff --git a/src/frontend/src/assets/get-started/csharp-aspire-dashboard-dark.png b/src/frontend/src/assets/get-started/csharp-aspire-dashboard-dark.png deleted file mode 100644 index 3137f0858d..0000000000 Binary files a/src/frontend/src/assets/get-started/csharp-aspire-dashboard-dark.png and /dev/null differ diff --git a/src/frontend/src/assets/get-started/csharp-aspire-dashboard-light.png b/src/frontend/src/assets/get-started/csharp-aspire-dashboard-light.png index 6923045d07..adcacc910e 100644 Binary files a/src/frontend/src/assets/get-started/csharp-aspire-dashboard-light.png and b/src/frontend/src/assets/get-started/csharp-aspire-dashboard-light.png differ diff --git a/src/frontend/src/assets/get-started/csharp-aspire-dashboard.png b/src/frontend/src/assets/get-started/csharp-aspire-dashboard.png new file mode 100644 index 0000000000..c4530c6b4b Binary files /dev/null and b/src/frontend/src/assets/get-started/csharp-aspire-dashboard.png differ diff --git a/src/frontend/src/assets/get-started/go-aspire-dashboard-dark.png b/src/frontend/src/assets/get-started/go-aspire-dashboard-dark.png new file mode 100644 index 0000000000..e09dbc8f37 Binary files /dev/null and b/src/frontend/src/assets/get-started/go-aspire-dashboard-dark.png differ diff --git a/src/frontend/src/assets/get-started/go-aspire-dashboard-light.png b/src/frontend/src/assets/get-started/go-aspire-dashboard-light.png new file mode 100644 index 0000000000..dd0f89c4b0 Binary files /dev/null and b/src/frontend/src/assets/get-started/go-aspire-dashboard-light.png differ diff --git a/src/frontend/src/assets/get-started/javascript-aspire-dashboard-dark.png b/src/frontend/src/assets/get-started/javascript-aspire-dashboard-dark.png deleted file mode 100644 index 6517439b2c..0000000000 Binary files a/src/frontend/src/assets/get-started/javascript-aspire-dashboard-dark.png and /dev/null differ diff --git a/src/frontend/src/assets/get-started/javascript-aspire-dashboard-light.png b/src/frontend/src/assets/get-started/javascript-aspire-dashboard-light.png index ac1348262c..bcc7b8fdb7 100644 Binary files a/src/frontend/src/assets/get-started/javascript-aspire-dashboard-light.png and b/src/frontend/src/assets/get-started/javascript-aspire-dashboard-light.png differ diff --git a/src/frontend/src/assets/get-started/javascript-aspire-dashboard.png b/src/frontend/src/assets/get-started/javascript-aspire-dashboard.png new file mode 100644 index 0000000000..c9141dd486 Binary files /dev/null and b/src/frontend/src/assets/get-started/javascript-aspire-dashboard.png differ diff --git a/src/frontend/src/assets/icons/microsoft-powerpoint.svg b/src/frontend/src/assets/icons/microsoft-powerpoint.svg new file mode 100644 index 0000000000..526c1cb4c7 --- /dev/null +++ b/src/frontend/src/assets/icons/microsoft-powerpoint.svg @@ -0,0 +1,25 @@ + + +MIT License + +Copyright (c) 2025 thesvg.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + \ No newline at end of file diff --git a/src/frontend/src/assets/whats-new/aspire-17/dashboard-home-light.png b/src/frontend/src/assets/whats-new/aspire-17/dashboard-home-light.png new file mode 100644 index 0000000000..42a04c006d Binary files /dev/null and b/src/frontend/src/assets/whats-new/aspire-17/dashboard-home-light.png differ diff --git a/src/frontend/src/assets/whats-new/aspire-17/dashboard-home.png b/src/frontend/src/assets/whats-new/aspire-17/dashboard-home.png new file mode 100644 index 0000000000..2a6447ecc4 Binary files /dev/null and b/src/frontend/src/assets/whats-new/aspire-17/dashboard-home.png differ diff --git a/src/frontend/src/assets/whats-new/aspire-17/dashboard-metrics-light.png b/src/frontend/src/assets/whats-new/aspire-17/dashboard-metrics-light.png new file mode 100644 index 0000000000..524e3e047b Binary files /dev/null and b/src/frontend/src/assets/whats-new/aspire-17/dashboard-metrics-light.png differ diff --git a/src/frontend/src/assets/whats-new/aspire-17/dashboard-metrics.png b/src/frontend/src/assets/whats-new/aspire-17/dashboard-metrics.png new file mode 100644 index 0000000000..94788432b0 Binary files /dev/null and b/src/frontend/src/assets/whats-new/aspire-17/dashboard-metrics.png differ diff --git a/src/frontend/src/assets/whats-new/aspire-17/dashboard-overview-light.png b/src/frontend/src/assets/whats-new/aspire-17/dashboard-overview-light.png new file mode 100644 index 0000000000..c8a27481d3 Binary files /dev/null and b/src/frontend/src/assets/whats-new/aspire-17/dashboard-overview-light.png differ diff --git a/src/frontend/src/assets/whats-new/aspire-17/dashboard-overview.png b/src/frontend/src/assets/whats-new/aspire-17/dashboard-overview.png new file mode 100644 index 0000000000..2e5412ac3d Binary files /dev/null and b/src/frontend/src/assets/whats-new/aspire-17/dashboard-overview.png differ diff --git a/src/frontend/src/assets/whats-new/aspire-17/testshop-dashboard-light.png b/src/frontend/src/assets/whats-new/aspire-17/testshop-dashboard-light.png new file mode 100644 index 0000000000..9b1b4f4586 Binary files /dev/null and b/src/frontend/src/assets/whats-new/aspire-17/testshop-dashboard-light.png differ diff --git a/src/frontend/src/assets/whats-new/aspire-17/testshop-dashboard.png b/src/frontend/src/assets/whats-new/aspire-17/testshop-dashboard.png new file mode 100644 index 0000000000..9c25fa8a9e Binary files /dev/null and b/src/frontend/src/assets/whats-new/aspire-17/testshop-dashboard.png differ diff --git a/src/frontend/src/assets/whats-new/aspire-17/testshop-resource-light.png b/src/frontend/src/assets/whats-new/aspire-17/testshop-resource-light.png new file mode 100644 index 0000000000..aeeeae5cc1 Binary files /dev/null and b/src/frontend/src/assets/whats-new/aspire-17/testshop-resource-light.png differ diff --git a/src/frontend/src/assets/whats-new/aspire-17/testshop-resource.png b/src/frontend/src/assets/whats-new/aspire-17/testshop-resource.png new file mode 100644 index 0000000000..f3269a3779 Binary files /dev/null and b/src/frontend/src/assets/whats-new/aspire-17/testshop-resource.png differ diff --git a/src/frontend/src/assets/whats-new/aspire-17/testshop-traces-light.png b/src/frontend/src/assets/whats-new/aspire-17/testshop-traces-light.png new file mode 100644 index 0000000000..69b2f48d4c Binary files /dev/null and b/src/frontend/src/assets/whats-new/aspire-17/testshop-traces-light.png differ diff --git a/src/frontend/src/assets/whats-new/aspire-17/testshop-traces.png b/src/frontend/src/assets/whats-new/aspire-17/testshop-traces.png new file mode 100644 index 0000000000..841353c7c5 Binary files /dev/null and b/src/frontend/src/assets/whats-new/aspire-17/testshop-traces.png differ diff --git a/src/frontend/src/components/ApiReference.astro b/src/frontend/src/components/ApiReference.astro index 9781ddca90..04a11aea81 100644 --- a/src/frontend/src/components/ApiReference.astro +++ b/src/frontend/src/components/ApiReference.astro @@ -34,14 +34,17 @@ const diagnosticText = resolution.diagnostics.map((diagnostic) => diagnostic.mes const languages: Array<{ id: string; icon: string; displayName: string }> = [ { id: 'csharp', icon: 'i-material-icon-theme:csharp', displayName: 'C#' }, { id: 'typescript', icon: 'i-material-icon-theme:typescript', displayName: 'TypeScript' }, + { id: 'go', icon: 'i-material-icon-theme:go', displayName: 'Go' }, ]; --- { languages.map(({ id, icon, displayName }) => { + if (id === 'go' && !resolution.targets?.go) return null; const target = - resolution.targets?.[id] ?? (id === 'csharp' ? resolution.csharp : resolution.typescript); + resolution.targets?.[id] ?? + (id === 'typescript' ? resolution.typescript : resolution.csharp); const href = target.path ? `${base}${target.path}` : undefined; const diagnostic = href ? undefined @@ -91,6 +94,7 @@ const languages: Array<{ id: string; icon: string; displayName: string }> = [ } :global(html[data-apphost-lang='csharp']) .ar-lang[data-lang='csharp'], + :global(html[data-apphost-lang='go']) .ar-lang[data-lang='go'], :global(html[data-apphost-lang='typescript']) .ar-lang[data-lang='typescript'] { display: inline; } diff --git a/src/frontend/src/components/AppHostBuilder.astro b/src/frontend/src/components/AppHostBuilder.astro index 8ba783e03f..79ea53c5ee 100644 --- a/src/frontend/src/components/AppHostBuilder.astro +++ b/src/frontend/src/components/AppHostBuilder.astro @@ -75,7 +75,7 @@ builder.Build().Run();`, apiFrontend: `var builder = DistributedApplication.CreateBuilder(args); // Add API service -var api = builder.AddProject("api", "../api/ApiService.csproj"); +var api = builder.AddDotnetProject("api", "../api/ApiService.csproj"); // Add frontend service and reference the API var frontend = builder.AddViteApp("frontend", "../frontend") @@ -87,7 +87,7 @@ builder.Build().Run();`, apiFrontendContainer: `var builder = DistributedApplication.CreateBuilder(args); // Add API service -var api = builder.AddProject("api", "../api/ApiService.csproj"); +var api = builder.AddDotnetProject("api", "../api/ApiService.csproj"); // Add frontend service and reference the API var frontend = builder.AddViteApp("frontend", "../frontend") @@ -107,7 +107,7 @@ var postgres = builder.AddPostgres("db") .AddDatabase("appdata"); // Add API service and reference the database -var api = builder.AddProject("api", "../api/ApiService.csproj") +var api = builder.AddDotnetProject("api", "../api/ApiService.csproj") .WithReference(postgres); // Add frontend service and reference the API @@ -124,7 +124,7 @@ var postgres = builder.AddPostgres("db") .AddDatabase("appdata"); // Add API service and reference the database -var api = builder.AddProject("api", "../api/ApiService.csproj") +var api = builder.AddDotnetProject("api", "../api/ApiService.csproj") .WithReference(postgres); // Add frontend service and reference the API @@ -162,14 +162,14 @@ builder.Build().Run();`, api: `var builder = DistributedApplication.CreateBuilder(args); // Add API service -var api = builder.AddProject("api", "../api/ApiService.csproj"); +var api = builder.AddDotnetProject("api", "../api/ApiService.csproj"); builder.Build().Run();`, apiContainer: `var builder = DistributedApplication.CreateBuilder(args); // Add API service -var api = builder.AddProject("api", "../api/ApiService.csproj"); +var api = builder.AddDotnetProject("api", "../api/ApiService.csproj"); // Add custom container var customContainer = builder.AddContainer("mycustomcontainer", "myregistry/myapp", "latest") @@ -184,7 +184,7 @@ var postgres = builder.AddPostgres("db") .AddDatabase("appdata"); // Add API service and reference the database -var api = builder.AddProject("api", "../api/ApiService.csproj") +var api = builder.AddDotnetProject("api", "../api/ApiService.csproj") .WithReference(postgres); builder.Build().Run();`, @@ -196,7 +196,7 @@ var postgres = builder.AddPostgres("db") .AddDatabase("appdata"); // Add API service and reference the database -var api = builder.AddProject("api", "../api/ApiService.csproj") +var api = builder.AddDotnetProject("api", "../api/ApiService.csproj") .WithReference(postgres); // Add custom container @@ -275,7 +275,7 @@ builder.Build().Run();`, apiFrontendDeployment: `var builder = DistributedApplication.CreateBuilder(args); // Add API service -var api = builder.AddProject("api", "../api/ApiService.csproj") +var api = builder.AddDotnetProject("api", "../api/ApiService.csproj") .PublishAsAzureContainerApp(); // Add frontend service and reference the API @@ -289,7 +289,7 @@ builder.Build().Run();`, apiFrontendContainerDeployment: `var builder = DistributedApplication.CreateBuilder(args); // Add API service -var api = builder.AddProject("api", "../api/ApiService.csproj") +var api = builder.AddDotnetProject("api", "../api/ApiService.csproj") .PublishAsAzureContainerApp(); // Add frontend service and reference the API @@ -314,7 +314,7 @@ var postgres = builder.AddAzurePostgresFlexibleServer("db") .RunAsContainer(); // Add API service and reference the database -var api = builder.AddProject("api", "../api/ApiService.csproj") +var api = builder.AddDotnetProject("api", "../api/ApiService.csproj") .WithReference(postgres) .WaitFor(postgres) .PublishAsAzureContainerApp(); @@ -336,7 +336,7 @@ var postgres = builder.AddAzurePostgresFlexibleServer("db") .RunAsContainer(); // Add API service and reference the database -var api = builder.AddProject("api", "../api/ApiService.csproj") +var api = builder.AddDotnetProject("api", "../api/ApiService.csproj") .WithReference(postgres) .WaitFor(postgres) .PublishAsAzureContainerApp(); @@ -383,7 +383,7 @@ builder.Build().Run();`, apiDeployment: `var builder = DistributedApplication.CreateBuilder(args); // Add API service -var api = builder.AddProject("api", "../api/ApiService.csproj") +var api = builder.AddDotnetProject("api", "../api/ApiService.csproj") .PublishAsAzureContainerApp(); builder.Build().Run();`, @@ -391,7 +391,7 @@ builder.Build().Run();`, apiContainerDeployment: `var builder = DistributedApplication.CreateBuilder(args); // Add API service -var api = builder.AddProject("api", "../api/ApiService.csproj") +var api = builder.AddDotnetProject("api", "../api/ApiService.csproj") .PublishAsAzureContainerApp(); // Add custom container @@ -410,7 +410,7 @@ var postgres = builder.AddAzurePostgresFlexibleServer("db") .RunAsContainer(); // Add API service and reference the database -var api = builder.AddProject("api", "../api/ApiService.csproj") +var api = builder.AddDotnetProject("api", "../api/ApiService.csproj") .WithReference(postgres) .WaitFor(postgres) .PublishAsAzureContainerApp(); @@ -426,7 +426,7 @@ var postgres = builder.AddAzurePostgresFlexibleServer("db") .RunAsContainer(); // Add API service and reference the database -var api = builder.AddProject("api", "../api/ApiService.csproj") +var api = builder.AddDotnetProject("api", "../api/ApiService.csproj") .WithReference(postgres) .WaitFor(postgres) .PublishAsAzureContainerApp(); @@ -448,6 +448,1008 @@ var customContainer = builder.AddContainer("mycustomcontainer", "myregistry/myap builder.Build().Run();`, }; +// Define all possible code combinations — Go +const goCodes: Record = { + empty: `package main + +import ( + "log" + + "apphost/modules/aspire" +) + +func main() { + builder, err := aspire.CreateBuilder() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + + // This would be a rather boring AppHost ☹️... + // Toggle the options above to see what an AppHost might look like. + // For example, select "Front end" to add a frontend service. + + app, err := builder.Build() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + if err := app.Run(); err != nil { + log.Fatal(aspire.FormatError(err)) + } +}`, + frontend: `package main + +import ( + "log" + + "apphost/modules/aspire" +) + +func main() { + builder, err := aspire.CreateBuilder() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + + // Add Vite frontend + builder.AddViteApp("frontend", "../frontend"). + WithHttpEndpoint(aspire.HttpEndpointEnv("PORT")) + + app, err := builder.Build() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + if err := app.Run(); err != nil { + log.Fatal(aspire.FormatError(err)) + } +}`, + frontendContainer: `package main + +import ( + "log" + + "apphost/modules/aspire" +) + +func main() { + builder, err := aspire.CreateBuilder() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + + // Add Vite frontend + builder.AddViteApp("frontend", "../frontend"). + WithHttpEndpoint(aspire.HttpEndpointEnv("PORT")) + + // Add custom container + builder.AddContainer("mycustomcontainer", "myregistry/myapp:latest"). + WithHttpEndpoint(aspire.HttpEndpointTargetPort(8080)) + + app, err := builder.Build() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + if err := app.Run(); err != nil { + log.Fatal(aspire.FormatError(err)) + } +}`, + databaseFrontend: `package main + +import ( + "log" + + "apphost/modules/aspire" +) + +func main() { + builder, err := aspire.CreateBuilder() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + + // Add database + builder.AddPostgres("db"). + WithDataVolume(). + AddDatabase("appdata") + + // Add Vite frontend + builder.AddViteApp("frontend", "../frontend"). + WithHttpEndpoint(aspire.HttpEndpointEnv("PORT")) + + app, err := builder.Build() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + if err := app.Run(); err != nil { + log.Fatal(aspire.FormatError(err)) + } +}`, + databaseFrontendContainer: `package main + +import ( + "log" + + "apphost/modules/aspire" +) + +func main() { + builder, err := aspire.CreateBuilder() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + + // Add database + builder.AddPostgres("db"). + WithDataVolume(). + AddDatabase("appdata") + + // Add Vite frontend + builder.AddViteApp("frontend", "../frontend"). + WithHttpEndpoint(aspire.HttpEndpointEnv("PORT")) + + // Add custom container + builder.AddContainer("mycustomcontainer", "myregistry/myapp:latest"). + WithHttpEndpoint(aspire.HttpEndpointTargetPort(8080)) + + app, err := builder.Build() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + if err := app.Run(); err != nil { + log.Fatal(aspire.FormatError(err)) + } +}`, + apiFrontend: `package main + +import ( + "log" + + "apphost/modules/aspire" +) + +func main() { + builder, err := aspire.CreateBuilder() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + + // Add Go API + api := builder.AddGoApp("api", "../api"). + WithHttpEndpoint(aspire.HttpEndpointEnv("PORT")) + + // Add Vite frontend and reference the API + builder.AddViteApp("frontend", "../frontend"). + WithHttpEndpoint(aspire.HttpEndpointEnv("PORT")). + WithReference(api) + + app, err := builder.Build() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + if err := app.Run(); err != nil { + log.Fatal(aspire.FormatError(err)) + } +}`, + apiFrontendContainer: `package main + +import ( + "log" + + "apphost/modules/aspire" +) + +func main() { + builder, err := aspire.CreateBuilder() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + + // Add Go API + api := builder.AddGoApp("api", "../api"). + WithHttpEndpoint(aspire.HttpEndpointEnv("PORT")) + + // Add Vite frontend and reference the API + builder.AddViteApp("frontend", "../frontend"). + WithHttpEndpoint(aspire.HttpEndpointEnv("PORT")). + WithReference(api) + + // Add custom container + builder.AddContainer("mycustomcontainer", "myregistry/myapp:latest"). + WithHttpEndpoint(aspire.HttpEndpointTargetPort(8080)) + + app, err := builder.Build() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + if err := app.Run(); err != nil { + log.Fatal(aspire.FormatError(err)) + } +}`, + databaseApiFrontend: `package main + +import ( + "log" + + "apphost/modules/aspire" +) + +func main() { + builder, err := aspire.CreateBuilder() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + + // Add database + postgres := builder.AddPostgres("db"). + WithDataVolume(). + AddDatabase("appdata") + + // Add Go API and reference the database + api := builder.AddGoApp("api", "../api"). + WithHttpEndpoint(aspire.HttpEndpointEnv("PORT")). + WithReference(postgres) + + // Add Vite frontend and reference the API + builder.AddViteApp("frontend", "../frontend"). + WithHttpEndpoint(aspire.HttpEndpointEnv("PORT")). + WithReference(api) + + app, err := builder.Build() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + if err := app.Run(); err != nil { + log.Fatal(aspire.FormatError(err)) + } +}`, + databaseApiFrontendContainer: `package main + +import ( + "log" + + "apphost/modules/aspire" +) + +func main() { + builder, err := aspire.CreateBuilder() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + + // Add database + postgres := builder.AddPostgres("db"). + WithDataVolume(). + AddDatabase("appdata") + + // Add Go API and reference the database + api := builder.AddGoApp("api", "../api"). + WithHttpEndpoint(aspire.HttpEndpointEnv("PORT")). + WithReference(postgres) + + // Add Vite frontend and reference the API + builder.AddViteApp("frontend", "../frontend"). + WithHttpEndpoint(aspire.HttpEndpointEnv("PORT")). + WithReference(api) + + // Add custom container + builder.AddContainer("mycustomcontainer", "myregistry/myapp:latest"). + WithHttpEndpoint(aspire.HttpEndpointTargetPort(8080)) + + app, err := builder.Build() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + if err := app.Run(); err != nil { + log.Fatal(aspire.FormatError(err)) + } +}`, + database: `package main + +import ( + "log" + + "apphost/modules/aspire" +) + +func main() { + builder, err := aspire.CreateBuilder() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + + // Add database + builder.AddPostgres("db"). + WithDataVolume(). + AddDatabase("appdata") + + app, err := builder.Build() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + if err := app.Run(); err != nil { + log.Fatal(aspire.FormatError(err)) + } +}`, + databaseContainer: `package main + +import ( + "log" + + "apphost/modules/aspire" +) + +func main() { + builder, err := aspire.CreateBuilder() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + + // Add database + builder.AddPostgres("db"). + WithDataVolume(). + AddDatabase("appdata") + + // Add custom container + builder.AddContainer("mycustomcontainer", "myregistry/myapp:latest"). + WithHttpEndpoint(aspire.HttpEndpointTargetPort(8080)) + + app, err := builder.Build() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + if err := app.Run(); err != nil { + log.Fatal(aspire.FormatError(err)) + } +}`, + api: `package main + +import ( + "log" + + "apphost/modules/aspire" +) + +func main() { + builder, err := aspire.CreateBuilder() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + + // Add Go API + builder.AddGoApp("api", "../api"). + WithHttpEndpoint(aspire.HttpEndpointEnv("PORT")) + + app, err := builder.Build() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + if err := app.Run(); err != nil { + log.Fatal(aspire.FormatError(err)) + } +}`, + apiContainer: `package main + +import ( + "log" + + "apphost/modules/aspire" +) + +func main() { + builder, err := aspire.CreateBuilder() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + + // Add Go API + builder.AddGoApp("api", "../api"). + WithHttpEndpoint(aspire.HttpEndpointEnv("PORT")) + + // Add custom container + builder.AddContainer("mycustomcontainer", "myregistry/myapp:latest"). + WithHttpEndpoint(aspire.HttpEndpointTargetPort(8080)) + + app, err := builder.Build() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + if err := app.Run(); err != nil { + log.Fatal(aspire.FormatError(err)) + } +}`, + databaseApi: `package main + +import ( + "log" + + "apphost/modules/aspire" +) + +func main() { + builder, err := aspire.CreateBuilder() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + + // Add database + postgres := builder.AddPostgres("db"). + WithDataVolume(). + AddDatabase("appdata") + + // Add Go API and reference the database + builder.AddGoApp("api", "../api"). + WithHttpEndpoint(aspire.HttpEndpointEnv("PORT")). + WithReference(postgres) + + app, err := builder.Build() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + if err := app.Run(); err != nil { + log.Fatal(aspire.FormatError(err)) + } +}`, + databaseApiContainer: `package main + +import ( + "log" + + "apphost/modules/aspire" +) + +func main() { + builder, err := aspire.CreateBuilder() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + + // Add database + postgres := builder.AddPostgres("db"). + WithDataVolume(). + AddDatabase("appdata") + + // Add Go API and reference the database + builder.AddGoApp("api", "../api"). + WithHttpEndpoint(aspire.HttpEndpointEnv("PORT")). + WithReference(postgres) + + // Add custom container + builder.AddContainer("mycustomcontainer", "myregistry/myapp:latest"). + WithHttpEndpoint(aspire.HttpEndpointTargetPort(8080)) + + app, err := builder.Build() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + if err := app.Run(); err != nil { + log.Fatal(aspire.FormatError(err)) + } +}`, + container: `package main + +import ( + "log" + + "apphost/modules/aspire" +) + +func main() { + builder, err := aspire.CreateBuilder() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + + // Add custom container + builder.AddContainer("mycustomcontainer", "myregistry/myapp:latest"). + WithHttpEndpoint(aspire.HttpEndpointTargetPort(8080)) + + app, err := builder.Build() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + if err := app.Run(); err != nil { + log.Fatal(aspire.FormatError(err)) + } +}`, + frontendDeployment: `package main + +import ( + "log" + + "apphost/modules/aspire" +) + +func main() { + builder, err := aspire.CreateBuilder() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + + // Add Vite frontend + builder.AddViteApp("frontend", "../frontend"). + WithHttpEndpoint(aspire.HttpEndpointEnv("PORT")). + PublishAsDockerFile(func(container aspire.ContainerResource) {}) + + app, err := builder.Build() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + if err := app.Run(); err != nil { + log.Fatal(aspire.FormatError(err)) + } +}`, + frontendContainerDeployment: `package main + +import ( + "log" + + "apphost/modules/aspire" +) + +func main() { + builder, err := aspire.CreateBuilder() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + + // Add Vite frontend + builder.AddViteApp("frontend", "../frontend"). + WithHttpEndpoint(aspire.HttpEndpointEnv("PORT")). + PublishAsDockerFile(func(container aspire.ContainerResource) {}) + + // Add custom container + builder.AddContainer("mycustomcontainer", "myregistry/myapp:latest"). + WithHttpEndpoint(aspire.HttpEndpointTargetPort(8080)). + PublishAsKubernetesService(func(service aspire.KubernetesResource) {}) + + app, err := builder.Build() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + if err := app.Run(); err != nil { + log.Fatal(aspire.FormatError(err)) + } +}`, + databaseFrontendDeployment: `package main + +import ( + "log" + + "apphost/modules/aspire" +) + +func main() { + builder, err := aspire.CreateBuilder() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + + // Add database + builder.AddAzurePostgresFlexibleServer("db"). + RunAsContainer(). + AddDatabase("appdata") + + // Add Vite frontend + builder.AddViteApp("frontend", "../frontend"). + WithHttpEndpoint(aspire.HttpEndpointEnv("PORT")). + PublishAsDockerFile(func(container aspire.ContainerResource) {}) + + app, err := builder.Build() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + if err := app.Run(); err != nil { + log.Fatal(aspire.FormatError(err)) + } +}`, + databaseFrontendContainerDeployment: `package main + +import ( + "log" + + "apphost/modules/aspire" +) + +func main() { + builder, err := aspire.CreateBuilder() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + + // Add database + builder.AddAzurePostgresFlexibleServer("db"). + RunAsContainer(). + AddDatabase("appdata") + + // Add Vite frontend + builder.AddViteApp("frontend", "../frontend"). + WithHttpEndpoint(aspire.HttpEndpointEnv("PORT")). + PublishAsDockerFile(func(container aspire.ContainerResource) {}) + + // Add custom container + builder.AddContainer("mycustomcontainer", "myregistry/myapp:latest"). + WithHttpEndpoint(aspire.HttpEndpointTargetPort(8080)). + PublishAsKubernetesService(func(service aspire.KubernetesResource) {}) + + app, err := builder.Build() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + if err := app.Run(); err != nil { + log.Fatal(aspire.FormatError(err)) + } +}`, + apiFrontendDeployment: `package main + +import ( + "log" + + "apphost/modules/aspire" +) + +func main() { + builder, err := aspire.CreateBuilder() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + + // Add Go API + api := builder.AddGoApp("api", "../api"). + WithHttpEndpoint(aspire.HttpEndpointEnv("PORT")). + PublishAsAzureContainerApp(func(infra aspire.AzureResourceInfrastructure, app aspire.ContainerApp) {}) + + // Add Vite frontend and reference the API + builder.AddViteApp("frontend", "../frontend"). + WithHttpEndpoint(aspire.HttpEndpointEnv("PORT")). + WithReference(api). + PublishAsDockerFile(func(container aspire.ContainerResource) {}) + + app, err := builder.Build() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + if err := app.Run(); err != nil { + log.Fatal(aspire.FormatError(err)) + } +}`, + apiFrontendContainerDeployment: `package main + +import ( + "log" + + "apphost/modules/aspire" +) + +func main() { + builder, err := aspire.CreateBuilder() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + + // Add Go API + api := builder.AddGoApp("api", "../api"). + WithHttpEndpoint(aspire.HttpEndpointEnv("PORT")). + PublishAsAzureContainerApp(func(infra aspire.AzureResourceInfrastructure, app aspire.ContainerApp) {}) + + // Add Vite frontend and reference the API + builder.AddViteApp("frontend", "../frontend"). + WithHttpEndpoint(aspire.HttpEndpointEnv("PORT")). + WithReference(api). + PublishAsDockerFile(func(container aspire.ContainerResource) {}) + + // Add custom container + builder.AddContainer("mycustomcontainer", "myregistry/myapp:latest"). + WithHttpEndpoint(aspire.HttpEndpointTargetPort(8080)). + PublishAsKubernetesService(func(service aspire.KubernetesResource) {}) + + app, err := builder.Build() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + if err := app.Run(); err != nil { + log.Fatal(aspire.FormatError(err)) + } +}`, + databaseApiFrontendDeployment: `package main + +import ( + "log" + + "apphost/modules/aspire" +) + +func main() { + builder, err := aspire.CreateBuilder() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + + // Add database + postgres := builder.AddAzurePostgresFlexibleServer("db"). + RunAsContainer(). + AddDatabase("appdata") + + // Add Go API and reference the database + api := builder.AddGoApp("api", "../api"). + WithHttpEndpoint(aspire.HttpEndpointEnv("PORT")). + WithReference(postgres). + PublishAsAzureContainerApp(func(infra aspire.AzureResourceInfrastructure, app aspire.ContainerApp) {}) + + // Add Vite frontend and reference the API + builder.AddViteApp("frontend", "../frontend"). + WithHttpEndpoint(aspire.HttpEndpointEnv("PORT")). + WithReference(api). + PublishAsDockerFile(func(container aspire.ContainerResource) {}) + + app, err := builder.Build() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + if err := app.Run(); err != nil { + log.Fatal(aspire.FormatError(err)) + } +}`, + databaseApiFrontendContainerDeployment: `package main + +import ( + "log" + + "apphost/modules/aspire" +) + +func main() { + builder, err := aspire.CreateBuilder() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + + // Add database + postgres := builder.AddAzurePostgresFlexibleServer("db"). + RunAsContainer(). + AddDatabase("appdata") + + // Add Go API and reference the database + api := builder.AddGoApp("api", "../api"). + WithHttpEndpoint(aspire.HttpEndpointEnv("PORT")). + WithReference(postgres). + PublishAsAzureContainerApp(func(infra aspire.AzureResourceInfrastructure, app aspire.ContainerApp) {}) + + // Add Vite frontend and reference the API + builder.AddViteApp("frontend", "../frontend"). + WithHttpEndpoint(aspire.HttpEndpointEnv("PORT")). + WithReference(api). + PublishAsDockerFile(func(container aspire.ContainerResource) {}) + + // Add custom container + builder.AddContainer("mycustomcontainer", "myregistry/myapp:latest"). + WithHttpEndpoint(aspire.HttpEndpointTargetPort(8080)). + PublishAsKubernetesService(func(service aspire.KubernetesResource) {}) + + app, err := builder.Build() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + if err := app.Run(); err != nil { + log.Fatal(aspire.FormatError(err)) + } +}`, + databaseDeployment: `package main + +import ( + "log" + + "apphost/modules/aspire" +) + +func main() { + builder, err := aspire.CreateBuilder() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + + // Add database + builder.AddAzurePostgresFlexibleServer("db"). + RunAsContainer(). + AddDatabase("appdata") + + app, err := builder.Build() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + if err := app.Run(); err != nil { + log.Fatal(aspire.FormatError(err)) + } +}`, + databaseContainerDeployment: `package main + +import ( + "log" + + "apphost/modules/aspire" +) + +func main() { + builder, err := aspire.CreateBuilder() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + + // Add database + builder.AddAzurePostgresFlexibleServer("db"). + RunAsContainer(). + AddDatabase("appdata") + + // Add custom container + builder.AddContainer("mycustomcontainer", "myregistry/myapp:latest"). + WithHttpEndpoint(aspire.HttpEndpointTargetPort(8080)). + PublishAsKubernetesService(func(service aspire.KubernetesResource) {}) + + app, err := builder.Build() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + if err := app.Run(); err != nil { + log.Fatal(aspire.FormatError(err)) + } +}`, + apiDeployment: `package main + +import ( + "log" + + "apphost/modules/aspire" +) + +func main() { + builder, err := aspire.CreateBuilder() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + + // Add Go API + builder.AddGoApp("api", "../api"). + WithHttpEndpoint(aspire.HttpEndpointEnv("PORT")). + PublishAsAzureContainerApp(func(infra aspire.AzureResourceInfrastructure, app aspire.ContainerApp) {}) + + app, err := builder.Build() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + if err := app.Run(); err != nil { + log.Fatal(aspire.FormatError(err)) + } +}`, + apiContainerDeployment: `package main + +import ( + "log" + + "apphost/modules/aspire" +) + +func main() { + builder, err := aspire.CreateBuilder() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + + // Add Go API + builder.AddGoApp("api", "../api"). + WithHttpEndpoint(aspire.HttpEndpointEnv("PORT")). + PublishAsAzureContainerApp(func(infra aspire.AzureResourceInfrastructure, app aspire.ContainerApp) {}) + + // Add custom container + builder.AddContainer("mycustomcontainer", "myregistry/myapp:latest"). + WithHttpEndpoint(aspire.HttpEndpointTargetPort(8080)). + PublishAsKubernetesService(func(service aspire.KubernetesResource) {}) + + app, err := builder.Build() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + if err := app.Run(); err != nil { + log.Fatal(aspire.FormatError(err)) + } +}`, + databaseApiDeployment: `package main + +import ( + "log" + + "apphost/modules/aspire" +) + +func main() { + builder, err := aspire.CreateBuilder() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + + // Add database + postgres := builder.AddAzurePostgresFlexibleServer("db"). + RunAsContainer(). + AddDatabase("appdata") + + // Add Go API and reference the database + builder.AddGoApp("api", "../api"). + WithHttpEndpoint(aspire.HttpEndpointEnv("PORT")). + WithReference(postgres). + PublishAsAzureContainerApp(func(infra aspire.AzureResourceInfrastructure, app aspire.ContainerApp) {}) + + app, err := builder.Build() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + if err := app.Run(); err != nil { + log.Fatal(aspire.FormatError(err)) + } +}`, + databaseApiContainerDeployment: `package main + +import ( + "log" + + "apphost/modules/aspire" +) + +func main() { + builder, err := aspire.CreateBuilder() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + + // Add database + postgres := builder.AddAzurePostgresFlexibleServer("db"). + RunAsContainer(). + AddDatabase("appdata") + + // Add Go API and reference the database + builder.AddGoApp("api", "../api"). + WithHttpEndpoint(aspire.HttpEndpointEnv("PORT")). + WithReference(postgres). + PublishAsAzureContainerApp(func(infra aspire.AzureResourceInfrastructure, app aspire.ContainerApp) {}) + + // Add custom container + builder.AddContainer("mycustomcontainer", "myregistry/myapp:latest"). + WithHttpEndpoint(aspire.HttpEndpointTargetPort(8080)). + PublishAsKubernetesService(func(service aspire.KubernetesResource) {}) + + app, err := builder.Build() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + if err := app.Run(); err != nil { + log.Fatal(aspire.FormatError(err)) + } +}`, + containerDeployment: `package main + +import ( + "log" + + "apphost/modules/aspire" +) + +func main() { + builder, err := aspire.CreateBuilder() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + + // Add custom container + builder.AddContainer("mycustomcontainer", "myregistry/myapp:latest"). + WithHttpEndpoint(aspire.HttpEndpointTargetPort(8080)). + PublishAsKubernetesService(func(service aspire.KubernetesResource) {}) + + app, err := builder.Build() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + if err := app.Run(); err != nil { + log.Fatal(aspire.FormatError(err)) + } +}`, +}; + // Define all possible code combinations — TypeScript const tsCodes: Record = { empty: `import { createBuilder } from './.aspire/modules/aspire.mjs'; @@ -1037,6 +2039,7 @@ await builder.build().run();`, TypeScript +
@@ -1236,6 +2239,21 @@ await builder.build().run();`, }
+ + +
+ {goCode && ( + + + + + )}
) : ( <> diff --git a/src/frontend/src/components/SimpleAppHostCode.shared.ts b/src/frontend/src/components/SimpleAppHostCode.shared.ts index c7a0650de9..4d5a033abe 100644 --- a/src/frontend/src/components/SimpleAppHostCode.shared.ts +++ b/src/frontend/src/components/SimpleAppHostCode.shared.ts @@ -5,12 +5,15 @@ export type CollapseValueType = string | string[] | undefined; export type LangType = 'csharp' | 'python' | 'nodejs' | 'go' | 'java'; export const typescriptLineOffset = 2; +export const goLineOffset = 12; function shiftLine(line: number, offset: number): number { return line + offset; } -function shiftRange(value: string, offset: number): string { +// A collapsed range that starts at line 1 must keep covering the extra header lines +// (imports, builder creation) that the TypeScript and Go samples add before line 1 of the C# sample. +function shiftRange(value: string, offset: number, anchorFirstLine = false): string { const [startText, endText] = value.split('-'); const start = Number.parseInt(startText, 10); @@ -24,7 +27,7 @@ function shiftRange(value: string, offset: number): string { return value; } - const shiftedStart = shiftLine(start, offset); + const shiftedStart = anchorFirstLine && start === 1 ? 1 : shiftLine(start, offset); const shiftedEnd = shiftLine(end, offset); return shiftedStart === shiftedEnd ? `${shiftedStart}` : `${shiftedStart}-${shiftedEnd}`; @@ -68,10 +71,10 @@ export function shiftCollapseValue(value: CollapseValueType, offset: number): Co } if (Array.isArray(value)) { - return value.map((item) => shiftRange(item, offset)); + return value.map((item) => shiftRange(item, offset, true)); } - return shiftRange(value, offset); + return shiftRange(value, offset, true); } const csharp = ` @@ -83,7 +86,7 @@ var postgres = builder.AddPostgres("db") .WithDataVolume(); // Add API service and reference the database -var api = builder.AddProject("api") +var api = builder.AddDotnetProject("api", "../api/Api.csproj") .WithReference(postgres) .WaitFor(postgres); @@ -193,7 +196,7 @@ const postgres = await builder.addPostgres("db") .withDataVolume(); // Add API service and reference the database -const api = await builder.addProject("api", "../api/Api.csproj", "https") +const api = await builder.addDotnetProject("api", "../api/Api.csproj") .withReference(postgres) .waitFor(postgres); @@ -253,6 +256,72 @@ await builder.addViteApp("frontend", "../frontend") await builder.build().run(); `; +function goAppHost(apiResource: string): string { + return ` +package main + +import ( + "log" + + "apphost/modules/aspire" +) + +func main() { + builder, err := aspire.CreateBuilder() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + + // Add database resource + postgres := builder.AddPostgres("db"). + WithDataVolume(). + AddDatabase("appdata") + + // Add API service and reference the database +${apiResource} + + // Add frontend service and reference the API + builder.AddViteApp("frontend", "../frontend"). + WithHttpEndpoint(aspire.HttpEndpointEnv("PORT")). + WithReference(api) + + app, err := builder.Build() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + if err := app.Run(); err != nil { + log.Fatal(aspire.FormatError(err)) + } +} +`; +} + +const csharpGo = goAppHost(` api := builder.AddDotnetProject("api", "../api/Api.csproj"). + WithReference(postgres). + WaitFor(postgres)`); + +const pythonGo = goAppHost(` api := builder.AddUvicornApp("api", "../api", "main:app"). + WithUv(). + WithReference(postgres). + WaitFor(postgres)`); + +const nodejsGo = goAppHost(` api := builder.AddNodeApp("api", "../api", "server.js"). + WithNpm(). + WithReference(postgres). + WaitFor(postgres)`); + +const golangGo = goAppHost(` api := builder.AddGoApp("api", "../api"). + WithHttpEndpoint(aspire.HttpEndpointEnv("PORT")). + WithReference(postgres). + WaitFor(postgres)`); + +const goCodeMap: Partial> = { + csharp: csharpGo, + python: pythonGo, + nodejs: nodejsGo, + go: golangGo, +}; + const csharpCodeMap: Record = { csharp, python, @@ -270,9 +339,11 @@ const typescriptCodeMap: Partial> = { export function getSimpleAppHostCode(lang: LangType): { csharpCode: string; typescriptCode?: string; + goCode?: string; } { return { csharpCode: csharpCodeMap[lang], typescriptCode: typescriptCodeMap[lang], + goCode: goCodeMap[lang], }; } diff --git a/src/frontend/src/components/ThreeTierAspire.astro b/src/frontend/src/components/ThreeTierAspire.astro index f59e4c77a8..ef4f581e61 100644 --- a/src/frontend/src/components/ThreeTierAspire.astro +++ b/src/frontend/src/components/ThreeTierAspire.astro @@ -54,7 +54,7 @@ var postgres = builder.AddPostgres("db") .WithDataVolume(); // Add API service and reference the database -var api = builder.AddProject("api", "../api/ApiService.csproj") +var api = builder.AddDotnetProject("api", "../api/ApiService.csproj") .WithReference(postgres) .WaitFor(postgres); diff --git a/src/frontend/src/components/api-reference/GoDocText.astro b/src/frontend/src/components/api-reference/GoDocText.astro new file mode 100644 index 0000000000..4bbbf90316 --- /dev/null +++ b/src/frontend/src/components/api-reference/GoDocText.astro @@ -0,0 +1,77 @@ +--- +/** + * GoDocText — renders a Go API description with its inline markup: `code` spans, + * references to other API items and external links. The accepted markup is + * documented in go-doc-text.ts. + * + * Text segments carry their own whitespace, so the map below must stay the only + * expression: the Astro compiler trims whitespace between an expression and the text + * beside it, which would join the words around each code span. + */ +import ReadableText from '@components/ReadableText.astro'; +import { resolveGoDocRef } from '@utils/go-doc-refs'; +import { parseGoDocText } from '@utils/go-doc-text'; +import { goModuleHref, type GoApiDocument } from '@utils/go-modules'; + +interface Props { + text: string; + /** Module whose pages references resolve against; without it references render as plain code. */ + module?: GoApiDocument; + base?: string; + /** Turn off inside another link, where a nested anchor is invalid; references keep their Go name. */ + link?: boolean; +} + +const { text, module, base = '', link = true } = Astro.props; + +const nodes = parseGoDocText(text).map((segment) => { + if (segment.kind !== 'ref') { + return segment; + } + + const target = module ? resolveGoDocRef(module, segment.refKind, segment.target) : undefined; + return { + kind: 'ref' as const, + label: target?.label ?? segment.label, + href: + link && module && target + ? `${goModuleHref(base, module.package.name)}${target.path}` + : undefined, + }; +}); +--- + +{ + nodes.map((node) => { + switch (node.kind) { + case 'text': + return node.text; + case 'code': + return ( + + + + ); + case 'ref': + return node.href ? ( + + + + + + ) : ( + + + + ); + case 'link': + return link ? ( + + {node.text} + + ) : ( + node.text + ); + } + }) +} diff --git a/src/frontend/src/components/api-reference/GoMemberCard.astro b/src/frontend/src/components/api-reference/GoMemberCard.astro new file mode 100644 index 0000000000..a731747525 --- /dev/null +++ b/src/frontend/src/components/api-reference/GoMemberCard.astro @@ -0,0 +1,308 @@ +--- +/** + * GoMemberCard — renders a single Go callable, property or struct field. + * + * Mirrors the MemberCardBase layout (header, description, signature, parameters, + * returns) and adds the two pieces only Go has: the trailing options struct and the + * error model. MemberCardBase is shared by the C# and TypeScript references, so the + * Go card lives beside it instead of widening that component. + */ +import { Code } from '@astrojs/starlight/components'; +import ReadableText from '@components/ReadableText.astro'; +import { + describeGoErrorModel, + formatGoSignature, + getGoOptionsParameterName, + type GoApiDocument, + type GoCallableOptions, + type GoFunctionParameter, +} from '@utils/go-modules'; +import GoDocText from './GoDocText.astro'; + +interface CardMember { + name: string; + description?: string | null; + signature?: string | null; + parameters?: GoFunctionParameter[]; + options?: GoCallableOptions | null; + /** Result type of a callable, or the value type of a property or field. */ + returnType?: string | null; + returns?: string | null; + errorModel?: string; + returnsBuilder?: boolean; +} + +interface Props { + member: CardMember; + variant?: 'method' | 'function' | 'property' | 'field'; + /** Replaces the kind pill text, e.g. `method` or `function` on a standalone function page. */ + kindLabel?: string; + /** Makes the member name a link. */ + href?: string | null; + /** Modifier badges such as `get · set`, `optional` or `callback`. */ + badges?: string[]; + /** Further signatures shown under the primary one, such as a property's setter. */ + relatedSignatures?: string[]; + /** Module whose pages references in descriptions link to. */ + module?: GoApiDocument; + base?: string; +} + +const { + member, + variant = 'method', + kindLabel: kindLabelOverride, + href, + badges: extraBadges = [], + relatedSignatures = [], + module, + base, +} = Astro.props; + +/** Simple string hash → 0–3 for type color assignment. */ +function typeColorIndex(s: string): number { + let h = 0; + for (const c of s) h = (h * 31 + c.charCodeAt(0)) | 0; + return Math.abs(h) % 4; +} + +const isCallable = variant === 'method' || variant === 'function'; +const kindLabel = variant === 'field' ? undefined : (kindLabelOverride ?? variant); +const kindClass = + variant === 'property' ? 'kind-property' : variant === 'field' ? 'kind-field' : 'kind-method'; +const badges = [...(member.returnsBuilder ? ['builder'] : []), ...extraBadges]; + +// A property is a getter plus an optional setter in Go, so show both accessor signatures. +const signatureCode = + variant === 'field' + ? '' + : [member.signature, ...relatedSignatures] + .filter((signature): signature is string => Boolean(signature)) + .map(formatGoSignature) + .join('\n'); + +const parameters: { name: string; type: string; description?: string | null; isCallback?: boolean }[] = isCallable + ? (member.parameters ?? []).map((parameter) => ({ + name: parameter.name, + type: parameter.type ?? 'any', + description: parameter.description, + isCallback: parameter.isCallback, + })) + : []; +const options = isCallable ? member.options : undefined; +if (options?.typeName) { + parameters.push({ + name: getGoOptionsParameterName({ signature: member.signature ?? undefined, options }), + type: `...*${options.typeName}`, + description: 'Optional settings, described under Options.', + }); +} + +const optionFields = options?.fields ?? []; +const returnType = member.returnType?.trim() || undefined; +const returnTypeColorIdx = returnType ? typeColorIndex(returnType) : 0; +const showReturnInHeader = !isCallable && returnType !== undefined; +const hasReturnSection = isCallable && (returnType !== undefined || member.errorModel !== undefined); + +// describeGoErrorModel quotes code with backticks; odd segments after splitting are code. +const errorModelSegments = + hasReturnSection && member.errorModel !== undefined + ? describeGoErrorModel({ errorModel: member.errorModel, returnType }).split('`') + : []; +--- + +
+ {/* Header */} +
+ {kindLabel && {kindLabel}} + { + href ? ( + + + + ) : ( + + ) + } + { + showReturnInHeader && returnType && ( + + + + ) + } + {badges.map((badge) => {badge})} +
+ + {/* Description */} + {member.description &&
} + + {/* Signature, in Go syntax without the `func` keyword */} + { + signatureCode && ( +
+ +
+ ) + } + + {/* Parameters: required parameters plus the trailing options struct */} + { + parameters.length > 0 && ( +
+ +
+ {parameters.map((parameter) => ( +
+ + + + + + {parameter.isCallback && callback} + + {parameter.description && ( + + )} +
+ ))} +
+
+ ) + } + + {/* Options: fields of the trailing options struct */} + { + options?.typeName && ( +
+ + {options.isDirect ? ( +

+ Optional parameters are passed as the existing *{options.typeName} struct. +

+ ) : ( +

+ Optional parameters are passed in a trailing{' '} + {getGoOptionsParameterName({ signature: member.signature ?? undefined, options })} ...*{options.typeName}{' '} + argument. +

+ )} + {optionFields.length > 0 && ( +
+ {optionFields.map((field) => { + const fieldType = field.isCallback && field.callbackSignature ? field.callbackSignature : (field.type ?? 'any'); + return ( +
+ + + + + + {field.isCallback && callback} + + {field.description && ( + + )} +
+ ); + })} +
+ )} +
+ ) + } + + {/* Returns: result type, its description and the error model */} + { + hasReturnSection && ( +
+ +
+ {returnType && ( + + + + )} + {member.returns &&

} + {errorModelSegments.length > 0 && ( +

+ {errorModelSegments.map((segment, index) => (index % 2 === 1 ? {segment} : segment))} +

+ )} +
+
+ ) + } +
+ + diff --git a/src/frontend/src/components/api-reference/search-lifecycle.ts b/src/frontend/src/components/api-reference/search-lifecycle.ts index a0a0856c39..0156a02f88 100644 --- a/src/frontend/src/components/api-reference/search-lifecycle.ts +++ b/src/frontend/src/components/api-reference/search-lifecycle.ts @@ -1,4 +1,4 @@ -type ApiSearchLanguage = 'csharp' | 'typescript'; +type ApiSearchLanguage = 'csharp' | 'typescript' | 'go'; type ApiSearchPageKind = 'landing' | 'package' | 'module' | 'type' | 'item'; /** diff --git a/src/frontend/src/components/brand/BrandAssetGallery.astro b/src/frontend/src/components/brand/BrandAssetGallery.astro new file mode 100644 index 0000000000..203163ae9c --- /dev/null +++ b/src/frontend/src/components/brand/BrandAssetGallery.astro @@ -0,0 +1,144 @@ +--- +import FluidGrid from '@components/FluidGrid.astro'; +import BrandWordmark from '@components/brand/BrandWordmark.astro'; +import BrandDownloadButton from '@components/brand/BrandDownloadButton.astro'; +import type { BrandAsset } from '@data/brand'; + +interface Props { + assets: readonly BrandAsset[]; +} + +const { assets } = Astro.props; +--- + +
asset.kind === 'logo') }, + ]} +> + + { + assets.map((asset) => ( +
  • + +
    +

    {asset.name}

    +

    {asset.description}

    + +
    +
  • + )) + } +
    +
    + + diff --git a/src/frontend/src/components/brand/BrandCodeTypography.astro b/src/frontend/src/components/brand/BrandCodeTypography.astro new file mode 100644 index 0000000000..d7099b20f5 --- /dev/null +++ b/src/frontend/src/components/brand/BrandCodeTypography.astro @@ -0,0 +1,26 @@ +--- +import { Code } from '@astrojs/starlight/components'; + +const sample = `const service = { name: "api", port: 8080 }; +const ready = service.port === 8080; +const endpoint = \`http://localhost:\${service.port}\`;`; +--- + +
    +

    Fira Code Variable

    + +
    + + diff --git a/src/frontend/src/components/brand/BrandCopyValue.astro b/src/frontend/src/components/brand/BrandCopyValue.astro new file mode 100644 index 0000000000..d6e267fc25 --- /dev/null +++ b/src/frontend/src/components/brand/BrandCopyValue.astro @@ -0,0 +1,224 @@ +--- +interface Props { + value: string; + label: string; +} + +const { value, label } = Astro.props; +--- + + + {value} + + + + + + + diff --git a/src/frontend/src/components/brand/BrandDownloadButton.astro b/src/frontend/src/components/brand/BrandDownloadButton.astro new file mode 100644 index 0000000000..e0e4eb35b7 --- /dev/null +++ b/src/frontend/src/components/brand/BrandDownloadButton.astro @@ -0,0 +1,83 @@ +--- +import { Icon } from '@astrojs/starlight/components'; +// thesvg-color:microsoft-powerpoint; the SVG includes its MIT notice. +import PowerPointIcon from '@assets/icons/microsoft-powerpoint.svg'; + +interface Props { + href: string; + name: string; + kind: 'svg' | 'deck'; + label?: string; +} + +const { href, name, kind, label } = Astro.props; +const buttonLabel = label ?? (kind === 'deck' ? 'Download PowerPoint' : 'Download SVG'); +--- + + + + diff --git a/src/frontend/src/components/brand/BrandDownloadGate.astro b/src/frontend/src/components/brand/BrandDownloadGate.astro new file mode 100644 index 0000000000..b25f9d779b --- /dev/null +++ b/src/frontend/src/components/brand/BrandDownloadGate.astro @@ -0,0 +1,258 @@ +--- +import BrandLicenseModal from '@components/brand/BrandLicenseModal.astro'; +import { brandLicenseUrl } from '@data/brand'; +--- + + + +
    +

    Review the brand guidelines

    +

    + Before downloading , review the{' '} + artwork license + {' '}and{' '} + usage guidelines. +

    +

    + The artwork is released under CC0 1.0. Microsoft retains trademark rights in the Aspire name + and logo. Use the assets without implying endorsement, sponsorship, or affiliation. +

    + +

    When local storage is available, this browser remembers your agreement for future brand downloads.

    +
    + + +
    +
    +
    + + +
    + + + + diff --git a/src/frontend/src/components/brand/BrandExternalLink.astro b/src/frontend/src/components/brand/BrandExternalLink.astro new file mode 100644 index 0000000000..133c5a48e6 --- /dev/null +++ b/src/frontend/src/components/brand/BrandExternalLink.astro @@ -0,0 +1,35 @@ +--- +import { Icon } from '@astrojs/starlight/components'; + +interface Props { + href: string; +} + +const { href } = Astro.props; +--- + + + + + (opens in a new tab) + + + diff --git a/src/frontend/src/components/brand/BrandIconDownloads.astro b/src/frontend/src/components/brand/BrandIconDownloads.astro new file mode 100644 index 0000000000..6519fbc5dc --- /dev/null +++ b/src/frontend/src/components/brand/BrandIconDownloads.astro @@ -0,0 +1,93 @@ +--- +import BrandDownloadButton from '@components/brand/BrandDownloadButton.astro'; +import { brandAssets } from '@data/brand'; + +const icons = brandAssets.filter((asset) => asset.kind === 'icon'); +const preview = icons.find((asset) => asset.width === 256); +if (!preview) throw new Error('The standalone Aspire icon preview is missing.'); +--- + +
    + +
    +

    Standalone Aspire icon

    +

    Both files are scalable SVGs. The sizes refer to their native artboards.

    +
    + { + icons.map((icon) => ( + + )) + } +
    +
    +
    + + diff --git a/src/frontend/src/components/brand/BrandLicenseModal.astro b/src/frontend/src/components/brand/BrandLicenseModal.astro new file mode 100644 index 0000000000..ede10977f7 --- /dev/null +++ b/src/frontend/src/components/brand/BrandLicenseModal.astro @@ -0,0 +1,216 @@ +--- +import { Icon } from '@astrojs/starlight/components'; +import { brandLicenseUrl } from '@data/brand'; +--- + + + +
    +

    Artwork license

    + +
    + + + +
    +
    + + + + diff --git a/src/frontend/src/components/brand/BrandNavigation.astro b/src/frontend/src/components/brand/BrandNavigation.astro new file mode 100644 index 0000000000..4b7365b89b --- /dev/null +++ b/src/frontend/src/components/brand/BrandNavigation.astro @@ -0,0 +1,55 @@ +--- +import { CardGrid } from '@astrojs/starlight/components'; +--- + + + + diff --git a/src/frontend/src/components/brand/BrandPalette.astro b/src/frontend/src/components/brand/BrandPalette.astro new file mode 100644 index 0000000000..6fee1b372e --- /dev/null +++ b/src/frontend/src/components/brand/BrandPalette.astro @@ -0,0 +1,136 @@ +--- +import FluidGrid from '@components/FluidGrid.astro'; +import BrandCopyValue from '@components/brand/BrandCopyValue.astro'; +import type { BrandColor } from '@data/brand'; + +interface Props { + colors: readonly BrandColor[]; + variant?: 'colors' | 'gradients' | 'accents'; +} + +const { colors, variant = 'colors' } = Astro.props; + +function copyValue(value: string): string { + return variant === 'gradients' ? value.replace('(', '(\n ').replace(/\)$/, '\n)') : value; +} +--- + +
    + + { + colors.map((color) => ( +
  • +
  • + )) + } +
    +
    + + diff --git a/src/frontend/src/components/brand/BrandTypography.astro b/src/frontend/src/components/brand/BrandTypography.astro new file mode 100644 index 0000000000..c8473a1924 --- /dev/null +++ b/src/frontend/src/components/brand/BrandTypography.astro @@ -0,0 +1,90 @@ +--- +import FluidGrid from '@components/FluidGrid.astro'; +import { brandFontWeights } from '@data/brand'; +--- + +
    + + { + brandFontWeights.map(({ name, weight }) => ( +
  • +

    + {name} {weight} +

    +

    + Aspire +

    +

    + ABCDEFGHIJKLMNOPQRSTUVWXYZ +
    + abcdefghijklmnopqrstuvwxyz +
    + 0123456789 +

    +
  • + )) + } +
    +
    + + diff --git a/src/frontend/src/components/brand/BrandUsageGuidance.astro b/src/frontend/src/components/brand/BrandUsageGuidance.astro new file mode 100644 index 0000000000..f00db0b4f4 --- /dev/null +++ b/src/frontend/src/components/brand/BrandUsageGuidance.astro @@ -0,0 +1,110 @@ +--- +import { Icon } from '@astrojs/starlight/components'; + +const dos = [ + 'Call the product Aspire in brand, editorial, and marketing copy.', + 'Use aspire.dev for official documentation and product explanations.', + 'Use the supplied SVG files without redrawing, outlining, or reshaping the mark, except as permitted for the provided developer-icon variants below.', + 'Leave space around the logo and use a high-contrast background.', + 'Write clear, helpful, direct, approachable copy.', + 'Use the core purple palette for primary elements and accents or gradients for highlights.', +]; +const donts = [ + 'Do not call the product ".NET Aspire" in consumer-facing brand or marketing content.', + 'Do not stretch, rotate, or crowd the logo with partner marks, badges, or dense UI. Recoloring is permitted only under the narrow developer-icon usage permission below.', + 'Do not use gradients or supporting accents as the main palette for an interface.', + 'Do not rely on internal shorthand when a simple reader-facing explanation would be clearer.', +]; +const panels = [ + { title: 'Do', id: 'do', items: dos, icon: 'approve-check' as const, tone: 'positive' }, + { title: 'Do not', id: 'do-not', items: donts, icon: 'close' as const, tone: 'negative' }, +]; +--- + +
    +
    + { + panels.map((panel) => ( +
    +

    {panel.title}

    +
      + {panel.items.map((item) => ( +
    • + + {item} +
    • + ))} +
    +
    + )) + } +
    +
    + + diff --git a/src/frontend/src/components/brand/BrandWordmark.astro b/src/frontend/src/components/brand/BrandWordmark.astro new file mode 100644 index 0000000000..539b0a4200 --- /dev/null +++ b/src/frontend/src/components/brand/BrandWordmark.astro @@ -0,0 +1,39 @@ +--- +import type { BrandAsset } from '@data/brand'; + +interface Props { + asset: BrandAsset; +} + +const { asset } = Astro.props; +--- + +
    + +
    + + diff --git a/src/frontend/src/components/home/HomePage.astro b/src/frontend/src/components/home/HomePage.astro index 1fce0da9f9..d8c53e4d4a 100644 --- a/src/frontend/src/components/home/HomePage.astro +++ b/src/frontend/src/components/home/HomePage.astro @@ -70,16 +70,52 @@ var postgres = builder.AddPostgres("postgres") var cache = builder.AddRedis("basketcache"); var catalog = builder - .AddProject("catalogservice") + .AddDotnetProject("catalogservice", "./catalog/CatalogService.csproj") .WithReference(postgres); -builder.AddProject("frontend") +builder.AddDotnetProject("frontend", "./frontend/Frontend.csproj") .WithReference(catalog) .WithReference(cache); builder.Build().Run(); `; +const modelAppHostGo = `package main + +import ( + "log" + + "apphost/modules/aspire" +) + +func main() { + builder, err := aspire.CreateBuilder() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + + postgres := builder.AddPostgres("postgres"). + AddDatabase("catalogdb") + cache := builder.AddRedis("basketcache") + + catalog := builder. + AddNodeApp("catalogservice", "./catalog", "src/index.ts"). + WithReference(postgres) + + frontend := builder.AddViteApp("frontend", "./frontend"). + WithReference(catalog). + WithReference(cache) + + app, err := builder.Build() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + if err := app.Run(); err != nil { + log.Fatal(aspire.FormatError(err)) + } +} +`; + const frontendResourceIcons = [reactIcon, typescriptIcon, javascriptIcon] as const; const apiResourceIcons = [csharpIcon, javaIcon, pythonIcon, goIcon] as const; const databaseResourceIcons = [postgresqlIcon, mongodbIcon, mysqlIcon, sqliteIcon] as const; @@ -252,6 +288,13 @@ const localizedPrinciples = principles.map((principle) => ({ width="18" height="18" /> + AppHost @@ -316,6 +359,10 @@ const localizedPrinciples = principles.map((principle) => ({
    + +
    + +
    ({ import { loadLazyImagesNearViewport } from '@utils/lazy-images'; import { createViewportActivationObserver } from '@utils/viewport-activation'; - type AppHostLanguage = 'csharp' | 'typescript'; + type AppHostLanguage = 'csharp' | 'typescript' | 'go'; type ModelStoryStage = 'code' | 'topology' | 'dashboard'; type TerminalStatus = 'checking' | 'building' | 'preparing' | 'connecting' | 'dashboard'; function isAppHostLanguage(value: unknown): value is AppHostLanguage { - return value === 'csharp' || value === 'typescript'; + return value === 'csharp' || value === 'typescript' || value === 'go'; } function randomizeLanguageOrder(page: HTMLElement) { @@ -848,8 +895,14 @@ const localizedPrinciples = principles.map((principle) => ({ toggle.setAttribute('aria-label', manuallyPaused ? playLabel : pauseLabel); }; - const getAppHostFileName = () => - storyLanguage === 'typescript' ? 'apphost.mts' : 'apphost.cs'; + const appHostFileNames: Record = { + csharp: 'apphost.cs', + typescript: 'apphost.mts', + go: 'apphost.go', + }; + const getAppHostFileName = () => appHostFileNames[storyLanguage]; + // C# AppHosts are built with the .NET SDK; TypeScript and Go AppHosts use a generated SDK. + const usesGeneratedSdk = () => storyLanguage !== 'csharp'; const getStatusText = (status: TerminalStatus) => { switch (status) { @@ -938,7 +991,7 @@ const localizedPrinciples = principles.map((principle) => ({ command.textContent = commandText; root.removeAttribute('data-terminal-typing'); if (stage === 'code') { - showStatus(storyLanguage === 'typescript' ? 'preparing' : 'checking'); + showStatus(usesGeneratedSdk() ? 'preparing' : 'checking'); } else if (stage === 'topology') { showStatus('connecting'); } else { @@ -961,10 +1014,7 @@ const localizedPrinciples = principles.map((principle) => ({ const setLanguage = (language: AppHostLanguage) => { storyLanguage = language; root.dataset.storyLanguage = language; - if ( - language === 'typescript' && - (activeStatus === 'checking' || activeStatus === 'building') - ) { + if (language !== 'csharp' && (activeStatus === 'checking' || activeStatus === 'building')) { activeStatus = 'preparing'; } else if (language === 'csharp' && activeStatus === 'preparing') { activeStatus = 'building'; @@ -1019,7 +1069,7 @@ const localizedPrinciples = principles.map((principle) => ({ }); scheduleAt( - () => showStatus(storyLanguage === 'typescript' ? 'preparing' : 'checking'), + () => showStatus(usesGeneratedSdk() ? 'preparing' : 'checking'), 1_250 ); scheduleAt(() => { @@ -1979,7 +2029,8 @@ const localizedPrinciples = principles.map((principle) => ({ } .model-proof[data-story-language='typescript'] :global(.model-tab-lang-typescript), - .model-proof[data-story-language='csharp'] :global(.model-tab-lang-csharp) { + .model-proof[data-story-language='csharp'] :global(.model-tab-lang-csharp), + .model-proof[data-story-language='go'] :global(.model-tab-lang-go) { display: block; } @@ -2100,7 +2151,9 @@ const localizedPrinciples = principles.map((principle) => ({ .model-proof[data-story-language='typescript'] .model-code-variant[data-model-code-language='typescript'], .model-proof[data-story-language='csharp'] - .model-code-variant[data-model-code-language='csharp'] { + .model-code-variant[data-model-code-language='csharp'], + .model-proof[data-story-language='go'] + .model-code-variant[data-model-code-language='go'] { display: block; } diff --git a/src/frontend/src/components/live-status.ts b/src/frontend/src/components/live-status.ts index 7bc3c5fb0a..01ab844a06 100644 --- a/src/frontend/src/components/live-status.ts +++ b/src/frontend/src/components/live-status.ts @@ -112,10 +112,9 @@ function syncDom(): void { btn.dataset.pipOpen = pipOpen ? 'true' : 'false'; btn.dataset.liveDismissed = notificationDismissed ? 'true' : 'false'; btn.dataset.source = sourceAttr; - btn.setAttribute( - 'aria-label', - current.isLive ? 'Aspire is live — watch now' : 'Watch Aspire live streams' - ); + const label = current.isLive ? 'Aspire is live — watch now' : 'Watch Aspire live streams'; + btn.setAttribute('aria-label', label); + btn.setAttribute('title', label); }); } diff --git a/src/frontend/src/components/pivot-selector.ts b/src/frontend/src/components/pivot-selector.ts index 4899d3b4ed..c389bb6e6a 100644 --- a/src/frontend/src/components/pivot-selector.ts +++ b/src/frontend/src/components/pivot-selector.ts @@ -2,6 +2,12 @@ import { getStoredPreference, setStoredPreference } from '@utils/browser-storage const headingSelector = 'main h1, main h2, main h3, main h4, main h5, main h6'; +const appHostLanguageLabels: Record = { + csharp: 'C#', + typescript: 'TypeScript', + go: 'Go', +}; + function findScrollAnchor() { let nearest: HTMLElement | undefined; let minDistance = Infinity; @@ -117,11 +123,8 @@ export class PivotSelector extends HTMLElement { const anchor = preserveScroll ? findScrollAnchor() : undefined; setStoredPreference(key, id); // Keep destination Starlight tabs on the same AppHost language. - if (key === 'aspire-lang' && (id === 'csharp' || id === 'typescript')) { - setStoredPreference( - 'starlight-synced-tabs__aspire-lang', - id === 'csharp' ? 'C#' : 'TypeScript' - ); + if (key === 'aspire-lang' && appHostLanguageLabels[id]) { + setStoredPreference('starlight-synced-tabs__aspire-lang', appHostLanguageLabels[id]); document.documentElement.dataset.apphostLang = id; } const url = new URL(window.location.href); diff --git a/src/frontend/src/components/starlight/Footer.astro b/src/frontend/src/components/starlight/Footer.astro index 49432c8b3b..64e546c548 100644 --- a/src/frontend/src/components/starlight/Footer.astro +++ b/src/frontend/src/components/starlight/Footer.astro @@ -362,6 +362,10 @@ const commit = (import.meta.env.PUBLIC_GIT_COMMIT_ID || import.meta.env.GIT_COMM padding-top: 1.5rem; } + .footer-main { + padding-block: 1.5rem; + } + .footer-directory { gap: 2rem; } @@ -394,6 +398,7 @@ const commit = (import.meta.env.PUBLIC_GIT_COMMIT_ID || import.meta.env.GIT_COMM const applyExternalLinkAttrs = () => { document.querySelectorAll('a[href]').forEach((a) => { + if (a.hasAttribute('data-brand-license')) return; try { const url = new URL(a.getAttribute('href'), window.location.origin); if (!/^https?:$/.test(url.protocol)) return; diff --git a/src/frontend/src/components/starlight/Head.astro b/src/frontend/src/components/starlight/Head.astro index 3e0e17c518..a56cafaece 100644 --- a/src/frontend/src/components/starlight/Head.astro +++ b/src/frontend/src/components/starlight/Head.astro @@ -103,6 +103,7 @@ function computeSourceUrl() { var appHostLangLabels = { csharp: 'C#', typescript: 'TypeScript', + go: 'Go', }; var appHostLangStorageKey = 'starlight-synced-tabs__aspire-lang'; @@ -111,6 +112,9 @@ function computeSourceUrl() { if (normalized.indexOf('typescript') !== -1) { return 'typescript'; } + if (normalized === 'go' || normalized === 'golang') { + return 'go'; + } if ( normalized.indexOf('c#') !== -1 || normalized.indexOf('csharp') !== -1 || diff --git a/src/frontend/src/components/starlight/Header.astro b/src/frontend/src/components/starlight/Header.astro index eb0e028e62..e31558e71b 100644 --- a/src/frontend/src/components/starlight/Header.astro +++ b/src/frontend/src/components/starlight/Header.astro @@ -44,6 +44,7 @@ const tryLabel = t('header.try' as any); data-tour-target="install-cli" data-tour-step="install-cli" aria-label="Open install Aspire CLI dialog" + title="Install Aspire CLI" > Install Aspire CLI @@ -55,6 +56,7 @@ const tryLabel = t('header.try' as any); data-source="none" data-tour-target="live-status" aria-label="Watch Aspire live streams" + title="Watch Aspire live streams" aria-current={Astro.url.pathname === '/community/videos/' ? 'page' : undefined} > Watch Aspire live streams @@ -71,6 +73,7 @@ const tryLabel = t('header.try' as any); data-tour-target="cookie-preferences" data-tour-step="cookie-preferences" aria-label="Open cookie preferences dialog" + title="Cookie preferences" > Cookie Preferences diff --git a/src/frontend/src/components/starlight/Search.astro b/src/frontend/src/components/starlight/Search.astro index 8a136b999d..ba132ee184 100644 --- a/src/frontend/src/components/starlight/Search.astro +++ b/src/frontend/src/components/starlight/Search.astro @@ -3,6 +3,7 @@ import DefaultSearch from "@astrojs/starlight/components/Search.astro"; import { Image } from 'astro:assets'; import csharpIcon from '@assets/icons/csharp.svg'; import typescriptIcon from '@assets/icons/typescript.svg'; +import goIcon from '@assets/icons/go.svg'; import '../../styles/search-controls.css'; const routeData = Astro.locals.starlightRoute; @@ -12,6 +13,7 @@ const hideSearch = isApiRefPage; const base = import.meta.env.BASE_URL.replace(/\/$/, ''); const csharpHref = `${base}/reference/api/csharp/`; const typescriptHref = `${base}/reference/api/typescript/`; +const goHref = `${base}/reference/api/go/`; --- { hideSearch ? <> : } @@ -40,6 +42,16 @@ const typescriptHref = `${base}/reference/api/typescript/`; TypeScript API Reference + + + Go API Reference +
    diff --git a/src/frontend/src/components/starlight/Sidebar.astro b/src/frontend/src/components/starlight/Sidebar.astro index b6f3eaeffe..6e3c74f42e 100644 --- a/src/frontend/src/components/starlight/Sidebar.astro +++ b/src/frontend/src/components/starlight/Sidebar.astro @@ -17,7 +17,9 @@ const apiLang = pageId.startsWith('reference/api/typescript') ? 'ts' : pageId.startsWith('reference/api/csharp') ? 'csharp' - : undefined; + : pageId.startsWith('reference/api/go') + ? 'go' + : undefined; const sidebar = routeData?.sidebar ?? []; const topics = topicState?.topics ?? []; diff --git a/src/frontend/src/content.config.ts b/src/frontend/src/content.config.ts index b978059d15..47cc487198 100644 --- a/src/frontend/src/content.config.ts +++ b/src/frontend/src/content.config.ts @@ -150,4 +150,30 @@ export const collections = { }) .passthrough(), }), + + /** + * Go API module schemas — drop `{Package}.{version}.json` files into + * `src/data/go-modules/` and the Go API reference pages are generated + * automatically. + */ + goModules: defineCollection({ + loader: glob({ pattern: '**/*.json', base: './src/data/go-modules' }), + schema: z + .object({ + package: z.object({ + name: z.string(), + version: z.string().optional(), + language: z.string().optional(), + importPath: z.string().optional(), + sourceRepository: z.string().optional(), + sourceCommit: z.string().optional(), + }), + functions: z.array(z.any()).default([]), + handleTypes: z.array(z.any()).default([]), + dtoTypes: z.array(z.any()).default([]), + enumTypes: z.array(z.any()).default([]), + exportedValues: z.array(z.any()).default([]), + }) + .passthrough(), + }), }; diff --git a/src/frontend/src/content/docs/app-host/configuration.mdx b/src/frontend/src/content/docs/app-host/configuration.mdx index c395a3e6f7..b70cb77388 100644 --- a/src/frontend/src/content/docs/app-host/configuration.mdx +++ b/src/frontend/src/content/docs/app-host/configuration.mdx @@ -22,6 +22,7 @@ AppHost configuration is provided through launch profiles: options={[ { id: 'csharp', title: 'C#' }, { id: 'typescript', title: 'TypeScript' }, + { id: 'go', title: 'Go' }, ]} /> @@ -101,7 +102,27 @@ In TypeScript AppHosts, profiles live in `aspire.config.json`: } ``` + +In Go AppHosts, profiles live in `aspire.config.json`: +```json title="aspire.config.json" +{ + "appHost": { + "path": "apphost.go", + "language": "go" + }, + "profiles": { + "https": { + "applicationUrl": "https://localhost:17134;http://localhost:15170", + "environmentVariables": { + "ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL": "https://localhost:21030", + "ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:22057" + } + } + } +} +``` + -Aspire builds that include the experimental `WithTerminal` API support interactive terminal user interfaces (TUIs) and shell-based experiences that need a live, bidirectional session, separately from the dashboard's console log viewer. - -:::caution[Experimental API] -`WithTerminal` is reported under diagnostic ID `ASPIRETERMINAL001`. Using it in C# requires suppressing that diagnostic, and its API surface and behavior may change. This API might not be present in your installed release; use compatible hosting packages and a CLI build that includes it. -::: +Use the `WithTerminal` API for interactive terminal user interfaces (TUIs) and shell-based experiences that need a live, bidirectional session, separately from the dashboard's console log viewer. For more information, see [Attach a terminal to a resource](/app-host/with-terminal/). ## Viewing console output diff --git a/src/frontend/src/content/docs/app-host/container-files.mdx b/src/frontend/src/content/docs/app-host/container-files.mdx index 080ecfb63d..404dbd1f47 100644 --- a/src/frontend/src/content/docs/app-host/container-files.mdx +++ b/src/frontend/src/content/docs/app-host/container-files.mdx @@ -99,7 +99,7 @@ const builder = await createBuilder(); const frontend = await builder.addViteApp("frontend", "../frontend"); await frontend.withContainerFilesSource("/app/dist"); -const api = await builder.addProject("api", "../Api/Api.csproj"); +const api = await builder.addDotnetProject("api", "../Api/Api.csproj"); await api.publishWithContainerFiles(frontend, "./wwwroot"); await builder.build().run(); @@ -351,7 +351,7 @@ var builder = DistributedApplication.CreateBuilder(args); var frontend = builder.AddViteApp("frontend", "../frontend"); -var api = builder.AddProject("api") +var api = builder.AddDotnetProject("api", "../Api/Api.csproj") .PublishWithContainerFiles(frontend, "./wwwroot"); builder.Build().Run(); @@ -365,7 +365,7 @@ const builder = await createBuilder(); const frontend = await builder.addViteApp("frontend", "../frontend"); -const api = await builder.addProject("api", "./Api/Api.csproj") +const api = await builder.addDotnetProject("api", "../Api/Api.csproj") .publishWithContainerFiles(frontend, "./wwwroot"); await builder.build().run(); @@ -414,7 +414,7 @@ await builder.build().run(); This produces a self-contained Nginx container that serves the frontend application, with no external volume mounts or runtime file copying needed. -`PublishWithContainerFiles` only applies in publish mode — it has no effect during `aspire run`. The destination resource must implement `IContainerFilesDestinationResource` (such as `ProjectResource`), and the source resource must implement `IResourceWithContainerFiles`. +`PublishWithContainerFiles` only applies in publish mode — it has no effect during `aspire run`. The destination resource must implement `IContainerFilesDestinationResource` (such as a .NET project added with `AddDotnetProject`), and the source resource must implement `IResourceWithContainerFiles`. ### Customize the source path @@ -426,7 +426,7 @@ By default, the source resource exports files from its container based on its co var frontend = builder.AddViteApp("frontend", "../frontend") .WithContainerFilesSource("/app/dist"); -var api = builder.AddProject("api") +var api = builder.AddDotnetProject("api", "../Api/Api.csproj") .PublishWithContainerFiles(frontend, "./wwwroot"); ``` diff --git a/src/frontend/src/content/docs/app-host/container-registry.mdx b/src/frontend/src/content/docs/app-host/container-registry.mdx index 28809f66e4..bcca6e0331 100644 --- a/src/frontend/src/content/docs/app-host/container-registry.mdx +++ b/src/frontend/src/content/docs/app-host/container-registry.mdx @@ -40,7 +40,7 @@ var builder = DistributedApplication.CreateBuilder(args); var registry = builder.AddContainerRegistry("myregistry", "registry.example.com"); // Associate the registry with a project -var api = builder.AddProject("api") +var api = builder.AddDotnetProject("api", "../Api/Api.csproj") .WithContainerRegistry(registry); builder.Build().Run(); @@ -56,7 +56,7 @@ const builder = await createBuilder(); const registry = await builder.addContainerRegistry("myregistry", "registry.example.com"); // Associate the registry with a project -const api = await builder.addProject("api", "../Api/Api.csproj"); +const api = await builder.addDotnetProject("api", "../Api/Api.csproj"); await api.withContainerRegistry(registry); await builder.build().run(); @@ -81,7 +81,7 @@ var builder = DistributedApplication.CreateBuilder(args); var registry = builder.AddContainerRegistry("dockerhub", "docker.io"); -var api = builder.AddProject("api") +var api = builder.AddDotnetProject("api", "../Api/Api.csproj") .WithContainerRegistry(registry); ``` @@ -93,7 +93,7 @@ const builder = await createBuilder(); const registry = await builder.addContainerRegistry("dockerhub", "docker.io"); -const api = await builder.addProject("api", "../Api/Api.csproj"); +const api = await builder.addDotnetProject("api", "../Api/Api.csproj"); await api.withContainerRegistry(registry); ``` @@ -110,7 +110,7 @@ var builder = DistributedApplication.CreateBuilder(args); var registry = builder.AddContainerRegistry("ghcr", "ghcr.io"); -var api = builder.AddProject("api") +var api = builder.AddDotnetProject("api", "../Api/Api.csproj") .WithContainerRegistry(registry); ``` @@ -122,7 +122,7 @@ const builder = await createBuilder(); const registry = await builder.addContainerRegistry("ghcr", "ghcr.io"); -const api = await builder.addProject("api", "../Api/Api.csproj"); +const api = await builder.addDotnetProject("api", "../Api/Api.csproj"); await api.withContainerRegistry(registry); ``` @@ -141,7 +141,7 @@ var registry = builder.AddContainerRegistry( "private-registry", "registry.mycompany.com:5000"); -var api = builder.AddProject("api") +var api = builder.AddDotnetProject("api", "../Api/Api.csproj") .WithContainerRegistry(registry); ``` @@ -155,7 +155,7 @@ const registry = await builder.addContainerRegistry( "private-registry", "registry.mycompany.com:5000"); -const api = await builder.addProject("api", "../Api/Api.csproj"); +const api = await builder.addDotnetProject("api", "../Api/Api.csproj"); await api.withContainerRegistry(registry); ``` @@ -182,7 +182,7 @@ var registry = builder.AddContainerRegistry( registryEndpoint, registryRepository); -var api = builder.AddProject("api") +var api = builder.AddDotnetProject("api", "../Api/Api.csproj") .WithContainerRegistry(registry); ``` @@ -200,7 +200,7 @@ const registry = await builder.addContainerRegistry( registryEndpoint, registryRepository); -const api = await builder.addProject("api", "../Api/Api.csproj"); +const api = await builder.addDotnetProject("api", "../Api/Api.csproj"); await api.withContainerRegistry(registry); ``` @@ -265,7 +265,7 @@ var builder = DistributedApplication.CreateBuilder(args); var environment = builder.AddAzureContainerAppEnvironment("myenv"); -var api = builder.AddProject("api") +var api = builder.AddDotnetProject("api", "../Api/Api.csproj") .WithContainerRegistry(environment); builder.Build().Run(); @@ -279,7 +279,7 @@ const builder = await createBuilder(); const environment = await builder.addAzureContainerAppEnvironment("myenv"); -const api = await builder.addProject("api", "../Api/Api.csproj"); +const api = await builder.addDotnetProject("api", "../Api/Api.csproj"); await api.withContainerRegistry(environment); await builder.build().run(); @@ -320,7 +320,7 @@ var acr = builder.AddAzureContainerRegistry("my-acr") builder.AddAzureContainerAppEnvironment("env") .WithAzureContainerRegistry(acr); -var api = builder.AddProject("api") +var api = builder.AddDotnetProject("api", "../Api/Api.csproj") .WithContainerRegistry(acr); ``` @@ -339,7 +339,7 @@ await acr.publishAsExisting(registryName, rgName); const environment = await builder.addAzureContainerAppEnvironment("env"); await environment.withAzureContainerRegistry(acr); -const api = await builder.addProject("api", "../Api/Api.csproj"); +const api = await builder.addDotnetProject("api", "../Api/Api.csproj"); await api.withContainerRegistry(acr); ``` @@ -420,10 +420,10 @@ var privateRegistry = builder.AddContainerRegistry( "private", "registry.company.com"); -var publicApi = builder.AddProject("public-api") +var publicApi = builder.AddDotnetProject("public-api", "../PublicApi/PublicApi.csproj") .WithContainerRegistry(publicRegistry); -var internalApi = builder.AddProject("internal-api") +var internalApi = builder.AddDotnetProject("internal-api", "../InternalApi/InternalApi.csproj") .WithContainerRegistry(privateRegistry); ``` @@ -438,10 +438,10 @@ const privateRegistry = await builder.addContainerRegistry( "private", "registry.company.com"); -const publicApi = await builder.addProject("public-api", "../PublicApi/PublicApi.csproj"); +const publicApi = await builder.addDotnetProject("public-api", "../PublicApi/PublicApi.csproj"); await publicApi.withContainerRegistry(publicRegistry); -const internalApi = await builder.addProject("internal-api", "../InternalApi/InternalApi.csproj"); +const internalApi = await builder.addDotnetProject("internal-api", "../InternalApi/InternalApi.csproj"); await internalApi.withContainerRegistry(privateRegistry); ``` @@ -464,10 +464,10 @@ var registry = builder.AddContainerRegistry( registryEndpoint, registryRepository); -var api = builder.AddProject("api") +var api = builder.AddDotnetProject("api", "../Api/Api.csproj") .WithContainerRegistry(registry); -var worker = builder.AddProject("worker") +var worker = builder.AddDotnetProject("worker", "../Worker/Worker.csproj") .WithContainerRegistry(registry); builder.Build().Run(); @@ -487,10 +487,10 @@ const registry = await builder.addContainerRegistry( registryEndpoint, registryRepository); -const api = await builder.addProject("api", "../Api/Api.csproj"); +const api = await builder.addDotnetProject("api", "../Api/Api.csproj"); await api.withContainerRegistry(registry); -const worker = await builder.addProject("worker", "../Worker/Worker.csproj"); +const worker = await builder.addDotnetProject("worker", "../Worker/Worker.csproj"); await worker.withContainerRegistry(registry); await builder.build().run(); @@ -532,12 +532,12 @@ var acaEnv = builder.AddAzureContainerAppEnvironment("production"); var cache = builder.AddRedis("cache"); // Add API with registry configuration -var api = builder.AddProject("api") +var api = builder.AddDotnetProject("api", "../Api/Api.csproj") .WithReference(cache) .WithContainerRegistry(acaEnv); // Add frontend with registry configuration -var web = builder.AddProject("web") +var web = builder.AddDotnetProject("web", "../Web/Web.csproj") .WithReference(api) .WithContainerRegistry(acaEnv); @@ -557,12 +557,12 @@ const environment = await builder.addAzureContainerAppEnvironment("production"); const cache = await builder.addRedis("cache"); // Add API with registry configuration -const api = await builder.addProject("api", "../Api/Api.csproj"); +const api = await builder.addDotnetProject("api", "../Api/Api.csproj"); await api.withReference(cache); await api.withContainerRegistry(environment); // Add frontend with registry configuration -const web = await builder.addProject("web", "../Web/Web.csproj"); +const web = await builder.addDotnetProject("web", "../Web/Web.csproj"); await web.withReference(api); await web.withContainerRegistry(environment); diff --git a/src/frontend/src/content/docs/app-host/cors-configuration.mdx b/src/frontend/src/content/docs/app-host/cors-configuration.mdx index 6309eed803..4707519fe9 100644 --- a/src/frontend/src/content/docs/app-host/cors-configuration.mdx +++ b/src/frontend/src/content/docs/app-host/cors-configuration.mdx @@ -239,7 +239,7 @@ These examples assume a JavaScript frontend in `../frontend` with a `dev` script -This example assumes an existing `Api` project. A C# AppHost also needs a project reference to `Api`. Add the frontend and the API to your AppHost: +This example assumes an existing `Api` project. Add the frontend and the API to your AppHost: @@ -250,7 +250,7 @@ var builder = DistributedApplication.CreateBuilder(args); var frontend = builder.AddJavaScriptApp("frontend", "../frontend", "dev") .WithHttpEndpoint(port: 3000, env: "PORT"); -var api = builder.AddProject("api") +var api = builder.AddDotnetProject("api", "../Api/Api.csproj") .WithReference(frontend) // Injects services__frontend__http__0 into the API .WithExternalHttpEndpoints(); @@ -270,7 +270,7 @@ const frontend = await builder.addJavaScriptApp('frontend', '../frontend', { }); await frontend.withHttpEndpoint({ port: 3000, env: 'PORT' }); -const api = await builder.addProject('api', '../Api/Api.csproj'); +const api = await builder.addDotnetProject('api', '../Api/Api.csproj'); await api.withReference(frontend); // Injects services__frontend__http__0 into the API await api.withExternalHttpEndpoints(); diff --git a/src/frontend/src/content/docs/app-host/docker-compose-to-apphost-reference.mdx b/src/frontend/src/content/docs/app-host/docker-compose-to-apphost-reference.mdx index fa440161dc..cc84511171 100644 --- a/src/frontend/src/content/docs/app-host/docker-compose-to-apphost-reference.mdx +++ b/src/frontend/src/content/docs/app-host/docker-compose-to-apphost-reference.mdx @@ -49,7 +49,7 @@ Learn more about [Docker Compose pull_policy](https://docs.docker.com/reference/ | Docker Compose | Aspire | Notes | |----------------|-------------|-------| -| `build: ./MyApi` (for .NET) | `builder.AddProject("myapi")` | Direct .NET project reference | +| `build: ./MyApi` (for .NET) | `builder.AddDotnetProject("myapi", "../MyApi/MyApi.csproj")` | Direct .NET project reference | Learn more about [adding .NET projects](/get-started/app-host/). diff --git a/src/frontend/src/content/docs/app-host/eventing.mdx b/src/frontend/src/content/docs/app-host/eventing.mdx index f45685daa8..cbdc4c6a3b 100644 --- a/src/frontend/src/content/docs/app-host/eventing.mdx +++ b/src/frontend/src/content/docs/app-host/eventing.mdx @@ -220,9 +220,9 @@ cache.OnConnectionStringAvailable( return Task.CompletedTask; }); -var apiService = builder.AddProject("apiservice"); +var apiService = builder.AddDotnetProject("apiservice", "../AspireApp.ApiService/AspireApp.ApiService.csproj"); -builder.AddProject("webfrontend") +builder.AddDotnetProject("webfrontend", "../AspireApp.Web/AspireApp.Web.csproj") .WithExternalHttpEndpoints() .WithReference(cache) .WaitFor(cache) diff --git a/src/frontend/src/content/docs/app-host/executable-resources.mdx b/src/frontend/src/content/docs/app-host/executable-resources.mdx index 118f282e60..649d84f9c7 100644 --- a/src/frontend/src/content/docs/app-host/executable-resources.mdx +++ b/src/frontend/src/content/docs/app-host/executable-resources.mdx @@ -175,7 +175,7 @@ Here's a complete example using the [Vercel CLI](https://vercel.com/docs/cli) to var builder = DistributedApplication.CreateBuilder(args); // Backend API -var api = builder.AddProject("api") +var api = builder.AddDotnetProject("api", "../Api/Api.csproj") .WithExternalHttpEndpoints(); // Frontend with Vercel CLI @@ -194,7 +194,7 @@ import { createBuilder } from './.aspire/modules/aspire.mjs'; const builder = await createBuilder(); // Backend API -const api = await builder.addProject("api", "./Api/Api.csproj") +const api = await builder.addDotnetProject("api", "./Api/Api.csproj") .withExternalHttpEndpoints(); // Frontend with Vercel CLI @@ -281,6 +281,88 @@ Aspire 13.3 unified non-C# AppHost environment assignment behind a single `withE When upgrading to Aspire 13.3, replace every earlier per-kind environment helper call with `withEnvironment(name, value)`. The 13.3 TypeScript SDK doesn't generate compatibility aliases for those helpers. +## Declare required commands + +Executables depend on tools that must be installed on the developer's machine. Use to declare a command that a resource needs, and optionally a link to installation instructions. You can call it on any resource, not only executables, and call it more than once to declare several commands: + + + +```csharp title="AppHost.cs" +var builder = DistributedApplication.CreateBuilder(args); + +var frontend = builder.AddExecutable("frontend", "vercel", ".", "dev") + .WithRequiredCommand("vercel", helpLink: "https://vercel.com/docs/cli"); + +builder.Build().Run(); +``` + + +```typescript title="apphost.mts" twoslash +import { createBuilder } from './.aspire/modules/aspire.mjs'; + +const builder = await createBuilder(); + +const frontend = await builder.addExecutable("frontend", "vercel", ".", ["dev"]) + .withRequiredCommand("vercel", { helpLink: "https://vercel.com/docs/cli" }); + +await builder.build().run(); +``` + + + +Before the resource starts, Aspire checks that the command exists. A command that contains a directory separator is treated as a path to a file; otherwise Aspire searches the `PATH` (on Windows, `PATHEXT` extensions are also tried). If the command isn't found, Aspire: + +- Logs a warning that the resource may fail to start. +- Shows a **Missing command** notification in the dashboard, with an **Installation instructions** link when you provide `helpLink`. +- Still lets the resource attempt to start. The check never blocks startup. + +When several resources require the same command with the same validation, Aspire checks it and shows the notification only once per AppHost run. + +### Validate the resolved command + +To check more than whether the command exists, such as its version or install location, pass a validation callback. The callback runs only after the command is found and receives a `RequiredCommandValidationContext` with the resolved `ResolvedPath`, a `Services` provider, and a `CancellationToken`. Return `context.Success()` or `context.Failure(message)`. In TypeScript, use `withRequiredCommandValidation`: + + + +```csharp title="AppHost.cs" +var builder = DistributedApplication.CreateBuilder(args); + +var worker = builder.AddExecutable("worker", "python", ".", "worker.py") + .WithRequiredCommand( + "python", + context => Task.FromResult( + context.ResolvedPath.Contains(".venv") + ? context.Success() + : context.Failure($"Activate the project's virtual environment. Found: {context.ResolvedPath}")), + helpLink: "https://docs.python.org/3/library/venv.html"); + +builder.Build().Run(); +``` + + +```typescript title="apphost.mts" twoslash +import { createBuilder } from './.aspire/modules/aspire.mjs'; + +const builder = await createBuilder(); + +const worker = await builder.addExecutable("worker", "python", ".", ["worker.py"]) + .withRequiredCommandValidation( + "python", + async (context) => { + const resolvedPath = await context.resolvedPath(); + return resolvedPath.includes(".venv") + ? context.success() + : context.failure(`Activate the project's virtual environment. Found: ${resolvedPath}`); + }, + { helpLink: "https://docs.python.org/3/library/venv.html" }); + +await builder.build().run(); +``` + + + +A failed validation is reported the same way as a missing command: the warning and notification include your failure message, and the resource still attempts to start. + ## Publishing with PublishAsDockerFile For production deployment, executable resources need to be containerized. Use the method to specify how the executable should be packaged: diff --git a/src/frontend/src/content/docs/app-host/go-apphost-conventions.mdx b/src/frontend/src/content/docs/app-host/go-apphost-conventions.mdx new file mode 100644 index 0000000000..8c2662fca1 --- /dev/null +++ b/src/frontend/src/content/docs/app-host/go-apphost-conventions.mdx @@ -0,0 +1,114 @@ +--- +title: Go AppHost API conventions +seoTitle: Go AppHost API conventions for the Aspire SDK +description: Learn how the generated Aspire Go SDK names methods, passes typed options, reports errors through handles, and cancels a running AppHost. +--- + +The Aspire CLI generates the Go SDK from the integrations in your `aspire.config.json` file, and every integration follows the same conventions. The examples on this page use a `builder` from `aspire.CreateBuilder()`, as in [Get started with the Go AppHost](/app-host/go-apphost/). + +## Names and handles + +Every integration adds its methods to the `aspire` package, and method names are PascalCase. The TypeScript method `addRedis` is `AddRedis` in Go. + +Numeric parameters and fields use the Go type that matches the .NET type, such as `int` for a port and `int64` for a file size. Methods and properties that are marked obsolete in .NET aren't generated. + +Methods that add a resource, such as `AddRedis` and `AddGoApp`, return a _handle_. A handle is a Go interface that stands for the resource in the app model, for example `aspire.RedisResource`. Methods that configure a resource return the same handle type, so calls chain. Errors are reported when you call `Build`, as described in [Errors](#errors). + +### Pass derived resource handles + +Go interfaces don't support covariant return types, so the handle for a derived resource type doesn't satisfy the handle interface of its base type. When other resource types derive from a type, the SDK also generates an `Any` interface that accepts a handle of that type or of any type derived from it. Parameters that take such a resource use this interface. For example, `WithNodePool` takes an `aspire.AnyKubernetesNodePoolResource`, so it accepts the `aspire.AksNodePoolResource` handle that `AddNodePool` returns: + +```go title="apphost.go" +aks := builder.AddAzureKubernetesEnvironment("aks") +pool := aks.AddNodePool("workload", func(config *aspire.AksNodePoolConfig) { + config.MaxCount = 5 +}) + +builder.AddContainer("api", "nginx").WithNodePool(pool) +``` + +The compiler rejects a handle of an unrelated resource type. Methods still return the receiver's own handle type, so chained calls keep their type. + +## Optional parameters + +Optional parameters go in a trailing variadic options argument. Leave it out to use the defaults, or pass typed option values for the settings you want to change. You don't need an options struct or pointer helpers: + +```go title="apphost.go" +builder.AddGoApp("api", "./api"). + WithHttpEndpoint(aspire.HttpEndpointPort(8080), aspire.HttpEndpointEnv("PORT")) +``` + +Option names combine the method name without a leading `With` and the parameter name, such as `HttpEndpointPort`, `HttpEndpointEnv`, and `AddGoAppPackagePath`. Collection and callback options use the same pattern: + +```go title="apphost.go" +builder.AddGoApp("api", "./api", + aspire.AddGoAppPackagePath("./cmd/server"), + aspire.AddGoAppBuildTags([]string{"netgo", "integration"}), + aspire.AddGoAppRaceDetector(true), +) +``` + +Options are applied from left to right. Omitting an option preserves the default; passing `false`, `0`, or `""` explicitly sets that value. If you repeat an option, the last value wins. + +The generated SDK still accepts pointer-based options structs for compatibility. DTO inputs that aren't variadic options, such as `AddContainerOptions`, retain their declared field types. Check the generated SDK for the exact types and option names available for your installed integrations. + +The [`WithHttpEndpoint` API reference](/reference/api/go/aspire.hosting/withhttpendpoint/) describes the available endpoint settings. + +## Errors + +The SDK reports errors in two ways. + +Methods that add or configure a resource return a handle instead of an error, so you can add many resources without checking each call. A failed resource doesn't stop you from adding other resources. The SDK collects the error from every failed handle and `Build` returns them together, joined with `errors.Join`: + +```go title="apphost.go" +cache := builder.AddRedis("cache") +builder.AddGoApp("api", "./api").WithReference(cache) + +app, err := builder.Build() +if err != nil { + log.Fatal(aspire.FormatError(err)) +} +``` + +Each failure is reported once, even when it passes through a chain of calls. To check for errors before you call `Build`, call `builder.Err()`, which returns the same combined error. To check a single resource, call the `Err()` method on its handle, which returns the first error recorded for that resource. + +Methods that return a value return a `(T, error)` pair, and `Build` and `Run` return an `error`: + +```go title="apphost.go" +dir, err := builder.AppHostDirectory() +if err != nil { + log.Fatal(aspire.FormatError(err)) +} + +log.Println("AppHost directory:", dir) +``` + +`aspire.FormatError` turns an error into a message that is ready to log. When the AppHost server returns an error for a call, the error is an `*aspire.CapabilityError`, and `FormatError` adds its error code and the capability that failed. Use `errors.As` and the `Code`, `Message`, and `Capability` methods to read these values yourself. When the error combines several errors, such as the error that `Build` returns, `FormatError` formats each one on its own line. For any other error, `FormatError` returns `err.Error()`. + +If a callback that you pass to an SDK method panics, the AppHost process keeps running. The SDK recovers the panic and fails only the call that invoked the callback. + +## Cancellation + +A method that accepts a cancellation token exposes a typed option for it, such as `aspire.RunCancellationToken`. Create a token with `aspire.NewCancellationToken`, pass it in the options, and call its `Cancel` method to cancel the call: + +```go title="apphost.go" +app, err := builder.Build() +if err != nil { + log.Fatal(aspire.FormatError(err)) +} + +// Cancel the Run call if the AppHost is still running after an hour. +token := aspire.NewCancellationToken() +time.AfterFunc(time.Hour, token.Cancel) + +if err := app.Run(aspire.RunCancellationToken(token)); err != nil { + log.Fatal(aspire.FormatError(err)) +} +``` + +You can't create a token from a `context.Context`. To cancel a token when an existing context ends, call `context.AfterFunc(ctx, token.Cancel)`. The token's `Context` method returns a `context.Context` that ends when the token is canceled, so you can use the same token with other Go APIs. + +## See also + +- [Get started with the Go AppHost](/app-host/go-apphost/) +- [Go API reference](/reference/api/go/) diff --git a/src/frontend/src/content/docs/app-host/go-apphost.mdx b/src/frontend/src/content/docs/app-host/go-apphost.mdx new file mode 100644 index 0000000000..ec90f1be77 --- /dev/null +++ b/src/frontend/src/content/docs/app-host/go-apphost.mdx @@ -0,0 +1,378 @@ +--- +title: Get started with the Go AppHost +seoTitle: Get started with the Aspire Go AppHost and generated SDK +description: Create an Aspire Go AppHost with the Aspire CLI, learn the project layout and generated SDK, add integrations, and orchestrate apps in other languages. +--- + +import FileTree from 'starlight-plugin-icons/components/FileTree.astro'; +import LearnMore from '@components/LearnMore.astro'; + +A Go AppHost is a Go program that defines the resources in your application and how they connect. It uses the same app model as a C# AppHost, through a Go SDK that the Aspire CLI generates from the hosting integrations you install. + +## Prerequisites + +- [Go](https://go.dev/dl/) 1.26 or later, with `go` on your `PATH` +- The [Aspire CLI](/get-started/install-cli/) +- [Node.js](https://nodejs.org/) for the starter template's React frontend +- A container runtime if you include the optional Redis cache in the starter template. See [Aspire prerequisites](/get-started/prerequisites/) for the supported options. + +## Create a Go AppHost + +Create a new app from the Go starter template: + +```bash title="Aspire CLI" +aspire new aspire-go-starter -n aspire-app -o aspire-app +``` + +The template creates a Go AppHost (`apphost.go`), a Go API (`api/`), a Vite and React frontend (`frontend/`), and the generated SDK. The frontend waits for the API and proxies `/api` requests to it, and it loads `/api/weatherforecast` on startup. When you publish, the frontend build output is copied into the Go API container and served from `./static`, so the deployed app uses one origin. Redis is optional: `aspire new` prompts for it interactively (default yes), and non-interactive runs omit it unless you pass `--use-redis-cache true`. To choose from the templates that support Go, run `aspire new --language go` instead. + + + See the [`aspire new` command reference](/reference/cli/commands/aspire-new/) for all options. + + +The project has the following structure: + + + +- aspire-app/ + - .aspire/modules/ Generated Go SDK (do not edit) + - aspire.go + - base.go + - go.mod + - transport.go + - .vscode/ + - extensions.json Recommended VS Code extensions + - api/ Go API that the AppHost runs + - go.mod + - main.go + - telemetry.go + - frontend/ Vite and React frontend + - public/ + - src/ + - index.html + - package.json + - package-lock.json + - vite.config.ts + - ... + - .gitignore Keeps the generated .aspire/ directory out of source control + - apphost.go Your AppHost entry point + - aspire.config.json Aspire configuration + - go.mod Go module for the AppHost + + + +## Run the AppHost + +From the project directory, start the AppHost with the Aspire CLI: + +```bash title="Aspire CLI" +aspire run +``` + +The CLI regenerates the SDK when the `packages` list has changed, starts the AppHost with `go run .`, and prints the dashboard URL. Open the dashboard to see the `app` Go API and `frontend` resources with their logs, traces, and metrics. If you included Redis, the dashboard also shows the `cache` resource. Open the `frontend` endpoint to use the React app. + +:::note +Always start the AppHost with `aspire run`. The CLI sets the environment variables that the SDK uses to connect to the AppHost server, so running `go run .` on its own fails with `REMOTE_APP_HOST_SOCKET_PATH environment variable not set`. +::: + +## apphost.go + +The AppHost is a `package main` Go program. The following example shows the starter with Redis enabled. It defines a Go API, a Vite frontend that references and waits for the API, and a Redis cache: + +```go title="apphost.go" +package main + +import ( + "log" + + "apphost/modules/aspire" +) + +func main() { + builder, err := aspire.CreateBuilder() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + + // A Redis cache the API will use for read-through caching. + cache := builder.AddRedis("cache") + + // Keep Go modules current and send traces, metrics, and logs to the dashboard. + api := builder.AddGoApp("app", "./api"). + WithModTidy(). + WithReference(cache). + WaitFor(cache). + WithHttpEndpoint(aspire.HttpEndpointEnv("PORT")). + WithHttpHealthCheck(aspire.HttpHealthCheckPath("/health")). + WithExternalHttpEndpoints(). + WithOtlpExporter() + + // Reference the app for Vite proxying and wait until it is healthy. + frontend := builder.AddViteApp("frontend", "./frontend"). + WithReference(api). + WaitFor(api) + + // Bundle the frontend into the app container for same-origin production serving. + api.PublishWithContainerFiles(frontend, "./static") + + application, err := builder.Build() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + if err := application.Run(); err != nil { + log.Fatal(aspire.FormatError(err)) + } +} +``` + +`PublishWithContainerFiles` copies the frontend build output into the Go API container at `./static` when you publish. The API serves those files from the same origin as its API endpoints. + +If you omit Redis, the generated AppHost has no `AddRedis` call, `WithReference(cache)`, or `WaitFor(cache)`. The frontend and publish configuration stay the same. + +The program has three parts: + +1. `aspire.CreateBuilder()` connects to the AppHost server that the CLI starts and returns the builder. +2. `AddGoApp`, `AddViteApp`, and the optional `AddRedis` add resources. Each call returns a handle, so `WithReference`, `WaitFor`, and the other configuration methods chain onto it. +3. `builder.Build()` creates the application, and `application.Run()` blocks until the AppHost stops. Both return an error. You don't check each resource: errors from the `Add` and `With` calls are collected and reported together when you call `Build`. See [Go AppHost API conventions](/app-host/go-apphost-conventions/#errors) for how errors are reported and formatted. + +See [Deploy Go apps](/deployment/go-apps/) for publishing and deployment options. + +## aspire.config.json + +The `aspire.config.json` file is the central configuration for your AppHost. This example includes the optional Redis integration: + +```json title="aspire.config.json" +{ + "appHost": { + "path": "apphost.go", + "language": "go" + }, + "packages": { + "Aspire.Hosting.Go": "%ASPIRE_VERSION%", + "Aspire.Hosting.JavaScript": "%ASPIRE_VERSION%", + "Aspire.Hosting.Redis": "%ASPIRE_VERSION%" + }, + "profiles": { + "https": { + "applicationUrl": "https://localhost:17127;http://localhost:15118", + "environmentVariables": { + "ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL": "https://localhost:21169", + "ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:22260" + } + }, + "http": { + "applicationUrl": "http://localhost:15118", + "environmentVariables": { + "ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:19001", + "ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL": "http://localhost:20115", + "ASPIRE_ALLOW_UNSECURED_TRANSPORT": "true" + } + } + } +} +``` + +If you omit Redis, the `packages` section contains only `Aspire.Hosting.Go` and `Aspire.Hosting.JavaScript`. + +### Key sections + +| Section | Description | +|---------|-------------| +| `appHost.path` | Path to the AppHost entry point (`apphost.go`) | +| `appHost.language` | The AppHost language (`go`) | +| `packages` | Hosting integration packages and their versions. `aspire add` updates this section. | +| `profiles` | Launch profiles with dashboard URLs and environment variables | + +## Generated SDK + +The `.aspire/modules/` directory holds the Go SDK that the CLI generates from the packages in `aspire.config.json`. The CLI creates and updates it, so don't edit these files. + +| File | Purpose | +|------|---------| +| `aspire.go` | Typed API for the installed integrations | +| `base.go` | Handle, option, and error infrastructure | +| `transport.go` | JSON-RPC transport to the AppHost server | + +The SDK is one Go package for all integrations. The AppHost's `go.mod` file maps the `apphost/modules/aspire` import path to the `.aspire/modules/` directory, so `apphost.go` imports it like any other package: + +```text title="go.mod" +module apphost + +go 1.26 + +require apphost/modules/aspire v0.0.0 + +replace apphost/modules/aspire => ./.aspire/modules +``` + +The SDK regenerates when: + +- You run `aspire add` to add or update an integration +- You run `aspire run` or `aspire start` and the package list has changed +- You run `aspire restore` + +:::tip +The starter's `.gitignore` already lists `.aspire/`. The directory holds generated files that the CLI recreates from `aspire.config.json`, so keep it out of source control. +::: + +### Documentation in the SDK + +The generated `aspire.go` includes godoc comments, so `go doc` and editor hover (gopls) show each API's summary, parameters, and return value. Obsolete APIs carry a `Deprecated:` notice that gopls and staticcheck flag, and experimental APIs are marked with an **Experimental** heading. + +### Restore the SDK + +Run `aspire restore` to regenerate the SDK without starting the AppHost: + +```bash title="Aspire CLI" +aspire restore --apphost apphost.go +``` + +Restore after you clone a repository, switch branches, or edit the `packages` section by hand. In CI, restore before any step that compiles the AppHost, such as `go build` or `go vet`. + +## Add integrations + +Use `aspire add` from the AppHost directory to add a hosting integration. The CLI adds the package to `aspire.config.json` and regenerates the Go SDK in `.aspire/modules/`: + +```bash title="Aspire CLI" +aspire add postgresql +``` + +The `packages` section now lists the PostgreSQL integration: + +```json title="aspire.config.json" ins={6} +{ + "packages": { + "Aspire.Hosting.Go": "%ASPIRE_VERSION%", + "Aspire.Hosting.JavaScript": "%ASPIRE_VERSION%", + "Aspire.Hosting.Redis": "%ASPIRE_VERSION%", + "Aspire.Hosting.PostgreSQL": "%ASPIRE_VERSION%" + } +} +``` + +The regenerated SDK has an `AddPostgres` method. This AppHost adds a PostgreSQL server with one database and gives the API access to it, retaining the starter's frontend and publish configuration. As in the previous example, omit the Redis package and cache configuration if you didn't include Redis: + +```go title="apphost.go" +package main + +import ( + "log" + + "apphost/modules/aspire" +) + +func main() { + builder, err := aspire.CreateBuilder() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + + cache := builder.AddRedis("cache") + db := builder.AddPostgres("postgres").AddDatabase("postgresdb") + + api := builder.AddGoApp("app", "./api"). + WithModTidy(). + WithReference(cache). + WithReference(db). + WaitFor(cache). + WaitFor(db). + WithHttpEndpoint(aspire.HttpEndpointEnv("PORT")). + WithExternalHttpEndpoints(). + WithOtlpExporter() + + frontend := builder.AddViteApp("frontend", "./frontend"). + WithReference(api). + WaitFor(api) + + api.PublishWithContainerFiles(frontend, "./static") + + app, err := builder.Build() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + if err := app.Run(); err != nil { + log.Fatal(aspire.FormatError(err)) + } +} +``` + +- `AddPostgres` adds the PostgreSQL server, and `AddDatabase` returns a handle for a database on that server. +- `WithReference(db)` passes the connection details to the API as environment variables named after the resource, such as `POSTGRESDB_URI`. See [Connect to PostgreSQL](/integrations/databases/postgres/postgres-connect/) for a Go example that reads them. +- `WaitFor(db)` starts the API after the database is ready. +- Any error from these calls is reported when you call `Build`. + +## Orchestrate apps in other languages + +A Go AppHost can run resources written in other languages next to your Go apps. Add the integration for each language that you use. Python and Node.js must also be installed, because these resources run on your machine: + +```bash title="Aspire CLI" +aspire add python +aspire add javascript +``` + +This AppHost runs a Go API and a Python recommendation service that share a Redis cache, and a Vite frontend that calls both: + +```go title="apphost.go" +package main + +import ( + "log" + + "apphost/modules/aspire" +) + +func main() { + builder, err := aspire.CreateBuilder() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + + cache := builder.AddRedis("cache") + + api := builder.AddGoApp("api", "./api"). + WithReference(cache). + WaitFor(cache). + WithHttpEndpoint(aspire.HttpEndpointEnv("PORT")) + + recommender := builder.AddUvicornApp("recommender", "./recommender", "main:app"). + WithReference(cache). + WaitFor(cache) + + builder.AddViteApp("web", "./web"). + WithReference(api). + WithReference(recommender). + WaitFor(api) + + app, err := builder.Build() + if err != nil { + log.Fatal(aspire.FormatError(err)) + } + if err := app.Run(); err != nil { + log.Fatal(aspire.FormatError(err)) + } +} +``` + +- `AddUvicornApp` runs a Python ASGI app. The `main:app` argument names the Python module and the application object in it. +- `AddViteApp` runs a Vite frontend. `AddUvicornApp` and `AddViteApp` already register an `http` endpoint that reads its port from `PORT`, so only the Go API calls `WithHttpEndpoint`. +- `WithReference` and `WaitFor` work the same for every resource type. The frontend receives the endpoints of the API and the recommender, and it starts after the API is ready. + + + See [Set up JavaScript apps in the AppHost](/integrations/frameworks/javascript/) and [Python integration](/integrations/frameworks/python/) for the options of each integration. + + +## Debug a Go AppHost + +{/* PLACEHOLDER: replace the link below with the Go AppHost debugging guide when it is published. */} + +To debug AppHosts and their resources in Visual Studio Code, see [Run, debug, and deploy](/get-started/aspire-vscode-extension/#run-debug-and-deploy). + +## See also + +- [Go AppHost API conventions](/app-host/go-apphost-conventions/) +- [Go API reference](/reference/api/go/) +- [Set up Go apps in the AppHost](/integrations/frameworks/go/go-host/) +- [Multi-language architecture](/architecture/multi-language-architecture/) +- [aspire new command](/reference/cli/commands/aspire-new/) +- [aspire run command](/reference/cli/commands/aspire-run/) +- [aspire restore command](/reference/cli/commands/aspire-restore/) diff --git a/src/frontend/src/content/docs/app-host/migrate-from-docker-compose.mdx b/src/frontend/src/content/docs/app-host/migrate-from-docker-compose.mdx index c69a2f18d4..fa0c15a4ec 100644 --- a/src/frontend/src/content/docs/app-host/migrate-from-docker-compose.mdx +++ b/src/frontend/src/content/docs/app-host/migrate-from-docker-compose.mdx @@ -110,14 +110,14 @@ var database = builder.AddPostgres("postgres") .AddDatabase("myapp"); // Add the API project with proper dependencies -var api = builder.AddProject("api") +var api = builder.AddDotnetProject("api", "../MyApp.Api/MyApp.Api.csproj") .WithHttpEndpoint(port: 5000) .WithHttpHealthCheck("/health") .WithReference(database, "DefaultConnection") .WaitFor(database); // Add the frontend project with dependencies -var frontend = builder.AddProject("frontend") +var frontend = builder.AddDotnetProject("frontend", "../MyApp.Frontend/MyApp.Frontend.csproj") .WithHttpEndpoint(port: 3000) .WithReference(api) .WithEnvironment("API_URL", api.GetEndpoint("http")) @@ -139,14 +139,14 @@ const database = (await builder.addPostgres("postgres") .addDatabase("myapp"); // Add the API project with proper dependencies -const api = await builder.addProject("api", "./MyApp.Api/MyApp.Api.csproj") +const api = await builder.addDotnetProject("api", "./MyApp.Api/MyApp.Api.csproj") .withHttpEndpoint({ port: 5000 }) .withHttpHealthCheck("/health") .withReference(database, "DefaultConnection") .waitFor(database); // Add the frontend project with dependencies -const frontend = await builder.addProject("frontend", "./MyApp.Frontend/MyApp.Frontend.csproj") +const frontend = await builder.addDotnetProject("frontend", "./MyApp.Frontend/MyApp.Frontend.csproj") .withHttpEndpoint({ port: 3000 }) .withReference(api) .withEnvironment("API_URL", api.getEndpoint("http")) @@ -158,12 +158,12 @@ await builder.build().run(); **Key differences explained:** -- **Build vs. project** — Docker Compose `build:` services become `AddProject()` for .NET apps, which runs them directly instead of in containers +- **Build vs. project** — Docker Compose `build:` services become `AddDotnetProject` resources for .NET apps, which runs them directly instead of in containers - **Ports** — Both examples explicitly map ports (3000 and 5000) - **Startup order** — Docker Compose uses `depends_on` with health conditions; Aspire uses for startup ordering - **Service discovery** — only configures service discovery and connection strings; it doesn't control startup order @@ -527,7 +527,7 @@ Successfully migrating from Docker Compose to Aspire requires a systematic appro - **Add backing services** like PostgreSQL, Redis with specific versions using `WithImageTag()` - **Add persistent storage** using `WithDataVolume()` where needed - - **Convert .NET applications** to project references with `AddProject()` for better integration + - **Convert .NET applications** to `AddDotnetProject` resources for better integration - **Convert Dockerfile-built containers** using `AddDockerfile()` to match `build:` directives - **Convert pre-built images** using `AddContainer()` to match `image:` directives - **Configure dependencies** with `WithReference()` for service discovery @@ -604,14 +604,14 @@ const app = await builder.addContainer("app", "myapp:latest") ```csharp title="AppHost.cs" -var api = builder.AddProject("api") +var api = builder.AddDotnetProject("api", "../Api/Api.csproj") .WithReference(database) // Service discovery .WaitFor(database); // Startup ordering ``` ```typescript title="apphost.mts" -const api = await builder.addProject("api", "./Api/Api.csproj", "https") +const api = await builder.addDotnetProject("api", "./Api/Api.csproj", { launchProfileName: "https" }) .withReference(database) // Service discovery .waitFor(database); // Startup ordering ``` @@ -654,13 +654,13 @@ Docker Compose health checks use shell commands. Aspire integrations (like Postg ```csharp title="AppHost.cs" -var api = builder.AddProject("api") +var api = builder.AddDotnetProject("api", "../Api/Api.csproj") .WithHttpHealthCheck("/health"); ``` ```typescript title="apphost.mts" -const api = await builder.addProject("api", "./Api/Api.csproj", "https") +const api = await builder.addDotnetProject("api", "./Api/Api.csproj", { launchProfileName: "https" }) .withHttpHealthCheck("/health"); ``` @@ -683,7 +683,7 @@ var rabbit = builder.AddContainer("rabbitmq", "rabbitmq", "4.1.4-management-alpi .WithHealthCheck("rabbitmq-health"); // WaitFor uses the registered health check to determine readiness -var app = builder.AddProject("app") +var app = builder.AddDotnetProject("app", "../App/App.csproj") .WaitFor(rabbit); ``` @@ -693,7 +693,7 @@ const rabbit = await builder.addContainer("rabbitmq", "rabbitmq", "4.1.4-managem .withHealthCheck("rabbitmq-health"); // WaitFor uses the registered health check to determine readiness -const app = await builder.addProject("app", "./App/App.csproj", "https") +const app = await builder.addDotnetProject("app", "./App/App.csproj", { launchProfileName: "https" }) .waitFor(rabbit); ``` diff --git a/src/frontend/src/content/docs/app-host/resource-lifetimes.mdx b/src/frontend/src/content/docs/app-host/resource-lifetimes.mdx index 22214da3de..1cb9599393 100644 --- a/src/frontend/src/content/docs/app-host/resource-lifetimes.mdx +++ b/src/frontend/src/content/docs/app-host/resource-lifetimes.mdx @@ -148,7 +148,7 @@ var postgres = builder.AddPostgres("postgres") var db = postgres.AddDatabase("inventorydb"); -builder.AddProject("inventory") +builder.AddDotnetProject("inventory", "../InventoryService/InventoryService.csproj") .WithReference(db); builder.Build().Run(); @@ -168,7 +168,7 @@ await postgres.withDataVolume(); const db = postgres.addDatabase('inventorydb'); -const inventory = await builder.addProject( +const inventory = await builder.addDotnetProject( 'inventory', './InventoryService/InventoryService.csproj' ); @@ -231,7 +231,7 @@ Project resources can use persistent lifetimes when you want the project process ```csharp title="AppHost.cs" var builder = DistributedApplication.CreateBuilder(args); -var api = builder.AddProject("api") +var api = builder.AddDotnetProject("api", "../ApiService/ApiService.csproj") .WithPersistentLifetime(); builder.Build().Run(); @@ -245,7 +245,7 @@ import { createBuilder } from './.aspire/modules/aspire.mjs'; const builder = await createBuilder(); -const api = await builder.addProject('api', '../ApiService/ApiService.csproj'); +const api = await builder.addDotnetProject('api', '../ApiService/ApiService.csproj'); await api.withPersistentLifetime(); await builder.build().run(); diff --git a/src/frontend/src/content/docs/app-host/resource-naming.mdx b/src/frontend/src/content/docs/app-host/resource-naming.mdx index d5223a51be..acf4569f2d 100644 --- a/src/frontend/src/content/docs/app-host/resource-naming.mdx +++ b/src/frontend/src/content/docs/app-host/resource-naming.mdx @@ -33,20 +33,6 @@ ConnectionStrings__ For example, if you define a Redis resource named `cache`: - - -```csharp title="AppHost.cs" -var builder = DistributedApplication.CreateBuilder(args); - -var cache = builder.AddRedis("cache"); - -var api = builder.AddProject("api") - .WithReference(cache); - -builder.Build().Run(); -``` - - ```typescript title="apphost.mts" @@ -56,11 +42,25 @@ const builder = await createBuilder(); const cache = await builder.addRedis('cache'); -await builder.addProject('api', '../MyApi/MyApi.csproj').withReference(cache); +await builder.addDotnetProject('api', '../MyApi/MyApi.csproj').withReference(cache); await builder.build().run(); ``` + + + +```csharp title="AppHost.cs" +var builder = DistributedApplication.CreateBuilder(args); + +var cache = builder.AddRedis("cache"); + +var api = builder.AddDotnetProject("api", "../MyApi/MyApi.csproj") + .WithReference(cache); + +builder.Build().Run(); +``` + @@ -98,22 +98,6 @@ Aspire preserves the original resource name in connection string and service dis The following AppHost defines resources whose names contain dashes: - - -```csharp title="AppHost.cs" -var builder = DistributedApplication.CreateBuilder(args); - -var db = builder.AddPostgres("postgres").AddDatabase("app-db"); -var catalog = builder.AddProject("catalog-api"); - -builder.AddProject("worker") - .WithReference(db) - .WithReference(catalog); - -builder.Build().Run(); -``` - - ```typescript title="apphost.mts" @@ -123,18 +107,34 @@ const builder = await createBuilder(); const postgres = await builder.addPostgres('postgres'); const db = await postgres.addDatabase('app-db'); -const catalog = await builder.addProject( +const catalog = await builder.addDotnetProject( 'catalog-api', '../CatalogApi/CatalogApi.csproj' ); -const worker = await builder.addProject('worker', '../Worker/Worker.csproj'); +const worker = await builder.addDotnetProject('worker', '../Worker/Worker.csproj'); await worker.withReference(db); await worker.withReference(catalog); await builder.build().run(); ``` + + + +```csharp title="AppHost.cs" +var builder = DistributedApplication.CreateBuilder(args); + +var db = builder.AddPostgres("postgres").AddDatabase("app-db"); +var catalog = builder.AddDotnetProject("catalog-api", "../CatalogApi/CatalogApi.csproj"); + +builder.AddDotnetProject("worker", "../Worker/Worker.csproj") + .WithReference(db) + .WithReference(catalog); + +builder.Build().Run(); +``` + @@ -191,25 +191,6 @@ Follow these recommendations when naming resources in your AppHost: The following example shows a set of clear, conventional resource names: - - -```csharp title="AppHost.cs" -var builder = DistributedApplication.CreateBuilder(args); - -var postgres = builder.AddPostgres("postgres"); -var appDb = postgres.AddDatabase("app-db"); -var cache = builder.AddRedis("cache"); -var messageBus = builder.AddRabbitMQ("message-bus"); - -var api = builder.AddProject("api") - .WithReference(appDb) - .WithReference(cache) - .WithReference(messageBus); - -builder.Build().Run(); -``` - - ```typescript title="apphost.mts" @@ -222,7 +203,7 @@ const appDb = await postgres.addDatabase('app-db'); const cache = await builder.addRedis('cache'); const messageBus = await builder.addRabbitMQ('message-bus'); -const api = await builder.addProject('api', '../Api/Api.csproj'); +const api = await builder.addDotnetProject('api', '../Api/Api.csproj'); await api.withReference(appDb); await api.withReference(cache); await api.withReference(messageBus); @@ -230,6 +211,25 @@ await api.withReference(messageBus); await builder.build().run(); ``` + + + +```csharp title="AppHost.cs" +var builder = DistributedApplication.CreateBuilder(args); + +var postgres = builder.AddPostgres("postgres"); +var appDb = postgres.AddDatabase("app-db"); +var cache = builder.AddRedis("cache"); +var messageBus = builder.AddRabbitMQ("message-bus"); + +var api = builder.AddDotnetProject("api", "../Api/Api.csproj") + .WithReference(appDb) + .WithReference(cache) + .WithReference(messageBus); + +builder.Build().Run(); +``` + diff --git a/src/frontend/src/content/docs/app-host/with-terminal.mdx b/src/frontend/src/content/docs/app-host/with-terminal.mdx index 40f341228e..e5773732ab 100644 --- a/src/frontend/src/content/docs/app-host/with-terminal.mdx +++ b/src/frontend/src/content/docs/app-host/with-terminal.mdx @@ -6,9 +6,9 @@ description: Configure interactive resource terminals with WithTerminal, choose import { Aside, Tabs, TabItem } from '@astrojs/starlight/components'; import ThemeImage from '@components/ThemeImage.astro'; -import terminalResourceDark from '@assets/dashboard/terminals/terminal-resource-dark.png'; +import terminalResourceDark from '@assets/dashboard/terminals/terminal-resource.png'; import terminalResourceLight from '@assets/dashboard/terminals/terminal-resource-light.png'; -import terminalDetachedDark from '@assets/dashboard/terminals/terminal-detached-dark.png'; +import terminalDetachedDark from '@assets/dashboard/terminals/terminal-detached.png'; import terminalDetachedLight from '@assets/dashboard/terminals/terminal-detached-light.png'; import ApiReference from '@components/ApiReference.astro'; @@ -16,10 +16,6 @@ If you have a terminal user interface (TUI) application or a shell-based experie For an introduction to the resource Terminal view, terminal dock, and detached windows, start with [Dashboard terminals](/dashboard/terminals/). -:::caution[Aspire 13.6 preview] -This page describes resource-terminal behavior and defaults for Aspire 13.6 preview. Use matching AppHost, dashboard, and CLI builds. -::: - ## Prerequisites Start with a [TypeScript or C# AppHost](/get-started/app-host/) and an installed interactive program. Resource terminals support executable and project processes on Windows, macOS, and Linux, as well as container processes through the container runtime. Containers require a [supported container runtime](/get-started/prerequisites/). @@ -47,7 +43,6 @@ await builder.build().run(); ```csharp title="AppHost.cs" -#pragma warning disable ASPIRETERMINAL001 var builder = DistributedApplication.CreateBuilder(args); builder.AddExecutable("repl", "python3", ".", "-i", "-q") @@ -59,11 +54,7 @@ builder.Build().Run(); -Start the app with `aspire run`, select `repl` on the dashboard's **Console logs** page, and switch to **Terminal** if needed. At the Python prompt, enter `print("Hello from Aspire")`. You can also run `aspire terminal attach repl` after [enabling the CLI commands](#work-with-terminals-from-the-cli). - - +Start the app with `aspire run`, select `repl` on the dashboard's **Console logs** page, and switch to **Terminal** if needed. At the Python prompt, enter `print("Hello from Aspire")`. You can also use [`aspire terminal attach repl`](#work-with-terminals-from-the-cli). ## When to use WithTerminal @@ -105,21 +96,25 @@ To query a running database or cache, use the integration's [`WithRepl()` comman The terminal session is described by a set of options with sensible defaults: -| Option | Default | Description | -| ------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Columns` | `120` | The initial number of columns for the terminal grid. | -| `Rows` | `30` | The initial number of rows for the terminal grid. | -| `ShowTerminalHost` | `false` | Whether the hidden per-replica terminal host resources appear in the dashboard and CLI resource lists **and** export their diagnostic logs, metrics, and traces. Set to `true` to diagnose terminal-host startup or connectivity issues. | +| Option | Default | Description | +| --------- | ------- | ---------------------------------------------------- | +| `Columns` | `132` | The initial number of columns for the terminal grid. | +| `Rows` | `50` | The initial number of rows for the terminal grid. | + +On the resource **Terminal** page, the dashboard automatically fits the terminal grid to the view when you open the terminal unless you set `Columns` or `Rows`. Setting either dimension, even to its default value, turns off automatic fitting on that page until you request a resize. A configuration callback that doesn't set either dimension keeps automatic fitting. The terminal dock still automatically fits its resource-terminal pane when it opens, even if you set dimensions. -