Skip to content

Commit da31ad9

Browse files
authored
Merge pull request modelcontextprotocol#647 from jonathanhefner/consolidate-check-scripts
Consolidate check scripts
2 parents 6a46454 + 1e3889d commit da31ad9

File tree

4 files changed

+26
-24
lines changed

4 files changed

+26
-24
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ jobs:
1818

1919
- run: npm ci
2020

21-
- run: npm run validate:schema
21+
- name: Check TypeScript definitions
22+
run: npm run check:schema:ts
2223

23-
- run: npm run generate:json
2424
- name: Verify that `npm run generate:json` did not change outputs (if it did, please re-run it and re-commit!)
25-
run: git diff --exit-code
25+
run: npm run check:schema:json

.github/workflows/markdown-format.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,7 @@ jobs:
2525
run: npm ci
2626

2727
- name: Check markdown formatting
28-
run: npm run format:check
28+
run: npm run check:docs:format
29+
30+
- name: Check markdown links
31+
run: npm run check:docs:links

CONTRIBUTING.md

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,39 +33,34 @@ npm install # install dependencies
3333
## Making Changes
3434

3535
Note that schema changes are made to `schema.ts`, and `schema.json` is generated from
36-
`schema.ts`. You should validate your `schema.ts` changes first and then generate the
37-
`schema.json`.
36+
`schema.ts`.
3837

3938
1. Create a new branch:
4039

4140
```bash
4241
git checkout -b feature/your-feature-name
4342
```
4443

45-
2. Make your changes
46-
3. Validate your changes:
44+
2. Make your changes.
4745

48-
```bash
49-
npm run validate:schema # validate schema
50-
```
51-
52-
4. Generate the `schema.json`:
46+
3. Validate schema changes and generate `schema.json`:
5347

5448
```bash
55-
npm run generate:json # generate JSON schema
49+
npm run check:schema:ts
50+
npm run generate:json
5651
```
5752

58-
5. Run docs locally (optional):
53+
4. Validate documentation changes and apply formatting:
5954

6055
```bash
61-
npm run serve:docs
56+
npm run check:docs
57+
npm run format
6258
```
6359

64-
6. Format/lint your changes:
60+
5. Preview documentation locally (optional):
6561

6662
```bash
67-
npm run format:check # check formatting
68-
npm run format # apply formatting
63+
npm run serve:docs
6964
```
7065

7166
### Documentation Guidelines
@@ -77,7 +72,7 @@ When contributing to the documentation:
7772
- Include code examples where appropriate
7873
- Use proper MDX formatting and components
7974
- Test all links and code samples
80-
- You may run `npm run check-links` to look for broken internal links.
75+
- You may run `npm run check:docs:links` to look for broken internal links.
8176
- Use appropriate headings: "When to use", "Steps", and "Tips" for tutorials
8277
- Place new pages in appropriate sections (concepts, tutorials, etc.)
8378
- Update `docs.json` when adding new pages

package.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,16 @@
2121
]
2222
},
2323
"scripts": {
24-
"validate:schema": "tsc",
24+
"check": "npm run check:schema && npm run check:docs",
25+
"check:schema": "npm run check:schema:ts && npm run check:schema:json",
26+
"check:schema:ts": "tsc",
27+
"check:schema:json": "for f in schema/*/schema.ts; do typescript-json-schema --defaultNumberType integer --required --skipLibCheck \"$f\" \"*\" | cat | cmp \"${f%ts}json\" - || exit 1; done",
28+
"check:docs": "npm run check:docs:format && npm run check:docs:links",
29+
"check:docs:format": "prettier --check \"**/*.{md,mdx}\"",
30+
"check:docs:links": "cd docs && mintlify broken-links",
2531
"generate:json": "for f in schema/*/schema.ts; do typescript-json-schema --defaultNumberType integer --required --skipLibCheck \"$f\" \"*\" -o \"${f%ts}json\"; done",
26-
"serve:docs": "cd docs && mintlify dev",
2732
"format": "prettier --write \"**/*.{md,mdx}\"",
28-
"format:check": "prettier --check \"**/*.{md,mdx}\"",
29-
"check-links": "cd docs && mintlify broken-links"
33+
"serve:docs": "cd docs && mintlify dev"
3034
},
3135
"devDependencies": {
3236
"ajv": "^8.17.1",

0 commit comments

Comments
 (0)