solana-web3.js icon indicating copy to clipboard operation
solana-web3.js copied to clipboard

[WIP] Create subpackages for internal-ish code

Open steveluscher opened this issue 1 year ago • 7 comments
trafficstars

Summary

The entire problem that this PR tries to solve is this.

  1. Retain the simplicity of being able to export * from '@solana/errors' in packages/library/
  2. Prevent things like safeCaptureStackTrace() from being exported from packages/library/

The steps taken to that end were:

  1. Change moduleResolution everywhere to NodeNext. This enables subpackage exports
  2. Add .js extensions everywhere to satisfy that resolution regime
  3. Create a subpackage export in @solana/errors for all of the stuff that we want to share internally but not to export from packages/library/

Now any package in the @solana scope can use @solana/errors/internal but we can still enjoy the simplicity of export * from '@solana/errors' in packages/library/

steveluscher avatar Mar 20 '24 19:03 steveluscher