@artymclabin/qa-review 0.3.7
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.
- package/CHANGELOG.md +174 -0
- package/LICENSE +21 -0
- package/README.md +177 -0
- package/dist/client/QAReviewOverlay.d.ts +59 -0
- package/dist/client/QAReviewOverlay.js +858 -0
- package/dist/client/device.d.ts +28 -0
- package/dist/client/device.js +57 -0
- package/dist/client/fingerprint.d.ts +19 -0
- package/dist/client/fingerprint.js +40 -0
- package/dist/client/highlight.d.ts +17 -0
- package/dist/client/highlight.js +77 -0
- package/dist/client/index.d.ts +12 -0
- package/dist/client/index.js +11 -0
- package/dist/client/journey.d.ts +89 -0
- package/dist/client/journey.js +134 -0
- package/dist/client/preview.d.ts +30 -0
- package/dist/client/preview.js +116 -0
- package/dist/client/revisit.d.ts +28 -0
- package/dist/client/revisit.js +27 -0
- package/dist/client/store.d.ts +100 -0
- package/dist/client/store.js +234 -0
- package/dist/client/styles.d.ts +3 -0
- package/dist/client/styles.js +211 -0
- package/dist/client/types.d.ts +87 -0
- package/dist/client/types.js +7 -0
- package/dist/server/handlers.d.ts +31 -0
- package/dist/server/handlers.js +186 -0
- package/dist/server/index.d.ts +3 -0
- package/dist/server/index.js +3 -0
- package/dist/server/storage.d.ts +78 -0
- package/dist/server/storage.js +245 -0
- package/dist/shared/codename.d.ts +16 -0
- package/dist/shared/codename.js +55 -0
- package/package.json +61 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// Semantic codenames: a deterministic two-word "adjective-noun" reference for
|
|
2
|
+
// every (target, itemId) pair, so humans and agents can talk about an item
|
|
3
|
+
// ("I'm QA-ing red-apple") without quoting selectors or ids. Pure + shared by
|
|
4
|
+
// the client (card display / copy-ref) and the server (state GET responses).
|
|
5
|
+
/** 64 adjectives x 64 nouns = 4096 codenames (collisions possible; the
|
|
6
|
+
* resolver returns ALL matches so callers can disambiguate). */
|
|
7
|
+
const ADJECTIVES = [
|
|
8
|
+
"amber", "bold", "brave", "brisk", "calm", "candid", "clear", "cobalt",
|
|
9
|
+
"coral", "cosmic", "crimson", "crisp", "daring", "deep", "dusty", "eager",
|
|
10
|
+
"early", "easy", "fabled", "fancy", "fleet", "frosty", "gentle", "gilded",
|
|
11
|
+
"glad", "golden", "grand", "green", "happy", "hardy", "hazel", "humble",
|
|
12
|
+
"icy", "ivory", "jade", "jolly", "keen", "kind", "large", "lively",
|
|
13
|
+
"lucky", "lunar", "mellow", "merry", "mighty", "misty", "noble", "olive",
|
|
14
|
+
"opal", "pale", "plucky", "proud", "quick", "quiet", "rapid", "red",
|
|
15
|
+
"royal", "ruby", "rustic", "silent", "silver", "snowy", "solar", "swift",
|
|
16
|
+
];
|
|
17
|
+
const NOUNS = [
|
|
18
|
+
"acorn", "anchor", "apple", "arrow", "badger", "banjo", "beacon", "bear",
|
|
19
|
+
"birch", "bison", "breeze", "brook", "candle", "canyon", "castle", "cloud",
|
|
20
|
+
"comet", "compass", "crane", "creek", "crow", "delta", "dune", "eagle",
|
|
21
|
+
"falcon", "fern", "finch", "fjord", "flint", "forest", "fox", "garnet",
|
|
22
|
+
"glacier", "grove", "harbor", "hawk", "heron", "hill", "iris", "island",
|
|
23
|
+
"jasper", "kite", "lagoon", "lantern", "larch", "lark", "lily", "lynx",
|
|
24
|
+
"maple", "meadow", "meteor", "moon", "moss", "oak", "orbit", "otter",
|
|
25
|
+
"owl", "pebble", "pine", "planet", "prairie", "quartz", "raven", "river",
|
|
26
|
+
];
|
|
27
|
+
/** FNV-1a 32-bit (deterministic across platforms/sessions). */
|
|
28
|
+
export function fnv1a(str) {
|
|
29
|
+
let h = 0x811c9dc5;
|
|
30
|
+
for (let i = 0; i < str.length; i++) {
|
|
31
|
+
h ^= str.charCodeAt(i);
|
|
32
|
+
h = Math.imul(h, 0x01000193) >>> 0;
|
|
33
|
+
}
|
|
34
|
+
return h >>> 0;
|
|
35
|
+
}
|
|
36
|
+
/** Stable two-word codename for a (target, itemId) pair, e.g. "red-apple". */
|
|
37
|
+
export function codenameFor(target, itemId) {
|
|
38
|
+
const h = fnv1a(`${target}#${itemId}`);
|
|
39
|
+
const adj = ADJECTIVES[(h >>> 6) % ADJECTIVES.length];
|
|
40
|
+
const noun = NOUNS[h % NOUNS.length];
|
|
41
|
+
return `${adj}-${noun}`;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Resolve a spoken/written codename ("red-apple", "red apple", "Red Apple")
|
|
45
|
+
* back to items. Returns ALL matches (codename space is 4096; collisions are
|
|
46
|
+
* possible across many items).
|
|
47
|
+
*/
|
|
48
|
+
export function findByCodename(codename, entries) {
|
|
49
|
+
const norm = codename.trim().toLowerCase().replace(/[\s_]+/g, "-");
|
|
50
|
+
return entries.filter((e) => codenameFor(e.target, e.itemId) === norm);
|
|
51
|
+
}
|
|
52
|
+
/** Canonical copy-reference line for an item ("Copy ref" button payload). */
|
|
53
|
+
export function formatQARef(target, itemId, title) {
|
|
54
|
+
return `{ qa-ref: ${codenameFor(target, itemId)} | ${target} # ${itemId} | ${title} }`;
|
|
55
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@artymclabin/qa-review",
|
|
3
|
+
"version": "0.3.7",
|
|
4
|
+
"description": "Interactive on-page QA review overlay (spotlight walkthrough, approve/reject verdict ledger) with a framework-agnostic server handler factory and a self-provisioning Postgres store.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/ArtyMcLabin/qa-review.git"
|
|
9
|
+
},
|
|
10
|
+
"type": "module",
|
|
11
|
+
"sideEffects": false,
|
|
12
|
+
"main": "./dist/client/index.js",
|
|
13
|
+
"types": "./dist/client/index.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/client/index.d.ts",
|
|
17
|
+
"default": "./dist/client/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./client": {
|
|
20
|
+
"types": "./dist/client/index.d.ts",
|
|
21
|
+
"default": "./dist/client/index.js"
|
|
22
|
+
},
|
|
23
|
+
"./server": {
|
|
24
|
+
"types": "./dist/server/index.d.ts",
|
|
25
|
+
"default": "./dist/server/index.js"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"dist",
|
|
33
|
+
"README.md",
|
|
34
|
+
"CHANGELOG.md",
|
|
35
|
+
"LICENSE"
|
|
36
|
+
],
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "tsc -p tsconfig.build.json",
|
|
39
|
+
"test": "vitest run",
|
|
40
|
+
"prepare": "npm run build"
|
|
41
|
+
},
|
|
42
|
+
"peerDependencies": {
|
|
43
|
+
"lucide-react": ">=0.400.0",
|
|
44
|
+
"react": ">=18",
|
|
45
|
+
"react-dom": ">=18"
|
|
46
|
+
},
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"postgres": "^3.4.5"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@types/node": "^22",
|
|
52
|
+
"@types/react": "^19",
|
|
53
|
+
"@types/react-dom": "^19",
|
|
54
|
+
"jsdom": "^26",
|
|
55
|
+
"lucide-react": "^1.25.0",
|
|
56
|
+
"react": "^19.2.0",
|
|
57
|
+
"react-dom": "^19.2.0",
|
|
58
|
+
"typescript": "^5",
|
|
59
|
+
"vitest": "^3"
|
|
60
|
+
}
|
|
61
|
+
}
|