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
Apply review-round fixes from the branch code review
Damian Legawiec9c80ab185344
diff --git a/docs/developer/dashboard/customization/routes.mdx b/docs/developer/dashboard/customization/routes.mdxindex 9eff396e55..0bb2b37915 100644--- a/docs/developer/dashboard/customization/routes.mdx+++ b/docs/developer/dashboard/customization/routes.mdx@@ -63,6 +63,10 @@ Route "/_authenticated/$storeId/brands/" is declared by more than one package:Rename one of the routes, or drop the plugin that shouldn't own it. (Duplicate paths *within* a single package are reported by the TanStack generator instead — that's an authoring bug in one package.)+<Warning>+The collision check only sees **file routes**. If a runtime-registry route (below) uses the same URL as a compiled file route, there's no build error — the file route silently wins on every navigation, because the registry's catch-all is the lowest-priority match. If a page you registered at runtime never renders, check whether an installed plugin claims the same path.+</Warning>+## Runtime route registry (in-app & dynamic)Register from your host app's `plugins.ts` (or a plugin that genuinely needs runtime registration):@@ -137,6 +141,8 @@ routes: [{Always pair this with a matching `subject` on the **nav entry** so users without permission never see the link in the first place. The route subject is the defensive layer for direct URLs.+`subject` is a **registry-route** feature — the dispatcher applies it before rendering. File routes don't pass through the dispatcher, so they gate themselves: check permissions inside the component with `<Can>` or `usePermissions()` from `@spree/dashboard-core` and render a fallback. Either way, this is UX only — the backend still authorizes every API call.+## LayoutCustom routes inherit the dashboard's `_authenticated` + `$storeId` layout (auth guard, sidebar, top bar, etc.) — your component renders inside the `<Outlet />`. Use `<ResourceLayout>` from `@spree/dashboard-ui` to get the same header/main/sidebar grid as core pages:diff --git a/packages/cli/src/commands/plugin.ts b/packages/cli/src/commands/plugin.tsindex 68cf05a400..2347145b36 100644--- a/packages/cli/src/commands/plugin.ts+++ b/packages/cli/src/commands/plugin.ts@@ -452,7 +452,10 @@ function printNextSteps(answers: Answers, dst: string, installed: boolean): voidlines.push('')lines.push(pc.bold('Dashboard plugin'))lines.push(- ` Edit ${pc.cyan('packages/dashboard/src/index.tsx')} to wire your nav/route/slot extensions.`,+ ` Edit ${pc.cyan('packages/dashboard/src/index.tsx')} to register nav entries and slot widgets.`,+ )+ lines.push(+ ` Add pages as file routes in ${pc.cyan('packages/dashboard/src/routes/')} — compiled into the host's typed route tree.`,)lines.push(` See ${pc.cyan('https://spreecommerce.org/docs/developer/dashboard/plugins/overview')}`,diff --git a/packages/dashboard-core/src/vite/discover.ts b/packages/dashboard-core/src/vite/discover.tsindex 455edafc1b..be38668f9d 100644--- a/packages/dashboard-core/src/vite/discover.ts+++ b/packages/dashboard-core/src/vite/discover.ts@@ -63,7 +63,8 @@ export function discoverDashboardPluginManifests(let pkg: PluginManifesttry {pkg = JSON.parse(fs.readFileSync(manifestPath, 'utf8')) as PluginManifest- } catch {+ } catch (err) {+ onWarn?.(`Could not parse ${manifestPath}: ${(err as Error).message}`)manifests.push({ name })continue}diff --git a/packages/dashboard/src/vite/index.ts b/packages/dashboard/src/vite/index.tsindex 5767d829bc..b0a2811a8a 100644--- a/packages/dashboard/src/vite/index.ts+++ b/packages/dashboard/src/vite/index.ts@@ -88,8 +88,10 @@ function dashboardRouterPlugin(hostRoot: string, options: SpreeDashboardPluginOp]assertNoRouteCollisions(sources)+ // POSIX-normalize: the generator expects forward slashes; path.relative+ // emits backslashes on Windows.const pluginMounts = routedPlugins.map((m) =>- physical('', path.relative(shellRoutesDir, m.routesDir)),+ physical('', path.relative(shellRoutesDir, m.routesDir).split(path.sep).join('/')),)const virtualRouteConfig = rootRoute('__root.tsx', [