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
This commit is contained in:
David Soria Parra 2026-01-27 22:16:52 +00:00
commit 39f4178bc8
No known key found for this signature in database
4 changed files with 34 additions and 14 deletions

0
.prototools Normal file
View file

View file

@ -37,9 +37,26 @@ JSON examples live in `schema/[version]/examples/[TypeName]/`:
## Useful Commands
```bash
# Dev servers
npm run serve:docs # Local Mintlify docs server
npm run serve:blog # Local Hugo blog server
# Generation (run after editing source files)
npm run generate # Generate all (schema + SEPs)
npm run generate:schema # Generate JSON schemas + MDX from TypeScript
npm run check:docs # Check formatting and links
npm run generate:seps # Generate SEP documents
# Formatting
npm run format # Format all (docs + schema)
npm run format:docs # Format markdown/MDX files
npm run format:schema # Format schema TypeScript files
# Checks
npm run check # Run all checks
npm run check:schema # Check schema (TS, JSON, examples, MDX)
npm run check:docs # Check docs (format, comments, links)
npm run check:seps # Check SEP documents
# Workflow
npm run prep # Full prep before committing (check, generate, format)
```

View file

@ -72,7 +72,7 @@ npm run format
> [!NOTE]
> You can run all schema/documentation
> changes at once with `npm run prep:changes`.
> changes at once with `npm run prep`.
## Blog changes

View file

@ -21,25 +21,28 @@
]
},
"scripts": {
"generate": "npm run generate:schema && npm run generate:seps",
"generate:schema": "npm run generate:schema:json & npm run generate:schema:md & wait",
"generate:schema:json": "tsx scripts/generate-schemas.ts",
"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'",
"generate:seps": "tsx scripts/render-seps.ts",
"format": "npm run format:docs && npm run format:schema",
"format:docs": "prettier --write \"**/*.{md,mdx}\" --ignore-path .prettierignore",
"format:schema": "prettier --write \"schema/**/*.ts\"",
"check": "npm run check:schema && npm run check:docs && npm run check:seps",
"check:seps": "tsx scripts/render-seps.ts --check",
"check:docs": "npm run check:docs:format && npm run check:docs:js-comments && npm run check:docs:links",
"check:docs:format": "prettier --check \"**/*.{md,mdx}\"",
"check:docs:js-comments": "tsx scripts/check-mdx-comments.ts",
"check:docs:links": "cd docs && npx mint broken-links",
"check:schema": "npm run check:schema:ts && npm run check:schema:json && npm run check:schema:examples && npm run check:schema:md",
"check:schema:ts": "tsc --noEmit && eslint schema/ && prettier --check \"schema/**/*.ts\"",
"check:schema:json": "tsx scripts/generate-schemas.ts --check",
"check:schema:examples": "tsx scripts/validate-examples.ts",
"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",
"format": "prettier --write \"**/*.{md,mdx}\" --ignore \"docs/specification/*/schema.mdx\" ",
"generate:schema": "npm run generate:schema:json & npm run generate:schema:md & wait",
"generate:seps": "tsx scripts/render-seps.ts",
"generate:schema:json": "tsx scripts/generate-schemas.ts",
"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'",
"prep:changes": "npm run check:schema:ts && npm run generate:schema && npm run check:docs && npm run format",
"check:docs": "npm run check:docs:format && npm run check:docs:js-comments && npm run check:docs:links",
"check:docs:format": "prettier --check \"**/*.{md,mdx}\"",
"check:docs:js-comments": "tsx scripts/check-mdx-comments.ts",
"check:docs:links": "cd docs && npx mint broken-links",
"check:seps": "tsx scripts/render-seps.ts --check",
"serve:docs": "cd docs && npx mint dev",
"serve:blog": "cd blog && hugo serve"
"serve:blog": "cd blog && hugo serve",
"prep": "npm run check:schema:ts && npm run generate && npm run check:docs && npm run format"
},
"devDependencies": {
"@eslint/js": "^9.8.0",