Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
Fix: Made dashboard package dependencies safe for apps to upgrade (#14917)
Damian Legawiecdd72579df100
diff --git a/.changeset/dashboard-internal-dependencies.md b/.changeset/dashboard-internal-dependencies.mdnew file mode 100644index 0000000000..e77b0d87a3--- /dev/null+++ b/.changeset/dashboard-internal-dependencies.md@@ -0,0 +1,10 @@+---+"@spree/dashboard-core": patch+"@spree/dashboard-ui": patch+"@spree/dashboard": patch+"@spree/seller-dashboard": patch+---++Apps no longer choose the versions of `@tanstack/react-table`, `@tanstack/react-hotkeys` and `@hookform/resolvers` used inside the dashboard packages: they are now regular dependencies, so upgrading them in an app (for example to React Table 9) no longer breaks type checking or the dashboard itself. Table column definitions are available as `DataGridColumn` from `@spree/dashboard-ui`. The TipTap menu extensions are pinned to the same version as the rest of the editor.++`@spree/dashboard` and `@spree/seller-dashboard` now list the libraries they share with the app (React, TanStack Router and Query, React Hook Form, i18next, react-i18next and the Spree dashboard packages) as peer dependencies, so the app's copy is the only one. Before, an app on a different version got a second copy, which crashes React or makes plugins disappear. Apps must list these packages as their own dependencies; the starter templates now include React Hook Form, i18next and react-i18next.diff --git a/packages/dashboard-core/package.json b/packages/dashboard-core/package.jsonindex e757f30ddb..40fec85742 100644--- a/packages/dashboard-core/package.json+++ b/packages/dashboard-core/package.json@@ -58,13 +58,10 @@"prepublishOnly": "tsup"},"peerDependencies": {- "@hookform/resolvers": "^5.2.2","@spree/admin-sdk": ">=1.0.0-rc.4 <2.0.0-0","@spree/dashboard-ui": ">=0.10.0 <1.0.0-0 || >=1.0.0-0 <2.0.0-0",- "@tanstack/react-hotkeys": "^0.10.0","@tanstack/react-query": "^5.100.9","@tanstack/react-router": "^1.169.2",- "@tanstack/react-table": "^8.21.3","i18next": "^26.2.0","react": "^19.2.6","react-dom": "^19.2.6",@@ -75,7 +72,9 @@"@dnd-kit/core": "^6.3.1","@dnd-kit/sortable": "^10.0.0","@dnd-kit/utilities": "^3.2.2",+ "@hookform/resolvers": "^5.2.2","@tailwindcss/vite": "^4.2.4",+ "@tanstack/react-hotkeys": "^0.10.0","date-fns": "^4.1.0","date-fns-tz": "^3.2.0","lucide-react": "^1.47.0",diff --git a/packages/dashboard-core/src/products/inventory-section.tsx b/packages/dashboard-core/src/products/inventory-section.tsxindex f5f3e54f42..74f4724237 100644--- a/packages/dashboard-core/src/products/inventory-section.tsx+++ b/packages/dashboard-core/src/products/inventory-section.tsx@@ -2,13 +2,13 @@ import type { ProductFormValues, StockLevelFormValues } from '@spree/dashboard-cimport { useStockLocations } from '@spree/dashboard-core'import {DataGrid,+ type DataGridColumn,editableRowIndex,NumberCell,ReadOnlyCell,SwitchCell,} from '@spree/dashboard-ui'import { ExternalLinkIcon } from '@spree/dashboard-ui/icons'-import type { ColumnDef } from '@tanstack/react-table'import { useCallback, useMemo } from 'react'import { type UseFormReturn, useWatch } from 'react-hook-form'import { useTranslation } from 'react-i18next'@@ -135,7 +135,7 @@ export function InventorySection({ form, stockLocationHref }: InventorySectionPr[form],)- const columns = useMemo<ColumnDef<InventoryRow>[]>(+ const columns = useMemo<DataGridColumn<InventoryRow>[]>(() => [{id: 'location',diff --git a/packages/dashboard-starter/package.json b/packages/dashboard-starter/package.jsonindex 44ff6cd511..dea66c60dd 100644--- a/packages/dashboard-starter/package.json+++ b/packages/dashboard-starter/package.json@@ -22,8 +22,11 @@"@spree/dashboard-ui": "workspace:^","@tanstack/react-query": "^5.100.9","@tanstack/react-router": "^1.169.2",+ "i18next": "^26.2.0","react": "^19.2.6",- "react-dom": "^19.2.6"+ "react-dom": "^19.2.6",+ "react-hook-form": "^7.75.0",+ "react-i18next": "^17.0.8"},"devDependencies": {"@biomejs/biome": "^2.4.14",diff --git a/packages/dashboard-ui/package.json b/packages/dashboard-ui/package.jsonindex 96197eac75..426c1abd27 100644--- a/packages/dashboard-ui/package.json+++ b/packages/dashboard-ui/package.json@@ -43,7 +43,6 @@"typecheck": "tsc --noEmit"},"peerDependencies": {- "@tanstack/react-hotkeys": "^0.10.0","@tanstack/react-router": "^1.169.2","i18next": "^26.2.0","react": "^19.2.6",@@ -68,8 +67,11 @@"@dnd-kit/utilities": "3.2.2","@fontsource-variable/geist": "5.2.8","@fontsource-variable/geist-mono": "5.2.7",+ "@tanstack/react-hotkeys": "^0.10.0","@tanstack/react-table": "8.21.3","@tiptap/core": "3.31.3",+ "@tiptap/extension-bubble-menu": "3.31.3",+ "@tiptap/extension-floating-menu": "3.31.3","@tiptap/extension-image": "3.31.3","@tiptap/extension-link": "3.31.3","@tiptap/extension-placeholder": "3.31.3",diff --git a/packages/dashboard-ui/src/spree/data-grid/index.ts b/packages/dashboard-ui/src/spree/data-grid/index.tsindex 3781b07f0f..6035c9465e 100644--- a/packages/dashboard-ui/src/spree/data-grid/index.ts+++ b/packages/dashboard-ui/src/spree/data-grid/index.ts@@ -1,3 +1,6 @@+// Column definitions name the table library through this package, which owns+// its version — consumers never install it themselves.+export type { ColumnDef as DataGridColumn } from '@tanstack/react-table'export {DecimalCell,MoneyCell,diff --git a/packages/dashboard/package.json b/packages/dashboard/package.jsonindex ec3d3905bf..a194a70326 100644--- a/packages/dashboard/package.json+++ b/packages/dashboard/package.json@@ -65,11 +65,7 @@"@fontsource-variable/geist": "^5.2.8","@fontsource-variable/geist-mono": "^5.2.7","@hookform/resolvers": "^5.2.2",- "@spree/admin-sdk": "workspace:^",- "@spree/dashboard-core": "workspace:^",- "@spree/dashboard-ui": "workspace:^","@tanstack/react-hotkeys": "^0.10.0",- "@tanstack/react-query": "^5.100.9","@tanstack/react-table": "^8.21.3","@tanstack/router-plugin": "^1.167.35","@tanstack/virtual-file-routes": "^1.162.0",@@ -80,15 +76,10 @@"date-fns": "^4.1.0","date-fns-tz": "^3.2.0","flag-icons": "^7.5.0",- "i18next": "^26.2.0","lucide-react": "^1.47.0","next-themes": "^0.4.6",- "react": "^19.2.6","react-colorful": "^5.7.0","react-day-picker": "^9.14.0",- "react-dom": "^19.2.6",- "react-hook-form": "^7.75.0",- "react-i18next": "^17.0.8","react-markdown": "^10.1.0","recharts": "3.10.1","rehype-raw": "^7.0.0",@@ -100,11 +91,21 @@},"devDependencies": {"@playwright/test": "^1.59.1",+ "@spree/admin-sdk": "workspace:^",+ "@spree/dashboard-core": "workspace:^","@spree/dashboard-plugin-example": "workspace:^",+ "@spree/dashboard-ui": "workspace:^",+ "@tanstack/react-query": "^5.100.9",+ "@tanstack/react-router": "^1.169.2","@types/node": "^25.6.0","@types/react": "^19.2.14","@types/react-dom": "^19.2.3","@vitejs/plugin-react": "^6.0.1",+ "i18next": "^26.2.0",+ "react": "^19.2.6",+ "react-dom": "^19.2.6",+ "react-hook-form": "^7.75.0",+ "react-i18next": "^17.0.8","shadcn": "^4.21.0","tailwindcss": "^4.2.4","tsup": "^8.5.1",@@ -118,6 +119,15 @@}},"peerDependencies": {- "@tanstack/react-router": "^1.169.2"+ "@spree/admin-sdk": "workspace:^",+ "@spree/dashboard-core": "workspace:^",+ "@spree/dashboard-ui": "workspace:^",+ "@tanstack/react-query": "^5.100.9",+ "@tanstack/react-router": "^1.169.2",+ "i18next": "^26.2.0",+ "react": "^19.2.6",+ "react-dom": "^19.2.6",+ "react-hook-form": "^7.75.0",+ "react-i18next": "^17.0.8"}}diff --git a/packages/seller-dashboard-starter/package.json b/packages/seller-dashboard-starter/package.jsonindex 06c6cb2718..223d5271a0 100644--- a/packages/seller-dashboard-starter/package.json+++ b/packages/seller-dashboard-starter/package.json@@ -17,14 +17,17 @@},"dependencies": {"@spree/admin-sdk": "workspace:^",- "@spree/seller-dashboard": "workspace:^","@spree/dashboard-core": "workspace:^","@spree/dashboard-ui": "workspace:^",+ "@spree/seller-dashboard": "workspace:^","@spree/seller-sdk": "workspace:^","@tanstack/react-query": "^5.100.9","@tanstack/react-router": "^1.169.2",+ "i18next": "^26.2.0","react": "^19.2.6",- "react-dom": "^19.2.6"+ "react-dom": "^19.2.6",+ "react-hook-form": "^7.75.0",+ "react-i18next": "^17.0.8"},"devDependencies": {"@biomejs/biome": "^2.4.14",diff --git a/packages/seller-dashboard/package.json b/packages/seller-dashboard/package.jsonindex dcf24eb00a..eb15378806 100644--- a/packages/seller-dashboard/package.json+++ b/packages/seller-dashboard/package.json@@ -48,31 +48,40 @@"@dnd-kit/core": "^6.3.1","@dnd-kit/sortable": "^10.0.0","@dnd-kit/utilities": "^3.2.2",- "@spree/dashboard-core": "workspace:*",- "@spree/dashboard-ui": "workspace:*","@spree/seller-sdk": "workspace:*",- "@tanstack/react-query": "^5.90.2",- "@tanstack/react-router": "^1.133.32","@tanstack/router-plugin": "^1.167.35","@tanstack/virtual-file-routes": "^1.162.0",- "i18next": "^26.2.0","lucide-react": "^1.47.0",- "react-hook-form": "^7.65.0",- "react-i18next": "^17.0.8","zod": "^4.4.3"},"peerDependencies": {- "react": "^19.0.0",- "react-dom": "^19.0.0"+ "@spree/admin-sdk": "workspace:^",+ "@spree/dashboard-core": "workspace:^",+ "@spree/dashboard-ui": "workspace:^",+ "@tanstack/react-query": "^5.100.9",+ "@tanstack/react-router": "^1.169.2",+ "i18next": "^26.2.0",+ "react": "^19.2.6",+ "react-dom": "^19.2.6",+ "react-hook-form": "^7.75.0",+ "react-i18next": "^17.0.8"},"devDependencies": {"@biomejs/biome": "^2.4.14",+ "@spree/admin-sdk": "workspace:*",+ "@spree/dashboard-core": "workspace:*",+ "@spree/dashboard-ui": "workspace:*",+ "@tanstack/react-query": "^5.100.9",+ "@tanstack/react-router": "^1.169.2","@types/node": "^25.6.0","@types/react": "^19.2.2","@types/react-dom": "^19.2.1","@vitejs/plugin-react": "^6.0.1",- "react": "^19.2.0",- "react-dom": "^19.2.0",+ "i18next": "^26.2.0",+ "react": "^19.2.6",+ "react-dom": "^19.2.6",+ "react-hook-form": "^7.75.0",+ "react-i18next": "^17.0.8","tsup": "^8.5.0","typescript": "~6.0.3","vite": "^8.0.0"diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex bc2dfc2c89..55f6e32d46 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -178,24 +178,9 @@ importers:'@hookform/resolvers':specifier: ^5.2.2version: 5.9.1(@standard-schema/[email protected])([email protected]([email protected]))([email protected])([email protected](@types/[email protected])([email protected]))([email protected])- '@spree/admin-sdk':- specifier: workspace:^- version: link:../admin-sdk- '@spree/dashboard-core':- specifier: workspace:^- version: link:../dashboard-core- '@spree/dashboard-ui':- specifier: workspace:^- version: link:../dashboard-ui'@tanstack/react-hotkeys':specifier: ^0.10.0- '@tanstack/react-query':- specifier: ^5.100.9- version: 5.104.1([email protected])- '@tanstack/react-router':- specifier: ^1.169.2'@tanstack/react-table':specifier: ^8.21.3@@ -226,33 +211,18 @@ importers:flag-icons:specifier: ^7.5.0version: 7.5.0- i18next:- specifier: ^26.2.0- version: 26.4.2([email protected])lucide-react:specifier: ^1.47.0version: 1.52.0(@types/[email protected])([email protected])next-themes:specifier: ^0.4.6- react:- specifier: ^19.2.6- version: 19.3.0react-colorful:specifier: ^5.7.0react-day-picker:specifier: ^9.14.0version: 9.14.0([email protected])- react-dom:- specifier: ^19.2.6- version: 19.3.0([email protected])- react-hook-form:- specifier: ^7.75.0- version: 7.89.0(@types/[email protected])([email protected])- react-i18next:- specifier: ^17.0.8- version: 17.0.16([email protected]([email protected]))([email protected]([email protected]))([email protected])([email protected])react-markdown:specifier: ^10.1.0version: 10.1.0(@types/[email protected])([email protected])@@ -281,9 +251,24 @@ importers:'@playwright/test':specifier: ^1.59.1version: 1.63.0+ '@spree/admin-sdk':+ specifier: workspace:^+ version: link:../admin-sdk+ '@spree/dashboard-core':+ specifier: workspace:^+ version: link:../dashboard-core'@spree/dashboard-plugin-example':specifier: workspace:^version: link:../dashboard-plugin-example+ '@spree/dashboard-ui':+ specifier: workspace:^+ version: link:../dashboard-ui+ '@tanstack/react-query':+ specifier: ^5.100.9+ version: 5.104.1([email protected])+ '@tanstack/react-router':+ specifier: ^1.169.2'@types/node':specifier: ^25.6.0version: 25.9.9@@ -296,6 +281,21 @@ importers:'@vitejs/plugin-react':specifier: ^6.0.1version: 6.1.2([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]))+ i18next:+ specifier: ^26.2.0+ version: 26.4.2([email protected])+ react:+ specifier: ^19.2.6+ version: 19.3.0+ react-dom:+ specifier: ^19.2.6+ version: 19.3.0([email protected])+ react-hook-form:+ specifier: ^7.75.0+ version: 7.89.0(@types/[email protected])([email protected])+ react-i18next:+ specifier: ^17.0.8+ version: 17.0.16([email protected]([email protected]))([email protected]([email protected]))([email protected])([email protected])shadcn:specifier: ^4.21.0version: 4.21.3@@ -341,9 +341,6 @@ importers:'@tanstack/react-router':specifier: ^1.169.2- '@tanstack/react-table':- specifier: ^8.21.3date-fns:specifier: ^4.1.0version: 4.4.0@@ -463,12 +460,21 @@ importers:'@tanstack/react-router':specifier: ^1.169.2+ i18next:+ specifier: ^26.2.0+ version: 26.4.2([email protected])react:specifier: ^19.2.6version: 19.3.0react-dom:specifier: ^19.2.6version: 19.3.0([email protected])+ react-hook-form:+ specifier: ^7.75.0+ version: 7.89.0(@types/[email protected])([email protected])+ react-i18next:+ specifier: ^17.0.8+ version: 17.0.16([email protected]([email protected]))([email protected]([email protected]))([email protected])([email protected])devDependencies:'@biomejs/biome':specifier: ^2.4.14@@ -557,6 +563,12 @@ importers:'@tiptap/core':specifier: 3.31.3version: 3.31.3(@tiptap/[email protected])+ '@tiptap/extension-bubble-menu':+ specifier: 3.31.3+ '@tiptap/extension-floating-menu':+ specifier: 3.31.3+ version: 3.31.3(@floating-ui/[email protected])(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])'@tiptap/extension-image':specifier: 3.31.3version: 3.31.3(@tiptap/[email protected](@tiptap/[email protected]))@@ -720,39 +732,18 @@ importers:'@hookform/resolvers':specifier: ^5.2.2version: 5.9.1(@standard-schema/[email protected])([email protected]([email protected]))([email protected])([email protected](@types/[email protected])([email protected]))([email protected])- '@spree/dashboard-core':- specifier: workspace:*- version: link:../dashboard-core- '@spree/dashboard-ui':- specifier: workspace:*- version: link:../dashboard-ui'@spree/seller-sdk':specifier: workspace:*version: link:../seller-sdk- '@tanstack/react-query':- specifier: ^5.90.2- version: 5.104.1([email protected])- '@tanstack/react-router':- specifier: ^1.133.32'@tanstack/router-plugin':specifier: ^1.167.35version: 1.168.42(@tanstack/[email protected]([email protected]([email protected]))([email protected]))([email protected])([email protected])([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]))'@tanstack/virtual-file-routes':specifier: ^1.162.0version: 1.162.0- i18next:- specifier: ^26.2.0- version: 26.4.2([email protected])lucide-react:specifier: ^1.47.0version: 1.52.0(@types/[email protected])([email protected])- react-hook-form:- specifier: ^7.65.0- version: 7.89.0(@types/[email protected])([email protected])- react-i18next:- specifier: ^17.0.8- version: 17.0.16([email protected]([email protected]))([email protected]([email protected]))([email protected])([email protected])zod:specifier: ^4.4.3version: 4.6.5@@ -760,6 +751,21 @@ importers:'@biomejs/biome':specifier: ^2.4.14version: 2.5.15+ '@spree/admin-sdk':+ specifier: workspace:*+ version: link:../admin-sdk+ '@spree/dashboard-core':+ specifier: workspace:*+ version: link:../dashboard-core+ '@spree/dashboard-ui':+ specifier: workspace:*+ version: link:../dashboard-ui+ '@tanstack/react-query':+ specifier: ^5.100.9+ version: 5.104.1([email protected])+ '@tanstack/react-router':+ specifier: ^1.169.2'@types/node':specifier: ^25.6.0version: 25.9.9@@ -772,12 +778,21 @@ importers:'@vitejs/plugin-react':specifier: ^6.0.1version: 6.1.2([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]))+ i18next:+ specifier: ^26.2.0+ version: 26.4.2([email protected])react:- specifier: ^19.2.0+ specifier: ^19.2.6version: 19.3.0react-dom:- specifier: ^19.2.0+ specifier: ^19.2.6version: 19.3.0([email protected])+ react-hook-form:+ specifier: ^7.75.0+ version: 7.89.0(@types/[email protected])([email protected])+ react-i18next:+ specifier: ^17.0.8+ version: 17.0.16([email protected]([email protected]))([email protected]([email protected]))([email protected])([email protected])tsup:specifier: ^8.5.0version: 8.5.1([email protected])([email protected])([email protected])([email protected])([email protected])@@ -811,12 +826,21 @@ importers:'@tanstack/react-router':specifier: ^1.169.2+ i18next:+ specifier: ^26.2.0+ version: 26.4.2([email protected])react:specifier: ^19.2.6version: 19.3.0react-dom:specifier: ^19.2.6version: 19.3.0([email protected])+ react-hook-form:+ specifier: ^7.75.0+ version: 7.89.0(@types/[email protected])([email protected])+ react-i18next:+ specifier: ^17.0.8+ version: 17.0.16([email protected]([email protected]))([email protected]([email protected]))([email protected])([email protected])devDependencies:'@biomejs/biome':specifier: ^2.4.14@@ -2268,6 +2292,12 @@ packages:peerDependencies:'@tiptap/core': 3.31.3+ '@tiptap/[email protected]':+ resolution: {integrity: sha512-EV6ZnwKc++2OM/OcD54n8s1B7C9LP7GKAtdEPwu0t3BYJf3sG8Ueoinf7SgGPO9oMPg96GneOkDNm1urMV167g==}+ peerDependencies:+ '@tiptap/core': 3.31.3+ '@tiptap/pm': 3.31.3+'@tiptap/[email protected]':resolution: {integrity: sha512-Ml/yswuys+3QkOMajfXyAGlUKCxEbT3dMyF8vHwQ5mDk9MDm+dqp10It5CrDBkUT/KkVTa6AJI3kb0TXZJZiAA==}peerDependencies:@@ -2300,6 +2330,13 @@ packages:peerDependencies:'@tiptap/extensions': 3.31.3+ '@tiptap/[email protected]':+ resolution: {integrity: sha512-rd4VJ9PGSP9Eop8ZTEwaLZcMzMXLuJKe3hUNf58rq+zANpwM+9fI+vB7g9MAc3eXwUNDxNDVACFIL2oeBqpQ3A==}+ peerDependencies:+ '@floating-ui/dom': ^1.0.0+ '@tiptap/core': 3.31.3+ '@tiptap/pm': 3.31.3+'@tiptap/[email protected]':resolution: {integrity: sha512-pKzulkDmolpVt7IP9FSPsC5pKbXQ5pyeqkaAYr8cyOVW+KUObpPRIzAuXvEso8PCjWgwJ1f2qyishOEMw8MbfQ==}peerDependencies:@@ -6574,6 +6611,12 @@ snapshots:dependencies:'@tiptap/core': 3.31.3(@tiptap/[email protected])+ '@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])':+ dependencies:+ '@floating-ui/dom': 1.8.0+ '@tiptap/core': 3.31.3(@tiptap/[email protected])+ '@tiptap/pm': 3.31.3+'@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])':dependencies:'@floating-ui/dom': 1.8.0@@ -6602,6 +6645,12 @@ snapshots:dependencies:'@tiptap/extensions': 3.31.3(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])+ '@tiptap/[email protected](@floating-ui/[email protected])(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])':+ dependencies:+ '@floating-ui/dom': 1.8.0+ '@tiptap/core': 3.31.3(@tiptap/[email protected])+ '@tiptap/pm': 3.31.3+'@tiptap/[email protected](@floating-ui/[email protected])(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])':dependencies:'@floating-ui/dom': 1.8.0