Skip to content

Commit

Permalink
Added build instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
pwstegman committed Dec 6, 2018
1 parent a99416f commit 098993a
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ Documentation can be found at [https://bci.js.org](https://bci.js.org) or by vie

More examples can be found in the [examples](https://github.com/pwstegman/bcijs/tree/master/examples) directory

## Building

See [dev.md](dev.md) for info on how to modify and build bci.js

## Reference

If you use bci.js in a published work, please reference this paper
Expand Down
40 changes: 40 additions & 0 deletions dev.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
## Building bci.js

BCI.js methods are contained within the [lib](lib) directory. To keep the project organized, methods are separated into four folders:
- `compat` Deprecated methods which remain for compatibility purposes
- `data` Methods which pertain to data management (CSV files, partition data, etc.)
- `math` Methods used to process data (CSP, LDA, ICA, etc.)
- `network` Networking methods (OSC)

If a method is Node.js exclusive and won't run in the browser, placing

```html
<p>This method is exclusive to Node.js</p>
```

below the method description in the documentation comment will exclude the method from the browser-only build.

To create a new method, create a file in the appropriate folder, and make sure the file name matches the method name. When bci.js builds, it searches for new files within the [lib](lib) folders and adds them automatically.

Looking at [index.js](index.js), you'll see each method of bci.js points to the appropriate file in [lib](lib). As such, making a change to an already existing method will not require rebuilding the index.js. However, adding a new method or renaming a method will require a rebuild.

To rebuild [index.js](index.js), run

```bash
npm run build
```

This will also rebuild [browser.js](browser.js), which is index.js, but with the node-only methods removed. That way it can be used with webpack or browserify.

To rebuild the [dist](dist) files for use in the browser, run

```bash
npm run dist
```

To rebuild the [docs](docs), run

```bash
npm run docs
```

0 comments on commit 098993a

Please sign in to comment.