Skip to content

Commit ca09c41

Browse files
authored
setup ci & presubmit (#20)
* ci & presubmit * Update ci.yml
1 parent 3df49c3 commit ca09c41

File tree

5 files changed

+46
-5
lines changed

5 files changed

+46
-5
lines changed

.github/workflows/ci.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- uses: oven-sh/setup-bun@v2
16+
with:
17+
bun-version: latest
18+
19+
- uses: actions/setup-node@v4
20+
with:
21+
node-version: "20"
22+
23+
- run: npm install
24+
25+
- run: npm run build
26+
27+
- name: Build simple-host example
28+
working-directory: examples/simple-host
29+
run: |
30+
npm install
31+
npm run build
32+
33+
- name: Build simple-server example
34+
working-directory: examples/simple-server
35+
run: |
36+
npm install
37+
npm run build
38+
39+
- run: npm run prettier

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
npm run build
2+
npm run prettier:fix
3+
( cd examples/simple-host && npm run build )
4+
( cd examples/simple-server && npm run build )

CONTRIBUTING.md

Whitespace-only changes.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"start:example-mcp-server": "cd examples//simple-server && npm --registry=https://registry.npmjs.org/ install && npm start",
2828
"start": "NODE_ENV=development npm run build && concurrently 'npm run start:example-host' 'npm run start:example-mcp-server'",
2929
"build": "bun build.bun.ts",
30-
"prepare": "npm run build",
30+
"prepare": "npm run build && husky",
3131
"prettier:base-cmd": "prettier -u --ignore-path ./.gitignore --ignore-path ./.prettierignore",
3232
"prettier": "yarn prettier:base-cmd \"$(pwd)/**/*.{js,jsx,ts,tsx,mjs,json,md,yml,yaml}\" --check",
3333
"prettier:fix": "yarn prettier:base-cmd \"$(pwd)/**/*.{js,jsx,ts,tsx,mjs,json,md,yml,yaml}\" --write --list-different"
@@ -40,6 +40,7 @@
4040
"cors": "^2.8.5",
4141
"esbuild": "^0.25.12",
4242
"express": "^5.1.0",
43+
"husky": "^9.1.7",
4344
"prettier": "^3.6.2",
4445
"typescript": "^5.9.3"
4546
},

src/app-bridge.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,10 +266,7 @@ export class AppBridge extends Protocol<Request, Notification, Result> {
266266
ListResourceTemplatesRequestSchema,
267267
ListResourceTemplatesResultSchema,
268268
);
269-
this.forwardRequest(
270-
ReadResourceRequestSchema,
271-
ReadResourceResultSchema,
272-
);
269+
this.forwardRequest(ReadResourceRequestSchema, ReadResourceResultSchema);
273270
if (serverCapabilities.resources.listChanged) {
274271
this.forwardNotification(ResourceListChangedNotificationSchema);
275272
}

0 commit comments

Comments
 (0)