@xfe-repo/cli-presets 2.0.1

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.
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @xfe-repo/cli-presets - 项目类型预设
3
+ *
4
+ * 使用专属的项目类型插件(plugin-web / plugin-bff / plugin-mini)搭配
5
+ * plugin-project(能力层)来组合项目定义,替代原先单一 runnerPlugin 承担一切的方案。
6
+ */
7
+ import type { ProjectDefinition } from '@xfe-repo/cli-core';
8
+ export declare const saasDashboard: ProjectDefinition;
9
+ export declare const saasPlatform: ProjectDefinition;
10
+ export declare const saasBff: ProjectDefinition;
11
+ export declare const saasMini: ProjectDefinition;
12
+ export declare const zhiyaoErp: ProjectDefinition;
13
+ export declare const jarvisWeb: ProjectDefinition;
14
+ /** 所有预设项目定义 */
15
+ export declare const allPresets: ProjectDefinition[];
16
+ /** 注册所有预设到全局注册表 */
17
+ export declare function registerAllPresets(register: (definition: ProjectDefinition) => void): void;
18
+ //# sourceMappingURL=index.d.ts.map
package/dist/index.js ADDED
@@ -0,0 +1,122 @@
1
+ /**
2
+ * @xfe-repo/cli-presets - 项目类型预设
3
+ *
4
+ * 使用专属的项目类型插件(plugin-web / plugin-bff / plugin-mini)搭配
5
+ * plugin-project(能力层)来组合项目定义,替代原先单一 runnerPlugin 承担一切的方案。
6
+ */
7
+ import { gitPlugin } from '@xfe-repo/cli-plugin-git';
8
+ import { pkgPlugin } from '@xfe-repo/cli-plugin-pkg';
9
+ import { projectPlugin } from '@xfe-repo/cli-plugin-project';
10
+ import { webProjectPlugin } from '@xfe-repo/cli-plugin-project-web';
11
+ import { bffProjectPlugin } from '@xfe-repo/cli-plugin-project-bff';
12
+ import { miniProjectPlugin } from '@xfe-repo/cli-plugin-project-mini';
13
+ import { servicePlugin } from '@xfe-repo/cli-plugin-service';
14
+ import { updatePlugin } from '@xfe-repo/cli-plugin-update';
15
+ import { aiRulesPlugin } from '@xfe-repo/cli-plugin-ai-rules';
16
+ import { aiMcpPlugin } from '@xfe-repo/cli-plugin-ai-mcp';
17
+ // ============================================================
18
+ // 项目模板工厂
19
+ // ============================================================
20
+ /** Web 前端项目 */
21
+ function createWebProject(config) {
22
+ return {
23
+ name: config.name,
24
+ aliases: config.aliases,
25
+ description: config.description,
26
+ plugins: [
27
+ gitPlugin({ gitPath: config.gitPath }),
28
+ pkgPlugin(),
29
+ projectPlugin(),
30
+ webProjectPlugin({ businessList: config.businessList }),
31
+ servicePlugin(),
32
+ updatePlugin(),
33
+ aiRulesPlugin(),
34
+ aiMcpPlugin(),
35
+ ],
36
+ };
37
+ }
38
+ /** BFF 项目 */
39
+ function createBffProject(config) {
40
+ return {
41
+ name: config.name,
42
+ aliases: config.aliases,
43
+ description: config.description,
44
+ plugins: [
45
+ gitPlugin({ gitPath: config.gitPath }),
46
+ pkgPlugin(),
47
+ projectPlugin(),
48
+ bffProjectPlugin(),
49
+ servicePlugin(),
50
+ updatePlugin(),
51
+ aiRulesPlugin(),
52
+ aiMcpPlugin(),
53
+ ],
54
+ };
55
+ }
56
+ /** 小程序项目 */
57
+ function createMiniProject(config) {
58
+ return {
59
+ name: config.name,
60
+ aliases: config.aliases,
61
+ description: config.description,
62
+ plugins: [
63
+ gitPlugin({ gitPath: config.gitPath }),
64
+ pkgPlugin(),
65
+ projectPlugin(),
66
+ miniProjectPlugin(),
67
+ servicePlugin(),
68
+ updatePlugin(),
69
+ aiRulesPlugin(),
70
+ aiMcpPlugin(),
71
+ ],
72
+ };
73
+ }
74
+ // ============================================================
75
+ // 项目定义
76
+ // ============================================================
77
+ export const saasDashboard = createWebProject({
78
+ name: 'saas-dashboard',
79
+ description: '易奢堂PC端',
80
+ gitPath: 'http://gitlab.xianghuanji.com/airent-web/saas-dashboard.git',
81
+ businessList: [
82
+ { name: '稍后cookies注入', value: '' },
83
+ { name: '值耀ERP', value: 'erp_pc' },
84
+ { name: '易奢堂平台', value: 'platform_pc' },
85
+ ],
86
+ });
87
+ export const saasPlatform = createWebProject({
88
+ name: 'saas-platform',
89
+ description: '易奢堂平台',
90
+ gitPath: 'http://gitlab.xianghuanji.com/airent-web/saas-platform.git',
91
+ });
92
+ export const saasBff = createBffProject({
93
+ name: 'saas-bff',
94
+ aliases: ['bff-saas'],
95
+ description: '易奢堂BFF',
96
+ gitPath: 'http://gitlab.xianghuanji.com/airent-web/saas-bff.git',
97
+ });
98
+ export const saasMini = createMiniProject({
99
+ name: 'saas-mini',
100
+ aliases: ['mini-saas'],
101
+ description: '易奢堂小程序',
102
+ gitPath: 'http://gitlab.xianghuanji.com/airent-web/saas-mini.git',
103
+ });
104
+ export const zhiyaoErp = createWebProject({
105
+ name: 'zhiyao-erp',
106
+ description: '值耀ERP',
107
+ gitPath: 'http://gitlab.xianghuanji.com/airent-web/zhiyao-erp.git',
108
+ });
109
+ export const jarvisWeb = createWebProject({
110
+ name: 'pc-jarvis',
111
+ description: 'Jarvis PC端',
112
+ gitPath: 'https://gitlab.xianghuanji.com/jarvis2/jarvis-web.git',
113
+ });
114
+ /** 所有预设项目定义 */
115
+ export const allPresets = [saasDashboard, saasPlatform, saasBff, saasMini, zhiyaoErp, jarvisWeb];
116
+ /** 注册所有预设到全局注册表 */
117
+ export function registerAllPresets(register) {
118
+ for (const preset of allPresets) {
119
+ register(preset);
120
+ }
121
+ }
122
+ //# sourceMappingURL=index.js.map
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "@xfe-repo/cli-presets",
3
+ "version": "2.0.1",
4
+ "description": "XFE project type presets",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "dependencies": {
9
+ "@xfe-repo/cli-core": "2.0.1",
10
+ "@xfe-repo/cli-plugin-git": "2.0.0",
11
+ "@xfe-repo/cli-plugin-pkg": "2.0.0",
12
+ "@xfe-repo/cli-plugin-project-web": "2.0.0",
13
+ "@xfe-repo/cli-plugin-project": "2.0.0",
14
+ "@xfe-repo/cli-plugin-project-mini": "2.0.0",
15
+ "@xfe-repo/cli-plugin-project-bff": "2.0.0",
16
+ "@xfe-repo/cli-plugin-update": "2.0.0",
17
+ "@xfe-repo/cli-plugin-ai-mcp": "2.0.0",
18
+ "@xfe-repo/cli-plugin-ai-rules": "2.0.0",
19
+ "@xfe-repo/cli-plugin-service": "2.0.0"
20
+ },
21
+ "devDependencies": {
22
+ "@types/node": "^24.3.0",
23
+ "typescript": "^5.9.2"
24
+ },
25
+ "files": [
26
+ "dist",
27
+ "!dist/**/*.map"
28
+ ],
29
+ "license": "ISC",
30
+ "scripts": {
31
+ "build": "tsc -p tsconfig.json",
32
+ "clean": "rm -rf dist"
33
+ }
34
+ }