Repository navigation
Expand the unreleased changelog entry - #19
Merged
Merged
Conversation
Group the entry into behaviour changes, fixes, changes and development, and spell out what consumers of the element will notice: the stricter input validation inherited from fen-chess-board 4 (with the version 3 behaviour each case replaces), the same-square move fix, the raised browser baseline from Vite 8, the shipped sourcemap and package.json export. The readme Methods section now states the square and piece validation too. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ChaqSMq3tG8bvWgpJBmdGC
|
Preview for cf2ba14: https://659f1d53.chess-board-4mh.pages.dev Branch alias (always the latest push): https://claude-repo-modernize-harden.chess-board-4mh.pages.dev |
laat
marked this pull request as ready for review
September 5, 2026 19:24
laat
added a commit
that referenced
this pull request
Sep 5, 2026
## Summary
The package is one TypeScript file with one ESM import; nothing in it
needs a bundler. Since 2.0.0 the published `dist/chess-board.js` has
nevertheless been a Vite library bundle with `fen-chess-board` inlined
and identifiers mangled. This PR publishes what `tsc` emits instead.
- `pnpm build` is now `tsc -p tsconfig.build.json`. Output: readable
ES2022 `dist/chess-board.js`, `chess-board.d.ts`, plus `.js.map` and
`.d.ts.map`. `src/chess-board.ts` ships in the package (tests excluded)
so both maps resolve and go-to-definition lands in the TypeScript
source.
- `fen-chess-board` moves from a bundled devDependency to `dependencies`
(`^4.0.0`). Consumers' lockfiles now pin and audit it like any other
dependency.
- `vite.config.ts` loses `build.lib`; Vite only serves/builds the demo
site and runs the tests.
- Readme gets a "Without a bundler" section showing a self-hosted import
map for the dependency. No CDN is recommended.
- Changelog: new **Breaking** section for this change; the
browser-support bullet now describes ES2022 as written (roughly
Chrome/Edge 94, Firefox 93, Safari 15.4) rather than Vite's down-level
target.
## What breaks
Loading `dist/chess-board.js` directly from a `<script type="module">`
tag with no bundler and no import map stops working, because the file
now contains `import FENBoard from "fen-chess-board"`. Bundlers are
unaffected, and buildless pages work again with an import map pointing
`fen-chess-board` at a self-hosted copy. The demo site goes through Vite
and is unaffected.
## Verification
- `pnpm typecheck`, `pnpm test` (27 passing), `pnpm build`, `pnpm
build:pages` green; `pnpm install --frozen-lockfile` passes with the
updated lockfile.
- Packed the tarball and installed it into a scratch project with npm:
`fen-chess-board` is pulled in as a dependency, `import "chess-board"`
resolves through `exports`, and under happy-dom the element renders the
start position and reports `piece("e1") === "K"`.
- Tarball contents: `dist/` (4 files), `src/chess-board.ts`, `license`,
`package.json`, `readme.md`. No test files, no `packageManager` field.
## Suggested version: 3.0.0
This supersedes the 2.1.0 recommendation from #19. The bare `<script>`
tag case is a real, if niche, way people used the 2.x file, and it
breaks; under semver that is a major. It also gives a clean line for the
stricter input validation and the ES2022 baseline already listed in the
Unreleased entry, so all of the "you may notice this" changes land in
one major instead of being argued into a minor. Rename the `Unreleased`
heading to `3.0.0 / <date>` when tagging.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01ChaqSMq3tG8bvWgpJBmdGC
---------
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Unreleased entry written in #16 and #17 listed what changed in the repository but not what a user of
<chess-board>will notice. This rewrites it into four groups and fills the gaps.Behaviour changes for users of the element (new section)
fen-chess-board@4, with the version 3 behaviour each case replaces, verified by running both versions side by side:fen = ...throws on more than eight ranks, a rank longer than eight squares, or the digits0/9; the board is left unchanged. v3 silently truncated or dropped such input.piece(),put(),clear(),move()throwInvalid squareoutsidea1–h8. v3 crashed with aTypeErroror corrupted the board.put()throwsInvalid piecefor anything that is not a single non-FEN-syntax character. v3 accepted"QQ"and produced unparseable FEN.move(square, square)is now a no-op instead of clearing the piece.console.warnand keep the current position (already listed, moved here).baseline-widely-availablebrowsers (roughly Chrome/Edge 107, Firefox 104, Safari 16) and usesObject.hasOwn; 2.0 targeted Chrome 87 / Firefox 78 / Safari 14.Fixed / Changed: the double-registration guard, dropped test declarations, SVG template caching,
border-spacingreplacing deprecated attributes, plus the previously unlisted shipped sourcemap,./package.jsonexport and derivedRanktype.Development: toolchain, stricter tsconfig, pnpm policies (and the removed
esbuildallow-list), test coverage, CI hardening, zizmor, Dependabot scope and why the library's deps are excluded, staged release flow, preview deploys, backfilled 2.0.2/2.0.3 entries.The readme Methods section now states the square and piece validation in one sentence, since it documents the API these rules apply to.
Suggested version: 2.1.0
TypeError. Under semver that is a bug fix, not a breaking change, although anyone feeding untrusted FEN to thefensetter without atry/catchwill now see exceptions instead of garbage../package.jsonexport, double-import safety), which is what makes this a minor rather than a patch.Recommendation: release as 2.1.0. Rename the
Unreleasedheading to2.1.0 / <date>when tagging.🤖 Generated with Claude Code
https://claude.ai/code/session_01ChaqSMq3tG8bvWgpJBmdGC
Generated by Claude Code