Skip to content

Commit c58e264

Browse files
committed
refactor: replace JSON Schema + AJV with Zod-first architecture
Zod schemas are now the single source of truth for input/output validation, MCP tool definitions, REST route schemas, and OpenAPI spec derivation. All artefacts are built at runtime from Zod schemas using z.toJSONSchema() and safeParse(), eliminating the need for a pre-build code generation step. Changes: - Add zod@4.3.6 as dependency - Add src/schemas/ with Zod schemas, validators, MCP tools, API routes, and OpenAPI spec builder - Remove src/generated/ and src/generated-stubs/ (all generated code) - Remove scripts/generate-schemas.js and its test - Remove ajv and ts-json-schema-generator dependencies - Remove generate:schemas from build pipeline and CI workflows - Update mcp-server.ts and api-server.ts imports to src/schemas/ - Update test imports from generated/ to schemas/ - Update tsconfig: module/moduleResolution to NodeNext/nodenext, add types: ["node"], fix missing comma - Update CI workflows: remove generate:schemas steps - Pin vitest@3.2.3 (update broke mock compatibility)
1 parent 1e40388 commit c58e264

32 files changed

Lines changed: 1098 additions & 5498 deletions

.github/workflows/cross-platform-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,6 @@ jobs:
154154
ls -la test-data/cross-platform/
155155
shell: bash
156156

157-
- name: Generate schemas (required for TypeScript compilation)
158-
run: pnpm run generate:schemas
159-
160157
- name: Build project
161158
run: pnpm run build
162159

.github/workflows/main.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,6 @@ jobs:
130130
git push
131131
fi
132132
133-
# Generate required files before quality checks
134-
- name: Generate schemas (required for TypeScript compilation)
135-
run: pnpm run generate:schemas
136-
137-
- name: Format generated files
138-
run: pnpm run format
139-
140133
# Quality checks (must pass for all further steps)
141134
- name: Run lint (fast fail)
142135
run: pnpm run lint

package.json

Lines changed: 32 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@
1919
"./package.json": "./package.json"
2020
},
2121
"scripts": {
22-
"build": "npm run generate:schemas && tsc",
23-
"dev": "npm run generate:schemas && tsc --watch",
24-
"generate:schemas": "node scripts/generate-schemas.js",
25-
"generate:schemas:watch": "nodemon --watch src/index.ts --watch src/commands/ --ext ts --exec \"npm run generate:schemas\"",
22+
"build": "tsc",
23+
"dev": "tsc --watch",
2624
"start": "node dist/cli.js",
2725
"mcp-server": "node dist/mcp-server.js",
2826
"api-server": "node dist/api-server.js",
@@ -72,50 +70,48 @@
7270
"author": "Joe Mearman",
7371
"license": "CC-BY-NC-SA-4.0",
7472
"devDependencies": {
75-
"@amanda-mitchell/semantic-release-npm-multiple": "^3.15.0",
76-
"@commitlint/cli": "^19.8.1",
77-
"@commitlint/config-conventional": "^19.8.1",
78-
"@eslint/js": "^9.28.0",
73+
"@amanda-mitchell/semantic-release-npm-multiple": "^3.17.0",
74+
"@commitlint/cli": "^20.5.0",
75+
"@commitlint/config-conventional": "^20.5.0",
76+
"@eslint/js": "^10.0.1",
7977
"@semantic-release/changelog": "^6.0.3",
8078
"@semantic-release/exec": "^7.1.0",
8179
"@semantic-release/git": "^10.0.1",
8280
"@types/mdast": "^4.0.4",
83-
"@types/node": "^24.0.1",
84-
"@types/unist": "^3.0.0",
85-
"@typescript-eslint/eslint-plugin": "^8.34.0",
86-
"@typescript-eslint/parser": "^8.34.0",
81+
"@types/node": "^25.6.0",
82+
"@types/unist": "^3.0.3",
83+
"@typescript-eslint/eslint-plugin": "^8.59.0",
84+
"@typescript-eslint/parser": "^8.59.0",
8785
"@vitest/coverage-v8": "^3.2.3",
88-
"ajv": "^8.17.1",
8986
"commitizen": "^4.3.1",
90-
"conventional-changelog-conventionalcommits": "^9.0.0",
87+
"conventional-changelog-conventionalcommits": "^9.3.1",
9188
"cz-conventional-changelog": "^3.3.0",
92-
"eslint": "^9.28.0",
93-
"eslint-config-prettier": "^10.1.5",
94-
"eslint-plugin-prettier": "^5.4.1",
95-
"jiti": "^2.4.2",
96-
"prettier": "^3.5.3",
97-
"prettier-plugin-jsdoc": "^1.3.2",
98-
"semantic-release": "^24.2.5",
99-
"ts-json-schema-generator": "^2.4.0",
100-
"tsx": "^4.19.4",
101-
"typedoc": "^0.28.5",
102-
"typedoc-material-theme": "^1.4.0",
103-
"typedoc-plugin-coverage": "^4.0.1",
104-
"typedoc-plugin-markdown": "^4.6.4",
105-
"typedoc-plugin-missing-exports": "^4.0.0",
106-
"typescript": "^5.0.0",
107-
"typescript-eslint": "^8.34.0",
89+
"eslint": "^10.2.1",
90+
"eslint-config-prettier": "^10.1.8",
91+
"eslint-plugin-prettier": "^5.5.5",
92+
"jiti": "^2.6.1",
93+
"prettier": "^3.8.3",
94+
"prettier-plugin-jsdoc": "^1.8.0",
95+
"semantic-release": "^25.0.3",
96+
"tsx": "^4.21.0",
97+
"typedoc": "^0.28.19",
98+
"typedoc-material-theme": "^1.4.1",
99+
"typedoc-plugin-coverage": "^4.0.3",
100+
"typedoc-plugin-markdown": "^4.11.0",
101+
"typedoc-plugin-missing-exports": "^4.1.3",
102+
"typescript": "^6.0.3",
103+
"typescript-eslint": "^8.59.0",
108104
"vitest": "^3.2.3"
109105
},
110106
"dependencies": {
111-
"@modelcontextprotocol/sdk": "^1.12.3",
112-
"commander": "^14.0.0",
113-
"glob": "^11.0.3",
114-
"remark": "^15.0.0",
107+
"@modelcontextprotocol/sdk": "^1.29.0",
108+
"commander": "^14.0.3",
109+
"glob": "^13.0.6",
110+
"remark": "^15.0.1",
115111
"remark-parse": "^11.0.0",
116112
"remark-stringify": "^11.0.0",
117-
"unified": "^11.0.0",
118-
"unist-util-visit": "^5.0.0",
113+
"unified": "^11.0.5",
114+
"unist-util-visit": "^5.1.0",
119115
"zod": "4.3.6"
120116
},
121117
"engines": {

0 commit comments

Comments
 (0)