@johnmorrisdotca/houseki 0.4.0 → 0.4.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 (72) hide show
  1. package/CHANGELOG.md +29 -1
  2. package/README.md +77 -95
  3. package/dist/colour-chains/challenge.d.ts +12 -1
  4. package/dist/colour-chains/challenge.js +12 -1
  5. package/dist/colour-chains/content-types.d.ts +112 -0
  6. package/dist/colour-chains/content.d.ts +140 -3
  7. package/dist/colour-chains/content.js +140 -3
  8. package/dist/colour-chains/engine.d.ts +85 -6
  9. package/dist/colour-chains/engine.js +85 -6
  10. package/dist/colour-chains/input.d.ts +97 -7
  11. package/dist/colour-chains/input.js +97 -7
  12. package/dist/colour-chains/persistence.d.ts +36 -3
  13. package/dist/colour-chains/persistence.js +36 -3
  14. package/dist/colour-chains/types.d.ts +291 -17
  15. package/dist/colour-chains/validation.d.ts +12 -1
  16. package/dist/colour-chains/validation.js +12 -1
  17. package/dist/falling-triplets/content-types.d.ts +69 -0
  18. package/dist/falling-triplets/content.d.ts +60 -3
  19. package/dist/falling-triplets/content.js +60 -3
  20. package/dist/falling-triplets/engine.d.ts +122 -10
  21. package/dist/falling-triplets/engine.js +122 -10
  22. package/dist/falling-triplets/input.d.ts +61 -5
  23. package/dist/falling-triplets/input.js +61 -5
  24. package/dist/falling-triplets/match.d.ts +26 -2
  25. package/dist/falling-triplets/match.js +26 -2
  26. package/dist/falling-triplets/random.d.ts +34 -3
  27. package/dist/falling-triplets/random.js +34 -3
  28. package/dist/falling-triplets/types.d.ts +227 -3
  29. package/dist/gem-swap/content.d.ts +116 -0
  30. package/dist/gem-swap/content.js +72 -0
  31. package/dist/gem-swap/engine.d.ts +124 -9
  32. package/dist/gem-swap/engine.js +124 -9
  33. package/dist/gem-swap/persistence.d.ts +60 -4
  34. package/dist/gem-swap/persistence.js +65 -7
  35. package/dist/gem-swap/practice.js +2 -2
  36. package/dist/gem-swap/types.d.ts +336 -3
  37. package/dist/magnetic-blocks/content-types.d.ts +56 -0
  38. package/dist/magnetic-blocks/content.d.ts +91 -5
  39. package/dist/magnetic-blocks/content.js +91 -5
  40. package/dist/magnetic-blocks/engine.d.ts +63 -5
  41. package/dist/magnetic-blocks/engine.js +63 -5
  42. package/dist/magnetic-blocks/persistence.d.ts +36 -3
  43. package/dist/magnetic-blocks/persistence.js +36 -3
  44. package/dist/magnetic-blocks/physics.d.ts +176 -6
  45. package/dist/magnetic-blocks/physics.js +176 -6
  46. package/dist/magnetic-blocks/types.d.ts +185 -1
  47. package/dist/magnetic-blocks/validation.d.ts +12 -0
  48. package/dist/magnetic-blocks/validation.js +12 -0
  49. package/dist/nature/attraction.d.ts +24 -2
  50. package/dist/nature/attraction.js +24 -2
  51. package/dist/nature/environment.d.ts +200 -7
  52. package/dist/nature/environment.js +88 -7
  53. package/dist/nature/marking.d.ts +13 -1
  54. package/dist/nature/marking.js +13 -1
  55. package/dist/nature/rebound.d.ts +30 -2
  56. package/dist/nature/rebound.js +30 -2
  57. package/dist/nature/state.d.ts +11 -0
  58. package/dist/nature/state.js +11 -0
  59. package/dist/nature/types.d.ts +194 -1
  60. package/dist/nature/validation.d.ts +12 -0
  61. package/dist/nature/validation.js +12 -0
  62. package/dist/stone-collapse/content-types.d.ts +69 -0
  63. package/dist/stone-collapse/content.d.ts +60 -3
  64. package/dist/stone-collapse/content.js +60 -3
  65. package/dist/stone-collapse/engine.d.ts +99 -8
  66. package/dist/stone-collapse/engine.js +99 -8
  67. package/dist/stone-collapse/persistence.d.ts +36 -3
  68. package/dist/stone-collapse/persistence.js +36 -3
  69. package/dist/stone-collapse/types.d.ts +220 -3
  70. package/dist/stone-collapse/validation.d.ts +12 -1
  71. package/dist/stone-collapse/validation.js +12 -1
  72. package/package.json +34 -26
package/CHANGELOG.md CHANGED
@@ -4,6 +4,31 @@ All notable changes to this package are written here, newest first, in the form
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.4.2] - 2026-10-14
8
+
9
+ Nothing that was exported has changed. The package has an English and Japanese documentation site with a checked example for every export.
10
+
11
+ ### Added
12
+
13
+ - Add the bilingual documentation site, checked public examples, paired guides, local search and machine-readable pages.
14
+
15
+ ### Changed
16
+
17
+ - The API link in the header reads "API" in English, so that the header takes the same number of rows in English and in Japanese on a phone, as the demo's test of a language change asks.
18
+ - Synchronize documentation tooling for repository layouts, generated type references, Node entry points and repository-specific README links.
19
+ - Keep complete resource catalogues on the documentation entry index and the active resource beside core navigation; render valid default imports in HTML and Markdown.
20
+ - The demo's smoke test counts thirty-three links in the family footer, after the sports packages joined the list, and the family test counts thirty-two packages.
21
+ - Group the package family by kind, alphabetize each group, and include the geography packages and REST in Pieces in the shared footer and README.
22
+ - Update the shared family description for addresses in all seven supported countries, including France and Germany.
23
+
24
+ ## [0.4.1] - 2026-10-07
25
+
26
+ ### Fixed
27
+
28
+ - Gem Swap rejects excessively nested replay inputs with a bounded validation error.
29
+ - Reshuffling preserves an active Black Hole portal and all remaining gem identities.
30
+ - Black Hole design status now matches the optional shipped tray power. CI explicitly checks public metadata and machine-specific documentation paths.
31
+
7
32
  ## [0.4.0] - 2026-10-06
8
33
 
9
34
  ### Added
@@ -96,7 +121,8 @@ Nothing that was exported has changed. The README is the family's one layout, in
96
121
  - An experimental Magnetic Blocks engine with bonded squares, magnetic floor schedules, a Floor Switch and impact drops.
97
122
  - Typed entry points, a generated API reference, an MIT licence and reproducible package checks.
98
123
 
99
- [Unreleased]: https://github.com/johnmorrisdotca/houseki/compare/v0.4.0...HEAD
124
+ [Unreleased]: https://github.com/johnmorrisdotca/houseki/compare/v0.4.2...HEAD
125
+ [0.4.2]: https://github.com/johnmorrisdotca/houseki/compare/v0.4.1...v0.4.2
100
126
  [0.3.0]: https://github.com/johnmorrisdotca/houseki/compare/v0.2.1...v0.3.0
101
127
  [0.2.1]: https://github.com/johnmorrisdotca/houseki/compare/v0.2.0...v0.2.1
102
128
  [0.2.0]: https://github.com/johnmorrisdotca/houseki/compare/v0.1.1...v0.2.0
@@ -104,3 +130,5 @@ Nothing that was exported has changed. The README is the family's one layout, in
104
130
  [0.1.0]: https://github.com/johnmorrisdotca/houseki/releases/tag/v0.1.0
105
131
 
106
132
  [0.4.0]: https://github.com/johnmorrisdotca/houseki/compare/v0.3.0...v0.4.0
133
+
134
+ [0.4.1]: https://github.com/johnmorrisdotca/houseki/compare/v0.4.0...v0.4.1
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- <h1 align="center">Houseki <sub>宝石</sub></h1>
1
+ <h1 align="center">Houseki <sub>宝石</sub> — Match-3 gem puzzles</h1>
2
2
 
3
3
  <p align="center"><strong>Five original gem and stone puzzle games for JavaScript and TypeScript.</strong><br>
4
4
  Falling Triplets, Colour Chains, Stone Collapse and Gem Swap: each an immutable, seeded rules engine that runs anywhere, with graded challenges and lessons, saves that replay to the same board, and a keyboard, keypad and touch player in the demo. Magnetic Blocks adds bonded squares, a magnetic floor and its own campaign. Shizen and Arashi each add a separate Colour Chains campaign. In English and Japanese. No dependencies.</p>
@@ -9,6 +9,8 @@ Falling Triplets, Colour Chains, Stone Collapse and Gem Swap: each an immutable,
9
9
  <a href="./LICENSE"><img alt="MIT licence" src="https://img.shields.io/badge/licence-MIT-2f5d4a"></a>
10
10
  <img alt="No dependencies" src="https://img.shields.io/badge/dependencies-0-2f5d4a">
11
11
  <img alt="TypeScript" src="https://img.shields.io/badge/types-TypeScript-2f5d4a">
12
+ <a href="https://johnmorrisdotca.github.io/houseki/docs/api/main/index.html"><img alt="179.1 kB minified and gzipped" src="https://img.shields.io/badge/min%2Bgzip-179.1%20kB-2f5d4a"></a>
13
+ <a href="https://www.npmjs.com/package/@johnmorrisdotca/houseki#provenance"><img alt="Published with npm provenance" src="https://img.shields.io/badge/npm-provenance-2f5d4a"></a>
12
14
  </p>
13
15
 
14
16
  <table align="center">
@@ -16,7 +18,7 @@ Falling Triplets, Colour Chains, Stone Collapse and Gem Swap: each an immutable,
16
18
  <td align="center" valign="top">
17
19
  <picture>
18
20
  <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/johnmorrisdotca/houseki/main/docs/images/hero-desk-dark.webp">
19
- <img src="https://raw.githubusercontent.com/johnmorrisdotca/houseki/main/docs/images/hero-desk-light.webp" alt="The demo on a desk, in English: the page header with its language chooser, the API reference link, five cloth patches and the Help switch, the page chooser (Falling Triplets, Colour Chains, Gem Swap and Stone Collapse chosen, Magnetic Blocks), the settings column, and Gem Swap on green felt: an eight by eight board of red, blue, green, gold and purple gems with a permanent symbol on each, and the tool tray beside it with Bomb, Row clear and Colour clear" width="600">
21
+ <img src="https://raw.githubusercontent.com/johnmorrisdotca/houseki/main/docs/images/hero-desk-light.webp" alt="The demo on a desk, in English: the page header with its language chooser, the Docs and API reference links, five cloth patches and the Help switch, the page chooser (Falling Triplets, Colour Chains, Gem Swap and Stone Collapse chosen, Magnetic Blocks), the settings column, and Gem Swap on green felt: an eight by eight board of red, blue, green, gold and purple gems with a permanent symbol on each, and the tool tray beside it with Bomb, Row clear and Colour clear" width="600">
20
22
  </picture>
21
23
  <br><em>The demo on a desk: Gem Swap with its tool tray.</em>
22
24
  </td>
@@ -31,6 +33,8 @@ Falling Triplets, Colour Chains, Stone Collapse and Gem Swap: each an immutable,
31
33
  </table>
32
34
 
33
35
 
36
+ <p align="center"><a href="https://johnmorrisdotca.github.io/houseki/docs/">Documentation</a> · <a href="https://johnmorrisdotca.github.io/houseki/docs/guides/getting-started.html">Getting started</a> · <a href="https://johnmorrisdotca.github.io/houseki/api.html">API reference</a></p>
37
+
34
38
  Houseki is a set of match-style puzzle games made to be dropped into a page or a server. Every game is a set of plain functions on plain data: a state in, a new state out, nothing read from the page, the clock or the network. The demo's players draw those states, and a person can play them with the keyboard, a keypad or a finger.
35
39
 
36
40
  ## In 30 seconds
@@ -173,6 +177,17 @@ Each picture is the real game, drawn by the demo's player from the package's eng
173
177
 
174
178
  ## Use it in your project
175
179
 
180
+ ### Install under another name
181
+
182
+ ```sh
183
+ npm install match-3@npm:@johnmorrisdotca/houseki
184
+ ```
185
+
186
+ ```ts no-check
187
+ import { fallingTriplets } from "match-3";
188
+ console.log(fallingTriplets.createGame({seed:"docs"}).phase);
189
+ ```
190
+
176
191
  ### Install
177
192
 
178
193
  ```sh
@@ -550,6 +565,8 @@ setInterval(() => { // the page owns the clock;
550
565
 
551
566
  ## API
552
567
 
568
+ The [documentation](https://johnmorrisdotca.github.io/houseki/docs/) has paired guides, local search and checked examples. The [API index](https://johnmorrisdotca.github.io/houseki/api.html) retains existing export anchors.
569
+
553
570
  Every export of every entry point is in the [API reference](https://johnmorrisdotca.github.io/houseki/api.html), made from the source when the demo is built, with each signature and doc comment. A test fails when a public export has no doc comment.
554
571
 
555
572
  ### Entry points
@@ -617,77 +634,7 @@ Physical-device feel testing, a fluent Japanese review and human difficulty revi
617
634
 
618
635
  ## Architecture
619
636
 
620
- ```text
621
- src/
622
- ├── colour-chains/
623
- │ ├── challenge.ts
624
- │ ├── content-data.ts
625
- │ ├── content-types.ts
626
- │ ├── content.ts
627
- │ ├── engine.ts
628
- │ ├── input.ts
629
- │ ├── match.ts
630
- │ ├── persistence.ts
631
- │ ├── random.ts
632
- │ ├── types.ts
633
- │ └── validation.ts
634
- ├── colour-chains.ts
635
- ├── falling-triplets/
636
- │ ├── content-data.ts
637
- │ ├── content-types.ts
638
- │ ├── content.ts
639
- │ ├── engine.ts
640
- │ ├── input.ts
641
- │ ├── match.ts
642
- │ ├── random.ts
643
- │ └── types.ts
644
- ├── falling-triplets.ts
645
- ├── gem-swap/
646
- │ ├── black-hole.ts
647
- │ ├── board.ts
648
- │ ├── content.ts
649
- │ ├── engine.ts
650
- │ ├── persistence.ts
651
- │ ├── practice.ts
652
- │ ├── random.ts
653
- │ ├── specials.ts
654
- │ ├── tools.ts
655
- │ └── types.ts
656
- ├── gem-swap.ts
657
- ├── index.ts
658
- ├── magnetic-blocks/
659
- │ ├── content-data.ts
660
- │ ├── content-types.ts
661
- │ ├── content.ts
662
- │ ├── engine.ts
663
- │ ├── persistence.ts
664
- │ ├── physics.ts
665
- │ ├── random.ts
666
- │ ├── types.ts
667
- │ └── validation.ts
668
- ├── magnetic-blocks.ts
669
- ├── nature/
670
- │ ├── attraction.ts
671
- │ ├── environment.ts
672
- │ ├── marking.ts
673
- │ ├── random.ts
674
- │ ├── rebound.ts
675
- │ ├── state.ts
676
- │ ├── types.ts
677
- │ └── validation.ts
678
- ├── nature.ts
679
- ├── stone-collapse/
680
- │ ├── content-data.ts
681
- │ ├── content-types.ts
682
- │ ├── content.ts
683
- │ ├── engine.ts
684
- │ ├── persistence.ts
685
- │ ├── types.ts
686
- │ └── validation.ts
687
- └── stone-collapse.ts
688
- ```
689
-
690
- The [design pack](docs/design/README.md) specifies the rules, controls, materials, accessibility, level generation, grading, persistence and acceptance checks of every game; [level generation](docs/design/LEVEL-GENERATION.md) follows a deliberate complete count: generate and prove original boards, remove duplicates, grade the decisions a player faces, then sort and number from easy to hard.
637
+ The [architecture guide](docs/guides/architecture.md) preserves the complete source tree and design explanation. Each native engine keeps its own types, immutable transitions, content and replay boundary.
691
638
 
692
639
  ## The name
693
640
 
@@ -704,35 +651,67 @@ Using Houseki in something? Open an *Add my project* issue and we will add you.
704
651
  ### The family
705
652
 
706
653
  <!-- family:start (made by scripts/family-readme.mjs from scripts/family-template.mjs; change those, not this) -->
707
- Houseki is one of twenty-four packages, each made for the same site, each at
708
- [github.com/johnmorrisdotca](https://github.com/johnmorrisdotca). The code of every one is MIT.
654
+ Houseki is one of thirty-two packages, each made for the same site, each at
655
+ [github.com/johnmorrisdotca](https://github.com/johnmorrisdotca) or [github.com/spxis](https://github.com/spxis). The code of every one is MIT.
709
656
 
710
- - [Korokoro](https://github.com/johnmorrisdotca/korokoro) (コロコロ): dice, with notation, exact odds, real sounds and the dice of many games. [Demo](https://johnmorrisdotca.github.io/korokoro/).
711
- - [Kyuubu](https://github.com/johnmorrisdotca/kyuubu) (キューブ): a turning cube for the browser, 2×2 to 7×7, with record solves to replay. [Demo](https://johnmorrisdotca.github.io/kyuubu/).
712
- - [Hitotsu](https://github.com/johnmorrisdotca/hitotsu) (一つ): a colour-card shedding game for two to eight, with the house rules people play. [Demo](https://johnmorrisdotca.github.io/hitotsu/).
713
- - [Toranpu](https://github.com/johnmorrisdotca/toranpu) (トランプ): a deck of playing cards, card games with computer players, and solitaires. [Demo](https://johnmorrisdotca.github.io/toranpu/).
714
- - [Tane](https://github.com/johnmorrisdotca/tane) (種): seeded random numbers and daily seeds, the same in every browser and on every server. [Demo](https://johnmorrisdotca.github.io/tane/).
657
+ **Games — board**
658
+
659
+ - [Domino](https://github.com/johnmorrisdotca/domino) (ドミノ): dominoes and Mexican Train. [Demo](https://johnmorrisdotca.github.io/domino/).
660
+ - [Gunjin](https://github.com/johnmorrisdotca/gunjin) (軍人): five hidden-rank strategy games with pass-the-device play. [Demo](https://johnmorrisdotca.github.io/gunjin/).
715
661
  - [Narabe](https://github.com/johnmorrisdotca/narabe) (並べ): one rules engine for abstract board games, from gomoku and Reversi to Go and checkers. [Demo](https://johnmorrisdotca.github.io/narabe/).
662
+ - [Sugoroku](https://github.com/johnmorrisdotca/sugoroku) (双六): backgammon and its variants, with the doubling cube and match play. [Demo](https://johnmorrisdotca.github.io/sugoroku/).
716
663
  - [Tenka](https://github.com/johnmorrisdotca/tenka) (天下): world conquest for two to six, on a map of the real world. [Demo](https://johnmorrisdotca.github.io/tenka/).
717
- - [Kumimoji](https://github.com/johnmorrisdotca/kumimoji) (組み文字): a crossword tile race, in English and Japanese kana. [Demo](https://johnmorrisdotca.github.io/kumimoji/).
718
- - [Tsunagi](https://github.com/johnmorrisdotca/tsunagi) (繋ぎ): a line-joining logic puzzle whose every level has exactly one answer. [Demo](https://johnmorrisdotca.github.io/tsunagi/).
664
+
665
+ **Games — cards & tiles**
666
+
667
+ - [Hitotsu](https://github.com/johnmorrisdotca/hitotsu) (一つ): a colour-card shedding game for two to eight, with the house rules people play. [Demo](https://johnmorrisdotca.github.io/hitotsu/).
719
668
  - [Jarajara](https://github.com/johnmorrisdotca/jarajara) (ジャラジャラ): mahjong tiles drawn as SVG, stacked layouts, and the matching solitaire Awase. [Demo](https://johnmorrisdotca.github.io/jarajara/).
720
- - [Suido](https://github.com/johnmorrisdotca/suido) (水道): a pipe puzzle: turn the pieces until the water reaches every drain. [Demo](https://johnmorrisdotca.github.io/suido/).
721
- - [Domino](https://github.com/johnmorrisdotca/domino) (ドミノ): dominoes and Mexican Train. [Demo](https://johnmorrisdotca.github.io/domino/).
722
- - [Kotoba](https://github.com/johnmorrisdotca/kotoba) (言葉): word lists and word-game rules in English, French, German and Japanese. [Demo](https://johnmorrisdotca.github.io/kotoba/).
723
- - [Sugoroku](https://github.com/johnmorrisdotca/sugoroku) (双六): backgammon and its variants, with the doubling cube and match play. [Demo](https://johnmorrisdotca.github.io/sugoroku/).
669
+ - [Kumimoji](https://github.com/johnmorrisdotca/kumimoji) (組み文字): a crossword tile race, in English and Japanese kana. [Demo](https://johnmorrisdotca.github.io/kumimoji/).
670
+ - [Toranpu](https://github.com/johnmorrisdotca/toranpu) (トランプ): a deck of playing cards, card games with computer players, and solitaires. [Demo](https://johnmorrisdotca.github.io/toranpu/).
671
+
672
+ **Games — puzzles**
673
+
674
+ - [Houseki](https://github.com/johnmorrisdotca/houseki) (宝石): gem and stone matching puzzles: falling triplets, stone collapse, colour chains and gem swap. [Demo](https://johnmorrisdotca.github.io/houseki/).
675
+ - [Jirai](https://github.com/johnmorrisdotca/jirai) (地雷): minesweeper on shaped grids with verified no-guess boards. [Demo](https://johnmorrisdotca.github.io/jirai/).
676
+ - [Karakuri](https://github.com/johnmorrisdotca/karakuri) (からくり): eight hyper-casual puzzle games, some of them physics: draw a shield, pull pins, cut ropes, slide blocks, pour tubes. [Demo](https://johnmorrisdotca.github.io/karakuri/).
724
677
  - [Kazu](https://github.com/johnmorrisdotca/kazu) (数): grid number puzzles: Sudoku and its variants, Futoshiki and Skyscrapers. [Demo](https://johnmorrisdotca.github.io/kazu/).
678
+ - [Kyuubu](https://github.com/johnmorrisdotca/kyuubu) (キューブ): a turning cube for the browser, 2×2 to 7×7, with record solves to replay. [Demo](https://johnmorrisdotca.github.io/kyuubu/).
725
679
  - [Meikyuu](https://github.com/johnmorrisdotca/meikyuu) (迷宮): mazes on squares, hexagons, triangles and circles, made from a seed and drawn through with a finger or the mouse. [Demo](https://johnmorrisdotca.github.io/meikyuu/).
680
+ - [Suido](https://github.com/johnmorrisdotca/suido) (水道): a pipe puzzle: turn the pieces until the water reaches every drain. [Demo](https://johnmorrisdotca.github.io/suido/).
681
+ - [Tobiishi](https://github.com/johnmorrisdotca/tobiishi) (飛び石): peg solitaire with nine boards and seeded solvable challenges. [Demo](https://johnmorrisdotca.github.io/tobiishi/).
682
+ - [Tsunagi](https://github.com/johnmorrisdotca/tsunagi) (繋ぎ): a line-joining logic puzzle whose every level has exactly one answer. [Demo](https://johnmorrisdotca.github.io/tsunagi/).
683
+
684
+ **Games — dice & random**
685
+
686
+ - [Korokoro](https://github.com/johnmorrisdotca/korokoro) (コロコロ): dice, with notation, exact odds, real sounds and the dice of many games. [Demo](https://johnmorrisdotca.github.io/korokoro/).
687
+ - [Tane](https://github.com/johnmorrisdotca/tane) (種): seeded random numbers and daily seeds, the same in every browser and on every server. [Demo](https://johnmorrisdotca.github.io/tane/).
688
+
689
+ **Language**
690
+
691
+ - [Bushu](https://github.com/johnmorrisdotca/bushu) (部首): find a kanji by the parts it is made of. [Demo](https://johnmorrisdotca.github.io/bushu/).
726
692
  - [Hikidashi](https://github.com/johnmorrisdotca/hikidashi) (引き出し): a drawer of small Japanese text tools: era dates, kanji numerals, readings and sentence difficulty. [Demo](https://johnmorrisdotca.github.io/hikidashi/).
693
+ - [Kotoba](https://github.com/johnmorrisdotca/kotoba) (言葉): word lists and word-game rules in English, French, German and Japanese. [Demo](https://johnmorrisdotca.github.io/kotoba/).
694
+
695
+ **Geography & data**
696
+
697
+ - [address-plus](https://github.com/johnmorrisdotca/address-plus) (アドレスプラス): parse and format addresses in the United States, Canada, Japan, Australia, France, Germany and the United Kingdom. [Demo](https://johnmorrisdotca.github.io/address-plus/).
727
698
  - [Chizu](https://github.com/johnmorrisdotca/chizu) (地図): maps of the world and of countries' regions, in English and Japanese, with a quiz and callouts. [Demo](https://johnmorrisdotca.github.io/chizu/).
728
- - [Bushu](https://github.com/johnmorrisdotca/bushu) (部首): find a kanji by the parts it is made of. [Demo](https://johnmorrisdotca.github.io/bushu/).
729
- - [Tobiishi](https://github.com/johnmorrisdotca/tobiishi) (飛び石): peg solitaire with nine boards and seeded solvable challenges. [Demo](https://johnmorrisdotca.github.io/tobiishi/).
730
- - [Jirai](https://github.com/johnmorrisdotca/jirai) (地雷): minesweeper on shaped grids with verified no-guess boards. [Demo](https://johnmorrisdotca.github.io/jirai/).
731
- - [Gunjin](https://github.com/johnmorrisdotca/gunjin) (軍人): five hidden-rank strategy games with pass-the-device play. [Demo](https://johnmorrisdotca.github.io/gunjin/).
732
- - [Karakuri](https://github.com/johnmorrisdotca/karakuri) (からくり): eight hyper-casual puzzle games, some of them physics: draw a shield, pull pins, cut ropes, slide blocks, pour tubes. [Demo](https://johnmorrisdotca.github.io/karakuri/).
733
- - [Houseki](https://github.com/johnmorrisdotca/houseki) (宝石): gem and stone matching puzzles: falling triplets, stone collapse, colour chains and gem swap. [Demo](https://johnmorrisdotca.github.io/houseki/).
699
+ - [Hata](https://github.com/johnmorrisdotca/hata) (旗): country and regional flags as SVG, at their true proportions and keyed by ISO code. [Demo](https://johnmorrisdotca.github.io/hata/).
700
+ - [Kuni](https://github.com/johnmorrisdotca/kuni) (国): countries and their regions, with ISO codes and names in English and Japanese. [Demo](https://johnmorrisdotca.github.io/kuni/).
701
+
702
+ **Sports**
703
+
704
+ - [Dougu Sports](https://github.com/johnmorrisdotca/dougu-sports) (道具): sports emblems as SVG: trophies, medals, crests, and the ball and gear of every sport, with optional 3D turning. [Demo](https://johnmorrisdotca.github.io/dougu-sports/).
705
+ - [Kyogijo Stadiums](https://github.com/johnmorrisdotca/kyogijo-stadiums) (競技場): sports fields, rinks, courts and ballparks drawn to scale as SVG, with each team and the score on them. [Demo](https://johnmorrisdotca.github.io/kyogijo-stadiums/).
706
+ - [Senshu Jerseys](https://github.com/johnmorrisdotca/senshu-jerseys) (選手): sports jerseys, sweaters, kits, caps, helmets and retired-number banners as SVG, front and back, with optional 2.5D turning. [Demo](https://johnmorrisdotca.github.io/senshu-jerseys/).
707
+ - [Taisen Brackets](https://github.com/johnmorrisdotca/taisen-brackets) (対戦): a sport-agnostic tournament bracket, drawn as SVG, from a list of ties. [Demo](https://johnmorrisdotca.github.io/taisen-brackets/).
708
+
709
+ **Developer tools**
710
+
711
+ - [REST in Pieces](https://github.com/spxis/rest-in-pieces) (レスト・イン・ピーシーズ): seeded test data and REST APIs for frontend development, with latency and error drills. [Demo](https://spxis.github.io/rest-in-pieces/).
712
+
734
713
 
735
- **This package is Houseki.** The demos of all twenty-four share one header and footer, so each links the rest.
714
+ **This package is Houseki.** The demos of all thirty-two share one header and footer, so each links the rest.
736
715
  <!-- family:end -->
737
716
 
738
717
  ## Development
@@ -742,7 +721,10 @@ pnpm install
742
721
  pnpm check # lint, types and tests: every game's rules, every campaign's recorded wins
743
722
  pnpm test:package # pack it as npm does, install it in an empty project, import every entry
744
723
  pnpm test:demo # build the demo and play it in a real browser, at a phone's width and a desk's
745
- pnpm site # build the demo and the API reference into site/
724
+ pnpm site # build the native demo into site/
725
+ pnpm docs:site # add guides, API pages, search and llms files
726
+ pnpm docs:check # check public documentation and run its examples
727
+ pnpm size --write # refresh the measured bundle size and README badge
746
728
  pnpm test:readme # run every example in this README against the built package
747
729
  pnpm screenshots:readme # take the README's pictures from the built demo, in light and dark
748
730
  ```
@@ -753,7 +735,7 @@ Ideas, bug reports and pull requests are welcome in the [issues](https://github.
753
735
 
754
736
  ## Changes
755
737
 
756
- Every release is written up in [CHANGELOG.md](./CHANGELOG.md). The latest release, 0.3.0, makes Magnetic Blocks show a level's fixed rules as soon as the level is chosen and give free play its own choices back, makes Space do what the ghost showed, lets a big board be scrolled from the keyboard on all three falling players, and adds `settledCells` to the Shizen hard-drop preview.
738
+ Every release is written up in [CHANGELOG.md](./CHANGELOG.md). The latest release, 0.4.2, adds no code: it adds the documentation site, with a checked example for every export, in English and Japanese.
757
739
 
758
740
  ## Licence
759
741
 
@@ -1,3 +1,14 @@
1
1
  import type { ChallengeOptions, GameState } from './types.js';
2
- /** Validates and creates a finite witnessed challenge. Hints use only the supplied verified pair placements. */
2
+ /** Validates and creates a finite witnessed challenge. Hints use only the supplied verified pair placements.
3
+ *
4
+ * @param options - Validated native creation, authored challenge, or environment options described by this signature.
5
+ * @returns Validates and creates a finite witnessed challenge. Hints use only the supplied verified pair placements.
6
+ * @example
7
+ * ```ts
8
+ * import { createChallenge, levelManifest } from "@johnmorrisdotca/houseki/colour-chains";
9
+ *
10
+ * const level=levelManifest[0];
11
+ * console.log(createChallenge({id:level.id,seed:level.seed,width:level.width,height:level.height,colourCount:level.colourCount,board:level.board,queue:level.queue,goal:level.goal,witness:level.witness}).phase);
12
+ * ```
13
+ */
3
14
  export declare function createChallenge(options: ChallengeOptions): GameState;
@@ -57,7 +57,18 @@ function solveWitness(start, witness) {
57
57
  throw new StoneChainsOptionsError('witness-does-not-win', 'Witness does not complete the challenge goal within its finite queue');
58
58
  return state;
59
59
  }
60
- /** Validates and creates a finite witnessed challenge. Hints use only the supplied verified pair placements. */
60
+ /** Validates and creates a finite witnessed challenge. Hints use only the supplied verified pair placements.
61
+ *
62
+ * @param options - Validated native creation, authored challenge, or environment options described by this signature.
63
+ * @returns Validates and creates a finite witnessed challenge. Hints use only the supplied verified pair placements.
64
+ * @example
65
+ * ```ts
66
+ * import { createChallenge, levelManifest } from "@johnmorrisdotca/houseki/colour-chains";
67
+ *
68
+ * const level=levelManifest[0];
69
+ * console.log(createChallenge({id:level.id,seed:level.seed,width:level.width,height:level.height,colourCount:level.colourCount,board:level.board,queue:level.queue,goal:level.goal,witness:level.witness}).phase);
70
+ * ```
71
+ */
61
72
  export function createChallenge(options) {
62
73
  if (!options || typeof options !== 'object' || Array.isArray(options))
63
74
  throw new StoneChainsOptionsError('invalid-challenge', 'Challenge options must be an object');
@@ -1,8 +1,30 @@
1
1
  import type { ChallengeGoal, Colour, Gem, Orientation, WitnessStep } from './types.js';
2
+ /** One authored text in English and Japanese.
3
+ *
4
+ * @example
5
+ * ```ts
6
+ * import type { LocalizedText } from "@johnmorrisdotca/houseki/colour-chains";
7
+ *
8
+ * const value: LocalizedText = {en:"A small puzzle",ja:"小さいパズル"};
9
+ * console.log(value == null ? value : typeof value === "object" ? Object.keys(value).slice(0,6) : value);
10
+ * ```
11
+ */
2
12
  export interface LocalizedText {
3
13
  readonly en: string;
4
14
  readonly ja: string;
5
15
  }
16
+ /** The bounded engine measurements used to grade this campaign; they do not claim human difficulty.
17
+ *
18
+ * @example
19
+ * ```ts
20
+ * import { levelManifest } from "@johnmorrisdotca/houseki/colour-chains";
21
+ * import type { ChainDifficultyMetrics } from "@johnmorrisdotca/houseki/colour-chains";
22
+ *
23
+ * const level=levelManifest[0];
24
+ * const value: ChainDifficultyMetrics = level.rawMetrics;
25
+ * console.log(value == null ? value : typeof value === "object" ? Object.keys(value).slice(0,6) : value);
26
+ * ```
27
+ */
6
28
  export interface ChainDifficultyMetrics {
7
29
  readonly placementProbes: number;
8
30
  readonly legalPlacements: number;
@@ -63,6 +85,18 @@ export interface ChainDifficultyMetrics {
63
85
  /** Number of committed pair placements in the supplied winning plan. */
64
86
  readonly planningLength: number;
65
87
  }
88
+ /** One authored native challenge with its stable id, setup, winning witness, measurements and review status.
89
+ *
90
+ * @example
91
+ * ```ts
92
+ * import { levelManifest } from "@johnmorrisdotca/houseki/colour-chains";
93
+ * import type { ChainCampaignLevel } from "@johnmorrisdotca/houseki/colour-chains";
94
+ *
95
+ * const level=levelManifest[0];
96
+ * const value: ChainCampaignLevel = level;
97
+ * console.log(value == null ? value : typeof value === "object" ? Object.keys(value).slice(0,6) : value);
98
+ * ```
99
+ */
66
100
  export interface ChainCampaignLevel {
67
101
  readonly id: string;
68
102
  readonly number: number;
@@ -91,6 +125,17 @@ export interface ChainCampaignLevel {
91
125
  readonly rawDifficultyScore?: number;
92
126
  readonly normalizationCategory?: string;
93
127
  }
128
+ /** One authored native challenge with its stable id, setup, winning witness, measurements and review status.
129
+ *
130
+ * @example
131
+ * ```ts
132
+ * import type { NatureChainCampaignLevel } from "@johnmorrisdotca/houseki/colour-chains";
133
+ * import { shizenLevelManifest } from "@johnmorrisdotca/houseki/colour-chains";
134
+ *
135
+ * const value: NatureChainCampaignLevel = shizenLevelManifest[0];
136
+ * console.log(value == null ? value : typeof value === "object" ? Object.keys(value).slice(0,6) : value);
137
+ * ```
138
+ */
94
139
  export interface NatureChainCampaignLevel extends ChainCampaignLevel {
95
140
  readonly objective: LocalizedText;
96
141
  readonly nature: true;
@@ -98,6 +143,17 @@ export interface NatureChainCampaignLevel extends ChainCampaignLevel {
98
143
  readonly magneticQueue?: readonly (readonly [boolean, boolean])[];
99
144
  readonly weatherTrace?: readonly Readonly<Record<string, unknown>>[];
100
145
  }
146
+ /** The ordered native campaign, its generation/grading revisions, checksum and measured levels.
147
+ *
148
+ * @example
149
+ * ```ts
150
+ * import type { ChainCampaignManifest } from "@johnmorrisdotca/houseki/colour-chains";
151
+ * import { campaignManifest } from "@johnmorrisdotca/houseki/colour-chains";
152
+ *
153
+ * const value: ChainCampaignManifest = campaignManifest;
154
+ * console.log(value == null ? value : typeof value === "object" ? Object.keys(value).slice(0,6) : value);
155
+ * ```
156
+ */
101
157
  export interface ChainCampaignManifest {
102
158
  readonly count: number;
103
159
  readonly candidatePoolCount: number;
@@ -111,20 +167,65 @@ export interface ChainCampaignManifest {
111
167
  readonly checksum: string;
112
168
  readonly levels: readonly ChainCampaignLevel[];
113
169
  }
170
+ /** An inclusive one-based range in a measured native nature-campaign difficulty band.
171
+ *
172
+ * @example
173
+ * ```ts
174
+ * import type { NatureCampaignBand } from "@johnmorrisdotca/houseki/colour-chains";
175
+ *
176
+ * const value: NatureCampaignBand = {id:"entry",count:1,first:1,last:1};
177
+ * console.log(value == null ? value : typeof value === "object" ? Object.keys(value).slice(0,6) : value);
178
+ * ```
179
+ */
114
180
  export interface NatureCampaignBand {
115
181
  readonly id: 'entry' | 'easy' | 'intermediate' | 'hard' | 'expert';
116
182
  readonly count: number;
117
183
  readonly first: number;
118
184
  readonly last: number;
119
185
  }
186
+ /** The ordered native campaign, its generation/grading revisions, checksum and measured levels.
187
+ *
188
+ * @example
189
+ * ```ts
190
+ * import type { NatureChainCampaignManifest } from "@johnmorrisdotca/houseki/colour-chains";
191
+ * import { shizenCampaignManifest } from "@johnmorrisdotca/houseki/colour-chains";
192
+ *
193
+ * const value: NatureChainCampaignManifest = shizenCampaignManifest;
194
+ * console.log(value == null ? value : typeof value === "object" ? Object.keys(value).slice(0,6) : value);
195
+ * ```
196
+ */
120
197
  export interface NatureChainCampaignManifest extends Omit<ChainCampaignManifest, 'levels'> {
121
198
  readonly levels: readonly NatureChainCampaignLevel[];
122
199
  readonly bands?: readonly NatureCampaignBand[];
123
200
  }
201
+ /** One bilingual native lesson instruction and the corresponding action or tick step.
202
+ *
203
+ * @example
204
+ * ```ts
205
+ * import { tutorialManifest } from "@johnmorrisdotca/houseki/colour-chains";
206
+ * import type { ChainTutorialStep } from "@johnmorrisdotca/houseki/colour-chains";
207
+ *
208
+ * const lesson=tutorialManifest[0];
209
+ * const value: ChainTutorialStep = lesson.steps[0];
210
+ * console.log(value == null ? value : typeof value === "object" ? Object.keys(value).slice(0,6) : value);
211
+ * ```
212
+ */
124
213
  export interface ChainTutorialStep {
125
214
  readonly instruction: LocalizedText;
126
215
  readonly action: string;
127
216
  }
217
+ /** One bilingual native lesson with its authored setup, teaching steps and winning witness.
218
+ *
219
+ * @example
220
+ * ```ts
221
+ * import { tutorialManifest } from "@johnmorrisdotca/houseki/colour-chains";
222
+ * import type { ChainTutorialDefinition } from "@johnmorrisdotca/houseki/colour-chains";
223
+ *
224
+ * const lesson=tutorialManifest[0];
225
+ * const value: ChainTutorialDefinition = lesson;
226
+ * console.log(value == null ? value : typeof value === "object" ? Object.keys(value).slice(0,6) : value);
227
+ * ```
228
+ */
128
229
  export interface ChainTutorialDefinition {
129
230
  readonly id: string;
130
231
  readonly title: LocalizedText;
@@ -138,6 +239,17 @@ export interface ChainTutorialDefinition {
138
239
  readonly steps: readonly ChainTutorialStep[];
139
240
  readonly tags: readonly string[];
140
241
  }
242
+ /** The stored native Colour Chains campaign, lessons and optional Shizen/Arashi campaigns.
243
+ *
244
+ * @example
245
+ * ```ts
246
+ * import type { ChainContentData } from "@johnmorrisdotca/houseki/colour-chains";
247
+ * import { campaignManifest, tutorialManifest } from "@johnmorrisdotca/houseki/colour-chains";
248
+ *
249
+ * const value: ChainContentData = {campaign:campaignManifest,tutorials:tutorialManifest};
250
+ * console.log(value == null ? value : typeof value === "object" ? Object.keys(value).slice(0,6) : value);
251
+ * ```
252
+ */
141
253
  export interface ChainContentData {
142
254
  readonly campaign: ChainCampaignManifest;
143
255
  readonly tutorials: readonly ChainTutorialDefinition[];