@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 +49 -1
- package/CONTRIBUTING.md +65 -20
- package/README.md +810 -146
- package/dist/computerTurn.d.ts +1 -0
- package/dist/computerTurn.js +1 -0
- package/dist/export.d.ts +87 -0
- package/dist/export.js +158 -0
- package/dist/grid.d.ts +4 -1
- package/dist/grid.js +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/kumimoji.types.d.ts +2 -0
- package/dist/partyKept.d.ts +1 -0
- package/dist/partyKept.js +1 -0
- package/dist/partySeats.d.ts +2 -0
- package/dist/partySeats.js +2 -0
- package/dist/placement.d.ts +1 -0
- package/dist/play.d.ts +7 -0
- package/dist/play.js +1 -1
- package/dist/random.d.ts +1 -0
- package/dist/random.js +1 -0
- package/dist/react.d.ts +4 -1
- package/dist/react.js +4 -4
- package/dist/showcase.d.ts +4 -0
- package/dist/showcase.js +5 -1
- package/dist/strings.d.ts +62 -0
- package/dist/strings.js +96 -0
- package/dist/tableView.d.ts +1 -0
- package/dist/tableView.js +1 -0
- package/dist/tileFace.d.ts +4 -0
- package/dist/tileFace.js +2 -0
- package/dist/tileWords.d.ts +2 -0
- package/dist/tileWords.js +2 -0
- package/dist/ui/board.d.ts +6 -0
- package/dist/ui/mount.d.ts +32 -2
- package/dist/ui/mount.js +157 -26
- package/dist/ui/style.d.ts +5 -4
- package/dist/ui/style.js +23 -15
- package/dist/ui.d.ts +1 -0
- package/dist/ui.js +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.js +2 -0
- package/package.json +102 -32
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
|
|
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
|
|
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)
|
|
9
|
-
what you expected and what happened. A
|
|
10
|
-
|
|
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
|
|
16
|
+
git clone https://github.com/johnmorrisdotca/kumimoji
|
|
16
17
|
cd kumimoji
|
|
17
18
|
pnpm install
|
|
18
|
-
pnpm
|
|
19
|
-
pnpm
|
|
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
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
-
|
|
29
|
-
|
|
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
|
|
34
|
-
|
|
35
|
-
`
|
|
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
|
|
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).
|