@spree/cli 2.4.9 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/dist/index.js +742 -222
  2. package/dist/templates/dashboard-starter/README.md +1 -1
  3. package/dist/templates/dashboard-starter/index.html +3 -0
  4. package/dist/templates/dashboard-starter/package.json +2 -2
  5. package/dist/templates/dashboard-starter/public/android-chrome-192x192.png +0 -0
  6. package/dist/templates/dashboard-starter/public/android-chrome-512x512.png +0 -0
  7. package/dist/templates/dashboard-starter/public/apple-touch-icon.png +0 -0
  8. package/dist/templates/dashboard-starter/public/favicon-16x16.png +0 -0
  9. package/dist/templates/dashboard-starter/public/favicon-32x32.png +0 -0
  10. package/dist/templates/dashboard-starter/public/favicon.ico +0 -0
  11. package/dist/templates/dashboard-starter/public/favicon.svg +9 -0
  12. package/dist/templates/dashboard-starter/src/routeTree.gen.ts +1054 -51
  13. package/dist/templates/dashboard-starter/vite.config.ts +11 -2
  14. package/dist/templates/seller-dashboard-starter/.env.example +7 -0
  15. package/dist/templates/seller-dashboard-starter/biome.json +60 -0
  16. package/dist/templates/seller-dashboard-starter/gitignore.template +3 -0
  17. package/dist/templates/seller-dashboard-starter/index.html +27 -0
  18. package/dist/templates/seller-dashboard-starter/package.json +32 -0
  19. package/dist/templates/seller-dashboard-starter/pnpm-workspace.yaml +11 -0
  20. package/dist/templates/seller-dashboard-starter/src/main.tsx +29 -0
  21. package/dist/templates/seller-dashboard-starter/src/plugins.ts +30 -0
  22. package/dist/templates/seller-dashboard-starter/src/routeTree.gen.ts +590 -0
  23. package/dist/templates/seller-dashboard-starter/src/styles.css +8 -0
  24. package/dist/templates/seller-dashboard-starter/tsconfig.json +21 -0
  25. package/dist/templates/seller-dashboard-starter/vite.config.ts +27 -0
  26. package/package.json +3 -3
@@ -27,9 +27,18 @@ export default defineConfig(({ mode }) => {
27
27
  // target, not VITE_SPREE_API_URL — that switches the SDK to absolute
28
28
  // cross-origin URLs and bypasses this proxy (see .env.example).
29
29
  server: {
30
+ // Reachable from a phone on the same network (`vite --host`) or through
31
+ // a tunnel: Vite otherwise rejects any request whose Host header it does
32
+ // not recognise. Dev server only — this file is not used for builds.
33
+ allowedHosts: ['.localhost', '.trycloudflare.com', '.ngrok-free.app'],
30
34
  proxy: {
31
- '/api': { target: proxyTarget, changeOrigin: true },
32
- '/rails': { target: proxyTarget, changeOrigin: true },
35
+ // `secure: false`: the worktree's Rails URL is served by portless
36
+ // behind a self-signed certificate, which Node refuses by default —
37
+ // the proxy fails with "self-signed certificate in certificate
38
+ // chain". Scoped to these two dev-only proxy routes rather than
39
+ // disabling TLS verification for the whole process.
40
+ '/api': { target: proxyTarget, changeOrigin: true, secure: false },
41
+ '/rails': { target: proxyTarget, changeOrigin: true, secure: false },
33
42
  },
34
43
  },
35
44
  }
@@ -0,0 +1,7 @@
1
+ # The Rails server the dev proxy forwards /api to. The panel stays same-origin
2
+ # with the API in dev, which is what lets the seller refresh cookie ride under
3
+ # SameSite=Lax without HTTPS.
4
+ #
5
+ # Do NOT set VITE_SPREE_API_URL here — it switches the SDK to absolute
6
+ # cross-origin URLs and bypasses this proxy.
7
+ VITE_API_PROXY_TARGET=http://localhost:3000
@@ -0,0 +1,60 @@
1
+ {
2
+ "$schema": "https://biomejs.dev/schemas/2.4.13/schema.json",
3
+ "vcs": {
4
+ "enabled": true,
5
+ "clientKind": "git",
6
+ "useIgnoreFile": true
7
+ },
8
+ "linter": {
9
+ "enabled": true,
10
+ "rules": {
11
+ "recommended": true,
12
+ "correctness": {
13
+ "noUnusedImports": "warn",
14
+ "noUnusedVariables": "warn"
15
+ },
16
+ "suspicious": {
17
+ "noExplicitAny": "off"
18
+ },
19
+ "style": {
20
+ "noNonNullAssertion": "off"
21
+ }
22
+ }
23
+ },
24
+ "formatter": {
25
+ "enabled": true,
26
+ "indentStyle": "space",
27
+ "indentWidth": 2,
28
+ "lineWidth": 100
29
+ },
30
+ "javascript": {
31
+ "formatter": {
32
+ "quoteStyle": "single",
33
+ "semicolons": "asNeeded"
34
+ }
35
+ },
36
+ "css": {
37
+ "linter": {
38
+ "enabled": false
39
+ },
40
+ "formatter": {
41
+ "enabled": false
42
+ }
43
+ },
44
+ "assist": {
45
+ "actions": {
46
+ "source": {
47
+ "organizeImports": "on"
48
+ }
49
+ }
50
+ },
51
+ "files": {
52
+ "includes": [
53
+ "src/**",
54
+ "*.ts",
55
+ "index.html",
56
+ "!src/routeTree.gen.ts",
57
+ "!src/**/*.css"
58
+ ]
59
+ }
60
+ }
@@ -0,0 +1,3 @@
1
+ dist
2
+ node_modules
3
+ .env.local
@@ -0,0 +1,27 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>Spree Seller Panel</title>
7
+ </head>
8
+ <body>
9
+ <script>
10
+ (() => {
11
+ try {
12
+ const stored = localStorage.getItem('spree-admin-theme');
13
+ const mode = stored === 'light' || stored === 'dark' ? stored : 'system';
14
+ const dark =
15
+ mode === 'dark' ||
16
+ (mode === 'system' && window.matchMedia('(prefers-color-scheme: dark)').matches);
17
+ if (dark) document.documentElement.classList.add('dark');
18
+ document.documentElement.style.colorScheme = dark ? 'dark' : 'light';
19
+ } catch (_) {
20
+ /* localStorage unavailable */
21
+ }
22
+ })();
23
+ </script>
24
+ <div id="root"></div>
25
+ <script type="module" src="/src/main.tsx"></script>
26
+ </body>
27
+ </html>
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "@spree/seller-dashboard-starter",
3
+ "private": true,
4
+ "license": "MIT",
5
+ "version": "0.0.0",
6
+ "type": "module",
7
+ "scripts": {
8
+ "dev": "vite",
9
+ "build": "vite build",
10
+ "preview": "vite preview",
11
+ "typecheck": "tsc --noEmit",
12
+ "lint": "biome check .",
13
+ "lint:fix": "biome check --fix ."
14
+ },
15
+ "dependencies": {
16
+ "@spree/seller-dashboard": "^1.0.0-beta.1",
17
+ "@spree/seller-sdk": "^1.0.0-beta.1",
18
+ "@tanstack/react-query": "^5.100.9",
19
+ "@tanstack/react-router": "^1.169.2",
20
+ "react": "^19.2.6",
21
+ "react-dom": "^19.2.6"
22
+ },
23
+ "devDependencies": {
24
+ "@biomejs/biome": "^2.4.14",
25
+ "@types/react": "^19.2.14",
26
+ "@types/react-dom": "^19.2.3",
27
+ "@vitejs/plugin-react": "^6.0.1",
28
+ "typescript": "~6.0.3",
29
+ "vite": "^8.0.16"
30
+ },
31
+ "packageManager": "pnpm@11.13.1"
32
+ }
@@ -0,0 +1,11 @@
1
+ packages:
2
+ - '.'
3
+ # Image rebuilds re-install the committed lockfile verbatim — without this,
4
+ # pnpm 11's supply-chain re-validation (minimumReleaseAge) fails any build
5
+ # whose lockfile references <24h-old packages you intentionally installed.
6
+ # Fresh resolution on your machine still honors the age gate.
7
+ trustLockfile: true
8
+ # Spree's own releases shouldn't wait out the age gate — an upgrade right
9
+ # after a Spree release would otherwise fail for a day.
10
+ minimumReleaseAgeExclude:
11
+ - '@spree/*'
@@ -0,0 +1,29 @@
1
+ import { createSellerApiClient, createSellerRouter, SellerDashboard } from '@spree/seller-dashboard'
2
+ import { createRoot } from 'react-dom/client'
3
+ import './styles.css'
4
+ // Generated by @spree/seller-dashboard/vite on every dev start and build.
5
+ // Commit it — its diff on upgrades shows exactly which pages changed.
6
+ // Activate installed seller-panel plugins — synthesized by the Vite plugin
7
+ // from your package.json deps. `pnpm add <plugin>` + dev-server restart is
8
+ // the whole install; this line never changes.
9
+ import 'virtual:spree-dashboard-plugins'
10
+ // Your own customisations (nav entries, slot widgets, table columns).
11
+ import './plugins'
12
+ import { routeTree } from './routeTree.gen'
13
+
14
+ // Build the Seller API client and register it with the shared framework
15
+ // before anything renders: the providers read it on mount.
16
+ createSellerApiClient({ baseUrl: import.meta.env.VITE_SPREE_API_URL || '' })
17
+
18
+ // basepath mirrors Vite's `base` so sub-path mounts route correctly.
19
+ const router = createSellerRouter(routeTree, { basepath: import.meta.env.BASE_URL })
20
+
21
+ // Registers the router program-wide so <Link> and navigation are type-checked
22
+ // against the real route tree.
23
+ declare module '@tanstack/react-router' {
24
+ interface Register {
25
+ router: typeof router
26
+ }
27
+ }
28
+
29
+ createRoot(document.getElementById('root')!).render(<SellerDashboard router={router} />)
@@ -0,0 +1,30 @@
1
+ // Seller panel customisations for this marketplace.
2
+ //
3
+ // The seller panel is the part of a marketplace most often shaped to fit —
4
+ // but shaping it should mean adding and removing, not rewriting. Register
5
+ // nav entries, slot widgets and table columns against the shared registries
6
+ // here, the same API distributed plugins use. Imported once from main.tsx,
7
+ // before the panel renders.
8
+ //
9
+ // Example — add a payouts page and drop the built-in team screen:
10
+ //
11
+ // import { defineDashboardPlugin } from '@spree/seller-dashboard'
12
+ // import { PayoutsPage } from './pages/payouts'
13
+ //
14
+ // defineDashboardPlugin({
15
+ // nav: {
16
+ // add: [{ key: 'payouts', label: 'Payouts', path: '/payouts', position: 300 }],
17
+ // remove: ['team'],
18
+ // },
19
+ // slots: {
20
+ // 'seller.team.after': [{ id: 'audit', component: TeamAuditCard }],
21
+ // },
22
+ // })
23
+ //
24
+ // Slots the built-in screens expose: `seller.team.actions`, `seller.team.after`.
25
+ //
26
+ // Building custom pages? Add the framework and design-system packages first —
27
+ // `pnpm add @spree/dashboard-core @spree/dashboard-ui` — then import hooks,
28
+ // providers, and UI primitives from those.
29
+
30
+ export {}