@clawplays/ospec-cli 0.3.3 → 0.3.4
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.
- package/README.md +5 -1
- package/assets/for-ai/ar/ai-guide.md +55 -0
- package/assets/for-ai/ar/execution-protocol.md +44 -0
- package/assets/for-ai/ja-JP/ai-guide.md +55 -0
- package/assets/for-ai/ja-JP/execution-protocol.md +44 -0
- package/assets/project-conventions/ar/development-guide.md +31 -0
- package/assets/project-conventions/ar/naming-conventions.md +37 -0
- package/assets/project-conventions/ar/skill-conventions.md +33 -0
- package/assets/project-conventions/ar/workflow-conventions.md +40 -0
- package/assets/project-conventions/ja-JP/development-guide.md +31 -0
- package/assets/project-conventions/ja-JP/naming-conventions.md +45 -0
- package/assets/project-conventions/ja-JP/skill-conventions.md +33 -0
- package/assets/project-conventions/ja-JP/workflow-conventions.md +40 -0
- package/dist/cli.js +2 -2
- package/dist/commands/NewCommand.js +39 -8
- package/dist/core/types.d.ts +1 -0
- package/dist/presets/ProjectPresets.d.ts +2 -2
- package/dist/presets/ProjectPresets.js +195 -69
- package/dist/services/ConfigManager.js +6 -0
- package/dist/services/ProjectAssetRegistry.d.ts +2 -2
- package/dist/services/ProjectAssetRegistry.js +12 -0
- package/dist/services/ProjectAssetService.js +7 -1
- package/dist/services/ProjectScaffoldCommandService.js +55 -21
- package/dist/services/ProjectScaffoldService.js +108 -12
- package/dist/services/ProjectService.js +229 -558
- package/dist/services/templates/ExecutionTemplateBuilder.js +235 -9
- package/dist/services/templates/ProjectTemplateBuilder.js +878 -276
- package/dist/services/templates/TemplateBuilderBase.d.ts +2 -2
- package/dist/services/templates/TemplateBuilderBase.js +12 -3
- package/dist/services/templates/TemplateInputFactory.js +102 -47
- package/dist/services/templates/templateTypes.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,21 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getProjectPresetFirstChangeSuggestion = exports.inferProjectPresetFromDescription = exports.getLocalizedProjectPresetContent = exports.getProjectPresetById = exports.PROJECT_PRESETS = void 0;
|
|
4
|
-
|
|
5
|
-
{
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
description: 'Marketing website with docs center, blog or changelog, admin content management, and auth.',
|
|
9
|
-
recommendedMode: 'full',
|
|
10
|
-
recommendedTechStack: ['Next.js', 'TypeScript', 'Tailwind CSS', 'Node.js'],
|
|
11
|
-
architecture: 'Use a web/documentation/content architecture with a dedicated admin surface and shared auth boundaries.',
|
|
12
|
-
modules: ['web', 'docs', 'content', 'admin', 'auth'],
|
|
13
|
-
apiAreas: ['content api', 'auth api', 'admin api'],
|
|
14
|
-
designDocs: ['ui information architecture', 'content model', 'cms workflow'],
|
|
15
|
-
planningDocs: ['delivery plan', 'launch checklist'],
|
|
16
|
-
keywords: ['官网', 'website', 'official site', 'docs', 'documentation', 'blog', 'changelog', 'cms'],
|
|
17
|
-
buildFirstChangeSuggestion: (language, projectName) => language === 'zh-CN'
|
|
18
|
-
? {
|
|
4
|
+
const buildOfficialSiteSuggestion = (language, projectName) => {
|
|
5
|
+
switch (language) {
|
|
6
|
+
case 'zh-CN':
|
|
7
|
+
return {
|
|
19
8
|
name: 'launch-official-site-foundation',
|
|
20
9
|
background: `${projectName} 已完成初始框架搭建,下一步需要把官网首页、文档入口、内容流和后台入口串成第一版可演示链路。`,
|
|
21
10
|
goals: [
|
|
@@ -32,8 +21,47 @@ exports.PROJECT_PRESETS = [
|
|
|
32
21
|
],
|
|
33
22
|
affects: ['web', 'docs', 'content', 'admin', 'auth'],
|
|
34
23
|
flags: ['multi_file_change'],
|
|
35
|
-
}
|
|
36
|
-
|
|
24
|
+
};
|
|
25
|
+
case 'ja-JP':
|
|
26
|
+
return {
|
|
27
|
+
name: 'launch-official-site-foundation',
|
|
28
|
+
background: `${projectName} の初期骨格は整いました。次の change では、ホームページ、docs 導線、コンテンツフロー、admin 入口を最初の実演可能な縦スライスとして接続する必要があります。`,
|
|
29
|
+
goals: [
|
|
30
|
+
'ホーム、docs、blog、admin、login をまたぐ主要ナビゲーションを接続する',
|
|
31
|
+
'公式サイト向けの最初の content / admin 境界を定義する',
|
|
32
|
+
'最初の change を公式サイト MVP の具体的な実装単位にする',
|
|
33
|
+
],
|
|
34
|
+
inScope: ['web', 'docs', 'content', 'admin', 'auth'],
|
|
35
|
+
outOfScope: ['高度な RBAC', '本番向け CMS 連携', '完全な多言語コンテンツ基盤'],
|
|
36
|
+
acceptanceCriteria: [
|
|
37
|
+
'ホームから docs、blog、admin、login へ遷移できる',
|
|
38
|
+
'docs / blog / admin ページにプレースホルダー構造とモジュール意図がある',
|
|
39
|
+
'proposal / tasks / verification が公式サイト MVP 範囲を明確にカバーする',
|
|
40
|
+
],
|
|
41
|
+
affects: ['web', 'docs', 'content', 'admin', 'auth'],
|
|
42
|
+
flags: ['multi_file_change'],
|
|
43
|
+
};
|
|
44
|
+
case 'ar':
|
|
45
|
+
return {
|
|
46
|
+
name: 'launch-official-site-foundation',
|
|
47
|
+
background: `أصبح لدى ${projectName} هيكل أولي جاهز. يجب أن يربط التغيير التالي بين الصفحة الرئيسية ومدخل docs وتدفق المحتوى ومدخل الإدارة ليشكّل أول شريحة عمودية قابلة للعرض.`,
|
|
48
|
+
goals: [
|
|
49
|
+
'ربط التنقل الرئيسي بين الصفحة الرئيسية وdocs والمدونة والإدارة وتسجيل الدخول',
|
|
50
|
+
'تحديد أول حدود واضحة بين content وadmin للموقع الرسمي',
|
|
51
|
+
'تحويل أول change إلى شريحة تنفيذية واضحة لـ MVP الموقع الرسمي',
|
|
52
|
+
],
|
|
53
|
+
inScope: ['web', 'docs', 'content', 'admin', 'auth'],
|
|
54
|
+
outOfScope: ['نماذج صلاحيات معقدة', 'تكامل CMS إنتاجي', 'منظومة محتوى متعددة اللغات كاملة'],
|
|
55
|
+
acceptanceCriteria: [
|
|
56
|
+
'يمكن التنقل من الصفحة الرئيسية إلى docs والمدونة والإدارة وتسجيل الدخول',
|
|
57
|
+
'تحتوي صفحات docs والمدونة والإدارة على هياكل مؤقتة واضحة ونية وحدات مفهومة',
|
|
58
|
+
'تغطي proposal وtasks وverification نطاق MVP الموقع الرسمي بوضوح',
|
|
59
|
+
],
|
|
60
|
+
affects: ['web', 'docs', 'content', 'admin', 'auth'],
|
|
61
|
+
flags: ['multi_file_change'],
|
|
62
|
+
};
|
|
63
|
+
default:
|
|
64
|
+
return {
|
|
37
65
|
name: 'launch-official-site-foundation',
|
|
38
66
|
background: `${projectName} has the initial scaffold in place. The next change should connect the homepage, docs entry, content flow, and admin entry into the first demonstrable vertical slice.`,
|
|
39
67
|
goals: [
|
|
@@ -50,22 +78,13 @@ exports.PROJECT_PRESETS = [
|
|
|
50
78
|
],
|
|
51
79
|
affects: ['web', 'docs', 'content', 'admin', 'auth'],
|
|
52
80
|
flags: ['multi_file_change'],
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
recommendedTechStack: ['Next.js', 'TypeScript', 'Tailwind CSS', 'Node.js'],
|
|
61
|
-
architecture: 'Use a web-first architecture with shared auth/account boundaries and clear API ownership.',
|
|
62
|
-
modules: ['web', 'account', 'auth', 'api'],
|
|
63
|
-
apiAreas: ['auth api', 'user api'],
|
|
64
|
-
designDocs: ['ui information architecture', 'system architecture'],
|
|
65
|
-
planningDocs: ['delivery plan'],
|
|
66
|
-
keywords: ['next.js', 'nextjs', 'react', 'web app', 'web', 'portal'],
|
|
67
|
-
buildFirstChangeSuggestion: (language, projectName) => language === 'zh-CN'
|
|
68
|
-
? {
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
const buildNextjsWebSuggestion = (language, projectName) => {
|
|
85
|
+
switch (language) {
|
|
86
|
+
case 'zh-CN':
|
|
87
|
+
return {
|
|
69
88
|
name: 'establish-web-app-shell',
|
|
70
89
|
background: `${projectName} 已初始化基础 Web App 骨架,下一步需要把首页、账户、登录与基础 API 入口连成第一版产品骨架。`,
|
|
71
90
|
goals: [
|
|
@@ -82,8 +101,47 @@ exports.PROJECT_PRESETS = [
|
|
|
82
101
|
],
|
|
83
102
|
affects: ['web', 'account', 'auth', 'api'],
|
|
84
103
|
flags: ['multi_file_change'],
|
|
85
|
-
}
|
|
86
|
-
|
|
104
|
+
};
|
|
105
|
+
case 'ja-JP':
|
|
106
|
+
return {
|
|
107
|
+
name: 'establish-web-app-shell',
|
|
108
|
+
background: `${projectName} には基本的な Web App の骨格があります。次の change では、ホーム、アカウント画面、ログイン導線、基本 API を接続して最初のプロダクトシェルを作る必要があります。`,
|
|
109
|
+
goals: [
|
|
110
|
+
'ホーム、アカウント、ログインをまたぐ基本ナビゲーションを接続する',
|
|
111
|
+
'auth api と user api の最初の責務境界を定義する',
|
|
112
|
+
'最初の change を継続的に拡張できるプロダクトシェルの節目にする',
|
|
113
|
+
],
|
|
114
|
+
inScope: ['web', 'account', 'auth', 'api'],
|
|
115
|
+
outOfScope: ['決済フロー', '複雑な管理モジュール', '完全な通知システム'],
|
|
116
|
+
acceptanceCriteria: [
|
|
117
|
+
'ホーム、アカウント、ログイン画面へ移動できる',
|
|
118
|
+
'auth api と user api の文書が最初の実装スライスを支えられる',
|
|
119
|
+
'最初の change 文書が初期プロダクトシェルの範囲を明確に示す',
|
|
120
|
+
],
|
|
121
|
+
affects: ['web', 'account', 'auth', 'api'],
|
|
122
|
+
flags: ['multi_file_change'],
|
|
123
|
+
};
|
|
124
|
+
case 'ar':
|
|
125
|
+
return {
|
|
126
|
+
name: 'establish-web-app-shell',
|
|
127
|
+
background: `أصبح لدى ${projectName} هيكل أساسي لتطبيق ويب. يجب أن يربط التغيير التالي بين الصفحة الرئيسية وسطح الحساب وتدفق تسجيل الدخول وواجهة API الأساسية لبناء أول غلاف منتج.`,
|
|
128
|
+
goals: [
|
|
129
|
+
'ربط التنقل الأساسي بين الصفحة الرئيسية والحساب وتسجيل الدخول',
|
|
130
|
+
'تحديد أول حدود مسؤولية بين auth api وuser api',
|
|
131
|
+
'تحويل أول change إلى محطة واضحة لغلاف منتج قابل للتوسع',
|
|
132
|
+
],
|
|
133
|
+
inScope: ['web', 'account', 'auth', 'api'],
|
|
134
|
+
outOfScope: ['المدفوعات', 'وحدات إدارة معقدة', 'أنظمة إشعارات كاملة'],
|
|
135
|
+
acceptanceCriteria: [
|
|
136
|
+
'يمكن الوصول إلى الصفحة الرئيسية والحساب وتسجيل الدخول',
|
|
137
|
+
'وثائق auth api وuser api كافية لشريحة التنفيذ الأولى',
|
|
138
|
+
'تحدد وثائق أول change نطاق غلاف المنتج الأولي بوضوح',
|
|
139
|
+
],
|
|
140
|
+
affects: ['web', 'account', 'auth', 'api'],
|
|
141
|
+
flags: ['multi_file_change'],
|
|
142
|
+
};
|
|
143
|
+
default:
|
|
144
|
+
return {
|
|
87
145
|
name: 'establish-web-app-shell',
|
|
88
146
|
background: `${projectName} now has the base web-app scaffold. The next change should connect the homepage, account surface, login flow, and base API surface into the first product shell.`,
|
|
89
147
|
goals: [
|
|
@@ -100,7 +158,37 @@ exports.PROJECT_PRESETS = [
|
|
|
100
158
|
],
|
|
101
159
|
affects: ['web', 'account', 'auth', 'api'],
|
|
102
160
|
flags: ['multi_file_change'],
|
|
103
|
-
}
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
exports.PROJECT_PRESETS = [
|
|
165
|
+
{
|
|
166
|
+
id: 'official-site',
|
|
167
|
+
name: 'Official Site',
|
|
168
|
+
description: 'Marketing website with docs center, blog or changelog, admin content management, and auth.',
|
|
169
|
+
recommendedMode: 'full',
|
|
170
|
+
recommendedTechStack: ['Next.js', 'TypeScript', 'Tailwind CSS', 'Node.js'],
|
|
171
|
+
architecture: 'Use a web/documentation/content architecture with a dedicated admin surface and shared auth boundaries.',
|
|
172
|
+
modules: ['web', 'docs', 'content', 'admin', 'auth'],
|
|
173
|
+
apiAreas: ['content api', 'auth api', 'admin api'],
|
|
174
|
+
designDocs: ['ui information architecture', 'content model', 'cms workflow'],
|
|
175
|
+
planningDocs: ['delivery plan', 'launch checklist'],
|
|
176
|
+
keywords: ['官网', 'website', 'official site', 'docs', 'documentation', 'blog', 'changelog', 'cms', '公式サイト', 'ドキュメント', 'ブログ', '変更履歴', 'موقع', 'توثيق', 'مدونة', 'سجل التغييرات'],
|
|
177
|
+
buildFirstChangeSuggestion: buildOfficialSiteSuggestion,
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
id: 'nextjs-web',
|
|
181
|
+
name: 'Next.js Web App',
|
|
182
|
+
description: 'General-purpose Next.js web product with web, account, and API surfaces.',
|
|
183
|
+
recommendedMode: 'standard',
|
|
184
|
+
recommendedTechStack: ['Next.js', 'TypeScript', 'Tailwind CSS', 'Node.js'],
|
|
185
|
+
architecture: 'Use a web-first architecture with shared auth/account boundaries and clear API ownership.',
|
|
186
|
+
modules: ['web', 'account', 'auth', 'api'],
|
|
187
|
+
apiAreas: ['auth api', 'user api'],
|
|
188
|
+
designDocs: ['ui information architecture', 'system architecture'],
|
|
189
|
+
planningDocs: ['delivery plan'],
|
|
190
|
+
keywords: ['next.js', 'nextjs', 'react', 'web app', 'web', 'portal', 'ウェブアプリ', 'ポータル', 'تطبيق ويب', 'بوابة'],
|
|
191
|
+
buildFirstChangeSuggestion: buildNextjsWebSuggestion,
|
|
104
192
|
},
|
|
105
193
|
];
|
|
106
194
|
const getProjectPresetById = (presetId) => exports.PROJECT_PRESETS.find(preset => preset.id === presetId);
|
|
@@ -110,38 +198,76 @@ const getLocalizedProjectPresetContent = (presetId, language) => {
|
|
|
110
198
|
return null;
|
|
111
199
|
}
|
|
112
200
|
if (presetId === 'official-site') {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
201
|
+
switch (language) {
|
|
202
|
+
case 'zh-CN':
|
|
203
|
+
return {
|
|
204
|
+
name: '官网站点',
|
|
205
|
+
description: '用于官网展示、文档中心、博客/更新日志、后台内容管理与鉴权的一体化官网项目。',
|
|
206
|
+
architecture: '采用 web / docs / content 分层,并提供独立 admin 面与共享 auth 边界。',
|
|
207
|
+
designDocs: ['界面信息架构', '内容模型', 'CMS 工作流'],
|
|
208
|
+
planningDocs: ['交付计划', '上线检查清单'],
|
|
209
|
+
};
|
|
210
|
+
case 'ja-JP':
|
|
211
|
+
return {
|
|
212
|
+
name: '公式サイト',
|
|
213
|
+
description: '公式サイト、docs センター、ブログ / 変更履歴、admin コンテンツ管理、auth をまとめた一体型プロジェクト。',
|
|
214
|
+
architecture: 'web / docs / content の分離を基本にし、専用の admin 面と共有 auth 境界を持つ構成を採用します。',
|
|
215
|
+
designDocs: ['UI 情報設計', 'コンテンツモデル', 'CMS ワークフロー'],
|
|
216
|
+
planningDocs: ['配信計画', 'ローンチチェックリスト'],
|
|
217
|
+
};
|
|
218
|
+
case 'ar':
|
|
219
|
+
return {
|
|
220
|
+
name: 'الموقع الرسمي',
|
|
221
|
+
description: 'مشروع موحد للموقع الرسمي مع مركز docs ومدونة أو سجل تغييرات وإدارة محتوى عبر admin مع auth.',
|
|
222
|
+
architecture: 'اعتمد معمارية web / docs / content مع سطح admin مخصص وحدود auth مشتركة.',
|
|
223
|
+
designDocs: ['هيكلة معلومات الواجهة', 'نموذج المحتوى', 'سير عمل CMS'],
|
|
224
|
+
planningDocs: ['خطة التسليم', 'قائمة فحص الإطلاق'],
|
|
225
|
+
};
|
|
226
|
+
default:
|
|
227
|
+
return {
|
|
228
|
+
name: 'Official Site',
|
|
229
|
+
description: 'Marketing website with docs center, blog or changelog, admin content management, and auth.',
|
|
230
|
+
architecture: 'Use a web/documentation/content architecture with a dedicated admin surface and shared auth boundaries.',
|
|
231
|
+
designDocs: ['ui information architecture', 'content model', 'cms workflow'],
|
|
232
|
+
planningDocs: ['delivery plan', 'launch checklist'],
|
|
233
|
+
};
|
|
234
|
+
}
|
|
128
235
|
}
|
|
129
236
|
if (presetId === 'nextjs-web') {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
237
|
+
switch (language) {
|
|
238
|
+
case 'zh-CN':
|
|
239
|
+
return {
|
|
240
|
+
name: 'Next.js Web 应用',
|
|
241
|
+
description: '适用于标准 Web 产品的 Next.js 项目骨架,内置 web、account、auth 与 API 边界。',
|
|
242
|
+
architecture: '采用以 web 为中心的架构,并保持 account / auth / api 的清晰职责边界。',
|
|
243
|
+
designDocs: ['界面信息架构', '系统架构'],
|
|
244
|
+
planningDocs: ['交付计划'],
|
|
245
|
+
};
|
|
246
|
+
case 'ja-JP':
|
|
247
|
+
return {
|
|
248
|
+
name: 'Next.js Web アプリ',
|
|
249
|
+
description: 'web、account、auth、API の境界を備えた汎用的な Next.js Web プロダクト用の初期構成です。',
|
|
250
|
+
architecture: 'web を中心にしつつ、auth / account の共有境界と明確な API 所有権を持つ構成を採用します。',
|
|
251
|
+
designDocs: ['UI 情報設計', 'システムアーキテクチャ'],
|
|
252
|
+
planningDocs: ['配信計画'],
|
|
253
|
+
};
|
|
254
|
+
case 'ar':
|
|
255
|
+
return {
|
|
256
|
+
name: 'تطبيق ويب Next.js',
|
|
257
|
+
description: 'هيكل مشروع Next.js عام لمنتج ويب مع أسطح web وaccount وAPI وحدود واضحة.',
|
|
258
|
+
architecture: 'اعتمد معمارية تتمحور حول web مع حدود auth/account مشتركة وملكية API واضحة.',
|
|
259
|
+
designDocs: ['هيكلة معلومات الواجهة', 'معمارية النظام'],
|
|
260
|
+
planningDocs: ['خطة التسليم'],
|
|
261
|
+
};
|
|
262
|
+
default:
|
|
263
|
+
return {
|
|
264
|
+
name: 'Next.js Web App',
|
|
265
|
+
description: 'General-purpose Next.js web product with web, account, and API surfaces.',
|
|
266
|
+
architecture: 'Use a web-first architecture with shared auth/account boundaries and clear API ownership.',
|
|
267
|
+
designDocs: ['ui information architecture', 'system architecture'],
|
|
268
|
+
planningDocs: ['delivery plan'],
|
|
269
|
+
};
|
|
270
|
+
}
|
|
145
271
|
}
|
|
146
272
|
return null;
|
|
147
273
|
};
|
|
@@ -152,10 +278,10 @@ const inferProjectPresetFromDescription = (description) => {
|
|
|
152
278
|
const matchedKeywords = preset.keywords.filter(keyword => normalized.includes(keyword.toLowerCase()));
|
|
153
279
|
const weightedScore = matchedKeywords.reduce((score, keyword) => {
|
|
154
280
|
const normalizedKeyword = keyword.toLowerCase();
|
|
155
|
-
if (['官网', 'official site', 'website', 'docs', 'documentation', 'blog', 'changelog', 'cms'].includes(normalizedKeyword)) {
|
|
281
|
+
if (['官网', 'official site', 'website', 'docs', 'documentation', 'blog', 'changelog', 'cms', '公式サイト', 'ドキュメント', 'ブログ', '変更履歴', 'موقع', 'توثيق', 'مدونة', 'سجل التغييرات'].includes(normalizedKeyword)) {
|
|
156
282
|
return score + 3;
|
|
157
283
|
}
|
|
158
|
-
if (['next.js', 'nextjs', 'react', 'web app', 'portal'].includes(normalizedKeyword)) {
|
|
284
|
+
if (['next.js', 'nextjs', 'react', 'web app', 'portal', 'ウェブアプリ', 'ポータル', 'تطبيق ويب', 'بوابة'].includes(normalizedKeyword)) {
|
|
159
285
|
return score + 2;
|
|
160
286
|
}
|
|
161
287
|
return score + 1;
|
|
@@ -187,4 +313,4 @@ const getProjectPresetFirstChangeSuggestion = (presetId, language, projectName)
|
|
|
187
313
|
return preset.buildFirstChangeSuggestion(language, projectName);
|
|
188
314
|
};
|
|
189
315
|
exports.getProjectPresetFirstChangeSuggestion = getProjectPresetFirstChangeSuggestion;
|
|
190
|
-
//# sourceMappingURL=ProjectPresets.js.map
|
|
316
|
+
//# sourceMappingURL=ProjectPresets.js.map
|
|
@@ -91,6 +91,11 @@ class ConfigManager {
|
|
|
91
91
|
checkpoint: PluginWorkflowComposer_1.DEFAULT_CHECKPOINT_PLUGIN_CONFIG,
|
|
92
92
|
}));
|
|
93
93
|
}
|
|
94
|
+
normalizeDocumentLanguage(input) {
|
|
95
|
+
return input === 'en-US' || input === 'zh-CN' || input === 'ja-JP' || input === 'ar'
|
|
96
|
+
? input
|
|
97
|
+
: undefined;
|
|
98
|
+
}
|
|
94
99
|
normalizePluginsConfig(plugins) {
|
|
95
100
|
const defaults = this.createDefaultPluginsConfig();
|
|
96
101
|
const stitch = plugins?.stitch && typeof plugins.stitch === 'object' ? plugins.stitch : {};
|
|
@@ -364,6 +369,7 @@ class ConfigManager {
|
|
|
364
369
|
...config,
|
|
365
370
|
version: config.version === '3.0' ? '4.0' : config.version,
|
|
366
371
|
mode,
|
|
372
|
+
documentLanguage: this.normalizeDocumentLanguage(config.documentLanguage),
|
|
367
373
|
hooks: {
|
|
368
374
|
...normalizedHooks,
|
|
369
375
|
...(legacyWarnDefaults
|
|
@@ -5,8 +5,8 @@ export interface DirectCopyProjectAssetDefinition {
|
|
|
5
5
|
description: string;
|
|
6
6
|
targetRelativePath: string;
|
|
7
7
|
overwritePolicy: 'if_missing';
|
|
8
|
-
localizedSources?: Partial<Record<'zh-CN' | 'en-US', string>>;
|
|
8
|
+
localizedSources?: Partial<Record<'zh-CN' | 'en-US' | 'ja-JP' | 'ar', string>>;
|
|
9
9
|
sourceRelativePaths?: string[];
|
|
10
10
|
}
|
|
11
11
|
export declare const DIRECT_COPY_PROJECT_ASSETS: DirectCopyProjectAssetDefinition[];
|
|
12
|
-
//# sourceMappingURL=ProjectAssetRegistry.d.ts.map
|
|
12
|
+
//# sourceMappingURL=ProjectAssetRegistry.d.ts.map
|
|
@@ -11,6 +11,8 @@ exports.DIRECT_COPY_PROJECT_ASSETS = [
|
|
|
11
11
|
localizedSources: {
|
|
12
12
|
'zh-CN': 'assets/for-ai/zh-CN/ai-guide.md',
|
|
13
13
|
'en-US': 'assets/for-ai/en-US/ai-guide.md',
|
|
14
|
+
'ja-JP': 'assets/for-ai/ja-JP/ai-guide.md',
|
|
15
|
+
'ar': 'assets/for-ai/ar/ai-guide.md',
|
|
14
16
|
},
|
|
15
17
|
},
|
|
16
18
|
{
|
|
@@ -22,6 +24,8 @@ exports.DIRECT_COPY_PROJECT_ASSETS = [
|
|
|
22
24
|
localizedSources: {
|
|
23
25
|
'zh-CN': 'assets/for-ai/zh-CN/execution-protocol.md',
|
|
24
26
|
'en-US': 'assets/for-ai/en-US/execution-protocol.md',
|
|
27
|
+
'ja-JP': 'assets/for-ai/ja-JP/execution-protocol.md',
|
|
28
|
+
'ar': 'assets/for-ai/ar/execution-protocol.md',
|
|
25
29
|
},
|
|
26
30
|
},
|
|
27
31
|
{
|
|
@@ -41,6 +45,8 @@ exports.DIRECT_COPY_PROJECT_ASSETS = [
|
|
|
41
45
|
localizedSources: {
|
|
42
46
|
'zh-CN': 'assets/project-conventions/zh-CN/naming-conventions.md',
|
|
43
47
|
'en-US': 'assets/project-conventions/en-US/naming-conventions.md',
|
|
48
|
+
'ja-JP': 'assets/project-conventions/ja-JP/naming-conventions.md',
|
|
49
|
+
'ar': 'assets/project-conventions/ar/naming-conventions.md',
|
|
44
50
|
},
|
|
45
51
|
},
|
|
46
52
|
{
|
|
@@ -52,6 +58,8 @@ exports.DIRECT_COPY_PROJECT_ASSETS = [
|
|
|
52
58
|
localizedSources: {
|
|
53
59
|
'zh-CN': 'assets/project-conventions/zh-CN/skill-conventions.md',
|
|
54
60
|
'en-US': 'assets/project-conventions/en-US/skill-conventions.md',
|
|
61
|
+
'ja-JP': 'assets/project-conventions/ja-JP/skill-conventions.md',
|
|
62
|
+
'ar': 'assets/project-conventions/ar/skill-conventions.md',
|
|
55
63
|
},
|
|
56
64
|
},
|
|
57
65
|
{
|
|
@@ -63,6 +71,8 @@ exports.DIRECT_COPY_PROJECT_ASSETS = [
|
|
|
63
71
|
localizedSources: {
|
|
64
72
|
'zh-CN': 'assets/project-conventions/zh-CN/development-guide.md',
|
|
65
73
|
'en-US': 'assets/project-conventions/en-US/development-guide.md',
|
|
74
|
+
'ja-JP': 'assets/project-conventions/ja-JP/development-guide.md',
|
|
75
|
+
'ar': 'assets/project-conventions/ar/development-guide.md',
|
|
66
76
|
},
|
|
67
77
|
},
|
|
68
78
|
{
|
|
@@ -74,6 +84,8 @@ exports.DIRECT_COPY_PROJECT_ASSETS = [
|
|
|
74
84
|
localizedSources: {
|
|
75
85
|
'zh-CN': 'assets/project-conventions/zh-CN/workflow-conventions.md',
|
|
76
86
|
'en-US': 'assets/project-conventions/en-US/workflow-conventions.md',
|
|
87
|
+
'ja-JP': 'assets/project-conventions/ja-JP/workflow-conventions.md',
|
|
88
|
+
'ar': 'assets/project-conventions/ar/workflow-conventions.md',
|
|
77
89
|
},
|
|
78
90
|
},
|
|
79
91
|
{
|
|
@@ -164,7 +164,7 @@ class ProjectAssetService {
|
|
|
164
164
|
const manifest = {
|
|
165
165
|
version: '1.0',
|
|
166
166
|
generatedAt: new Date().toISOString(),
|
|
167
|
-
documentLanguage: options.documentLanguage || '
|
|
167
|
+
documentLanguage: options.documentLanguage || 'en-US',
|
|
168
168
|
assets,
|
|
169
169
|
summary: {
|
|
170
170
|
directCopy: copyEntries.length,
|
|
@@ -179,6 +179,9 @@ class ProjectAssetService {
|
|
|
179
179
|
if (documentLanguage && asset.localizedSources?.[documentLanguage]) {
|
|
180
180
|
candidates.push(asset.localizedSources[documentLanguage]);
|
|
181
181
|
}
|
|
182
|
+
if (asset.localizedSources?.['en-US']) {
|
|
183
|
+
candidates.push(asset.localizedSources['en-US']);
|
|
184
|
+
}
|
|
182
185
|
if (asset.localizedSources?.['zh-CN']) {
|
|
183
186
|
candidates.push(asset.localizedSources['zh-CN']);
|
|
184
187
|
}
|
|
@@ -197,6 +200,9 @@ class ProjectAssetService {
|
|
|
197
200
|
if (documentLanguage && asset.localizedSources?.[documentLanguage]) {
|
|
198
201
|
return asset.localizedSources[documentLanguage];
|
|
199
202
|
}
|
|
203
|
+
if (asset.localizedSources?.['en-US']) {
|
|
204
|
+
return asset.localizedSources['en-US'];
|
|
205
|
+
}
|
|
200
206
|
if (asset.localizedSources?.['zh-CN']) {
|
|
201
207
|
return asset.localizedSources['zh-CN'];
|
|
202
208
|
}
|
|
@@ -16,27 +16,22 @@ class ProjectScaffoldCommandService {
|
|
|
16
16
|
return null;
|
|
17
17
|
}
|
|
18
18
|
const installRunner = this.resolvePackageManagerRunner('npm');
|
|
19
|
+
const copy = this.getLocalizedCopy(normalized.documentLanguage);
|
|
19
20
|
return {
|
|
20
21
|
presetId: scaffoldPlan.presetId,
|
|
21
22
|
autoExecute: normalized.executeScaffoldCommands,
|
|
22
23
|
steps: [
|
|
23
24
|
{
|
|
24
25
|
id: 'install-dependencies',
|
|
25
|
-
title:
|
|
26
|
-
? '安装框架依赖'
|
|
27
|
-
: 'Install framework dependencies',
|
|
26
|
+
title: copy.installTitle,
|
|
28
27
|
command: installRunner,
|
|
29
28
|
args: ['install'],
|
|
30
29
|
shellCommand: 'npm install',
|
|
31
|
-
description:
|
|
32
|
-
? '安装脚手架依赖,让生成的应用可以直接运行。'
|
|
33
|
-
: 'Install scaffold dependencies so the generated app can run immediately.',
|
|
30
|
+
description: copy.installDescription,
|
|
34
31
|
phase: 'install',
|
|
35
32
|
},
|
|
36
33
|
],
|
|
37
|
-
deferredMessage:
|
|
38
|
-
? '脚手架命令已生成但暂未执行。准备好后请在项目根目录运行 npm install。'
|
|
39
|
-
: 'Scaffold commands are prepared but deferred. Run npm install in the project root when you are ready.',
|
|
34
|
+
deferredMessage: copy.deferredMessage,
|
|
40
35
|
};
|
|
41
36
|
}
|
|
42
37
|
async executePlan(rootDir, plan) {
|
|
@@ -67,6 +62,7 @@ class ProjectScaffoldCommandService {
|
|
|
67
62
|
}
|
|
68
63
|
async writeRecoveryRecord(rootDir, input) {
|
|
69
64
|
const recoveryPath = path_1.default.join(rootDir, '.ospec', 'bootstrap-recovery.json');
|
|
65
|
+
const copy = this.getLocalizedCopy(input.normalized.documentLanguage);
|
|
70
66
|
const record = {
|
|
71
67
|
generatedAt: new Date().toISOString(),
|
|
72
68
|
projectPresetId: input.normalized.projectPresetId,
|
|
@@ -82,17 +78,7 @@ class ProjectScaffoldCommandService {
|
|
|
82
78
|
directCopyFiles: input.directCopyCreatedFiles,
|
|
83
79
|
hooks: input.hookInstalledFiles,
|
|
84
80
|
},
|
|
85
|
-
remediation:
|
|
86
|
-
input.normalized.documentLanguage === 'zh-CN'
|
|
87
|
-
? '先检查网络与 npm registry 可用性,再重新执行安装命令。'
|
|
88
|
-
: 'Check network access and npm registry availability, then rerun the install command.',
|
|
89
|
-
input.normalized.documentLanguage === 'zh-CN'
|
|
90
|
-
? '重试前先查看已创建的脚手架文件,确认哪些内容已经生成。'
|
|
91
|
-
: 'Review the created scaffold files before retrying so you know which files were already generated.',
|
|
92
|
-
input.normalized.documentLanguage === 'zh-CN'
|
|
93
|
-
? '修复环境后,可重新执行 bootstrap,或手动执行延后的安装命令。'
|
|
94
|
-
: 'After fixing the environment, rerun bootstrap or manually execute the deferred install command.',
|
|
95
|
-
],
|
|
81
|
+
remediation: copy.remediation,
|
|
96
82
|
};
|
|
97
83
|
await this.fileService.writeJSON(recoveryPath, record);
|
|
98
84
|
return recoveryPath;
|
|
@@ -152,8 +138,56 @@ class ProjectScaffoldCommandService {
|
|
|
152
138
|
}
|
|
153
139
|
return `${normalized.slice(0, 600)}...`;
|
|
154
140
|
}
|
|
141
|
+
getLocalizedCopy(documentLanguage) {
|
|
142
|
+
if (documentLanguage === 'zh-CN') {
|
|
143
|
+
return {
|
|
144
|
+
installTitle: '安装框架依赖',
|
|
145
|
+
installDescription: '安装脚手架依赖,让生成的应用可以直接运行。',
|
|
146
|
+
deferredMessage: '脚手架命令已生成但暂未执行。准备好后请在项目根目录运行 npm install。',
|
|
147
|
+
remediation: [
|
|
148
|
+
'先检查网络与 npm registry 可用性,再重新执行安装命令。',
|
|
149
|
+
'重试前先查看已创建的脚手架文件,确认哪些内容已经生成。',
|
|
150
|
+
'修复环境后,可重新执行 bootstrap,或手动执行延后的安装命令。',
|
|
151
|
+
],
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
if (documentLanguage === 'ja-JP') {
|
|
155
|
+
return {
|
|
156
|
+
installTitle: 'フレームワーク依存関係をインストール',
|
|
157
|
+
installDescription: '生成されたアプリをすぐに動かせるように scaffold の依存関係をインストールします。',
|
|
158
|
+
deferredMessage: 'scaffold コマンドは生成されましたがまだ実行していません。準備ができたらプロジェクトルートで npm install を実行してください。',
|
|
159
|
+
remediation: [
|
|
160
|
+
'まずネットワークと npm registry の利用可否を確認してからインストールを再実行してください。',
|
|
161
|
+
'再試行前に生成済みの scaffold ファイルを確認し、どこまで生成済みか把握してください。',
|
|
162
|
+
'環境を修正した後は bootstrap を再実行するか、保留された install コマンドを手動で実行してください。',
|
|
163
|
+
],
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
if (documentLanguage === 'ar') {
|
|
167
|
+
return {
|
|
168
|
+
installTitle: 'تثبيت اعتماديات الإطار',
|
|
169
|
+
installDescription: 'ثبّت اعتماديات scaffold حتى يعمل التطبيق المولَّد مباشرةً.',
|
|
170
|
+
deferredMessage: 'تم إعداد أوامر scaffold ولكن تم تأجيل تنفيذها. شغّل npm install من جذر المشروع عندما تكون جاهزاً.',
|
|
171
|
+
remediation: [
|
|
172
|
+
'تحقق أولاً من توفر الشبكة وإمكانية الوصول إلى npm registry ثم أعد تنفيذ أمر التثبيت.',
|
|
173
|
+
'راجع ملفات scaffold التي تم إنشاؤها قبل إعادة المحاولة لمعرفة ما الذي تم توليده بالفعل.',
|
|
174
|
+
'بعد إصلاح البيئة، أعد bootstrap أو نفّذ أمر التثبيت المؤجل يدوياً.',
|
|
175
|
+
],
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
return {
|
|
179
|
+
installTitle: 'Install framework dependencies',
|
|
180
|
+
installDescription: 'Install scaffold dependencies so the generated app can run immediately.',
|
|
181
|
+
deferredMessage: 'Scaffold commands are prepared but deferred. Run npm install in the project root when you are ready.',
|
|
182
|
+
remediation: [
|
|
183
|
+
'Check network access and npm registry availability, then rerun the install command.',
|
|
184
|
+
'Review the created scaffold files before retrying so you know which files were already generated.',
|
|
185
|
+
'After fixing the environment, rerun bootstrap or manually execute the deferred install command.',
|
|
186
|
+
],
|
|
187
|
+
};
|
|
188
|
+
}
|
|
155
189
|
}
|
|
156
190
|
exports.ProjectScaffoldCommandService = ProjectScaffoldCommandService;
|
|
157
191
|
const createProjectScaffoldCommandService = (fileService, logger) => new ProjectScaffoldCommandService(fileService, logger);
|
|
158
192
|
exports.createProjectScaffoldCommandService = createProjectScaffoldCommandService;
|
|
159
|
-
//# sourceMappingURL=ProjectScaffoldCommandService.js.map
|
|
193
|
+
//# sourceMappingURL=ProjectScaffoldCommandService.js.map
|