@johnmorrisdotca/kumimoji 1.0.1 → 1.1.0

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 CHANGED
@@ -6,6 +6,53 @@ All notable changes to this project are written down here. The format follows
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [1.1.0] - 2026-09-30
10
+
11
+ Nothing that was exported has changed, a seed deals the bag it always dealt,
12
+ and the word lists and how they load are as they were.
13
+
14
+ ### Added
15
+
16
+ - **Export and import.** `kumimojiToJSON` writes a game alone as versioned
17
+ JSON (`"format": 1`): how it was set up, its seed and where the player has
18
+ got to. `kumimojiFromJSON` reads it back by dealing the bag again from the
19
+ seed and checking every tile held against it, so nothing in a file is
20
+ trusted. `kumimojiToText` is a game as plain text and `gridToText` a
21
+ crossword as it lies. `kumimojiExported`, `kumimojiClock`,
22
+ `KUMIMOJI_EXPORT_FORMAT`, `KumimojiSaved` and `KumimojiExported` with them.
23
+ - **The table's words in English and Japanese**, in one table,
24
+ `KUMIMOJI_STRINGS`, listed side by side in `docs/strings-ja.md`.
25
+ `mountKumimoji` takes `locale` and `strings`, follows the page's `lang`, and
26
+ its handle has `setLocale`. `kumimojiStrings`, `kumimojiSay`,
27
+ `KumimojiStrings` and `KumimojiLocale`. The Japanese has not yet been
28
+ reviewed by a native reader.
29
+ - **Saving and loading on the table**: save as JSON or as text, and load a
30
+ saved game back with its clock going on. `keep: false` leaves it off; the
31
+ handle has `saved` and `setGame`, and the table takes `onChange`.
32
+ - **Theming.** `--km-radius` and `--km-font` beside the colours, and
33
+ `mountKumimoji` takes a `theme`.
34
+ - `KUMIMOJI_VERSION`.
35
+ - A doc comment on every export, held by a test.
36
+ - The README says near its top, and in a section of its own, what each word
37
+ list is, where it came from and under what terms: SCOWL's permissive
38
+ licence, and CC BY-SA 4.0, attribution and share-alike, for the list derived
39
+ from JMdict.
40
+ - The demo in the family's look, in English and Japanese, a game kept on the
41
+ device between visits.
42
+ - Checks: the package packed by npm, installed in an empty project, every
43
+ entry imported and required, both lists read and their notices found in the
44
+ tarball, on Linux, macOS and Windows; every example in the README run; the
45
+ table tapped in Chromium and WebKit; and the table built and played in
46
+ React, Vue, Svelte, Angular and a plain page.
47
+
48
+ ### Changed
49
+
50
+ - A square and a tile on the table are 44px, from 36px, and every button is
51
+ at least 44px: a fingertip. `--km-square` sets another size.
52
+ - `package.json` has `main`, `module` and `types` beside `exports`, for tools
53
+ that read those.
54
+ - `--km-apart`, which nothing used, is no longer defined.
55
+
9
56
  ## [1.0.1] - 2026-09-30
10
57
 
11
58
  ### Fixed
@@ -47,7 +94,8 @@ The first release.
47
94
  `@johnmorrisdotca/kumimoji/react`.
48
95
  - A static demo for GitHub Pages.
49
96
 
50
- [Unreleased]: https://github.com/johnmorrisdotca/kumimoji/compare/v1.0.1...HEAD
97
+ [Unreleased]: https://github.com/johnmorrisdotca/kumimoji/compare/v1.1.0...HEAD
98
+ [1.1.0]: https://github.com/johnmorrisdotca/kumimoji/releases/tag/v1.1.0
51
99
  [1.0.1]: https://github.com/johnmorrisdotca/kumimoji/releases/tag/v1.0.1
52
100
  [1.0.0]: https://github.com/johnmorrisdotca/kumimoji/releases/tag/v1.0.0
53
101
  [0.1.0]: https://github.com/johnmorrisdotca/kumimoji/commits/v1.0.0
package/CONTRIBUTING.md CHANGED
@@ -1,38 +1,83 @@
1
1
  # Contributing to Kumimoji
2
2
 
3
- Thank you for wanting to help. Bug reports, rule questions and pull requests are
4
- all welcome.
3
+ Thank you for helping. Bug reports, rule questions, corrections to the
4
+ Japanese and pull requests are all welcome.
5
5
 
6
6
  ## Reporting a bug
7
7
 
8
- Open an [issue](https://github.com/johnmorrisdotca/kumimoji/issues) with what you did,
9
- what you expected and what happened. A game's seed makes almost any bug
10
- reproducible: include it, and the moves if you have them.
8
+ Open an [issue](https://github.com/johnmorrisdotca/kumimoji/issues/new?template=report-a-bug.md)
9
+ with what you did, what you expected and what happened. A seed deals the same
10
+ bag every time, so the table's *Save as JSON* file, or the seed with the
11
+ language, hand and level, makes almost any bug reproducible.
11
12
 
12
13
  ## Making a change
13
14
 
14
15
  ```sh
15
- git clone https://github.com/johnmorrisdotca/kumimoji.git
16
+ git clone https://github.com/johnmorrisdotca/kumimoji
16
17
  cd kumimoji
17
18
  pnpm install
18
- pnpm run check # lint, types and tests, as CI runs them
19
- pnpm run site # build the demo into site/ and open site/index.html
19
+ pnpm check # lint, types and tests: the same as CI
20
+ pnpm test:table # the demo in real browsers: builds it, then taps it
21
+ pnpm test:package # npm pack, install the tarball, import and require every entry, read both lists
22
+ pnpm test:frameworks # the README's examples built in React, Vue, Svelte, Angular and a plain page
23
+ pnpm site # builds the demo into ./site
24
+ pnpm dlx serve site # or any static server
20
25
  ```
21
26
 
22
- - The rules are pure functions over plain values: a function returns a new
23
- game and never changes the one it was given. Keep it that way.
24
- - Anything random is drawn from the game's own seeded random, so a game always
25
- replays from its seed. Never call `Math.random` inside the rules.
26
- - Add or change a test beside the code you change (`*.test.ts`).
27
- - Note the change under **Unreleased** in [CHANGELOG.md](CHANGELOG.md).
28
- - Keep pull requests to one change each, with a message that says what a player
29
- or a developer would notice.
27
+ - **The rules are pure.** Everything outside `src/ui` and `src/react.tsx` is
28
+ plain functions over plain data, with no DOM and no dependency. A function
29
+ returns a new game and never changes the one it was given.
30
+ - **Never break a seed.** Anything random is drawn from the game's own seeded
31
+ random, never from `Math.random`, and a seed must deal the bag it always
32
+ dealt, because people race them. `scripts/check-package.mjs` pins two.
33
+ - **Nothing read is trusted.** A game read back (`kumimojiFromJSON`,
34
+ `decodeTileProgress`, `decodeParty`) is checked against its own bag.
35
+ - **The word lists are other people's, and their notices travel with them.**
36
+ `src/words.en.data.ts` is made from SCOWL and `src/words.ja.data.ts` from
37
+ JMdict; neither is edited by hand, each opens with its notice, and
38
+ `NOTICE.md` has both in full. JMdict's list is under CC BY-SA 4.0:
39
+ share-alike. A change that adds a list, swaps one, or drops a notice is not
40
+ a small change: open an issue first. A new list comes from a real
41
+ dictionary of its language, with a licence that lets its words be shipped,
42
+ and its terms go in `NOTICE.md` and the README in the same change.
43
+ - **How the lists load is not to be changed lightly.** They are fetched by a
44
+ dynamic import behind `typeof window`, so that a page's server code never
45
+ carries them; Itsutsu relies on it.
46
+ - **Test what you change.** Tests sit beside their source as `*.test.ts`.
47
+ - **The table is tested by tapping it.** `table/*.table.mjs` are Playwright
48
+ tests that open the built demo in Chromium and WebKit, at a phone's width by
49
+ touch and at a desktop's by mouse, and do what a person does. After every
50
+ flow they check that nothing is wider than the screen, nothing to tap is
51
+ under 44px, and the page complained of nothing. The first time,
52
+ `pnpm exec playwright install chromium webkit` fetches the browsers.
53
+ - **Words go in `src/strings.ts`**, in English and Japanese, then
54
+ `pnpm docs:make` to bring `docs/strings-ja.md` up to date. Japanese is plain
55
+ and polite, and uses the words players use: タイル, 手札, 袋, ワイルド.
56
+ - **Examples in the README are run.** `src/docs.test.js` runs every
57
+ TypeScript example and checks each value it states (a line ending
58
+ `// → value`); `scripts/check-frameworks.mjs` takes the React, Vue, Svelte,
59
+ Angular and plain-page examples from the README as they are written, builds
60
+ each from the packed tarball and lays a tile.
61
+ - **Every export gets a doc comment**, which a test holds, and the README's
62
+ tables (options, theming, limits) are checked against the code.
63
+ - **The demo wears the family's look.** `demo/family.css` is the same file in
64
+ every sibling package's demo, and a test fails if it differs from its
65
+ recorded hash. What is Kumimoji's own goes in `demo/kumimoji.css`.
66
+ - **No dependencies.** The package has none at run time and should stay so.
67
+ - **No name, art or wording of a published game.**
68
+ - One change per pull request, with a line in `CHANGELOG.md` under
69
+ *Unreleased*.
30
70
 
31
71
  ## Releasing
32
72
 
33
- Maintainers bump the version in `package.json`, move **Unreleased** in the
34
- changelog under the new version and date, tag `v<version>`, and publish with
35
- `pnpm publish --access public`.
73
+ Maintainers bump the version in `package.json` and `src/version.ts` and move
74
+ *Unreleased* to the new version in `CHANGELOG.md`, dated. Pushing the tag
75
+ `vX.Y.Z` runs the Release workflow, which checks that the tag matches
76
+ `package.json`, runs the checks, builds the package, installs and uses it as
77
+ npm packs it, attaches the tarball to a GitHub release, and publishes it to
78
+ npm with provenance, through npm's trusted publishing (no token is kept). A
79
+ version already on npm is not published again. The workflow can also be run
80
+ by hand.
36
81
 
37
- By contributing you agree that your work is released under the
82
+ By contributing you agree that your code is released under the
38
83
  [MIT licence](LICENSE), and to follow the [code of conduct](CODE_OF_CONDUCT.md).