/** * FeatNPM 项目类型定义 */ export type Framework = "vue" | "react" | "angular"; export type PackageManager = "npm" | "yarn" | "pnpm"; /** * Feature 元数据 */ export interface FeatureMeta { /** * npm 包名称(唯一标识,系统会根据此包名自动安装) */ id: string; desc: string; /** * 分类列表(一个包可能属于多个分类) */ category: string[]; /** * 依赖类型:dev(开发依赖)或 prod(生产依赖) * 默认为 "prod"(生产依赖) */ dependencyType?: "dev" | "prod"; conflicts?: string[]; /** * 框架依赖(表示该包只能在特定框架下使用) */ frameworkDeps?: readonly Framework[]; required?: boolean; github?: string; githubStars?: number; homepage?: string; npmjs?: string; npmDownloads?: number; features?: string[]; installation?: string; usage?: string; } /** * Feature 上下文 */ export interface FeatureContext { projectRoot: string; packageManager: PackageManager; framework: Framework; features: Array<{ id: string; }>; answers?: Record; targetDir?: string; } /** * @deprecated 已废弃,现在完全基于 package.json */ export interface FeatureInfo { id: string; version: string; installedAt: string; dependencies: string[]; files?: string[]; config?: Record; } /** * @deprecated 已废弃,现在完全基于 package.json */ export interface FeaturesConfig { version: string; framework: Framework; packageManager: PackageManager; projectRoot: string; features: Record; } /** * Feature 模块接口 */ export interface FeatureModule { meta: FeatureMeta; apply: (context: FeatureContext) => Promise; remove?: (context: FeatureContext) => Promise; check?: (context: FeatureContext) => Promise<{ canApply: boolean; reason?: string; }>; } export * from "./cli.js"; //# sourceMappingURL=index.d.ts.map