Skip to content

Commit 38833ba

Browse files
ochafikclaude
andcommitted
feat: use cross-env for Windows-compatible example builds
- Add cross-env to devDependencies - Update all example package.json scripts to use cross-env for INPUT and NODE_ENV - Enable examples:build on Windows in CI (no longer Unix-only) - Add examples:build to WSL CI job 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 239e69a commit 38833ba

File tree

13 files changed

+77
-52
lines changed

13 files changed

+77
-52
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,9 @@ jobs:
4242

4343
- run: npm install
4444

45-
# Build SDK (all platforms) and examples (Unix only - they use INPUT=... syntax)
4645
- run: npm run build
4746

48-
- name: Build examples
49-
if: runner.os != 'Windows'
50-
run: npm run examples:build
47+
- run: npm run examples:build
5148

5249
- name: Verify generated schemas are up-to-date
5350
shell: bash
@@ -83,6 +80,7 @@ jobs:
8380
run: |
8481
npm install
8582
npm run build
83+
npm run examples:build
8684
npm test
8785
npm run prettier
8886

examples/basic-host/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
"version": "1.0.0",
55
"type": "module",
66
"scripts": {
7-
"build": "concurrently 'INPUT=index.html vite build' 'INPUT=sandbox.html vite build'",
8-
"watch": "concurrently 'INPUT=index.html vite build --watch' 'INPUT=sandbox.html vite build --watch'",
7+
"build": "concurrently \"cross-env INPUT=index.html vite build\" \"cross-env INPUT=sandbox.html vite build\"",
8+
"watch": "concurrently \"cross-env INPUT=index.html vite build --watch\" \"cross-env INPUT=sandbox.html vite build --watch\"",
99
"serve": "bun serve.ts",
10-
"start": "NODE_ENV=development npm run build && npm run serve",
11-
"dev": "NODE_ENV=development concurrently 'npm run watch' 'npm run serve'"
10+
"start": "cross-env NODE_ENV=development npm run build && npm run serve",
11+
"dev": "cross-env NODE_ENV=development concurrently \"npm run watch\" \"npm run serve\""
1212
},
1313
"dependencies": {
1414
"@modelcontextprotocol/ext-apps": "../..",

examples/basic-server-react/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
"private": true,
55
"type": "module",
66
"scripts": {
7-
"build": "INPUT=mcp-app.html vite build",
8-
"watch": "INPUT=mcp-app.html vite build --watch",
7+
"build": "cross-env INPUT=mcp-app.html vite build",
8+
"watch": "cross-env INPUT=mcp-app.html vite build --watch",
99
"serve": "bun server.ts",
10-
"start": "NODE_ENV=development npm run build && npm run serve",
11-
"dev": "NODE_ENV=development concurrently 'npm run watch' 'npm run serve'"
10+
"start": "cross-env NODE_ENV=development npm run build && npm run serve",
11+
"dev": "cross-env NODE_ENV=development concurrently 'npm run watch' 'npm run serve'"
1212
},
1313
"dependencies": {
1414
"@modelcontextprotocol/ext-apps": "../..",

examples/basic-server-vanillajs/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
"private": true,
55
"type": "module",
66
"scripts": {
7-
"build": "INPUT=mcp-app.html vite build",
8-
"watch": "INPUT=mcp-app.html vite build --watch",
7+
"build": "cross-env INPUT=mcp-app.html vite build",
8+
"watch": "cross-env INPUT=mcp-app.html vite build --watch",
99
"serve": "bun server.ts",
10-
"start": "NODE_ENV=development npm run build && npm run serve",
11-
"dev": "NODE_ENV=development concurrently 'npm run watch' 'npm run serve'"
10+
"start": "cross-env NODE_ENV=development npm run build && npm run serve",
11+
"dev": "cross-env NODE_ENV=development concurrently 'npm run watch' 'npm run serve'"
1212
},
1313
"dependencies": {
1414
"@modelcontextprotocol/ext-apps": "../..",

examples/budget-allocator-server/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
"private": true,
55
"type": "module",
66
"scripts": {
7-
"build": "INPUT=mcp-app.html vite build",
8-
"watch": "INPUT=mcp-app.html vite build --watch",
7+
"build": "cross-env INPUT=mcp-app.html vite build",
8+
"watch": "cross-env INPUT=mcp-app.html vite build --watch",
99
"serve:http": "bun server.ts",
1010
"serve:stdio": "bun server.ts --stdio",
1111
"start": "npm run start:http",
12-
"start:http": "NODE_ENV=development npm run build && npm run serve:http",
13-
"start:stdio": "NODE_ENV=development npm run build && npm run serve:stdio",
14-
"dev": "NODE_ENV=development concurrently 'npm run watch' 'npm run serve:http'"
12+
"start:http": "cross-env NODE_ENV=development npm run build && npm run serve:http",
13+
"start:stdio": "cross-env NODE_ENV=development npm run build && npm run serve:stdio",
14+
"dev": "cross-env NODE_ENV=development concurrently 'npm run watch' 'npm run serve:http'"
1515
},
1616
"dependencies": {
1717
"@modelcontextprotocol/ext-apps": "../..",

examples/cohort-heatmap-server/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
"private": true,
55
"type": "module",
66
"scripts": {
7-
"build": "INPUT=mcp-app.html vite build",
8-
"watch": "INPUT=mcp-app.html vite build --watch",
7+
"build": "cross-env INPUT=mcp-app.html vite build",
8+
"watch": "cross-env INPUT=mcp-app.html vite build --watch",
99
"serve:http": "bun server.ts",
1010
"serve:stdio": "bun server.ts --stdio",
1111
"start": "npm run start:http",
12-
"start:http": "NODE_ENV=development npm run build && npm run serve:http",
13-
"start:stdio": "NODE_ENV=development npm run build && npm run serve:stdio",
14-
"dev": "NODE_ENV=development concurrently 'npm run watch' 'npm run serve:http'"
12+
"start:http": "cross-env NODE_ENV=development npm run build && npm run serve:http",
13+
"start:stdio": "cross-env NODE_ENV=development npm run build && npm run serve:stdio",
14+
"dev": "cross-env NODE_ENV=development concurrently 'npm run watch' 'npm run serve:http'"
1515
},
1616
"dependencies": {
1717
"@modelcontextprotocol/ext-apps": "../..",

examples/customer-segmentation-server/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
"private": true,
55
"type": "module",
66
"scripts": {
7-
"build": "INPUT=mcp-app.html vite build",
8-
"watch": "INPUT=mcp-app.html vite build --watch",
7+
"build": "cross-env INPUT=mcp-app.html vite build",
8+
"watch": "cross-env INPUT=mcp-app.html vite build --watch",
99
"serve:http": "bun server.ts",
1010
"serve:stdio": "bun server.ts --stdio",
1111
"start": "npm run start:http",
12-
"start:http": "NODE_ENV=development npm run build && npm run serve:http",
13-
"start:stdio": "NODE_ENV=development npm run build && npm run serve:stdio",
14-
"dev": "NODE_ENV=development concurrently 'npm run watch' 'npm run serve:http'"
12+
"start:http": "cross-env NODE_ENV=development npm run build && npm run serve:http",
13+
"start:stdio": "cross-env NODE_ENV=development npm run build && npm run serve:stdio",
14+
"dev": "cross-env NODE_ENV=development concurrently 'npm run watch' 'npm run serve:http'"
1515
},
1616
"dependencies": {
1717
"@modelcontextprotocol/ext-apps": "../..",

examples/scenario-modeler-server/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
"private": true,
55
"type": "module",
66
"scripts": {
7-
"build": "INPUT=mcp-app.html vite build",
8-
"watch": "INPUT=mcp-app.html vite build --watch",
7+
"build": "cross-env INPUT=mcp-app.html vite build",
8+
"watch": "cross-env INPUT=mcp-app.html vite build --watch",
99
"serve:http": "bun server.ts",
1010
"serve:stdio": "bun server.ts --stdio",
1111
"start": "npm run start:http",
12-
"start:http": "NODE_ENV=development npm run build && npm run serve:http",
13-
"start:stdio": "NODE_ENV=development npm run build && npm run serve:stdio",
14-
"dev": "NODE_ENV=development concurrently 'npm run watch' 'npm run serve:http'"
12+
"start:http": "cross-env NODE_ENV=development npm run build && npm run serve:http",
13+
"start:stdio": "cross-env NODE_ENV=development npm run build && npm run serve:stdio",
14+
"dev": "cross-env NODE_ENV=development concurrently 'npm run watch' 'npm run serve:http'"
1515
},
1616
"dependencies": {
1717
"@modelcontextprotocol/ext-apps": "../..",

examples/system-monitor-server/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
"private": true,
55
"type": "module",
66
"scripts": {
7-
"build": "INPUT=mcp-app.html vite build",
8-
"watch": "INPUT=mcp-app.html vite build --watch",
7+
"build": "cross-env INPUT=mcp-app.html vite build",
8+
"watch": "cross-env INPUT=mcp-app.html vite build --watch",
99
"serve:http": "bun server.ts",
1010
"serve:stdio": "bun server.ts --stdio",
1111
"start": "npm run start:http",
12-
"start:http": "NODE_ENV=development npm run build && npm run serve:http",
13-
"start:stdio": "NODE_ENV=development npm run build && npm run serve:stdio",
14-
"dev": "NODE_ENV=development concurrently 'npm run watch' 'npm run serve:http'"
12+
"start:http": "cross-env NODE_ENV=development npm run build && npm run serve:http",
13+
"start:stdio": "cross-env NODE_ENV=development npm run build && npm run serve:stdio",
14+
"dev": "cross-env NODE_ENV=development concurrently 'npm run watch' 'npm run serve:http'"
1515
},
1616
"dependencies": {
1717
"@modelcontextprotocol/ext-apps": "../..",

examples/threejs-server/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
"private": true,
55
"type": "module",
66
"scripts": {
7-
"build": "INPUT=mcp-app.html vite build",
8-
"watch": "INPUT=mcp-app.html vite build --watch",
7+
"build": "cross-env INPUT=mcp-app.html vite build",
8+
"watch": "cross-env INPUT=mcp-app.html vite build --watch",
99
"serve:http": "bun server.ts",
1010
"serve:stdio": "bun server.ts --stdio",
1111
"start": "npm run start:http",
12-
"start:http": "NODE_ENV=development npm run build && npm run serve:http",
13-
"start:stdio": "NODE_ENV=development npm run build && npm run serve:stdio",
14-
"dev": "NODE_ENV=development concurrently 'npm run watch' 'npm run serve:http'"
12+
"start:http": "cross-env NODE_ENV=development npm run build && npm run serve:http",
13+
"start:stdio": "cross-env NODE_ENV=development npm run build && npm run serve:stdio",
14+
"dev": "cross-env NODE_ENV=development concurrently 'npm run watch' 'npm run serve:http'"
1515
},
1616
"dependencies": {
1717
"@modelcontextprotocol/ext-apps": "../..",

0 commit comments

Comments
 (0)