@slugbugblue/trax-cli 0.11.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/.dockerignore ADDED
@@ -0,0 +1,7 @@
1
+ .dockerignore
2
+ .git*
3
+ .husky
4
+ .npmignore
5
+ Dockerfile
6
+ jsconfig.json
7
+ node_modules
package/.rgignore ADDED
@@ -0,0 +1,2 @@
1
+ node_modules
2
+ package-lock.json
package/CHANGELOG.md ADDED
@@ -0,0 +1,80 @@
1
+ # @slugbugblue/trax
2
+
3
+ ## 0.11.0 - 2023-03-25
4
+
5
+ - Pull CLI from `@slugbugblue/trax` into its own repository
6
+
7
+ ## 0.10.0 - 2023-02-11
8
+
9
+ - Provide timing feedback on the puzzlebot's actions
10
+ - Add license information for puzzle sources
11
+ - Drop support for node 14; node v16.15 is our minimum supported version
12
+ - More puzzles from Martin M. S. Pedersen -- bringing the total to 100+
13
+ - Enhance the docker configuration and document it in the README
14
+
15
+ ## 0.9.0 - 2023-02-05
16
+
17
+ - CLI improvements:
18
+
19
+ - Puzzle information is now stored as notes, to make it searchable
20
+
21
+ - More puzzles:
22
+
23
+ - Martin M. S. Pedersen contributed eleven new puzzles
24
+
25
+ ## 0.8.0 - 2022-12-29
26
+
27
+ - The `import` CLI command now loads comments from a .trx file
28
+
29
+ ## 0.7.0 - 2022-12-27
30
+
31
+ - Added a `notes` command to the CLI to add comments to a game
32
+
33
+ - all comments are included in the output generated by the `export` command
34
+ - the latest comment can be used as a text filter by the `list` command
35
+ - the latest comment is displayed by the `view` and `list` commands
36
+
37
+ ## 0.6.0 - 2022-12-14
38
+
39
+ - Added shared `puzzles` commands to the CLI:
40
+
41
+ - `trax ls puzzles`: see all the puzzles
42
+ - `trax new puzzle`: start a new puzzle
43
+
44
+ ## 0.5.0 - 2022-12-05
45
+
46
+ - Added `puzzles` to the CLI:
47
+
48
+ - `trax puzzles ls`: see all the puzzles
49
+ - `trax puzzle new`: start a new puzzle
50
+
51
+ ## 0.4.0 - 2022-11-25
52
+
53
+ - Utilize the newly added move suggestions from `trax-analyst` to the CLI
54
+
55
+ - added the `suggest` CLI command for quick access to a random suggestion
56
+
57
+ - Use font glyphs for text bubbles in `tty.js` only if one of the following
58
+ environment variables are defined and non-empty:
59
+
60
+ - `NERDFONT`, `POWERLINE`, `P9K_TTY`, `P9K_SSH`
61
+
62
+ ## 0.3.0 - 2022-09-22
63
+
64
+ - Added the initial work on `trax-analyst`
65
+
66
+ - added the `analyze` CLI command to see an analysis
67
+
68
+ ## 0.2.0 - 2022-04-24
69
+
70
+ - Added tab-completion and completion preview code to the interactive CLI
71
+ - Restructured the CLI by moving most commands to their own file
72
+ - Changed the `view` CLI command to optionally examine previous moves
73
+
74
+ ## 0.1.0 - 2022-04-08
75
+
76
+ - Added a command-line interface (CLI) `cli.js` which npm will install using the
77
+ alias `trax`
78
+ - The CLI usage is self-documenting; run `trax help` to get started
79
+ - Initial commands available: `delete`, `export`, `help`, `import`, `list`,
80
+ `new`, `play`, `select`, `try`, `undo`, `view`
@@ -0,0 +1,102 @@
1
+ # Contributing to slugbugblue/trax-cli
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
+ - Open a merge request in the [slugbugblue/trax-cli][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
+ [howto]: https://opensource.guide/how-to-contribute/
98
+ [howto-mr]: https://opensource.guide/how-to-contribute/#opening-a-pull-request
99
+ [prettier]: https://prettier.io
100
+ [repo]: https://gitlab.com/slugbugblue/trax-cli
101
+ [xo]: https://github.com/sidresorhus/xo
102
+ [xo-plugin]: https://github.com/sidresorhus/xo#editor-plugins
package/Dockerfile ADDED
@@ -0,0 +1,14 @@
1
+ # Use the latest nodejs long-term-support release,
2
+ # on the latest Alpine Linux for its small footprint
3
+ FROM node:lts-alpine
4
+ # Install current source code
5
+ WORKDIR /trax
6
+ COPY . .
7
+ RUN npm install
8
+ # Ensure the data files can be persisted
9
+ WORKDIR /mnt/data
10
+ ENV XDG_CONFIG_HOME=/mnt/data
11
+ ENV XDG_DATA_HOME=/mnt/data
12
+ VOLUME /mnt/data
13
+ # Use the trax CLI as the starting point
14
+ ENTRYPOINT ["/trax/src/cli.js"]
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright © 2021-2023 Chad Transtrum
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,193 @@
1
+ # Trax Command Line interface
2
+
3
+ This project provides a command-line for working with Trax games and puzzles.
4
+
5
+ ## Description
6
+
7
+ Trax is a two-player boardless board game invented by David Smith. For more
8
+ information about Trax, including its [rules][traxrules] and
9
+ [history][traxhistory], see the official website at [traxgame.com][traxgame].
10
+
11
+ The goal of this javascript project is to allow Trax to be played from the
12
+ command line.
13
+
14
+ ## Installation
15
+
16
+ Installation can be done in one of two ways, each for a slightly different
17
+ purpose.
18
+
19
+ If you have nodejs installed on your system, you can use the trax CLI by
20
+ installing it globally via `npm`:
21
+
22
+ ```bash
23
+ npm install -g @slugbugblue/trax-cli
24
+ ```
25
+
26
+ If you don't have node installed and want to use the CLI as a docker container:
27
+
28
+ ```bash
29
+ git clone https://gitlab.com/slugbugblue/trax-cli.git ~/trax
30
+ docker build -t trax ~/trax
31
+ ```
32
+
33
+ ## CLI Usage
34
+
35
+ The command-line interface is provided as `trax`, available in your path if
36
+ installed globally, or in the `node_modules/.bin` directory and runnable using
37
+ `npx trax` if installed locally.
38
+
39
+ > If you installed by creating a Docker image, use the following command to
40
+ > launch the CLI:
41
+ >
42
+ > - `docker run --name trax -itv $HOME/trax:/mnt/data --rm trax`
43
+ >
44
+ > Since that's a bit much to type, it's recommended to create an alias in one of
45
+ > your startup scripts:
46
+ >
47
+ > - `alias trax="docker run --name trax -itv $HOME/trax:/mnt/data --rm trax"`
48
+ >
49
+ > Then you can launch the docker container simply by typing in `trax`, the same
50
+ > as if it were installed globally.
51
+
52
+ The CLI can be used interactively by running the command with no parameters or
53
+ by passing the `--interactive` or `-i` flag. When run interactively, you can
54
+ avoid worries about the need to escape certain characters from the shell, and it
55
+ can be easier to run multiple commands back to back.
56
+
57
+ Help is available for the CLI through the use of the `help` command. Type
58
+ `trax help` (or `npx trax help` with a local installation, or simply `help` if
59
+ run interactively) to see a list of the available commands, and `trax help play`
60
+ to see information about the `play` command. Aliases and abbreviations are
61
+ provided to minimize typing and to try to avoid the requirement of memorizing
62
+ the commands. For example, the `list` command has an alias of `ls`, `help` can
63
+ be shortened to `?`, and the `select` command can be activated using `#`.
64
+
65
+ When you first launch the CLI, you can create a new game using the `new`
66
+ command, and then enter moves for that game using `play`. Since `play` is likely
67
+ to be the most common command used, you can simply omit the command name. For
68
+ example, at the interactive prompt, entering `@0/` is the same as if you had
69
+ entered `play 1. @0/`.
70
+
71
+ Multiple games can be started at once, and the CLI will remember the currently
72
+ active game and apply future actions to that game. Each game will retain its
73
+ `#id` number until it is deleted, and you can use that number to switch between
74
+ games. For example, to make game \#1 active, enter `select 1` or `select #1` or
75
+ simply `#1` at the interactive prompt.
76
+
77
+ For ease of working at the command line, the symbols used as the last character
78
+ of the Trax notation can optionally be replaced with letters. Use `s` for slash
79
+ symbol (`/`), `b` for backslash (`\`), and `p` for plus (`+`). While there is no
80
+ need to escape at the interactive prompt, these substitutions will be avilable
81
+ there as well.
82
+
83
+ ### Examples
84
+
85
+ ```text
86
+ # Start a new Trax game with Chad playing as white
87
+ > trax new Chad vs
88
+
89
+ # Start a new Loop Trax game with Chad playing as black
90
+ > trax new loop vs Chad
91
+
92
+ # Start a new 8x8 Trax game with Chad as white and Another Player as black
93
+ > trax new 8x8 Chad vs Another Player
94
+
95
+ # Switch back to the first game. Note the quoting required at the command line.
96
+ # This would not be necessary when running at the interactive prompt.
97
+ > trax '#1'
98
+
99
+ # Play two moves, using full notation
100
+ > trax play 1. @0/ 2. A0/
101
+
102
+ # Two more moves, using short notation and symbol substitution
103
+ # B2/ => b2s and A0\ => a0b
104
+ > trax b2s a0b
105
+
106
+ # See the status of all games
107
+ > trax ls
108
+ ```
109
+
110
+ ### Environment variables
111
+
112
+ The CLI uses standard Windows and Linux [XDG][xdg] file locations as provided by
113
+ the [env-paths library][env-path], with current uses being user-specific
114
+ `config` (`XDG_CONFIG_HOME`) and `data` (`XDG_DATA_HOME`) folders.
115
+
116
+ In addition, the CLI recognizes several environment variables to determine the
117
+ glyphs to use in the user interface. Setting either `NERDFONT` or `NERDFONTS` to
118
+ any non-empty string will use characters from [Nerdfonts][nerdfont]. Otherwise,
119
+ any of `POWERLINE`, `P9K_TTY`, or `P9K_SSH` will use characters from [Powerline
120
+ fonts][powerline].
121
+
122
+ ## Support
123
+
124
+ This project is built by [Chad Transtrum][ctrans] as part of the work on
125
+ [slugbugblue.com][sbb]. Issues can be opened on the [gitlab project page][repo].
126
+
127
+ ## Contributing
128
+
129
+ [Contributions are welcome][contributing]. Ideally in the form of pull requests,
130
+ but feel free to open an issue with a bug report or a suggestion as well.
131
+
132
+ ## Acknowledgments
133
+
134
+ Many thanks to the late David Smith for coming up with the idea of Trax and for
135
+ his generosity in allowing me to add the game to [GoldToken.com][goldtoken].
136
+
137
+ Thanks to his widow Colleen Foley-Smith for extending that courtesy to allow me
138
+ to include Trax on [slugbugblue.com][sbb] as well.
139
+
140
+ I would also like to express my huge heartfelt appreciation to the magnanimous
141
+ [Donald G. Bailey][dgb], who, through his excellent book [Trax Strategy for
142
+ Beginners][traxbook], taught me the basics (and more!) of Trax. I found him
143
+ always ready to share his insights on the mechanics of the game, as well as
144
+ various approaches to encoding its complexities. His undeserved kindness and
145
+ infinite patience in indulging my many questions can never be repaid.
146
+
147
+ Thanks to [Martin M. S. Pedersen][traxplayer] for contributing ideas, code, and
148
+ puzzles. He's been [curating Trax puzzles][puzzlebook] and [coding solutions for
149
+ Trax][gnutrax] for over two decades, and has a lot of expertise in this area.
150
+
151
+ ## License
152
+
153
+ Copyright 2019-2023 Chad Transtrum
154
+
155
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
156
+ the files in this project except in compliance with the License. You may obtain
157
+ a copy of the License at
158
+
159
+ http://www.apache.org/licenses/LICENSE-2.0
160
+
161
+ Unless required by applicable law or agreed to in writing, software distributed
162
+ under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
163
+ CONDITIONS OF ANY KIND, either express or implied. See the License for the
164
+ specific language governing permissions and limitations under the License.
165
+
166
+ ## Trax rules copyright
167
+
168
+ In the United States, game mechanics are not eligible for copyright protection;
169
+ however, the specific wording of game rules does fall under copyright law.
170
+
171
+ The official rules for Trax are found at http://traxgame.com/about_rules.php.
172
+
173
+ As Trax is a proprietary game, these rules are the intellectual property of
174
+ David Smith and heirs, and are not to be used without permission.
175
+
176
+ [contributing]: CONTRIBUTING.md
177
+ [ctrans]: mailto:chad@transtrum.net
178
+ [dgb]: mailto:donald@traxgame.com
179
+ [env-path]: https://www.npmjs.com/package/env-paths
180
+ [gnutrax]: https://gnutrax.com
181
+ [goldtoken]: https://goldtoken.com/
182
+ [nerdfont]: https://nerdfonts.com/
183
+ [powerline]: https://github.com/powerline/fonts
184
+ [puzzlebook]: https://gnutrax.com/book
185
+ [repo]: https://gitlab.com/slugbugblue/trax-cli
186
+ [sbb]: https://slugbugblue.com/
187
+ [traxbook]: http://traxgame.com/shop_book.php
188
+ [traxgame]: http://traxgame.com/
189
+ [traxhistory]: http://www.traxgame.com/about_history.php
190
+ [traxplayer]: mailto:traxplayer@gmail.com
191
+ [traxrules]: http://www.traxgame.com/about_rules.php
192
+ [xdg]:
193
+ https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
package/package.json ADDED
@@ -0,0 +1,71 @@
1
+ {
2
+ "name": "@slugbugblue/trax-cli",
3
+ "version": "0.11.0",
4
+ "description": "Trax command line interface",
5
+ "keywords": [
6
+ "trax",
7
+ "traxgame",
8
+ "cli",
9
+ "command line interface"
10
+ ],
11
+ "homepage": "https://gitlab.com/slugbugblue/trax-cli",
12
+ "bugs": "https://gitlab.com/slugbugblue/trax-cli/issues",
13
+ "license": "Apache-2.0",
14
+ "author": "Chad Transtrum <chad@transtrum.net>",
15
+ "types": "./src/types.d.ts",
16
+ "exports": {
17
+ ".": "./src/cli.js",
18
+ "./utils": "./src/utils.js",
19
+ "./version": "./src/version.js",
20
+ "./version.js": "./src/version.js"
21
+ },
22
+ "repository": "gitlab:slugbugblue/trax-cli",
23
+ "bin": {
24
+ "trax": "./src/cli.js"
25
+ },
26
+ "scripts": {
27
+ "genversion": "genversion --es6 src/version.js",
28
+ "git-add": "git add src/version.js benchmark/benchmarks.json",
29
+ "test": "xo",
30
+ "prepare": "husky install",
31
+ "preversion": "npm test",
32
+ "version": "npm run genversion ; npm run git-add",
33
+ "postversion": "git push && git push --tags && npm publish"
34
+ },
35
+ "dependencies": {
36
+ "@slugbugblue/trax": "^0.21.0",
37
+ "@slugbugblue/trax-analyst": "^0.11.0",
38
+ "@slugbugblue/trax-puzzles": "^0.5.0",
39
+ "@slugbugblue/trax-tty": "^1.0.0",
40
+ "env-paths": "^3.0.0",
41
+ "make-dir": "^3.1.0",
42
+ "yaml": "^2.0.0-11"
43
+ },
44
+ "devDependencies": {
45
+ "genversion": "^3.0.2",
46
+ "husky": "^8.0.3",
47
+ "prettier": "^2.6.1",
48
+ "xo": "0.*"
49
+ },
50
+ "type": "module",
51
+ "engines": {
52
+ "node": ">=16.15.0"
53
+ },
54
+ "prettier": {
55
+ "bracketSpacing": true,
56
+ "proseWrap": "always",
57
+ "semi": false,
58
+ "singleQuote": true,
59
+ "trailingComma": "all",
60
+ "useTabs": false
61
+ },
62
+ "xo": {
63
+ "prettier": true,
64
+ "rules": {
65
+ "curly": [
66
+ "error",
67
+ "multi-line"
68
+ ]
69
+ }
70
+ }
71
+ }