Skip to content

Commit 9e63a90

Browse files
[autofix.ci] apply automated fixes
1 parent a8a402b commit 9e63a90

File tree

5 files changed

+40
-37
lines changed

5 files changed

+40
-37
lines changed

backend/src/build-system/handlers/file-manager/file-arch/index.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,11 @@ export class FileArchGenerateHandler implements BuildHandler<string> {
8080
// validate with virutual dir
8181
const { graph, nodes, fileInfos } = buildDependencyGraph(jsonData);
8282
if (!validateAgainstVirtualDirectory(nodes, this.virtualDir)) {
83-
84-
this.logger.error('Validate Against Virtual Directory Fail !!!');
85-
throw new ResponseParsingError('Failed to validate against virtualDirectory.');
86-
}
83+
this.logger.error('Validate Against Virtual Directory Fail !!!');
84+
throw new ResponseParsingError(
85+
'Failed to validate against virtualDirectory.',
86+
);
87+
}
8788

8889
this.logger.log('File architecture document generated successfully.');
8990
return {

backend/src/build-system/handlers/ux/sitemap-document/index.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,7 @@ import { BuilderContext } from 'src/build-system/context';
33
import { prompts } from './prompt';
44
import { Logger } from '@nestjs/common';
55
import { removeCodeBlockFences } from 'src/build-system/utils/strings';
6-
import { MessageInterface } from 'src/common/model-provider/types';
76
import { chatSyncWithClocker } from 'src/build-system/utils/handler-helper';
8-
import {
9-
MissingConfigurationError,
10-
ModelUnavailableError,
11-
ResponseParsingError,
12-
} from 'src/build-system/errors';
13-
import { OpenAIModelProvider } from 'src/common/model-provider/openai-model-provider';
147

158
export class UXSMDHandler implements BuildHandler<string> {
169
readonly id = 'op:UX:SMD';
@@ -29,7 +22,11 @@ export class UXSMDHandler implements BuildHandler<string> {
2922
const prompt = prompts.generateUxsmdPrompt(projectName, platform);
3023

3124
// Send the prompt to the LLM server and process the response
32-
const uxsmdContent = await this.generateUXSMDFromLLM(context, prompt, prdContent);
25+
const uxsmdContent = await this.generateUXSMDFromLLM(
26+
context,
27+
prompt,
28+
prdContent,
29+
);
3330

3431
// Store the generated document in the context
3532
context.setGlobalContext('uxsmdDocument', uxsmdContent);

backend/src/build-system/handlers/ux/sitemap-structure/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ export class UXSitemapStructureHandler implements BuildHandler<string> {
7878
];
7979

8080
try {
81-
8281
const uxStructureContent = await chatSyncWithClocker(
8382
context,
8483
{

backend/src/build-system/handlers/ux/sitemap-structure/sms-page.ts

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,11 @@ import { Logger } from '@nestjs/common';
22
import { BuilderContext } from 'src/build-system/context';
33
import { BuildHandler, BuildResult } from 'src/build-system/types';
44
import { prompts } from './prompt';
5-
import { removeCodeBlockFences } from 'src/build-system/utils/strings';
6-
import { MessageInterface } from 'src/common/model-provider/types';
75
import { batchChatSyncWithClock } from 'src/build-system/utils/handler-helper';
86
import {
97
MissingConfigurationError,
108
ResponseParsingError,
119
} from 'src/build-system/errors';
12-
import { OpenAIModelProvider } from 'src/common/model-provider/openai-model-provider';
1310

1411
export class UXSitemapStructurePagebyPageHandler
1512
implements BuildHandler<string>
@@ -65,33 +62,39 @@ export class UXSitemapStructurePagebyPageHandler
6562

6663
this.logger.log('Processing each Global Component...');
6764

68-
const requests = globalSections.map((globalSection) => ({
69-
model: 'gpt-4o',
70-
messages: [{
71-
role: 'system' as const,
72-
content: globalComponentPrompt,
73-
},
74-
{
75-
role: 'user' as const,
76-
content: `
65+
const requests = globalSections.map((globalSection) => ({
66+
model: 'gpt-4o',
67+
messages: [
68+
{
69+
role: 'system' as const,
70+
content: globalComponentPrompt,
71+
},
72+
{
73+
role: 'user' as const,
74+
content: `
7775
This is the Global Components Section (GCS) of the UX SiteMap Structre (SMS) :
7876
${globalSection}
7977
8078
Please generate the Full UX Sitemap Structre for this section now. Provide the information exclusively within <global_component> tags.
8179
`,
82-
},
83-
{
84-
role: 'user' as const,
85-
content: `Please enrich the details of Core Components in each <global_component> block.
80+
},
81+
{
82+
role: 'user' as const,
83+
content: `Please enrich the details of Core Components in each <global_component> block.
8684
Specifically:
8785
- **Descriptive Component Names**: Include a clear, meaningful name (C#.X. [Component Name]) and explain its purpose on this page.
8886
- **States and Interactions**: Define possible UI states (e.g., Default, Hover, Clicked) and describe typical user interactions (e.g., click, drag, input).
8987
- **Access Restrictions**: Note any conditions (e.g., login required, admin-only) that govern access to the component.`,
90-
},
91-
]
92-
}));
88+
},
89+
],
90+
}));
9391

94-
const refinedGlobalCompSections = await batchChatSyncWithClock(context, 'generate global components', this.id, requests);
92+
const refinedGlobalCompSections = await batchChatSyncWithClock(
93+
context,
94+
'generate global components',
95+
this.id,
96+
requests,
97+
);
9598
refinedSections.push(refinedGlobalCompSections);
9699

97100
this.logger.log('Processing each Page View...');
@@ -140,11 +143,15 @@ export class UXSitemapStructurePagebyPageHandler
140143
- **Essential Content**: Identify critical information displayed in the component and explain its importance to the user experience.
141144
- **Missing Elements**: Review the structure and add any components, features, or details that may be missing to ensure a complete and robust UX structure.`,
142145
},
143-
]
146+
],
144147
}));
145-
146148

147-
const refinedPageViewSections = await batchChatSyncWithClock(context, 'generate global components', this.id, page_view_requests);
149+
const refinedPageViewSections = await batchChatSyncWithClock(
150+
context,
151+
'generate global components',
152+
this.id,
153+
page_view_requests,
154+
);
148155
refinedSections.push(refinedPageViewSections);
149156

150157
// TODO: deal with chat clocker

backend/src/build-system/utils/file_generator_util.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import * as path from 'path';
33
import { Logger } from '@nestjs/common';
44
import { VirtualDirectory } from '../virtual-dir';
55
import { extractJsonFromMarkdown } from 'src/build-system/utils/strings';
6-
import normalizePath from 'normalize-path';
76
import toposort from 'toposort';
87

98
interface FileDependencyInfo {

0 commit comments

Comments
 (0)