@clawplays/ospec-cli 0.3.7 → 0.3.9
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 +9 -1
- package/SKILL.md +1 -1
- package/assets/git-hooks/post-merge +4 -2
- package/assets/git-hooks/pre-commit +4 -2
- package/dist/advanced/BatchOperations.d.ts +1 -2
- package/dist/advanced/BatchOperations.js +1 -2
- package/dist/advanced/CachingLayer.d.ts +1 -2
- package/dist/advanced/CachingLayer.js +1 -2
- package/dist/advanced/FeatureUpdater.d.ts +1 -2
- package/dist/advanced/FeatureUpdater.js +1 -2
- package/dist/advanced/PerformanceMonitor.d.ts +1 -2
- package/dist/advanced/PerformanceMonitor.js +1 -2
- package/dist/advanced/StatePersistence.d.ts +1 -2
- package/dist/advanced/StatePersistence.js +1 -2
- package/dist/advanced/index.d.ts +1 -2
- package/dist/advanced/index.js +1 -2
- package/dist/cli/commands/config.d.ts +1 -2
- package/dist/cli/commands/config.js +1 -2
- package/dist/cli/commands/feature.d.ts +1 -2
- package/dist/cli/commands/feature.js +1 -2
- package/dist/cli/commands/index.d.ts +1 -2
- package/dist/cli/commands/index.js +1 -2
- package/dist/cli/commands/project.d.ts +1 -2
- package/dist/cli/commands/project.js +1 -2
- package/dist/cli/commands/validate.d.ts +1 -2
- package/dist/cli/commands/validate.js +1 -2
- package/dist/cli/index.d.ts +1 -2
- package/dist/cli/index.js +1 -2
- package/dist/cli.d.ts +1 -2
- package/dist/cli.js +1 -2
- package/dist/commands/ArchiveCommand.d.ts +1 -2
- package/dist/commands/ArchiveCommand.js +1 -1
- package/dist/commands/BaseCommand.d.ts +1 -2
- package/dist/commands/BaseCommand.js +1 -2
- package/dist/commands/BatchCommand.d.ts +1 -2
- package/dist/commands/BatchCommand.js +1 -2
- package/dist/commands/ChangesCommand.js +0 -1
- package/dist/commands/DocsCommand.d.ts +1 -2
- package/dist/commands/DocsCommand.js +0 -1
- package/dist/commands/IndexCommand.d.ts +1 -2
- package/dist/commands/IndexCommand.js +1 -2
- package/dist/commands/InitCommand.d.ts +1 -2
- package/dist/commands/InitCommand.js +0 -1
- package/dist/commands/NewCommand.d.ts +0 -1
- package/dist/commands/NewCommand.js +19 -12
- package/dist/commands/PluginsCommand.d.ts +0 -1
- package/dist/commands/PluginsCommand.js +0 -1
- package/dist/commands/ProgressCommand.d.ts +1 -2
- package/dist/commands/ProgressCommand.js +1 -2
- package/dist/commands/QueueCommand.d.ts +0 -1
- package/dist/commands/QueueCommand.js +0 -1
- package/dist/commands/RunCommand.d.ts +0 -1
- package/dist/commands/RunCommand.js +0 -1
- package/dist/commands/SkillCommand.d.ts +0 -1
- package/dist/commands/SkillCommand.js +1 -2
- package/dist/commands/SkillsCommand.d.ts +1 -2
- package/dist/commands/SkillsCommand.js +1 -2
- package/dist/commands/StatusCommand.d.ts +1 -2
- package/dist/commands/StatusCommand.js +0 -1
- package/dist/commands/UpdateCommand.d.ts +0 -1
- package/dist/commands/UpdateCommand.js +37 -2
- package/dist/commands/VerifyCommand.d.ts +1 -2
- package/dist/commands/VerifyCommand.js +4 -41
- package/dist/commands/WorkflowCommand.d.ts +0 -1
- package/dist/commands/WorkflowCommand.js +0 -1
- package/dist/commands/index.d.ts +0 -1
- package/dist/commands/index.js +0 -1
- package/dist/core/constants.d.ts +1 -2
- package/dist/core/constants.js +1 -2
- package/dist/core/errors.d.ts +1 -2
- package/dist/core/errors.js +1 -2
- package/dist/core/index.d.ts +1 -2
- package/dist/core/index.js +1 -2
- package/dist/core/types.d.ts +0 -1
- package/dist/core/types.js +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.js +1 -2
- package/dist/presets/ProjectPresets.d.ts +0 -1
- package/dist/presets/ProjectPresets.js +0 -1
- package/dist/scaffolds/ProjectScaffoldPresets.d.ts +1 -2
- package/dist/scaffolds/ProjectScaffoldPresets.js +1 -2
- package/dist/services/ConfigManager.d.ts +1 -2
- package/dist/services/ConfigManager.js +0 -1
- package/dist/services/FeatureManager.d.ts +1 -2
- package/dist/services/FeatureManager.js +1 -2
- package/dist/services/FileService.d.ts +1 -2
- package/dist/services/FileService.js +0 -1
- package/dist/services/IndexBuilder.d.ts +1 -2
- package/dist/services/IndexBuilder.js +1 -2
- package/dist/services/Logger.d.ts +1 -2
- package/dist/services/Logger.js +1 -2
- package/dist/services/ProjectAssetRegistry.d.ts +0 -1
- package/dist/services/ProjectAssetRegistry.js +1 -2
- package/dist/services/ProjectAssetService.d.ts +0 -1
- package/dist/services/ProjectAssetService.js +4 -2
- package/dist/services/ProjectScaffoldCommandService.d.ts +1 -2
- package/dist/services/ProjectScaffoldCommandService.js +0 -1
- package/dist/services/ProjectScaffoldService.d.ts +1 -2
- package/dist/services/ProjectScaffoldService.js +0 -1
- package/dist/services/ProjectService.d.ts +1 -1
- package/dist/services/ProjectService.js +267 -411
- package/dist/services/QueueService.d.ts +0 -1
- package/dist/services/QueueService.js +1 -1
- package/dist/services/RunService.d.ts +0 -1
- package/dist/services/RunService.js +0 -1
- package/dist/services/SkillParser.d.ts +1 -2
- package/dist/services/SkillParser.js +0 -1
- package/dist/services/StateManager.d.ts +0 -1
- package/dist/services/StateManager.js +0 -1
- package/dist/services/TemplateEngine.d.ts +1 -2
- package/dist/services/TemplateEngine.js +1 -2
- package/dist/services/TemplateGenerator.d.ts +1 -2
- package/dist/services/TemplateGenerator.js +6 -7
- package/dist/services/ValidationService.d.ts +1 -2
- package/dist/services/ValidationService.js +1 -2
- package/dist/services/Validator.d.ts +1 -2
- package/dist/services/Validator.js +1 -2
- package/dist/services/index.d.ts +0 -1
- package/dist/services/index.js +0 -1
- package/dist/services/templates/ExecutionTemplateBuilder.d.ts +1 -2
- package/dist/services/templates/ExecutionTemplateBuilder.js +52 -29
- package/dist/services/templates/ProjectTemplateBuilder.d.ts +1 -2
- package/dist/services/templates/ProjectTemplateBuilder.js +0 -1
- package/dist/services/templates/TemplateBuilderBase.d.ts +5 -1
- package/dist/services/templates/TemplateBuilderBase.js +31 -3
- package/dist/services/templates/TemplateInputFactory.d.ts +1 -2
- package/dist/services/templates/TemplateInputFactory.js +4 -1
- package/dist/services/templates/templateTypes.d.ts +4 -1
- package/dist/services/templates/templateTypes.js +1 -2
- package/dist/tools/build-index.js +128 -36
- package/dist/utils/DateUtils.d.ts +1 -2
- package/dist/utils/DateUtils.js +1 -2
- package/dist/utils/PathUtils.d.ts +0 -1
- package/dist/utils/PathUtils.js +0 -1
- package/dist/utils/StringUtils.d.ts +1 -2
- package/dist/utils/StringUtils.js +1 -2
- package/dist/utils/helpers.d.ts +0 -1
- package/dist/utils/helpers.js +0 -1
- package/dist/utils/index.d.ts +1 -2
- package/dist/utils/index.js +1 -2
- package/dist/utils/logger.d.ts +1 -2
- package/dist/utils/logger.js +1 -2
- package/dist/utils/path.d.ts +1 -2
- package/dist/utils/path.js +1 -2
- package/dist/utils/subcommandHelp.d.ts +0 -1
- package/dist/utils/subcommandHelp.js +0 -1
- package/dist/workflow/ArchiveGate.d.ts +1 -2
- package/dist/workflow/ArchiveGate.js +1 -2
- package/dist/workflow/ConfigurableWorkflow.d.ts +1 -2
- package/dist/workflow/ConfigurableWorkflow.js +1 -2
- package/dist/workflow/HookSystem.d.ts +1 -2
- package/dist/workflow/HookSystem.js +1 -2
- package/dist/workflow/IndexRegenerator.d.ts +1 -2
- package/dist/workflow/IndexRegenerator.js +1 -2
- package/dist/workflow/PluginWorkflowComposer.d.ts +0 -1
- package/dist/workflow/PluginWorkflowComposer.js +0 -1
- package/dist/workflow/SkillUpdateEngine.d.ts +1 -2
- package/dist/workflow/SkillUpdateEngine.js +1 -2
- package/dist/workflow/VerificationSystem.d.ts +1 -2
- package/dist/workflow/VerificationSystem.js +1 -2
- package/dist/workflow/WorkflowEngine.d.ts +1 -2
- package/dist/workflow/WorkflowEngine.js +1 -2
- package/dist/workflow/index.d.ts +0 -1
- package/dist/workflow/index.js +0 -1
- package/package.json +17 -8
- package/skill.yaml +2 -2
|
@@ -77,6 +77,7 @@ class QueueService {
|
|
|
77
77
|
await this.fileService.writeJSON(statePath, state);
|
|
78
78
|
await this.updateFrontmatterStatus(path_1.default.join(activePath, constants_1.FILE_NAMES.PROPOSAL), 'active');
|
|
79
79
|
await this.updateFrontmatterStatus(path_1.default.join(activePath, constants_1.FILE_NAMES.VERIFICATION), 'verifying');
|
|
80
|
+
await this.projectService.rebaseMovedChangeMarkdownLinks(queuedPath, activePath);
|
|
80
81
|
const item = await this.buildQueuedChangeStatusItem(rootDir, activePath);
|
|
81
82
|
if (!item) {
|
|
82
83
|
throw new Error(`Activated change state could not be read: ${changeName}`);
|
|
@@ -139,4 +140,3 @@ exports.QueueService = QueueService;
|
|
|
139
140
|
function createQueueService(fileService, projectService) {
|
|
140
141
|
return new QueueService(fileService, projectService);
|
|
141
142
|
}
|
|
142
|
-
//# sourceMappingURL=QueueService.js.map
|
|
@@ -39,5 +39,4 @@ export declare class TemplateEngine {
|
|
|
39
39
|
generateExecutionProtocolTemplate(input?: ProjectBootstrapInput): string;
|
|
40
40
|
generateBuildIndexScriptTemplate(): string;
|
|
41
41
|
}
|
|
42
|
-
export declare const templateEngine: TemplateEngine;
|
|
43
|
-
//# sourceMappingURL=TemplateEngine.d.ts.map
|
|
42
|
+
export declare const templateEngine: TemplateEngine;
|
|
@@ -63,20 +63,20 @@ optional_steps: [${optionalSteps.map((s) => `"${s}"`).join(', ')}]
|
|
|
63
63
|
// 添加核心任务
|
|
64
64
|
if (coreRequiredSteps.length > 0) {
|
|
65
65
|
coreRequiredSteps.forEach((step, index) => {
|
|
66
|
-
content += `- [ ] ${
|
|
66
|
+
content += `- [ ] ${step}\n`;
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
69
|
else {
|
|
70
|
-
content += `- [ ]
|
|
71
|
-
content += `- [ ]
|
|
72
|
-
content += `- [ ]
|
|
73
|
-
content += `- [ ]
|
|
70
|
+
content += `- [ ] 实现功能\n`;
|
|
71
|
+
content += `- [ ] 更新文档\n`;
|
|
72
|
+
content += `- [ ] 更新索引\n`;
|
|
73
|
+
content += `- [ ] 运行测试\n`;
|
|
74
74
|
}
|
|
75
75
|
// 添加可选任务
|
|
76
76
|
if (optionalSteps.length > 0) {
|
|
77
77
|
content += `\n### 可选任务\n\n`;
|
|
78
78
|
optionalSteps.forEach((step, index) => {
|
|
79
|
-
content += `- [ ] ${
|
|
79
|
+
content += `- [ ] ${step}\n`;
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
82
|
return content;
|
|
@@ -270,4 +270,3 @@ ospec feature archive my-feature
|
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
272
|
exports.TemplateGenerator = TemplateGenerator;
|
|
273
|
-
//# sourceMappingURL=TemplateGenerator.js.map
|
|
@@ -15,5 +15,4 @@ export declare class ValidationService {
|
|
|
15
15
|
*/
|
|
16
16
|
validateRequiredFields(data: Record<string, any>, fields: string[]): boolean;
|
|
17
17
|
}
|
|
18
|
-
export declare const validationService: ValidationService;
|
|
19
|
-
//# sourceMappingURL=ValidationService.d.ts.map
|
|
18
|
+
export declare const validationService: ValidationService;
|
package/dist/services/index.d.ts
CHANGED
package/dist/services/index.js
CHANGED
|
@@ -8,5 +8,4 @@ export declare class ExecutionTemplateBuilder extends TemplateBuilderBase {
|
|
|
8
8
|
generateTasksTemplate(input: string | FeatureTemplateInput): string;
|
|
9
9
|
generateVerificationTemplate(input: string | FeatureTemplateInput): string;
|
|
10
10
|
generateReviewTemplate(input: string | FeatureTemplateInput): string;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=ExecutionTemplateBuilder.d.ts.map
|
|
11
|
+
}
|
|
@@ -9,6 +9,8 @@ class ExecutionTemplateBuilder extends TemplateBuilderBase_1.TemplateBuilderBase
|
|
|
9
9
|
}
|
|
10
10
|
generateProposalTemplate(input) {
|
|
11
11
|
const context = this.inputs.normalizeFeatureTemplateInput(input);
|
|
12
|
+
this.setReferenceDocumentContext(context.projectRoot, context.documentPath);
|
|
13
|
+
try {
|
|
12
14
|
const created = this.getCurrentDate();
|
|
13
15
|
const projectDocs = context.projectContext.projectDocs ?? [];
|
|
14
16
|
const moduleSkills = context.projectContext.moduleSkills ?? [];
|
|
@@ -156,30 +158,36 @@ ${this.formatChecklist(context.acceptanceCriteria, 'قيد التحديد')}`;
|
|
|
156
158
|
affects: context.affects,
|
|
157
159
|
flags: context.flags,
|
|
158
160
|
}, this.copy(context.documentLanguage, zh, en, ja, ar));
|
|
161
|
+
}
|
|
162
|
+
finally {
|
|
163
|
+
this.clearReferenceDocumentContext();
|
|
164
|
+
}
|
|
159
165
|
}
|
|
160
166
|
generateTasksTemplate(input) {
|
|
161
167
|
const context = this.inputs.normalizeFeatureTemplateInput(input);
|
|
168
|
+
this.setReferenceDocumentContext(context.projectRoot, context.documentPath);
|
|
169
|
+
try {
|
|
162
170
|
const created = this.getCurrentDate();
|
|
163
171
|
const projectDocs = context.projectContext.projectDocs ?? [];
|
|
164
172
|
const moduleSkills = context.projectContext.moduleSkills ?? [];
|
|
165
173
|
const optionalStepTasksZh = context.optionalSteps.length > 0
|
|
166
174
|
? context.optionalSteps
|
|
167
|
-
.map((step
|
|
175
|
+
.map((step) => `- [ ] 完成可选步骤 \`${step}\` 的文档和验证`)
|
|
168
176
|
.join('\n')
|
|
169
177
|
: '';
|
|
170
178
|
const optionalStepTasksEn = context.optionalSteps.length > 0
|
|
171
179
|
? context.optionalSteps
|
|
172
|
-
.map((step
|
|
180
|
+
.map((step) => `- [ ] Finish docs and verification for optional step \`${step}\``)
|
|
173
181
|
.join('\n')
|
|
174
182
|
: '';
|
|
175
183
|
const optionalStepTasksJa = context.optionalSteps.length > 0
|
|
176
184
|
? context.optionalSteps
|
|
177
|
-
.map((step
|
|
185
|
+
.map((step) => `- [ ] オプション手順 \`${step}\` の文書と検証を完了する`)
|
|
178
186
|
.join('\n')
|
|
179
187
|
: '';
|
|
180
188
|
const optionalStepTasksAr = context.optionalSteps.length > 0
|
|
181
189
|
? context.optionalSteps
|
|
182
|
-
.map((step
|
|
190
|
+
.map((step) => `- [ ] أكمل التوثيق والتحقق للخطوة الاختيارية \`${step}\``)
|
|
183
191
|
.join('\n')
|
|
184
192
|
: '';
|
|
185
193
|
const zh = `## 上下文引用
|
|
@@ -192,12 +200,12 @@ ${this.formatReferenceList(moduleSkills, '待补充')}
|
|
|
192
200
|
|
|
193
201
|
## 任务清单
|
|
194
202
|
|
|
195
|
-
- [ ]
|
|
196
|
-
- [ ]
|
|
197
|
-
- [ ]
|
|
198
|
-
- [ ]
|
|
199
|
-
- [ ]
|
|
200
|
-
- [ ]
|
|
203
|
+
- [ ] 完成实现
|
|
204
|
+
- [ ] 对齐项目规划文档与本次 change 的边界
|
|
205
|
+
- [ ] 更新涉及模块的 \`SKILL.md\`
|
|
206
|
+
- [ ] 更新相关 API / 设计 / 计划文档
|
|
207
|
+
- [ ] 重新生成 \`SKILL.index.json\`
|
|
208
|
+
- [ ] 执行验证并更新 \`verification.md\`
|
|
201
209
|
${optionalStepTasksZh}`.trim();
|
|
202
210
|
const en = `## Context References
|
|
203
211
|
|
|
@@ -209,12 +217,12 @@ ${this.formatReferenceList(moduleSkills, 'TBD')}
|
|
|
209
217
|
|
|
210
218
|
## Task Checklist
|
|
211
219
|
|
|
212
|
-
- [ ]
|
|
213
|
-
- [ ]
|
|
214
|
-
- [ ]
|
|
215
|
-
- [ ]
|
|
216
|
-
- [ ]
|
|
217
|
-
- [ ]
|
|
220
|
+
- [ ] Implement the change
|
|
221
|
+
- [ ] Align project planning docs with this change boundary
|
|
222
|
+
- [ ] Update affected \`SKILL.md\` files
|
|
223
|
+
- [ ] Update related API / design / planning docs
|
|
224
|
+
- [ ] Rebuild \`SKILL.index.json\`
|
|
225
|
+
- [ ] Run verification and update \`verification.md\`
|
|
218
226
|
${optionalStepTasksEn}`.trim();
|
|
219
227
|
const ja = `## 参照コンテキスト
|
|
220
228
|
|
|
@@ -226,12 +234,12 @@ ${this.formatReferenceList(moduleSkills, '未定')}
|
|
|
226
234
|
|
|
227
235
|
## タスクチェックリスト
|
|
228
236
|
|
|
229
|
-
- [ ]
|
|
230
|
-
- [ ]
|
|
231
|
-
- [ ]
|
|
232
|
-
- [ ]
|
|
233
|
-
- [ ]
|
|
234
|
-
- [ ]
|
|
237
|
+
- [ ] change を実装する
|
|
238
|
+
- [ ] この change の境界に合わせてプロジェクト計画文書を揃える
|
|
239
|
+
- [ ] 影響を受ける \`SKILL.md\` を更新する
|
|
240
|
+
- [ ] 関連する API / 設計 / 計画文書を更新する
|
|
241
|
+
- [ ] \`SKILL.index.json\` を再生成する
|
|
242
|
+
- [ ] 検証を実行して \`verification.md\` を更新する
|
|
235
243
|
${optionalStepTasksJa}`.trim();
|
|
236
244
|
const ar = `## مراجع السياق
|
|
237
245
|
|
|
@@ -243,21 +251,27 @@ ${this.formatReferenceList(moduleSkills, 'قيد التحديد')}
|
|
|
243
251
|
|
|
244
252
|
## قائمة المهام
|
|
245
253
|
|
|
246
|
-
- [ ]
|
|
247
|
-
- [ ]
|
|
248
|
-
- [ ]
|
|
249
|
-
- [ ]
|
|
250
|
-
- [ ]
|
|
251
|
-
- [ ]
|
|
254
|
+
- [ ] نفّذ التغيير
|
|
255
|
+
- [ ] وحّد وثائق تخطيط المشروع مع حدود هذا change
|
|
256
|
+
- [ ] حدّث ملفات \`SKILL.md\` المتأثرة
|
|
257
|
+
- [ ] حدّث وثائق API / التصميم / التخطيط ذات الصلة
|
|
258
|
+
- [ ] أعد بناء \`SKILL.index.json\`
|
|
259
|
+
- [ ] نفّذ التحقق وحدّث \`verification.md\`
|
|
252
260
|
${optionalStepTasksAr}`.trim();
|
|
253
261
|
return this.withFrontmatter({
|
|
254
262
|
feature: context.feature,
|
|
255
263
|
created,
|
|
256
264
|
optional_steps: context.optionalSteps,
|
|
257
265
|
}, this.copy(context.documentLanguage, zh, en, ja, ar));
|
|
266
|
+
}
|
|
267
|
+
finally {
|
|
268
|
+
this.clearReferenceDocumentContext();
|
|
269
|
+
}
|
|
258
270
|
}
|
|
259
271
|
generateVerificationTemplate(input) {
|
|
260
272
|
const context = this.inputs.normalizeFeatureTemplateInput(input);
|
|
273
|
+
this.setReferenceDocumentContext(context.projectRoot, context.documentPath);
|
|
274
|
+
try {
|
|
261
275
|
const created = this.getCurrentDate();
|
|
262
276
|
const projectDocs = context.projectContext.projectDocs ?? [];
|
|
263
277
|
const moduleSkills = context.projectContext.moduleSkills ?? [];
|
|
@@ -365,9 +379,15 @@ ${this.formatChecklist(context.acceptanceCriteria, 'معيار قبول 1')}
|
|
|
365
379
|
optional_steps: context.optionalSteps,
|
|
366
380
|
passed_optional_steps: [],
|
|
367
381
|
}, this.copy(context.documentLanguage, zh, en, ja, ar));
|
|
382
|
+
}
|
|
383
|
+
finally {
|
|
384
|
+
this.clearReferenceDocumentContext();
|
|
385
|
+
}
|
|
368
386
|
}
|
|
369
387
|
generateReviewTemplate(input) {
|
|
370
388
|
const context = this.inputs.normalizeFeatureTemplateInput(input);
|
|
389
|
+
this.setReferenceDocumentContext(context.projectRoot, context.documentPath);
|
|
390
|
+
try {
|
|
371
391
|
const created = this.getCurrentDate();
|
|
372
392
|
const projectDocs = context.projectContext.projectDocs ?? [];
|
|
373
393
|
const moduleSkills = context.projectContext.moduleSkills ?? [];
|
|
@@ -520,7 +540,10 @@ ${this.formatReferenceList(linkedKnowledgeDocs, 'قيد التحديد')}
|
|
|
520
540
|
created,
|
|
521
541
|
status: 'pending_review',
|
|
522
542
|
}, this.copy(context.documentLanguage, zh, en, ja, ar));
|
|
543
|
+
}
|
|
544
|
+
finally {
|
|
545
|
+
this.clearReferenceDocumentContext();
|
|
546
|
+
}
|
|
523
547
|
}
|
|
524
548
|
}
|
|
525
549
|
exports.ExecutionTemplateBuilder = ExecutionTemplateBuilder;
|
|
526
|
-
//# sourceMappingURL=ExecutionTemplateBuilder.js.map
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { FeatureProjectReference, TemplateDocumentLanguage } from './templateTypes';
|
|
2
2
|
type FrontmatterValue = string | number | boolean | string[];
|
|
3
3
|
export declare abstract class TemplateBuilderBase {
|
|
4
|
+
private referenceProjectRoot?;
|
|
5
|
+
private referenceDocumentPath?;
|
|
6
|
+
protected setReferenceDocumentContext(projectRoot: string | undefined, documentPath: string | undefined): void;
|
|
7
|
+
protected clearReferenceDocumentContext(): void;
|
|
4
8
|
protected getCurrentDate(): string;
|
|
5
9
|
protected isEnglish(language: TemplateDocumentLanguage): boolean;
|
|
6
10
|
protected copy(language: TemplateDocumentLanguage, zh: string, en: string, ja?: string, ar?: string): string;
|
|
@@ -13,7 +17,7 @@ export declare abstract class TemplateBuilderBase {
|
|
|
13
17
|
protected formatReferenceList(items: FeatureProjectReference[], emptyFallback: string): string;
|
|
14
18
|
protected formatReferenceChecklist(items: FeatureProjectReference[], emptyFallback: string): string;
|
|
15
19
|
protected withFrontmatter(fields: Record<string, FrontmatterValue | undefined>, body: string): string;
|
|
20
|
+
private resolveReferenceHref;
|
|
16
21
|
private toYamlValue;
|
|
17
22
|
}
|
|
18
23
|
export {};
|
|
19
|
-
//# sourceMappingURL=TemplateBuilderBase.d.ts.map
|
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.TemplateBuilderBase = void 0;
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
4
8
|
class TemplateBuilderBase {
|
|
9
|
+
setReferenceDocumentContext(projectRoot, documentPath) {
|
|
10
|
+
this.referenceProjectRoot = typeof projectRoot === 'string' && projectRoot.trim().length > 0 ? projectRoot : undefined;
|
|
11
|
+
this.referenceDocumentPath = typeof documentPath === 'string' && documentPath.trim().length > 0 ? documentPath : undefined;
|
|
12
|
+
}
|
|
13
|
+
clearReferenceDocumentContext() {
|
|
14
|
+
this.referenceProjectRoot = undefined;
|
|
15
|
+
this.referenceDocumentPath = undefined;
|
|
16
|
+
}
|
|
5
17
|
getCurrentDate() {
|
|
6
18
|
return new Date().toISOString().slice(0, 10);
|
|
7
19
|
}
|
|
@@ -40,13 +52,17 @@ class TemplateBuilderBase {
|
|
|
40
52
|
if (items.length === 0) {
|
|
41
53
|
return `- ${emptyFallback}`;
|
|
42
54
|
}
|
|
43
|
-
return items
|
|
55
|
+
return items
|
|
56
|
+
.map(item => `- ${item.title}: [${item.path}](${this.resolveReferenceHref(item.path)})`)
|
|
57
|
+
.join('\n');
|
|
44
58
|
}
|
|
45
59
|
formatReferenceChecklist(items, emptyFallback) {
|
|
46
60
|
if (items.length === 0) {
|
|
47
61
|
return `- [ ] ${emptyFallback}`;
|
|
48
62
|
}
|
|
49
|
-
return items
|
|
63
|
+
return items
|
|
64
|
+
.map(item => `- [ ] ${item.title}: [${item.path}](${this.resolveReferenceHref(item.path)})`)
|
|
65
|
+
.join('\n');
|
|
50
66
|
}
|
|
51
67
|
withFrontmatter(fields, body) {
|
|
52
68
|
const frontmatter = Object.entries(fields)
|
|
@@ -55,6 +71,19 @@ class TemplateBuilderBase {
|
|
|
55
71
|
.join('\n');
|
|
56
72
|
return `---\n${frontmatter}\n---\n\n${body.trim()}\n`;
|
|
57
73
|
}
|
|
74
|
+
resolveReferenceHref(referencePath) {
|
|
75
|
+
const normalizedReferencePath = String(referencePath || '').replace(/\\/g, '/');
|
|
76
|
+
if (!normalizedReferencePath) {
|
|
77
|
+
return normalizedReferencePath;
|
|
78
|
+
}
|
|
79
|
+
if (!this.referenceProjectRoot || !this.referenceDocumentPath) {
|
|
80
|
+
return normalizedReferencePath;
|
|
81
|
+
}
|
|
82
|
+
const targetPath = path_1.default.resolve(this.referenceProjectRoot, normalizedReferencePath);
|
|
83
|
+
const documentDir = path_1.default.dirname(this.referenceDocumentPath);
|
|
84
|
+
const relativePath = path_1.default.relative(documentDir, targetPath).replace(/\\/g, '/');
|
|
85
|
+
return relativePath || '.';
|
|
86
|
+
}
|
|
58
87
|
toYamlValue(value) {
|
|
59
88
|
if (Array.isArray(value)) {
|
|
60
89
|
return `[${value.map(item => JSON.stringify(item)).join(', ')}]`;
|
|
@@ -66,4 +95,3 @@ class TemplateBuilderBase {
|
|
|
66
95
|
}
|
|
67
96
|
}
|
|
68
97
|
exports.TemplateBuilderBase = TemplateBuilderBase;
|
|
69
|
-
//# sourceMappingURL=TemplateBuilderBase.js.map
|
|
@@ -20,6 +20,8 @@ class TemplateInputFactory {
|
|
|
20
20
|
acceptanceCriteria: [...englishDefaults.acceptanceCriteria],
|
|
21
21
|
projectContext: this.normalizeFeatureProjectContext(),
|
|
22
22
|
documentLanguage: 'en-US',
|
|
23
|
+
projectRoot: undefined,
|
|
24
|
+
documentPath: undefined,
|
|
23
25
|
};
|
|
24
26
|
}
|
|
25
27
|
const documentLanguage = this.normalizeDocumentLanguage(input.documentLanguage);
|
|
@@ -38,6 +40,8 @@ class TemplateInputFactory {
|
|
|
38
40
|
acceptanceCriteria: input.acceptanceCriteria?.map(item => item.trim()).filter(Boolean) ?? [...localizedDefaults.acceptanceCriteria],
|
|
39
41
|
projectContext: this.normalizeFeatureProjectContext(input.projectContext),
|
|
40
42
|
documentLanguage,
|
|
43
|
+
projectRoot: typeof input.projectRoot === 'string' && input.projectRoot.trim().length > 0 ? input.projectRoot.trim() : undefined,
|
|
44
|
+
documentPath: typeof input.documentPath === 'string' && input.documentPath.trim().length > 0 ? input.documentPath.trim() : undefined,
|
|
41
45
|
};
|
|
42
46
|
if (!input.background?.trim()) {
|
|
43
47
|
normalized.background = localizedDefaults.background;
|
|
@@ -357,4 +361,3 @@ class TemplateInputFactory {
|
|
|
357
361
|
}
|
|
358
362
|
}
|
|
359
363
|
exports.TemplateInputFactory = TemplateInputFactory;
|
|
360
|
-
//# sourceMappingURL=TemplateInputFactory.js.map
|
|
@@ -15,6 +15,8 @@ export interface FeatureTemplateInput {
|
|
|
15
15
|
acceptanceCriteria?: string[];
|
|
16
16
|
projectContext?: FeatureProjectContext;
|
|
17
17
|
documentLanguage?: TemplateDocumentLanguage;
|
|
18
|
+
projectRoot?: string;
|
|
19
|
+
documentPath?: string;
|
|
18
20
|
}
|
|
19
21
|
export interface NormalizedFeatureTemplateInput {
|
|
20
22
|
feature: string;
|
|
@@ -30,6 +32,8 @@ export interface NormalizedFeatureTemplateInput {
|
|
|
30
32
|
acceptanceCriteria: string[];
|
|
31
33
|
projectContext: FeatureProjectContext;
|
|
32
34
|
documentLanguage: TemplateDocumentLanguage;
|
|
35
|
+
projectRoot?: string;
|
|
36
|
+
documentPath?: string;
|
|
33
37
|
}
|
|
34
38
|
export interface FeatureProjectReference {
|
|
35
39
|
title: string;
|
|
@@ -87,4 +91,3 @@ export interface NormalizedProjectBootstrapInput {
|
|
|
87
91
|
inferredFields: BootstrapFieldKey[];
|
|
88
92
|
placeholderFields: BootstrapFieldKey[];
|
|
89
93
|
}
|
|
90
|
-
//# sourceMappingURL=templateTypes.d.ts.map
|