Skip to content

Commit 36a73de

Browse files
authored
Merge pull request #36 from mhmzdev/mts-to-ts-migrate
.mts to .ts migrate
2 parents 1617529 + 5b31073 commit 36a73de

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1718
-261
lines changed

.changeset/fuzzy-eagles-hammer.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"figma-flutter-mcp": minor
3+
---
4+
5+
Migrated .mts to .ts, added semantic detection and visual context approaches

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"version": "0.2.0",
44
"description": "MCP server for Figma to Flutter conversion",
55
"type": "module",
6-
"main": "dist/cli.mjs",
6+
"main": "dist/cli.js",
77
"bin": {
8-
"figma-flutter-mcp": "dist/cli.mjs"
8+
"figma-flutter-mcp": "dist/cli.js"
99
},
1010
"files": [
1111
"dist/**/*",
@@ -14,10 +14,10 @@
1414
],
1515
"scripts": {
1616
"build": "tsc",
17-
"start": "node dist/cli.mjs",
18-
"dev": "tsx src/cli.mts --http",
19-
"dev:stdio": "tsx src/cli.mts --stdio",
20-
"dev:port": "tsx src/cli.mts --http --port",
17+
"start": "node dist/cli.js",
18+
"dev": "tsx src/cli.ts --http",
19+
"dev:stdio": "tsx src/cli.ts --stdio",
20+
"dev:port": "tsx src/cli.ts --http --port",
2121
"changeset": "changeset add",
2222
"version": "changeset version && npm install --lockfile-only",
2323
"release": "changeset publish"

src/cli.mts renamed to src/cli.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env node
2-
import {getServerConfig} from './config.mjs';
3-
import {startMcpServer, startHttpServer} from './server.mjs';
2+
import {getServerConfig} from './config.js';
3+
import {startMcpServer, startHttpServer} from './server.js';
44

55
async function startServer(): Promise<void> {
66
const config = getServerConfig();
File renamed without changes.

src/extractors/colors/core.mts renamed to src/extractors/colors/core.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
// src/extractors/colors/core.mts
22

3-
import type {FigmaNode} from '../../types/figma.mjs';
3+
import type {FigmaNode} from '../../types/figma.js';
44
import type {
55
ThemeColor,
66
ColorDefinition,
77
ColorExtractionContext,
88
ColorExtractorFn,
9-
} from './types.mjs';
9+
} from './types.js';
1010
import {
1111
extractColorsFromThemeFrame,
12-
} from './extractor.mjs';
12+
} from './extractor.js';
1313

1414
/**
1515
* Main color extraction orchestrator

src/extractors/colors/extractor.mts renamed to src/extractors/colors/extractor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// src/extractors/colors/extractor.mts
22

3-
import type {FigmaNode} from '../../types/figma.mjs';
3+
import type {FigmaNode} from '../../types/figma.js';
44
import type {
55
ThemeColor,
66
ColorDefinition,
77
ColorExtractorFn
8-
} from './types.mjs';
8+
} from './types.js';
99

1010
/**
1111
* Extract colors from a theme frame containing color swatches with text labels
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// src/extractors/colors/index.mts
22

33
// Core functionality
4-
export { ColorExtractor, extractThemeColors } from './core.mjs';
4+
export { ColorExtractor, extractThemeColors } from './core.js';
55

66
// Extractor functions
77
export {
88
extractColorsFromThemeFrame,
99
isTypographyNode
10-
} from './extractor.mjs';
10+
} from './extractor.js';
1111

1212
// Types
1313
export type {
@@ -16,4 +16,4 @@ export type {
1616
ColorExtractionContext,
1717
ColorExtractorFn,
1818
ThemeGenerationOptions
19-
} from './types.mjs';
19+
} from './types.js';

src/extractors/colors/types.mts renamed to src/extractors/colors/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// src/extractors/colors/types.mts
22

3-
import type {FigmaNode} from '../../types/figma.mjs';
3+
import type {FigmaNode} from '../../types/figma.js';
44

55
/**
66
* Color definition from theme extraction

src/extractors/components/core.mts renamed to src/extractors/components/core.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
// src/extractors/components/core.mts
22

3-
import type {FigmaNode} from '../../types/figma.mjs';
3+
import type {FigmaNode} from '../../types/figma.js';
44
import type {
55
ComponentAnalysis,
66
ComponentExtractionOptions,
77
ComponentVariant
8-
} from './types.mjs';
8+
} from './types.js';
99
import {
1010
extractMetadata,
1111
extractLayoutInfo,
1212
extractStylingInfo,
1313
analyzeChildren,
14-
} from './extractor.mjs';
14+
} from './extractor.js';
1515

1616
/**
1717
* Component extraction and analysis class
@@ -83,7 +83,7 @@ export async function analyzeComponentWithVariants(
8383
throw new Error('Node is not a COMPONENT_SET');
8484
}
8585

86-
const {VariantAnalyzer} = await import('./variant-analyzer.mjs');
86+
const {VariantAnalyzer} = await import('./variant-analyzer.js');
8787
const variantAnalyzer = new VariantAnalyzer();
8888
const variants = await variantAnalyzer.analyzeComponentSet(componentSetNode);
8989

src/extractors/components/deduplicated-extractor.mts renamed to src/extractors/components/deduplicated-extractor.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
// src/extractors/components/deduplicated-extractor.mts
22

3-
import type { FigmaNode } from '../../types/figma.mjs';
4-
import type { FlutterStyleDefinition } from '../flutter/style-library.mjs';
5-
import { FlutterStyleLibrary } from '../flutter/style-library.mjs';
3+
import type { FigmaNode } from '../../types/figma.js';
4+
import type { FlutterStyleDefinition } from '../flutter/style-library.js';
5+
import { FlutterStyleLibrary } from '../flutter/style-library.js';
66
import {
77
extractStylingInfo,
88
extractLayoutInfo,
99
extractMetadata,
1010
extractTextInfo,
1111
createNestedComponentInfo
12-
} from './extractor.mjs';
12+
} from './extractor.js';
1313
import type {
1414
ComponentMetadata,
1515
LayoutInfo,
1616
StylingInfo,
1717
NestedComponentInfo,
1818
TextInfo
19-
} from './types.mjs';
19+
} from './types.js';
2020

2121
export interface DeduplicatedComponentAnalysis {
2222
metadata: ComponentMetadata;

0 commit comments

Comments
 (0)