From 62d814ddf77991914752be2915505e0e591378e4 Mon Sep 17 00:00:00 2001 From: Josh Johnson Date: Tue, 27 Jun 2017 11:31:38 +0100 Subject: [PATCH 01/22] Merge in search PR + use normal test commands --- README.md | 14 ++++++++------ package.json | 4 ++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index ba0a1d5..51eb116 100644 --- a/README.md +++ b/README.md @@ -807,12 +807,14 @@ To setup a local environment: clone this repo, navigate into it's directory in a ```npm install``` ### NPM tasks -| Task | Usage | -| ------------------- | ------------------------------------------------------------ | -| `npm start` | Fire up local server for development | -| `npm run js:build` | Compile Choices to an uglified JavaScript file | -| `npm run css:watch` | Watch SCSS files for changes. On a change, run build process | -| `npm run css:build` | Compile, minify and prefix SCSS files to CSS | +| Task | Usage | +| -------------------- | ------------------------------------------------------------ | +| `npm run start` | Fire up local server for development | +| `npm run test` | Run sequence of tests once | +| `npm run test:watch` | Fire up test server and re-test on file change | +| `npm run js:build` | Compile Choices to an uglified JavaScript file | +| `npm run css:watch` | Watch SCSS files for changes. On a change, run build process | +| `npm run css:build` | Compile, minify and prefix SCSS files to CSS | ## Contributions In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using npm scripts...bla bla bla diff --git a/package.json b/package.json index c629c22..01c55b0 100644 --- a/package.json +++ b/package.json @@ -5,14 +5,14 @@ "main": "./assets/scripts/dist/choices.min.js", "scripts": { "start": "node server.js", + "test": "./node_modules/karma/bin/karma start --single-run --no-auto-watch tests/karma.config.js", + "test:watch": "./node_modules/karma/bin/karma start --auto-watch --no-single-run tests/karma.config.js", "css:watch": "nodemon -e scss -x \"npm run css:build\"", "css:build": "npm run css:sass -s && npm run css:prefix -s && npm run css:min -s", "css:sass": "node-sass --output-style expanded --include-path scss assets/styles/scss/base.scss assets/styles/css/base.css && node-sass --output-style expanded --include-path scss assets/styles/scss/choices.scss assets/styles/css/choices.css", "css:prefix": "postcss --use autoprefixer -b 'last 2 versions' assets/styles/css/*.css -d assets/styles/css/", "css:min": "csso assets/styles/css/base.css assets/styles/css/base.min.css && csso assets/styles/css/choices.css assets/styles/css/choices.min.css", "js:build": "concurrently --prefix-colors yellow,green \"webpack --minimize --config webpack.config.prod.js\" \"webpack --config webpack.config.prod.js\"", - "js:test": "./node_modules/karma/bin/karma start --single-run --no-auto-watch tests/karma.config.js", - "js:test:watch": "./node_modules/karma/bin/karma start --auto-watch --no-single-run tests/karma.config.js", "version": "node version.js --current $npm_package_version --new $npm_config_newVersion", "postversion": "npm run js:build" }, From 3084cae9f00ac84fd6fef9571a2af1a16557e0b3 Mon Sep 17 00:00:00 2001 From: Josh Johnson Date: Tue, 27 Jun 2017 11:35:53 +0100 Subject: [PATCH 02/22] Update travis task --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3fd3fa8..5288cdf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,4 +6,4 @@ before_install: - npm install -g npm@latest install: - npm install -script: npm run js:test +script: npm run test From b1cfa5441c674fc369105bf43205abc884e4588c Mon Sep 17 00:00:00 2001 From: Josh Johnson Date: Tue, 27 Jun 2017 12:42:01 +0100 Subject: [PATCH 03/22] Use classnames lib for generating class lists --- assets/scripts/dist/choices.js | 726 ++-- assets/scripts/dist/choices.js.map | 2 +- assets/scripts/dist/choices.min.js | 6 +- assets/scripts/src/choices.js | 149 +- assets/scripts/src/lib/utils.js | 7 +- package-lock.json | 4954 ++++++++++++++++++++++++++++ package.json | 5 +- 7 files changed, 5500 insertions(+), 349 deletions(-) create mode 100644 package-lock.json diff --git a/assets/scripts/dist/choices.js b/assets/scripts/dist/choices.js index 62fe267..3a36bb8 100644 --- a/assets/scripts/dist/choices.js +++ b/assets/scripts/dist/choices.js @@ -70,15 +70,19 @@ return /******/ (function(modules) { // webpackBootstrap var _fuse2 = _interopRequireDefault(_fuse); - var _index = __webpack_require__(3); + var _classnames = __webpack_require__(3); + + var _classnames2 = _interopRequireDefault(_classnames); + + var _index = __webpack_require__(4); var _index2 = _interopRequireDefault(_index); - var _index3 = __webpack_require__(29); + var _index3 = __webpack_require__(30); - var _utils = __webpack_require__(30); + var _utils = __webpack_require__(31); - __webpack_require__(31); + __webpack_require__(32); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -2467,43 +2471,68 @@ return /******/ (function(modules) { // webpackBootstrap value: function _createTemplates() { var _this22 = this; - var classNames = this.config.classNames; + var globalClasses = this.config.classNames; var templates = { containerOuter: function containerOuter(direction) { - return (0, _utils.strToEl)('\n \n '); + return (0, _utils.strToEl)('\n