question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Exclude Apps in affected scripts by tags from nx.json

See original GitHub issue

Currently the only way to exclude apps and libs from being processed by the affected scripts, is by their names. It would be useful, if we could exclude apps and libs in the affected scripts by their tags which can be defined in nx.json

For example having the following nx.json

....
    "booking": {
      "tags": ["booking"]
    },
    "error-page": {
      "tags": ["error-page"]
    },
    "my-nanosite": {
      "tags": ["my-nanosite", "nanosites"]
    },
    "my-other-nanosite": {
      "tags": ["my-other-nanosite", "nanosites"]
    },
...

and running npm run affected:apps -- --base=origin/develop --exclude="tags:nanosites" or something similar 😃 only apps should printed out, which are affected by changes and do not have the nanosites tag. It should also be possible to pass a list of tags to be excluded. This would save us a lot of headaches, because we have more than 50 nanosites and adding them by name in the exclude part is tedious and error prone.

I know the nx.json is used for linting, but could that purpose be extended?

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:8
  • Comments:26 (15 by maintainers)

github_iconTop GitHub Comments

3reactions
mehrad-rafighcommented, Feb 8, 2021

Unstale

2reactions
wickstargazercommented, Feb 11, 2020

Hi,

I saw there is a pullrequest for .nxignore --> PR #1585

However it only works for the workspace-lint command and not the affected commands

Can it be added in? I see that its added in the core/file-utils.ts in the function allFilesInDir

However thats only use in the workspace-lint as i observed.

Can we add the ignore machanism for the affected as well?

From what I observe there are several places this mechanism can be coded in, if someone would guide with me it would be great.

  1. We either add a project level check with tags/flags at these functions
  • getTouchedProjects,
  • getImplicitlyTouchedProjects,
  • getImplicitlyTouchedProjectsByJsonChanges,
  • getTouchedProjectsInNxJson,
  • getTouchedProjectsInWorkspaceJson
  1. Or we can go directly for the files using glob pattern in .nxignore
  • Either in shared.parseFiles after the git command are run
  • Or add directly into the file-utils.calculateFileChanges

I like the

add directly into the file-utils.calculateFileChanges

option the most. Please advise 😄, If so can i work on it and open a PR?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Project Configuration - Nx
Projects can be configured in package.json (if you use npm scripts and not Nx executors) ... Nx merges the two files to get...
Read more >
nrwl-nx/community - Gitter
x version. I'm working on large angular based project with mono repo. i feel after adding 40+ libraries, angular.json has become huge. Is...
Read more >
Setting up an Nx workspace with nx-dotnet
Generate web API and testing projects nx generate app weather-api # Tag testing project with "type:test" json -I -f nx.json -e ...
Read more >
Angular.json Invalid in Nx Workspace - Stack Overflow
I recently migrated a usual Angular Application into an Nx Workspace. Badly, I always get an error when trying to run any command...
Read more >
Tutorial - First Steps with Nx and Angular Architecture
Open your nx.json in your project's root and add the following tags: · Add the following constraints to your .eslintrc. · Import the ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found