Thursday, 7 September 2023

How to calculate files array in nx dep-graph?

I'm using NX v16.1.4. In these version with every build the file node_modules/.cache/nx/nxdeps.json is created.

The structure of this file is not identical to the file, which can be generated by nx graph and this file is not generated anymore in releases after 16.1.: Before nodes.<app/lib>.data.files included array with all files (and hash values).

"data-access-anything": {
  "name": "data-access-anything",
  "type": "lib",
  "data": {
    "name": "data-access-anything",
    "$schema": "../../../../node_modules/nx/schemas/project-schema.json",
    "sourceRoot": "libs/data-access/anything/src",
    "projectType": "library",
    "files": [ // <-- need this files array
      {
        "file": "libs/data-access/anything/.babelrc",
        "hash": "2685020516260856122"
      },
      {
        "file": "libs/data-access/anything/.eslintrc.json",
        "hash": "15754961097349354736"
      },
      // ...
    ]
  }
},

I used this to calculate versions of each single application by analysing the git logs. Every git commit has changed files and the file-arrays of nxdeps.json give me the information which library and which application is affected.

In the latest version this has changed. So my question is if it is possible to generate the files content manually?



from How to calculate files array in nx dep-graph?

No comments:

Post a Comment