Skip to content

Commit

Permalink
Merge pull request #125 from EOSIO/develop
Browse files Browse the repository at this point in the history
Release 4.0.0
  • Loading branch information
flux627 authored Feb 22, 2019
2 parents 32aa833 + ff84e5a commit b93a09a
Show file tree
Hide file tree
Showing 61 changed files with 25,776 additions and 1,144 deletions.
49 changes: 0 additions & 49 deletions .eslintrc.json

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ examples/**/package-lock.json

# Editor files
.idea/
.vscode/

dist/
23 changes: 14 additions & 9 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
src
tsconfig.json
tslint.json
dist/**/*.test.*
examples/
dist/testHelpers/
docs/
examples/
scripts/
src/
.eslintrc.json
.gitignore
.idea
yarn-error.log
.npmignore
.npmrc.template
.nvmrc
.travis.yml
.eslintrc.json
CONTRIBUTING.md
README.md
build-docs.sh
scripts/*
.npmrc.template
tsconfig.json
tslint.json
yarn.lock
yarn-error.log
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.9.4
10.15.1
57 changes: 35 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,42 @@
sudo: false
language: node_js
node_js:
- '10.0.0'
- '11.6.0'
before_install:
- npm i -g npm@6.4.1
- npm install -g typescript
- npm i -g npm@6.4.1
- npm install -g typescript
stages:
- test
- name: deploy
if: (NOT type IN (pull_request)) AND (branch = develop)
- test
- name: publish-edge
if: (NOT type IN (pull_request)) AND (branch = develop)
- name: publish-latest
# Travis assigns the tag to branch for some reason. This matches any valid semver version.
if: branch =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$
jobs:
include:
- stage: test
name: "Lint and Test"
script:
- npm run lint
- npm run test
- stage: deploy
name: "Deploy to NPM"
script:
- npm run build
deploy:
provider: script
skip_cleanup: true
script:
- ./scripts/publish.sh
on:
branch: develop
- stage: test
name: "Lint and Test"
script:
- npm run lint
- npm run test
- stage: publish-edge
name: "Publish @edge to NPM"
script:
- npm run build
deploy:
provider: script
skip_cleanup: true
script: ./scripts/publish-edge.sh
on:
branch: develop
- stage: publish-latest
name: "Publish @latest to NPM"
script:
- npm run build
deploy:
provider: script
skip_cleanup: true
script: ./scripts/publish-latest.sh
on:
all_branches: true
condition: $TRAVIS_TAG =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$
45 changes: 42 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ This library provides the following classes:

* [**`BaseActionWatcher`**](https://eosio.github.io/demux-js/classes/baseactionwatcher.html): Base class that implements a ready-to-use Action Watcher

* [**`ExpressActionWatcher`**](https://eosio.github.io/demux-js/classes/expressactionwatcher.html): Exposes the API methods from the BaseActionWatcher through an Express server

In order to process actions, we need the following things:

- An implementation of an `AbstractActionReader`
Expand All @@ -91,10 +93,47 @@ In order to process actions, we need the following things:

After we have these things, we need to:

- Instantiate the implemented `AbstractActionHandler`, passing in the `HandlerVersion` and any other needed configuration
- Instantiate the implemented `AbstractActionReader` with any needed configuration
- Instantiate a `BaseActionWatcher`, passing in the above Handler and Reader instances
- Call `watch()` on the Watcher
- Instantiate the implemented `AbstractActionHandler`, passing in the `HandlerVersion` and any other needed configuration
- Instantiate the `BaseActionWatcher` (or a subclass), passing in the Action Handler and Action Watcher instances
- Start indexing via the Action Watcher's `watch()` method (by either calling it directly or otherwise)


#### Example

```javascript
const { BaseActionWatcher, ExpressActionWatcher } = require("demux")
const { MyActionReader } = require("./MyActionReader")
const { MyActionHandler } = require("./MyActionHandler")
const { handlerVersions } = require("./handlerVersions")
const { readerConfig, handlerConfig, pollInterval, portNumber } = require("./config")

const actionReader = new MyActionReader(readerConfig)
const actioHandler = new MyActionHandler(handlerVersions, handlerConfig)
```
Then, either
```javascript
const watcher = new BaseActionWatcher(
actionReader,
actionHandler,
pollInterval,
)

watcher.watch()
```
Or,
```javascript
const expressWatcher = new ExpressActionWatcher(
actionReader,
actionHandler,
pollInterval,
portNumber,
)

expressWatcher.listen()

// You can then make a POST request to `/start` on your configured endpoint
```

### [**API documentation**](https://eosio.github.io/demux-js/)

Expand Down
2 changes: 1 addition & 1 deletion docs/assets/js/search.js

Large diffs are not rendered by default.

Loading

0 comments on commit b93a09a

Please sign in to comment.