diff --git a/.gitignore b/.gitignore index 8dbfc126..2e4e4e61 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,8 @@ # Node / local-viewer SPA source (the built bundle in -# strix/viewer/viewer_dist/ is committed and shipped; do not ignore it) +# strix/viewer/static/ is committed and shipped; do not ignore it) node_modules/ -strix/viewer_src/node_modules/ -strix/viewer_src/.vite/ +strix/viewer/frontend/node_modules/ +strix/viewer/frontend/.vite/ # Python __pycache__/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e838b9b5..20cb009a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -101,17 +101,17 @@ We welcome feature ideas! Please: ## 🖥️ Local viewer SPA -`strix view` serves a prebuilt web UI whose source lives in `strix/viewer_src/` -(a Vite + React project) and whose built output is committed to -`strix/viewer/viewer_dist/` and shipped in the package. End users never run a -JS build. If you change anything under `strix/viewer_src/`, rebuild and commit -the output: +`strix view` serves a prebuilt web UI whose source lives in +`strix/viewer/frontend/` (a Vite + React project) and whose built output is +committed to `strix/viewer/static/` and shipped in the package. End users never +run a JS build. If you change anything under `strix/viewer/frontend/`, rebuild +and commit the output: ```bash -make viewer # or: cd strix/viewer_src && npm ci && npm run build +make viewer # or: cd strix/viewer/frontend && npm ci && npm run build ``` -Commit both the source change and the regenerated `strix/viewer/viewer_dist/`. +Commit both the source change and the regenerated `strix/viewer/static/`. ## 🤝 Community diff --git a/Makefile b/Makefile index 708aacc8..656c0346 100644 --- a/Makefile +++ b/Makefile @@ -69,8 +69,8 @@ clean: viewer: @echo "🖥️ Building the local-viewer SPA..." - cd strix/viewer_src && npm ci && npm run build - @echo "✅ Viewer built to strix/viewer/viewer_dist/ (commit the changes)." + cd strix/viewer/frontend && npm ci && npm run build + @echo "✅ Viewer built to strix/viewer/static/ (commit the changes)." dev: format lint type-check @echo "✅ Development cycle complete!" diff --git a/pyproject.toml b/pyproject.toml index 39806bde..3bc079a3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -77,10 +77,10 @@ build-backend = "hatchling.build" [tool.hatch.build.targets.wheel] packages = ["strix"] -# The prebuilt viewer bundle under strix/viewer/viewer_dist/ ships automatically +# The prebuilt viewer bundle under strix/viewer/static/ ships automatically # (hatchling includes non-.py files under the package). The Vite SOURCE lives -# under the package dir too but must never ship in the wheel. -exclude = ["strix/viewer_src", "strix/viewer_src/**"] +# under the package dir too (strix/viewer/frontend/) but must never ship in the wheel. +exclude = ["strix/viewer/frontend", "strix/viewer/frontend/**"] # ============================================================================ # Type Checking Configuration diff --git a/strix.spec b/strix.spec index d3b21202..7c94cca6 100644 --- a/strix.spec +++ b/strix.spec @@ -26,8 +26,8 @@ for tcss_file in strix_root.rglob('*.tcss'): datas.append((str(tcss_file), str(rel_path.parent))) # Prebuilt local-viewer SPA (served by `strix view`). -viewer_dist = strix_root / 'viewer' / 'viewer_dist' -for asset in viewer_dist.rglob('*'): +viewer_static = strix_root / 'viewer' / 'static' +for asset in viewer_static.rglob('*'): if asset.is_file(): rel_path = asset.relative_to(project_root) datas.append((str(asset), str(rel_path.parent))) diff --git a/strix/viewer/cli.py b/strix/viewer/cli.py index 852fbfcc..1f51e22d 100644 --- a/strix/viewer/cli.py +++ b/strix/viewer/cli.py @@ -58,7 +58,7 @@ def run_view(argv: list[str]) -> None: if not bundle_is_built(): console.print( "[bold red]Viewer UI is not built.[/]\n" - "Build it with: [cyan]cd strix/viewer_src && npm ci && npm run build[/]" + "Build it with: [cyan]cd strix/viewer/frontend && npm ci && npm run build[/]" ) raise SystemExit(1) diff --git a/strix/viewer_src/index.html b/strix/viewer/frontend/index.html similarity index 100% rename from strix/viewer_src/index.html rename to strix/viewer/frontend/index.html diff --git a/strix/viewer_src/package-lock.json b/strix/viewer/frontend/package-lock.json similarity index 100% rename from strix/viewer_src/package-lock.json rename to strix/viewer/frontend/package-lock.json diff --git a/strix/viewer_src/package.json b/strix/viewer/frontend/package.json similarity index 100% rename from strix/viewer_src/package.json rename to strix/viewer/frontend/package.json diff --git a/strix/viewer/viewer_dist/logo.png b/strix/viewer/frontend/public/logo.png similarity index 100% rename from strix/viewer/viewer_dist/logo.png rename to strix/viewer/frontend/public/logo.png diff --git a/strix/viewer_src/src/App.tsx b/strix/viewer/frontend/src/App.tsx similarity index 100% rename from strix/viewer_src/src/App.tsx rename to strix/viewer/frontend/src/App.tsx diff --git a/strix/viewer_src/src/components/AddRepositoryDialog.tsx b/strix/viewer/frontend/src/components/AddRepositoryDialog.tsx similarity index 100% rename from strix/viewer_src/src/components/AddRepositoryDialog.tsx rename to strix/viewer/frontend/src/components/AddRepositoryDialog.tsx diff --git a/strix/viewer_src/src/components/EmailReportView.tsx b/strix/viewer/frontend/src/components/EmailReportView.tsx similarity index 100% rename from strix/viewer_src/src/components/EmailReportView.tsx rename to strix/viewer/frontend/src/components/EmailReportView.tsx diff --git a/strix/viewer_src/src/components/EmailVerifyInline.tsx b/strix/viewer/frontend/src/components/EmailVerifyInline.tsx similarity index 100% rename from strix/viewer_src/src/components/EmailVerifyInline.tsx rename to strix/viewer/frontend/src/components/EmailVerifyInline.tsx diff --git a/strix/viewer_src/src/components/FeatureDetail.tsx b/strix/viewer/frontend/src/components/FeatureDetail.tsx similarity index 100% rename from strix/viewer_src/src/components/FeatureDetail.tsx rename to strix/viewer/frontend/src/components/FeatureDetail.tsx diff --git a/strix/viewer_src/src/components/IssueSeveritySummary.tsx b/strix/viewer/frontend/src/components/IssueSeveritySummary.tsx similarity index 100% rename from strix/viewer_src/src/components/IssueSeveritySummary.tsx rename to strix/viewer/frontend/src/components/IssueSeveritySummary.tsx diff --git a/strix/viewer_src/src/components/PastRunsView.tsx b/strix/viewer/frontend/src/components/PastRunsView.tsx similarity index 100% rename from strix/viewer_src/src/components/PastRunsView.tsx rename to strix/viewer/frontend/src/components/PastRunsView.tsx diff --git a/strix/viewer_src/src/components/ProCta.tsx b/strix/viewer/frontend/src/components/ProCta.tsx similarity index 100% rename from strix/viewer_src/src/components/ProCta.tsx rename to strix/viewer/frontend/src/components/ProCta.tsx diff --git a/strix/viewer_src/src/components/RunDetails.tsx b/strix/viewer/frontend/src/components/RunDetails.tsx similarity index 100% rename from strix/viewer_src/src/components/RunDetails.tsx rename to strix/viewer/frontend/src/components/RunDetails.tsx diff --git a/strix/viewer_src/src/components/Sidebar.tsx b/strix/viewer/frontend/src/components/Sidebar.tsx similarity index 100% rename from strix/viewer_src/src/components/Sidebar.tsx rename to strix/viewer/frontend/src/components/Sidebar.tsx diff --git a/strix/viewer_src/src/components/TrustToast.tsx b/strix/viewer/frontend/src/components/TrustToast.tsx similarity index 100% rename from strix/viewer_src/src/components/TrustToast.tsx rename to strix/viewer/frontend/src/components/TrustToast.tsx diff --git a/strix/viewer_src/src/components/live/AgentDetailModal.tsx b/strix/viewer/frontend/src/components/live/AgentDetailModal.tsx similarity index 100% rename from strix/viewer_src/src/components/live/AgentDetailModal.tsx rename to strix/viewer/frontend/src/components/live/AgentDetailModal.tsx diff --git a/strix/viewer_src/src/components/live/AgentGraph.tsx b/strix/viewer/frontend/src/components/live/AgentGraph.tsx similarity index 100% rename from strix/viewer_src/src/components/live/AgentGraph.tsx rename to strix/viewer/frontend/src/components/live/AgentGraph.tsx diff --git a/strix/viewer_src/src/components/live/AgentNode.tsx b/strix/viewer/frontend/src/components/live/AgentNode.tsx similarity index 100% rename from strix/viewer_src/src/components/live/AgentNode.tsx rename to strix/viewer/frontend/src/components/live/AgentNode.tsx diff --git a/strix/viewer_src/src/components/live/AgentTranscript.tsx b/strix/viewer/frontend/src/components/live/AgentTranscript.tsx similarity index 100% rename from strix/viewer_src/src/components/live/AgentTranscript.tsx rename to strix/viewer/frontend/src/components/live/AgentTranscript.tsx diff --git a/strix/viewer_src/src/components/live/GraphSkeleton.tsx b/strix/viewer/frontend/src/components/live/GraphSkeleton.tsx similarity index 100% rename from strix/viewer_src/src/components/live/GraphSkeleton.tsx rename to strix/viewer/frontend/src/components/live/GraphSkeleton.tsx diff --git a/strix/viewer_src/src/components/live/ScanPromptComposer.tsx b/strix/viewer/frontend/src/components/live/ScanPromptComposer.tsx similarity index 100% rename from strix/viewer_src/src/components/live/ScanPromptComposer.tsx rename to strix/viewer/frontend/src/components/live/ScanPromptComposer.tsx diff --git a/strix/viewer_src/src/components/live/tool-renderers/AgentCommsRenderer.tsx b/strix/viewer/frontend/src/components/live/tool-renderers/AgentCommsRenderer.tsx similarity index 100% rename from strix/viewer_src/src/components/live/tool-renderers/AgentCommsRenderer.tsx rename to strix/viewer/frontend/src/components/live/tool-renderers/AgentCommsRenderer.tsx diff --git a/strix/viewer_src/src/components/live/tool-renderers/ApplyPatchRenderer.tsx b/strix/viewer/frontend/src/components/live/tool-renderers/ApplyPatchRenderer.tsx similarity index 100% rename from strix/viewer_src/src/components/live/tool-renderers/ApplyPatchRenderer.tsx rename to strix/viewer/frontend/src/components/live/tool-renderers/ApplyPatchRenderer.tsx diff --git a/strix/viewer_src/src/components/live/tool-renderers/BrowserRenderer.tsx b/strix/viewer/frontend/src/components/live/tool-renderers/BrowserRenderer.tsx similarity index 100% rename from strix/viewer_src/src/components/live/tool-renderers/BrowserRenderer.tsx rename to strix/viewer/frontend/src/components/live/tool-renderers/BrowserRenderer.tsx diff --git a/strix/viewer_src/src/components/live/tool-renderers/ChatBubble.tsx b/strix/viewer/frontend/src/components/live/tool-renderers/ChatBubble.tsx similarity index 100% rename from strix/viewer_src/src/components/live/tool-renderers/ChatBubble.tsx rename to strix/viewer/frontend/src/components/live/tool-renderers/ChatBubble.tsx diff --git a/strix/viewer_src/src/components/live/tool-renderers/FallbackRenderer.tsx b/strix/viewer/frontend/src/components/live/tool-renderers/FallbackRenderer.tsx similarity index 100% rename from strix/viewer_src/src/components/live/tool-renderers/FallbackRenderer.tsx rename to strix/viewer/frontend/src/components/live/tool-renderers/FallbackRenderer.tsx diff --git a/strix/viewer_src/src/components/live/tool-renderers/FileEditRenderer.tsx b/strix/viewer/frontend/src/components/live/tool-renderers/FileEditRenderer.tsx similarity index 100% rename from strix/viewer_src/src/components/live/tool-renderers/FileEditRenderer.tsx rename to strix/viewer/frontend/src/components/live/tool-renderers/FileEditRenderer.tsx diff --git a/strix/viewer_src/src/components/live/tool-renderers/FinishRenderer.tsx b/strix/viewer/frontend/src/components/live/tool-renderers/FinishRenderer.tsx similarity index 100% rename from strix/viewer_src/src/components/live/tool-renderers/FinishRenderer.tsx rename to strix/viewer/frontend/src/components/live/tool-renderers/FinishRenderer.tsx diff --git a/strix/viewer_src/src/components/live/tool-renderers/LoadSkillRenderer.tsx b/strix/viewer/frontend/src/components/live/tool-renderers/LoadSkillRenderer.tsx similarity index 100% rename from strix/viewer_src/src/components/live/tool-renderers/LoadSkillRenderer.tsx rename to strix/viewer/frontend/src/components/live/tool-renderers/LoadSkillRenderer.tsx diff --git a/strix/viewer_src/src/components/live/tool-renderers/Markdown.tsx b/strix/viewer/frontend/src/components/live/tool-renderers/Markdown.tsx similarity index 100% rename from strix/viewer_src/src/components/live/tool-renderers/Markdown.tsx rename to strix/viewer/frontend/src/components/live/tool-renderers/Markdown.tsx diff --git a/strix/viewer_src/src/components/live/tool-renderers/NotesRenderer.tsx b/strix/viewer/frontend/src/components/live/tool-renderers/NotesRenderer.tsx similarity index 100% rename from strix/viewer_src/src/components/live/tool-renderers/NotesRenderer.tsx rename to strix/viewer/frontend/src/components/live/tool-renderers/NotesRenderer.tsx diff --git a/strix/viewer_src/src/components/live/tool-renderers/ProxyRenderer.tsx b/strix/viewer/frontend/src/components/live/tool-renderers/ProxyRenderer.tsx similarity index 100% rename from strix/viewer_src/src/components/live/tool-renderers/ProxyRenderer.tsx rename to strix/viewer/frontend/src/components/live/tool-renderers/ProxyRenderer.tsx diff --git a/strix/viewer_src/src/components/live/tool-renderers/PythonRenderer.tsx b/strix/viewer/frontend/src/components/live/tool-renderers/PythonRenderer.tsx similarity index 100% rename from strix/viewer_src/src/components/live/tool-renderers/PythonRenderer.tsx rename to strix/viewer/frontend/src/components/live/tool-renderers/PythonRenderer.tsx diff --git a/strix/viewer_src/src/components/live/tool-renderers/ScanInfoRenderer.tsx b/strix/viewer/frontend/src/components/live/tool-renderers/ScanInfoRenderer.tsx similarity index 100% rename from strix/viewer_src/src/components/live/tool-renderers/ScanInfoRenderer.tsx rename to strix/viewer/frontend/src/components/live/tool-renderers/ScanInfoRenderer.tsx diff --git a/strix/viewer_src/src/components/live/tool-renderers/TerminalRenderer.tsx b/strix/viewer/frontend/src/components/live/tool-renderers/TerminalRenderer.tsx similarity index 100% rename from strix/viewer_src/src/components/live/tool-renderers/TerminalRenderer.tsx rename to strix/viewer/frontend/src/components/live/tool-renderers/TerminalRenderer.tsx diff --git a/strix/viewer_src/src/components/live/tool-renderers/ThinkRenderer.tsx b/strix/viewer/frontend/src/components/live/tool-renderers/ThinkRenderer.tsx similarity index 100% rename from strix/viewer_src/src/components/live/tool-renderers/ThinkRenderer.tsx rename to strix/viewer/frontend/src/components/live/tool-renderers/ThinkRenderer.tsx diff --git a/strix/viewer_src/src/components/live/tool-renderers/TodoRenderer.tsx b/strix/viewer/frontend/src/components/live/tool-renderers/TodoRenderer.tsx similarity index 100% rename from strix/viewer_src/src/components/live/tool-renderers/TodoRenderer.tsx rename to strix/viewer/frontend/src/components/live/tool-renderers/TodoRenderer.tsx diff --git a/strix/viewer_src/src/components/live/tool-renderers/ToolCard.tsx b/strix/viewer/frontend/src/components/live/tool-renderers/ToolCard.tsx similarity index 100% rename from strix/viewer_src/src/components/live/tool-renderers/ToolCard.tsx rename to strix/viewer/frontend/src/components/live/tool-renderers/ToolCard.tsx diff --git a/strix/viewer_src/src/components/live/tool-renderers/ViewImageRenderer.tsx b/strix/viewer/frontend/src/components/live/tool-renderers/ViewImageRenderer.tsx similarity index 100% rename from strix/viewer_src/src/components/live/tool-renderers/ViewImageRenderer.tsx rename to strix/viewer/frontend/src/components/live/tool-renderers/ViewImageRenderer.tsx diff --git a/strix/viewer_src/src/components/live/tool-renderers/VulnReportRenderer.tsx b/strix/viewer/frontend/src/components/live/tool-renderers/VulnReportRenderer.tsx similarity index 100% rename from strix/viewer_src/src/components/live/tool-renderers/VulnReportRenderer.tsx rename to strix/viewer/frontend/src/components/live/tool-renderers/VulnReportRenderer.tsx diff --git a/strix/viewer_src/src/components/live/tool-renderers/WebSearchRenderer.tsx b/strix/viewer/frontend/src/components/live/tool-renderers/WebSearchRenderer.tsx similarity index 100% rename from strix/viewer_src/src/components/live/tool-renderers/WebSearchRenderer.tsx rename to strix/viewer/frontend/src/components/live/tool-renderers/WebSearchRenderer.tsx diff --git a/strix/viewer_src/src/components/live/tool-renderers/index.ts b/strix/viewer/frontend/src/components/live/tool-renderers/index.ts similarity index 100% rename from strix/viewer_src/src/components/live/tool-renderers/index.ts rename to strix/viewer/frontend/src/components/live/tool-renderers/index.ts diff --git a/strix/viewer_src/src/components/live/tool-renderers/utils.ts b/strix/viewer/frontend/src/components/live/tool-renderers/utils.ts similarity index 100% rename from strix/viewer_src/src/components/live/tool-renderers/utils.ts rename to strix/viewer/frontend/src/components/live/tool-renderers/utils.ts diff --git a/strix/viewer_src/src/components/vulnerability/CodeDiffBlock.tsx b/strix/viewer/frontend/src/components/vulnerability/CodeDiffBlock.tsx similarity index 100% rename from strix/viewer_src/src/components/vulnerability/CodeDiffBlock.tsx rename to strix/viewer/frontend/src/components/vulnerability/CodeDiffBlock.tsx diff --git a/strix/viewer_src/src/components/vulnerability/ContentSection.tsx b/strix/viewer/frontend/src/components/vulnerability/ContentSection.tsx similarity index 100% rename from strix/viewer_src/src/components/vulnerability/ContentSection.tsx rename to strix/viewer/frontend/src/components/vulnerability/ContentSection.tsx diff --git a/strix/viewer_src/src/components/vulnerability/IssueSidebar.tsx b/strix/viewer/frontend/src/components/vulnerability/IssueSidebar.tsx similarity index 100% rename from strix/viewer_src/src/components/vulnerability/IssueSidebar.tsx rename to strix/viewer/frontend/src/components/vulnerability/IssueSidebar.tsx diff --git a/strix/viewer_src/src/components/vulnerability/MdCodeBlock.tsx b/strix/viewer/frontend/src/components/vulnerability/MdCodeBlock.tsx similarity index 100% rename from strix/viewer_src/src/components/vulnerability/MdCodeBlock.tsx rename to strix/viewer/frontend/src/components/vulnerability/MdCodeBlock.tsx diff --git a/strix/viewer_src/src/components/vulnerability/PocBlock.tsx b/strix/viewer/frontend/src/components/vulnerability/PocBlock.tsx similarity index 100% rename from strix/viewer_src/src/components/vulnerability/PocBlock.tsx rename to strix/viewer/frontend/src/components/vulnerability/PocBlock.tsx diff --git a/strix/viewer_src/src/components/vulnerability/VulnerabilityDetail.tsx b/strix/viewer/frontend/src/components/vulnerability/VulnerabilityDetail.tsx similarity index 100% rename from strix/viewer_src/src/components/vulnerability/VulnerabilityDetail.tsx rename to strix/viewer/frontend/src/components/vulnerability/VulnerabilityDetail.tsx diff --git a/strix/viewer_src/src/data/serverSource.ts b/strix/viewer/frontend/src/data/serverSource.ts similarity index 100% rename from strix/viewer_src/src/data/serverSource.ts rename to strix/viewer/frontend/src/data/serverSource.ts diff --git a/strix/viewer_src/src/index.css b/strix/viewer/frontend/src/index.css similarity index 100% rename from strix/viewer_src/src/index.css rename to strix/viewer/frontend/src/index.css diff --git a/strix/viewer_src/src/lib/cta.ts b/strix/viewer/frontend/src/lib/cta.ts similarity index 100% rename from strix/viewer_src/src/lib/cta.ts rename to strix/viewer/frontend/src/lib/cta.ts diff --git a/strix/viewer_src/src/lib/display-number.ts b/strix/viewer/frontend/src/lib/display-number.ts similarity index 100% rename from strix/viewer_src/src/lib/display-number.ts rename to strix/viewer/frontend/src/lib/display-number.ts diff --git a/strix/viewer_src/src/lib/hljs.ts b/strix/viewer/frontend/src/lib/hljs.ts similarity index 100% rename from strix/viewer_src/src/lib/hljs.ts rename to strix/viewer/frontend/src/lib/hljs.ts diff --git a/strix/viewer_src/src/lib/local-run-parser.ts b/strix/viewer/frontend/src/lib/local-run-parser.ts similarity index 100% rename from strix/viewer_src/src/lib/local-run-parser.ts rename to strix/viewer/frontend/src/lib/local-run-parser.ts diff --git a/strix/viewer_src/src/lib/pro-features.ts b/strix/viewer/frontend/src/lib/pro-features.ts similarity index 100% rename from strix/viewer_src/src/lib/pro-features.ts rename to strix/viewer/frontend/src/lib/pro-features.ts diff --git a/strix/viewer_src/src/lib/target-utils.ts b/strix/viewer/frontend/src/lib/target-utils.ts similarity index 100% rename from strix/viewer_src/src/lib/target-utils.ts rename to strix/viewer/frontend/src/lib/target-utils.ts diff --git a/strix/viewer_src/src/lib/utils.ts b/strix/viewer/frontend/src/lib/utils.ts similarity index 100% rename from strix/viewer_src/src/lib/utils.ts rename to strix/viewer/frontend/src/lib/utils.ts diff --git a/strix/viewer_src/src/lib/vulnerability-utils.ts b/strix/viewer/frontend/src/lib/vulnerability-utils.ts similarity index 100% rename from strix/viewer_src/src/lib/vulnerability-utils.ts rename to strix/viewer/frontend/src/lib/vulnerability-utils.ts diff --git a/strix/viewer_src/src/main.tsx b/strix/viewer/frontend/src/main.tsx similarity index 100% rename from strix/viewer_src/src/main.tsx rename to strix/viewer/frontend/src/main.tsx diff --git a/strix/viewer_src/src/stores/auth.ts b/strix/viewer/frontend/src/stores/auth.ts similarity index 100% rename from strix/viewer_src/src/stores/auth.ts rename to strix/viewer/frontend/src/stores/auth.ts diff --git a/strix/viewer_src/src/types/events.ts b/strix/viewer/frontend/src/types/events.ts similarity index 100% rename from strix/viewer_src/src/types/events.ts rename to strix/viewer/frontend/src/types/events.ts diff --git a/strix/viewer_src/src/types/issues.ts b/strix/viewer/frontend/src/types/issues.ts similarity index 100% rename from strix/viewer_src/src/types/issues.ts rename to strix/viewer/frontend/src/types/issues.ts diff --git a/strix/viewer_src/tsconfig.json b/strix/viewer/frontend/tsconfig.json similarity index 100% rename from strix/viewer_src/tsconfig.json rename to strix/viewer/frontend/tsconfig.json diff --git a/strix/viewer_src/vite.config.ts b/strix/viewer/frontend/vite.config.ts similarity index 83% rename from strix/viewer_src/vite.config.ts rename to strix/viewer/frontend/vite.config.ts index 02260488..696fbb84 100644 --- a/strix/viewer_src/vite.config.ts +++ b/strix/viewer/frontend/vite.config.ts @@ -5,7 +5,7 @@ import { fileURLToPath, URL } from "node:url"; // The viewer is served as static files by a stdlib Python server on an // arbitrary ephemeral port, so all asset URLs must be relative (base: "./"). -// The build output is committed at strix/viewer/viewer_dist and shipped. +// The build output is committed at strix/viewer/static and shipped. export default defineConfig({ base: "./", plugins: [react(), tailwindcss()], @@ -15,7 +15,7 @@ export default defineConfig({ }, }, build: { - outDir: "../viewer/viewer_dist", + outDir: "../static", emptyOutDir: true, }, }); diff --git a/strix/viewer/server.py b/strix/viewer/server.py index 1a4e647e..e1a8285a 100644 --- a/strix/viewer/server.py +++ b/strix/viewer/server.py @@ -47,7 +47,7 @@ logger = logging.getLogger(__name__) def bundle_dir() -> Path: """Directory holding the committed, prebuilt SPA (index.html + assets).""" - return Path(__file__).resolve().parent / "viewer_dist" + return Path(__file__).resolve().parent / "static" def bundle_is_built() -> bool: diff --git a/strix/viewer/viewer_dist/assets/index-B_UeT2c7.js b/strix/viewer/static/assets/index-B_UeT2c7.js similarity index 100% rename from strix/viewer/viewer_dist/assets/index-B_UeT2c7.js rename to strix/viewer/static/assets/index-B_UeT2c7.js diff --git a/strix/viewer/viewer_dist/assets/index-C0NveaV7.css b/strix/viewer/static/assets/index-C0NveaV7.css similarity index 100% rename from strix/viewer/viewer_dist/assets/index-C0NveaV7.css rename to strix/viewer/static/assets/index-C0NveaV7.css diff --git a/strix/viewer/viewer_dist/index.html b/strix/viewer/static/index.html similarity index 100% rename from strix/viewer/viewer_dist/index.html rename to strix/viewer/static/index.html diff --git a/strix/viewer_src/public/logo.png b/strix/viewer/static/logo.png similarity index 100% rename from strix/viewer_src/public/logo.png rename to strix/viewer/static/logo.png