-
Notifications
You must be signed in to change notification settings - Fork 49
How to write a hack
Sean LeBlanc edited this page Jan 26, 2020
·
4 revisions
- clone the repo
- run
npm install
(link for if you don't have node/npm) - write your hack in
./src/
- run
npm run build
- your hack should now be in
./dist/
!
-
import bitsy from "bitsy";
can be used in your hack to create an alias to the global scope under the namebitsy
-
the last code block in the format
export var hackOptions = {
...
};
will be shifted to the top of the built file's function body. If your hack has configurable options, it's best to make them properties of hackOptions
so that users can easily find + edit them without having to know how the internals work
- the last
/** */
comment block will be parsed as a jsdoc to generate the readme. the format is
/**
<emoji>
@file <filename (without ".js")>
@summary <short description listed in readme>
@description
<full description>
*/
I recommend also including @license
, @version
, and @author
for general info, and @requires
for indicating what version of bitsy the hack is for
- the last
/* */
comment block will be shifted to the top of the built file (i.e. you should use//
for comments outside of the jsdoc header)