nx/packages
Jason Jean 92d9d13da4
Experimental TaskHashPlanInspector (#27809)
## Current Behavior
<!-- This is the behavior we have today -->

There is no easy way to inspect the hash plan for a task.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

There is a `TaskHashPlanInspector` which can be used to provide details
about the hash plan for a task.

## Example Usage

```js
const { createProjectGraphAsync } = require('@nx/devkit');
const { HashPlanInspector } = require('nx/src/hasher/hash-plan-inspector');

(async () => {
  const graph = await createProjectGraphAsync();
  const hashPlanInspector = new HashPlanInspector(graph);
  await hashPlanInspector.init();
  const target = {
    project: 'nx',
    target: 'build-native',
  };
  console.log(
    JSON.stringify(hashPlanInspector.inspectTask(target), null, 2)
  );
})();
```

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

---------

Co-authored-by: Craigory Coppola <craigorycoppola@gmail.com>
2025-06-10 07:39:59 -04:00
..