diff --git a/.npmignore b/.npmignore index 148d8ce..c2a2506 100644 --- a/.npmignore +++ b/.npmignore @@ -1,4 +1,10 @@ -webpack.config.js +src/ +test-harness/ +.husky/ +.github/ +vite.config.ts tsconfig.json -.eslintrc.js -.gitignore \ No newline at end of file +eslint.config.mjs +commitlint.config.mjs +.prettierrc* +.prettierignore diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..1818bac --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,23 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +## [2.0.0] - 2026-03-26 + +Initial public release. + +### Added + +- `Backgammon` component — the main board component accepting a `BoardState` prop +- `direction` prop (`"clockwise"` | `"anticlockwise"`) to control which way the player moves (#8) +- Bar component to display hit checkers (#6) +- Dice display via `dice` prop — supports one or two dice values (#1) +- Doubling cube display via `doublingCube` prop with owner and value (#1) +- Pip counter in the sidebar (#1) +- `preset` prop with 7 built-in themes: `default`, `felt`, `coral`, `forest`, `rose`, `arctic`, `sand` (#10) +- `theme` prop for fully custom theming via a `Theme` object +- `positions` prop to render checker positions on the board +- SVG-based rendering for crisp display at any size +- Full TypeScript types exported (`BoardState`, `Theme`, `Position`, `DoublingCube`, `DieValue`, `Direction`, `PlayerType`) +- ESM and UMD builds with type declarations +- Peer dependency support for React 17, 18, and 19 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..710deef --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Laszlo Heves + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 556ed5c..d09c479 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,10 @@ A React component library for rendering a backgammon board. Displays positions, dice, and the doubling cube as a scalable SVG. Fully typed with TypeScript. +![](./backgammon-board-react.png) + +Use the online editor:
https://backgammonist.github.io/backgammon-board-react/ + ## Installation ```bash diff --git a/backgammon-board-react.png b/backgammon-board-react.png new file mode 100644 index 0000000..3d87895 Binary files /dev/null and b/backgammon-board-react.png differ diff --git a/package.json b/package.json index e0b1019..59fc06d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "backgammon-board-react", - "version": "1.0.0", + "version": "2.0.0", "description": "Simplistic backgammon board in react", "type": "module", "files": [ @@ -20,7 +20,8 @@ "build": "vite build", "lint": "eslint .", "format": "prettier --write --ignore-unknown .", - "prepare": "husky", + "prepare": "husky || true", + "prepublishOnly": "npm run build", "commitlint": "commitlint --edit $1" }, "repository": {