tooling icon indicating copy to clipboard operation
tooling copied to clipboard

Tooling integrations for package.json#exports

Open bmeck opened this issue 3 years ago • 1 comments

I've seen various issues with understanding the package.json#exports,imports fields.

  1. Lack of linting (E.G. https://github.com/microsoft/TypeScript/issues/46861 )
  2. Lack of convention. No official recommendations of ordering of conditions in typical application/framework. (E.G. https://twitter.com/AndaristRake/status/1498701683093823494 )
  3. Lack of discoverability. Understanding which path in your own package will be taken / altering the resolution of such.
  4. Lack of specification granularity / need to be reimplemented in userland (E.G. https://twitter.com/sebmarkbage/status/1498691681750765577 )

It would be good to have some way for tooling to provide these and/or make recommendations for tools that do scaffolding and the general user of Node.js to reference.

bmeck avatar Mar 01 '22 18:03 bmeck

fwiw, I'm continuing to refine https://npmjs.com/ls-exports (it's still not caught up to the latest node features), and once it's up to par, I'll be updating resolve to support both fields, using the test fixtures from list-exports for verification.

ljharb avatar Mar 01 '22 19:03 ljharb