@slugbugblue/trax 1.0.1 → 1.1.1

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 DELETED
@@ -1,233 +0,0 @@
1
- # @slugbugblue/trax
2
-
3
- ## 1.0.1 - 2026-02-20
4
-
5
- - Add references for ambient typescript definitions
6
-
7
- ## 1.0.0 - 2025-11-04
8
-
9
- v1 release:
10
-
11
- - Update dev dependencies to latest versions
12
- - Fix xo complaints
13
- - No other code changes
14
-
15
- ## 0.23.0 - 2023-03-28
16
-
17
- Release candidate
18
-
19
- Finalize work with jsdoc/typescript
20
-
21
- ## 0.22.0 - 2023-03-25
22
-
23
- - Pull point.js into its own package: `@slugbugblue/point`
24
- - Pull lru.js into its own package: `@slugbugblue/lru`
25
- - Pull puzzles.js into its own package: `@slugbugblue/trax-puzzles`
26
- - Pull tty.js into its own package: `@slugbugblue/trax-tty`
27
- - Pull analyst.js into its own package: `@slugbugblue/trax-analyst`
28
- - Pull cli.js into its own package: `@slugbugblue/trax-cli`
29
-
30
- ## 0.21.0 - 2023-03-12
31
-
32
- - Update the analysis engine to be more lazy
33
- - The LRU cache is more likely to have a hit because it no longer separates
34
- validated from unvalidated analyses
35
- - Suggestions are much faster because it now skips validations for low-scoring
36
- moves
37
- - You will now need to call `validateThreats()` to remove faulty threats
38
- manually
39
-
40
- ## 0.20.0 - 2023-02-11
41
-
42
- - Provide timing feedback on the puzzlebot's actions
43
- - Add license information for puzzle sources
44
- - Add gitlab CI configuration
45
- - Drop support for node 14; node v16.15 is our minimum supported version
46
- - More puzzles from Martin M. S. Pedersen -- bringing the total to 100+
47
- - Enhance the docker configuration and document it in the README
48
- - Refine faulty threat detection and add test for one case it was failing
49
-
50
- ## 0.19.0 - 2023-02-06
51
-
52
- - Added a simple LRU cache to increase the efficiency of the analysis engine
53
-
54
- ## 0.18.0 - 2023-02-05
55
-
56
- - Analysis improvements:
57
- - Add `count.b(level)` and `count.w(level)` methods to an analysis to quickly
58
- count the number of threats at a given level
59
- - Remove faulty threats from an analysis
60
- - Add additional threats for more puzzle solving mojo
61
-
62
- - Development environment enhancements:
63
- - Added an initial benchmarking framework with puzzle benchmarks so far
64
- - Added husky pre-commit hook to ensure npm test is run before a commit
65
-
66
- - CLI improvements:
67
- - Puzzle information is now stored as notes, to make it searchable
68
-
69
- - More puzzles:
70
- - Martin M. S. Pedersen contributed eleven new puzzles
71
-
72
- ## 0.17.0 - 2022-12-29
73
-
74
- - The `import` CLI command now loads comments from a .trx file
75
-
76
- ## 0.16.0 - 2022-12-27
77
-
78
- - Added a `notes` command to the CLI to add comments to a game
79
- - all comments are included in the output generated by the `export` command
80
- - the latest comment can be used as a text filter by the `list` command
81
- - the latest comment is displayed by the `view` and `list` commands
82
-
83
- - Minor analysis improvements
84
-
85
- ## 0.15.0 - 2022-12-14
86
-
87
- - Added shared `puzzles` commands to the CLI:
88
- - `trax ls puzzles`: see all the puzzles
89
- - `trax new puzzle`: start a new puzzle
90
-
91
- - Puzzle improvements:
92
- - Adjust puzzle category levels for harder puzzles
93
- - Add multiple hints when the puzzle can be solved multiple ways
94
-
95
- - Analysis improvements:
96
- - Analysis suggestions now "solve" all tough puzzles
97
- - Reworked threats to be more precise
98
- - Reworked scoring to add more nuance
99
-
100
- ## 0.14.0 - 2022-12-05
101
-
102
- - Added `puzzles` to the CLI:
103
- - `trax puzzles ls`: see all the puzzles
104
- - `trax puzzle new`: start a new puzzle
105
-
106
- - Analysis tests now include correctly suggesting the first move for solving all
107
- tutorial and easy puzzles. As the threats database improves, we will add more
108
- puzzles to the tests.
109
-
110
- ## 0.13.0 - 2022-11-25
111
-
112
- - Add move suggestions to `analyst.js` for CLI and bot use
113
- - use `suggest(trax)` to get a suggestion for the current position
114
- - added the `suggest` CLI command for quick access to a random suggestion
115
-
116
- - Use font glyphs for text bubbles in `tty.js` only if one of the following
117
- environment variables are defined and non-empty:
118
- - `NERDFONT`, `POWERLINE`, `P9K_TTY`, `P9K_SSH`
119
-
120
- - Begin work on documenting the javascript files using jsdoc, with the initial
121
- focus on types so typescript-powered autocomplete can be more useful
122
-
123
- ## 0.12.0 - 2022-10-28
124
-
125
- - `point.in()` now accepts any two opposing corners to define the bounding box
126
- - Fleshing out testing and debugging of `analyst.js`
127
-
128
- ## 0.11.0 - 2022-09-22
129
-
130
- - Breaking change: Refactor `play()` and `playMove()` into a single function
131
- `play()`. `playMove()` is no longer available.
132
- - Add a new function `playMoves()` to submit multiple moves at once
133
- - Initial work on `analyst.js`, with documentation and a start on tests
134
- - use `analyze(trax)` to perform an analysis
135
- - added the `analyze` CLI command to see an analysis
136
-
137
- ## 0.10.1 - 0.10.2 - 2022-06-12
138
-
139
- - Added an entry point for the `Point` class at `@slugbugblue/trax/point`
140
-
141
- ## 0.10.0 - 2022-06-12
142
-
143
- - Added `point.in(topLeft, bottomRight)` to see if a point is inside a
144
- rectangular bounded area
145
- - Minor coding style changes due to updated `xo` rules
146
-
147
- ## 0.9.0 - 2022-04-24
148
-
149
- - Added tab-completion and completion preview code to the interactive CLI
150
- - Restructured the CLI by moving most commands to their own file
151
- - Changed the `view` CLI command to optionally examine previous moves
152
-
153
- ## 0.8.0 - 2022-04-08
154
-
155
- - Breaking change: `playMove()` now takes the _next_ move number instead of the
156
- _last_ move number. It makes more sense to say "move number 1 is @0/" than to
157
- say "the move following move number 0 is @0/".
158
- - Added variant name info to the engine as `Trax.name[rules]` as well as
159
- `trax.name`
160
- - Restructured the repo to handle additional files, creating `src` and `hooks`
161
- folders
162
- - Added a command-line interface (CLI) `cli.js` which npm will install using the
163
- alias `trax`
164
- - The CLI usage is self-documenting; run `trax help` to get started
165
- - Initial commands available: `delete`, `export`, `help`, `import`, `list`,
166
- `new`, `play`, `select`, `try`, `undo`, `view`
167
-
168
- ## 0.7.0 - 2022-03-28
169
-
170
- - Fixed a bug when including extra characters in a starting notation
171
- - Added regression tests to detect/prevent this bug in the future
172
-
173
- ## 0.6.0 - 2022-02-13
174
-
175
- - Completed documentation for `engine.js` at [docs/engine.md](docs/engine.md)
176
- - `x` and `y` locations are now handled in a `Point` class
177
- - Renamed `tentativeIcon()` to `dropsIcon()`
178
-
179
- ## 0.5.0 - 2022-01-29
180
-
181
- This code base is now using [`xo`](https://github.com/xojs/xo) for style and
182
- [`ava`](https://github.com/avajs/ava) for testing. Should be no functional
183
- changes, but a lot of code was updated, including the names of all functions and
184
- variables from snake_case to camelCase.
185
-
186
- ## 0.4.0 - 2022-01-17
187
-
188
- - Testing coverage of `engine.js` is now at 100%
189
- - Testing revealed a few bugs, which are now fixed
190
- - The name and signature for provisional move handling, which was broken, has
191
- been changed. It is now called `provisional_moves()` and takes three
192
- arguments:
193
- - `from`: the normalized position code of the board before the move
194
- - `to`: the normalized position code of the board after the move
195
- - `via`: the move notation to go from `from` to `to`
196
-
197
- ## 0.3.1 - 2022-01-07
198
-
199
- - Make a faster implementation of `trax.possible_locations()`
200
- - Display updates for tentative moves
201
-
202
- ## 0.3.0 - 2021-12-29
203
-
204
- Display a tentative move on the screen
205
-
206
- - Add `trax.tentative_icon()` function
207
- - `tty.display()` now accepts a tentative move
208
-
209
- ## 0.2.0 - 2021-12-28
210
-
211
- Breaking changes:
212
-
213
- - Converted from CommonJS to ESM
214
- - `trax.normalized` now prepends turn information to the string
215
-
216
- More convenience:
217
-
218
- - `trax.color`: the color of the player whose turn it is
219
- - `Trax.color_of[num]`: go from player number to color
220
- - `Trax.player_num[color]`: or from color to player number
221
- - `Trax.other[color]`: easily switch from 'w' to 'b' and back
222
-
223
- ## 0.1.0 - 2021-12-26
224
-
225
- Initial release:
226
-
227
- - engine.js
228
- - create a new Trax game with `trax = new Trax()`
229
- - play one move at a time with `trax.play('@0/')`
230
- - ... etc
231
-
232
- - tty.js
233
- - display a game with `tty.display(trax)`
package/CONTRIBUTING.md DELETED
@@ -1,113 +0,0 @@
1
- # Contributing to slugbugblue/trax
2
-
3
- Hi, thanks for considering contributing to this project.
4
-
5
- If this is your first time working on an open source project, it is recommended
6
- that you start by reading [How to Contribute to Open Source][howto].
7
-
8
- ## Ways to contribute
9
-
10
- ### Improve documentation
11
-
12
- One of the simplest ways to get started contributing is to find areas of the
13
- documentation that are unclear, incorrect, or that have typos or other errors,
14
- and providing feedback and corrections. You don't have to know how to code or
15
- even how to use git.
16
-
17
- ### Identify bugs
18
-
19
- If you are aware of something not working as you think it should, feel free to
20
- open a new issue to let us know. Browsing through the existing open issues and
21
- adding comments or making clarifications can also be a great way to get started.
22
-
23
- ### Fixing bugs
24
-
25
- If you feel you have a solution to an existing bug, you are welcome to code up
26
- your solution and submit a merge request. It may take some time to get fully up
27
- to speed with our coding styles and with the structure of the code, so don't
28
- feel bad if your merge request receives comments rather than being immediately
29
- accepted. Simply make any necessary changes, and update the merge request, or
30
- let us know in a subsequent comment if you think we are misunderstanding the
31
- merge request.
32
-
33
- ## Submitting an issue
34
-
35
- If you choose to submit an issue, please take the time to ensure that you
36
- provide as much detail as possible about the issue. A poorly worded or poorly
37
- researched issue report will unnecessarily delay the issue resolution.
38
-
39
- Even if you don't have the time or expertise to fully diagnose the problem, a
40
- good issue report can be very helpful to us as we seek to improve the code.
41
-
42
- ## Submitting a merge request
43
-
44
- Good merge requests are a fantastic way to contribute to this project. Your
45
- merge request is going to be accepted more quickly if it is easy to understand.
46
- Ideally it should be focused on a single item and avoid unrelated commits.
47
-
48
- Please ask first before embarking on a major change, such as adding a new
49
- feature or refactoring the code, otherwise you risk spending a significant
50
- amount of time working on something that will not be merged into the project.
51
-
52
- If you have never submitted a merge request before, no fear. Here is a [quick
53
- tutorial][howto-mr] on how to create one.
54
-
55
- ### Merge request steps
56
-
57
- - Fork the project and clone it to your own workspace.
58
- - Get the latest changes and update the project dependencies:
59
-
60
- ```bash
61
- $ git checkout develop
62
- $ git pull upstream develop
63
- $ rm -rf node_modules
64
- $ npm install
65
- ```
66
-
67
- - Create a new branch to contain your changes:
68
-
69
- ```bash
70
- $ git checkout -b <new-branch-name>
71
- ```
72
-
73
- - Make your changes.
74
- - Test your changes.
75
-
76
- ```bash
77
- $ npm test
78
- ```
79
-
80
- - Push your changes back to your fork.
81
-
82
- ```bash
83
- $ git push -u origin <new-branch-name>
84
- ```
85
-
86
- 1. Open a merge request in the [slugbugblue/trax][trax-repo] repo.
87
-
88
- ## Working with the code
89
-
90
- This repository uses [XO][xo] for linting and [Prettier][prettier] for
91
- formatting. Running `npm test` will produce an error if your changes do not
92
- conform. You should consider installing the [XO plugin][xo-plugin] for your
93
- editor to have the linting errors highlighted for you and automatically fixed on
94
- save. You can also run `npx xo --fix` from the command line to fix most linting
95
- errors.
96
-
97
- This repository uses [AVA][ava] for writing and running tests. While we want as
98
- much code coverage as possible for all code, we have a minimum requirement of
99
- 95% of code coverage for the [analysis engine][analyst] and 100% for the [main
100
- trax engine][engine]. You should be able to get a quick grasp on the testing
101
- process by simply examining a few of the test files in the [test
102
- directory][test].
103
-
104
- [analyst]: src/analyst.js
105
- [ava]: https://github.com/avajs/ava
106
- [engine]: src/engine.js
107
- [howto]: https://opensource.guide/how-to-contribute/
108
- [howto-mr]: https://opensource.guide/how-to-contribute/#opening-a-pull-request
109
- [prettier]: https://prettier.io
110
- [test]: test/
111
- [trax-repo]: https://gitlab.com/slugbugblue/trax
112
- [xo]: https://github.com/sidresorhus/xo
113
- [xo-plugin]: https://github.com/sidresorhus/xo#editor-plugins