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 registry installs of the dashboard Vite integration; release admin-sdk 0.6.0, dashboard 0.10.1, CLI 2.4.1 (#14307)
Damian Legawieccc8b4be3352c
diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.ymlindex 613e85d90f..56b0356590 100644--- a/.github/workflows/packages.yml+++ b/.github/workflows/packages.yml@@ -122,9 +122,11 @@ jobs:- run: pnpm install --frozen-lockfile# The admin SPA imports built dist from the SDKs (per the workspace- # convention) — build them first so Vite resolves the workspace deps.+ # convention), and its vite.config resolves dashboard-core's compiled+ # Vite entry (dist/vite) — build them first so Vite resolves the+ # workspace deps.- name: Build SDK dependencies- run: pnpm turbo build --filter=@spree/sdk-core --filter=@spree/admin-sdk+ run: pnpm turbo build --filter=@spree/sdk-core --filter=@spree/admin-sdk --filter=@spree/dashboard-core- name: Setup dummy Rails appworking-directory: spree/api@@ -366,10 +368,12 @@ jobs:if: steps.check.outputs.published == 'false'run: pnpm publish --provenance --access public --tag ${{ steps.tag.outputs.tag }} --no-git-checks- # The dashboard packages are source-only (they ship src/, no build step) and- # depend on each other via workspace:^, which `pnpm publish` rewrites to the- # concrete ^x.y.z while packing — so they publish in dependency order from a- # single job. Pre-1.0 Developer Preview versions ship under the `next` tag,+ # The dashboard packages are source-only for everything the host's Vite+ # compiles, but their Node-side Vite-plugin entries are compiled to JS by a+ # per-package prepublishOnly hook (Node refuses to type-strip .ts under+ # node_modules). They depend on each other via workspace:^, which+ # `pnpm publish` rewrites to the concrete ^x.y.z while packing — so they+ # publish in dependency order from a single job. Pre-1.0 Developer Preview versions ship under the `next` tag,# matching @spree/admin-sdk.release-dashboard:name: "Dashboard packages - Release"diff --git a/CLAUDE.md b/CLAUDE.mdindex 9a54615bd8..771b0b2122 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -487,11 +487,12 @@ The split lets plugin authors register UI via `defineDashboardPlugin` from `@sprpnpm server:setup # one-time bootstrap (see "Development Server" above)pnpm server:dev # foreground; streams logs — Rails on http://localhost:3000-# 2. Boot the admin (separate terminal)-cd packages/dashboard-pnpm dev # http://localhost:5173 (proxies /api/* to :3000)+# 2. Boot the admin (separate terminal, from monorepo root)+pnpm turbo dev --filter=@spree/dashboard-starter # http://localhost:5173 (proxies /api/* to :3000)```+The starter is the canonical host — the same app `spree add dashboard` scaffolds — so local dev exercises the real consumer path (shell + plugin pipeline) while still hot-reloading `@spree/dashboard`/`-core`/`-ui` source through the workspace. `turbo dev` (not a bare `pnpm dev` inside the package) matters on a fresh clone: the starter's `vite.config.ts` resolves the compiled Node-side Vite entries (`@spree/dashboard/vite`, `@spree/dashboard-core/vite`) from `dist/`, and turbo's `^build` dependency produces them. After any full `pnpm build`, `cd packages/dashboard-starter && pnpm dev` works too.+`VITE_SPREE_API_URL` overrides the backend URL (default `http://localhost:3000`). Sign in with the seed admin user (`[email protected]` / `spree123` — override at seed time with `ADMIN_EMAIL` / `ADMIN_PASSWORD`; see `spree/core/app/services/spree/seeds/admin_user.rb`).**When implementing a new admin feature:**diff --git a/docs/developer/dashboard/plugins/publishing.mdx b/docs/developer/dashboard/plugins/publishing.mdxindex eed1b6500d..e386fa7116 100644--- a/docs/developer/dashboard/plugins/publishing.mdx+++ b/docs/developer/dashboard/plugins/publishing.mdx@@ -17,7 +17,7 @@ Your plugin imports React, the dashboard, Tailwind, i18next, etc., but **you don"react-dom": "^19","@spree/dashboard-core": "^0.10.0","@spree/dashboard-ui": "^0.10.0",- "@spree/admin-sdk": "^0.5.0",+ "@spree/admin-sdk": "^0.6.0","i18next": "^26","react-i18next": "^17","@tanstack/react-query": "^5",diff --git a/package.json b/package.jsonindex dc416d5b00..8dc6587c2f 100644--- a/package.json+++ b/package.json@@ -13,7 +13,7 @@"clean": "turbo clean","server:create": "git clone --depth 1 https://github.com/spree/spree-starter.git server && rm -rf server/.git server/.gitignore && printf 'SPREE_PATH=..\\nSECRET_KEY_BASE=%s\\n' \"$(openssl rand -hex 64)\" > server/.env","server:setup": "bash scripts/server-setup.sh",- "server:dashboard": "VITE_BASE_PATH=/dashboard/ pnpm --dir packages/dashboard-starter build",+ "server:dashboard": "turbo build --filter=@spree/dashboard && VITE_BASE_PATH=/dashboard/ pnpm --dir packages/dashboard-starter build","server:dev": "SPREE_PATH=$PWD docker compose -f server/docker-compose.dev.yml -f scripts/docker-compose.edge.yml up --force-recreate web worker","server:build": "bash scripts/server-build.sh","server:restart": "SPREE_PATH=$PWD docker compose -f server/docker-compose.dev.yml -f scripts/docker-compose.edge.yml restart web worker",diff --git a/packages/admin-sdk/.changeset/admin-self-profile-update.md b/packages/admin-sdk/.changeset/admin-self-profile-update.mddeleted file mode 100644index 0c57679395..0000000000--- a/packages/admin-sdk/.changeset/admin-self-profile-update.md+++ /dev/null@@ -1,5 +0,0 @@-----"@spree/admin-sdk": minor------Add self-service profile updates for the authenticated admin. `client.me.update(params)` (`PATCH /me`) lets the signed-in admin change their own `selected_locale` (admin UI display language), `first_name`, and `last_name` without going through the store-scoped staff-management endpoint. The `MeResponse.user` shape now includes `selected_locale`, and a new `MeUpdateParams` type describes the writable fields.diff --git a/packages/admin-sdk/.changeset/admin-translations-management.md b/packages/admin-sdk/.changeset/admin-translations-management.mddeleted file mode 100644index 4019577956..0000000000--- a/packages/admin-sdk/.changeset/admin-translations-management.md+++ /dev/null@@ -1,5 +0,0 @@-----"@spree/admin-sdk": minor------Add translation management for translatable resources. `client.translatableResources.list()` discovers every translatable resource type, its translatable fields, and whether each one exposes a dedicated read route (`readable`); `client.locales.list()` returns the locales a merchant can translate content into for the current store. Per-resource reads are available via `client.products.translations.get(id)` and `client.optionTypes.translations.get(id)`, each returning the full locale × field matrix plus any nested translatable children (e.g. an option type's option values) in one request. All writes go through `client.translations.batch(entries)` — a single atomic endpoint that upserts translations across many records of any registered type, so an option type and all its option values can be translated in one save. New `Locale`, `TranslatableResource`, `TranslatableField`, `ResourceTranslations`, `ResourceTranslationsNode`, and `TranslationBatchEntry` types describe these shapes.diff --git a/packages/admin-sdk/.changeset/csv-imports.md b/packages/admin-sdk/.changeset/csv-imports.mddeleted file mode 100644index b1ab239c46..0000000000--- a/packages/admin-sdk/.changeset/csv-imports.md+++ /dev/null@@ -1,5 +0,0 @@-----"@spree/admin-sdk": minor------Add asynchronous CSV imports. `client.imports.create({ type, attachment })` queues an import from a direct-uploaded CSV (pass the `signed_id` from `client.directUploads.create()`); the response is in the `mapping` state and carries the type's `schema_fields`, the file's `csv_headers`, a `sample_row`, and auto-assigned column `mappings`. Adjust mappings if needed and call `client.imports.completeMapping(id, { mappings })` to start background processing, then poll `client.imports.get(id)` — `rows_count`, `completed_rows_count`, and `failed_rows_count` drive progress until the terminal `completed`/`failed` status. Failed rows (with the raw CSV `data` and per-row `validation_errors`) are listed via `client.imports.rows.list(id, { status_eq: 'failed' })` and can be re-processed with `client.imports.retryFailedRows(id)`. Pass an optional `results_url` on create (validated against the store's allowed origins) and the import-done email links back to your admin's imports view with `?import=<id>` appended. New `Import`, `ImportRow`, `ImportMapping`, `ImportType`, `ImportCreateParams`, and `ImportCompleteMappingParams` types describe these shapes.diff --git a/packages/admin-sdk/.changeset/customer-group-membership.md b/packages/admin-sdk/.changeset/customer-group-membership.mddeleted file mode 100644index 54a8e04c01..0000000000--- a/packages/admin-sdk/.changeset/customer-group-membership.md+++ /dev/null@@ -1,5 +0,0 @@-----"@spree/admin-sdk": minor------Expose customer group membership on the Customer resource. `Customer.customer_group_ids` now always returns the prefixed group IDs a customer belongs to (the full `customer_groups` objects remain available via `expand`), and `CustomerCreateParams`/`CustomerUpdateParams` accept `customer_group_ids` to replace a customer's group membership in a single `PATCH /customers/{id}` — no separate add/remove calls needed.diff --git a/packages/admin-sdk/.changeset/export-results-url.md b/packages/admin-sdk/.changeset/export-results-url.mddeleted file mode 100644index 38e0b1cdf7..0000000000--- a/packages/admin-sdk/.changeset/export-results-url.md+++ /dev/null@@ -1,5 +0,0 @@-----"@spree/admin-sdk": patch------`ExportCreateParams` accepts an optional `results_url` (validated against the store's allowed origins) — the export-done email uses it as its download button target instead of relying on the legacy Rails admin's routes.diff --git a/packages/admin-sdk/.changeset/fulfillment-create-cost-and-carrier-inheritance.md b/packages/admin-sdk/.changeset/fulfillment-create-cost-and-carrier-inheritance.mddeleted file mode 100644index f2f8e1059c..0000000000--- a/packages/admin-sdk/.changeset/fulfillment-create-cost-and-carrier-inheritance.md+++ /dev/null@@ -1,5 +0,0 @@-----"@spree/admin-sdk": minor------`orders.fulfillments.create` now accepts an optional `cost` (explicit shipping cost, e.g. the 3PL price — frozen exactly on `status: 'shipped'` registrations; note it changes the order total and payment state). When `delivery_method_id` is omitted, the new fulfillment now inherits the delivery method and cost of the source fulfillment(s) it fully drains instead of defaulting to the lowest-cost rate.diff --git a/packages/admin-sdk/.changeset/fulfillment-tracking-url-passthrough.md b/packages/admin-sdk/.changeset/fulfillment-tracking-url-passthrough.mddeleted file mode 100644index 152561205c..0000000000--- a/packages/admin-sdk/.changeset/fulfillment-tracking-url-passthrough.md+++ /dev/null@@ -1,5 +0,0 @@-----"@spree/admin-sdk": patch------Fulfillment `tracking` now accepts a full `https://` tracking link — the API serves it back as `tracking_url` unchanged instead of templating it into the delivery method's tracking URL. Useful when an external system (3PL, courier API) provides the complete link.diff --git a/packages/admin-sdk/.changeset/nullable-money-types.md b/packages/admin-sdk/.changeset/nullable-money-types.mddeleted file mode 100644index a9a4e4db78..0000000000--- a/packages/admin-sdk/.changeset/nullable-money-types.md+++ /dev/null@@ -1,5 +0,0 @@-----"@spree/admin-sdk": patch------Regenerated types: fixes `created_at`/`updated_at` on Country, State, and other resources previously typed `unknown` to `string`. Admin money fields remain non-nullable — storefront price gating never applies to the Admin API.diff --git a/packages/admin-sdk/.changeset/order-fulfillment-create.md b/packages/admin-sdk/.changeset/order-fulfillment-create.mddeleted file mode 100644index 7290275af2..0000000000--- a/packages/admin-sdk/.changeset/order-fulfillment-create.md+++ /dev/null@@ -1,5 +0,0 @@-----"@spree/admin-sdk": minor------Add `orders.fulfillments.create` for manually registering fulfillments on completed orders (`POST /orders/:order_id/fulfillments`). Supports external carrier / 3PL sync: pick the stock location, carrier (`delivery_method_id`), tracking number, and line item quantities (`items`, omitted = everything not yet shipped), and pass `status: 'shipped'` to register an already-shipped fulfillment. Adds the `FulfillmentCreateParams` type. `FulfillmentUpdateParams.selected_delivery_rate_id` is now honored by the Admin API (previously the server expected a different field name and ignored it).diff --git a/packages/admin-sdk/.changeset/preorder-fields.md b/packages/admin-sdk/.changeset/preorder-fields.mddeleted file mode 100644index 0142e3a9c3..0000000000--- a/packages/admin-sdk/.changeset/preorder-fields.md+++ /dev/null@@ -1,5 +0,0 @@-----"@spree/admin-sdk": minor------Add pre-order management to the Admin API. `Variant` now exposes the editable `preorderable` flag, `preorder_ships_at` (the "ships by" date), and `backorder_limit` (the universal oversell cap — units sellable beyond available stock as backorders or pre-orders; `null` = unlimited), alongside the computed `preorder` state; `Product` and `LineItem` gain `preorder` + `preorder_ships_at`. `ProductVariantInput`, `VariantCreateParams`, and `VariantUpdateParams` accept `preorderable`, `preorder_ships_at`, and `backorder_limit`, so a variant can be flagged for pre-order and capped in a single write.diff --git a/packages/admin-sdk/.changeset/store-available-locales.md b/packages/admin-sdk/.changeset/store-available-locales.mddeleted file mode 100644index 48cf16870f..0000000000--- a/packages/admin-sdk/.changeset/store-available-locales.md+++ /dev/null@@ -1,5 +0,0 @@-----"@spree/admin-sdk": minor------Expose `Store.available_locales` — the full canonical set of locale codes a merchant may translate content into, independent of the store's currently-configured `supported_locales`. Lets locale pickers offer any supported locale instead of only ones already in use.diff --git a/packages/admin-sdk/.changeset/store-storefront-access-gating.md b/packages/admin-sdk/.changeset/store-storefront-access-gating.mddeleted file mode 100644index 9026bb4bf3..0000000000--- a/packages/admin-sdk/.changeset/store-storefront-access-gating.md+++ /dev/null@@ -1,5 +0,0 @@-----"@spree/admin-sdk": minor------Expose the store-wide gated storefront defaults on the Store resource. `Store.preferred_storefront_access` (`public`, `prices_hidden`, or `login_required`) and `Store.preferred_guest_checkout` are now serialized, and `StoreUpdateParams` accepts both — letting apps read and configure the store-level fallback that channels inherit when they don't set their own posture.diff --git a/packages/admin-sdk/CHANGELOG.md b/packages/admin-sdk/CHANGELOG.mdindex 22e6ad25b2..179792d1fd 100644--- a/packages/admin-sdk/CHANGELOG.md+++ b/packages/admin-sdk/CHANGELOG.md@@ -1,5 +1,37 @@# @spree/admin-sdk+## 0.6.0++This is the Admin API surface the 5.6 React Dashboard consumes — hosts installing `@spree/[email protected]` from the registry need this version; 0.5.0 lacks exports the dashboard imports.++### Minor Changes++- Add asynchronous CSV imports. `client.imports.create({ type, attachment })` queues an import from a direct-uploaded CSV (pass the `signed_id` from `client.directUploads.create()`); the response is in the `mapping` state and carries the type's `schema_fields`, the file's `csv_headers`, a `sample_row`, and auto-assigned column `mappings`. Adjust mappings if needed and call `client.imports.completeMapping(id, { mappings })` to start background processing, then poll `client.imports.get(id)` — `rows_count`, `completed_rows_count`, and `failed_rows_count` drive progress until the terminal `completed`/`failed` status. Failed rows (with the raw CSV `data` and per-row `validation_errors`) are listed via `client.imports.rows.list(id, { status_eq: 'failed' })` and can be re-processed with `client.imports.retryFailedRows(id)`. Pass an optional `results_url` on create (validated against the store's allowed origins) and the import-done email links back to your admin's imports view with `?import=<id>` appended. New `Import`, `ImportRow`, `ImportMapping`, `ImportType`, `ImportCreateParams`, and `ImportCompleteMappingParams` types describe these shapes.++- Add translation management for translatable resources. `client.translatableResources.list()` discovers every translatable resource type, its translatable fields, and whether each one exposes a dedicated read route (`readable`); `client.locales.list()` returns the locales a merchant can translate content into for the current store. Per-resource reads are available via `client.products.translations.get(id)` and `client.optionTypes.translations.get(id)`, each returning the full locale × field matrix plus any nested translatable children (e.g. an option type's option values) in one request. All writes go through `client.translations.batch(entries)` — a single atomic endpoint that upserts translations across many records of any registered type, so an option type and all its option values can be translated in one save. New `Locale`, `TranslatableResource`, `TranslatableField`, `ResourceTranslations`, `ResourceTranslationsNode`, and `TranslationBatchEntry` types describe these shapes.++- Add `orders.fulfillments.create` for manually registering fulfillments on completed orders (`POST /orders/:order_id/fulfillments`). Supports external carrier / 3PL sync: pick the stock location, carrier (`delivery_method_id`), tracking number, and line item quantities (`items`, omitted = everything not yet shipped), and pass `status: 'shipped'` to register an already-shipped fulfillment. Adds the `FulfillmentCreateParams` type. `FulfillmentUpdateParams.selected_delivery_rate_id` is now honored by the Admin API (previously the server expected a different field name and ignored it).++- `orders.fulfillments.create` now accepts an optional `cost` (explicit shipping cost, e.g. the 3PL price — frozen exactly on `status: 'shipped'` registrations; note it changes the order total and payment state). When `delivery_method_id` is omitted, the new fulfillment now inherits the delivery method and cost of the source fulfillment(s) it fully drains instead of defaulting to the lowest-cost rate.++- Add pre-order management to the Admin API. `Variant` now exposes the editable `preorderable` flag, `preorder_ships_at` (the "ships by" date), and `backorder_limit` (the universal oversell cap — units sellable beyond available stock as backorders or pre-orders; `null` = unlimited), alongside the computed `preorder` state; `Product` and `LineItem` gain `preorder` + `preorder_ships_at`. `ProductVariantInput`, `VariantCreateParams`, and `VariantUpdateParams` accept `preorderable`, `preorder_ships_at`, and `backorder_limit`, so a variant can be flagged for pre-order and capped in a single write.++- Expose customer group membership on the Customer resource. `Customer.customer_group_ids` now always returns the prefixed group IDs a customer belongs to (the full `customer_groups` objects remain available via `expand`), and `CustomerCreateParams`/`CustomerUpdateParams` accept `customer_group_ids` to replace a customer's group membership in a single `PATCH /customers/{id}` — no separate add/remove calls needed.++- Add self-service profile updates for the authenticated admin. `client.me.update(params)` (`PATCH /me`) lets the signed-in admin change their own `selected_locale` (admin UI display language), `first_name`, and `last_name` without going through the store-scoped staff-management endpoint. The `MeResponse.user` shape now includes `selected_locale`, and a new `MeUpdateParams` type describes the writable fields.++- Expose `Store.available_locales` — the full canonical set of locale codes a merchant may translate content into, independent of the store's currently-configured `supported_locales`. Lets locale pickers offer any supported locale instead of only ones already in use.++- Expose the store-wide gated storefront defaults on the Store resource. `Store.preferred_storefront_access` (`public`, `prices_hidden`, or `login_required`) and `Store.preferred_guest_checkout` are now serialized, and `StoreUpdateParams` accepts both — letting apps read and configure the store-level fallback that channels inherit when they don't set their own posture.++### Patch Changes++- `ExportCreateParams` accepts an optional `results_url` (validated against the store's allowed origins) — the export-done email uses it as its download button target instead of relying on the legacy Rails admin's routes.++- Fulfillment `tracking` now accepts a full `https://` tracking link — the API serves it back as `tracking_url` unchanged instead of templating it into the delivery method's tracking URL. Useful when an external system (3PL, courier API) provides the complete link.++- Regenerated types: fixes `created_at`/`updated_at` on Country, State, and other resources previously typed `unknown` to `string`. Admin money fields remain non-nullable — storefront price gating never applies to the Admin API.+## 0.5.0### Minor Changesdiff --git a/packages/admin-sdk/package.json b/packages/admin-sdk/package.jsonindex 113f694d68..6b5769c344 100644--- a/packages/admin-sdk/package.json+++ b/packages/admin-sdk/package.json@@ -1,6 +1,6 @@{"name": "@spree/admin-sdk",- "version": "0.5.0",+ "version": "0.6.0","description": "Official TypeScript SDK for Spree Commerce Admin API","type": "module","main": "./dist/index.cjs",diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.mdindex 161ee87d6e..4c0667e98a 100644--- a/packages/cli/CHANGELOG.md+++ b/packages/cli/CHANGELOG.md@@ -1,5 +1,18 @@# @spree/cli+## 2.4.1++### Patch Changes++- Re-embed the dashboard-starter template against `@spree/dashboard` 0.10.1+and `@spree/admin-sdk` ^0.6.0. 0.10.1 ships the Vite integration compiled to+JS — registry installs of 0.10.0 failed the host build with+`ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING` when `vite.config.ts` imported+`@spree/dashboard/vite` — and admin-sdk 0.5.0 lacks the Admin API endpoints+and types the dashboard consumes (the 0.x caret in the previous template pin+never resolves to 0.6.0). The `spree dashboard plugin` scaffold now pins+`@spree/admin-sdk` ^0.6.0 as well.+## 2.4.0### Minor Changesdiff --git a/packages/cli/package.json b/packages/cli/package.jsonindex 9a1cb28370..f9c266ddcc 100644--- a/packages/cli/package.json+++ b/packages/cli/package.json@@ -1,6 +1,6 @@{"name": "@spree/cli",- "version": "2.4.0",+ "version": "2.4.1","description": "CLI for managing Spree Commerce projects","type": "module","bin": {diff --git a/packages/cli/templates/plugin/packages/dashboard/package.json.tt b/packages/cli/templates/plugin/packages/dashboard/package.json.ttindex fc45fbb8af..76b03fdc91 100644--- a/packages/cli/templates/plugin/packages/dashboard/package.json.tt+++ b/packages/cli/templates/plugin/packages/dashboard/package.json.tt@@ -28,7 +28,7 @@}},"peerDependencies": {- "@spree/admin-sdk": "^0.5.0",+ "@spree/admin-sdk": "^0.6.0","@spree/dashboard-core": "^0.10.0","@spree/dashboard-ui": "^0.10.0","@tanstack/react-query": "^5",diff --git a/packages/dashboard-core/package.json b/packages/dashboard-core/package.jsonindex 85e014a110..3c8b2585a5 100644--- a/packages/dashboard-core/package.json+++ b/packages/dashboard-core/package.json@@ -1,8 +1,8 @@{"name": "@spree/dashboard-core","license": "MIT",- "version": "0.10.0",- "description": "Spree Dashboard framework — registries (table, nav, slot, settings-nav), providers (auth, permission, store), admin SDK client, generic infra hooks, and the defineDashboardPlugin extension API. Developer Preview.",+ "version": "0.10.1",+ "description": "Spree Dashboard framework \u2014 registries (table, nav, slot, settings-nav), providers (auth, permission, store), admin SDK client, generic infra hooks, and the defineDashboardPlugin extension API. Developer Preview.","author": "Vendo Connect Inc.","homepage": "https://spreecommerce.org","repository": {@@ -26,8 +26,14 @@"exports": {".": "./src/index.ts","./plugin": "./src/plugin.ts",- "./vite": "./src/vite/index.ts",- "./vite/discover": "./src/vite/discover.ts",+ "./vite": {+ "types": "./src/vite/index.ts",+ "default": "./dist/vite/index.js"+ },+ "./vite/discover": {+ "types": "./src/vite/discover.ts",+ "default": "./dist/vite/discover.js"+ },"./providers/*": "./src/providers/*.tsx","./hooks/*": "./src/hooks/*.ts","./hooks/use-command-palette": "./src/hooks/use-command-palette.tsx",@@ -36,6 +42,7 @@},"files": ["src",+ "dist","README.md","LICENSE"],@@ -44,7 +51,9 @@"lint:fix": "biome check --fix src","format": "biome format --write src","typecheck": "tsc --noEmit",- "test": "vitest run"+ "test": "vitest run",+ "build": "tsup",+ "prepublishOnly": "tsup"},"peerDependencies": {"@hookform/resolvers": "^5.2.2",@@ -77,6 +86,7 @@"@types/react": "^19.2.14","@types/react-dom": "^19.2.3","@types/spark-md5": "^3.0.5",+ "tsup": "^8.5.1","typescript": "~6.0.3","vite": "^8.0.16","vitest": "^4.1.5"diff --git a/packages/dashboard-core/src/vite/index.ts b/packages/dashboard-core/src/vite/index.tsindex 6cd4538be2..617e331d82 100644--- a/packages/dashboard-core/src/vite/index.ts+++ b/packages/dashboard-core/src/vite/index.ts@@ -2,13 +2,12 @@ import fs from 'node:fs'import { createRequire } from 'node:module'import path from 'node:path'import { fileURLToPath } from 'node:url'-// Self-referencing package import (not a relative path): this entry is loaded-// raw by Node when a host's vite.config.ts imports `@spree/dashboard-core/vite`,-// and Node's TS type-stripping can't resolve extensionless relative specifiers.-// The exports-map path resolves to the real file name everywhere.-import { discoverDashboardPlugins } from '@spree/dashboard-core/vite/discover'import tailwindcss from '@tailwindcss/vite'import type { Plugin, PluginOption } from 'vite'+// Explicit .js extension: this entry ships compiled (dist/vite), where the+// specifier must name the real emitted file — tsup transpiles 1:1 without+// rewriting import paths. Bundlers map .js back to the .ts source.+import { discoverDashboardPlugins } from './discover.js'export interface SpreeDashboardPluginOptions {/**diff --git a/packages/dashboard-core/tsup.config.ts b/packages/dashboard-core/tsup.config.tsnew file mode 100644index 0000000000..6e08865abd--- /dev/null+++ b/packages/dashboard-core/tsup.config.ts@@ -0,0 +1,21 @@+import { defineConfig } from 'tsup'++// Compile ONLY the Node-side Vite integration to JS. The rest of the package+// stays source-only (the host's Vite compiles it, and Tailwind scans the+// source) — but these entries are loaded by Node itself when a host's+// vite.config.ts imports them, and Node refuses to type-strip .ts files+// under node_modules (ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING). In the+// monorepo the workspace symlink hides this; registry installs hit it hard.+//+// bundle: false — transpile-only, 1:1 file mapping. Entry files import each+// other via explicit ./name.js specifiers, which stay valid in the emitted+// output.+export default defineConfig({+ entry: ['src/vite/index.ts', 'src/vite/discover.ts'],+ outDir: 'dist/vite',+ format: ['esm'],+ target: 'node20',+ bundle: false,+ splitting: false,+ clean: true,+})diff --git a/packages/dashboard/package.json b/packages/dashboard/package.jsonindex cedd7d5c7f..78f5f990be 100644--- a/packages/dashboard/package.json+++ b/packages/dashboard/package.json@@ -1,8 +1,8 @@{"name": "@spree/dashboard","license": "MIT",- "version": "0.10.0",- "description": "Spree Dashboard app shell — the next-gen React admin for Spree Commerce. Routes, resource hooks, schemas, locales, and the <Dashboard /> component. Source-only package; hosts compile it via @spree/dashboard/vite. Developer Preview.",+ "version": "0.10.1",+ "description": "Spree Dashboard app shell \u2014 the next-gen React admin for Spree Commerce. Routes, resource hooks, schemas, locales, and the <Dashboard /> component. Source-only package; hosts compile it via @spree/dashboard/vite. Developer Preview.","author": "Vendo Connect Inc.","homepage": "https://spreecommerce.org","repository": {@@ -22,18 +22,25 @@"exports": {".": "./src/index.ts","./styles.css": "./src/styles.css",- "./vite": "./src/vite/index.ts",- "./vite/route-collisions": "./src/vite/route-collisions.ts",+ "./vite": {+ "types": "./src/vite/index.ts",+ "default": "./dist/vite-plugin/index.js"+ },+ "./vite/route-collisions": {+ "types": "./src/vite/route-collisions.ts",+ "default": "./dist/vite-plugin/route-collisions.js"+ },"./components/spree/payment-method-editors/types": "./src/components/spree/payment-method-editors/types.ts"},"files": ["src",+ "dist/vite-plugin","README.md","LICENSE"],"scripts": {"dev": "vite",- "build": "tsc -b && vite build",+ "build": "tsc -b && vite build && tsup","lint": "biome check .","lint:fix": "biome check --fix .","format": "biome format --write .",@@ -42,7 +49,8 @@"test:watch": "vitest","test:e2e": "playwright test","test:e2e:ui": "playwright test --ui",- "test:e2e:install": "playwright install chromium"+ "test:e2e:install": "playwright install chromium",+ "prepublishOnly": "tsup"},"dependencies": {"@base-ui/react": "^1.4.1",@@ -97,6 +105,7 @@"@types/spark-md5": "^3.0.5","@vitejs/plugin-react": "^6.0.1","tailwindcss": "^4.2.4",+ "tsup": "^8.5.1","typescript": "~6.0.3","vite": "^8.0.16","vitest": "^4.1.5"diff --git a/packages/dashboard/src/vite/index.ts b/packages/dashboard/src/vite/index.tsindex b0a2811a8a..69d9bcc43a 100644--- a/packages/dashboard/src/vite/index.ts+++ b/packages/dashboard/src/vite/index.ts@@ -15,10 +15,6 @@*/import { createRequire } from 'node:module'import path from 'node:path'-// Self-referencing package import (not a relative path): Node loads this-// module raw when a host's vite.config.ts imports `@spree/dashboard/vite`,-// and TS type-stripping can't resolve extensionless relative specifiers.-import { assertNoRouteCollisions, type RouteSource } from '@spree/dashboard/vite/route-collisions'import {type SpreeDashboardPluginOptions as CoreOptions,spreeDashboardPlugin as spreeDashboardCorePlugin,@@ -27,6 +23,10 @@ import { discoverDashboardPluginManifests } from '@spree/dashboard-core/vite/disimport { TanStackRouterVite } from '@tanstack/router-plugin/vite'import { index, layout, physical, rootRoute, route } from '@tanstack/virtual-file-routes'import type { PluginOption } from 'vite'+// Explicit .js extension: this entry ships compiled (dist/vite-plugin), where+// the specifier must name the real emitted file — tsup transpiles 1:1 without+// rewriting import paths. Bundlers map .js back to the .ts source.+import { assertNoRouteCollisions, type RouteSource } from './route-collisions.js'export interface SpreeDashboardPluginOptions extends CoreOptions {/**diff --git a/packages/dashboard/tsup.config.ts b/packages/dashboard/tsup.config.tsnew file mode 100644index 0000000000..20cc026be0--- /dev/null+++ b/packages/dashboard/tsup.config.ts@@ -0,0 +1,21 @@+import { defineConfig } from 'tsup'++// Compile ONLY the Node-side Vite integration to JS — see the twin config in+// packages/dashboard-core for the full rationale (Node refuses to type-strip+// .ts under node_modules, and vite.config.ts imports resolve through Node).+//+// Output lands inside dist/ (which the app's `vite build` owns) in its own+// subdirectory, and this runs AFTER vite build in the package build script,+// so emptyOutDir can't erase it. bundle: false transpiles 1:1 — entry files+// import each other via explicit ./name.js specifiers, which stay valid in+// the emitted output, and bare imports (dashboard-core, TanStack) resolve+// through node_modules at runtime.+export default defineConfig({+ entry: ['src/vite/index.ts', 'src/vite/route-collisions.ts'],+ outDir: 'dist/vite-plugin',+ format: ['esm'],+ target: 'node20',+ bundle: false,+ splitting: false,+ clean: true,+})diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex a79aee2898..974261ef74 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -304,6 +304,9 @@ importers:tailwindcss:specifier: ^4.2.4version: 4.2.4+ tsup:+ specifier: ^8.5.1+ version: 8.5.1([email protected])([email protected])([email protected])([email protected])([email protected])typescript:specifier: ~6.0.3version: 6.0.3@@ -389,6 +392,9 @@ importers:'@types/spark-md5':specifier: ^3.0.5version: 3.0.5+ tsup:+ specifier: ^8.5.1+ version: 8.5.1([email protected])([email protected])([email protected])([email protected])([email protected])typescript:specifier: ~6.0.3version: 6.0.3