sr-puzzlegen
v1.0.4
Published
Generate WCA puzzle images
Downloads
214
Readme
PuzzleGen
PuzzleGen is a javascript library intended to render WCA puzzles. Colors can be customized, or scrambles can be applied to make references for solve guides or scramble previews. It's heavily inspired by visualcube and twistysim. My first go at this was porting visuacube to javascript here. But in order to get all the functionality desired, I had to completely rewrite from scratch.
PuzzleGen is built to be customizable, so if desired functionality can be extended to use cases other than embedding scramble previews in web pages.
Demonstration
Check out the library in action HERE
Docs
See the docs for more information
Examples
Here are some examples of what the library is capable of.
Installation
> npm install sr-puzzlegen
Usage
For full usage demonsration see here
Development
Requirements
- Node.js - v16.14.0 but other versions may work
Tools Used
- nvm
- TypeScript - v4.1.3
- WebPack - 5.15.0
Install dependencies
> npm install
Run development demos. This will automatically start a web server and open a browser to the index. For more info see Demos
> npm run dev
Run tests cases (Yes we have some tests!)
> npm t
Build library. This will save build assets to dist/
> npm run build # build the bundled library with webpack to /dist/bundle
> tsc # build unbundled library to /dist/lib
Publish to registry
- update version in
package.json
- build bundle
npm run build
and build librarytsc
- run npm publish command
> npm publish