Skip to content

Commit 2a69cf6

Browse files
author
Hans Scheuren
authored
chore(global): modernise Module
Modernised Module
2 parents a15f528 + c17b91d commit 2a69cf6

19 files changed

+3712
-639
lines changed

.babelrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"presets": [
3+
[
4+
"@babel/env",
5+
{
6+
"modules": false
7+
}
8+
]
9+
]
10+
}

.eslintrc.json

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
{
22
"extends": "google",
3-
3+
"parserOptions": {
4+
"ecmaVersion": 6,
5+
"sourceType": "module",
6+
"ecmaFeatures": {
7+
"modules": true,
8+
"experimentalObjectRestSpread": true
9+
}
10+
},
411
"rules": {
512
"no-var": "off",
6-
"indent": [
7-
"error",
8-
2
9-
],
10-
"linebreak-style": [
11-
"error",
12-
"unix"
13-
],
13+
"indent": ["error", 2],
14+
"linebreak-style": ["error", "unix"],
1415
"quotes": [
1516
"error",
16-
"double", {
17+
"double",
18+
{
1719
"avoidEscape": true
1820
}
1921
],
20-
"semi": [
21-
"error",
22-
"always"
23-
],
22+
"semi": ["error", "always"],
2423
"max-len": [
25-
"warn", {
24+
"warn",
25+
{
2626
"ignoreComments": true
2727
}
2828
],
2929
"prefer-spread": ["off"],
3030
"prefer-rest-params": ["off"],
31-
"camelcase" : ["off"]
31+
"camelcase": ["off"]
3232
}
3333
}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ tests/*.json
44
# editor and IDE remnants
55
*~
66
.idea/
7+
8+
# Bundled
9+
dist/

.npmignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
tests/tests.json
22
play.html
33
bower.json
4-
4+
src/
5+
.babelrc
6+
.editorconfig
7+
.eslintrc.json
8+
bower.json
9+
gulpfile.js
10+
rollup.config.js

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ npm install json-logic-js
2222

2323
Note that this project uses a [module loader](http://ricostacruz.com/cheatsheets/umdjs.html) that also makes it suitable for RequireJS projects.
2424

25-
If that doesn't suit you, and you want to manage updates yourself, the entire library is self-contained in `logic.js` and you can download it straight into your project as you see fit.
25+
If that doesn't suit you, and you want to manage updates yourself, the entire library is self-contained and you can download it straight into your project as you see fit.
2626

2727
```bash
28-
curl -O https://raw.githubusercontent.com/jwadhams/json-logic-js/master/logic.js
28+
curl -O https://unpkg.com/json-logic-js@1.2.2
2929
```
3030

3131
## Examples

bower.json

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,11 @@
22
"name": "json-logic-js",
33
"version": "1.2.2",
44
"homepage": "https://github.com/jwadhams/json-logic-js",
5-
"authors": [
6-
"Jeremy Wadhams <[email protected]>"
7-
],
5+
"authors": ["Jeremy Wadhams <[email protected]>"],
86
"description": "Serialize complex logic in JSON, run it in JavaScript",
9-
"main": "logic.js",
10-
"moduleType": [
11-
"globals"
12-
],
13-
"keywords": [
14-
"json",
15-
"logic"
16-
],
7+
"main": "dist/logic.js",
8+
"moduleType": ["globals"],
9+
"keywords": ["json", "logic"],
1710
"license": "MIT",
1811
"private": false,
1912
"ignore": [

gulpfile.js

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
var gulp = require("gulp");
22
var exec = require("child_process").exec;
33

4+
gulp.task("build", function(cb) {
5+
exec("npm run build", function(err, stdout, stderr) {
6+
console.log(stdout);
7+
console.log(stderr);
8+
cb(err);
9+
});
10+
});
11+
412
gulp.task("test", function(cb) {
5-
exec(
6-
"node testrunner.js",
7-
{cwd: "tests"},
8-
function(err, stdout, stderr) {
9-
console.log(stdout);
10-
console.log(stderr);
11-
cb(err);
12-
}
13-
);
13+
exec("node testrunner.js", {cwd: "tests"}, function(err, stdout, stderr) {
14+
console.log(stdout);
15+
console.log(stderr);
16+
cb(err);
17+
});
1418
});
1519

1620
gulp.task("default", function() {
21+
gulp.watch(["src/*.js"], ["build"]);
1722
gulp.watch(["**/*.js", "tests/tests.json"], ["test"]);
1823
});

0 commit comments

Comments
 (0)