Skip to content

Commit 3f4219e

Browse files
committed
chore: bump mcp version, update file extensions to .mjs, and add unplugin-raw dependency
1 parent 8909cb2 commit 3f4219e

File tree

7 files changed

+30
-18
lines changed

7 files changed

+30
-18
lines changed

packages/mcp-server/package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
22
"name": "@tempad-dev/mcp",
33
"description": "MCP server for TemPad Dev.",
4-
"version": "0.3.7",
4+
"version": "0.3.8",
55
"type": "module",
6-
"main": "dist/cli.js",
7-
"bin": "dist/cli.js",
6+
"main": "dist/cli.mjs",
7+
"bin": "dist/cli.mjs",
88
"files": [
99
"dist/**/*",
1010
"README.md"
1111
],
1212
"scripts": {
13-
"build": "tsdown && cp src/instructions.md dist/instructions.md",
13+
"build": "tsdown",
1414
"typecheck": "tsc -p tsconfig.json --noEmit",
1515
"lint": "eslint . --ext .ts,.mts,.cts,.js,.mjs,.cjs",
1616
"format": "prettier --write \"**/*.{js,ts,mjs,cjs,cts,mts,json,md}\"",
@@ -31,6 +31,7 @@
3131
"@types/ws": "^8.5.12",
3232
"tsdown": "^0.17.2",
3333
"typescript": "^5.9.3",
34+
"unplugin-raw": "^0.6.3",
3435
"zod": "^4.1.12"
3536
}
3637
}

packages/mcp-server/src/cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const HUB_STARTUP_TIMEOUT = 5000
4444
const CONNECT_RETRY_DELAY = 200
4545
const FAILED_RESTART_DELAY = 5000
4646
const HERE = fileURLToPath(new URL('.', import.meta.url))
47-
const HUB_ENTRY = join(HERE, 'hub.js')
47+
const HUB_ENTRY = join(HERE, 'hub.mjs')
4848

4949
ensureDir(RUNTIME_DIR)
5050

packages/mcp-server/src/hub.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,10 @@ import type { AssetRecord, ExtensionConnection } from './types'
3232
import { createAssetHttpServer } from './asset-http-server'
3333
import { createAssetStore } from './asset-store'
3434
import { getMcpServerConfig } from './config'
35+
import MCP_INSTRUCTIONS from './instructions.md?raw'
3536
import { register, resolve, reject, cleanupForExtension, cleanupAll } from './request'
3637
import { PACKAGE_VERSION, log, RUNTIME_DIR, SOCK_PATH, ensureDir } from './shared'
37-
import {
38-
TOOL_DEFS,
39-
MCP_INSTRUCTIONS,
40-
coercePayloadToToolResponse,
41-
createToolErrorResponse
42-
} from './tools'
38+
import { TOOL_DEFS, coercePayloadToToolResponse, createToolErrorResponse } from './tools'
4339

4440
const SHUTDOWN_TIMEOUT = 2000
4541
const { wsPortCandidates, toolTimeoutMs, maxPayloadBytes, autoActivateGraceMs } =

packages/mcp-server/src/tools.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ import {
1616
GetStructureParametersSchema,
1717
GetTokenDefsParametersSchema
1818
} from '@tempad-dev/mcp-shared'
19-
import { readFileSync } from 'node:fs'
20-
import { dirname, join } from 'node:path'
21-
import { fileURLToPath } from 'node:url'
2219

2320
export type {
2421
AssetDescriptor,
@@ -38,9 +35,6 @@ export type {
3835
ToolSchema
3936
} from '@tempad-dev/mcp-shared'
4037

41-
const HERE = dirname(fileURLToPath(import.meta.url))
42-
export const MCP_INSTRUCTIONS = readFileSync(join(HERE, 'instructions.md'), 'utf8')
43-
4438
type BaseToolMetadata<Name extends ToolName, Schema extends ZodType> = ToolSchema<Name> & {
4539
parameters: Schema
4640
format?: (payload: ToolResultMap[Name]) => CallToolResult

packages/mcp-server/tsdown.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { readFileSync } from 'node:fs'
22
import { dirname, join } from 'node:path'
33
import { fileURLToPath } from 'node:url'
44
import { defineConfig } from 'tsdown'
5+
import raw from 'unplugin-raw/rolldown'
56

67
const dir = dirname(fileURLToPath(import.meta.url))
78
const pkg = JSON.parse(readFileSync(join(dir, 'package.json'), 'utf8'))
@@ -13,6 +14,7 @@ const internalDeps = Object.keys(pkg.dependencies ?? {}).filter((name: string) =
1314

1415
export default defineConfig({
1516
entry: ['src/cli.ts', 'src/hub.ts'],
17+
plugins: [raw()],
1618
format: ['esm'],
1719
platform: 'node',
1820
target: 'node18',

packages/mcp-server/types.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
declare module '*.md' {
1+
declare module '*.md?raw' {
22
const content: string
33
export { content as default }
44
}

pnpm-lock.yaml

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)