json-schema-artifact is a utility designed to bundle and optimize JSON Schemas, facilitating their use in development and production environments. Currently at version 2.0.3, this project shows active development with recent patch releases in the v2 series. Its release cadence appears to follow common open-source practices, with updates occurring as needed to introduce features, fix bugs, and align with evolving JSON Schema specifications. Key differentiators include robust support for multiple configuration formats (ESM, JSON, YAML, TypeScript) via `defineConfig`, built-in optimization options such as minification and dereferencing, and an integrated localization system that supports `t('key')` syntax for dynamic content. It also features a watch mode for development and provides direct integration recommendations for VSCode's schema validation, making it a comprehensive solution for managing complex JSON Schema ecosystems.
npm install json-schema-artifactVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to configure json-schema-artifact using an ESM file, bundling a main schema, including localized content, applying optimizations like minification and dereferencing, and setting up watch paths for development.
Consult the official `json-schema-artifact` GitHub repository or npm page for a detailed changelog or migration guide for version 2.0.0. Adapt configuration files and schema definitions as necessary.
Verify the `key` string in `t('key')` against the structure of your locale files. Use valid JSONPath expressions. Check console output for warnings about unresolved localization keys during the build process.For `defineConfig`, ensure your configuration file is named `.mjs` or `.ts` and that your project environment supports ESM imports. For static configurations, use `.json` or `.yaml` files directly without the `defineConfig` wrapper.
Periodically verify that the `url` in `.vscode/settings.json` matches the actual output path and filename (including any locale suffixes) of the generated schema artifacts. Rebuild your schemas after configuration changes to confirm output paths.
Rename your configuration file to `json-schema-artifact.mjs` or `json-schema-artifact.ts`, or ensure your `package.json` contains `"type": "module"` if using a `.js` extension for ESM. If using CommonJS, define your configuration as a plain JSON or YAML file.
Create a configuration file in the project root with one of the supported names, or explicitly specify its path using `npx json-schema-artifact --config ./path/to/my-config.mjs`.
Verify that all `$ref` paths in your schemas are correct relative to the input file or other known schema locations. Ensure referenced files exist and are accessible by the bundler. Check for typos or incorrect base URIs.
Review your locale files (e.g., `locales/en.yaml`) to ensure that the JSONPath `my.missing.key` exists and has a defined value. Correct the key in your schema or add the missing entry to the locale file.
No dependency data recorded yet.