Skip to content

fix(core): allow any framework value in preset generator schema #31665

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

FrozenPandaz
Copy link
Collaborator

Current Behavior

When using third-party presets with npx create-nx-workspace, passing framework values other than the predefined backend frameworks fails with a schema validation error:

Error: Property 'framework' does not match the schema. 'angular' should be one of express,koa,fastify,nest,none.

For example:

npx create-nx-workspace --preset=@rig/cli@alpha --framework=angular --theme=pcb --name=hello-world

Expected Behavior

Third-party presets should be able to pass any framework value without schema validation errors, allowing for greater flexibility in the Nx ecosystem.

Related Issue(s)

This fixes the issue where third-party presets cannot pass framework values like 'angular', 'react', 'vue', etc., due to overly restrictive schema validation.

Changes

  • Removed the enum constraint from the framework property in the workspace preset generator schema
  • The property remains a string type but now accepts any value
  • Maintains backward compatibility with existing functionality

The built-in Nx preset generators still only handle frameworks they know about, but the schema validation no longer blocks third-party presets from passing other framework values.

Test plan

  • Workspace package builds successfully
  • Schema validation allows any string value for framework property
  • Backward compatibility maintained for existing presets
  • Manual test: npx create-nx-workspace --preset=@rig/cli@alpha --framework=angular should work without schema validation errors

@FrozenPandaz FrozenPandaz requested review from a team as code owners June 20, 2025 14:29
Copy link

vercel bot commented Jun 20, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nx-dev ❌ Failed (Inspect) Jun 20, 2025 7:50pm

Copy link

nx-cloud bot commented Jun 20, 2025

View your CI Pipeline Execution ↗ for commit 76fa13d.

Command Status Duration Result
nx documentation ❌ Failed 1m 16s View ↗

☁️ Nx Cloud last updated this comment at 2025-06-20 19:31:48 UTC

third-party presets can now pass any value for framework, linter, bundler,
unitTestRunner, e2eTestRunner, formatter, and packageManager properties
without schema validation errors. previously, these properties were
restricted to specific enum values, but third-party presets need
flexibility to use other tools.

fixes issue where npx create-nx-workspace --preset=@rig/cli@alpha --framework=angular
would fail with schema validation error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants