Skip to content

Add --mashlib-module flag for ES module data browser#141

Merged
melvincarvalho merged 2 commits into
gh-pagesfrom
issue-140-mashlib-module
Mar 1, 2026
Merged

Add --mashlib-module flag for ES module data browser#141
melvincarvalho merged 2 commits into
gh-pagesfrom
issue-140-mashlib-module

Conversation

@melvincarvalho

Copy link
Copy Markdown
Contributor

Summary

  • Add --mashlib-module <url> CLI flag and JSS_MASHLIB_MODULE env var
  • New generateModuleDatabrowserHtml() in src/mashlib/index.js using <script type="module"> and <div id="mashlib">
  • CSS URL auto-derived from JS URL (.js.css)
  • Integrated into both container and resource GET handlers
  • Auto-enables content negotiation (same as --mashlib)
  • Backwards compatible: --mashlib and --mashlib-cdn unchanged

Closes #140

Files changed

  • bin/jss.js — new CLI option, pass-through to config, banner output
  • src/config.js — default, env var mapping, conneg auto-enable, printConfig
  • src/server.js — request decoration, mashlibEnabled includes module
  • src/mashlib/index.js — new generateModuleDatabrowserHtml() export
  • src/handlers/resource.js — use module HTML when mashlibModule is set

Test plan

  • All 69 core tests pass (LDP, conformance, conneg)
  • Manual test: jss start --mashlib-module https://example.com/mashlib.js

Adds a new --mashlib-module <url> option that serves an ES module-based
data browser instead of the classic script-based mashlib. Uses
<script type="module"> and <div id="mashlib"> (self-initializing).

Backwards compatible: existing --mashlib and --mashlib-cdn unchanged.

Closes #140
@melvincarvalho
melvincarvalho merged commit 41f3355 into gh-pages Mar 1, 2026
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.

Add --mashlib-module flag for ES module data browser

1 participant