arcjet-js: Deduplicate `errorMessage` utility across packages

We currently duplicate the errorMessage function across various packages. This is just an internal utility so we don’t want it to live as an external package nor be exported from a package.

I think we could solve this by using a rollup “virtual package” (see: Astro or SvelteKit virtual packages) that provides the utilities. However, I think that TypeScript and especially the LSP hard to wrangle because the types won’t be directly available.

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 18 (18 by maintainers)

Commits related to this issue

Most upvoted comments

That’s an awesome trick that I didn’t know was possible! As you stated, these are in different packages and we don’t really want to introduce another package to the tree just to pluck/format error messages (see the closed, linked PR).