Refactor eLabFTW conde integration into package#668
Conversation
🦋 Changeset detectedLatest commit: 1cb7614 The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
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 |
There was a problem hiding this comment.
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-elabftwpackage (interface implementation, shared utilities, Vitest + Cypress tests). - Adds
DatabaseContextto@opencloning/uiand switchesapps/opencloningto 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
licensefields + 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.
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
|
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 |
|
👍 |
No description provided.