Skip to content

Fix browser global export for GitHub Pages demo#9

Merged
martin-raden merged 2 commits into
mainfrom
copilot/debug-github-pages-export
Jul 2, 2026
Merged

Fix browser global export for GitHub Pages demo#9
martin-raden merged 2 commits into
mainfrom
copilot/debug-github-pages-export

Conversation

Copilot AI commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

The GitHub Pages demo was loading index.html without a usable window.vaRRI, which blocked rendering and left the color pickers initialized to the browser fallback instead of the library defaults. This change makes the browser export path resilient when a CommonJS-style module.exports object is also present.

  • Browser export path

    • Publish vaRRI to the browser global unconditionally in browser-like environments.
    • Preserve the existing CommonJS export for Node/Jest consumers.
  • Demo bootstrap impact

    • Restores index.html access to vaRRI.render() and vaRRI.getColors().
    • Ensures the visualization and color picker defaults come from the library again.
  • Regression coverage

    • Add a focused test for the mixed environment that exposed the bug: window present alongside module.exports.
global.vaRRI = vaRRI;
if (typeof module !== 'undefined' && module.exports) {
    module.exports = vaRRI;
}

Copilot AI linked an issue Jul 2, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix github pages export visualization and color picker issue Fix browser global export for GitHub Pages demo Jul 2, 2026
Copilot AI requested a review from martin-raden July 2, 2026 12:42
@martin-raden martin-raden marked this pull request as ready for review July 2, 2026 15:11
@martin-raden martin-raden merged commit 68a0c4b into main Jul 2, 2026
2 of 3 checks passed
@martin-raden martin-raden deleted the copilot/debug-github-pages-export branch July 2, 2026 15:55
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.

github pages export does not work

2 participants