sunpeak 0.18.14 → 0.19.2

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 (53) hide show
  1. package/README.md +37 -134
  2. package/bin/commands/new.mjs +3 -1
  3. package/bin/commands/test-init.mjs +305 -0
  4. package/bin/commands/test.mjs +144 -0
  5. package/bin/lib/inspect/inspect-config.d.mts +4 -0
  6. package/bin/lib/inspect/inspect-config.mjs +18 -24
  7. package/bin/lib/test/base-config.mjs +75 -0
  8. package/bin/lib/test/matchers.mjs +99 -0
  9. package/bin/lib/test/test-config.d.mts +66 -0
  10. package/bin/lib/test/test-config.mjs +125 -0
  11. package/bin/lib/test/test-fixtures.d.mts +129 -0
  12. package/bin/lib/test/test-fixtures.mjs +232 -0
  13. package/bin/sunpeak.js +18 -5
  14. package/package.json +22 -10
  15. package/template/README.md +18 -8
  16. package/template/dist/albums/albums.json +1 -1
  17. package/template/dist/carousel/carousel.json +1 -1
  18. package/template/dist/map/map.html +468 -280
  19. package/template/dist/map/map.json +1 -1
  20. package/template/dist/review/review.json +1 -1
  21. package/template/node_modules/.bin/playwright +2 -2
  22. package/template/node_modules/.bin/vite +2 -2
  23. package/template/node_modules/.bin/vitest +2 -2
  24. package/template/node_modules/.vite/deps/_metadata.json +4 -4
  25. package/template/node_modules/.vite-mcp/deps/_metadata.json +22 -22
  26. package/template/node_modules/.vite-mcp/deps/mapbox-gl.js +15924 -14588
  27. package/template/node_modules/.vite-mcp/deps/mapbox-gl.js.map +1 -1
  28. package/template/node_modules/.vite-mcp/deps/vitest.js +8 -8
  29. package/template/node_modules/.vite-mcp/deps/vitest.js.map +1 -1
  30. package/template/package.json +9 -7
  31. package/template/playwright.config.ts +2 -40
  32. package/template/test-results/.last-run.json +4 -0
  33. package/template/tests/e2e/albums.spec.ts +114 -245
  34. package/template/tests/e2e/carousel.spec.ts +189 -313
  35. package/template/tests/e2e/map.spec.ts +177 -300
  36. package/template/tests/e2e/review.spec.ts +232 -423
  37. package/template/tests/e2e/visual.spec.ts +36 -0
  38. package/template/tests/e2e/visual.spec.ts-snapshots/albums-dark-chatgpt-linux.png +0 -0
  39. package/template/tests/e2e/visual.spec.ts-snapshots/albums-dark-claude-linux.png +0 -0
  40. package/template/tests/e2e/visual.spec.ts-snapshots/albums-fullscreen-chatgpt-linux.png +0 -0
  41. package/template/tests/e2e/visual.spec.ts-snapshots/albums-fullscreen-claude-linux.png +0 -0
  42. package/template/tests/e2e/visual.spec.ts-snapshots/albums-light-chatgpt-linux.png +0 -0
  43. package/template/tests/e2e/visual.spec.ts-snapshots/albums-light-claude-linux.png +0 -0
  44. package/template/tests/e2e/visual.spec.ts-snapshots/albums-page-light-chatgpt-linux.png +0 -0
  45. package/template/tests/e2e/visual.spec.ts-snapshots/albums-page-light-claude-linux.png +0 -0
  46. package/template/tests/live/albums.spec.ts +1 -1
  47. package/template/tests/live/carousel.spec.ts +1 -1
  48. package/template/tests/live/map.spec.ts +1 -1
  49. package/template/tests/live/playwright.config.ts +1 -1
  50. package/template/tests/live/review.spec.ts +1 -1
  51. package/template/vitest.config.ts +1 -1
  52. package/template/tests/e2e/global-setup.ts +0 -10
  53. package/template/tests/e2e/helpers.ts +0 -13
@@ -0,0 +1,36 @@
1
+ import { test, expect } from 'sunpeak/test';
2
+
3
+ // Visual regression tests. Screenshot comparisons only run with `sunpeak test --visual`.
4
+ // Update baselines with `sunpeak test --visual --update`.
5
+
6
+ test('albums renders correctly in light mode', async ({ mcp }) => {
7
+ const result = await mcp.callTool('show-albums', {}, { theme: 'light' });
8
+ const app = result.app();
9
+ await expect(app.locator('button:has-text("Summer Slice")')).toBeVisible();
10
+
11
+ await mcp.screenshot('albums-light');
12
+ });
13
+
14
+ test('albums renders correctly in dark mode', async ({ mcp }) => {
15
+ const result = await mcp.callTool('show-albums', {}, { theme: 'dark' });
16
+ const app = result.app();
17
+ await expect(app.locator('button:has-text("Summer Slice")')).toBeVisible();
18
+
19
+ await mcp.screenshot('albums-dark');
20
+ });
21
+
22
+ test('albums renders correctly in fullscreen', async ({ mcp }) => {
23
+ const result = await mcp.callTool('show-albums', {}, { displayMode: 'fullscreen' });
24
+ const app = result.app();
25
+ await expect(app.locator('button:has-text("Summer Slice")')).toBeVisible();
26
+
27
+ await mcp.screenshot('albums-fullscreen');
28
+ });
29
+
30
+ test('full page renders correctly', async ({ mcp }) => {
31
+ const result = await mcp.callTool('show-albums', {}, { theme: 'light' });
32
+ const app = result.app();
33
+ await expect(app.locator('button:has-text("Summer Slice")')).toBeVisible();
34
+
35
+ await mcp.screenshot('albums-page-light', { target: 'page', maxDiffPixelRatio: 0.02 });
36
+ });
@@ -1,4 +1,4 @@
1
- import { test, expect } from 'sunpeak/test';
1
+ import { test, expect } from 'sunpeak/test/live';
2
2
 
3
3
  test('albums tool renders photo grid with correct styles', async ({ live }) => {
4
4
  const app = await live.invoke('show-albums');
@@ -1,4 +1,4 @@
1
- import { test, expect } from 'sunpeak/test';
1
+ import { test, expect } from 'sunpeak/test/live';
2
2
 
3
3
  test('carousel tool renders cards with correct styles', async ({ live }) => {
4
4
  const app = await live.invoke('show-carousel');
@@ -1,4 +1,4 @@
1
- import { test, expect } from 'sunpeak/test';
1
+ import { test, expect } from 'sunpeak/test/live';
2
2
 
3
3
  test('map tool renders interactive map with correct styles', async ({ live }) => {
4
4
  const app = await live.invoke('show-map');
@@ -1,3 +1,3 @@
1
- import { defineLiveConfig } from 'sunpeak/test/config';
1
+ import { defineLiveConfig } from 'sunpeak/test/live/config';
2
2
 
3
3
  export default defineLiveConfig({ devOverlay: false });
@@ -1,4 +1,4 @@
1
- import { test, expect } from 'sunpeak/test';
1
+ import { test, expect } from 'sunpeak/test/live';
2
2
 
3
3
  test('review tool renders review card with correct styles', async ({ live }) => {
4
4
  const app = await live.invoke('review-diff');
@@ -8,7 +8,7 @@ const parentSrc = path.resolve(__dirname, '../src');
8
8
  export default defineConfig({
9
9
  test: {
10
10
  globals: true,
11
- environment: 'jsdom',
11
+ environment: 'happy-dom',
12
12
  setupFiles: './tests/setup.ts',
13
13
  exclude: ['**/node_modules/**', '**/tests/e2e/**', '**/tests/live/**'],
14
14
  },
@@ -1,10 +0,0 @@
1
- /**
2
- * Playwright global setup.
3
- *
4
- * The webServer (pnpm dev) handles building resources via its build watcher.
5
- * No separate build step needed here — the dev server's initial build creates
6
- * dist/ files before serving the first request.
7
- */
8
- export default function globalSetup() {
9
- // Nothing to do — the webServer handles everything.
10
- }
@@ -1,13 +0,0 @@
1
- import {
2
- createInspectorUrl as _createInspectorUrl,
3
- type InspectorUrlParams,
4
- } from 'sunpeak/chatgpt';
5
-
6
- /**
7
- * Wrapper around createInspectorUrl that hides the dev overlay by default.
8
- * The overlay shows resource timestamps and tool timing, which can interfere
9
- * with element assertions in e2e tests.
10
- */
11
- export function createInspectorUrl(params: InspectorUrlParams, basePath?: string): string {
12
- return _createInspectorUrl({ devOverlay: false, ...params }, basePath);
13
- }