Skip to content

Commit 18131d7

Browse files
committed
fix(): tools formatting
1 parent f8397f6 commit 18131d7

File tree

4 files changed

+35
-33
lines changed

4 files changed

+35
-33
lines changed

packages/angular-mcp-server/src/lib/tools/ds/component-contract/builder/build-component-contract.tool.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ import {
44
} from '../../shared/utils/handler-helpers.js';
55
import { buildComponentContractSchema } from './models/schema.js';
66
import { buildComponentContract } from './utils/build-contract.js';
7-
import {
8-
generateContractSummary,
9-
} from '../shared/utils/contract-file-ops.js';
7+
import { generateContractSummary } from '../shared/utils/contract-file-ops.js';
108
import { ContractResult } from './models/types.js';
119
import { resolveCrossPlatformPath } from '../../shared/utils/cross-platform-path.js';
1210

@@ -34,7 +32,10 @@ export const buildComponentContractHandler = createHandler<
3432

3533
const effectiveTemplatePath = resolveCrossPlatformPath(cwd, templateFile);
3634
const effectiveScssPath = resolveCrossPlatformPath(cwd, styleFile);
37-
const effectiveTypescriptPath = resolveCrossPlatformPath(cwd, typescriptFile);
35+
const effectiveTypescriptPath = resolveCrossPlatformPath(
36+
cwd,
37+
typescriptFile,
38+
);
3839

3940
const contract = await buildComponentContract(
4041
effectiveTemplatePath,
@@ -44,14 +45,17 @@ export const buildComponentContractHandler = createHandler<
4445
);
4546

4647
const contractString = JSON.stringify(contract, null, 2);
47-
const hash = require('node:crypto').createHash('sha256').update(contractString).digest('hex');
48-
48+
const hash = require('node:crypto')
49+
.createHash('sha256')
50+
.update(contractString)
51+
.digest('hex');
52+
4953
const effectiveSaveLocation = resolveCrossPlatformPath(cwd, saveLocation);
50-
54+
5155
const { mkdir, writeFile } = await import('node:fs/promises');
5256
const { dirname } = await import('node:path');
5357
await mkdir(dirname(effectiveSaveLocation), { recursive: true });
54-
58+
5559
const contractData = {
5660
contract,
5761
hash: `sha256-${hash}`,

packages/angular-mcp-server/src/lib/tools/ds/component-contract/builder/models/schema.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import { ToolSchemaOptions } from '@push-based/models';
2-
import {
3-
COMMON_ANNOTATIONS,
4-
} from '../../../shared';
2+
import { COMMON_ANNOTATIONS } from '../../../shared';
53

64
/**
75
* Schema for building component contracts
@@ -30,20 +28,16 @@ export const buildComponentContractSchema: ToolSchemaOptions = {
3028
},
3129
typescriptFile: {
3230
type: 'string',
33-
description: 'Path to the TypeScript component file (.ts). Supports both absolute and relative paths.',
31+
description:
32+
'Path to the TypeScript component file (.ts). Supports both absolute and relative paths.',
3433
},
3534
dsComponentName: {
3635
type: 'string',
3736
description: 'The name of the design system component being used',
3837
default: '',
3938
},
4039
},
41-
required: [
42-
'saveLocation',
43-
'templateFile',
44-
'styleFile',
45-
'typescriptFile',
46-
],
40+
required: ['saveLocation', 'templateFile', 'styleFile', 'typescriptFile'],
4741
},
4842
annotations: {
4943
title: 'Build Component Contract',

packages/angular-mcp-server/src/lib/tools/ds/component-contract/diff/diff-component-contract.tool.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,17 @@ export const diffComponentContractHandler = createHandler<
3333
>(
3434
diffComponentContractSchema.name,
3535
async (params, { cwd, workspaceRoot }) => {
36-
const { saveLocation, contractBeforePath, contractAfterPath, dsComponentName = '' } = params;
37-
38-
const effectiveBeforePath = resolveCrossPlatformPath(cwd, contractBeforePath);
36+
const {
37+
saveLocation,
38+
contractBeforePath,
39+
contractAfterPath,
40+
dsComponentName = '',
41+
} = params;
42+
43+
const effectiveBeforePath = resolveCrossPlatformPath(
44+
cwd,
45+
contractBeforePath,
46+
);
3947
const effectiveAfterPath = resolveCrossPlatformPath(cwd, contractAfterPath);
4048

4149
const contractBefore = await loadContract(effectiveBeforePath);
@@ -61,10 +69,10 @@ export const diffComponentContractHandler = createHandler<
6169
const normalizedDiffData = normalizePathsInObject(diffData, workspaceRoot);
6270

6371
const effectiveSaveLocation = resolveCrossPlatformPath(cwd, saveLocation);
64-
72+
6573
const { dirname } = await import('node:path');
6674
await mkdir(dirname(effectiveSaveLocation), { recursive: true });
67-
75+
6876
const diffFilePath = effectiveSaveLocation;
6977

7078
const formattedJson = JSON.stringify(normalizedDiffData, null, 2);

packages/angular-mcp-server/src/lib/tools/ds/component-contract/diff/models/schema.ts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import { ToolSchemaOptions } from '@push-based/models';
2-
import {
3-
COMMON_ANNOTATIONS,
4-
} from '../../../shared';
2+
import { COMMON_ANNOTATIONS } from '../../../shared';
53

64
/**
75
* Schema for diffing component contracts
@@ -20,23 +18,21 @@ export const diffComponentContractSchema: ToolSchemaOptions = {
2018
},
2119
contractBeforePath: {
2220
type: 'string',
23-
description: 'Path to the contract file before refactoring. Supports both absolute and relative paths.',
21+
description:
22+
'Path to the contract file before refactoring. Supports both absolute and relative paths.',
2423
},
2524
contractAfterPath: {
2625
type: 'string',
27-
description: 'Path to the contract file after refactoring. Supports both absolute and relative paths.',
26+
description:
27+
'Path to the contract file after refactoring. Supports both absolute and relative paths.',
2828
},
2929
dsComponentName: {
3030
type: 'string',
3131
description: 'The name of the design system component being used',
3232
default: '',
3333
},
3434
},
35-
required: [
36-
'saveLocation',
37-
'contractBeforePath',
38-
'contractAfterPath',
39-
],
35+
required: ['saveLocation', 'contractBeforePath', 'contractAfterPath'],
4036
},
4137
annotations: {
4238
title: 'Diff Component Contract',

0 commit comments

Comments
 (0)