refactor(ui+skills): split import.ts + primitives.tsx god files
Two more > 400 LOC modules split along responsibility seams. Zero
behavior change — public APIs re-export from the original file paths,
so every consumer import stays working.
| Original | Split into | LOC each |
|---------------------------------------|-------------------------------|----------|
| src/main/skills/import.ts (458) | import (orchestrator) / | 132 |
| | discovery (findSkillMdFiles, | 153 |
| | buildLocalInventory) | |
| | materialize | 24 |
| | import-local | 147 |
| | import-url | 85 |
| src/renderer/components/ui/ | primitives (barrel re-export) | 11 |
| primitives.tsx (419) | Card / Eyebrow / Badge / | 9–59 |
| | Spinner / Panel / Field / | each |
| | Input / Select / TextArea / | |
| | ActionButton / SectionButton | |
`createSkillImporter` still returns `{ importFromSource, importFromGitHub,
importFromLocal, importFromUrl, cleanupSkillFiles, parseGitHubUrl,
findSkillMdFiles, buildLocalInventory }` — every existing consumer
resolves unchanged.
`primitives.tsx` is now a pure barrel re-exporting the 11 primitives.
Consumers can migrate to direct imports (`../ui/Card`) opportunistically
but the barrel path keeps working.
This commit is contained in:
1 parent
dbdec86cdd
commit
00b0e0aaed
17 files changed
+836
-786
No files matched your search
@@ -0,0 +1,27 @@
|
||||
import { type ReactNode } from "react";
|
||||
|
||||
export function Eyebrow({
|
||||
children,
|
||||
tone = "muted",
|
||||
className = "",
|
||||
}: {
|
||||
children: ReactNode;
|
||||
tone?: "muted" | "primary" | "warning" | "destructive" | "success";
|
||||
className?: string;
|
||||
}) {
|
||||
const toneClass =
|
||||
tone === "primary"
|
||||
? "text-primary"
|
||||
: tone === "warning"
|
||||
? "text-warning"
|
||||
: tone === "destructive"
|
||||
? "text-destructive"
|
||||
: tone === "success"
|
||||
? "text-success"
|
||||
: "text-muted-foreground";
|
||||
return (
|
||||
<div className={`text-[11px] font-semibold uppercase tracking-[0.08em] ${toneClass} ${className}`}>
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user