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.

workspace/command-line: dep-graph renders weird dependency tree

See original GitHub issue

Expected Behavior

properly resolve dep graph

Current Behavior

workspace-tools isn’t used anywhere - it’s default nx ./tools folder registered within workspace.json se we are be able to leverage nx for running pipeline for ./tools as well (schematics/scripts/builders).

  • Am I missing something within configs ?
  • How is the dep graph being build under the hood? (would be easier to know to be able to debug this)

image

workspace.json:

 "projects": {
    "workspace-tools": {
      "root": "tools",
      "sourceRoot": "tools",
      "projectType": "library",
      "schematics": {},
      "architect": {
        "lint": {
          "builder": "@nrwl/linter:lint",
          "options": {
            "linter": "eslint",
            "config": "tools/.eslintrc",
            "fix": true,
            "tsConfig": ["tools/tsconfig.tools.json"],
            "exclude": ["**/node_modules/**"]
          }
        },
        "test": {
          "builder": "@nrwl/jest:jest",
          "options": {
            "jestConfig": "tools/jest.config.js",
            "tsConfig": "tools/tsconfig.spec.json",
            "passWithNoTests": true
          }
        }
      }
    },
}

nx.json:

{
"npmScope": "my-project",
  "implicitDependencies": {
    "workspace.json": "*",
    "package.json": {
      "dependencies": "*",
      "devDependencies": "*"
    },
    "tsconfig.json": "*",
    "tslint.json": "*",
    "nx.json": "*"
  },
  "projects": {
    "workspace-tools": {
      "tags": []
    },
  }
}

.eslintrc.js:

rules: {
    '@nrwl/nx/enforce-module-boundaries': [
      'error',
       {
        allow: [
          // "old" codebase within src/js/libs - it's mapped within tsconfig.json "paths"
          'libs/**',
          // "old" codebase within apps/ui/ - ui needs be moved to proper package within lib
          'apps/ui/**',
          // "old packages, without nx support"
          '@my-project/ui/**',
          '@my-project/globals',
        ],
        depConstraints: [
          // Projects without any tags cannot depend on any other projects.
          // Following allows projects without any tags to be able to depend on any other project.
          {
            sourceTag: '*',
            onlyDependOnLibsWithTags: ['*'],
          },
       ]
}]
}

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. yarn nx dep-graph

Context

 @nrwl/angular : Not Found
  @nrwl/cli : 9.1.2
  @nrwl/cypress : 9.1.2
  @nrwl/eslint-plugin-nx : 9.1.2
  @nrwl/express : Not Found
  @nrwl/jest : 9.1.2
  @nrwl/linter : 9.1.2
  @nrwl/nest : Not Found
  @nrwl/next : Not Found
  @nrwl/node : 9.1.2
  @nrwl/react : 9.1.2
  @nrwl/schematics : Not Found
  @nrwl/tao : 9.1.2
  @nrwl/web : 9.1.2
  @nrwl/workspace : 9.1.2
  typescript : 3.8.3

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
juristrcommented, Apr 2, 2020

Hey @Hotell 👋 . Surprisingly I had the exact same issue yesterday also embedding the tools folder as workspace-tools in the angular.json.

Talked to Jason and I think we found it. Jason has a PR (#2789) that might fix it. Gonna test it now on my workspace.

In general, thanks a lot for all ur detailed issues/feature requests you provide here. Awesome job 😃

0reactions
Hotellcommented, Apr 2, 2020

you’re the best folks! ❤️hope I will have more time to contribute more soon - in terms of PR etc. 🙌keep rockin

Read more comments on GitHub >

github_iconTop Results From Across the Web

ferstl/depgraph-maven-plugin - GitHub
A Maven plugin that generates dependency graphs in various formats (DOT, GML, PlantUML, ... A more powerful alternative to mvn dependency:tree .
Read more >
Viewing and debugging dependencies - Gradle User Manual
A build scan can visualize dependencies as a navigable, searchable tree. Additional context information can be rendered by clicking on a specific dependency...
Read more >
The Dependency Jungle - Medium
A few strange-looking dependencies that didn't seem to belong. ... The Dependency Tree is Actually More of a Jungle. And it's Haunted.
Read more >
depgraph - npm
depgraph returns a dependency graph for a javascript module. It resolves ES6 modules, CommonJS modules and Typescript files using ...
Read more >
cargo tree - The Cargo Book
cargo-tree(1 ). NAME. cargo-tree - Display a tree visualization of a dependency graph ... This command will display a tree of dependencies to...
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