Skip to content

Refactor eLabFTW conde integration into package#668

Merged
manulera merged 5 commits intomasterfrom
refactor-eLabFTW-into-package
Mar 6, 2026
Merged

Refactor eLabFTW conde integration into package#668
manulera merged 5 commits intomasterfrom
refactor-eLabFTW-into-package

Conversation

@manulera
Copy link
Owner

@manulera manulera commented Mar 6, 2026

No description provided.

@manulera manulera requested a review from Copilot March 6, 2026 10:12
@changeset-bot
Copy link

changeset-bot bot commented Mar 6, 2026

🦋 Changeset detected

Latest commit: 1cb7614

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
@opencloning/opencloning-elabftw Minor
@opencloning/ui Minor
standalone-app Patch
syntax-builder Patch
opencloning Patch
@opencloning/store Minor
@opencloning/utils Minor
test-app Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@manulera manulera merged commit dd0df39 into master Mar 6, 2026
29 checks passed
@manulera manulera deleted the refactor-eLabFTW-into-package branch March 6, 2026 10:21
Copy link
Contributor

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 eLabFTW database integration into a dedicated workspace package (@opencloning/opencloning-elabftw) and updates the app/UI wiring to consume a database interface via a new DatabaseContext provider. It also standardizes package metadata by adding license: "MIT" and updates test/build tooling to recognize the new package.

Changes:

  • Introduces @opencloning/opencloning-elabftw package (interface implementation, shared utilities, Vitest + Cypress tests).
  • Adds DatabaseContext to @opencloning/ui and switches apps/opencloning to select/provide the active database interface via context.
  • Updates workspace/tooling configs (Vitest workspaces, Cypress/Vite aliases, yarn.lock/resolutions, husky axios check) and adds license fields + changesets.

Reviewed changes

Copilot reviewed 32 out of 45 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
yarn.lock Adds the new workspace package and wires it into the app dependencies.
vitest.config.js Includes the new package in Vitest workspace projects.
packages/utils/package.json Adds MIT license metadata.
packages/ui/src/providers/DatabaseContext.jsx Adds a DB interface context/provider + hook.
packages/ui/src/hooks/useDatabase.js Switches useDatabase to come from DatabaseContext.
packages/ui/src/components/dummy/index.js Exposes dummy DB interface via a stable export path.
packages/ui/package.json Adds license and exports DatabaseContext + form component entrypoints.
packages/store/package.json Adds MIT license metadata.
packages/opencloning-elabftw/vitest.config.js Adds package-local Vitest config and aliases.
packages/opencloning-elabftw/src/utils.js Shared helpers (error formatting + file fetch).
packages/opencloning-elabftw/src/index.js Exports eLabFTWInterface from the package.
packages/opencloning-elabftw/src/envValues.js Reads Vite env configuration for local/dev usage.
packages/opencloning-elabftw/src/eLabFTWInterface.test.js Adds unit tests for the eLabFTW interface logic.
packages/opencloning-elabftw/src/eLabFTWInterface.js Implements the eLabFTW OpenCloning DB adapter interface.
packages/opencloning-elabftw/src/common.js Centralizes axios client + headers + helpers (allowed by husky rule).
packages/opencloning-elabftw/src/SubmitToDatabaseComponent.jsx Minor cleanup (removes stray whitespace line).
packages/opencloning-elabftw/src/SubmitToDatabaseComponent.cy.jsx Fixes test imports after package move.
packages/opencloning-elabftw/src/PrimersNotInDatabaseComponent.jsx Adds UI for saving missing primers during submission.
packages/opencloning-elabftw/src/PrimersNotInDatabaseComponent.cy.jsx Adds component tests for the new primers UI.
packages/opencloning-elabftw/src/LoadHistoryComponent.jsx Switches to consuming shared UI RetryAlert.
packages/opencloning-elabftw/src/LoadHistoryComponent.cy.jsx Adds component tests for loading history.
packages/opencloning-elabftw/src/GetSequenceFileAndDatabaseIdComponent.jsx Switches to consuming shared UI RetryAlert.
packages/opencloning-elabftw/src/GetSequenceFileAndDatabaseIdComponent.cy.jsx Fixes test imports after package move.
packages/opencloning-elabftw/src/GetPrimerComponent.jsx Adds primer selection component.
packages/opencloning-elabftw/src/GetPrimerComponent.cy.jsx Adds component tests for primer selection behavior.
packages/opencloning-elabftw/src/ELabFTWResourceSelect.jsx Switches to consuming shared UI PostRequestSelect.
packages/opencloning-elabftw/src/ELabFTWResourceSelect.cy.jsx Adds component tests for resource search/select.
packages/opencloning-elabftw/src/ELabFTWFileSelect.jsx Switches to consuming shared UI GetRequestMultiSelect.
packages/opencloning-elabftw/src/ELabFTWFileSelect.cy.jsx Adds component tests for file selection.
packages/opencloning-elabftw/src/ELabFTWCategorySelect.jsx Switches to consuming shared UI request wrapper/components.
packages/opencloning-elabftw/src/ELabFTWCategorySelect.cy.jsx Adds component tests for category selection.
packages/opencloning-elabftw/package.json Defines the new package (deps/peers/exports).
packages/opencloning-elabftw/README.md Documents package purpose + env vars + local run instructions.
package.json Adds license and pins workspace resolution for the new package.
cypress.config.js Adds alias to the new package for component tests.
apps/test-app/package.json Adds MIT license metadata.
apps/syntax-builder/package.json Adds MIT license metadata.
apps/standalone-app/package.json Adds MIT license metadata.
apps/opencloning/vite.config.js Adds config option + alias for the new package.
apps/opencloning/src/App.jsx Selects DB interface (eLabFTW/dummy) and provides via DatabaseProvider.
apps/opencloning/package.json Adds dependency on @opencloning/opencloning-elabftw + license.
.husky/no_axios_outside_clients.sh Allows axios usage in new package client module.
.changeset/sweet-tires-deny.md Changeset for adding license to packages.
.changeset/plain-frogs-dream.md Changeset for moving eLabFTW integration into its own package.
.changeset/config.json Links the new package into changeset grouping.

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

@github-actions github-actions bot mentioned this pull request Mar 6, 2026
@codecov
Copy link

codecov bot commented Mar 6, 2026

Codecov Report

❌ Patch coverage is 92.30769% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 86.68%. Comparing base (e2275ad) to head (1cb7614).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
apps/opencloning/src/App.jsx 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #668      +/-   ##
==========================================
+ Coverage   86.66%   86.68%   +0.02%     
==========================================
  Files         229      229              
  Lines        7131     7136       +5     
  Branches     1586     1586              
==========================================
+ Hits         6180     6186       +6     
+ Misses        951      950       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@manulera
Copy link
Owner Author

manulera commented Mar 6, 2026

Hi @NicolasCARPi, I have separated the integration code into a package, that is also published to npm. I think it's good to keep the code separate, and it reinforces the idea that it's truly an integration and not hard-coded into OpenCloning.

Nothing to do on your end, I will test the docker container with eLabFTW and then release again but just wanted to let you know.

The summary of copilot is quite good

@NicolasCARPi
Copy link
Contributor

👍

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