Skip to content

[heft-config-file] Add precompiled JSON schema validator support - #6100

Draft
David Michon (dmichon-msft) with Copilot wants to merge 2 commits into
mainfrom
copilot/schema-precompilation-support
Draft

David Michon (dmichon-msft) with Copilot wants to merge 2 commits into
mainfrom
copilot/schema-precompilation-support

Conversation

Copilot AI commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Schema publishers currently compile AJV validators at runtime. This PR introduces build-time precompilation and a path for configuration loaders to use the generated validators while continuing to publish JSON schemas.

  • Generation: Add a built-in Heft task plugin that emits standalone CommonJS validators from *.schema.json files. Generated modules resolve AJV runtime dependencies through @rushstack/node-core-library.
  • Runtime: Add jsonSchemaValidator to heft-config-file and have Heft plugin option-schema loading prefer a generated validator when present.
new ProjectConfigurationFile({
  projectRelativeFilePath: 'config/my-plugin.json',
  jsonSchemaValidator: require('./schemas/my-plugin.validator.cjs')
});

This establishes the precompilation path; schema-publishing projects are not yet migrated to run the new task.

Copilot AI and others added 2 commits September 29, 2026 20:45
Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com>
Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com>
Copilot AI changed the title [heft-config-file] Add support for precompiled JSON schema validation [heft-config-file] Add precompiled JSON schema validator support Sep 29, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Needs triage

Development

Successfully merging this pull request may close these issues.

2 participants