Skip to content

Commit

Permalink
exposed module version as a static prop, introduced eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
Shintaro Tanaka committed Mar 13, 2017
1 parent bf97b9f commit 4c8f4de
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 4 deletions.
12 changes: 12 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"env": {
"browser": true,
"es6": true
},
"extends": "eslint:recommended",
"parserOptions": {
"sourceType": "module"
},
"rules": {
}
}
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ language: java # This is npm project but selecting java for selenium testing
jdk: oraclejdk8
env: NODE_VERSION=6.10.0
before_install: nvm install $NODE_VERSION
install: npm install
install:
- npm install
- npm run lint
- npm run build
before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
Expand Down
3 changes: 3 additions & 0 deletions dist/customrangeinput.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

/* global require, ShadyCSS, VERSION */

function defineCustomRangeInput() {
/**
* Actually CustomRangeInput extends HTMLInputElement (<input> element) but
Expand Down Expand Up @@ -280,6 +282,7 @@ function defineCustomRangeInput() {
return CustomRangeInput;
}(HTMLElement);

CustomRangeInput.version = "0.1.0" || "development";
customElements.define("custom-range-input", CustomRangeInput);
window.CustomRangeInput = CustomRangeInput;
}
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"clean": "rm -r ./dist || exit 0",
"test": "wct --plugin local",
"build": "webpack",
"lint": "eslint src/js/",
"watch": "webpack --watch",
"serve": "serve ./"
},
Expand All @@ -32,12 +33,13 @@
"babel-loader": "^6.4.0",
"babel-preset-es2015": "^6.22.0",
"css-loader": "^0.26.2",
"eslint": "^3.17.1",
"node-sass": "^4.5.0",
"sass-loader": "^6.0.3",
"selenium-standalone": "3.0.1",
"serve": "^5.0.2",
"web-component-tester": "^5.0.0",
"webpack": "^2.2.1",
"selenium-standalone": "3.0.1"
"webpack": "^2.2.1"
},
"bugs": {
"url": "https://github.com/misttechnologies/custom-range-input/issues"
Expand Down
3 changes: 3 additions & 0 deletions src/js/customrangeinput.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

/* global require, ShadyCSS, VERSION */

export default function defineCustomRangeInput() {
/**
* Actually CustomRangeInput extends HTMLInputElement (<input> element) but
Expand Down Expand Up @@ -155,6 +157,7 @@ export default function defineCustomRangeInput() {
this.min), this.max);
}
}
CustomRangeInput.version = VERSION || "development";
customElements.define("custom-range-input", CustomRangeInput);
window.CustomRangeInput = CustomRangeInput;
}
9 changes: 8 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const webpack = require("webpack");

module.exports = {
entry: "./index.js",
output: {
Expand Down Expand Up @@ -25,5 +27,10 @@ module.exports = {
loader: 'html-loader'
}
]
}
},
plugins: [
new webpack.DefinePlugin({
VERSION: JSON.stringify(require("./package.json").version)
})
]
};

0 comments on commit 4c8f4de

Please sign in to comment.