全部 kit / 程式 kit
blocks-kit
元件收割機 — 跨專案 UI 區塊金庫:harvest 收割元件原始碼進金庫、add 播種到新專案(shadcn 慣例、零依賴 CLI)
版本 v0.1.0 · 更新 2026-11-13
範例
repo 裡的 example.js,整份照登。 在 GitHub 上看
// 最小範例:node example.js — 掃一段元件原始碼的依賴分類
const { scanImports, inferCategory, kebab } = require("./index");
const source = `
import Link from "next/link";
import { Star } from "lucide-react";
import { Button } from "@/components/ui/button";
import { cn } from "@/lib/utils";
import { useTenant } from "@/contexts/TenantContext";
`;
console.log("deps:", scanImports(source));
// → npm: ['lucide-react'], shadcn: ['(lib/utils · cn)', 'button'],
// internal: ['@/contexts/TenantContext'], framework: ['next/link']
console.log("category:", inferCategory("src/components/course/CourseReviewList.tsx")); // → course
console.log("name:", kebab("CourseReviewList.tsx")); // → course-review-list