Skip to content

Commit

Permalink
Update dependancies (#3)
Browse files Browse the repository at this point in the history
* updated dependanciess

* new config settings

* linting issues

* version number

* linting

* make rollup handle all building

* banner work around
  • Loading branch information
azinasili authored Nov 4, 2018
1 parent beda368 commit e573680
Show file tree
Hide file tree
Showing 8 changed files with 3,837 additions and 4,179 deletions.
8 changes: 6 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
{
"comments": false,
"presets": [
["env", { "modules": false }]
"@babel/preset-env"
],
"plugins": [
"@babel/plugin-transform-object-assign"
],
"env": {
"test": {
"presets": [
["env"]
["@babel/preset-env"]
]
}
}
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: node_js
node_js:
- "node"
- "node"
cache:
directories:
- node_modules
Expand Down
7,924 changes: 3,790 additions & 4,134 deletions package-lock.json

Large diffs are not rendered by default.

33 changes: 17 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "a11ytrap",
"version": "1.0.1",
"version": "1.0.2",
"description": "A proper accessible focus management for components.",
"homepage": "https://github.com/azinasili/a11ytrap",
"author": "Azin Asili <[email protected]> (azinasili.com)",
Expand Down Expand Up @@ -36,22 +36,23 @@
"build": "src/**/*.js"
},
"devDependencies": {
"babel-core": "^6.26.0",
"babel-jest": "^22.4.3",
"babel-plugin-external-helpers": "^6.22.0",
"babel-plugin-transform-object-assign": "^6.22.0",
"babel-preset-env": "^1.6.1",
"eslint": "^4.19.1",
"eslint-config-airbnb-base": "^12.1.0",
"eslint-plugin-import": "^2.10.0",
"jest": "^22.4.3",
"npm-watch": "^0.3.0",
"rollup": "^0.57.1",
"rollup-plugin-babel": "^3.0.3",
"rollup-plugin-eslint": "^4.0.0",
"rollup-plugin-uglify": "^3.0.0"
"@babel/core": "^7.1.2",
"@babel/plugin-transform-object-assign": "^7.0.0",
"@babel/preset-env": "^7.1.0",
"babel-jest": "^23.6.0",
"eslint": "^5.8.0",
"eslint-config-airbnb-base": "^13.1.0",
"eslint-plugin-import": "^2.14.0",
"jest": "^23.6.0",
"npm-watch": "^0.4.0",
"rollup": "^0.67.0",
"rollup-plugin-babel": "^4.0.3",
"rollup-plugin-eslint": "^5.0.0",
"rollup-plugin-license": "^0.7.0",
"rollup-plugin-uglify-es": "0.0.1"
},
"directories": {
"test": "tests"
}
},
"browserslist": "> 0.25%, not dead"
}
36 changes: 18 additions & 18 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import eslint from 'rollup-plugin-eslint';
import { eslint } from 'rollup-plugin-eslint';
import babel from 'rollup-plugin-babel';
import uglify from 'rollup-plugin-uglify';
import uglify from 'rollup-plugin-uglify-es';
import license from 'rollup-plugin-license';
import pkg from './package.json';

const banner = `/*!
Expand All @@ -13,29 +14,28 @@ const banner = `/*!
export default {
input: 'src/a11ytrap.js',
output: [
{ banner, file: pkg.main, format: 'umd', name: 'A11yTrap' },
{ banner, file: pkg.module, format: 'es' },
{
banner,
file: pkg.main,
format: 'umd',
name: 'A11yTrap',
},
{
banner,
file: pkg.module,
format: 'es',
},
],
plugins: [
eslint({
include: '{src,tests}/**/*.js',
throwOnError: true,
throwOnWarning: true,
}),
babel({
plugins: [
'external-helpers',
'transform-object-assign',
],
}),
uglify({
output: {
comments: '/^!/',
},
compress: {
drop_console: true,
pure_funcs: 'warn',
},
babel(),
uglify(),
license({
banner,
}),
],
};
7 changes: 3 additions & 4 deletions src/a11ytrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,9 @@ const defaults = {

export default class A11yTrap {
constructor(target, options = {}) {
const container =
(target === document || target === document.body)
? target
: document.querySelector(target);
const container = (target === document || target === document.body)
? target
: document.querySelector(target);

this.settings = Object.assign({}, defaults, options);
this.elements = [...container.querySelectorAll(focusableElements)];
Expand Down
3 changes: 1 addition & 2 deletions src/utils/bindKeyPress.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import trapKey from './trapKey';
* @param {Event} event - Get current target of event
*/
export default function bindKeyPress(event) {
const arrowKeys =
this.settings.enableArrowKeys
const arrowKeys = this.settings.enableArrowKeys
&& (event.which === 37
|| event.which === 38
|| event.which === 39
Expand Down
3 changes: 1 addition & 2 deletions src/utils/trapKey.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
export default function trapKeys(event) {
event.preventDefault();

const arrowKeys =
this.settings.enableArrowKeys
const arrowKeys = this.settings.enableArrowKeys
&& (event.which === 37 || event.which === 38);

if (event.shiftKey || arrowKeys) {
Expand Down

0 comments on commit e573680

Please sign in to comment.