@quicksand-cloud/specs
Version:
QuickSand Cloud Specs CLI 工具 - 开发规范配置管理命令行工具,提供项目初始化、配置更新和验证功能
87 lines (73 loc) • 2.36 kB
TypeScript
import z$1, { z } from 'zod';
declare const specsConfigSchema: z.ZodObject<{
oxlint: z.ZodObject<{
enabled: z.ZodDefault<z.ZodBoolean>;
}, z.core.$strip>;
prettier: z.ZodObject<{
enabled: z.ZodDefault<z.ZodBoolean>;
}, z.core.$strip>;
commitlint: z.ZodObject<{
enabled: z.ZodDefault<z.ZodBoolean>;
}, z.core.$strip>;
lintStaged: z.ZodObject<{
enabled: z.ZodDefault<z.ZodBoolean>;
}, z.core.$strip>;
husky: z.ZodObject<{
enabled: z.ZodDefault<z.ZodBoolean>;
}, z.core.$strip>;
typescript: z.ZodObject<{
enabled: z.ZodDefault<z.ZodBoolean>;
}, z.core.$strip>;
}, z.core.$strip>;
declare const specsConfigJsonSchema: z.core.JSONSchema.JSONSchema;
type SpecsConfig = z$1.input<typeof specsConfigSchema>;
type SpecsConfigOutput = z$1.output<typeof specsConfigSchema>;
interface Plugin {
/** 名称 */
name: string;
/** 描述 */
description?: string;
/** 包配置 */
packageConfig?: {
/** 脚本 */
scripts?: Record<string, string>;
/** 开发依赖 */
devDependencies?: Record<string, string>;
/** 对等依赖 */
peerDependencies?: Record<string, string>;
/** 可选依赖 */
optionalDependencies?: Record<string, string>;
/** 依赖 */
dependencies?: Record<string, string>;
/** 配置项 */
config?: Record<string, unknown>;
};
/** 文件输出 */
files?: {
/** 输出路径 */
output: string;
/** 输出文件的内容 */
content: string;
}[];
}
declare class Specs {
#private;
constructor(root: string, plugins: Plugin[], isDevelopment?: boolean);
get packageConfig(): unknown;
get packageJson(): unknown;
/**
* 运行所有任务
*/
run(): Promise<void>;
}
declare const cSpell: Plugin;
declare const git: Plugin;
declare const husky: Plugin;
declare const lintStaged: Plugin;
declare const prettier: Plugin;
declare const typescript: Plugin;
declare const oxlint: Plugin;
declare const commitlint: Plugin;
declare const editorconfig: Plugin;
export { Specs, cSpell, commitlint, editorconfig, git, husky, lintStaged, oxlint, prettier, specsConfigJsonSchema, specsConfigSchema, typescript };
export type { Plugin, SpecsConfig, SpecsConfigOutput };