@spree/cli 3.0.1 → 3.1.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 (31) hide show
  1. package/README.md +1 -0
  2. package/dist/index.js +235 -204
  3. package/dist/templates/dashboard-starter/AGENTS.md +71 -0
  4. package/dist/templates/dashboard-starter/README.md +112 -1
  5. package/dist/templates/dashboard-starter/package.json +10 -3
  6. package/dist/templates/dashboard-starter/playwright.config.ts +37 -0
  7. package/dist/templates/dashboard-starter/src/hooks/.gitkeep +0 -0
  8. package/dist/templates/dashboard-starter/src/locales/en.json +3 -0
  9. package/dist/templates/dashboard-starter/src/pages/.gitkeep +0 -0
  10. package/dist/templates/dashboard-starter/src/plugins.ts +16 -6
  11. package/dist/templates/dashboard-starter/src/routeTree.gen.ts +21 -0
  12. package/dist/templates/dashboard-starter/src/schemas/.gitkeep +0 -0
  13. package/dist/templates/dashboard-starter/src/slots/.gitkeep +0 -0
  14. package/dist/templates/dashboard-starter/src/tables/.gitkeep +0 -0
  15. package/dist/templates/dashboard-starter/tsconfig.json +1 -0
  16. package/dist/templates/dashboard-starter/vitest.config.ts +14 -0
  17. package/dist/templates/plugin/README.md.tt +8 -15
  18. package/dist/templates/plugin/packages/dashboard/package.json.tt +7 -3
  19. package/dist/templates/seller-dashboard-starter/AGENTS.md +75 -0
  20. package/dist/templates/seller-dashboard-starter/package.json +10 -3
  21. package/dist/templates/seller-dashboard-starter/playwright.config.ts +37 -0
  22. package/dist/templates/seller-dashboard-starter/src/hooks/.gitkeep +0 -0
  23. package/dist/templates/seller-dashboard-starter/src/locales/en.json +3 -0
  24. package/dist/templates/seller-dashboard-starter/src/pages/.gitkeep +0 -0
  25. package/dist/templates/seller-dashboard-starter/src/plugins.ts +7 -3
  26. package/dist/templates/seller-dashboard-starter/src/schemas/.gitkeep +0 -0
  27. package/dist/templates/seller-dashboard-starter/src/slots/.gitkeep +0 -0
  28. package/dist/templates/seller-dashboard-starter/src/tables/.gitkeep +0 -0
  29. package/dist/templates/seller-dashboard-starter/tsconfig.json +1 -0
  30. package/dist/templates/seller-dashboard-starter/vitest.config.ts +14 -0
  31. package/package.json +2 -2
@@ -0,0 +1,37 @@
1
+ import { defineConfig, devices } from '@playwright/test'
2
+
3
+ // End-to-end tests run against your own stack: `spree dev` for the API, and
4
+ // the dev server Playwright starts below. Point them somewhere else with
5
+ // E2E_BASE_URL — a preview build, or a deployed environment.
6
+ const BASE_URL = process.env.E2E_BASE_URL || 'http://localhost:5174'
7
+
8
+ export default defineConfig({
9
+ testDir: './e2e',
10
+ // One worker: specs share a database, so parallel runs interfere unless
11
+ // every spec creates its own records under a unique name.
12
+ fullyParallel: false,
13
+ workers: 1,
14
+ retries: process.env.CI ? 2 : 0,
15
+ timeout: 30_000,
16
+ expect: { timeout: 10_000 },
17
+ reporter: process.env.CI ? [['github'], ['html', { open: 'never' }]] : 'list',
18
+
19
+ use: {
20
+ baseURL: BASE_URL,
21
+ trace: 'on-first-retry',
22
+ screenshot: 'only-on-failure',
23
+ },
24
+
25
+ projects: [{ name: 'chromium', use: { ...devices['Desktop Chrome'] } }],
26
+
27
+ // Starts the dashboard for the run and reuses one you already have open.
28
+ // The API is expected to be running separately (`spree dev`).
29
+ webServer: process.env.E2E_BASE_URL
30
+ ? undefined
31
+ : {
32
+ command: 'pnpm dev --port 5174 --strictPort',
33
+ url: BASE_URL,
34
+ reuseExistingServer: true,
35
+ timeout: 60_000,
36
+ },
37
+ })
@@ -6,6 +6,11 @@
6
6
  // here, the same API distributed plugins use. Imported once from main.tsx,
7
7
  // before the panel renders.
8
8
  //
9
+ // Keep this file a map of what you added: the registrations live here, the
10
+ // implementations live in pages/, hooks/, tables/ and schemas/ — one file per
11
+ // resource, the same layout the seller panel uses internally. Translations go
12
+ // in locales/ and merge in with `i18n.addResourceBundle`.
13
+ //
9
14
  // Example — add a payouts page and drop the built-in team screen:
10
15
  //
11
16
  // import { defineDashboardPlugin } from '@spree/seller-dashboard'
@@ -23,8 +28,7 @@
23
28
  //
24
29
  // Slots the built-in screens expose: `seller.team.actions`, `seller.team.after`.
25
30
  //
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.
31
+ // `@spree/dashboard-core` and `@spree/dashboard-ui` are already installed —
32
+ // import hooks, providers and UI primitives straight from them.
29
33
 
30
34
  export {}
@@ -8,6 +8,7 @@
8
8
  "types": ["vite/client"],
9
9
  "skipLibCheck": true,
10
10
  "moduleResolution": "bundler",
11
+ "resolveJsonModule": true,
11
12
  "allowImportingTsExtensions": true,
12
13
  "verbatimModuleSyntax": true,
13
14
  "moduleDetection": "force",
@@ -0,0 +1,14 @@
1
+ import { defineConfig } from 'vitest/config'
2
+
3
+ export default defineConfig({
4
+ test: {
5
+ globals: true,
6
+ // Node, not jsdom: what is worth unit-testing here is the logic between
7
+ // your UI and the API — query keys, payload mapping, permission
8
+ // predicates. Rendering a component to assert its markup tests React.
9
+ // Reach for a browser through Playwright instead (`pnpm test:e2e`).
10
+ environment: 'node',
11
+ include: ['src/**/*.{test,spec}.{ts,tsx}'],
12
+ exclude: ['node_modules/**', 'e2e/**', 'dist/**'],
13
+ },
14
+ })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spree/cli",
3
- "version": "3.0.1",
3
+ "version": "3.1.0",
4
4
  "description": "CLI for managing Spree Commerce projects",
5
5
  "type": "module",
6
6
  "bin": {
@@ -45,7 +45,7 @@
45
45
  "typescript": "^6.0.3",
46
46
  "vitest": "^4.1.5",
47
47
  "yaml": "^2.8.4",
48
- "@spree/admin-sdk": "^1.0.0-beta.1"
48
+ "@spree/admin-sdk": "^1.0.0-beta.3"
49
49
  },
50
50
  "engines": {
51
51
  "node": ">=20"