Skip to content

Conversation

@juristr
Copy link
Member

@juristr juristr commented Dec 4, 2025

Current Behavior

Currently we don't add the packageManager property when generating a new workspace.

Expected Behavior

We should have it as more and more tooling relies on it to make decisions. (e.g. on CI etc..)

Related Issue(s)

Fixes #

@juristr juristr requested a review from a team as a code owner December 4, 2025 09:25
@juristr juristr requested a review from Cammisuli December 4, 2025 09:25
@vercel
Copy link

vercel bot commented Dec 4, 2025

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

Project Deployment Preview Updated (UTC)
nx-dev Ready Ready Preview Dec 12, 2025 1:48pm

@netlify
Copy link

netlify bot commented Dec 4, 2025

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit 9826694
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/693c1b436b1c590009e337ae
😎 Deploy Preview https://deploy-preview-33702--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.

@nx-cloud
Copy link
Contributor

nx-cloud bot commented Dec 4, 2025

View your CI Pipeline Execution ↗ for commit 9826694

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

☁️ Nx Cloud last updated this comment at 2025-12-12 14:36:29 UTC

nx-cloud[bot]

This comment was marked as outdated.

Copy link
Collaborator

@JamesHenry JamesHenry left a comment

Choose a reason for hiding this comment

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

@juristr I think we'll want a custom snapshot serializer for these otherwise they will be subject to change every time our CI environment changes by even a patch version of npm

@juristr
Copy link
Member Author

juristr commented Dec 12, 2025

@JamesHenry oh yeah good catch

@juristr juristr force-pushed the feat/package-manager-field branch from 4f41b09 to 9826694 Compare December 12, 2025 13:40
@juristr juristr added the PR status: do not merge This will block a PR from being merged until this tag is removed. label Dec 12, 2025
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.

Nx Cloud is proposing a fix for your failed CI:

These changes fix the e2e test failures by ensuring the generated test specs use npm commands that match the package manager configured in the created workspaces. Since the create-package template hardcodes packageManager: 'npm' in the generated workspace, the e2e tests now correctly use npm ls and npx instead of dynamically resolved commands from the generating workspace (which uses pnpm).

We could not verify this fix.

diff --git a/packages/plugin/src/generators/create-package/files/e2e/__cliName__.spec.ts__tmpl__ b/packages/plugin/src/generators/create-package/files/e2e/__cliName__.spec.ts__tmpl__
index 11c89d9f74..192e057641 100644
--- a/packages/plugin/src/generators/create-package/files/e2e/__cliName__.spec.ts__tmpl__
+++ b/packages/plugin/src/generators/create-package/files/e2e/__cliName__.spec.ts__tmpl__
@@ -20,7 +20,7 @@ describe('<%= cliName %>', () => {
     projectDirectory = createTestProject();
 
     // npm ls will fail if the package is not installed properly
-    execSync('<%= packageManagerCommands.list %> <%= pluginPackageName %>', {
+    execSync('npm ls --depth 100 <%= pluginPackageName %>', {
       cwd: projectDirectory,
       stdio: 'inherit',
     });
@@ -45,7 +45,7 @@ function createTestProject(extraArgs = '') {
   });
 
   execSync(
-    `<%= packageManagerCommands.dlx %> <%= cliName %>@e2e ${projectName} ${extraArgs}`,
+    `npx <%= cliName %>@e2e ${projectName} ${extraArgs}`,
     {
       cwd: dirname(projectDirectory),
       stdio: 'inherit',

Apply fix via Nx Cloud  Reject fix via Nx Cloud


Or Apply changes locally with:

npx nx-cloud apply-locally Mu6j-N9dD

Apply fix locally with your editor ↗   View interactive diff ↗


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

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

Labels

PR status: do not merge This will block a PR from being merged until this tag is removed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants