Skip to content

Commit

Permalink
feat(ability): uses CSP build of sift.js
Browse files Browse the repository at this point in the history
Fixes #234 BREAKING CHANGES
  • Loading branch information
stalniy committed Dec 9, 2019
1 parent fe9ade5 commit f238813
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 56 deletions.
37 changes: 0 additions & 37 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"lint-staged": "^9.0.0",
"rollup": "^1.1.2",
"rollup-plugin-babel": "^4.3.2",
"rollup-plugin-commonjs": "^10.0.0",
"rollup-plugin-node-resolve": "^5.0.0",
"rollup-plugin-uglify": "^6.0.2",
"semantic-release": "15.9.17",
Expand Down
6 changes: 3 additions & 3 deletions packages/casl-ability/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions packages/casl-ability/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
"access": "public"
},
"scripts": {
"build.es": "rollup -c ../../tools/rollup.es.js -e sift",
"build.umd": "rollup -c ../../tools/rollup.umd.js -e sift -n casl -g sift:sift",
"build.es5m": "rollup -c ../../tools/rollup.es5m.js -e sift",
"build.es": "rollup -c ../../tools/rollup.es.js -e sift/sift.csp.min",
"build.umd": "rollup -c ../../tools/rollup.umd.js -e sift/sift.csp.min -n casl -g sift/sift.csp.min:sift",
"build.es5m": "rollup -c ../../tools/rollup.es5m.js -e sift/sift.csp.min",
"build.extra.es": "rollup -c ../../tools/rollup.es.js -i src/extra.js -o dist/es6/extra.js",
"build.extra.es5m": "rollup -c ../../tools/rollup.es5m.js -i src/extra.js -o dist/es5m/extra.js",
"build.extra.umd": "rollup -c ../../tools/rollup.umd.js -i src/extra.js -o dist/umd/extra.js -n casl.extra",
Expand All @@ -42,6 +42,6 @@
"npm": "^6.0.0"
},
"dependencies": {
"sift": "^9.0.0"
"sift": "^9.0.1"
}
}
2 changes: 1 addition & 1 deletion packages/casl-ability/src/rule.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import sift from 'sift';
import sift from 'sift/sift.csp.min';
import { wrapArray } from './utils';

const REGEXP_SPECIAL_CHARS = /[-/\\^$+?.()|[\]{}]/g;
Expand Down
5 changes: 4 additions & 1 deletion tools/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@ module.exports = {
},
setupFilesAfterEnv: [
`${__dirname}/spec_helper.js`
]
],
globals: {
window: {}
}
};
6 changes: 2 additions & 4 deletions tools/rollup.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ export default {
format: 'es'
},
plugins: [
babel({ rootMode: 'upward' }),
resolve({
jsnext: true,
main: true,
browser: true,
mainFields: ['jsnext', 'main', 'browser'],
}),
babel({ rootMode: 'upward' }),
]
};
6 changes: 1 addition & 5 deletions tools/rollup.umd.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import babel from 'rollup-plugin-babel';
import { uglify } from 'rollup-plugin-uglify';
import commonjs from 'rollup-plugin-commonjs';
import resolve from 'rollup-plugin-node-resolve';

export default {
Expand All @@ -11,12 +10,9 @@ export default {
},
plugins: [
resolve({
jsnext: true,
main: true,
browser: true
mainFields: ['jsnext', 'main', 'browser'],
}),
babel({ rootMode: 'upward' }),
commonjs(),
].concat(
process.env.NODE_ENV === 'production' && !process.env.SKIP_MINIFY ? uglify() : []
)
Expand Down

0 comments on commit f238813

Please sign in to comment.