@matchkit.io/cli 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/pull.js +23 -3
- package/package.json +1 -1
package/dist/commands/pull.js
CHANGED
|
@@ -23,10 +23,25 @@ function buildImportMap(fullSkillDir) {
|
|
|
23
23
|
// Skip non-component entries (layouts, patterns)
|
|
24
24
|
if (comp.type === "registry:layout" || comp.type === "registry:pattern")
|
|
25
25
|
continue;
|
|
26
|
-
|
|
26
|
+
// Strip directory prefix from file path (e.g. "components/button.tsx" → "button")
|
|
27
|
+
const basename = comp.file.replace(/^(components|lib)\//, "").replace(/\.tsx?$/, "");
|
|
27
28
|
const exports = Array.isArray(comp.exportName) ? comp.exportName : [comp.exportName];
|
|
28
29
|
const importStr = `{ ${exports.join(", ")} }`;
|
|
29
|
-
|
|
30
|
+
// Use the registry category to determine the correct import prefix:
|
|
31
|
+
// lib → @/lib/{name} (utils.ts)
|
|
32
|
+
// layout → @/components/layout/{name} (sidebar-nav, top-bar, page-header)
|
|
33
|
+
// ui/chart/other → @/components/ui/{name} (everything else)
|
|
34
|
+
let importPath;
|
|
35
|
+
if (comp.category === "lib") {
|
|
36
|
+
importPath = `@/lib/${basename}`;
|
|
37
|
+
}
|
|
38
|
+
else if (comp.category === "layout") {
|
|
39
|
+
importPath = `@/components/layout/${basename}`;
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
importPath = `@/components/ui/${basename}`;
|
|
43
|
+
}
|
|
44
|
+
lines.push(`| ${comp.name} | \`import ${importStr} from "${importPath}"\` |`);
|
|
30
45
|
}
|
|
31
46
|
if (lines.length === 0)
|
|
32
47
|
return "";
|
|
@@ -62,6 +77,9 @@ A full design system is installed at \`${skillDir}/\`. You MUST use it for ALL U
|
|
|
62
77
|
export function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs)); }
|
|
63
78
|
\`\`\`
|
|
64
79
|
5. **Copy component files** from \`${skillDir}/components/\` to \`src/components/ui/\` as needed
|
|
80
|
+
6. **Copy layout files** from \`${skillDir}/layouts/\` to \`src/components/layout/\` as needed (sidebar-nav, top-bar, page-header)
|
|
81
|
+
7. **Read \`${skillDir}/layouts/app-shell.tsx\`** — reference implementation showing how to compose the app shell
|
|
82
|
+
8. **Read the .tsx source** of any component before using it — the file contains the exact props interface
|
|
65
83
|
|
|
66
84
|
### Rules — follow these at ALL times:
|
|
67
85
|
|
|
@@ -70,8 +88,10 @@ A full design system is installed at \`${skillDir}/\`. You MUST use it for ALL U
|
|
|
70
88
|
- **NEVER** hardcode hex colors, pixel spacing, or font sizes — use CSS variables from \`globals.css\`
|
|
71
89
|
- **NEVER** improvise a component if one already exists in the registry
|
|
72
90
|
- **NEVER** modify files inside \`${skillDir}/\` — it is the upstream source of truth
|
|
73
|
-
- **ALWAYS** use \`@/components/ui/{name}\` import paths for
|
|
91
|
+
- **ALWAYS** use \`@/components/ui/{name}\` import paths for UI components
|
|
92
|
+
- **ALWAYS** use \`@/components/layout/{name}\` import paths for layout components (sidebar-nav, top-bar, page-header)
|
|
74
93
|
- **ALWAYS** use \`@/lib/utils\` for the \`cn()\` helper
|
|
94
|
+
- **ALWAYS** read the component .tsx source to see its props interface before using it — do NOT guess props
|
|
75
95
|
|
|
76
96
|
### Available resources in \`${skillDir}/\`:
|
|
77
97
|
|
package/package.json
CHANGED