Skip to content

Commit a5dfe9e

Browse files
committed
chore: refactor src structure; migrate to Bun runtime & CI; remove build output and legacy CLI; update tests and runner; add Bun CI
1 parent 9592fee commit a5dfe9e

File tree

15 files changed

+444
-422
lines changed

15 files changed

+444
-422
lines changed

.github/workflows/test.yml

Lines changed: 22 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI/CD Tests
1+
name: CI - Bun
22

33
on:
44
push:
@@ -8,77 +8,34 @@ on:
88

99
jobs:
1010
test:
11-
name: E2E Tests
11+
name: Tests (Bun)
1212
runs-on: ubuntu-latest
13-
14-
strategy:
15-
matrix:
16-
node-version: [18.x, 20.x, 22.x]
17-
1813
steps:
1914
- name: Checkout repository
2015
uses: actions/checkout@v4
21-
22-
- name: Setup Node.js ${{ matrix.node-version }}
23-
uses: actions/setup-node@v4
16+
17+
- name: Setup Bun
18+
uses: oven-sh/setup-bun@v2
2419
with:
25-
node-version: ${{ matrix.node-version }}
26-
cache: 'npm'
27-
20+
bun-version: latest
21+
2822
- name: Install dependencies
29-
run: npm ci
30-
23+
run: bun install --frozen-lockfile
24+
3125
- name: Type check
32-
run: npm run type-check
33-
34-
- name: Build project
35-
run: npm run build
36-
37-
- name: Run E2E tests
38-
run: npm run test:quick
39-
40-
- name: Test configuration loading
41-
run: |
42-
echo "Testing basic configuration..."
43-
timeout 10s node build/index.js --config=tests/configs/basic.yaml || true
44-
echo "Testing JSON configuration..."
45-
timeout 10s node build/index.js --config=tests/configs/basic.json || true
46-
47-
- name: Test environment configuration
48-
run: |
49-
echo "Testing environment variables..."
50-
timeout 10s env MCP_SERVERS="test:npx:user-review-mcp" node build/index.js || true
26+
run: bun x tsc --noEmit
5127

52-
build-check:
53-
name: Build Verification
54-
runs-on: ubuntu-latest
55-
56-
steps:
57-
- name: Checkout repository
58-
uses: actions/checkout@v4
59-
60-
- name: Setup Node.js
61-
uses: actions/setup-node@v4
62-
with:
63-
node-version: '20.x'
64-
cache: 'npm'
65-
66-
- name: Install dependencies
67-
run: npm ci
68-
69-
- name: Build project
70-
run: npm run build
71-
72-
- name: Verify build artifacts
28+
- name: Run quick E2E tests
29+
run: bun run tests/e2e-simple.ts
30+
31+
- name: Run full E2E tests
32+
run: bun run tests/e2e-test.ts
33+
34+
- name: Smoke: config loading with Bun
7335
run: |
74-
ls -la build/
75-
[ -f "build/index.js" ] || { echo "Missing index.js"; exit 1; }
76-
[ -f "build/aggregator-server.js" ] || { echo "Missing aggregator-server.js"; exit 1; }
77-
[ -f "build/config.js" ] || { echo "Missing config.js"; exit 1; }
78-
echo "All build artifacts present ✅"
79-
80-
- name: Test package installation
36+
timeout 10s bun run src/index.ts --config=tests/configs/basic.yaml || true
37+
timeout 10s bun run src/index.ts --config=tests/configs/basic.json || true
38+
39+
- name: Smoke: env config with Bun
8140
run: |
82-
npm pack
83-
npm install -g ./mcp-gateway-*.tgz
84-
echo "Package installation successful ✅"
41+
timeout 10s env MCP_SERVERS="test:npx:user-review-mcp" bun run src/index.ts || true

bun.lock

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

package.json

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@
55
"type": "module",
66
"main": "build/index.js",
77
"scripts": {
8-
"build": "tsc",
9-
"start": "node build/index.js",
10-
"dev": "tsx src/index.ts",
8+
"start": "bun run src/index.ts",
9+
"dev": "bun run src/index.ts",
1110
"type-check": "tsc --noEmit",
12-
"test": "npm run build && tsx tests/e2e-test.ts",
13-
"test:quick": "tsx tests/e2e-simple.ts"
11+
"test": "bun run tests/e2e-test.ts",
12+
"test:quick": "bun run tests/e2e-simple.ts"
1413
},
1514
"keywords": ["mcp", "gateway", "aggregator", "server", "proxy", "model-context-protocol"],
1615
"author": "MCP Gateway",
@@ -30,10 +29,7 @@
3029
},
3130
"devDependencies": {
3231
"@types/node": "^22.10.0",
33-
"tsx": "^4.19.1",
3432
"typescript": "^5.7.0"
3533
},
36-
"bin": {
37-
"mcp-gateway": "./build/index.js"
38-
}
34+
"bin": {}
3935
}

0 commit comments

Comments
 (0)