hashquiz 1.0.0-beta.2 → 1.0.0-beta.4

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 (39) hide show
  1. package/LICENSE.md +7 -7
  2. package/README.md +49 -8
  3. package/bin/hashquiz.js +1015 -176
  4. package/package.json +2 -1
  5. package/supabase/config.toml +388 -0
  6. package/supabase/functions/_shared/solo-core.js +3811 -0
  7. package/supabase/functions/solo-submit/index.ts +97 -0
  8. package/supabase/migrations/20261126090000_solo_live.sql +160 -0
  9. package/supabase/migrations/20261126120000_solo_hardening.sql +73 -0
  10. package/web/apple-touch-icon.png +0 -0
  11. package/web/assets/SoloCatalog-C2yyeNv7.css +1 -0
  12. package/web/assets/SoloCatalog-CkqJ5Tx_.js +1 -0
  13. package/web/assets/SoloEndView-D4O71skZ.js +1 -0
  14. package/web/assets/SoloEndView-DiG29AY1.css +1 -0
  15. package/web/assets/SoloIntroView-BZVJulM4.css +1 -0
  16. package/web/assets/SoloIntroView-BffbrN2m.js +1 -0
  17. package/web/assets/SoloLeaderboard-CZv7b2Vs.css +1 -0
  18. package/web/assets/SoloLeaderboard-yKT1v7Ii.js +1 -0
  19. package/web/assets/SoloQuestionView-7ZBgZtDL.js +65 -0
  20. package/web/assets/SoloQuestionView-D4uFu3tV.css +1 -0
  21. package/web/assets/decks-DUUEsbbr.js +49 -0
  22. package/web/assets/decks-i0k875Ku.js +1 -0
  23. package/web/assets/deps-B9JMgire.js +1 -0
  24. package/web/assets/index-B3S7raZa.js +32 -0
  25. package/web/assets/index-mrY1X_tz.css +1 -0
  26. package/web/assets/solo-8S92cge3.css +1 -0
  27. package/web/assets/solo-backend-DxFnwiPI.js +1 -0
  28. package/web/favicon-32.png +0 -0
  29. package/web/favicon.svg +8 -0
  30. package/web/host/apple-touch-icon.png +0 -0
  31. package/web/host/assets/index-CtXpIwsc.css +1 -0
  32. package/web/host/assets/{index-B8SRSGSJ.js → index-CuMMk6nf.js} +5 -5
  33. package/web/host/favicon-32.png +0 -0
  34. package/web/host/favicon.svg +8 -0
  35. package/web/host/index.html +8 -5
  36. package/web/index.html +8 -5
  37. package/web/assets/index-4A6VG5Dt.css +0 -1
  38. package/web/assets/index-AtaLR7F0.js +0 -31
  39. package/web/host/assets/index-Bld0lMZN.css +0 -1
package/LICENSE.md CHANGED
@@ -1,24 +1,24 @@
1
- # QuizV licensing
1
+ # HashQuiz licensing
2
2
 
3
3
  > **DRAFT — not yet reviewed by a lawyer.** The texts below describe the intended licensing model.
4
4
  > They must be reviewed before the repository is made public.
5
5
 
6
- QuizV is **fair-code open-core**. The repository contains code under three licenses.
6
+ HashQuiz is **fair-code open-core**. The repository contains code under three licenses.
7
7
  See [`docs/LICENSING.md`](docs/LICENSING.md) for a plain-language FAQ.
8
8
 
9
9
  | Tier | License | Applies to |
10
10
  |------|---------|------------|
11
- | Format & tooling | [MIT](packages/parser/LICENSE) | `packages/parser/` (the `.quizv.md` format), `.claude/plugins/quizv/` (Claude skills and commands), and any future MCP server package marked MIT |
12
- | Product | **QuizV Sustainable Use License** (below) | Everything else, unless stated otherwise: `packages/core`, `packages/server`, `packages/transport-*`, `packages/ui`, `packages/theme-default`, `apps/host`, `apps/player`, `decks/`, `examples/` |
13
- | Pro / Enterprise | [QuizV Enterprise License](LICENSE_EE.md) | `packages/ee/`, and any file whose name contains `.ee.` or whose path contains a `.ee` directory |
11
+ | Format & tooling | [MIT](packages/parser/LICENSE) | `packages/parser/` (the `.hashquiz.md` format), `.claude/plugins/hashquiz/` (Claude skills and commands), and any future MCP server package marked MIT |
12
+ | Product | **HashQuiz Sustainable Use License** (below) | Everything else, unless stated otherwise: `packages/core`, `packages/server`, `packages/transport-*`, `packages/ui`, `packages/theme-default`, `apps/host`, `apps/player`, `decks/`, `examples/` |
13
+ | Pro / Enterprise | [HashQuiz Enterprise License](LICENSE_EE.md) | `packages/ee/`, and any file whose name contains `.ee.` or whose path contains a `.ee` directory |
14
14
 
15
15
  When a directory contains its own `LICENSE` file, that file takes precedence for its contents.
16
16
 
17
- Versions of QuizV released before this change (up to and including v2.0.0) remain available under the MIT license.
17
+ Versions of HashQuiz released before this change (up to and including v2.0.0) remain available under the MIT license.
18
18
 
19
19
  ---
20
20
 
21
- ## QuizV Sustainable Use License
21
+ ## HashQuiz Sustainable Use License
22
22
 
23
23
  Version 1.0 (draft)
24
24
 
package/README.md CHANGED
@@ -17,7 +17,7 @@ bun add -d hashquiz@beta # prereleases until 1.0.0
17
17
  ```text
18
18
  decks/
19
19
  my-deck/
20
- index.quizv.md
20
+ index.hashquiz.md
21
21
  package.json
22
22
  vercel.json
23
23
  ```
@@ -27,22 +27,63 @@ Format reference: [deck format](https://github.com/WhiteWoodTech/hashquiz/blob/d
27
27
  ## Commands
28
28
 
29
29
  ```bash
30
- hashquiz check decks/my-deck/index.quizv.md # validate one deck
31
- hashquiz dev decks/my-deck/index.quizv.md # local game: host :3031/host/, players :3032
30
+ hashquiz check decks/my-deck/index.hashquiz.md # validate one deck
31
+ hashquiz dev decks/my-deck/index.hashquiz.md # local game: host :3031/host/, players :3032
32
+ hashquiz dev decks # same, a folder: solo decks folder, room deck = first deck by id
32
33
  hashquiz build decks --out dist # static site with every deck under decks/
34
+ hashquiz supabase deploy --project <ref> # solo backend on a Supabase project
33
35
  ```
34
36
 
35
- `build` validates every `*.quizv.md` under the folder, copies the apps and
36
- writes `host/decks.json` and `quizv-config.js`. It reads the deployment
37
- settings from the environment:
37
+ `build` validates every `*.hashquiz.md` under the folder, copies the apps and
38
+ writes `host/decks.json` (host deck list), the same `decks.json` at the root
39
+ (player solo decks) and `hashquiz-config.js`. It reads the deployment settings
40
+ from the environment:
38
41
 
39
42
  | Variable | Value |
40
43
  | --- | --- |
41
44
  | `HASHQUIZ_TRANSPORT` | `supabase` for a hosted game (default `local`) |
42
45
  | `HASHQUIZ_SUPABASE_URL` | Supabase project URL |
43
46
  | `HASHQUIZ_SUPABASE_ANON_KEY` | Supabase anon public key |
47
+ | `HASHQUIZ_SOLO_SCORING` | Solo run scoring: `browser` (default) or `edge` |
48
+ | `HASHQUIZ_PLAYER_URL` | Optional player URL for the host's solo links (default: same origin) |
44
49
 
45
- The `QUIZV_*` and `VITE_*` names (`VITE_TRANSPORT`, …) are accepted too.
50
+ The `VITE_*` names (`VITE_TRANSPORT`, …) are accepted too. The prebuilt apps carry no
51
+ settings of their own: whatever `hashquiz-config.js` says (including `local` and `browser`) is what they use.
52
+
53
+ Decks with `solo: true` in their frontmatter can also be played alone from
54
+ the player app. `hashquiz dev` serves solo on its own (port 3030): runs are stored in `.hashquiz/solo.db` of
55
+ the working directory (add `.hashquiz/` to `.gitignore`) and rescored by the server. The leaderboard exists only
56
+ on the machine running the server and the players must reach its port 3030, so it does not work for an https
57
+ static deploy (on an `https:` page the apps hide local solo). If `.hashquiz/solo.db` cannot be opened, the
58
+ server warns and runs rooms without solo. When a deck changes during a run, the score is not stored and the end
59
+ screen offers « Rejouer » with the new version. With `--decks <dir>` and a file, the solo decks come from that
60
+ folder. For a hosted site use the Supabase backend (see the hashquiz `docs/DEPLOY.md`).
61
+
62
+ ## Deploy the solo backend on Supabase
63
+
64
+ The package ships the Supabase project (`supabase/`: migrations, the `solo-submit` Edge Function and its
65
+ prebuilt core). After `hashquiz build`, deploy it with:
66
+
67
+ ```bash
68
+ HASHQUIZ_SITE_URL=https://<domain> hashquiz supabase deploy --project <project-ref> [--dry-run]
69
+ ```
70
+
71
+ It stages the project in a temp folder and runs `supabase link`, `supabase db push --remote`,
72
+ `supabase functions deploy solo-submit` and `supabase secrets set HASHQUIZ_SITE_URL=…`, stopping at the first
73
+ failure. The function reads `<HASHQUIZ_SITE_URL>/decks.json` at runtime, so deck changes need no redeploy.
74
+ `--site-url <url>` overrides `HASHQUIZ_SITE_URL` (an http(s) URL). It needs the
75
+ [Supabase CLI](https://supabase.com/docs/guides/cli) on `PATH` (or `SUPABASE_BIN`), plus
76
+ `SUPABASE_ACCESS_TOKEN` and `SUPABASE_DB_PASSWORD` in the environment (CI secrets). `--dry-run` prints the
77
+ steps without running them. The command never changes `solo_settings`: switching to edge scoring means setting
78
+ `HASHQUIZ_SOLO_SCORING=edge` for `hashquiz build` **and** running
79
+ `update solo_settings set scoring_mode = 'edge'` once.
80
+
81
+ Typical CI of a decks repository (secrets `SUPABASE_ACCESS_TOKEN`, `SUPABASE_DB_PASSWORD`, `HASHQUIZ_SITE_URL`):
82
+
83
+ ```bash
84
+ hashquiz build decks --out dist
85
+ hashquiz supabase deploy --project <project-ref>
86
+ ```
46
87
 
47
88
  ## Deploy on Vercel
48
89
 
@@ -51,7 +92,7 @@ The `QUIZV_*` and `VITE_*` names (`VITE_TRANSPORT`, …) are accepted too.
51
92
  ```json
52
93
  {
53
94
  "scripts": { "build": "hashquiz build decks --out dist" },
54
- "devDependencies": { "hashquiz": "^1.0.0-beta.1" }
95
+ "devDependencies": { "hashquiz": "^1.0.0-beta.2" }
55
96
  }
56
97
  ```
57
98