Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jaysoo
Copy link
Member

@jaysoo jaysoo commented Nov 13, 2025

This PR simplifies the CNW process so we only prompt for a starter (TS, NPM Packages, React, Angular) and we clone a full example to showcase Nx monorepo for the given starter. This speeds up CNW drastically and allows users to get the workspace in 5-10 seconds vs 1-3 minutes.

Users can choose Custom to fall back to the previous prompts, which will ask framework, unit test runner, e2e runner, etc.

@netlify
Copy link

netlify bot commented Nov 13, 2025

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit 37eb6d5
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/6930657f2aa54b000840952d
😎 Deploy Preview https://deploy-preview-33468--nx-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@vercel
Copy link

vercel bot commented Nov 13, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
nx-dev Ready Ready Preview Dec 3, 2025 4:35pm

@nx-cloud
Copy link
Contributor

nx-cloud bot commented Nov 13, 2025

View your CI Pipeline Execution ↗ for commit 37eb6d5

Command Status Duration Result
nx affected --targets=lint,test,test-kt,build,e... ✅ Succeeded 23m 57s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 2m 31s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 12s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 3s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2025-12-03 16:59:21 UTC

@github-actions
Copy link
Contributor

🐳 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-workspace

Or just copy this version and use it in your own command:

0.0.0-pr-33468-86c294c
Release details 📑
Published version 0.0.0-pr-33468-86c294c
Triggered by @jaysoo
Branch NXC-3464
Commit 86c294c
Workflow run 19337349373

To request a new release for this pull request, mention someone from the Nx team or the @nrwl/nx-pipelines-reviewers.

@github-actions
Copy link
Contributor

🐳 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-workspace

Or just copy this version and use it in your own command:

0.0.0-pr-33468-6e447bb
Release details 📑
Published version 0.0.0-pr-33468-6e447bb
Triggered by @jaysoo
Branch NXC-3464
Commit 6e447bb
Workflow run 19347098594

To request a new release for this pull request, mention someone from the Nx team or the @nrwl/nx-pipelines-reviewers.

@github-actions
Copy link
Contributor

🐳 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-workspace

Or just copy this version and use it in your own command:

0.0.0-pr-33468-7ba12c8
Release details 📑
Published version 0.0.0-pr-33468-7ba12c8
Triggered by @jaysoo
Branch NXC-3464
Commit 7ba12c8
Workflow run 19438705872

To request a new release for this pull request, mention someone from the Nx team or the @nrwl/nx-pipelines-reviewers.

@github-actions
Copy link
Contributor

🐳 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-workspace

Or just copy this version and use it in your own command:

0.0.0-pr-33468-10b2f55
Release details 📑
Published version 0.0.0-pr-33468-10b2f55
Triggered by @jaysoo
Branch NXC-3464
Commit 10b2f55
Workflow run 19475300511

To request a new release for this pull request, mention someone from the Nx team or the @nrwl/nx-pipelines-reviewers.

@github-actions
Copy link
Contributor

🐳 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-workspace

Or just copy this version and use it in your own command:

0.0.0-pr-33468-1bdc579
Release details 📑
Published version 0.0.0-pr-33468-1bdc579
Triggered by @jaysoo
Branch NXC-3464
Commit 1bdc579
Workflow run 19542895521

To request a new release for this pull request, mention someone from the Nx team or the @nrwl/nx-pipelines-reviewers.

@jaysoo jaysoo marked this pull request as ready for review November 20, 2025 22:15
jaysoo and others added 10 commits December 2, 2025 16:37
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.
Copy link
Contributor

@nx-cloud nx-cloud bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ The fix was rejected

These changes fix the workspace creation failures by making the directory parameter optional in the recordStat function. The issue occurred because recordStat was being called before the workspace directory existed, causing require.resolve to fail when trying to locate the nx package from a non-existent path. By making the parameter optional and only using it when provided, we allow the early telemetry call to succeed while preserving full functionality for the post-creation call.

We could not verify this fix.

Suggested Fix changes
diff --git a/packages/create-nx-workspace/bin/create-nx-workspace.ts b/packages/create-nx-workspace/bin/create-nx-workspace.ts
index 8fcca86287..cbbbdc240f 100644
--- a/packages/create-nx-workspace/bin/create-nx-workspace.ts
+++ b/packages/create-nx-workspace/bin/create-nx-workspace.ts
@@ -347,7 +347,6 @@ async function normalizeArgsMiddleware(
       command: 'create-nx-workspace',
       meta: [startPrefix],
       useCloud: argv.nxCloud !== 'skip',
-      directory,
     });
 
     if (template !== 'custom') {
diff --git a/packages/create-nx-workspace/src/utils/nx/ab-testing.ts b/packages/create-nx-workspace/src/utils/nx/ab-testing.ts
index 3405c9729a..63c36ef4fa 100644
--- a/packages/create-nx-workspace/src/utils/nx/ab-testing.ts
+++ b/packages/create-nx-workspace/src/utils/nx/ab-testing.ts
@@ -261,7 +261,7 @@ export async function recordStat(opts: {
   nxVersion: string;
   useCloud: boolean;
   meta: string[];
-  directory: string;
+  directory?: string;
 }) {
   try {
     if (!shouldRecordStats()) {
@@ -271,9 +271,11 @@ export async function recordStat(opts: {
     // nx-ignore-next-line
     const { getCloudUrl } = require(require.resolve(
       'nx/src/nx-cloud/utilities/get-cloud-options',
-      {
-        paths: [opts.directory],
-      }
+      opts.directory
+        ? {
+            paths: [opts.directory],
+          }
+        : undefined
       // nx-ignore-next-line
     )) as typeof import('nx/src/nx-cloud/utilities/get-cloud-options');
 

View interactive diff ↗
This fix was rejected by Jack Hsu


🎓 Learn more about Self-Healing CI on nx.dev

@jaysoo jaysoo merged commit 2e442d5 into master Dec 3, 2025
20 checks passed
@jaysoo jaysoo deleted the NXC-3464 branch December 3, 2025 18:12
barbados-clemens pushed a commit that referenced this pull request Dec 8, 2025
This PR simplifies the CNW process so we only prompt for a starter (TS,
NPM Packages, React, Angular) and we clone a full example to showcase Nx
monorepo for the given starter. This speeds up CNW drastically and
allows users to get the workspace in 5-10 seconds vs 1-3 minutes.

Users can choose `Custom` to fall back to the previous prompts, which
will ask framework, unit test runner, e2e runner, etc.

---------

Co-authored-by: Claude <[email protected]>
@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2025

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants