From 3da59f3e6382c2d4fc74599a6b7cb37cbadb91ee Mon Sep 17 00:00:00 2001 From: Olivier Chafik Date: Tue, 25 Nov 2025 02:16:54 +0000 Subject: [PATCH 1/2] ci & presubmit --- .github/workflows/ci.yml | 40 ++++++++++++++++++++++++++++++++++++++++ .husky/pre-commit | 4 ++++ CONTRIBUTING.md | 0 package.json | 3 ++- src/app-bridge.ts | 5 +---- 5 files changed, 47 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 .husky/pre-commit create mode 100644 CONTRIBUTING.md diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..32223f47f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,40 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + + - uses: actions/setup-node@v4 + with: + node-version: "20" + cache: "npm" + + - run: npm ci + + - run: npm run build + + - name: Build simple-host example + working-directory: examples/simple-host + run: | + npm ci + npm run build + + - name: Build simple-server example + working-directory: examples/simple-server + run: | + npm ci + npm run build + + - run: npm run prettier diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 000000000..f4743237f --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +npm run build +npm run prettier:fix +( cd examples/simple-host && npm run build ) +( cd examples/simple-server && npm run build ) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..e69de29bb diff --git a/package.json b/package.json index 39647cd58..dbe7d8627 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "scripts": { "start": "cd examples/simple-host && npm i && npm start", "build": "bun build.bun.ts", - "prepare": "npm run build", + "prepare": "npm run build && husky", "prettier:base-cmd": "prettier -u --ignore-path ./.gitignore --ignore-path ./.prettierignore", "prettier": "yarn prettier:base-cmd \"$(pwd)/**/*.{js,jsx,ts,tsx,mjs,json,md,yml,yaml}\" --check", "prettier:fix": "yarn prettier:base-cmd \"$(pwd)/**/*.{js,jsx,ts,tsx,mjs,json,md,yml,yaml}\" --write --list-different" @@ -37,6 +37,7 @@ "concurrently": "^9.2.1", "cors": "^2.8.5", "express": "^5.1.0", + "husky": "^9.1.7", "prettier": "^3.6.2" }, "dependencies": { diff --git a/src/app-bridge.ts b/src/app-bridge.ts index 0053c3b31..76a238b6a 100644 --- a/src/app-bridge.ts +++ b/src/app-bridge.ts @@ -273,10 +273,7 @@ export class AppBridge extends Protocol { ListResourceTemplatesRequestSchema, ListResourceTemplatesResultSchema, ); - this.forwardRequest( - ReadResourceRequestSchema, - ReadResourceResultSchema, - ); + this.forwardRequest(ReadResourceRequestSchema, ReadResourceResultSchema); if (serverCapabilities.resources.listChanged) { this.forwardNotification(ResourceListChangedNotificationSchema); } From 28bdb83eb7bc031e7fbd38230609fe20770c0d75 Mon Sep 17 00:00:00 2001 From: Olivier Chafik Date: Tue, 25 Nov 2025 02:19:27 +0000 Subject: [PATCH 2/2] Update ci.yml --- .github/workflows/ci.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 32223f47f..c00caa173 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,22 +19,21 @@ jobs: - uses: actions/setup-node@v4 with: node-version: "20" - cache: "npm" - - run: npm ci + - run: npm install - run: npm run build - name: Build simple-host example working-directory: examples/simple-host run: | - npm ci + npm install npm run build - name: Build simple-server example working-directory: examples/simple-server run: | - npm ci + npm install npm run build - run: npm run prettier