endojs / endo

Endo is a distributed secure JavaScript sandbox, based on SES
Apache License 2.0
829 stars 72 forks source link

Bundler: better diagnostic if package.json lacks a `name` #1845

Open kriskowal opened 1 year ago

kriskowal commented 1 year ago

Describe the bug

If one bundles an entrypoint with a package.json that does not have a name, the compartment mapper fails with an uninformative diagnostic. The bundler should produce a better error if it finds a package.json without a name.

Steps to reproduce

  1. Create a package.json without a name.
  2. Create an entry.js module.
  3. Attempt to bundle with bundle-source provided by @endo/bundle-source

Expected behavior

The bundler should fail with an error diagnostic referring the the package.json that did not have a name, possibly suggesting one based on the parent directory name. The suggestion cannot be reliably inferred because of workspaces.

Platform environment

All