@tianyio/quality-helper
Version:
A comprehensive quality helper tool for project scaffolding and management
137 lines (136 loc) • 5.17 kB
TypeScript
import { DependencyAnalysis, DependencyUpdateStrategy } from '../types.ts';
/**
* Vue 项目依赖配置
* 固定版本,分离运行时和开发时依赖
*/
export declare const RUNTIME_DEPENDENCIES: {
readonly vue: "3.5.18";
readonly 'vue-router': "4.5.1";
readonly pinia: "3.0.3";
readonly '@vueuse/core': "13.9.0";
readonly 'lodash-es': "4.17.21";
readonly axios: "1.12.2";
readonly '@tianyio/fast-util-lib': "latest";
};
export declare const DEV_DEPENDENCIES: {
readonly '@tianyio/quality-helper': "latest";
readonly vite: "7.1.5";
readonly '@vitejs/plugin-vue': "6.0.1";
readonly '@vitejs/plugin-legacy': "7.2.1";
readonly 'vite-plugin-vue-devtools': "8.0.0";
readonly 'vite-plugin-dts': "4.5.4";
readonly '@originjs/vite-plugin-federation': "1.4.1";
readonly 'vite-bundle-analyzer': "1.2.3";
readonly 'vue-tsc': "3.1.1";
readonly typescript: "5.9.2";
readonly '@types/node': "24.3.0";
readonly '@vue/tsconfig': "0.8.1";
readonly eslint: "9.33.0";
readonly '@eslint/js': "9.38.0";
readonly 'eslint-config-prettier': "10.1.8";
readonly 'eslint-plugin-prettier': "5.5.4";
readonly 'eslint-plugin-promise': "7.2.1";
readonly 'eslint-plugin-vue': "10.4.0";
readonly '@typescript-eslint/eslint-plugin': "8.40.0";
readonly '@typescript-eslint/parser': "8.40.0";
readonly 'eslint-plugin-complexity': "^1.0.0";
readonly 'vue-eslint-parser': "10.2.0";
readonly prettier: "3.6.2";
readonly husky: "9.1.7";
readonly 'lint-staged': "16.1.5";
readonly '@commitlint/cli': "19.8.1";
readonly '@commitlint/config-conventional': "19.8.1";
readonly 'unplugin-auto-import': "20.0.0";
readonly 'unplugin-vue-components': "29.0.0";
readonly 'unplugin-icons': "22.3.0";
readonly '@babel/core': "7.28.3";
readonly '@babel/preset-env': "7.28.3";
readonly '@babel/preset-typescript': "7.27.1";
readonly '@babel/plugin-proposal-decorators': "7.28.0";
readonly '@babel/plugin-syntax-dynamic-import': "7.8.3";
readonly '@rollup/plugin-babel': "6.0.4";
readonly '@vue/babel-plugin-jsx': "1.5.0";
readonly 'react-refresh': "0.17.0";
};
export type RuntimeDependency = keyof typeof RUNTIME_DEPENDENCIES;
export type DevDependency = keyof typeof DEV_DEPENDENCIES;
export declare function getRuntimeDependencies(): Record<string, string>;
export declare function getDevDependencies(): Record<string, string>;
export declare function getAllDependencies(): {
dependencies: Record<string, string>;
devDependencies: Record<string, string>;
};
export declare function isDependencySupported(name: string): boolean;
export declare function getDependencyVersion(name: string): string | undefined;
export declare const DEPENDENCY_UPDATE_STRATEGY: {
readonly templatePriority: true;
readonly preserveUserDependencies: true;
readonly syncNewTemplateDependencies: true;
};
export interface CustomDependencyConfig {
customDependencies?: Record<string, string>;
customDevDependencies?: Record<string, string>;
}
/**
* 获取运行时依赖(支持动态版本解析)
* @param resolveVersions 是否解析'latest'版本为具体版本号
* @returns 运行时依赖对象
*/
export declare function getRuntimeDependenciesWithVersionResolution(resolveVersions?: boolean): Promise<Record<string, string>>;
/**
* 获取开发依赖(支持动态版本解析)
* @param resolveVersions 是否解析'latest'版本为具体版本号
* @returns 开发依赖对象
*/
export declare function getDevDependenciesWithVersionResolution(resolveVersions?: boolean): Promise<Record<string, string>>;
/**
* 获取所有依赖(支持动态版本解析)
* @param resolveVersions 是否解析'latest'版本为具体版本号
* @returns 所有依赖对象
*/
export declare function getAllDependenciesWithVersionResolution(resolveVersions?: boolean): Promise<{
dependencies: Record<string, string>;
devDependencies: Record<string, string>;
}>;
/**
* 依赖管理器
*/
export declare class DependencyManager {
private strategy;
private customDependencies?;
private customDevDependencies?;
constructor(strategy?: DependencyUpdateStrategy, customConfig?: CustomDependencyConfig);
/**
* 直接更新项目依赖到推荐版本
* @returns 是否有更新
*/
updateToRecommendedVersions(projectRoot: string): Promise<boolean>;
/**
* 更新依赖组
*/
private updateDependencyGroup;
/**
* 分析项目依赖状态
*/
analyzeDependencies(projectRoot: string): Promise<DependencyAnalysis>;
/**
* 分析依赖组
*/
private analyzeDepGroup;
/**
* 生成依赖报告
*/
generateReport(analysis: DependencyAnalysis): void;
/**
* 检查依赖兼容性
*/
checkCompatibility(analysis: DependencyAnalysis): boolean;
/**
* 提取主版本号
*/
private extractMajorVersion;
}
/**
* 创建默认依赖管理器实例
*/
export declare function createDependencyManager(strategy?: Partial<DependencyUpdateStrategy> | CustomDependencyConfig): DependencyManager;