Skip to content

Add AMD distribution path for OJET/RequireJS compatibility (#33)#34

Open
miquelgall wants to merge 2 commits intomainfrom
issue-33
Open

Add AMD distribution path for OJET/RequireJS compatibility (#33)#34
miquelgall wants to merge 2 commits intomainfrom
issue-33

Conversation

@miquelgall
Copy link
Copy Markdown
Contributor

@miquelgall miquelgall commented Mar 24, 2026

Summary

  • add dual Rollup outputs for ESM and AMD artifacts
  • expose AMD entrypoint via package subpath export (@ofs-users/plugin/amd)
  • document OJET/RequireJS integration and path mapping guidance
  • add compatibility tests for package metadata and AMD artifact config
  • switch test script to Node built-in test runner (node --test) so tests run without extra dev dependency setup

Changes

  • rollup.config.mjs
    • output now includes:
      • dist/ofs-plugin.es.js (format: es)
      • dist/ofs-plugin.amd.js (format: amd)
  • package.json
    • add exports[.] with ESM default and types
    • add exports[./amd] pointing to ./dist/ofs-plugin.amd.js
    • update test script to node --test
  • README.md
    • add OJET/RequireJS compatibility section, module IDs, and mapping example
  • test/general/compatibility.test.js
    • validate ESM defaults + AMD subpath export
    • validate Rollup config includes AMD artifact output

Validation

  • npm test (passes)
  • npm run prepare (generates dist/ofs-plugin.es.js and dist/ofs-plugin.amd.js)

Closes #33

Signed-off-by: Miquel Gall <gall.miquel@gmail.com>
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Mar 24, 2026
Signed-off-by: Miquel Gall <gall.miquel@gmail.com>
@miquelgall miquelgall requested a review from btoron March 24, 2026 20:50
@btoron
Copy link
Copy Markdown
Contributor

btoron commented Mar 24, 2026

Closes #25 also

@btoron btoron linked an issue Mar 24, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OJET compatibility gaps: AMD/browser packaging requires fs shim and strict module-id handling Add AMD version in the Package Release

2 participants