@designfever/web-review-kit 0.7.3 → 0.8.1

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.
@@ -0,0 +1,23 @@
1
+ # 릴리즈 노트: 0.8.1
2
+
3
+ 0.8.0 이후 QA workflow 사용성을 다듬은 patch release. Copy Prompt 커스텀 지시문, status filter preset, count/tooltip/long comment/outside marker 표시 개선을 담았다.
4
+
5
+ 비교 기준: `0.8.0`
6
+ 검토 기준: `main`
7
+
8
+ ## 주요 변경
9
+
10
+ - `mountReviewShell({ qaPrompt })`를 추가해 QA item Copy Prompt 앞에 프로젝트별 지시문을 붙일 수 있게 했다.
11
+ - QA status filter에 done을 제외한 active 상태(`todo`, `doing`, `review`, `hold`)를 한 번에 켜는 preset 버튼을 추가했다.
12
+ - 해상도별 QA count에서 `done` item을 제외해 남은 작업량 기준으로 표시한다.
13
+ - Figma image layer state button tooltip을 왼쪽으로 표시해 panel 내부 스크롤이 생기지 않게 했다.
14
+ - QA list item의 긴 comment는 기본 상태에서 max-height와 내부 스크롤을 적용하고, More/Less 버튼으로 펼치거나 접을 수 있게 했다.
15
+ - Outside QA marker가 세로로 몰릴 때 marker 간격을 자동 보정하고, connector는 원래 anchor 위치를 가리키게 했다.
16
+
17
+ ## 검증
18
+
19
+ - `pnpm typecheck`
20
+ - `pnpm test`
21
+ - `pnpm build`
22
+ - `pnpm typecheck:dev`
23
+ - `pnpm build:dev`
@@ -0,0 +1,68 @@
1
+ # Testing
2
+
3
+ `df-web-review-kit` uses Vitest (jsdom environment) for package-level unit and adapter contract tests.
4
+
5
+ ## Commands
6
+
7
+ ```bash
8
+ pnpm test
9
+ pnpm test:watch
10
+ ```
11
+
12
+ Use the full package check before release or when touching public types:
13
+
14
+ ```bash
15
+ pnpm typecheck
16
+ pnpm test
17
+ pnpm build
18
+ pnpm typecheck:dev
19
+ pnpm build:dev
20
+ ```
21
+
22
+ ## Current Coverage
23
+
24
+ ### Adapter contract suite
25
+
26
+ `src/adapters/adapter.contract.test.ts` verifies that the built-in local and Supabase adapters:
27
+
28
+ - support `create`, `list`, `get`, `update`, and `remove`
29
+ - filter by project, route, and status
30
+ - preserve attachments, external links, assignee, and status metadata
31
+ - only return `dom` and `area` review item kinds
32
+ - filter legacy point-note rows instead of showing them in the QA list
33
+
34
+ The Supabase coverage uses an in-memory PostgREST/RPC mock. It does not contact a real Supabase project.
35
+
36
+ ### Pure function unit suites
37
+
38
+ Colocated `*.test.ts` files cover the core pure-function modules that refactors depend on:
39
+
40
+ - `src/core/geometry.test.ts`: coordinate conversion (host/target spaces), clamping, selection shapes, popover placement.
41
+ - `src/core/hotkey.test.ts`: hotkey matching with modifiers, Korean IME key aliases, physical key-code fallback.
42
+ - `src/core/location.test.ts`: page URL building and review-internal query param stripping.
43
+ - `src/core/review/scope.test.ts`: viewport preset matching, scope inference, and item numbering/draft labels.
44
+ - `src/route.test.ts`: route path normalization (`index.html`, query/hash) and item route keys.
45
+ - `src/figma/parse.test.ts`: Figma URL/node-ref parsing, including non-figma host rejection.
46
+ - `src/vite/figma-asset.test.ts`: asset storage key validation, including path traversal rejection, and mime/format helpers.
47
+ - `src/vite/figma-image-store.server.test.ts`: dev middleware request guards — cross-origin (CSRF) rejection, JSON content-type enforcement, body size limit.
48
+ - `src/vite/figma-image-store.image.test.ts`: image store mutation lock ordering, lost-update prevention, and atomic data-file writes.
49
+ - `src/react-shell/source.open.test.ts`: repeated same-source element indexing (`#i/n`) and the per-call document scan cache.
50
+
51
+ Security-relevant behavior (figma.com host allowlist, asset path traversal guard) is pinned by these tests; keep them green when touching `src/figma/parse.ts` or `src/vite/figma-asset.ts`.
52
+
53
+ ## When to Add Tests
54
+
55
+ Add or extend Vitest coverage when changing:
56
+
57
+ - `ReviewItem` shape or adapter normalization
58
+ - localStorage migration behavior
59
+ - Supabase row mapping, RPC payloads, or review URL generation
60
+ - attachment upload contracts
61
+ - status, assignee, or external link fields
62
+ - coordinate/scope/route/parsing helpers listed above (extend the colocated suite)
63
+
64
+ ## Known Behavior Notes
65
+
66
+ - `getReviewItemScope` (`src/core/review/scope.ts`) intentionally never returns `dom`: a legacy `dom`/`element` scope falls back to viewport-based grouping so those items keep showing markers (marker visibility requires `scope === currentScope`, and the current scope is always a viewport scope). Current code never persists a `dom` scope, so this path only applies to legacy data. `scope.test.ts` pins this behavior.
67
+
68
+ Use Playwright only for browser-visible shell flows, screenshots, or iframe interaction. Adapter regressions should stay in Vitest because they are faster and easier to run in package CI.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@designfever/web-review-kit",
3
- "version": "0.7.3",
3
+ "version": "0.8.1",
4
4
  "type": "module",
5
5
  "description": "Designfever web page review overlay toolkit.",
6
6
  "license": "Apache-2.0",
@@ -45,19 +45,25 @@
45
45
  ".env.sample"
46
46
  ],
47
47
  "scripts": {
48
- "build": "tsup src/index.ts src/react-shell.tsx src/vite.ts --format esm,cjs --dts --sourcemap --clean --external react --external react-dom --external react/jsx-runtime",
49
- "dev": "tsup src/index.ts src/react-shell.tsx src/vite.ts --format esm,cjs --dts --sourcemap --watch --external react --external react-dom --external react/jsx-runtime",
48
+ "build": "tsup src/index.ts src/react-shell.tsx src/vite.ts --format esm,cjs --dts --sourcemap --clean --external react --external react-dom --external react/jsx-runtime --external zustand",
49
+ "dev": "tsup src/index.ts src/react-shell.tsx src/vite.ts --format esm,cjs --dts --sourcemap --watch --external react --external react-dom --external react/jsx-runtime --external zustand",
50
50
  "dev:review": "vite --config dev/vite.config.ts",
51
51
  "build:dev": "vite build --config dev/vite.config.ts",
52
52
  "lint:dead-code": "knip",
53
53
  "prepare": "pnpm build",
54
+ "test": "vitest run",
55
+ "test:watch": "vitest",
54
56
  "typecheck": "tsc --noEmit",
55
57
  "typecheck:dev": "tsc --noEmit -p tsconfig.dev.json"
56
58
  },
59
+ "dependencies": {
60
+ "html2canvas": "^1.4.1"
61
+ },
57
62
  "peerDependencies": {
58
63
  "react": ">=18",
59
64
  "react-dom": ">=18",
60
- "vite": ">=5"
65
+ "vite": ">=5",
66
+ "zustand": ">=5"
61
67
  },
62
68
  "peerDependenciesMeta": {
63
69
  "vite": {
@@ -69,13 +75,16 @@
69
75
  "@types/node": "^26.0.1",
70
76
  "@types/react": "^19.2.17",
71
77
  "@types/react-dom": "^19.2.3",
78
+ "jsdom": "^29.1.1",
72
79
  "knip": "^6.20.0",
73
80
  "lucide-react": "^1.20.0",
74
81
  "react": "^19.2.7",
75
82
  "react-dom": "^19.2.7",
76
83
  "tsup": "^8.3.6",
77
84
  "typescript": "^6.0.2",
78
- "vite": "^8.0.8"
85
+ "vite": "^8.0.8",
86
+ "vitest": "^4.1.9",
87
+ "zustand": "^5.0.14"
79
88
  },
80
89
  "packageManager": "pnpm@9.0.0"
81
90
  }