Skip to content

export react component#28

Merged
AlexSurtees merged 11 commits intodevfrom
feat/react-component
Jan 6, 2026
Merged

export react component#28
AlexSurtees merged 11 commits intodevfrom
feat/react-component

Conversation

@dannda
Copy link
Collaborator

@dannda dannda commented Nov 24, 2025

Description

make monorepo with packages viewer (component) and sites/app for deployment
export react component and api
monorepo follows a single version for simplicity

Fixes #12
Related to #15 as component expects a sources prop as an array of strings, and sites/app gets all source search params

Type of change

  • 🐛 Bug fix (non-breaking change that resolves an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • ⚡ Optimisation (non-breaking improvement to performance or efficiency)
  • 🧩 Documentation (adds or improves documentation)
  • 🧱 Maintenance (refactor, dependency update, CI/CD, etc.)
  • 🔥 Breaking change (fix or feature that causes existing functionality to change)

Checklist

  • All tests pass (eg. npm test)
  • Pre-commit hooks run successfully (eg. pre-commit run --all-files)
  • Documentation updated (if required)

Copilot AI review requested due to automatic review settings November 24, 2025 11:11
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the codebase into a monorepo structure with separate packages for the viewer React component (@biongff/vizarr) and a deployment application (sites/app). The viewer package is now published as a library while the app consumes it for deployment.

Key changes:

  • Converted from single package to pnpm monorepo workspace
  • Created viewer package exporting the Vizarr React component
  • Created sites/app package for deployment using the viewer component
  • Updated build configurations to support library builds and app bundling
  • Modified CI/CD workflows to build and publish the viewer package

Reviewed changes

Copilot reviewed 24 out of 55 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
vite.config.js Simplified root config (removed custom build logic)
viewer/vite.config.js New library build configuration with TypeScript declarations
viewer/package.json Package metadata for published @biongff/vizarr component
viewer/src/index.tsx Exports viewer component and API
sites/app/vite.config.js App build config with dev alias to viewer source
sites/app/src/main.tsx App entry point using the published viewer
sites/app/src/App.tsx App component managing URL state and viewer
pnpm-workspace.yaml Monorepo workspace configuration
package.json Root package scripts for monorepo management
.releaserc.json Updated release config for monorepo versioning
.github/workflows/*.yml Updated CI/CD to build viewer and app separately
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -0,0 +1,10 @@
export { version } from "../../package.json";
Copy link

Copilot AI Nov 24, 2025

Choose a reason for hiding this comment

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

Exporting version from the root package.json is incorrect for the viewer package. The viewer has its own package.json at viewer/package.json with version 1.1.1. This export should reference ../package.json (the viewer's package.json) instead of ../../package.json (the root monorepo package.json).

Copilot uses AI. Check for mistakes.
fileName: (format) => `biongff-vizarr.${format}.js`,
},
rollupOptions: {
external: ["react", "react-dom", "@mui/material", "@mui/icons-material", "@emotion/react", "@emotion/styled"],
Copy link

Copilot AI Nov 24, 2025

Choose a reason for hiding this comment

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

The external array is missing several critical dependencies that should also be externalized for the library build. Dependencies like deck.gl, @deck.gl/*, jotai, zarrita, @zarrita/storage, and @hms-dbmi/viv are listed as regular dependencies in viewer/package.json but are not marked as external. These should either be moved to peerDependencies or added to the external array to avoid bundling them into the library output.

Copilot uses AI. Check for mistakes.
[
"@semantic-release/exec",
{
"prepareCmd": "pnpm -r exec npm version ${nextRelease.version} --no-git-tag-version"
Copy link

Copilot AI Nov 24, 2025

Choose a reason for hiding this comment

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

The prepareCmd uses pnpm -r exec which will run the version command in all workspace packages including the root. However, the root package (biongff-monorepo) should not have the same version as the published viewer package. Consider using a more targeted approach like pnpm --filter viewer exec npm version ${nextRelease.version} --no-git-tag-version or filtering out the root package.

Suggested change
"prepareCmd": "pnpm -r exec npm version ${nextRelease.version} --no-git-tag-version"
"prepareCmd": "pnpm --filter viewer exec npm version ${nextRelease.version} --no-git-tag-version"

Copilot uses AI. Check for mistakes.
pre-release-tag: "dev"

- name: Sync package versions
run: pnpm -r exec npm version ${{ steps.pre-release-version.outputs.pre-release-version }} --no-git-tag-version
Copy link

Copilot AI Nov 24, 2025

Choose a reason for hiding this comment

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

Similar to the release config, this command will update versions in all workspace packages including the root. The root biongff-monorepo package is not published and should not have its version synchronized with the viewer package. Consider filtering to only update the viewer package: pnpm --filter viewer exec npm version ...

Suggested change
run: pnpm -r exec npm version ${{ steps.pre-release-version.outputs.pre-release-version }} --no-git-tag-version
run: pnpm --filter viewer exec npm version ${{ steps.pre-release-version.outputs.pre-release-version }} --no-git-tag-version

Copilot uses AI. Check for mistakes.
@dannda dannda requested a review from davehorsfall November 24, 2025 12:10
@AlexSurtees
Copy link
Collaborator

@dannda Have the workflow file changes been tested or are you planning on testing those after merging to the respective branches? It might be useful to do a pre-release for this PR in some form so that the api can be tested before merging.

@netlify
Copy link

netlify bot commented Dec 9, 2025

Deploy Preview for biongff-vizarr ready!

Name Link
🔨 Latest commit 0f4c025
🔍 Latest deploy log https://app.netlify.com/projects/biongff-vizarr/deploys/6945367e069a6900081a6ba6
😎 Deploy Preview https://deploy-preview-28--biongff-vizarr.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Collaborator

@davehorsfall davehorsfall left a comment

Choose a reason for hiding this comment

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

The restructure looks good. Merging to dev and testing pre-release workflow.

@AlexSurtees AlexSurtees closed this Jan 6, 2026
@AlexSurtees AlexSurtees reopened this Jan 6, 2026
@AlexSurtees AlexSurtees merged commit 70b6b72 into dev Jan 6, 2026
5 checks passed
@AlexSurtees AlexSurtees deleted the feat/react-component branch January 6, 2026 11:44
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