Skip to content

Commit 0c7daa0

Browse files
chore: refactor docs generating (#55)
* add script `npm run docs` that builds, generate docs and runs formatter to auto fix formatting after doc generation * rename generate-docs to docs:generate * update presubmit workflow * add docs process to contributing.md
1 parent a6923b8 commit 0c7daa0

File tree

5 files changed

+9
-4
lines changed

5 files changed

+9
-4
lines changed

.github/workflows/presubmit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
run: npm ci
5050

5151
- name: Generate documents
52-
run: npm run generate-docs && npm run format
52+
run: npm run docs
5353

5454
- name: Check if autogenerated docs differ
5555
run: |

CONTRIBUTING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,7 @@ npx @modelcontextprotocol/inspector node build/src/index.js --log-file=/your/des
8181
```
8282

8383
You can use the `DEBUG` environment variable as usual to control categories that are logged.
84+
85+
### Updating documentation
86+
87+
When adding a new tool or updating a tool name or description, make sure to run `npm run docs` to generate the tool reference documentation.

docs/tool-reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- AUTO GENERATED DO NOT EDIT - run 'npm run generate-docs' to update-->
1+
<!-- AUTO GENERATED DO NOT EDIT - run 'npm run docs' to update-->
22

33
# Chrome DevTools MCP Tool Reference
44

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"typecheck": "tsc --noEmit",
1313
"format": "eslint --cache --fix . ;prettier --write --cache .",
1414
"check-format": "eslint --cache .; prettier --check --cache .;",
15-
"generate-docs": "npm run build && node --experimental-strip-types scripts/generate-docs.ts",
15+
"docs": "npm run build && npm run docs:generate && npm run format",
16+
"docs:generate": "node --experimental-strip-types scripts/generate-docs.ts",
1617
"start": "npm run build && node build/src/index.js",
1718
"start-debug": "DEBUG=mcp:* DEBUG_COLORS=false npm run build && node build/src/index.js",
1819
"test": "npm run build && node --require ./build/tests/setup.js --test-reporter spec --test-force-exit --test 'build/tests/**/*.test.js'",

scripts/generate-docs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ async function generateToolDocumentation(): Promise<void> {
190190
console.log(`Found ${tools.length} tools`);
191191

192192
// Generate markdown documentation
193-
let markdown = `<!-- AUTO GENERATED DO NOT EDIT - run 'npm run generate-docs' to update-->
193+
let markdown = `<!-- AUTO GENERATED DO NOT EDIT - run 'npm run docs' to update-->
194194
195195
# Chrome DevTools MCP Tool Reference
196196

0 commit comments

Comments
 (0)