mirror of
https://github.com/hanzoai/ui.git
synced 2026-11-21 00:18:41 +00:00
The package was never published under EITHER name — `npm view @hanzo/gitops` and `@hanzo/cd` both returned E404 — so `pkg/ui/src/gitops.ts` (`export * from '@hanzo/gitops'`) and the `>=0.1.0` peer dep pointed at nothing and broke every clean install of @hanzo/ui. Publishing exposed a second break one level down: @hanzo/gitops peers on @hanzo/canvas >=0.2.0, and the registry still had canvas at 0.1.0 while the monorepo was on 0.2.1. Publishing the first package alone only moved the ETARGET deeper. Both are now on the registry, and a clean `npm install @hanzo/[email protected]` resolves — 673 packages, no errors. pkgs/gitops -> pkgs/cd and @hanzo/gitops -> @hanzo/cd: the surface is the CD surface (cd.hanzo.ai, apps/cd), and the old name only ever described the mechanism. Every reference in the monorepo moved with it; the old name is deprecated on npm pointing here rather than left as a second way to install the same code. Co-authored-by: Hanzo Dev <[email protected]>
42 lines
1.8 KiB
TypeScript
42 lines
1.8 KiB
TypeScript
/// <reference types="vitest/config" />
|
|
import { fileURLToPath, URL } from "node:url"
|
|
|
|
import react from "@vitejs/plugin-react"
|
|
import { defineConfig } from "vite"
|
|
|
|
/**
|
|
* Hanzo CD — a static SPA served at cd.hanzo.ai from the shared static plane
|
|
* (s3://cdn/cd, ingress staticFiles/spaMode). `/v1/deploy/*` is peeled off to the
|
|
* cloud binary by the ingress, so in prod the SPA calls same-origin `/v1/deploy`
|
|
* with the `hanzo_iam_token` cookie (cloud validates → SuperAdmin gate).
|
|
*
|
|
* The @hanzo/cd (built dist) + @hanzo/canvas/pure (pure TS source) workspace
|
|
* packages are resolved by path alias so the app builds without a full monorepo
|
|
* install (the shared store lacks the registry deps of the heavier packages). A
|
|
* dev proxy forwards `/v1` to CD_API (default the live cluster) for local dev.
|
|
*/
|
|
const r = (p: string) => fileURLToPath(new URL(p, import.meta.url))
|
|
const CD_API = process.env.CD_API ?? "https://cd.hanzo.ai"
|
|
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
resolve: {
|
|
dedupe: ["react", "react-dom"],
|
|
alias: {
|
|
"@hanzo/cd": r("../../pkgs/gitops/dist/index.mjs"),
|
|
"@hanzo/canvas/pure": r("../../pkgs/canvas/src/pure.ts"),
|
|
},
|
|
},
|
|
// Plain CSS only — override the monorepo-root PostCSS/Tailwind config discovery
|
|
// (this app has no Tailwind; the @hanzo/cd components ship their own scoped CSS).
|
|
css: { postcss: { plugins: [] } },
|
|
build: { outDir: "dist", target: "es2022", sourcemap: false },
|
|
server: {
|
|
port: 4200,
|
|
proxy: { "/v1": { target: CD_API, changeOrigin: true, secure: false } },
|
|
},
|
|
// The e2e/ specs are Playwright's (they use test.beforeAll); vitest must not
|
|
// glob them, or a bare `vitest run` reports a red suite for a passing app.
|
|
test: { exclude: ["e2e/**", "node_modules/**", "dist/**"] },
|
|
})
|