Skip to content

Commit eae5fa5

Browse files
committed
refactor: reorder imports and clean up code formatting
1 parent 839dac3 commit eae5fa5

File tree

14 files changed

+22
-30
lines changed

14 files changed

+22
-30
lines changed

eslint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import tsParser from '@typescript-eslint/parser'
21
import tsPlugin from '@typescript-eslint/eslint-plugin'
2+
import tsParser from '@typescript-eslint/parser'
33
import importPlugin from 'eslint-plugin-import'
44
import prettierPlugin from 'eslint-plugin-prettier'
55
import globals from 'globals'

package.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,7 @@
88
"bin": {
99
"doc-mcp-server": "./build/index.js"
1010
},
11-
"files": [
12-
"build",
13-
"LICENSE",
14-
"README.md"
15-
],
11+
"files": ["build", "LICENSE", "README.md"],
1612
"main": "build/index.js",
1713
"scripts": {
1814
"prepare": "husky",

scripts/base.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import path from 'path'
2-
import { fileURLToPath } from 'url'
3-
import { promises as fs } from 'fs'
4-
import { spawn } from 'child_process'
1+
import { spawn } from 'node:child_process'
2+
import { promises as fs } from 'node:fs'
3+
import path from 'node:path'
54
import { rimraf } from 'rimraf'
65
import kill from 'tree-kill'
76

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import 'dotenv/config'
33
import yargs, { type ArgumentsCamelCase } from 'yargs'
44
import { hideBin } from 'yargs/helpers'
5-
import { startWebServer, startStdioServer } from '@/services'
5+
import { startStdioServer, startWebServer } from '@/services'
66
import { getOptions } from '@/utils'
77
import pkg from '../package.json' with { type: 'json' }
88

src/prompts/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { z } from 'zod'
21
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'
2+
import { z } from 'zod'
33

44
export const registerPrompts = (server: McpServer) => {
55
server.registerPrompt(

src/services/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'
2-
import { registerTools } from '@/tools'
3-
import { registerResources } from '@/resources'
42
import { registerPrompts } from '@/prompts'
3+
import { registerResources } from '@/resources'
4+
import { registerTools } from '@/tools'
5+
import type { OptionsType } from '@/types'
56
import { stdioServer } from './stdio'
67
import { webServer } from './web'
7-
import type { OptionsType } from '@/types'
88

99
const createServer = (options: OptionsType) => {
1010
const server = new McpServer({

src/services/stdio.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'
21
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'
2+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'
33

44
export async function stdioServer(server: McpServer) {
55
const transport = new StdioServerTransport()

src/services/web.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import express from 'express'
21
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'
32
import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js'
3+
import express from 'express'
44
import type { OptionsType } from '@/types'
55

66
export async function webServer(server: McpServer, options: OptionsType) {

src/tools/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import registerWatermarkJsPlus from './registerWatermarkJsPlus'
21
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'
32
import type { OptionsType } from '@/types'
3+
import registerWatermarkJsPlus from './registerWatermarkJsPlus'
44

55
export const registerTools = (server: McpServer, options: OptionsType) => {
66
registerWatermarkJsPlus(server, options)

src/tools/registerWatermarkJsPlus.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { z } from 'zod'
2-
import { getPagesContent, searchAlgolia } from '@/utils'
31
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'
2+
import { z } from 'zod'
43
import type { OptionsType } from '@/types'
4+
import { getPagesContent, searchAlgolia } from '@/utils'
55

66
export default function register(server: McpServer, options: OptionsType) {
77
server.registerTool(

0 commit comments

Comments
 (0)