Phase 1A — @repowise/ui extraction (types + scaffold)#118
Closed
RaghavChamadiya wants to merge 4 commits intomainfrom
Closed
Phase 1A — @repowise/ui extraction (types + scaffold)#118RaghavChamadiya wants to merge 4 commits intomainfrom
RaghavChamadiya wants to merge 4 commits intomainfrom
Conversation
Adds packages/types as a workspace package, holding the canonical TypeScript shapes shared between packages/web (OSS) and the hosted frontend (currently frontend/, to become packages/hosted-web in 1B). Modules: graph, git, docs, decisions, dead-code, symbols, chat. ChatArtifact is a discriminated union (KnownChatArtifact + GenericArtifact + isKnownChatArtifact narrowing helper) so 2B's artifact-panel can switch on .type instead of casting Record<string, unknown>. Per-domain canonical decisions: - OSS engine shapes (PipelineResult / SymbolResponse / GitMetadata / DecisionRecordResponse) are canonical for engine-derived data; hosted's looser fields (path vs file_path, bare strings vs literal unions) get reshaped via adapters in 1B. - Hosted-only enrichment fields (DeadCodeFinding.status/note, DecisionRecord.staleness_score, GraphLink.confidence/edge_type) are optional so OSS-shaped artifacts still satisfy the contract. Tests: vitest --typecheck against contracts.test.ts (12 assertions covering narrowing, optional-field invariants, literal unions). Passes clean.
Skeleton only — Phase 1A scope is types extraction + scaffolding; component moves are 1B (per plan §5.3 day 5–7). Sets up: - package.json with subpath exports (graph, git, dead-code, decisions, docs, symbols, coverage, wiki, chat, dashboard, workspace, jobs, shared, hooks, ui) so 1B can drop components into per-domain directories without re-touching the exports map. - React 19 peer dep; @repowise/types as workspace dep. - tsconfig with paths shim so the package resolves @repowise/types from source (no build step needed in dev). - Empty styles/globals.css placeholder; 1B copies the canonical Tailwind v4 @theme tokens out of packages/web. - README documenting layout + consuming pattern.
Collaborator
Author
|
Superseded by a re-opened PR with a corrected base branch and cleaner commit messages. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 1A of the hosted upgrade programme (per
+ "docs/HOSTED_PRODUCT_UPGRADE_PLAN.md" +§5 ++ "docs/HOSTED_IMPLEMENTATION_GUIDE.md" +). Option α confirmed:+ "packages/types" +++ "packages/ui" +live inside the OSS monorepo. Scaffolding only — no component moves; that's 1B.What ships
+ "packages/types" +(new) — canonical TS contracts shared between OSS web (+ "packages/web" +) and the hosted web app (currently+ "frontend/" +, becoming+ "packages/hosted-web/" +in 1B).+ "graph" +,+ "git" +,+ "docs" +,+ "decisions" +,+ "dead-code" +,+ "symbols" +,+ "chat" +— exposed via subpath exports+ "ChatArtifact" +discriminated union (net-new):+ "KnownChatArtifact" +++ "GenericArtifact" +++ "isKnownChatArtifact" +narrowing helper. Lets 2B's+ "chat/artifact-panel.tsx" +switch on+ ".type" +instead of casting+ "Record<string, unknown>" +.+ "vitest --typecheck" +) covering narrowing per variant, optional-field invariants, literal unions,+ "Hotspot.file_path" +invariant.+ "packages/ui" +(new, scaffold only) — empty subpath exports for+ "graph" +/+ "git" +/+ "dead-code" +/+ "decisions" +/+ "docs" +/+ "symbols" +/+ "coverage" +/+ "wiki" +/+ "chat" +/+ "dashboard" +/+ "workspace" +/+ "jobs" +/+ "shared" +/+ "hooks" +/+ "ui" +. React 19 peer dep.+ "@repowise/types" +workspace dep.Root — added
+ "packages/types" +++ "packages/ui" +to npm workspaces; root scripts use+ "--workspaces --if-present" +so each package opts in.+ "docs/HOSTED_PROGRESS.md" +now tracked — dropped from+ ".gitignore" +so phase sessions can update it in-repo.Decisions taken
+ "status" +,+ "note" +,+ "staleness_score" +,+ "edge_type" +,+ "confidence" +) layer in as optional so OSS-shaped artifacts still satisfy the contract.+ "transpilePackages" +; raw TS resolves directly. Add when 1B starts shipping components, OR if a non-Next consumer appears.+ "Symbol" +→+ "CodeSymbol" +to avoid shadowing the JS global.Full close-out (decisions, drift, next-session entry point) is in
+ "docs/HOSTED_PROGRESS.md" +.Out of scope (Phase 1B)
+ "packages/web/src/components/" +and+ "frontend/src/components/demo/" +.+ "frontend/" +→+ "packages/hosted-web/" +rename.+ "@theme" +token set into+ "packages/ui/styles/globals.css" +.+ "transpilePackages: ["@repowise/ui"]" +in either+ "next.config.ts" +.Test plan
+ "npm install" +clean across workspaces+ "tsc --noEmit" +in+ "packages/types" +and+ "packages/ui" +(strict,+ "exactOptionalPropertyTypes" +,+ "noUncheckedIndexedAccess" +)+ "vitest run --typecheck" +in+ "packages/types" +(12/12 pass)+ "packages/web" ++ "type-check" +++ "build" +still pass (no consumer changes in 1A but workspace install touched lockfile)