function getPackageName(id) {
  const moduleSpecifier = id.toString();
  if (!moduleSpecifier.startsWith('@')) return id.toString().split('/')[0];

  const [scope, pkg] = moduleSpecifier.split('/');
  return [scope, pkg].join('/');
}
Given an import id like `lit-html/lit-html.js`, returns the package name i.e. `lit-html`
@param {string|number|boolean|RegExp} id
@return {string}