https://github.com/ffflorian/schemastore-updater
Publish schema files as TypeScript definitions on npm
https://github.com/ffflorian/schemastore-updater
schema-files schemastore typescript typescript-definitions
Last synced: 20 days ago
JSON representation
Publish schema files as TypeScript definitions on npm
- Host: GitHub
- URL: https://github.com/ffflorian/schemastore-updater
- Owner: ffflorian
- License: gpl-3.0
- Created: 2018-07-23T12:59:18.000Z (almost 8 years ago)
- Default Branch: main
- Last Pushed: 2026-06-22T13:57:30.000Z (29 days ago)
- Last Synced: 2026-06-22T15:29:33.094Z (28 days ago)
- Topics: schema-files, schemastore, typescript, typescript-definitions
- Language: TypeScript
- Homepage: https://npmjs.com/org/schemastore
- Size: 21.7 MB
- Stars: 26
- Watchers: 1
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Security: SECURITY.md
- Agents: AGENTS.md
Awesome Lists containing this project
README
# schemastore-updater
This project updates JSON schemas from [SchemaStore](https://github.com/SchemaStore/schemastore), generates TypeScript definitions for them, and prepares a publishable npm package per schema under the `@schemastore` scope.
## Agent Notes
For coding-agent specific workflows, repository conventions, and safety rules, see [AGENTS.md](./AGENTS.md).
## What it does
- Clones/updates `SchemaStore/schemastore` automatically (or uses `--source-dir`).
- Converts JSON schemas with `json-schema-to-typescript`.
- Creates an npm package folder per schema under `schemas/`.
- Generates `index.d.ts`, `README.md`, `package.json`, and `LICENSE` for each schema package.
- Type-checks each generated schema declaration immediately after generation.
- Writes a lock file (`schema-lock.json`) with SHA-256 hashes for generated declaration files.
- Skips schemas that cannot be converted or do not type-check.
- Skips non-publishable schemas listed in `schema-blocklist.json` (manually maintained) during both generation and publishing.
## Prerequisites
- [Node.js](https://nodejs.org/) >= 24
- [yarn](https://yarnpkg.com/)
## Usage
```bash
yarn install
yarn update
```
Options:
- `-f, --force`: regenerate all schemas.
- `--source-dir `: use an existing local SchemaStore directory.
## Testing
```bash
yarn test
```
Watch mode:
```bash
yarn test:watch
```
## Publishing
```bash
yarn publish:schemas
```
Publishing attempts every generated schema package under `schemas/`. If one package fails to publish, the remaining packages are still attempted. Publish failures are written to `publish-errors.log`.
Schemas listed in `schema-blocklist.json` are always skipped from publishing.
The publish workflow opens a pull request with an updated `schema-lock.json` file after publish attempts so published package versions are tracked in git.
All published schemastore packages are visible under the [@schemastore](https://www.npmjs.com/org/schemastore) npm organization page.
Dry-run mode:
```bash
yarn publish:schemas:dry-run
```
This prints the packages that would be published without sending anything to npm.
## Output
- Per-schema npm packages: `schemas//`
- Generated declaration per package: `schemas//index.d.ts`
- Package license per package: `schemas//LICENSE`
- Lock file: `schema-lock.json`