Skip to content
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

fix(devkit): ensurePackage should obey npmrc and yarnrc.yml #16652

Conversation

AgentEnder
Copy link
Member

Current Behavior

ensurePackage does not know how to obey .npmrc, .yarnrc, or .yarnrc.yml

nx migrate only obeys .npmrc

Expected Behavior

All package manager config files are obeyed

Related Issue(s)

Fixes #16644

@vercel
Copy link

vercel bot commented Apr 28, 2023

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

Name Status Preview Comments Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 1, 2023 8:18pm

const f = findFileInPackageJsonDirectory(packageManagerConfigFile, root);
if (f) {
// Copy config file if it exists, so that the package manager still follows it.
copyFileSync(f, `${destination}/.npmrc`);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Change this to be the file found

import { Tree } from 'nx/src/generators/tree';
import { createTreeWithEmptyWorkspace } from 'nx/src/generators/testing-utils/create-tree-with-empty-workspace';
import {
import type { Tree } from 'nx/src/generators/tree';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove all changes to spec files

@@ -39,7 +15,29 @@
{
"files": ["*.ts", "*.tsx"],
"rules": {
"@typescript-eslint/explicit-module-boundary-types": ["error"]
"@typescript-eslint/explicit-module-boundary-types": ["error"],
"@typescript-eslint/no-restricted-imports": [
Copy link
Collaborator

Choose a reason for hiding this comment

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

Move these up to the previous .ts block

@AgentEnder AgentEnder force-pushed the fix/copy-other-package-manager-config-files branch from 4fbcd8b to b619127 Compare May 1, 2023 20:06
@AgentEnder AgentEnder force-pushed the fix/copy-other-package-manager-config-files branch from b619127 to 01f530b Compare May 1, 2023 20:12
@github-actions
Copy link

github-actions bot commented May 7, 2023

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 May 7, 2023
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.

Nx generate fails to run yarn install commands with Yarn 3 and custom registries.
2 participants