arethetypeswrong / arethetypeswrong.github.io

Tool for analyzing TypeScript types of npm packages
https://arethetypeswrong.github.io
MIT License
1.21k stars 41 forks source link

Inconsistent Behavior of attw --pack with npm pack in PNPM + NX Monorepo #216

Closed prisis closed 1 month ago

prisis commented 1 month ago

I'm encountering an issue with running the command attw --pack in a monorepo managed by nx. It is unclear whether this is a bug or if npm pack or attw does not support this use case.

Steps to Reproduce

  1. Run the command:

    nx run-many --target=lint:attw --all --parallel

    lint:attw => attw --pack

  2. The attw command executes and displays a result page, but the resolutions for node10, node16, and bundler are incorrect.

  3. Manually navigating into the repository and running the command directly:

    attw --pack

    yields the correct resolution.

Expected Behavior

When running attw --pack through nx, I expect it to resolve the node versions and bundler correctly, just as it does when run directly from the repository or when the package is released.

Actual Behavior

Running attw --pack through nx results in incorrect resolutions for node10, node16, and bundler, while running it directly from the repository works as expected.

Questions

  1. Is there a known limitation with using npm pack or attw --pack in an nx monorepo environment?
  2. Is there a recommended way to configure or run this command through nx to ensure correct resolution?

Environment

prisis commented 1 month ago

Looks like the generated isolated declaration are somehow wrong...

Will close it as invalid