-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat(core): add template support to create-nx-workspace #33468
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
base: master
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for nx-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
View your CI Pipeline Execution ↗ for commit f947d21
☁️ Nx Cloud last updated this comment at |
🐳 We have a release for that!This PR has a release associated with it. You can try it out using this command: npx [email protected] my-workspaceOr just copy this version and use it in your own command: 0.0.0-pr-33468-86c294c
To request a new release for this pull request, mention someone from the Nx team or the |
🐳 We have a release for that!This PR has a release associated with it. You can try it out using this command: npx [email protected] my-workspaceOr just copy this version and use it in your own command: 0.0.0-pr-33468-6e447bb
To request a new release for this pull request, mention someone from the Nx team or the |
🐳 We have a release for that!This PR has a release associated with it. You can try it out using this command: npx [email protected] my-workspaceOr just copy this version and use it in your own command: 0.0.0-pr-33468-7ba12c8
To request a new release for this pull request, mention someone from the Nx team or the |
🐳 We have a release for that!This PR has a release associated with it. You can try it out using this command: npx [email protected] my-workspaceOr just copy this version and use it in your own command: 0.0.0-pr-33468-10b2f55
To request a new release for this pull request, mention someone from the Nx team or the |
🐳 We have a release for that!This PR has a release associated with it. You can try it out using this command: npx [email protected] my-workspaceOr just copy this version and use it in your own command: 0.0.0-pr-33468-1bdc579
To request a new release for this pull request, mention someone from the Nx team or the |
Add template support to create-nx-workspace so we can generate full examples quicker. Key features: - Template prompt: Interactive selection of Empty/TypeScript/React/Angular templates - Simplified Cloud prompt: Yes/no choice instead of CI provider selection - A/B testing: Three message variants for Cloud prompt optimization
Add A/B testing tracking for simplified Cloud prompt variants used in template flow. This allows us to measure which prompt wording is most effective at getting users to connect to Nx Cloud. ## Changes - Add metaCode field to setupNxCloudSimple variants (green-prs, remote-cache, fast-ci) - Capture prompt variant code after user selection - Pass prompt code through function chain to URL generation - Combine prompt code with success message code in meta parameter - Track prompt variant in recordStat telemetry ## URL Meta Format The meta parameter now tracks both A/B tests in format: "prompt-code:success-code" Examples: - green-prs:template-cloud-connect-v1 - remote-cache:template-cloud-connect-v2 - fast-ci:template-cloud-connect-v3 This creates a 3×3 matrix allowing us to track which prompt wording AND success message wording performed best. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Rename function to match the updated message key naming convention (setupNxCloudV2). This makes the codebase more consistent. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Previously, the template flow was not calling connectToNxCloud generator, which meant no Cloud workspace was created and nxCloudId remained undefined. This caused readNxCloudToken to return undefined. Now the template flow calls connectToNxCloud after installing dependencies, which creates the Cloud workspace and writes nxCloudId to nx.json. The preset flow is unchanged and continues to call connectToNxCloud through the workspace generator as before. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Adds a 'Custom' option to the starter selection that redirects to the original preset-based flow, giving users access to more configuration options including: - Framework selection - Test runner choices - Bundler options - And other preset-specific configurations When 'Custom' is selected, the flow returns 'skip' which triggers the preset flow instead of the template flow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nx Cloud is proposing a fix for your failed CI:
These changes fix the TypeScript compilation error by updating the test file to use the new getCompletionMessage function instead of the removed getMessageFactory. The PR refactored the message system from a factory pattern to a simpler direct function call, and these test updates ensure the test suite correctly validates the new API while maintaining all original test scenarios and expectations.
We verified this fix by re-running create-nx-workspace:test.
Warning
The suggested diff is too large to display here, but you can view it on Nx Cloud ↗
Or Apply changes locally with:
npx nx-cloud apply-locally Nnvu-1DrW
Apply fix locally with your editor ↗ View interactive diff ↗
🎓 Learn more about Self-Healing CI on nx.dev
🐳 We have a release for that!This PR has a release associated with it. You can try it out using this command: npx [email protected] my-workspaceOr just copy this version and use it in your own command: 0.0.0-pr-33468-9553ce4
To request a new release for this pull request, mention someone from the Nx team or the |
| require('fs').appendFileSync( | ||
| '/tmp/nx-cloud-onboarding-url.txt', | ||
| `${x} - ${meta}\n` | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debug code left in production. This writes onboarding URL data to /tmp/nx-cloud-onboarding-url.txt on every workspace creation, which will fail on Windows systems (no /tmp directory) and cause permission issues in restricted environments.
// Remove these lines:
require('fs').appendFileSync(
'/tmp/nx-cloud-onboarding-url.txt',
`${x} - ${meta}\n`
);Spotted by Graphite Agent
Is this helpful? React 👍 or 👎 to let us know.
| process.exit(1); | ||
| throw error; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unreachable code. The throw error; statement on line 249 will never execute because process.exit(1) on line 248 terminates the process immediately. Remove the throw statement or restructure the error handling.
// Either remove the throw:
process.exit(1);
// Or remove process.exit and let the throw propagate:
throw error;| process.exit(1); | |
| throw error; | |
| process.exit(1); |
Spotted by Graphite Agent
Is this helpful? React 👍 or 👎 to let us know.
🐳 We have a release for that!This PR has a release associated with it. You can try it out using this command: npx [email protected] my-workspaceOr just copy this version and use it in your own command: 0.0.0-pr-33468-f947d21
To request a new release for this pull request, mention someone from the Nx team or the |

Current Behavior
Expected Behavior
Related Issue(s)
Fixes #