feat(core): prompt for analytics preference during workspace creation#34818
Merged
Conversation
Adds an analytics opt-in prompt to create-nx-workspace so users can set their preference at workspace creation time rather than on first nx command. - Preset flow: analytics preference is set via the workspace generator, so nx.json is properly formatted by prettier - Template flow: analytics preference is written directly to nx.json - Supports --analytics CLI flag for non-interactive usage - Skips prompt in CI and non-interactive environments
✅ Deploy Preview for nx-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for nx-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
|
View your CI Pipeline Execution ↗ for commit f6af4dd
☁️ Nx Cloud last updated this comment at |
The SIGINT handler at the process level handles Ctrl+C, so the try/catch around the prompt was dead code. Also removed "anonymous" from descriptions.
AgentEnder
approved these changes
Mar 13, 2026
jaysoo
added a commit
that referenced
this pull request
Mar 17, 2026
## Current Behavior CNW flow matches v22.1.3 (restored in #34671): no template prompt is shown, the cloud prompt uses simplified "Would you like remote caching?" wording, banner variant is locked to 0, and preset flow connects to cloud during workspace creation. ## Expected Behavior Restore the template prompt and cloud prompts that were removed in #34671: - **Template prompt**: "Which starter do you want to use?" with 5 choices (Minimal, React, Angular, NPM Packages, Custom) - **Cloud prompt**: `determineNxCloudV2` ("Connect to Nx Cloud?") for preset flow when no `--nxCloud` CLI arg; existing CI provider prompt when `--nxCloud` is explicitly provided - **Banner**: Variant 2 (box banner) for standard Nx Cloud URLs, variant 0 for enterprise - **Preset flow**: Deferred cloud connection (`nxCloud: 'skip'`) instead of connecting during workspace creation - **Push logic**: Push to GitHub for both `nxCloud === 'github'` and `nxCloud === 'yes'` - **Messages**: "Try the full Nx platform?" wording, GitHub repo link in push messages, "Your remote cache setup is almost complete." title Preserves all subsequent changes (analytics prompt from #34818, SANDBOX_FAILED fix, .gitignore updates). ## Related Issue(s) Fixes NXC-4096
Contributor
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Current Behavior
When a user creates a new workspace with
create-nx-workspace, they are not asked about analytics. The analytics prompt only appears later on the firstnxcommand run, or via the 22.6.0 migration.Expected Behavior
Users are prompted to opt in or out of usage analytics during
create-nx-workspace, so the preference is set from the start. The prompt matches the style of other prompts in the flow (autocomplete with Yes/No choices).analyticsproperty is set via the workspace generator'screateNxJson, sonx.jsonis properly formatted by prettier throughformatFiles(tree)analyticsproperty is written directly tonx.json(matching the pattern used bysetNeverConnectToCloud)--analyticsCLI flag for non-interactive usagefalse)