Skip to content

Commit 39f4178

Browse files
committed
Reorganize npm scripts for consistency
- Add umbrella 'generate' command (schema + SEPs) - Split 'format' into format:docs and format:schema with umbrella - Rename prep:changes to prep - Reorder scripts logically: generate → format → check → serve → prep - Update CLAUDE.md and CONTRIBUTING.md to reflect changes
1 parent f88a634 commit 39f4178

4 files changed

Lines changed: 34 additions & 14 deletions

File tree

.prototools

Whitespace-only changes.

AGENTS.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,26 @@ JSON examples live in `schema/[version]/examples/[TypeName]/`:
3737
## Useful Commands
3838

3939
```bash
40+
# Dev servers
4041
npm run serve:docs # Local Mintlify docs server
4142
npm run serve:blog # Local Hugo blog server
43+
44+
# Generation (run after editing source files)
45+
npm run generate # Generate all (schema + SEPs)
4246
npm run generate:schema # Generate JSON schemas + MDX from TypeScript
43-
npm run check:docs # Check formatting and links
47+
npm run generate:seps # Generate SEP documents
48+
49+
# Formatting
50+
npm run format # Format all (docs + schema)
51+
npm run format:docs # Format markdown/MDX files
52+
npm run format:schema # Format schema TypeScript files
53+
54+
# Checks
4455
npm run check # Run all checks
56+
npm run check:schema # Check schema (TS, JSON, examples, MDX)
57+
npm run check:docs # Check docs (format, comments, links)
58+
npm run check:seps # Check SEP documents
59+
60+
# Workflow
61+
npm run prep # Full prep before committing (check, generate, format)
4562
```

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ npm run format
7272

7373
> [!NOTE]
7474
> You can run all schema/documentation
75-
> changes at once with `npm run prep:changes`.
75+
> changes at once with `npm run prep`.
7676
7777
## Blog changes
7878

package.json

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,28 @@
2121
]
2222
},
2323
"scripts": {
24+
"generate": "npm run generate:schema && npm run generate:seps",
25+
"generate:schema": "npm run generate:schema:json & npm run generate:schema:md & wait",
26+
"generate:schema:json": "tsx scripts/generate-schemas.ts",
27+
"generate:schema:md": "find schema/*/schema.mdx -print0 | xargs -0 -P 0 -I {} sh -c 'f=\"{}\"; typedoc --entryPoints \"${f%.mdx}.ts\" --schemaPageTemplate \"$f\" > docs/specification/$(basename -- $(dirname -- \"$f\"))/schema.mdx'",
28+
"generate:seps": "tsx scripts/render-seps.ts",
29+
"format": "npm run format:docs && npm run format:schema",
30+
"format:docs": "prettier --write \"**/*.{md,mdx}\" --ignore-path .prettierignore",
31+
"format:schema": "prettier --write \"schema/**/*.ts\"",
2432
"check": "npm run check:schema && npm run check:docs && npm run check:seps",
25-
"check:seps": "tsx scripts/render-seps.ts --check",
26-
"check:docs": "npm run check:docs:format && npm run check:docs:js-comments && npm run check:docs:links",
27-
"check:docs:format": "prettier --check \"**/*.{md,mdx}\"",
28-
"check:docs:js-comments": "tsx scripts/check-mdx-comments.ts",
29-
"check:docs:links": "cd docs && npx mint broken-links",
3033
"check:schema": "npm run check:schema:ts && npm run check:schema:json && npm run check:schema:examples && npm run check:schema:md",
3134
"check:schema:ts": "tsc --noEmit && eslint schema/ && prettier --check \"schema/**/*.ts\"",
3235
"check:schema:json": "tsx scripts/generate-schemas.ts --check",
3336
"check:schema:examples": "tsx scripts/validate-examples.ts",
3437
"check:schema:md": "for f in schema/*/schema.mdx; do typedoc --entryPoints \"${f%.mdx}.ts\" --schemaPageTemplate \"$f\" | cmp docs/specification/$(basename -- $(dirname -- \"$f\"))/schema.mdx - || exit 1; done",
35-
"format": "prettier --write \"**/*.{md,mdx}\" --ignore \"docs/specification/*/schema.mdx\" ",
36-
"generate:schema": "npm run generate:schema:json & npm run generate:schema:md & wait",
37-
"generate:seps": "tsx scripts/render-seps.ts",
38-
"generate:schema:json": "tsx scripts/generate-schemas.ts",
39-
"generate:schema:md": "find schema/*/schema.mdx -print0 | xargs -0 -P 0 -I {} sh -c 'f=\"{}\"; typedoc --entryPoints \"${f%.mdx}.ts\" --schemaPageTemplate \"$f\" > docs/specification/$(basename -- $(dirname -- \"$f\"))/schema.mdx'",
40-
"prep:changes": "npm run check:schema:ts && npm run generate:schema && npm run check:docs && npm run format",
38+
"check:docs": "npm run check:docs:format && npm run check:docs:js-comments && npm run check:docs:links",
39+
"check:docs:format": "prettier --check \"**/*.{md,mdx}\"",
40+
"check:docs:js-comments": "tsx scripts/check-mdx-comments.ts",
41+
"check:docs:links": "cd docs && npx mint broken-links",
42+
"check:seps": "tsx scripts/render-seps.ts --check",
4143
"serve:docs": "cd docs && npx mint dev",
42-
"serve:blog": "cd blog && hugo serve"
44+
"serve:blog": "cd blog && hugo serve",
45+
"prep": "npm run check:schema:ts && npm run generate && npm run check:docs && npm run format"
4346
},
4447
"devDependencies": {
4548
"@eslint/js": "^9.8.0",

0 commit comments

Comments
 (0)