Skip to content

Commit

Permalink
Merge pull request #211 from steemit/change/use-a-js-file-for-methods
Browse files Browse the repository at this point in the history
Remove usage of JSON files in steem-js
  • Loading branch information
bonustrack authored Jul 17, 2017
2 parents 5077121 + d52e539 commit 53f503e
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 24 deletions.
17 changes: 0 additions & 17 deletions examples/webpack-example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,6 @@
This is a demo of `steem-js` and webpack usage targetting both the Web and
Node.js platforms.

## Minimal configuration
`steem-js` requires JSON files internally, so you need JSON loader configured:
```json
{
...
module: {
loaders: [
{ test: /\.json$/, loader: 'json-loader'},
]
}
...
}
```

Make sure `resolve.extensions` and `json-loader`'s `module.loaders[...].exclude`
do not exclude `.json` files or `node_modules` from resolving.

## Compiling the example
Compiling for the web (`bundle.js`, which you can test with `open index.html`):
```
Expand Down
2 changes: 1 addition & 1 deletion examples/webpack-example/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = {
},
module: {
loaders: [
{ test: /\.json$/, loader: 'json-loader'},
// { test: /\.json$/, loader: 'json-loader'},
]
},
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "steem",
"version": "0.6.0",
"version": "0.6.1",
"description": "Steem.js the JavaScript API for Steem blockchain",
"main": "lib/index.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions src/api/methods.json → src/api/methods.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[
module.exports = [
{
"api": "database_api",
"method": "set_subscribe_callback",
Expand Down Expand Up @@ -492,4 +492,4 @@
"method": "get_market_history_buckets",
"params": []
}
]
];
2 changes: 1 addition & 1 deletion src/broadcast/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import newDebug from 'debug';

import broadcastHelpers from './helpers';
import formatterFactory from '../formatter';
import operations from './operations.json';
import operations from './operations';
import steemApi from '../api';
import steemAuth from '../auth';
import { camelCase } from '../utils';
Expand Down
4 changes: 2 additions & 2 deletions src/broadcast/operations.json → src/broadcast/operations.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[
module.exports = [
{
"roles": ["posting"],
"operation": "vote",
Expand Down Expand Up @@ -493,4 +493,4 @@
"memo"
]
}
]
];

0 comments on commit 53f503e

Please sign in to comment.