Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernised Module #56

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"presets": [
[
"@babel/env",
{
"modules": false
}
]
]
}
32 changes: 16 additions & 16 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
{
"extends": "google",

"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"modules": true,
"experimentalObjectRestSpread": true
}
},
"rules": {
"no-var": "off",
"indent": [
"error",
2
],
"linebreak-style": [
"error",
"unix"
],
"indent": ["error", 2],
"linebreak-style": ["error", "unix"],
"quotes": [
"error",
"double", {
"double",
{
"avoidEscape": true
}
],
"semi": [
"error",
"always"
],
"semi": ["error", "always"],
"max-len": [
"warn", {
"warn",
{
"ignoreComments": true
}
],
"prefer-spread": ["off"],
"prefer-rest-params": ["off"],
"camelcase" : ["off"]
"camelcase": ["off"]
}
}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ tests/*.json
# editor and IDE remnants
*~
.idea/

# Bundled
dist/
8 changes: 7 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
tests/tests.json
play.html
bower.json

src/
.babelrc
.editorconfig
.eslintrc.json
bower.json
gulpfile.js
rollup.config.js
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ npm install json-logic-js

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

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.
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.

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

## Examples
Expand Down
15 changes: 4 additions & 11 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,11 @@
"name": "json-logic-js",
"version": "1.2.2",
"homepage": "https://github.com/jwadhams/json-logic-js",
"authors": [
"Jeremy Wadhams <[email protected]>"
],
"authors": ["Jeremy Wadhams <[email protected]>"],
"description": "Serialize complex logic in JSON, run it in JavaScript",
"main": "logic.js",
"moduleType": [
"globals"
],
"keywords": [
"json",
"logic"
],
"main": "dist/logic.js",
"moduleType": ["globals"],
"keywords": ["json", "logic"],
"license": "MIT",
"private": false,
"ignore": [
Expand Down
23 changes: 14 additions & 9 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
var gulp = require("gulp");
var exec = require("child_process").exec;

gulp.task("build", function(cb) {
exec("npm run build", function(err, stdout, stderr) {
console.log(stdout);
console.log(stderr);
cb(err);
});
});

gulp.task("test", function(cb) {
exec(
"node testrunner.js",
{cwd: "tests"},
function(err, stdout, stderr) {
console.log(stdout);
console.log(stderr);
cb(err);
}
);
exec("node testrunner.js", {cwd: "tests"}, function(err, stdout, stderr) {
console.log(stdout);
console.log(stderr);
cb(err);
});
});

gulp.task("default", function() {
gulp.watch(["src/*.js"], ["build"]);
gulp.watch(["**/*.js", "tests/tests.json"], ["test"]);
});
Loading