Skip to content

Upgrade-library-improvements#241

Merged
iamfrankiemoran merged 19 commits intomainfrom
upgrade-library-improvements
Apr 1, 2026
Merged

Upgrade-library-improvements#241
iamfrankiemoran merged 19 commits intomainfrom
upgrade-library-improvements

Conversation

@iamfrankiemoran
Copy link
Copy Markdown
Contributor

@iamfrankiemoran iamfrankiemoran commented Feb 23, 2026

Jira link

  • N/A

Change description

This PR hardens @hmcts/opal-frontend-common-node for predictable Node 18+ ESM publishing and consumer installs.

  • Corrected package metadata and publish surface:
    • main/types now point to ./dist/...
    • exports targets now point to real dist files
    • added files whitelist, sideEffects: false, engines.node >=18, and typesVersions
  • Tightened exports and removed invalid subpath exposure (session/session-user-state) to prevent unresolved runtime imports.
  • Switched TypeScript build semantics to NodeNext (module + moduleResolution) and updated source imports to explicit .js where required for ESM correctness.
  • Simplified build/publish model:
    • removed copying package.json/README into dist
    • publish now uses root manifest as single source of truth
    • added prepack + pack:local tarball workflow for realistic local consumer testing
  • Added packaging safety checks:
    • check:exports
    • check:pack-shape
    • check:exports:esm
    • plus CI integration (including Node 18 compatibility lane)
  • Hardened release workflow:
    • checkout by release tag
    • validate release tag matches package.json version
    • run build/export/pack checks before publish
  • Documentation updates:
    • README updated for tarball-based local usage and release checklist
    • changelog policy introduced
    • .tgz artifacts ignored in git

Consumer impact

  • Consumers must use documented export-map paths only (unsupported deep imports may now fail).
  • CommonJS require() is not supported; package remains ESM-first.

Security Vulnerability Assessment

CVE Suppression: Are there any CVEs present in the codebase (either newly introduced or pre-existing) that are being intentionally suppressed or ignored by this commit?

  • Yes
  • No

Checklist

  • commit messages are meaningful and follow good commit message guidelines
  • README and other documentation has been updated / added (if needed)
  • tests have been updated / new tests has been added (if needed)
  • Does this PR introduce a breaking change

@iamfrankiemoran iamfrankiemoran self-assigned this Feb 24, 2026
Copy link
Copy Markdown
Contributor

@Arnabsubedi233 Arnabsubedi233 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Contributor

@ChrisGarratt122 ChrisGarratt122 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 1, 2026

@iamfrankiemoran iamfrankiemoran merged commit 51d3305 into main Apr 1, 2026
5 checks passed
@iamfrankiemoran iamfrankiemoran deleted the upgrade-library-improvements branch April 1, 2026 12:28
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