-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #248 from aichaos/async-await
Async/Await
- Loading branch information
Showing
59 changed files
with
10,937 additions
and
6,056 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"presets": [ | ||
["env", { | ||
"targets": { | ||
"browsers": ["last 2 versions"], | ||
"node": "6" | ||
} | ||
}] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
lib/ | ||
lib.es6/ | ||
dist/ | ||
node_modules/ | ||
.idea/ | ||
test.babel/ | ||
|
||
#OS X | ||
.DS_Store | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
language: node_js | ||
node_js: | ||
- "node" | ||
- "8" | ||
- "7" | ||
- "6" | ||
- "5" | ||
- "4" | ||
- "0.12" | ||
- "iojs" | ||
before_install: | ||
- npm install -g grunt-cli coffee-script | ||
script: grunt test | ||
- npm install -g babel-cli webpack uglify-js nodeunit | ||
script: npm run test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,21 +18,16 @@ $ git clone [email protected]:your-username/rivescript-js.git | |
Make sure you have `node` and `npm` and set up the build dependencies: | ||
|
||
```bash | ||
$ npm install -g grunt-cli # If you don't already have it | ||
$ npm install # Install dev dependencies | ||
``` | ||
# CLI dependencies if you don't have them already | ||
$ npm install -g babel-cli webpack uglify-js nodeunit | ||
|
||
Make your code changes in `rivescript.js` and test them either by using the | ||
TCP example server in `node/tcp-server.js` or by using the built-in web server | ||
by running `grunt connect:server`. | ||
# Install dev dependencies for rivescript-js | ||
$ npm install | ||
``` | ||
|
||
Make sure the unit tests still pass (`grunt test`), and add new unit tests if | ||
Make sure the unit tests still pass (`npm run test`), and add new unit tests if | ||
necessary for your change. | ||
|
||
Run JS linting with `grunt lint` and fix any issues that occur. | ||
|
||
When finished, run `grunt` to create the minified JS file. | ||
|
||
Push to your fork and [submit a pull request](https://github.com/aichaos/rivescript-js/compare/). | ||
|
||
At this point you're waiting on me. I'm usually pretty quick to comment on pull | ||
|
@@ -46,50 +41,50 @@ Some things that will increase the chance that your pull request is accepted: | |
|
||
# Code Documentation Style | ||
|
||
For this project I've adopted a JavaDoc-style documentation system for the CoffeeScript source code. Look at existing function documentation for examples, but briefly: | ||
For this project I've adopted a JavaDoc-style documentation system in the source | ||
code. Look at existing function documentation for examples, but briefly: | ||
|
||
* Begin the comment block with two comment characters: `##` | ||
* Each line of the comment block should begin with a `#` symbol. | ||
* Begin the comment block like: `/**` | ||
* Do NOT use a `*` as a prefix for each line. | ||
* The comment block should begin with the function definition prototype (use Java style data types to denote what each parameter should be) | ||
* Use a blank line between the function prototype and the description. | ||
* Use [Markdown syntax](http://daringfireball.net/projects/markdown/syntax) - the documentation is generated as Markdown files and then rendered to HTML. | ||
* End the comment block with another pair of `##` symbols. | ||
* End the comment block with a `*/` sequence. | ||
* There should be no more comments touching the comment block (if you need a comment directly after the comment block, leave a blank line in between, or else that comment may end up becoming a part of the documentation!) | ||
|
||
Examples: | ||
|
||
```coffeescript | ||
## | ||
# string processTags (string user, string msg, string reply, string[] stars, | ||
# string[] botstars, int step, scope) | ||
# | ||
# Process tags in a reply element. | ||
## | ||
processTags: (user, msg, reply, st, bst, step, scope) -> | ||
|
||
```javascript | ||
/** | ||
string processTags (string user, string msg, string reply, string[] stars, | ||
string[] botstars, int step, scope) | ||
Process tags in a reply element. | ||
*/ | ||
processTags: (user, msg, reply, st, bst, step, scope) => {} | ||
... | ||
## | ||
# int loadFile (string path || array path[, onSuccess[, onError]]) | ||
# | ||
# Load a RiveScript document from a file. The path can either be a string that | ||
# contains the path to a single file, or an array of paths to load multiple | ||
# files. `onSuccess` is a function to be called when the file(s) have been | ||
# successfully loaded. `onError` is for catching any errors, such as syntax | ||
# errors. | ||
# | ||
# This loading method is asynchronous. You should define an `onSuccess` | ||
# handler to be called when the file(s) have been successfully loaded. | ||
# | ||
# This method returns a "batch number" for this load attempt. The first call | ||
# to this function will have the batch number of 0 and that will go up from | ||
# there. This batch number is passed to your `onSuccess` handler as its only | ||
# argument, in case you want to correlate it with your call to `loadFile()`. | ||
# | ||
# `onSuccess` receives: int batchNumber | ||
# `onError` receives: string errorMessage[, int batchNumber] | ||
## | ||
loadFile: (path, onSuccess, onError) -> | ||
|
||
/** | ||
int loadFile (string path || array path[, onSuccess[, onError]]) | ||
Load a RiveScript document from a file. The path can either be a string that | ||
contains the path to a single file, or an array of paths to load multiple | ||
files. `onSuccess` is a function to be called when the file(s) have been | ||
successfully loaded. `onError` is for catching any errors, such as syntax | ||
errors. | ||
This loading method is asynchronous. You should define an `onSuccess` | ||
handler to be called when the file(s) have been successfully loaded. | ||
This method returns a "batch number" for this load attempt. The first call | ||
to this function will have the batch number of 0 and that will go up from | ||
there. This batch number is passed to your `onSuccess` handler as its only | ||
argument, in case you want to correlate it with your call to `loadFile()`. | ||
`onSuccess` receives: int batchNumber | ||
`onError` receives: string errorMessage[, int batchNumber] | ||
*/ | ||
loadFile: (path, onSuccess, onError) => {} | ||
``` | ||
|
||
To compile the documentation, you'll need Python and the `markdown` module installed. If you can't do this, don't worry too much about it; the project maintainer will rebuild the documentation periodically. Quick start: | ||
|
Oops, something went wrong.