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

Nx.json - Be able to add as implicit dependency value a RegExp #2483

Closed
4 tasks done
mauriziovitale opened this issue Feb 14, 2020 · 14 comments · Fixed by #3622
Closed
4 tasks done

Nx.json - Be able to add as implicit dependency value a RegExp #2483

mauriziovitale opened this issue Feb 14, 2020 · 14 comments · Fixed by #3622
Labels

Comments

@mauriziovitale
Copy link
Contributor

mauriziovitale commented Feb 14, 2020

Currently, Nx does not allow you to specify a regexp as the value of an implicit dependency such as package.json

Prerequisites

  "npmScope": "mycompany",
  "implicitDependencies": {
    "angular.json": "*",
    "package.json": {
      "dependencies": "@mycompany/lib/*",
      "devDependencies": "*"
    }

Please answer the following questions for yourself before submitting an issue.
YOU MAY DELETE THE PREREQUISITES SECTION.

  • I am running the latest version
  • I checked the documentation (nx.dev) and found no answer
  • I checked to make sure that this issue has not already been filed
  • I'm reporting the issue to the correct repository (not related to React, Angular or any dependency)

Expected Behavior

Should trigger the target action only if the @mycompany/lib has been changed

Please describe the behavior you are expecting

Current Behavior

What is the current behavior?

Failure Information (for bugs)

Please help provide information about the failure if this is a bug. If it is not a bug, please remove the rest of this template.

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. step 1
  2. step 2
  3. ...

If you can provide steps to reproduce from scratch, that would be enormously appreciated (i.e. where the first step is npx create-nx-workspace@latest repro-workspace)

Context

Please provide any relevant information about your setup:

Example of nx.json

  "npmScope": "mycompany",
  "implicitDependencies": {
    "angular.json": "*",
    "package.json": {
      "dependencies": "@mycompany/lib/*",
      "devDependencies": "*"
    }

A minimal reproduction scenario allows us to quickly confirm a bug (or point out coding problem) as well as confirm that we are fixing the right problem.

Failure Logs

Please include any relevant log snippets or files here.

Other

Any other relevant information that will help us help you.

@FrozenPandaz FrozenPandaz added scope: core core nx functionality type: feature labels Feb 15, 2020
@vsavkin vsavkin changed the title [Feature] Nx.json - Be able to add as implicit dependency value a RegExp Nx.json - Be able to add as implicit dependency value a RegExp Feb 21, 2020
@github-actions
Copy link

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs.
If we missed this issue please reply to keep it active.
Thanks for being a part of the Nrwl community! 🙏

@github-actions github-actions bot added the stale label May 29, 2020
@mauriziovitale
Copy link
Contributor Author

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs.
If we missed this issue please reply to keep it active.
Thanks for being a part of the Nrwl community! 🙏

It would be great to have it.

@vsavkin vsavkin removed the stale label May 29, 2020
@vsavkin
Copy link
Member

vsavkin commented May 29, 2020

Sorry. The issue was marked by mistake. I removed the label.

@METACEO METACEO mentioned this issue Jun 2, 2020
4 tasks
@mehrad-rafigh
Copy link
Contributor

Hey guys, we are really looking for this feature. Is there any plan to implement this?

@bekos
Copy link
Contributor

bekos commented Aug 24, 2020

hi @mehrad-rafigh .... since v10.1 you can use globs in implicitDependencies files paths, like "styles/**/*.css": "*". Does this solve your issue?

@mehrad-rafigh
Copy link
Contributor

mehrad-rafigh commented Aug 25, 2020

Hi @bekos. I'm afraid it doesn't solve my issue.
I would need to be able to ignore the version property in package.json. We are using semantic release and every PR wants to build everything.
Would I be able to achieve this with v10.1?

@bekos
Copy link
Contributor

bekos commented Aug 28, 2020

@mehrad-rafigh sorry I missed your response! no, it doesn't seem to be supported 😞 the problem I see though, is that the proposed syntax is not compliant with the current format, as the value of implicitDependencies is always the affected projects 🤔 So a syntax that would make more sense could be:

"implicitDependencies": {
  "angular.json": "*",
  "package.json": {
    "dependencies": {
      "@mycompany/lib/*": ["myapp"],
     },
    "devDependencies": "*"
  }
}

I will try to take a look and see if this an easy change 😃

bekos added a commit to bekos/nx that referenced this issue Aug 28, 2020
bekos added a commit to bekos/nx that referenced this issue Aug 29, 2020
@bekos
Copy link
Contributor

bekos commented Aug 31, 2020

hi @mehrad-rafigh @mauriziovitale 😃 can you please elaborate on your actual case? we are trying to understand if this would be a useful feature 🤔

@mehrad-rafigh
Copy link
Contributor

Hi @bekos. Sorry for the late reply. For my use case I want all properties of package.json except version to be implicit dependencies. We are using semantic release to do the release management in an automated way. So everytime we merge a PR, semantic-release creates a new release and updates the version property in our package.json. Since package.json is an implicit dependency, running nx affected:build or any other affected script will build/test all libs and apps of our monorepo. This is a huge hussle for us and our biggest bottleneck. Hope that information helps.

@bekos
Copy link
Contributor

bekos commented Sep 15, 2020

hi @mehrad-rafigh 😃 thx for the info. Do you really care for all the other properties in package.json or just the dependencies? Because i this case you could already have something like this:

"implicitDependencies": {
  "angular.json": "*",
  "package.json": {
    "dependencies": "*",
    "devDependencies": "*"
  }
}

@mehrad-rafigh
Copy link
Contributor

I actually have to check that. Is that functionality already released @bekos?

@bekos
Copy link
Contributor

bekos commented Sep 17, 2020

@mehrad-rafigh Yes.

@mehrad-rafigh
Copy link
Contributor

Will give it a try, when I'm back at the office

Doginal pushed a commit to Doginal/nx that referenced this issue Nov 25, 2020
@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants