Skip to content

build: align package.json exports with @ui5/webcomponents convention - #38

Merged
miloshevb merged 3 commits into
mainfrom
build/moduleEntry
Oct 28, 2026
Merged

miloshevb merged 3 commits into
mainfrom
build/moduleEntry

Conversation

@miloshevb

Copy link
Copy Markdown
Member

Remove the default-entry fields (main, module, types) and the exports["."] block that all pointed at a single component (dist/Geomap.js). This treated one component as the package's default export, which does not match how UI5 Web Components packages are structured deliberately expose no default entry and require consumers to import components via subpaths.

Adopt the subpath-only exports shape:

  • ./src/* raw TypeScript sources (useful inside monorepos)
  • ./dist/* compiled output (explicit, keeps the catch-all
    below from double-mapping)
  • ./package.json for tools that read the manifest at runtime
  • ./bundle.esm.js exposes the existing root-level self-contained
    bundle to published consumers
  • ./* → ./dist/* catch-all so consumers can write
    @ui5/webcomponents-geomap/Geomap.js without the
    /dist/ prefix

Also expand the files whitelist to include src/ and bundle.esm.js so the new entries actually resolve in the published tarball.

Note: the commit that introduced the removed fields (bcedc5e, "build: fix package.json for publish") claimed to "match @ui5/webcomponents convention" but did the opposite — the real convention is to have no default entry at all. This commit corrects that.

BREAKING CHANGE: import "@ui5/webcomponents-geomap" (the bare package specifier) no longer resolves — it now throws ERR_PACKAGE_PATH_NOT_EXPORTED, matching every other @ui5/webcomponents-* package. Consumers must use subpath imports, e.g. import "@ui5/webcomponents-geomap/dist/Geomap.js" or import "@ui5/webcomponents-geomap/Geomap.js". The README and docs already only use the subpath form.

Comment thread package.json Resolved
Comment thread package.json Resolved
@miloshevb
miloshevb merged commit 2519b20 into main Oct 28, 2026
5 of 6 checks passed
@miloshevb
miloshevb deleted the build/moduleEntry branch October 28, 2026 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants