diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index df7baccf..00000000 --- a/.editorconfig +++ /dev/null @@ -1,12 +0,0 @@ -# This file is for unifying the coding style for different editors and IDEs -# See editorconfig.org - -root = true - -[*] -indent_style = tab -indent_size = 2 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true diff --git a/.eslintignore b/.eslintignore index 921f7b49..ebf56065 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1 +1,3 @@ -packages/metal-soy-bundle/src/**/*.js +*.soy.js +packages/metal-isomorphic/**/*.js +packages/metal-soy-bundle/**/*.js \ No newline at end of file diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 00000000..14f7560a --- /dev/null +++ b/.eslintrc @@ -0,0 +1,7 @@ +{ + "env": { + "browser": true, + "node": true + }, + "extends": "liferay" +} \ No newline at end of file diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index b892904d..00000000 --- a/.eslintrc.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "env": { - "browser": true, - "node": true - }, - "globals": {}, - "parserOptions": { - "ecmaVersion": 6, - "sourceType": "module", - "ecmaFeatures": { - "jsx": true - } - }, - "rules": { - "semi": 1, - "no-bitwise": 0, - "curly": 2, - "eqeqeq": 2, - "no-eval": 0, - "guard-for-in": 0, - "wrap-iife": [2, "any"], - "max-depth": 0, - "no-multi-str": 0, - "new-cap": 2, - "no-caller": 2, - "quotes": [ - 1, - "single", - { "allowTemplateLiterals": true } - ], - "strict": 0, - "no-undef": 2, - "no-unused-vars": 2 - } -} diff --git a/.travis.yml b/.travis.yml index c2b92efa..f129a9a8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,8 +6,7 @@ addons: secure: rV35O/fLO1NHiINBspiMzvWWtJPBdetUb3bB4mBB2Qrqf0WMRMGJ4Pgkaxl0p9JqAgPMQ/HSQTKLPNKaATc5g6GO46H7N1ykWBLrhsi7YSgopbNwUw95RebaZc42iyfgbnYG1hU8YEmes01UwXLsVup6qNt7X64I+M/KcfM6Cb8= before_install: - - nvm install 7 - - npm install -g gulp + - nvm install 8 - npm install -g lerna@2.2.0 install: @@ -19,5 +18,7 @@ jdk: language: java script: - - gulp test:saucelabs + - npm run checkFormat + - npm run lint + - npm run test:saucelabs - npm run test:isomorphic diff --git a/gulpfile.js b/gulpfile.js index c7cb73a0..e4f42644 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,107 +1,12 @@ 'use strict'; -var babel = require('gulp-babel'); -var compileSoy = require('metal-tools-soy/lib/pipelines/compileSoy'); -var gulp = require('gulp'); -var karma = require('karma'); -var metal = require('gulp-metal'); -var path = require('path'); -var replace = require('gulp-replace'); - -var codeGlobs = [ - 'packages/metal*/src/**/*.js', - 'packages/metal*/test/**/*.js', - '!packages/metal*/**/*.soy.js', - '!packages/metal-incremental-dom/**/incremental-dom.js', - 'gulpfile.js', - 'karma.conf.js', - 'karma-coverage.conf.js' -]; - -metal.registerTasks({ - bundleFileName: 'metal.js', - formatGlobs: codeGlobs, - karma: require('karma'), - lintGlobs: codeGlobs, - testDepTasks: ['build:cjs'], - testNodeSrc: [ - // Since all files will be added, we need to ensure manually that these - // will be added first. - 'packages/metal-incremental-dom/lib/incremental-dom.js', - - // Test files - 'env/test/node.js', - 'packages/metal/test/**/*.js', - 'packages/metal-component/test/**/*.js', - 'packages/metal-dom/test/**/*.js', - 'packages/metal-events/test/**/*.js', - 'packages/metal-incremental-dom/test/**/*.js', - 'packages/metal-jsx/test/**/*.js', - 'packages/metal-soy/test/**/*.js', - 'packages/metal-state/test/**/*.js' - ], - testSaucelabsBrowsers: { - sl_chrome: { - base: 'SauceLabs', - browserName: 'chrome' - }, - sl_safari_8: { - base: 'SauceLabs', - browserName: 'safari', - platform: 'OS X 10.10' - }, - sl_safari_10: { - base: 'SauceLabs', - browserName: 'safari', - platform: 'OS X 10.12', - version: '10' - }, - sl_firefox: { - base: 'SauceLabs', - browserName: 'firefox' - }, - sl_ie_9: { - base: 'SauceLabs', - browserName: 'internet explorer', - platform: 'Windows 7', - version: '9' - }, - sl_ie_10: { - base: 'SauceLabs', - browserName: 'internet explorer', - platform: 'Windows 7', - version: '10' - }, - sl_ie_11: { - base: 'SauceLabs', - browserName: 'internet explorer', - platform: 'Windows 8.1', - version: '11' - }, - sl_edge_15: { - base: 'SauceLabs', - browserName: 'microsoftedge', - platform: 'Windows 10', - version: '15' - }, - sl_android_4: { - base: 'SauceLabs', - browserName: 'android', - platform: 'Linux', - version: '4.4' - }, - sl_android_5: { - base: 'SauceLabs', - browserName: 'android', - platform: 'Linux', - version: '5.0' - } - }, - useEslint: true -}); +let compileSoy = require('metal-tools-soy/lib/pipelines/compileSoy'); +let gulp = require('gulp'); +let replace = require('gulp-replace'); gulp.task('soy', function() { - return gulp.src('packages/metal-soy/test/**/*.soy') + return gulp + .src('packages/metal-soy/test/**/*.soy') .pipe(compileSoy()) .pipe(replace('metal-soy', '../..')) .pipe(replace('metal-component/src/Component', 'metal-component')) @@ -109,52 +14,8 @@ gulp.task('soy', function() { }); gulp.task('soy:isomorphic', function() { - return gulp.src('packages/metal-isomorphic/test/**/*.soy') + return gulp + .src('packages/metal-isomorphic/test/**/*.soy') .pipe(compileSoy()) .pipe(gulp.dest('packages/metal-isomorphic/test')); }); - -gulp.task('build:cjs', ['soy'], function() { - return compileToLib('packages/metal*/src/**/*.js'); -}); - -var changedJsSrc; -gulp.task('compile', function() { - return compileToLib(changedJsSrc); -}); - -// We need to override gulp-metal's default test:watch task so that it will -// update lib files when the related src files change. -gulp.task('test:watch', ['build:cjs'], function(done) { // eslint-disable-line - gulp.watch('packages/metal-soy/test/**/*.soy', ['soy']); - var jsWatcher = gulp.watch('packages/metal*/src/**/*.js', ['compile']); - jsWatcher.on('change', function(event) { - changedJsSrc = event.path; - }); - - new karma.Server( - { - configFile: path.resolve('karma.conf.js') - } - ).start(); -}); - -function calcDestDir(file) { - var relative = path.relative(path.resolve('packages'), file.path); - var index = relative.indexOf(path.sep); - file.base = path.dirname(file.path); - return path.dirname(path.join( - path.resolve('packages'), - relative.substr(0, index), - 'lib', - relative.substr(index + 5) - )); -} - -function compileToLib(src) { - return gulp.src(src) - .pipe(babel({ - presets: ['env'] - })) - .pipe(gulp.dest(calcDestDir)); -} diff --git a/karma-coverage.conf.js b/karma-coverage.conf.js index 327cc067..793ce707 100644 --- a/karma-coverage.conf.js +++ b/karma-coverage.conf.js @@ -1,115 +1,42 @@ -'use strict'; - -var lernaJson = require('./lerna.json'); +const karmaConfig = require('./karma.conf.js'); +const lernaJson = require('./lerna.json'); module.exports = function(config) { - config.set({ - frameworks: ['browserify', 'mocha', 'chai', 'sinon', 'source-map-support'], - - files: [ - // Since all files will be added, we need to ensure manually that these - // will be added first. - { - pattern: 'packages/metal-incremental-dom/src/incremental-dom.js', - watched: false, - included: true, - served: true - }, - { - pattern: 'packages/metal-incremental-dom/lib/incremental-dom.js', - watched: false, - included: true, - served: true - }, - { - pattern: 'packages/metal-soy-bundle/lib/bundle.js', - watched: false, - included: true, - served: true - }, - { - pattern: 'packages/metal-web-component/node_modules/babel-polyfill/dist/polyfill.min.js', - watched: false, - included: true, - served: true - }, - { - pattern: 'packages/metal-web-component/node_modules/@webcomponents/webcomponentsjs/webcomponents-lite.js', - watched: false, - included: false, - served: true - }, - { - pattern: 'packages/metal-web-component/webcomponents_polyfill.js', - watched: false, - included: true, - served: true - }, - { - pattern: 'packages/metal*/test/**/*.js', - watched: false, - included: true, - served: true - }, - { - pattern: 'packages/metal-dom/fixtures/*', - watched: true, - included: false, - served: true - } - ], - - exclude: ['packages/metal-isomorphic/**/*.js'], + karmaConfig(config); - preprocessors: { - 'packages/metal-incremental-dom/src/incremental-dom.js': ['browserify'], - 'packages/metal-incremental-dom/lib/incremental-dom.js': ['browserify'], - 'packages/metal-soy-bundle/lib/bundle.js': ['browserify'], - 'packages/metal*/test/**/*.js': ['browserify'] - }, - - browsers: ['Chrome'], + config.plugins.push('karma-coverage'); + config.set({ browserify: { debug: true, transform: [ [ 'babelify', { - plugins: [ - 'istanbul' - ], - presets: [ - 'env' - ] - } - ] + plugins: ['istanbul'], + presets: ['env'], + }, + ], ], insertGlobalVars: { METAL_VERSION: function() { return '\'' + lernaJson.version + '\''; - } - } + }, + }, }, - reporters: ['coverage', 'progress'], - coverageReporter: { reporters: [ { type: 'lcov', - subdir: 'lcov' + subdir: 'lcov', }, { - type: 'text-summary' - } - ] + type: 'text-summary', + }, + ], }, - autoWatch: true, - - proxies: { - '/fixtures/': '/base/packages/metal-dom/fixtures/' - } + reporters: ['coverage', 'progress'], }); }; diff --git a/karma-sauce.conf.js b/karma-sauce.conf.js deleted file mode 100644 index 6615fb81..00000000 --- a/karma-sauce.conf.js +++ /dev/null @@ -1,104 +0,0 @@ -'use strict'; - -var lernaJson = require('./lerna.json'); - -module.exports = function(config) { - config.set({ - frameworks: ['browserify', 'mocha', 'chai', 'sinon'], - - files: [ - // Since all files will be added, we need to ensure manually that these - // will be added first. - { - pattern: 'packages/metal-incremental-dom/src/incremental-dom.js', - watched: false, - included: true, - served: true - }, - { - pattern: 'packages/metal-incremental-dom/lib/incremental-dom.js', - watched: false, - included: true, - served: true - }, - { - pattern: 'packages/metal-soy/node_modules/metal-soy-bundle/lib/bundle.js', - watched: false, - included: true, - served: true - }, - { - pattern: 'packages/metal-web-component/node_modules/babel-polyfill/dist/polyfill.min.js', - watched: false, - included: true, - served: true - }, - { - pattern: 'packages/metal-web-component/node_modules/@webcomponents/webcomponentsjs/webcomponents-lite.js', - watched: false, - included: false, - served: true - }, - { - pattern: 'packages/metal-web-component/webcomponents_polyfill.js', - watched: false, - included: true, - served: true - }, - { - pattern: 'packages/metal*/test/**/*.js', - watched: false, - included: true, - served: true - }, - { - pattern: 'packages/metal-dom/fixtures/*', - watched: true, - included: false, - served: true - } - ], - - exclude: ['packages/metal-isomorphic/**/*.js'], - - preprocessors: { - 'packages/metal-incremental-dom/src/incremental-dom.js': ['browserify'], - 'packages/metal-incremental-dom/lib/incremental-dom.js': ['browserify'], - 'packages/metal-soy/node_modules/metal-soy-bundle/lib/bundle.js': ['browserify'], - 'packages/metal*/test/**/*.js': ['browserify'] - }, - - browsers: ['Chrome'], - - browserify: { - debug: true, - transform: [ - [ - 'babelify', - { - presets: [ - 'env' - ] - } - ] - ], - insertGlobalVars: { - METAL_VERSION: function() { - return '\'' + lernaJson.version + '\''; - } - } - }, - - client: { - mocha: { - timeout: 4000 - } - }, - - autoWatch: true, - - proxies: { - '/fixtures/': '/base/packages/metal-dom/fixtures/' - } - }); -}; diff --git a/karma-saucelabs.conf.js b/karma-saucelabs.conf.js new file mode 100644 index 00000000..3e5bbda5 --- /dev/null +++ b/karma-saucelabs.conf.js @@ -0,0 +1,101 @@ +'use strict'; + +const karmaSauceLauncher = require('karma-sauce-launcher'); + +const karmaConfig = require('./karma.conf.js'); + +module.exports = function(config) { + karmaConfig(config); + + const launchers = { + sl_chrome: { + base: 'SauceLabs', + browserName: 'chrome', + }, + sl_safari_8: { + base: 'SauceLabs', + browserName: 'safari', + platform: 'OS X 10.10', + }, + sl_safari_10: { + base: 'SauceLabs', + browserName: 'safari', + platform: 'OS X 10.12', + version: '10', + }, + sl_firefox: { + base: 'SauceLabs', + browserName: 'firefox', + }, + sl_ie_9: { + base: 'SauceLabs', + browserName: 'internet explorer', + platform: 'Windows 7', + version: '9', + }, + sl_ie_10: { + base: 'SauceLabs', + browserName: 'internet explorer', + platform: 'Windows 7', + version: '10', + }, + sl_ie_11: { + base: 'SauceLabs', + browserName: 'internet explorer', + platform: 'Windows 8.1', + version: '11', + }, + sl_edge_15: { + base: 'SauceLabs', + browserName: 'microsoftedge', + platform: 'Windows 10', + version: '15', + }, + sl_android_5: { + base: 'SauceLabs', + browserName: 'android', + platform: 'Linux', + version: '5.0', + }, + }; + + let sauceLabsAccessKey = process.env.SAUCE_ACCESS_KEY; + if (!sauceLabsAccessKey) { + sauceLabsAccessKey = process.env.SAUCE_ACCESS_KEY_ENC; + if (sauceLabsAccessKey) { + sauceLabsAccessKey = new Buffer(sauceLabsAccessKey, 'base64').toString( + 'binary' + ); + } + } + + config.plugins.push(karmaSauceLauncher); + + config.set({ + browsers: Object.keys(launchers), + + browserDisconnectTimeout: 10000, + browserDisconnectTolerance: 2, + browserNoActivityTimeout: 240000, + + captureTimeout: 240000, + + customLaunchers: launchers, + + reporters: ['dots', 'saucelabs'], + + sauceLabs: { + accessKey: sauceLabsAccessKey, + connectOptions: { + port: 4445, + logfile: 'sauce_connect.log', + }, + recordScreenshots: false, + recordVideo: false, + startConnect: false, + testName: 'metal.js tests', + tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER, + username: process.env.SAUCE_USERNAME, + }, + }); +}; diff --git a/karma.conf.js b/karma.conf.js index 65001c00..080fce0c 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -1,8 +1,117 @@ 'use strict'; -var karmaConf = require('./karma-sauce.conf'); +const lernaJson = require('./lerna.json'); module.exports = function(config) { - karmaConf(config); - config.frameworks.push('source-map-support'); + config.set({ + browserify: { + debug: true, + transform: [ + [ + 'babelify', + { + presets: ['env'], + }, + ], + ], + insertGlobalVars: { + METAL_VERSION: function() { + return '\'' + lernaJson.version + '\''; + }, + }, + }, + + browsers: ['Chrome'], + + client: { + mocha: { + timeout: 4000, + }, + }, + + exclude: ['packages/metal-isomorphic/**/*.js'], + + files: [ + // Since all files will be added, we need to ensure manually that these + // will be added first. + { + pattern: 'packages/metal-incremental-dom/src/incremental-dom.js', + watched: false, + included: true, + served: true, + }, + { + pattern: 'packages/metal-incremental-dom/lib/incremental-dom.js', + watched: false, + included: true, + served: true, + }, + { + pattern: + 'packages/metal-soy/node_modules/metal-soy-bundle/lib/bundle.js', + watched: false, + included: true, + served: true, + }, + { + pattern: + 'packages/metal-web-component/node_modules/babel-polyfill/dist/polyfill.min.js', + watched: false, + included: true, + served: true, + }, + { + pattern: + 'packages/metal-web-component/node_modules/@webcomponents/webcomponentsjs/webcomponents-lite.js', + watched: false, + included: false, + served: true, + }, + { + pattern: 'packages/metal-web-component/webcomponents_polyfill.js', + watched: false, + included: true, + served: true, + }, + { + pattern: 'packages/metal*/test/**/*.js', + watched: false, + included: true, + served: true, + }, + { + pattern: 'packages/metal-dom/fixtures/*', + watched: true, + included: false, + served: true, + }, + ], + + frameworks: ['browserify', 'mocha', 'chai', 'sinon', 'source-map-support'], + + plugins: [ + 'karma-browserify', + 'karma-chai', + 'karma-chrome-launcher', + 'karma-mocha', + 'karma-mocha', + 'karma-sinon', + 'karma-source-map-support', + ], + + preprocessors: { + 'packages/metal-incremental-dom/src/incremental-dom.js': ['browserify'], + 'packages/metal-incremental-dom/lib/incremental-dom.js': ['browserify'], + 'packages/metal-soy/node_modules/metal-soy-bundle/lib/bundle.js': [ + 'browserify', + ], + 'packages/metal*/test/**/*.js': ['browserify'], + }, + + proxies: { + '/fixtures/': '/base/packages/metal-dom/fixtures/', + }, + + singleRun: true, + }); }; diff --git a/package-lock.json b/package-lock.json index 7ede5498..8e756c40 100644 --- a/package-lock.json +++ b/package-lock.json @@ -62,39 +62,65 @@ "integrity": "sha1-anmQQ3ynNtXhKI25K9MmbV9csqo=", "dev": true }, + "adm-zip": { + "version": "0.4.7", + "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.7.tgz", + "integrity": "sha1-hgbCy/HEJs6MjsABdER/1Jtur8E=", + "dev": true + }, "after": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/after/-/after-0.8.2.tgz", "integrity": "sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8=", "dev": true }, - "ajv": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz", - "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=", + "agent-base": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-2.1.1.tgz", + "integrity": "sha1-1t4Q1a9hMtW9aSQn1G/FOFOQlMc=", "dev": true, "requires": { - "co": "4.6.0", - "json-stable-stringify": "1.0.1" + "extend": "3.0.1", + "semver": "5.0.3" }, "dependencies": { - "json-stable-stringify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", - "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", - "dev": true, - "requires": { - "jsonify": "0.0.0" - } + "semver": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.0.3.tgz", + "integrity": "sha1-d0Zt5YnNXTyV8TiqeLxWmjy10no=", + "dev": true } } }, + "ajv": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.4.0.tgz", + "integrity": "sha1-MtHPCNvIDEMvQm8S4QslEfa0ZHQ=", + "dev": true, + "requires": { + "co": "4.6.0", + "fast-deep-equal": "1.0.0", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.3.1" + } + }, "ajv-keywords": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-1.5.1.tgz", - "integrity": "sha1-MU3QpLM2j609/NxU7eYXG4htrzw=", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz", + "integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=", "dev": true }, + "align-text": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", + "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", + "dev": true, + "requires": { + "kind-of": "3.2.2", + "longest": "1.0.1", + "repeat-string": "1.6.1" + } + }, "amdefine": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", @@ -102,9 +128,9 @@ "dev": true }, "ansi-escapes": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz", - "integrity": "sha1-06ioOzGapneTZisT52HHkRQiMG4=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.0.0.tgz", + "integrity": "sha512-O/klc27mWNUigtv0F8NJWbLF00OcegQalkqKURWdosW08YZKi4m6CnSUSvIZG1otNJbTWhN01Hhz389DW7mvDQ==", "dev": true }, "ansi-regex": { @@ -129,12 +155,60 @@ "normalize-path": "2.1.1" } }, + "app-root-path": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/app-root-path/-/app-root-path-2.0.1.tgz", + "integrity": "sha1-zWLc+OT9WkF+/GZNLlsQZTxlG0Y=", + "dev": true + }, "aproba": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", "dev": true }, + "archiver": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/archiver/-/archiver-1.3.0.tgz", + "integrity": "sha1-TyGU1tj5nfP1MeaIHxTxXVX6ryI=", + "dev": true, + "requires": { + "archiver-utils": "1.3.0", + "async": "2.6.0", + "buffer-crc32": "0.2.13", + "glob": "7.1.2", + "lodash": "4.17.4", + "readable-stream": "2.3.3", + "tar-stream": "1.5.5", + "walkdir": "0.0.11", + "zip-stream": "1.2.0" + }, + "dependencies": { + "async": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.0.tgz", + "integrity": "sha512-xAfGg1/NTLBBKlHFmnd7PlmUW9KhVQIUuSrYem9xzFUZy13ScvtyGGejaae9iAVRiRq9+Cx7DPFaAAhCpyxyPw==", + "dev": true, + "requires": { + "lodash": "4.17.4" + } + } + } + }, + "archiver-utils": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-1.3.0.tgz", + "integrity": "sha1-5QtMCccL89aA4y/xt5lOn52JUXQ=", + "dev": true, + "requires": { + "glob": "7.1.2", + "graceful-fs": "4.1.11", + "lazystream": "1.0.0", + "lodash": "4.17.4", + "normalize-path": "2.1.1", + "readable-stream": "2.3.3" + } + }, "archy": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", @@ -211,6 +285,16 @@ "integrity": "sha1-nlKHYrSpBmrRY6aWKjZEGOlibs4=", "dev": true }, + "array-includes": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.0.3.tgz", + "integrity": "sha1-GEtI9i2S10UrsxsyMWXH+L0CJm0=", + "dev": true, + "requires": { + "define-properties": "1.1.2", + "es-abstract": "1.9.0" + } + }, "array-map": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/array-map/-/array-map-0.0.0.tgz", @@ -250,16 +334,6 @@ "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", "dev": true }, - "array.prototype.find": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/array.prototype.find/-/array.prototype.find-2.0.4.tgz", - "integrity": "sha1-VWpcU2LAhkgyPdrrnenRS8GGTJA=", - "dev": true, - "requires": { - "define-properties": "1.1.2", - "es-abstract": "1.9.0" - } - }, "arraybuffer.slice": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.6.tgz", @@ -272,6 +346,12 @@ "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", "dev": true }, + "asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=", + "dev": true + }, "asn1": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", @@ -279,9 +359,9 @@ "dev": true }, "asn1.js": { - "version": "4.9.1", - "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.9.1.tgz", - "integrity": "sha1-SLokC0WpKA6UdImQull9IWYX/UA=", + "version": "4.9.2", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.9.2.tgz", + "integrity": "sha512-b/OsSjvWEo8Pi8H0zsDd2P6Uqo2TK2pH8gNLSJtNLM2Db0v2QaAZ0pBQJXVjAn4gBuugeVDr7s63ZogpUIwWDg==", "dev": true, "requires": { "bn.js": "4.11.8", @@ -337,32 +417,6 @@ "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", "dev": true }, - "autoprefixer": { - "version": "6.7.7", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-6.7.7.tgz", - "integrity": "sha1-Hb0cg1ZY41zj+ZhAmdsAWFx4IBQ=", - "dev": true, - "requires": { - "browserslist": "1.7.7", - "caniuse-db": "1.0.30000746", - "normalize-range": "0.1.2", - "num2fraction": "1.2.2", - "postcss": "5.2.18", - "postcss-value-parser": "3.3.0" - }, - "dependencies": { - "browserslist": { - "version": "1.7.7", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-1.7.7.tgz", - "integrity": "sha1-C9dnBCWL6CmyOYu1Dkti0aFmsLk=", - "dev": true, - "requires": { - "caniuse-db": "1.0.30000746", - "electron-to-chromium": "1.3.25" - } - } - } - }, "aws-sign2": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", @@ -408,7 +462,7 @@ "lodash": "4.17.4", "minimatch": "3.0.4", "path-is-absolute": "1.0.1", - "private": "0.1.7", + "private": "0.1.8", "slash": "1.0.0", "source-map": "0.5.7" } @@ -601,7 +655,7 @@ "dev": true, "requires": { "find-up": "1.1.2", - "istanbul-lib-instrument": "1.8.0", + "istanbul-lib-instrument": "1.9.1", "test-exclude": "1.1.0" } }, @@ -905,9 +959,9 @@ } }, "babel-preset-env": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.6.0.tgz", - "integrity": "sha512-OVgtQRuOZKckrILgMA5rvctvFZPv72Gua9Rt006AiPoB0DJKGN07UmaQA+qRrYgK71MVct8fFhT0EyNWYorVew==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.6.1.tgz", + "integrity": "sha512-W6VIyA6Ch9ePMI7VptNn2wBM6dbG0eSz25HEiL40nQXCsXGTGZSTZu1Iap+cj3Q0S5a7T9+529l/5Bkvd+afNA==", "dev": true, "requires": { "babel-plugin-check-es2015-constants": "6.22.0", @@ -937,7 +991,7 @@ "babel-plugin-transform-es2015-unicode-regex": "6.24.1", "babel-plugin-transform-exponentiation-operator": "6.24.1", "babel-plugin-transform-regenerator": "6.26.0", - "browserslist": "2.5.1", + "browserslist": "2.9.0", "invariant": "2.2.2", "semver": "5.4.1" } @@ -1064,6 +1118,16 @@ "integrity": "sha1-R2iMuZu2gE8OBtPnY7HDLlfY5rY=", "dev": true }, + "bcrypt-pbkdf": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", + "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", + "dev": true, + "optional": true, + "requires": { + "tweetnacl": "0.14.5" + } + }, "beeper": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/beeper/-/beeper-1.1.1.tgz", @@ -1080,9 +1144,9 @@ } }, "binary-extensions": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.10.0.tgz", - "integrity": "sha1-muuabF6IY4qtFx4Wf1kAq+JINdA=", + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.11.0.tgz", + "integrity": "sha1-RqoXUftqL5PuXmibsQh9SxTGwgU=", "dev": true }, "binaryextensions": { @@ -1091,6 +1155,15 @@ "integrity": "sha1-HmN0iLNbWL2l9HdL+WpSEqjJB1U=", "dev": true }, + "bl": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.1.tgz", + "integrity": "sha1-ysMo977kVzDUBLaSID/LWQ4XLV4=", + "dev": true, + "requires": { + "readable-stream": "2.3.3" + } + }, "blob": { "version": "0.0.4", "resolved": "https://registry.npmjs.org/blob/-/blob-0.0.4.tgz", @@ -1125,16 +1198,14 @@ "qs": "6.5.1", "raw-body": "2.3.2", "type-is": "1.6.15" - }, - "dependencies": { - "iconv-lite": { - "version": "0.4.19", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", - "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==", - "dev": true - } } }, + "boolify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/boolify/-/boolify-1.0.1.tgz", + "integrity": "sha1-tcCeF8rNET0Rt7s+04TMASmU2Gs=", + "dev": true + }, "boom": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz", @@ -1216,7 +1287,7 @@ "concat-stream": "1.5.2", "console-browserify": "1.1.0", "constants-browserify": "1.0.0", - "crypto-browserify": "3.11.1", + "crypto-browserify": "3.12.0", "defined": "1.0.0", "deps-sort": "2.0.0", "domain-browser": "1.1.7", @@ -1239,7 +1310,7 @@ "querystring-es3": "0.2.1", "read-only-stream": "2.0.0", "readable-stream": "2.3.3", - "resolve": "1.4.0", + "resolve": "1.5.0", "shasum": "1.0.2", "shell-quote": "1.6.1", "stream-browserify": "2.0.1", @@ -1257,9 +1328,9 @@ } }, "browserify-aes": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.0.8.tgz", - "integrity": "sha512-WYCMOT/PtGTlpOKFht0YJFYcPy6pLCR98CtWfzK13zoynLlBMvAdEMSRGmgnJCw2M2j/5qxBkinZQFobieM8dQ==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.1.1.tgz", + "integrity": "sha512-UGnTYAnB2a3YuYKIRy1/4FB2HdM866E0qC46JXvVTYKlBlZlnvfpSfY6OKfXZAkv70eJ2a1SqzpAo5CRhZGDFg==", "dev": true, "requires": { "buffer-xor": "1.0.3", @@ -1276,7 +1347,7 @@ "integrity": "sha1-mYgkSHS/XtTijalWZtzWasj8Njo=", "dev": true, "requires": { - "browserify-aes": "1.0.8", + "browserify-aes": "1.1.1", "browserify-des": "1.0.0", "evp_bytestokey": "1.0.3" } @@ -1327,13 +1398,13 @@ } }, "browserslist": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-2.5.1.tgz", - "integrity": "sha512-jAvM2ku7YDJ+leAq3bFH1DE0Ylw+F+EQDq4GkqZfgPEqpWYw9ofQH85uKSB9r3Tv7XDbfqVtE+sdvKJW7IlPJA==", + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-2.9.0.tgz", + "integrity": "sha512-vJEBcDTANoDhSHL46NeOEW5hvQw7It9uCqzeFPQhpawXfnOwnpvW5C97vn1eGJ7iCkSg8wWU0nYObE7d/N95Iw==", "dev": true, "requires": { - "caniuse-lite": "1.0.30000746", - "electron-to-chromium": "1.3.25" + "caniuse-lite": "1.0.30000769", + "electron-to-chromium": "1.3.27" } }, "buffer": { @@ -1347,6 +1418,12 @@ "isarray": "1.0.0" } }, + "buffer-crc32": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=", + "dev": true + }, "buffer-xor": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", @@ -1420,16 +1497,16 @@ "map-obj": "1.0.1" } }, - "caniuse-db": { - "version": "1.0.30000746", - "resolved": "https://registry.npmjs.org/caniuse-db/-/caniuse-db-1.0.30000746.tgz", - "integrity": "sha1-UBCYxm9fu/Y0wC8lUIsF6ICZEPQ=", + "caniuse-lite": { + "version": "1.0.30000769", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000769.tgz", + "integrity": "sha1-1oxaoHcuo+rGyX1C4jnJtNMmG5M=", "dev": true }, - "caniuse-lite": { - "version": "1.0.30000746", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000746.tgz", - "integrity": "sha1-xk+Vo5Jc/TAgejCO12wa6W6gnqA=", + "capture-stack-trace": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/capture-stack-trace/-/capture-stack-trace-1.0.0.tgz", + "integrity": "sha1-Sm+gc5nCa7pH8LJJa00PtAjFVQ0=", "dev": true }, "caseless": { @@ -1438,6 +1515,17 @@ "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", "dev": true }, + "center-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", + "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", + "dev": true, + "optional": true, + "requires": { + "align-text": "0.1.4", + "lazy-cache": "1.0.4" + } + }, "chai": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/chai/-/chai-3.5.0.tgz", @@ -1462,6 +1550,12 @@ "supports-color": "2.0.0" } }, + "chardet": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.0.tgz", + "integrity": "sha1-C74TVaxE16PtSpJXB8TvcPgZD2w=", + "dev": true + }, "chokidar": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", @@ -1470,6 +1564,7 @@ "requires": { "anymatch": "1.3.2", "async-each": "1.0.1", + "fsevents": "1.1.3", "glob-parent": "2.0.0", "inherits": "2.0.3", "is-binary-path": "1.0.1", @@ -1479,9 +1574,9 @@ } }, "ci-info": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.1.1.tgz", - "integrity": "sha512-vHDDF/bP9RYpTWtUhpJRhCFdvvp3iDWvEbuDbWgvjUrNGV1MXJrE0MPcwGtEled04m61iwdBLUIHZtDgzWS4ZQ==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.1.2.tgz", + "integrity": "sha512-uTGIPNx/nSpBdsF6xnseRXLLtfr9VLqkz8ZqHXr3Y7b6SftyRxBGjwMtJj1OhNbmlc1wZzLNAlAcvyIiE8a6ZA==", "dev": true }, "cipher-base": { @@ -1501,12 +1596,56 @@ "dev": true }, "cli-cursor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz", - "integrity": "sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "dev": true, + "requires": { + "restore-cursor": "2.0.0" + } + }, + "cli-spinners": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-0.1.2.tgz", + "integrity": "sha1-u3ZNiOGF+54eaiofGXcjGPYF4xw=", + "dev": true + }, + "cli-truncate": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-0.2.1.tgz", + "integrity": "sha1-nxXPuwcFAFNpIWxiasfQWrkN1XQ=", "dev": true, "requires": { - "restore-cursor": "1.0.1" + "slice-ansi": "0.0.4", + "string-width": "1.0.2" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "slice-ansi": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz", + "integrity": "sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU=", + "dev": true + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + } } }, "cli-width": { @@ -1524,12 +1663,34 @@ "string-width": "1.0.2", "strip-ansi": "3.0.1", "wrap-ansi": "2.1.0" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + } } }, "clone": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.2.tgz", - "integrity": "sha1-Jgt6meux7f4kdTgXX3gyQ8sZ0Uk=", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.3.tgz", + "integrity": "sha1-KY1+IjFmD0DAA8LtMUDezz9TCF8=", "dev": true }, "clone-stats": { @@ -1567,9 +1728,9 @@ "dev": true }, "color-convert": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.0.tgz", - "integrity": "sha1-Gsz5fdc5uYO/mU1W/sj5WFNkG3o=", + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz", + "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==", "dev": true, "requires": { "color-name": "1.1.3" @@ -1647,6 +1808,15 @@ "integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==", "dev": true }, + "common-tags": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/common-tags/-/common-tags-1.4.0.tgz", + "integrity": "sha1-EYe+Tz1M8MBCfUP3Tu8fc1AWFMA=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0" + } + }, "compare-func": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-1.3.2.tgz", @@ -1675,6 +1845,18 @@ "integrity": "sha1-ZF/ErfWLcrZJ1crmUTVhnbJv8UM=", "dev": true }, + "compress-commons": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-1.2.2.tgz", + "integrity": "sha1-UkqfEJA/OoEzibAiXSfEi7dRiQ8=", + "dev": true, + "requires": { + "buffer-crc32": "0.2.13", + "crc32-stream": "2.0.0", + "normalize-path": "2.1.1", + "readable-stream": "2.3.3" + } + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -1748,86 +1930,86 @@ "dev": true }, "content-type-parser": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/content-type-parser/-/content-type-parser-1.0.1.tgz", - "integrity": "sha1-w+VpiMU8ZRJ/tG1AMqOpACRv3JQ=", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/content-type-parser/-/content-type-parser-1.0.2.tgz", + "integrity": "sha512-lM4l4CnMEwOLHAHr/P6MEZwZFPJFtAAKgL6pogbXmVZggIqXhdB6RbBtPOTsw2FcXwYhehRGERJmRrjOiIB8pQ==", "dev": true }, "conventional-changelog": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/conventional-changelog/-/conventional-changelog-1.1.6.tgz", - "integrity": "sha512-AaQRALJYQVbfMs0UYJ3jf5yIAJwGnm/E7ETwzZMwF/3JDMyDaa4agLQomz94pcYiGH7zcrxFcwHApSODOYnunA==", + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/conventional-changelog/-/conventional-changelog-1.1.7.tgz", + "integrity": "sha1-kVGmKx2O2y2CcR2r9bfPcQQfgrE=", "dev": true, "requires": { - "conventional-changelog-angular": "1.5.1", - "conventional-changelog-atom": "0.1.1", - "conventional-changelog-codemirror": "0.2.0", - "conventional-changelog-core": "1.9.2", - "conventional-changelog-ember": "0.2.8", - "conventional-changelog-eslint": "0.2.0", - "conventional-changelog-express": "0.2.0", + "conventional-changelog-angular": "1.5.2", + "conventional-changelog-atom": "0.1.2", + "conventional-changelog-codemirror": "0.2.1", + "conventional-changelog-core": "1.9.3", + "conventional-changelog-ember": "0.2.9", + "conventional-changelog-eslint": "0.2.1", + "conventional-changelog-express": "0.2.1", "conventional-changelog-jquery": "0.1.0", "conventional-changelog-jscs": "0.1.0", - "conventional-changelog-jshint": "0.2.0" + "conventional-changelog-jshint": "0.2.1" } }, "conventional-changelog-angular": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-1.5.1.tgz", - "integrity": "sha512-AnjnPyqHp8yR2IOWsXYOCv6Ly0WC2rLRK04fgAS/5QoA3ovYLSoz9PKB5pcSG3M9lAf40IqZwU3R3G6Hy7XCSA==", + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-1.5.2.tgz", + "integrity": "sha1-Kzj2Zf6cWSCvGi+C9Uf0ur5t5Xw=", "dev": true, "requires": { "compare-func": "1.3.2", - "q": "1.5.0" + "q": "1.5.1" } }, "conventional-changelog-atom": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/conventional-changelog-atom/-/conventional-changelog-atom-0.1.1.tgz", - "integrity": "sha512-6Nlu/+MiD4gi7k3Z+N1vMJWpaPSdvFPWzPGnH4OXewHAxiAl0L/TT9CGgA01fosPxmYr4hMNtD7kyN0tkg8vIA==", + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/conventional-changelog-atom/-/conventional-changelog-atom-0.1.2.tgz", + "integrity": "sha1-Ella1SZ6aTfDTPkAKBscZRmKTGM=", "dev": true, "requires": { - "q": "1.5.0" + "q": "1.5.1" } }, "conventional-changelog-cli": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/conventional-changelog-cli/-/conventional-changelog-cli-1.3.4.tgz", - "integrity": "sha512-b8B1i01df+Lq5t16L3g8uoEGdzViChIKmIo7TComL4DqqrjrtasRaT+/4OPGcApEgX86JkBqb4KVt85ytQinUw==", + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/conventional-changelog-cli/-/conventional-changelog-cli-1.3.5.tgz", + "integrity": "sha1-RsUUliFrdAZYiIPe+m+sWJ6bsx4=", "dev": true, "requires": { "add-stream": "1.0.0", - "conventional-changelog": "1.1.6", + "conventional-changelog": "1.1.7", "lodash": "4.17.4", "meow": "3.7.0", "tempfile": "1.1.1" } }, "conventional-changelog-codemirror": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/conventional-changelog-codemirror/-/conventional-changelog-codemirror-0.2.0.tgz", - "integrity": "sha512-jUbY98JoKdAOR5k3pOBiKZ+Iz9t2F84hL7x4WjSRW6x7FdeCEUOjyfml+YClE2h/h62Tf3mwur5jSO8upxxc1g==", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/conventional-changelog-codemirror/-/conventional-changelog-codemirror-0.2.1.tgz", + "integrity": "sha1-KZpPcUe681DmyBWPxUlUopHFzAk=", "dev": true, "requires": { - "q": "1.5.0" + "q": "1.5.1" } }, "conventional-changelog-core": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/conventional-changelog-core/-/conventional-changelog-core-1.9.2.tgz", - "integrity": "sha512-L/boGKXaKWrlCU8bHa1QM36Pb/JopCPmekj5SFqqAuBfjya860xX2fAC5Ggelse++Bw39AZ2NrHwBnJrdwLlLw==", + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/conventional-changelog-core/-/conventional-changelog-core-1.9.3.tgz", + "integrity": "sha1-KJn+d5OJoynw7EsnRsNt3vuY2i0=", "dev": true, "requires": { - "conventional-changelog-writer": "2.0.1", - "conventional-commits-parser": "2.0.0", + "conventional-changelog-writer": "2.0.2", + "conventional-commits-parser": "2.0.1", "dateformat": "1.0.12", "get-pkg-repo": "1.4.0", - "git-raw-commits": "1.2.0", + "git-raw-commits": "1.3.0", "git-remote-origin-url": "2.0.0", - "git-semver-tags": "1.2.2", + "git-semver-tags": "1.2.3", "lodash": "4.17.4", "normalize-package-data": "2.4.0", - "q": "1.5.0", + "q": "1.5.1", "read-pkg": "1.1.0", "read-pkg-up": "1.0.1", "through2": "2.0.3" @@ -1846,30 +2028,30 @@ } }, "conventional-changelog-ember": { - "version": "0.2.8", - "resolved": "https://registry.npmjs.org/conventional-changelog-ember/-/conventional-changelog-ember-0.2.8.tgz", - "integrity": "sha512-smsh0o/S95n22lrQZrSHYjJrxIGoFl+OFHK+q2KGHA2zRFrW7QilYM7VUjgmB+emzwqFguPjrq+D2U8iPhMNJg==", + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/conventional-changelog-ember/-/conventional-changelog-ember-0.2.9.tgz", + "integrity": "sha1-jsc8wFTjqwZGZ/sf61L+jvGxZDg=", "dev": true, "requires": { - "q": "1.5.0" + "q": "1.5.1" } }, "conventional-changelog-eslint": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/conventional-changelog-eslint/-/conventional-changelog-eslint-0.2.0.tgz", - "integrity": "sha512-WGKnC0bGPD6BHGiRBfYqNGfy6DZDn2jGs1yxPRT8I2796wYdGqsbDF4477o4fdsxUJvckoW2OFPqkmRMQaCHSA==", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/conventional-changelog-eslint/-/conventional-changelog-eslint-0.2.1.tgz", + "integrity": "sha1-LCoRvrIW+AZJunKDQYApO2h8BmI=", "dev": true, "requires": { - "q": "1.5.0" + "q": "1.5.1" } }, "conventional-changelog-express": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/conventional-changelog-express/-/conventional-changelog-express-0.2.0.tgz", - "integrity": "sha512-ujSEmbWfozC1iIjH5Pl7AKtREowvAl10whs1q6c7nZLnoNZK5CmdB2PQ/V42O6rCgUzaLX+ACRW2+g0A/Htqvw==", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/conventional-changelog-express/-/conventional-changelog-express-0.2.1.tgz", + "integrity": "sha1-g42eHmyQmXA7FQucGaoteBdCvWw=", "dev": true, "requires": { - "q": "1.5.0" + "q": "1.5.1" } }, "conventional-changelog-jquery": { @@ -1878,7 +2060,7 @@ "integrity": "sha1-Agg5cWLjhGmG5xJztsecW1+A9RA=", "dev": true, "requires": { - "q": "1.5.0" + "q": "1.5.1" } }, "conventional-changelog-jscs": { @@ -1887,29 +2069,29 @@ "integrity": "sha1-BHnrRDzH1yxYvwvPDvHURKkvDlw=", "dev": true, "requires": { - "q": "1.5.0" + "q": "1.5.1" } }, "conventional-changelog-jshint": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/conventional-changelog-jshint/-/conventional-changelog-jshint-0.2.0.tgz", - "integrity": "sha512-uUP4c0et6F2teapl+YY2JHFAHD401U5CkgI+P8PyU0y1zS8BdBy6EnhqgZEXhFOp9fPzUdic+Wv/9alOqw3agQ==", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/conventional-changelog-jshint/-/conventional-changelog-jshint-0.2.1.tgz", + "integrity": "sha1-hhObs6yZiZ8rF36WF+CbN9mbzzo=", "dev": true, "requires": { "compare-func": "1.3.2", - "q": "1.5.0" + "q": "1.5.1" } }, "conventional-changelog-writer": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-2.0.1.tgz", - "integrity": "sha512-X4qC758celQOKw0iUPAsH5sJX6fH6N5dboFc3elXb1/SIKhsYMukhhaxWmxRdtVUSqGt9rZg8giwBQG5B2GeKg==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-2.0.2.tgz", + "integrity": "sha1-tYV97RsAHa+aeLnNQJJvRcE0lJs=", "dev": true, "requires": { "compare-func": "1.3.2", - "conventional-commits-filter": "1.0.0", + "conventional-commits-filter": "1.1.0", "dateformat": "1.0.12", - "handlebars": "4.0.10", + "handlebars": "4.0.11", "json-stringify-safe": "5.0.1", "lodash": "4.17.4", "meow": "3.7.0", @@ -1931,9 +2113,9 @@ } }, "conventional-commits-filter": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-1.0.0.tgz", - "integrity": "sha1-b8KmWTcrw/IznPn//34bA0S5MDk=", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-1.1.0.tgz", + "integrity": "sha1-H8Ka8wte2rdvVOIpxBGwxmPQ+es=", "dev": true, "requires": { "is-subset": "0.1.1", @@ -1941,9 +2123,9 @@ } }, "conventional-commits-parser": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-2.0.0.tgz", - "integrity": "sha512-8od6g684Fhi5Vpp4ABRv/RBsW1AY6wSHbJHEK6FGTv+8jvAAnlABniZu/FVmX9TcirkHepaEsa1QGkRvbg0CKw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-2.0.1.tgz", + "integrity": "sha1-HxXOa4RPfKQUlcgZDAgzwwuLFpM=", "dev": true, "requires": { "is-text-path": "1.0.1", @@ -1956,16 +2138,16 @@ } }, "conventional-recommended-bump": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/conventional-recommended-bump/-/conventional-recommended-bump-1.0.2.tgz", - "integrity": "sha512-kC4EvXsc+flKpmD0Aa98qVGG7qGqLsVswVT0ijicXiNPBkGQAOMPYg+JoFjBXAWYWw4Y6RsiEDL+JKLrp0RqXQ==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/conventional-recommended-bump/-/conventional-recommended-bump-1.0.3.tgz", + "integrity": "sha1-RytpsbjwnFxO1A/iikHmPMBL1zY=", "dev": true, "requires": { "concat-stream": "1.5.2", - "conventional-commits-filter": "1.0.0", - "conventional-commits-parser": "2.0.0", - "git-raw-commits": "1.2.0", - "git-semver-tags": "1.2.2", + "conventional-commits-filter": "1.1.0", + "conventional-commits-parser": "2.0.1", + "git-raw-commits": "1.3.0", + "git-semver-tags": "1.2.3", "meow": "3.7.0", "object-assign": "4.1.1" } @@ -1994,6 +2176,46 @@ "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "dev": true }, + "cosmiconfig": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-1.1.0.tgz", + "integrity": "sha1-DeoPmATv37kp+7GxiOJVU+oFPTc=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "js-yaml": "3.10.0", + "minimist": "1.2.0", + "object-assign": "4.1.1", + "os-homedir": "1.0.2", + "parse-json": "2.2.0", + "pinkie-promise": "2.0.1", + "require-from-string": "1.2.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + } + } + }, + "crc": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/crc/-/crc-3.5.0.tgz", + "integrity": "sha1-mLi6fUiWZbo5efWbITgTdBAaGWQ=", + "dev": true + }, + "crc32-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-2.0.0.tgz", + "integrity": "sha1-483TtN8xaN10494/u8t7KX/pCPQ=", + "dev": true, + "requires": { + "crc": "3.5.0", + "readable-stream": "2.3.3" + } + }, "create-ecdh": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.0.tgz", @@ -2004,9 +2226,18 @@ "elliptic": "6.4.0" } }, - "create-hash": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.1.3.tgz", + "create-error-class": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/create-error-class/-/create-error-class-3.0.2.tgz", + "integrity": "sha1-Br56vvlHo/FKMP1hBnHUAbyot7Y=", + "dev": true, + "requires": { + "capture-stack-trace": "1.0.0" + } + }, + "create-hash": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.1.3.tgz", "integrity": "sha1-YGBCrIuSYnUPSDyt2rD1gZFy2P0=", "dev": true, "requires": { @@ -2039,18 +2270,6 @@ "lru-cache": "4.1.1", "shebang-command": "1.2.0", "which": "1.3.0" - }, - "dependencies": { - "lru-cache": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.1.tgz", - "integrity": "sha512-q4spe4KTfsAS1SUHLO0wz8Qiyf1+vMIAgpRYioFYDMNqKfHQbg+AVDH3i4fvpl71/P1L0dBl+fQi+P37UYf0ew==", - "dev": true, - "requires": { - "pseudomap": "1.0.2", - "yallist": "2.1.2" - } - } } }, "cryptiles": { @@ -2074,9 +2293,9 @@ } }, "crypto-browserify": { - "version": "3.11.1", - "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.11.1.tgz", - "integrity": "sha512-Na7ZlwCOqoaW5RwUK1WpXws2kv8mNhWdTlzob0UXulk6G9BDbyiJaGTYBIX61Ozn9l1EPPJpICZb4DaOpT9NlQ==", + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", "dev": true, "requires": { "browserify-cipher": "1.0.0", @@ -2088,7 +2307,8 @@ "inherits": "2.0.3", "pbkdf2": "3.0.14", "public-encrypt": "4.0.0", - "randombytes": "2.0.5" + "randombytes": "2.0.5", + "randomfill": "1.0.3" } }, "cssom": { @@ -2121,15 +2341,6 @@ "integrity": "sha1-XQKkaFCt8bSjF5RqOSj8y1v9BCU=", "dev": true }, - "d": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", - "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", - "dev": true, - "requires": { - "es5-ext": "0.10.31" - } - }, "dargs": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/dargs/-/dargs-4.1.0.tgz", @@ -2148,6 +2359,12 @@ "assert-plus": "1.0.0" } }, + "date-fns": { + "version": "1.29.0", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-1.29.0.tgz", + "integrity": "sha512-lbTXWZ6M20cWH8N9S6afb0SBm6tMk+uUg6z3MqHPKE9atmsY3kJkTm8vKe93izJ2B2+q5MV990sM2CHgtAZaOw==", + "dev": true + }, "date-now": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", @@ -2198,6 +2415,12 @@ } } }, + "deep-extend": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.4.2.tgz", + "integrity": "sha1-SLaZwn4zS/ifEIkr5DL25MfTSn8=", + "dev": true + }, "deep-is": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", @@ -2210,7 +2433,7 @@ "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", "dev": true, "requires": { - "clone": "1.0.2" + "clone": "1.0.3" } }, "define-properties": { @@ -2341,10 +2564,16 @@ "randombytes": "2.0.5" } }, + "dlv": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.0.tgz", + "integrity": "sha1-/uGnxD9jvnXz9nnoUmLaXxAnZKc=", + "dev": true + }, "doctrine": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", - "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.0.0.tgz", + "integrity": "sha1-xz2NKQnSIpHhoAejlYBNqLZl/mM=", "dev": true, "requires": { "esutils": "2.0.2", @@ -2393,6 +2622,12 @@ "readable-stream": "2.3.3" } }, + "duplexer3": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", + "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=", + "dev": true + }, "duplexify": { "version": "3.5.1", "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.5.1.tgz", @@ -2416,6 +2651,16 @@ } } }, + "ecc-jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", + "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", + "dev": true, + "optional": true, + "requires": { + "jsbn": "0.1.1" + } + }, "ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", @@ -2423,9 +2668,15 @@ "dev": true }, "electron-to-chromium": { - "version": "1.3.25", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.25.tgz", - "integrity": "sha1-RTshAJg20Jl9hgNWAf9srkeRxGA=", + "version": "1.3.27", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.27.tgz", + "integrity": "sha1-eOy4o5kGYYe7N07t412ccFZagD0=", + "dev": true + }, + "elegant-spinner": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/elegant-spinner/-/elegant-spinner-1.0.1.tgz", + "integrity": "sha1-2wQ1IcldfjA/2PNFvtwzSc+wcp4=", "dev": true }, "elliptic": { @@ -2449,6 +2700,15 @@ "integrity": "sha1-eePVhlU0aQn+bw9Fpd5oEDspTSA=", "dev": true }, + "encoding": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", + "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=", + "dev": true, + "requires": { + "iconv-lite": "0.4.19" + } + }, "end-of-stream": { "version": "0.1.5", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-0.1.5.tgz", @@ -2596,90 +2856,6 @@ "is-symbol": "1.0.1" } }, - "es5-ext": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.31.tgz", - "integrity": "sha1-e7k4yVp/G59ygJLcCcQe3MOY7v4=", - "dev": true, - "requires": { - "es6-iterator": "2.0.1", - "es6-symbol": "3.1.1" - } - }, - "es6-iterator": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.1.tgz", - "integrity": "sha1-jjGcnwRTv1ddN0lAplWSDlnKVRI=", - "dev": true, - "requires": { - "d": "1.0.0", - "es5-ext": "0.10.31", - "es6-symbol": "3.1.1" - } - }, - "es6-map": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/es6-map/-/es6-map-0.1.5.tgz", - "integrity": "sha1-kTbgUD3MBqMBaQ8LsU/042TpSfA=", - "dev": true, - "requires": { - "d": "1.0.0", - "es5-ext": "0.10.31", - "es6-iterator": "2.0.1", - "es6-set": "0.1.5", - "es6-symbol": "3.1.1", - "event-emitter": "0.3.5" - } - }, - "es6-plato": { - "version": "1.0.14", - "resolved": "https://registry.npmjs.org/es6-plato/-/es6-plato-1.0.14.tgz", - "integrity": "sha1-CSfhXORiC9+OEfBaTVwd3GveW3s=", - "dev": true, - "requires": { - "eslint": "3.19.0", - "fs-extra": "2.1.2", - "glob": "7.1.2", - "lodash": "4.17.4", - "posix-getopt": "1.2.0", - "typhonjs-escomplex": "0.0.12" - } - }, - "es6-set": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.5.tgz", - "integrity": "sha1-0rPsXU2ADO2BjbU40ol02wpzzLE=", - "dev": true, - "requires": { - "d": "1.0.0", - "es5-ext": "0.10.31", - "es6-iterator": "2.0.1", - "es6-symbol": "3.1.1", - "event-emitter": "0.3.5" - } - }, - "es6-symbol": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", - "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", - "dev": true, - "requires": { - "d": "1.0.0", - "es5-ext": "0.10.31" - } - }, - "es6-weak-map": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.2.tgz", - "integrity": "sha1-XjqzIlH/0VOKH45f+hNXdy+S2W8=", - "dev": true, - "requires": { - "d": "1.0.0", - "es5-ext": "0.10.31", - "es6-iterator": "2.0.1", - "es6-symbol": "3.1.1" - } - }, "escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", @@ -2713,161 +2889,178 @@ } } }, - "escomplex-plugin-metrics-module": { - "version": "0.0.13", - "resolved": "https://registry.npmjs.org/escomplex-plugin-metrics-module/-/escomplex-plugin-metrics-module-0.0.13.tgz", - "integrity": "sha1-uj/ir5obBi3uDhMJO3HtOJodcWg=", - "dev": true, - "requires": { - "typhonjs-escomplex-commons": "0.0.16" - } - }, - "escomplex-plugin-metrics-project": { - "version": "0.0.13", - "resolved": "https://registry.npmjs.org/escomplex-plugin-metrics-project/-/escomplex-plugin-metrics-project-0.0.13.tgz", - "integrity": "sha1-cDSXc/DEsZPVjyHqEDLRN1vvD0U=", - "dev": true, - "requires": { - "typhonjs-escomplex-commons": "0.0.16" - } - }, - "escomplex-plugin-syntax-babylon": { - "version": "0.0.13", - "resolved": "https://registry.npmjs.org/escomplex-plugin-syntax-babylon/-/escomplex-plugin-syntax-babylon-0.0.13.tgz", - "integrity": "sha1-bh8pnyAR1IfdK0rOtxQ4SKC/23I=", - "dev": true, - "requires": { - "escomplex-plugin-syntax-estree": "0.0.13", - "typhonjs-escomplex-commons": "0.0.16" - } - }, - "escomplex-plugin-syntax-estree": { - "version": "0.0.13", - "resolved": "https://registry.npmjs.org/escomplex-plugin-syntax-estree/-/escomplex-plugin-syntax-estree-0.0.13.tgz", - "integrity": "sha1-/BKGZxuMpo8fC4Abc2SwNBgvIUU=", - "dev": true, - "requires": { - "typhonjs-escomplex-commons": "0.0.16" - } - }, - "escope": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/escope/-/escope-3.6.0.tgz", - "integrity": "sha1-4Bl16BJ4GhY6ba392AOY3GTIicM=", - "dev": true, - "requires": { - "es6-map": "0.1.5", - "es6-weak-map": "2.0.2", - "esrecurse": "4.2.0", - "estraverse": "4.2.0" - } - }, "eslint": { - "version": "3.19.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-3.19.0.tgz", - "integrity": "sha1-yPxiAcf0DdCJQbh8CFdnOGpnmsw=", + "version": "4.11.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.11.0.tgz", + "integrity": "sha512-UWbhQpaKlm8h5x/VLwm0S1kheMrDj8jPwhnBMjr/Dlo3qqT7MvcN/UfKAR3E1N4lr4YNtOvS4m3hwsrVc/ky7g==", "dev": true, "requires": { + "ajv": "5.4.0", "babel-code-frame": "6.26.0", - "chalk": "1.1.3", - "concat-stream": "1.5.2", - "debug": "2.6.9", + "chalk": "2.3.0", + "concat-stream": "1.6.0", + "cross-spawn": "5.1.0", + "debug": "3.1.0", "doctrine": "2.0.0", - "escope": "3.6.0", - "espree": "3.5.1", + "eslint-scope": "3.7.1", + "espree": "3.5.2", "esquery": "1.0.0", "estraverse": "4.2.0", "esutils": "2.0.2", "file-entry-cache": "2.0.0", + "functional-red-black-tree": "1.0.1", "glob": "7.1.2", "globals": "9.18.0", - "ignore": "3.3.5", + "ignore": "3.3.7", "imurmurhash": "0.1.4", - "inquirer": "0.12.0", - "is-my-json-valid": "2.16.1", + "inquirer": "3.3.0", "is-resolvable": "1.0.0", "js-yaml": "3.10.0", - "json-stable-stringify": "1.0.1", + "json-stable-stringify-without-jsonify": "1.0.1", "levn": "0.3.0", "lodash": "4.17.4", + "minimatch": "3.0.4", "mkdirp": "0.5.1", "natural-compare": "1.4.0", "optionator": "0.8.2", "path-is-inside": "1.0.2", - "pluralize": "1.2.1", - "progress": "1.1.8", + "pluralize": "7.0.0", + "progress": "2.0.0", "require-uncached": "1.0.3", - "shelljs": "0.7.8", - "strip-bom": "3.0.0", + "semver": "5.4.1", + "strip-ansi": "4.0.0", "strip-json-comments": "2.0.1", - "table": "3.8.3", - "text-table": "0.2.0", - "user-home": "2.0.0" + "table": "4.0.2", + "text-table": "0.2.0" }, "dependencies": { - "doctrine": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.0.0.tgz", - "integrity": "sha1-xz2NKQnSIpHhoAejlYBNqLZl/mM=", + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", + "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", "dev": true, "requires": { - "esutils": "2.0.2", - "isarray": "1.0.0" + "color-convert": "1.9.1" } }, - "json-stable-stringify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", - "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", + "chalk": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", + "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", "dev": true, "requires": { - "jsonify": "0.0.0" + "ansi-styles": "3.2.0", + "escape-string-regexp": "1.0.5", + "supports-color": "4.5.0" } }, - "strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", - "dev": true + "concat-stream": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.0.tgz", + "integrity": "sha1-CqxmL9Ur54lk1VMvaUeE5wEQrPc=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "readable-stream": "2.3.3", + "typedarray": "0.0.6" + } }, - "user-home": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/user-home/-/user-home-2.0.0.tgz", - "integrity": "sha1-nHC/2Babwdy/SGBODwS4tJzenp8=", + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } + }, + "supports-color": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", + "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", "dev": true, "requires": { - "os-homedir": "1.0.2" + "has-flag": "2.0.0" } } } }, + "eslint-config-google": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/eslint-config-google/-/eslint-config-google-0.9.1.tgz", + "integrity": "sha512-5A83D+lH0PA81QMESKbLJd/a3ic8tPZtwUmqNrxMRo54nfFaUvtt89q/+icQ+fd66c2xQHn0KyFkzJDoAUfpZA==", + "dev": true + }, + "eslint-config-liferay": { + "version": "2.0.16", + "resolved": "https://registry.npmjs.org/eslint-config-liferay/-/eslint-config-liferay-2.0.16.tgz", + "integrity": "sha512-ToBCKv7qVu9F3px/jXR2dUnUCJlvEdlgJoHFs+0ESzfwkJ1zx5c8Sydn86YI5jTJLzvmUWKiwk6JCwUMGme61A==", + "dev": true, + "requires": { + "eslint-config-google": "0.9.1", + "eslint-plugin-liferayportal": "1.0.1" + } + }, + "eslint-plugin-liferayportal": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-liferayportal/-/eslint-plugin-liferayportal-1.0.1.tgz", + "integrity": "sha512-YOqhDwqtj/K4BSH6ToMMTONHX7VASQoVv2iwPIsetD0aV5DywdTpdj0ZOA8eY9jmhfl+aFbbUjy6jD0YqE2suw==", + "dev": true, + "requires": { + "requireindex": "1.1.0" + } + }, "eslint-plugin-react": { - "version": "6.10.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-6.10.3.tgz", - "integrity": "sha1-xUNb6wZ3ThLH2y9qut3L+QDNP3g=", + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.5.1.tgz", + "integrity": "sha512-YGSjB9Qu6QbVTroUZi66pYky3DfoIPLdHQ/wmrBGyBRnwxQsBXAov9j2rpXt/55i8nyMv6IRWJv2s4d4YnduzQ==", "dev": true, "requires": { - "array.prototype.find": "2.0.4", - "doctrine": "1.5.0", + "doctrine": "2.0.0", "has": "1.0.1", - "jsx-ast-utils": "1.4.1", - "object.assign": "4.0.4" + "jsx-ast-utils": "2.0.1", + "prop-types": "15.6.0" + } + }, + "eslint-scope": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.1.tgz", + "integrity": "sha1-PWPD7f2gLgbgGkUq2IyqzHzctug=", + "dev": true, + "requires": { + "esrecurse": "4.2.0", + "estraverse": "4.2.0" } }, "espree": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.1.tgz", - "integrity": "sha1-DJiLirRttTEAoZVK5LqZXd0n2H4=", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.2.tgz", + "integrity": "sha512-sadKeYwaR/aJ3stC2CdvgXu1T16TdYN+qwCpcWbMnGJ8s0zNWemzrvb2GbD4OhmJ/fwpJjudThAlLobGbWZbCQ==", "dev": true, "requires": { - "acorn": "5.1.2", + "acorn": "5.2.1", "acorn-jsx": "3.0.1" }, "dependencies": { "acorn": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.1.2.tgz", - "integrity": "sha512-o96FZLJBPY1lvTuJylGA9Bk3t/GKPPJG8H0ydQQl01crzwJgspa4AEIq/pVTXigmK0PHVQhiAtn8WMBLL9D2WA==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.2.1.tgz", + "integrity": "sha512-jG0u7c4Ly+3QkkW18V+NRDN+4bWHdln30NL1ZL2AvFZZmQe/BfopYCtghCKKVBUSetZ4QKcyA0pY6/4Gw8Pv8w==", "dev": true } } @@ -2909,16 +3102,6 @@ "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", "dev": true }, - "event-emitter": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", - "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", - "dev": true, - "requires": { - "d": "1.0.0", - "es5-ext": "0.10.31" - } - }, "eventemitter3": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-1.2.0.tgz", @@ -3055,31 +3238,14 @@ } }, "external-editor": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.0.5.tgz", - "integrity": "sha512-Msjo64WT5W+NhOpQXh0nOHm+n0RfU1QUwDnKYvJ8dEJ8zlwLrqXNTv5mSUTJpepf41PDJGyhueTw2vNZW+Fr/w==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.1.0.tgz", + "integrity": "sha512-E44iT5QVOUJBKij4IIV3uvxuNlbKS38Tw1HiupxEIHPv9qtC2PrDYohbXV5U+1jnfIXttny8gUhj+oZvflFlzA==", "dev": true, "requires": { + "chardet": "0.4.0", "iconv-lite": "0.4.19", - "jschardet": "1.5.1", "tmp": "0.0.33" - }, - "dependencies": { - "iconv-lite": { - "version": "0.4.19", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", - "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==", - "dev": true - }, - "tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "dev": true, - "requires": { - "os-tmpdir": "1.0.2" - } - } } }, "extglob": { @@ -3113,20 +3279,48 @@ "integrity": "sha1-liVqO8l1WV6zbYLpkp0GDYk0Of8=", "dev": true }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true + }, "fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, + "fbjs": { + "version": "0.8.16", + "resolved": "https://registry.npmjs.org/fbjs/-/fbjs-0.8.16.tgz", + "integrity": "sha1-XmdDL1UNxBtXK/VYR7ispk5TN9s=", + "dev": true, + "requires": { + "core-js": "1.2.7", + "isomorphic-fetch": "2.2.1", + "loose-envify": "1.3.1", + "object-assign": "4.1.1", + "promise": "7.3.1", + "setimmediate": "1.0.5", + "ua-parser-js": "0.7.17" + }, + "dependencies": { + "core-js": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-1.2.7.tgz", + "integrity": "sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY=", + "dev": true + } + } + }, "figures": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", - "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", "dev": true, "requires": { - "escape-string-regexp": "1.0.5", - "object-assign": "4.1.1" + "escape-string-regexp": "1.0.5" } }, "file-entry-cache": { @@ -3171,6 +3365,14 @@ "parseurl": "1.3.2", "statuses": "1.3.1", "unpipe": "1.0.0" + }, + "dependencies": { + "statuses": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", + "integrity": "sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4=", + "dev": true + } } }, "find-index": { @@ -3318,13 +3520,14 @@ "dev": true }, "fs-extra": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-2.1.2.tgz", - "integrity": "sha1-BGxwFjzvmq1GsOSn+kZ/si1x3jU=", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.2.tgz", + "integrity": "sha1-+RcExT0bRh+JNFKwwwfZmXZHq2s=", "dev": true, "requires": { "graceful-fs": "4.1.11", - "jsonfile": "2.4.0" + "jsonfile": "4.0.0", + "universalify": "0.1.1" } }, "fs.realpath": { @@ -3333,7695 +3536,1459 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, - "gauge": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", - "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", - "dev": true, - "requires": { - "aproba": "1.2.0", - "console-control-strings": "1.1.0", - "has-unicode": "2.0.1", - "object-assign": "4.1.1", - "signal-exit": "3.0.2", - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "wide-align": "1.1.2" - } - }, - "gaze": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/gaze/-/gaze-0.5.2.tgz", - "integrity": "sha1-QLcJU30k0dRXZ9takIaJ3+aaxE8=", + "fsevents": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.3.tgz", + "integrity": "sha512-WIr7iDkdmdbxu/Gh6eKEZJL6KPE74/5MEsf2whTOFNxbIoIixogroLdKYqB6FDav4Wavh/lZdzzd3b2KxIXC5Q==", "dev": true, + "optional": true, "requires": { - "globule": "0.1.0" - } - }, - "generate-function": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz", - "integrity": "sha1-aFj+fAlpt9TpCTM3ZHrHn2DfvnQ=", - "dev": true - }, - "generate-object-property": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", - "integrity": "sha1-nA4cQDCM6AT0eDYYuTf6iPmdUNA=", - "dev": true, - "requires": { - "is-property": "1.0.2" - } - }, - "get-caller-file": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.2.tgz", - "integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=", - "dev": true - }, - "get-pkg-repo": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/get-pkg-repo/-/get-pkg-repo-1.4.0.tgz", - "integrity": "sha1-xztInAbYDMVTbCyFP54FIyBWly0=", - "dev": true, - "requires": { - "hosted-git-info": "2.5.0", - "meow": "3.7.0", - "normalize-package-data": "2.4.0", - "parse-github-repo-url": "1.4.1", - "through2": "2.0.3" - } - }, - "get-port": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/get-port/-/get-port-3.2.0.tgz", - "integrity": "sha1-3Xzn3hh8Bsi/NTeWrHHgmfCYDrw=", - "dev": true - }, - "get-stdin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", - "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", - "dev": true - }, - "get-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", - "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", - "dev": true - }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "dev": true, - "requires": { - "assert-plus": "1.0.0" - } - }, - "git-raw-commits": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-1.2.0.tgz", - "integrity": "sha1-DzqL/ZmuDy2LkiTViJKXXppS0Dw=", - "dev": true, - "requires": { - "dargs": "4.1.0", - "lodash.template": "4.4.0", - "meow": "3.7.0", - "split2": "2.2.0", - "through2": "2.0.3" - }, - "dependencies": { - "lodash.template": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.4.0.tgz", - "integrity": "sha1-5zoDhcg1VZF0bgILmWecaQ5o+6A=", - "dev": true, - "requires": { - "lodash._reinterpolate": "3.0.0", - "lodash.templatesettings": "4.1.0" - } - }, - "lodash.templatesettings": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-4.1.0.tgz", - "integrity": "sha1-K01OlbpEDZFf8IvImeRVNmZxMxY=", - "dev": true, - "requires": { - "lodash._reinterpolate": "3.0.0" - } - } - } - }, - "git-remote-origin-url": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/git-remote-origin-url/-/git-remote-origin-url-2.0.0.tgz", - "integrity": "sha1-UoJlna4hBxRaERJhEq0yFuxfpl8=", - "dev": true, - "requires": { - "gitconfiglocal": "1.0.0", - "pify": "2.3.0" - } - }, - "git-semver-tags": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/git-semver-tags/-/git-semver-tags-1.2.2.tgz", - "integrity": "sha512-fhINopzKBQ8m6YlQt7gPf6T6hFnTF84O7U+8kYJmfjjKk7gbmKGj+BLcKNWi+japPbBwCeXXnfKwThpJpR9ZnQ==", - "dev": true, - "requires": { - "meow": "3.7.0", - "semver": "5.4.1" - } - }, - "gitconfiglocal": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/gitconfiglocal/-/gitconfiglocal-1.0.0.tgz", - "integrity": "sha1-QdBF84UaXqiPA/JMocYXgRRGS5s=", - "dev": true, - "requires": { - "ini": "1.3.4" - } - }, - "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", - "dev": true, - "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - }, - "glob-base": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", - "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", - "dev": true, - "requires": { - "glob-parent": "2.0.0", - "is-glob": "2.0.1" - } - }, - "glob-expand": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/glob-expand/-/glob-expand-0.1.0.tgz", - "integrity": "sha1-+rNWBjkewYFwPB8KonqHzQW/mjA=", - "dev": true, - "requires": { - "glob": "4.4.2", - "lodash": "1.2.1" - }, - "dependencies": { - "glob": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-4.4.2.tgz", - "integrity": "sha1-Pvk+KX7glsG5s/+x0hAlx4q2BUg=", - "dev": true, - "requires": { - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "2.0.10", - "once": "1.4.0" - } - }, - "lodash": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-1.2.1.tgz", - "integrity": "sha1-7UexbkbwaytAMJto6RY8F+k+owQ=", - "dev": true - }, - "minimatch": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz", - "integrity": "sha1-jQh8OcazjAAbl/ynzm0OHoCvusc=", - "dev": true, - "requires": { - "brace-expansion": "1.1.8" - } - } - } - }, - "glob-parent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", - "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", - "dev": true, - "requires": { - "is-glob": "2.0.1" - } - }, - "glob-stream": { - "version": "3.1.18", - "resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-3.1.18.tgz", - "integrity": "sha1-kXCl8St5Awb9/lmPMT+PeVT9FDs=", - "dev": true, - "requires": { - "glob": "4.5.3", - "glob2base": "0.0.12", - "minimatch": "2.0.10", - "ordered-read-streams": "0.1.0", - "through2": "0.6.5", - "unique-stream": "1.0.0" - }, - "dependencies": { - "glob": { - "version": "4.5.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-4.5.3.tgz", - "integrity": "sha1-xstz0yJsHv7wTePFbQEvAzd+4V8=", - "dev": true, - "requires": { - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "2.0.10", - "once": "1.4.0" - } - }, - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - }, - "minimatch": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz", - "integrity": "sha1-jQh8OcazjAAbl/ynzm0OHoCvusc=", - "dev": true, - "requires": { - "brace-expansion": "1.1.8" - } - }, - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" - } - }, - "through2": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", - "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", - "dev": true, - "requires": { - "readable-stream": "1.0.34", - "xtend": "4.0.1" - } - } - } - }, - "glob-watcher": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/glob-watcher/-/glob-watcher-0.0.6.tgz", - "integrity": "sha1-uVtKjfdLOcgymLDAXJeLTZo7cQs=", - "dev": true, - "requires": { - "gaze": "0.5.2" - } - }, - "glob2base": { - "version": "0.0.12", - "resolved": "https://registry.npmjs.org/glob2base/-/glob2base-0.0.12.tgz", - "integrity": "sha1-nUGbPijxLoOjYhZKJ3BVkiycDVY=", - "dev": true, - "requires": { - "find-index": "0.1.1" - } - }, - "global-modules": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-0.2.3.tgz", - "integrity": "sha1-6lo77ULG1s6ZWk+KEmm12uIjgo0=", - "dev": true, - "requires": { - "global-prefix": "0.1.5", - "is-windows": "0.2.0" - } - }, - "global-prefix": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-0.1.5.tgz", - "integrity": "sha1-jTvGuNo8qBEqFg2NSW/wRiv+948=", - "dev": true, - "requires": { - "homedir-polyfill": "1.0.1", - "ini": "1.3.4", - "is-windows": "0.2.0", - "which": "1.3.0" - } - }, - "globals": { - "version": "9.18.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", - "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", - "dev": true - }, - "globby": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", - "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", - "dev": true, - "requires": { - "array-union": "1.0.2", - "arrify": "1.0.1", - "glob": "7.1.2", - "object-assign": "4.1.1", - "pify": "2.3.0", - "pinkie-promise": "2.0.1" - } - }, - "globule": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/globule/-/globule-0.1.0.tgz", - "integrity": "sha1-2cjt3h2nnRJaFRt5UzuXhnY0auU=", - "dev": true, - "requires": { - "glob": "3.1.21", - "lodash": "1.0.2", - "minimatch": "0.2.14" - }, - "dependencies": { - "glob": { - "version": "3.1.21", - "resolved": "https://registry.npmjs.org/glob/-/glob-3.1.21.tgz", - "integrity": "sha1-0p4KBV3qUTj00H7UDomC6DwgZs0=", - "dev": true, - "requires": { - "graceful-fs": "1.2.3", - "inherits": "1.0.2", - "minimatch": "0.2.14" - } - }, - "graceful-fs": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.3.tgz", - "integrity": "sha1-FaSAaldUfLLS2/J/QuiajDRRs2Q=", - "dev": true - }, - "inherits": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-1.0.2.tgz", - "integrity": "sha1-ykMJ2t7mtUzAuNJH6NfHoJdb3Js=", - "dev": true - }, - "lodash": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-1.0.2.tgz", - "integrity": "sha1-j1dWDIO1n8JwvT1WG2kAQ0MOJVE=", - "dev": true - }, - "minimatch": { - "version": "0.2.14", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", - "integrity": "sha1-x054BXT2PG+aCQ6Q775u9TpqdWo=", - "dev": true, - "requires": { - "lru-cache": "2.7.3", - "sigmund": "1.0.1" - } - } - } - }, - "glogg": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/glogg/-/glogg-1.0.0.tgz", - "integrity": "sha1-f+DxmfV6yQbPUS/urY+Q7kooT8U=", - "dev": true, - "requires": { - "sparkles": "1.0.0" - } - }, - "graceful-fs": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", - "dev": true - }, - "growl": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.9.2.tgz", - "integrity": "sha1-Dqd0NxXbjY3ixe3hd14bRayFwC8=", - "dev": true - }, - "gulp": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/gulp/-/gulp-3.9.1.tgz", - "integrity": "sha1-VxzkWSjdQK9lFPxAEYZgFsE4RbQ=", - "dev": true, - "requires": { - "archy": "1.0.0", - "chalk": "1.1.3", - "deprecated": "0.0.1", - "gulp-util": "3.0.8", - "interpret": "1.0.4", - "liftoff": "2.3.0", - "minimist": "1.2.0", - "orchestrator": "0.3.8", - "pretty-hrtime": "1.0.3", - "semver": "4.3.6", - "tildify": "1.2.0", - "v8flags": "2.1.1", - "vinyl-fs": "0.3.14" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - }, - "semver": { - "version": "4.3.6", - "resolved": "https://registry.npmjs.org/semver/-/semver-4.3.6.tgz", - "integrity": "sha1-MAvG4OhjdPe6YQaLWx7NV/xlMto=", - "dev": true - } - } - }, - "gulp-autoprefixer": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/gulp-autoprefixer/-/gulp-autoprefixer-3.1.1.tgz", - "integrity": "sha1-dSMAUc0NFxND14O36bXREg7u+bA=", - "dev": true, - "requires": { - "autoprefixer": "6.7.7", - "gulp-util": "3.0.8", - "postcss": "5.2.18", - "through2": "2.0.3", - "vinyl-sourcemaps-apply": "0.2.1" - } - }, - "gulp-babel": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/gulp-babel/-/gulp-babel-6.1.2.tgz", - "integrity": "sha1-fAF25Lo/JExgWIoMSzIKRdGt784=", - "dev": true, - "requires": { - "babel-core": "6.26.0", - "gulp-util": "3.0.8", - "object-assign": "4.1.1", - "replace-ext": "0.0.1", - "through2": "2.0.3", - "vinyl-sourcemaps-apply": "0.2.1" - } - }, - "gulp-if": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/gulp-if/-/gulp-if-2.0.2.tgz", - "integrity": "sha1-pJe351cwBQQcqivIt92jyARE1ik=", - "dev": true, - "requires": { - "gulp-match": "1.0.3", - "ternary-stream": "2.0.1", - "through2": "2.0.3" - } - }, - "gulp-ignore": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/gulp-ignore/-/gulp-ignore-2.0.2.tgz", - "integrity": "sha1-XC6ioKRALgq0orzRLv2SlTRNePI=", - "dev": true, - "requires": { - "gulp-match": "1.0.3", - "through2": "2.0.3" - } - }, - "gulp-match": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/gulp-match/-/gulp-match-1.0.3.tgz", - "integrity": "sha1-kcfA1/Kb7NZgbVfYCn+Hdqh6uo4=", - "dev": true, - "requires": { - "minimatch": "3.0.4" - } - }, - "gulp-metal": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/gulp-metal/-/gulp-metal-1.12.2.tgz", - "integrity": "sha512-SfD7B/3gdc+go261GWql9i/08yq24ZKnTVSzdRpBvdn5n9yZXcWBghxW0zzAQxhgHGBNh1dKakT6i6NUtzcu9Q==", - "dev": true, - "requires": { - "babel-preset-es2015": "6.24.1", - "babel-register": "6.24.1", - "del": "2.2.2", - "es6-plato": "1.0.14", - "eslint": "3.19.0", - "glob-expand": "0.1.0", - "gulp": "3.9.1", - "gulp-autoprefixer": "3.1.1", - "gulp-concat": "2.6.1", - "gulp-esformatter": "5.0.0", - "gulp-eslint": "3.0.1", - "gulp-jshint": "2.0.4", - "gulp-mocha": "2.2.0", - "gulp-rename": "1.2.2", - "gulp-sass": "2.3.2", - "gulp-uglify": "1.5.4", - "gulp-util": "3.0.8", - "jsdoc": "3.4.3", - "jshint": "2.9.4", - "jshint-stylish": "2.2.1", - "karma": "1.7.0", - "karma-firefox-launcher": "0.1.7", - "karma-ievms": "0.1.0", - "karma-safari-launcher": "0.1.1", - "karma-sauce-launcher": "0.3.1", - "merge": "1.2.0", - "metal-karma-config": "2.3.1", - "metal-tools-build-amd": "3.0.3", - "metal-tools-build-globals": "2.0.2", - "metal-tools-build-jquery": "2.0.2", - "metal-tools-soy": "3.1.0", - "open": "0.0.5", - "run-sequence": "1.2.2", - "typhonjs-escomplex": "0.0.12" + "nan": "2.8.0", + "node-pre-gyp": "0.6.39" }, "dependencies": { "abbrev": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "accepts": { - "version": "1.3.3", - "bundled": true, - "dev": true, - "requires": { - "mime-types": "2.1.15", - "negotiator": "0.6.1" - } - }, - "acorn": { - "version": "5.0.3", - "bundled": true, - "dev": true - }, - "acorn-jsx": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "requires": { - "acorn": "3.3.0" - }, - "dependencies": { - "acorn": { - "version": "3.3.0", - "bundled": true, - "dev": true - } - } - }, - "adm-zip": { - "version": "0.4.7", - "bundled": true, - "dev": true - }, - "after": { - "version": "0.8.2", - "bundled": true, - "dev": true - }, - "agent-base": { - "version": "2.1.1", - "bundled": true, - "dev": true, - "requires": { - "extend": "3.0.1", - "semver": "5.0.3" - }, - "dependencies": { - "semver": { - "version": "5.0.3", - "bundled": true, - "dev": true - } - } - }, - "ajv": { - "version": "4.11.8", - "bundled": true, - "dev": true, - "requires": { - "co": "4.6.0", - "json-stable-stringify": "1.0.1" - } - }, - "ajv-keywords": { - "version": "1.5.1", - "bundled": true, - "dev": true - }, - "align-text": { - "version": "0.1.4", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "3.2.2", - "longest": "1.0.1", - "repeat-string": "1.6.1" - } - }, - "amdefine": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "ansi-escapes": { - "version": "1.4.0", - "bundled": true, - "dev": true - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "ansi-styles": { - "version": "2.2.1", - "bundled": true, - "dev": true - }, - "anymatch": { - "version": "1.3.0", - "bundled": true, - "dev": true, - "requires": { - "arrify": "1.0.1", - "micromatch": "2.3.11" - } - }, - "aproba": { - "version": "1.1.2", - "bundled": true, - "dev": true - }, - "archiver": { - "version": "0.14.4", - "bundled": true, - "dev": true, - "requires": { - "async": "0.9.2", - "buffer-crc32": "0.2.13", - "glob": "4.3.5", - "lazystream": "0.1.0", - "lodash": "3.2.0", - "readable-stream": "1.0.34", - "tar-stream": "1.1.5", - "zip-stream": "0.5.2" - }, - "dependencies": { - "async": { - "version": "0.9.2", - "bundled": true, - "dev": true - }, - "glob": { - "version": "4.3.5", - "bundled": true, - "dev": true, - "requires": { - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "2.0.10", - "once": "1.4.0" - } - }, - "isarray": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "lodash": { - "version": "3.2.0", - "bundled": true, - "dev": true - }, - "minimatch": { - "version": "2.0.10", - "bundled": true, - "dev": true, - "requires": { - "brace-expansion": "1.1.8" - } - }, - "readable-stream": { - "version": "1.0.34", - "bundled": true, - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" - } - }, - "string_decoder": { - "version": "0.10.31", - "bundled": true, - "dev": true - } - } - }, - "are-we-there-yet": { - "version": "1.1.4", - "bundled": true, - "dev": true, - "requires": { - "delegates": "1.0.0", - "readable-stream": "2.2.11" - } - }, - "argparse": { - "version": "1.0.9", - "bundled": true, - "dev": true, - "requires": { - "sprintf-js": "1.0.3" - } - }, - "arr-diff": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "arr-flatten": "1.0.3" - } - }, - "arr-flatten": { - "version": "1.0.3", - "bundled": true, - "dev": true - }, - "array-differ": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "array-find-index": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "array-slice": { - "version": "0.2.3", - "bundled": true, - "dev": true - }, - "array-union": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "array-uniq": "1.0.3" - } - }, - "array-uniq": { - "version": "1.0.3", - "bundled": true, - "dev": true - }, - "array-unique": { - "version": "0.2.1", - "bundled": true, - "dev": true - }, - "arraybuffer.slice": { - "version": "0.0.6", - "bundled": true, - "dev": true - }, - "arrify": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "asn1": { - "version": "0.2.3", - "bundled": true, - "dev": true - }, - "assert-plus": { - "version": "0.2.0", - "bundled": true, - "dev": true - }, - "assertion-error": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "async": { - "version": "0.2.10", - "bundled": true, - "dev": true - }, - "async-each": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "async-foreach": { - "version": "0.1.3", - "bundled": true, - "dev": true - }, - "asynckit": { - "version": "0.4.0", - "bundled": true, - "dev": true - }, - "aws-sign2": { - "version": "0.6.0", - "bundled": true, - "dev": true - }, - "aws4": { - "version": "1.6.0", - "bundled": true, - "dev": true - }, - "babel-code-frame": { - "version": "6.22.0", - "bundled": true, - "dev": true, - "requires": { - "chalk": "1.1.3", - "esutils": "2.0.2", - "js-tokens": "3.0.1" - } - }, - "babel-core": { - "version": "6.25.0", - "bundled": true, - "dev": true, - "requires": { - "babel-code-frame": "6.22.0", - "babel-generator": "6.25.0", - "babel-helpers": "6.24.1", - "babel-messages": "6.23.0", - "babel-register": "6.24.1", - "babel-runtime": "6.23.0", - "babel-template": "6.25.0", - "babel-traverse": "6.25.0", - "babel-types": "6.25.0", - "babylon": "6.17.3", - "convert-source-map": "1.5.0", - "debug": "2.6.8", - "json5": "0.5.1", - "lodash": "4.17.4", - "minimatch": "3.0.4", - "path-is-absolute": "1.0.1", - "private": "0.1.7", - "slash": "1.0.0", - "source-map": "0.5.6" - } - }, - "babel-deps": { - "version": "2.1.0", - "bundled": true, - "dev": true, - "requires": { - "babel-core": "6.25.0", - "merge": "1.2.0" - } - }, - "babel-generator": { - "version": "6.25.0", - "bundled": true, - "dev": true, - "requires": { - "babel-messages": "6.23.0", - "babel-runtime": "6.23.0", - "babel-types": "6.25.0", - "detect-indent": "4.0.0", - "jsesc": "1.3.0", - "lodash": "4.17.4", - "source-map": "0.5.6", - "trim-right": "1.0.1" - }, - "dependencies": { - "jsesc": { - "version": "1.3.0", - "bundled": true, - "dev": true - } - } - }, - "babel-globals": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "babel-core": "6.25.0", - "babel-deps": "2.1.0", - "babel-plugin-external-helpers-2": "6.3.13", - "babel-plugin-globals": "2.0.1", - "concat-with-sourcemaps": "1.0.4" - } - }, - "babel-helper-call-delegate": { - "version": "6.24.1", - "bundled": true, - "dev": true, - "requires": { - "babel-helper-hoist-variables": "6.24.1", - "babel-runtime": "6.23.0", - "babel-traverse": "6.25.0", - "babel-types": "6.25.0" - } - }, - "babel-helper-define-map": { - "version": "6.24.1", - "bundled": true, - "dev": true, - "requires": { - "babel-helper-function-name": "6.24.1", - "babel-runtime": "6.23.0", - "babel-types": "6.25.0", - "lodash": "4.17.4" - } - }, - "babel-helper-function-name": { - "version": "6.24.1", - "bundled": true, - "dev": true, - "requires": { - "babel-helper-get-function-arity": "6.24.1", - "babel-runtime": "6.23.0", - "babel-template": "6.25.0", - "babel-traverse": "6.25.0", - "babel-types": "6.25.0" - } - }, - "babel-helper-get-function-arity": { - "version": "6.24.1", - "bundled": true, - "dev": true, - "requires": { - "babel-runtime": "6.23.0", - "babel-types": "6.25.0" - } - }, - "babel-helper-hoist-variables": { - "version": "6.24.1", - "bundled": true, - "dev": true, - "requires": { - "babel-runtime": "6.23.0", - "babel-types": "6.25.0" - } - }, - "babel-helper-optimise-call-expression": { - "version": "6.24.1", - "bundled": true, - "dev": true, - "requires": { - "babel-runtime": "6.23.0", - "babel-types": "6.25.0" - } - }, - "babel-helper-regex": { - "version": "6.24.1", - "bundled": true, - "dev": true, - "requires": { - "babel-runtime": "6.23.0", - "babel-types": "6.25.0", - "lodash": "4.17.4" - } - }, - "babel-helper-replace-supers": { - "version": "6.24.1", - "bundled": true, - "dev": true, - "requires": { - "babel-helper-optimise-call-expression": "6.24.1", - "babel-messages": "6.23.0", - "babel-runtime": "6.23.0", - "babel-template": "6.25.0", - "babel-traverse": "6.25.0", - "babel-types": "6.25.0" - } - }, - "babel-helpers": { - "version": "6.24.1", - "bundled": true, - "dev": true, - "requires": { - "babel-runtime": "6.23.0", - "babel-template": "6.25.0" - } - }, - "babel-messages": { - "version": "6.23.0", - "bundled": true, - "dev": true, - "requires": { - "babel-runtime": "6.23.0" - } - }, - "babel-plugin-check-es2015-constants": { - "version": "6.22.0", - "bundled": true, - "dev": true, - "requires": { - "babel-runtime": "6.23.0" - } - }, - "babel-plugin-external-helpers-2": { - "version": "6.3.13", - "bundled": true, - "dev": true, - "requires": { - "babel-runtime": "5.8.38" - }, - "dependencies": { - "babel-runtime": { - "version": "5.8.38", - "bundled": true, - "dev": true, - "requires": { - "core-js": "1.2.7" - } - }, - "core-js": { - "version": "1.2.7", - "bundled": true, - "dev": true - } - } - }, - "babel-plugin-globals": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "babel-core": "6.25.0" - } - }, - "babel-plugin-transform-es2015-arrow-functions": { - "version": "6.22.0", - "bundled": true, - "dev": true, - "requires": { - "babel-runtime": "6.23.0" - } - }, - "babel-plugin-transform-es2015-block-scoped-functions": { - "version": "6.22.0", - "bundled": true, - "dev": true, - "requires": { - "babel-runtime": "6.23.0" - } - }, - "babel-plugin-transform-es2015-block-scoping": { - "version": "6.24.1", - "bundled": true, - "dev": true, - "requires": { - "babel-runtime": "6.23.0", - "babel-template": "6.25.0", - "babel-traverse": "6.25.0", - "babel-types": "6.25.0", - "lodash": "4.17.4" - } - }, - "babel-plugin-transform-es2015-classes": { - "version": "6.24.1", - "bundled": true, - "dev": true, - "requires": { - "babel-helper-define-map": "6.24.1", - "babel-helper-function-name": "6.24.1", - "babel-helper-optimise-call-expression": "6.24.1", - "babel-helper-replace-supers": "6.24.1", - "babel-messages": "6.23.0", - "babel-runtime": "6.23.0", - "babel-template": "6.25.0", - "babel-traverse": "6.25.0", - "babel-types": "6.25.0" - } - }, - "babel-plugin-transform-es2015-computed-properties": { - "version": "6.24.1", - "bundled": true, - "dev": true, - "requires": { - "babel-runtime": "6.23.0", - "babel-template": "6.25.0" - } - }, - "babel-plugin-transform-es2015-destructuring": { - "version": "6.23.0", - "bundled": true, - "dev": true, - "requires": { - "babel-runtime": "6.23.0" - } - }, - "babel-plugin-transform-es2015-duplicate-keys": { - "version": "6.24.1", - "bundled": true, - "dev": true, - "requires": { - "babel-runtime": "6.23.0", - "babel-types": "6.25.0" - } - }, - "babel-plugin-transform-es2015-for-of": { - "version": "6.23.0", - "bundled": true, - "dev": true, - "requires": { - "babel-runtime": "6.23.0" - } - }, - "babel-plugin-transform-es2015-function-name": { - "version": "6.24.1", - "bundled": true, - "dev": true, - "requires": { - "babel-helper-function-name": "6.24.1", - "babel-runtime": "6.23.0", - "babel-types": "6.25.0" - } - }, - "babel-plugin-transform-es2015-literals": { - "version": "6.22.0", - "bundled": true, - "dev": true, - "requires": { - "babel-runtime": "6.23.0" - } - }, - "babel-plugin-transform-es2015-modules-amd": { - "version": "6.24.1", - "bundled": true, - "dev": true, - "requires": { - "babel-plugin-transform-es2015-modules-commonjs": "6.24.1", - "babel-runtime": "6.23.0", - "babel-template": "6.25.0" - } - }, - "babel-plugin-transform-es2015-modules-commonjs": { - "version": "6.24.1", - "bundled": true, - "dev": true, - "requires": { - "babel-plugin-transform-strict-mode": "6.24.1", - "babel-runtime": "6.23.0", - "babel-template": "6.25.0", - "babel-types": "6.25.0" - } - }, - "babel-plugin-transform-es2015-modules-systemjs": { - "version": "6.24.1", - "bundled": true, - "dev": true, - "requires": { - "babel-helper-hoist-variables": "6.24.1", - "babel-runtime": "6.23.0", - "babel-template": "6.25.0" - } - }, - "babel-plugin-transform-es2015-modules-umd": { - "version": "6.24.1", - "bundled": true, - "dev": true, - "requires": { - "babel-plugin-transform-es2015-modules-amd": "6.24.1", - "babel-runtime": "6.23.0", - "babel-template": "6.25.0" - } - }, - "babel-plugin-transform-es2015-object-super": { - "version": "6.24.1", - "bundled": true, - "dev": true, - "requires": { - "babel-helper-replace-supers": "6.24.1", - "babel-runtime": "6.23.0" - } - }, - "babel-plugin-transform-es2015-parameters": { - "version": "6.24.1", - "bundled": true, - "dev": true, - "requires": { - "babel-helper-call-delegate": "6.24.1", - "babel-helper-get-function-arity": "6.24.1", - "babel-runtime": "6.23.0", - "babel-template": "6.25.0", - "babel-traverse": "6.25.0", - "babel-types": "6.25.0" - } - }, - "babel-plugin-transform-es2015-shorthand-properties": { - "version": "6.24.1", - "bundled": true, - "dev": true, - "requires": { - "babel-runtime": "6.23.0", - "babel-types": "6.25.0" - } - }, - "babel-plugin-transform-es2015-spread": { - "version": "6.22.0", - "bundled": true, - "dev": true, - "requires": { - "babel-runtime": "6.23.0" - } - }, - "babel-plugin-transform-es2015-sticky-regex": { - "version": "6.24.1", - "bundled": true, - "dev": true, - "requires": { - "babel-helper-regex": "6.24.1", - "babel-runtime": "6.23.0", - "babel-types": "6.25.0" - } - }, - "babel-plugin-transform-es2015-template-literals": { - "version": "6.22.0", - "bundled": true, - "dev": true, - "requires": { - "babel-runtime": "6.23.0" - } - }, - "babel-plugin-transform-es2015-typeof-symbol": { - "version": "6.23.0", - "bundled": true, - "dev": true, - "requires": { - "babel-runtime": "6.23.0" - } - }, - "babel-plugin-transform-es2015-unicode-regex": { - "version": "6.24.1", - "bundled": true, - "dev": true, - "requires": { - "babel-helper-regex": "6.24.1", - "babel-runtime": "6.23.0", - "regexpu-core": "2.0.0" - } - }, - "babel-plugin-transform-node-env-inline": { - "version": "0.1.1", - "bundled": true, - "dev": true - }, - "babel-plugin-transform-regenerator": { - "version": "6.24.1", - "bundled": true, - "dev": true, - "requires": { - "regenerator-transform": "0.9.11" - } - }, - "babel-plugin-transform-strict-mode": { - "version": "6.24.1", - "bundled": true, - "dev": true, - "requires": { - "babel-runtime": "6.23.0", - "babel-types": "6.25.0" - } - }, - "babel-preset-es2015": { - "version": "6.24.1", - "bundled": true, - "dev": true, - "requires": { - "babel-plugin-check-es2015-constants": "6.22.0", - "babel-plugin-transform-es2015-arrow-functions": "6.22.0", - "babel-plugin-transform-es2015-block-scoped-functions": "6.22.0", - "babel-plugin-transform-es2015-block-scoping": "6.24.1", - "babel-plugin-transform-es2015-classes": "6.24.1", - "babel-plugin-transform-es2015-computed-properties": "6.24.1", - "babel-plugin-transform-es2015-destructuring": "6.23.0", - "babel-plugin-transform-es2015-duplicate-keys": "6.24.1", - "babel-plugin-transform-es2015-for-of": "6.23.0", - "babel-plugin-transform-es2015-function-name": "6.24.1", - "babel-plugin-transform-es2015-literals": "6.22.0", - "babel-plugin-transform-es2015-modules-amd": "6.24.1", - "babel-plugin-transform-es2015-modules-commonjs": "6.24.1", - "babel-plugin-transform-es2015-modules-systemjs": "6.24.1", - "babel-plugin-transform-es2015-modules-umd": "6.24.1", - "babel-plugin-transform-es2015-object-super": "6.24.1", - "babel-plugin-transform-es2015-parameters": "6.24.1", - "babel-plugin-transform-es2015-shorthand-properties": "6.24.1", - "babel-plugin-transform-es2015-spread": "6.22.0", - "babel-plugin-transform-es2015-sticky-regex": "6.24.1", - "babel-plugin-transform-es2015-template-literals": "6.22.0", - "babel-plugin-transform-es2015-typeof-symbol": "6.23.0", - "babel-plugin-transform-es2015-unicode-regex": "6.24.1", - "babel-plugin-transform-regenerator": "6.24.1" - } - }, - "babel-preset-metal": { - "version": "3.1.0", - "bundled": true, - "dev": true, - "requires": { - "babel-plugin-transform-es2015-classes": "6.24.1", - "babel-preset-es2015": "6.24.1", - "resolve": "1.3.3" - } - }, - "babel-preset-metal-resolve-source": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "resolve": "1.3.3" - } - }, - "babel-register": { - "version": "6.24.1", - "bundled": true, - "dev": true, - "requires": { - "babel-core": "6.25.0", - "babel-runtime": "6.23.0", - "core-js": "2.4.1", - "home-or-tmp": "2.0.0", - "lodash": "4.17.4", - "mkdirp": "0.5.1", - "source-map-support": "0.4.15" - } - }, - "babel-runtime": { - "version": "6.23.0", - "bundled": true, - "dev": true, - "requires": { - "core-js": "2.4.1", - "regenerator-runtime": "0.10.5" - } - }, - "babel-template": { - "version": "6.25.0", - "bundled": true, - "dev": true, - "requires": { - "babel-runtime": "6.23.0", - "babel-traverse": "6.25.0", - "babel-types": "6.25.0", - "babylon": "6.17.3", - "lodash": "4.17.4" - } - }, - "babel-traverse": { - "version": "6.25.0", - "bundled": true, - "dev": true, - "requires": { - "babel-code-frame": "6.22.0", - "babel-messages": "6.23.0", - "babel-runtime": "6.23.0", - "babel-types": "6.25.0", - "babylon": "6.17.3", - "debug": "2.6.8", - "globals": "9.18.0", - "invariant": "2.2.2", - "lodash": "4.17.4" - } - }, - "babel-types": { - "version": "6.25.0", - "bundled": true, - "dev": true, - "requires": { - "babel-runtime": "6.23.0", - "esutils": "2.0.2", - "lodash": "4.17.4", - "to-fast-properties": "1.0.3" - } - }, - "babylon": { - "version": "6.17.3", - "bundled": true, - "dev": true - }, - "backo2": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "balanced-match": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "base64-arraybuffer": { - "version": "0.1.5", - "bundled": true, - "dev": true - }, - "base64id": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "beeper": { - "version": "1.1.1", - "bundled": true, - "dev": true - }, - "better-assert": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "callsite": "1.0.0" - } - }, - "binary-extensions": { - "version": "1.8.0", - "bundled": true, - "dev": true - }, - "binaryextensions": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "bl": { - "version": "0.9.5", - "bundled": true, - "dev": true, - "requires": { - "readable-stream": "1.0.34" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "readable-stream": { - "version": "1.0.34", - "bundled": true, - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" - } - }, - "string_decoder": { - "version": "0.10.31", - "bundled": true, - "dev": true - } - } - }, - "blob": { - "version": "0.0.4", - "bundled": true, - "dev": true - }, - "block-stream": { - "version": "0.0.9", - "bundled": true, - "dev": true, - "requires": { - "inherits": "2.0.3" - } - }, - "bluebird": { - "version": "3.4.7", - "bundled": true, - "dev": true - }, - "body-parser": { - "version": "1.17.2", - "bundled": true, - "dev": true, - "requires": { - "bytes": "2.4.0", - "content-type": "1.0.2", - "debug": "2.6.7", - "depd": "1.1.0", - "http-errors": "1.6.1", - "iconv-lite": "0.4.15", - "on-finished": "2.3.0", - "qs": "6.4.0", - "raw-body": "2.2.0", - "type-is": "1.6.15" - }, - "dependencies": { - "debug": { - "version": "2.6.7", - "bundled": true, - "dev": true, - "requires": { - "ms": "2.0.0" - } - } - } - }, - "boom": { - "version": "2.10.1", - "bundled": true, - "dev": true, - "requires": { - "hoek": "2.16.3" - } - }, - "bower": { - "version": "1.8.0", - "bundled": true, - "dev": true - }, - "brace-expansion": { - "version": "1.1.8", - "bundled": true, - "dev": true, - "requires": { - "balanced-match": "1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "1.8.5", - "bundled": true, - "dev": true, - "requires": { - "expand-range": "1.8.2", - "preserve": "0.2.0", - "repeat-element": "1.1.2" - } - }, - "buffer-crc32": { - "version": "0.2.13", - "bundled": true, - "dev": true - }, - "bufferstreams": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "requires": { - "readable-stream": "2.2.11" - } - }, - "builtin-modules": { - "version": "1.1.1", - "bundled": true, - "dev": true - }, - "bytes": { - "version": "2.4.0", - "bundled": true, - "dev": true - }, - "caller-path": { - "version": "0.1.0", - "bundled": true, - "dev": true, - "requires": { - "callsites": "0.2.0" - } - }, - "callsite": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "callsites": { - "version": "0.2.0", - "bundled": true, - "dev": true - }, - "camelcase": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "camelcase-keys": { - "version": "2.1.0", - "bundled": true, - "dev": true, - "requires": { - "camelcase": "2.1.1", - "map-obj": "1.0.1" - } - }, - "caseless": { - "version": "0.12.0", - "bundled": true, - "dev": true - }, - "catharsis": { - "version": "0.8.8", - "bundled": true, - "dev": true, - "requires": { - "underscore-contrib": "0.3.0" - } - }, - "center-align": { - "version": "0.1.3", - "bundled": true, - "dev": true, - "requires": { - "align-text": "0.1.4", - "lazy-cache": "1.0.4" - } - }, - "chai": { - "version": "2.3.0", - "bundled": true, - "dev": true, - "requires": { - "assertion-error": "1.0.0", - "deep-eql": "0.1.3" - } - }, - "chalk": { - "version": "1.1.3", - "bundled": true, - "dev": true, - "requires": { - "ansi-styles": "2.2.1", - "escape-string-regexp": "1.0.5", - "has-ansi": "2.0.0", - "strip-ansi": "3.0.1", - "supports-color": "2.0.0" - } - }, - "chokidar": { - "version": "1.7.0", - "bundled": true, - "dev": true, - "requires": { - "anymatch": "1.3.0", - "async-each": "1.0.1", - "glob-parent": "2.0.0", - "inherits": "2.0.3", - "is-binary-path": "1.0.1", - "is-glob": "2.0.1", - "path-is-absolute": "1.0.1", - "readdirp": "2.1.0" - } - }, - "circular-json": { - "version": "0.3.1", - "bundled": true, - "dev": true - }, - "cli": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "requires": { - "exit": "0.1.2", - "glob": "7.1.2" - } - }, - "cli-cursor": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "restore-cursor": "1.0.1" - } - }, - "cli-width": { - "version": "2.1.0", - "bundled": true, - "dev": true - }, - "cliui": { - "version": "3.2.0", - "bundled": true, - "dev": true, - "requires": { - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "wrap-ansi": "2.1.0" - } - }, - "clone": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "clone-buffer": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "clone-stats": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "cloneable-readable": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "inherits": "2.0.3", - "process-nextick-args": "1.0.7", - "through2": "2.0.3" - } - }, - "co": { - "version": "4.6.0", - "bundled": true, - "dev": true - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "colors": { - "version": "1.1.2", - "bundled": true, - "dev": true - }, - "combine-lists": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "requires": { - "lodash": "4.17.4" - } - }, - "combined-stream": { - "version": "1.0.5", - "bundled": true, - "dev": true, - "requires": { - "delayed-stream": "1.0.0" - } - }, - "commander": { - "version": "2.9.0", - "bundled": true, - "dev": true, - "requires": { - "graceful-readlink": "1.0.1" - } - }, - "component-bind": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "component-emitter": { - "version": "1.1.2", - "bundled": true, - "dev": true - }, - "component-inherit": { - "version": "0.0.3", - "bundled": true, - "dev": true - }, - "compress-commons": { - "version": "0.2.9", - "bundled": true, - "dev": true, - "requires": { - "buffer-crc32": "0.2.13", - "crc32-stream": "0.3.4", - "node-int64": "0.3.3", - "readable-stream": "1.0.34" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "readable-stream": { - "version": "1.0.34", - "bundled": true, - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" - } - }, - "string_decoder": { - "version": "0.10.31", - "bundled": true, - "dev": true - } - } - }, - "concat-map": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "concat-stream": { - "version": "1.6.0", - "bundled": true, - "dev": true, - "requires": { - "inherits": "2.0.3", - "readable-stream": "2.2.11", - "typedarray": "0.0.6" - } - }, - "concat-with-sourcemaps": { - "version": "1.0.4", - "bundled": true, - "dev": true, - "requires": { - "source-map": "0.5.6" - } - }, - "connect": { - "version": "3.6.2", - "bundled": true, - "dev": true, - "requires": { - "debug": "2.6.7", - "finalhandler": "1.0.3", - "parseurl": "1.3.1", - "utils-merge": "1.0.0" - }, - "dependencies": { - "debug": { - "version": "2.6.7", - "bundled": true, - "dev": true, - "requires": { - "ms": "2.0.0" - } - } - } - }, - "console-browserify": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "requires": { - "date-now": "0.1.4" - } - }, - "console-control-strings": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "content-type": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "convert-source-map": { - "version": "1.5.0", - "bundled": true, - "dev": true - }, - "cookie": { - "version": "0.3.1", - "bundled": true, - "dev": true - }, - "core-js": { - "version": "2.4.1", - "bundled": true, - "dev": true - }, - "core-util-is": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "crc32-stream": { - "version": "0.3.4", - "bundled": true, - "dev": true, - "requires": { - "buffer-crc32": "0.2.13", - "readable-stream": "1.0.34" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "readable-stream": { - "version": "1.0.34", - "bundled": true, - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" - } - }, - "string_decoder": { - "version": "0.10.31", - "bundled": true, - "dev": true - } - } - }, - "cross-spawn": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "requires": { - "lru-cache": "4.1.1", - "which": "1.2.14" - }, - "dependencies": { - "lru-cache": { - "version": "4.1.1", - "bundled": true, - "dev": true, - "requires": { - "pseudomap": "1.0.2", - "yallist": "2.1.2" - } - } - } - }, - "cryptiles": { - "version": "2.0.5", - "bundled": true, - "dev": true, - "requires": { - "boom": "2.10.1" - } - }, - "ctype": { - "version": "0.5.3", - "bundled": true, - "dev": true - }, - "currently-unhandled": { - "version": "0.4.1", - "bundled": true, - "dev": true, - "requires": { - "array-find-index": "1.0.2" - } - }, - "custom-event": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "d": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "es5-ext": "0.10.23" - } - }, - "dashdash": { - "version": "1.14.1", - "bundled": true, - "dev": true, - "requires": { - "assert-plus": "1.0.0" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "bundled": true, - "dev": true - } - } - }, - "date-now": { - "version": "0.1.4", - "bundled": true, - "dev": true - }, - "dateformat": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "deap": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "debug": { - "version": "2.6.8", - "bundled": true, - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "decamelize": { - "version": "1.2.0", - "bundled": true, - "dev": true - }, - "deep-eql": { - "version": "0.1.3", - "bundled": true, - "dev": true, - "requires": { - "type-detect": "0.1.1" - } - }, - "deep-is": { - "version": "0.1.3", - "bundled": true, - "dev": true - }, - "del": { - "version": "2.2.2", - "bundled": true, - "dev": true, - "requires": { - "globby": "5.0.0", - "is-path-cwd": "1.0.0", - "is-path-in-cwd": "1.0.0", - "object-assign": "4.1.1", - "pify": "2.3.0", - "pinkie-promise": "2.0.1", - "rimraf": "2.6.1" - } - }, - "delayed-stream": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "delegates": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "depd": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "detect-indent": { - "version": "4.0.0", - "bundled": true, - "dev": true, - "requires": { - "repeating": "2.0.1" - } - }, - "di": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "diff": { - "version": "1.4.0", - "bundled": true, - "dev": true - }, - "disparity": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "ansi-styles": "2.2.1", - "diff": "1.4.0" - } - }, - "doctrine": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "esutils": "2.0.2", - "isarray": "1.0.0" - } - }, - "dom-serialize": { - "version": "2.2.1", - "bundled": true, - "dev": true, - "requires": { - "custom-event": "1.0.1", - "ent": "2.2.0", - "extend": "3.0.1", - "void-elements": "2.0.1" - } - }, - "dom-serializer": { - "version": "0.1.0", - "bundled": true, - "dev": true, - "requires": { - "domelementtype": "1.1.3", - "entities": "1.1.1" - }, - "dependencies": { - "domelementtype": { - "version": "1.1.3", - "bundled": true, - "dev": true - }, - "entities": { - "version": "1.1.1", - "bundled": true, - "dev": true - } - } - }, - "domelementtype": { - "version": "1.3.0", - "bundled": true, - "dev": true - }, - "domhandler": { - "version": "2.3.0", - "bundled": true, - "dev": true, - "requires": { - "domelementtype": "1.3.0" - } - }, - "domutils": { - "version": "1.5.1", - "bundled": true, - "dev": true, - "requires": { - "dom-serializer": "0.1.0", - "domelementtype": "1.3.0" - } - }, - "duplexer": { - "version": "0.1.1", - "bundled": true, - "dev": true - }, - "duplexer2": { - "version": "0.0.2", - "bundled": true, - "dev": true, - "requires": { - "readable-stream": "1.1.14" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "readable-stream": { - "version": "1.1.14", - "bundled": true, - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" - } - }, - "string_decoder": { - "version": "0.10.31", - "bundled": true, - "dev": true - } - } - }, - "duplexify": { - "version": "3.5.0", - "bundled": true, - "dev": true, - "requires": { - "end-of-stream": "1.0.0", - "inherits": "2.0.3", - "readable-stream": "2.2.11", - "stream-shift": "1.0.0" - }, - "dependencies": { - "end-of-stream": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "once": "1.3.3" - } - }, - "once": { - "version": "1.3.3", - "bundled": true, - "dev": true, - "requires": { - "wrappy": "1.0.2" - } - } - } - }, - "ee-first": { - "version": "1.1.1", - "bundled": true, - "dev": true - }, - "encodeurl": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "engine.io": { - "version": "1.8.3", - "bundled": true, - "dev": true, - "requires": { - "accepts": "1.3.3", - "base64id": "1.0.0", - "cookie": "0.3.1", - "debug": "2.3.3", - "engine.io-parser": "1.3.2", - "ws": "1.1.2" - }, - "dependencies": { - "debug": { - "version": "2.3.3", - "bundled": true, - "dev": true, - "requires": { - "ms": "0.7.2" - } - }, - "ms": { - "version": "0.7.2", - "bundled": true, - "dev": true - } - } - }, - "engine.io-client": { - "version": "1.8.3", - "bundled": true, - "dev": true, - "requires": { - "component-emitter": "1.2.1", - "component-inherit": "0.0.3", - "debug": "2.3.3", - "engine.io-parser": "1.3.2", - "has-cors": "1.1.0", - "indexof": "0.0.1", - "parsejson": "0.0.3", - "parseqs": "0.0.5", - "parseuri": "0.0.5", - "ws": "1.1.2", - "xmlhttprequest-ssl": "1.5.3", - "yeast": "0.1.2" - }, - "dependencies": { - "component-emitter": { - "version": "1.2.1", - "bundled": true, - "dev": true - }, - "debug": { - "version": "2.3.3", - "bundled": true, - "dev": true, - "requires": { - "ms": "0.7.2" - } - }, - "ms": { - "version": "0.7.2", - "bundled": true, - "dev": true - } - } - }, - "engine.io-parser": { - "version": "1.3.2", - "bundled": true, - "dev": true, - "requires": { - "after": "0.8.2", - "arraybuffer.slice": "0.0.6", - "base64-arraybuffer": "0.1.5", - "blob": "0.0.4", - "has-binary": "0.1.7", - "wtf-8": "1.0.0" - } - }, - "ent": { - "version": "2.2.0", - "bundled": true, - "dev": true - }, - "entities": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "error-ex": { - "version": "1.3.1", - "bundled": true, - "dev": true, - "requires": { - "is-arrayish": "0.2.1" - } - }, - "es5-ext": { - "version": "0.10.23", - "bundled": true, - "dev": true, - "requires": { - "es6-iterator": "2.0.1", - "es6-symbol": "3.1.1" - } - }, - "es6-iterator": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "d": "1.0.0", - "es5-ext": "0.10.23", - "es6-symbol": "3.1.1" - } - }, - "es6-map": { - "version": "0.1.5", - "bundled": true, - "dev": true, - "requires": { - "d": "1.0.0", - "es5-ext": "0.10.23", - "es6-iterator": "2.0.1", - "es6-set": "0.1.5", - "es6-symbol": "3.1.1", - "event-emitter": "0.3.5" - } - }, - "es6-set": { - "version": "0.1.5", - "bundled": true, - "dev": true, - "requires": { - "d": "1.0.0", - "es5-ext": "0.10.23", - "es6-iterator": "2.0.1", - "es6-symbol": "3.1.1", - "event-emitter": "0.3.5" - } - }, - "es6-symbol": { - "version": "3.1.1", - "bundled": true, - "dev": true, - "requires": { - "d": "1.0.0", - "es5-ext": "0.10.23" - } - }, - "es6-weak-map": { - "version": "2.0.2", - "bundled": true, - "dev": true, - "requires": { - "d": "1.0.0", - "es5-ext": "0.10.23", - "es6-iterator": "2.0.1", - "es6-symbol": "3.1.1" - } - }, - "escape-html": { - "version": "1.0.3", - "bundled": true, - "dev": true - }, - "escape-string-regexp": { - "version": "1.0.5", - "bundled": true, - "dev": true - }, - "escodegen": { - "version": "1.8.1", - "bundled": true, - "dev": true, - "requires": { - "esprima": "2.7.3", - "estraverse": "1.9.3", - "esutils": "2.0.2", - "optionator": "0.8.2" - }, - "dependencies": { - "esprima": { - "version": "2.7.3", - "bundled": true, - "dev": true - }, - "estraverse": { - "version": "1.9.3", - "bundled": true, - "dev": true - } - } - }, - "escope": { - "version": "3.6.0", - "bundled": true, - "dev": true, - "requires": { - "es6-map": "0.1.5", - "es6-weak-map": "2.0.2", - "esrecurse": "4.1.0", - "estraverse": "4.2.0" - } - }, - "esformatter": { - "version": "0.8.2", - "bundled": true, - "dev": true, - "requires": { - "debug": "0.7.4", - "disparity": "2.0.0", - "espree": "2.2.5", - "glob": "5.0.15", - "minimist": "1.2.0", - "mout": "1.0.0", - "npm-run": "2.0.0", - "resolve": "1.3.3", - "rocambole": "0.7.0", - "rocambole-indent": "2.0.4", - "rocambole-linebreak": "1.0.2", - "rocambole-node": "1.0.0", - "rocambole-token": "1.2.1", - "rocambole-whitespace": "1.0.0", - "stdin": "0.0.1", - "strip-json-comments": "0.1.3", - "supports-color": "1.3.1", - "user-home": "2.0.0" - }, - "dependencies": { - "debug": { - "version": "0.7.4", - "bundled": true, - "dev": true - }, - "espree": { - "version": "2.2.5", - "bundled": true, - "dev": true - }, - "glob": { - "version": "5.0.15", - "bundled": true, - "dev": true, - "requires": { - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - }, - "minimist": { - "version": "1.2.0", - "bundled": true, - "dev": true - }, - "strip-json-comments": { - "version": "0.1.3", - "bundled": true, - "dev": true - }, - "supports-color": { - "version": "1.3.1", - "bundled": true, - "dev": true - } - } - }, - "eslint": { - "version": "3.19.0", - "bundled": true, - "dev": true, - "requires": { - "babel-code-frame": "6.22.0", - "chalk": "1.1.3", - "concat-stream": "1.6.0", - "debug": "2.6.8", - "doctrine": "2.0.0", - "escope": "3.6.0", - "espree": "3.4.3", - "esquery": "1.0.0", - "estraverse": "4.2.0", - "esutils": "2.0.2", - "file-entry-cache": "2.0.0", - "glob": "7.1.2", - "globals": "9.18.0", - "ignore": "3.3.3", - "imurmurhash": "0.1.4", - "inquirer": "0.12.0", - "is-my-json-valid": "2.16.0", - "is-resolvable": "1.0.0", - "js-yaml": "3.8.4", - "json-stable-stringify": "1.0.1", - "levn": "0.3.0", - "lodash": "4.17.4", - "mkdirp": "0.5.1", - "natural-compare": "1.4.0", - "optionator": "0.8.2", - "path-is-inside": "1.0.2", - "pluralize": "1.2.1", - "progress": "1.1.8", - "require-uncached": "1.0.3", - "shelljs": "0.7.8", - "strip-bom": "3.0.0", - "strip-json-comments": "2.0.1", - "table": "3.8.3", - "text-table": "0.2.0", - "user-home": "2.0.0" - } - }, - "espree": { - "version": "3.4.3", - "bundled": true, - "dev": true, - "requires": { - "acorn": "5.0.3", - "acorn-jsx": "3.0.1" - } - }, - "esprima": { - "version": "3.1.3", - "bundled": true, - "dev": true - }, - "esquery": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "estraverse": "4.2.0" - } - }, - "esrecurse": { - "version": "4.1.0", - "bundled": true, - "dev": true, - "requires": { - "estraverse": "4.1.1", - "object-assign": "4.1.1" - }, - "dependencies": { - "estraverse": { - "version": "4.1.1", - "bundled": true, - "dev": true - } - } - }, - "estraverse": { - "version": "4.2.0", - "bundled": true, - "dev": true - }, - "esutils": { - "version": "2.0.2", - "bundled": true, - "dev": true - }, - "event-emitter": { - "version": "0.3.5", - "bundled": true, - "dev": true, - "requires": { - "d": "1.0.0", - "es5-ext": "0.10.23" - } - }, - "eventemitter3": { - "version": "1.2.0", - "bundled": true, - "dev": true - }, - "exit": { - "version": "0.1.2", - "bundled": true, - "dev": true - }, - "exit-hook": { - "version": "1.1.1", - "bundled": true, - "dev": true - }, - "expand-braces": { - "version": "0.1.2", - "bundled": true, - "dev": true, - "requires": { - "array-slice": "0.2.3", - "array-unique": "0.2.1", - "braces": "0.1.5" - }, - "dependencies": { - "braces": { - "version": "0.1.5", - "bundled": true, - "dev": true, - "requires": { - "expand-range": "0.1.1" - } - }, - "expand-range": { - "version": "0.1.1", - "bundled": true, - "dev": true, - "requires": { - "is-number": "0.1.1", - "repeat-string": "0.2.2" - } - }, - "is-number": { - "version": "0.1.1", - "bundled": true, - "dev": true - }, - "repeat-string": { - "version": "0.2.2", - "bundled": true, - "dev": true - } - } - }, - "expand-brackets": { - "version": "0.1.5", - "bundled": true, - "dev": true, - "requires": { - "is-posix-bracket": "0.1.1" - } - }, - "expand-range": { - "version": "1.8.2", - "bundled": true, - "dev": true, - "requires": { - "fill-range": "2.2.3" - } - }, - "extend": { - "version": "3.0.1", - "bundled": true, - "dev": true - }, - "extend-shallow": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "is-extendable": "0.1.1" - } - }, - "extglob": { - "version": "0.3.2", - "bundled": true, - "dev": true, - "requires": { - "is-extglob": "1.0.0" - } - }, - "extsprintf": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "fancy-log": { - "version": "1.3.0", - "bundled": true, - "dev": true, - "requires": { - "chalk": "1.1.3", - "time-stamp": "1.1.0" - } - }, - "fast-levenshtein": { - "version": "2.0.6", - "bundled": true, - "dev": true - }, - "figures": { - "version": "1.7.0", - "bundled": true, - "dev": true, - "requires": { - "escape-string-regexp": "1.0.5", - "object-assign": "4.1.1" - } - }, - "file-entry-cache": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "flat-cache": "1.2.2", - "object-assign": "4.1.1" - } - }, - "filename-regex": { - "version": "2.0.1", - "bundled": true, - "dev": true - }, - "fill-range": { - "version": "2.2.3", - "bundled": true, - "dev": true, - "requires": { - "is-number": "2.1.0", - "isobject": "2.1.0", - "randomatic": "1.1.7", - "repeat-element": "1.1.2", - "repeat-string": "1.6.1" - } - }, - "finalhandler": { - "version": "1.0.3", - "bundled": true, - "dev": true, - "requires": { - "debug": "2.6.7", - "encodeurl": "1.0.1", - "escape-html": "1.0.3", - "on-finished": "2.3.0", - "parseurl": "1.3.1", - "statuses": "1.3.1", - "unpipe": "1.0.0" - }, - "dependencies": { - "debug": { - "version": "2.6.7", - "bundled": true, - "dev": true, - "requires": { - "ms": "2.0.0" - } - } - } - }, - "find-up": { - "version": "1.1.2", - "bundled": true, - "dev": true, - "requires": { - "path-exists": "2.1.0", - "pinkie-promise": "2.0.1" - } - }, - "first-chunk-stream": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "flat-cache": { - "version": "1.2.2", - "bundled": true, - "dev": true, - "requires": { - "circular-json": "0.3.1", - "del": "2.2.2", - "graceful-fs": "4.1.11", - "write": "0.2.1" - } - }, - "for-in": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "for-own": { - "version": "0.1.5", - "bundled": true, - "dev": true, - "requires": { - "for-in": "1.0.2" - } - }, - "forever-agent": { - "version": "0.6.1", - "bundled": true, - "dev": true - }, - "fork-stream": { - "version": "0.0.4", - "bundled": true, - "dev": true - }, - "form-data": { - "version": "2.1.4", - "bundled": true, - "dev": true, - "requires": { - "asynckit": "0.4.0", - "combined-stream": "1.0.5", - "mime-types": "2.1.15" - } - }, - "formatio": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "requires": { - "samsam": "1.1.2" - } - }, - "fs-access": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "requires": { - "null-check": "1.0.0" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "fstream": { - "version": "1.0.11", - "bundled": true, - "dev": true, - "requires": { - "graceful-fs": "4.1.11", - "inherits": "2.0.3", - "mkdirp": "0.5.1", - "rimraf": "2.6.1" - } - }, - "gauge": { - "version": "2.7.4", - "bundled": true, - "dev": true, - "requires": { - "aproba": "1.1.2", - "console-control-strings": "1.1.0", - "has-unicode": "2.0.1", - "object-assign": "4.1.1", - "signal-exit": "3.0.2", - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "wide-align": "1.1.2" - } - }, - "generate-function": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "generate-object-property": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "requires": { - "is-property": "1.0.2" - } - }, - "get-caller-file": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "get-stdin": { - "version": "4.0.1", - "bundled": true, - "dev": true - }, - "getpass": { - "version": "0.1.7", - "bundled": true, - "dev": true, - "requires": { - "assert-plus": "1.0.0" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "bundled": true, - "dev": true - } - } - }, - "glob": { - "version": "7.1.2", - "bundled": true, - "dev": true, - "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - }, - "glob-base": { - "version": "0.3.0", - "bundled": true, - "dev": true, - "requires": { - "glob-parent": "2.0.0", - "is-glob": "2.0.1" - } - }, - "glob-expand": { - "version": "0.1.0", - "bundled": true, - "dev": true, - "requires": { - "glob": "4.4.2", - "lodash": "1.2.1" - }, - "dependencies": { - "glob": { - "version": "4.4.2", - "bundled": true, - "dev": true, - "requires": { - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "2.0.10", - "once": "1.4.0" - } - }, - "lodash": { - "version": "1.2.1", - "bundled": true, - "dev": true - }, - "minimatch": { - "version": "2.0.10", - "bundled": true, - "dev": true, - "requires": { - "brace-expansion": "1.1.8" - } - } - } - }, - "glob-parent": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "is-glob": "2.0.1" - } - }, - "globals": { - "version": "9.18.0", - "bundled": true, - "dev": true - }, - "globby": { - "version": "5.0.0", - "bundled": true, - "dev": true, - "requires": { - "array-union": "1.0.2", - "arrify": "1.0.1", - "glob": "7.1.2", - "object-assign": "4.1.1", - "pify": "2.3.0", - "pinkie-promise": "2.0.1" - } - }, - "glogg": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "sparkles": "1.0.0" - } - }, - "graceful-fs": { - "version": "4.1.11", - "bundled": true, - "dev": true - }, - "graceful-readlink": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "growl": { - "version": "1.9.2", - "bundled": true, - "dev": true - }, - "gulp-babel-deps": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "babel-deps": "2.1.0", - "gulp-util": "3.0.8", - "through2": "2.0.3", - "vinyl-sourcemaps-apply": "0.2.1" - } - }, - "gulp-babel-globals": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "babel-globals": "2.0.1", - "gulp-util": "3.0.8", - "through2": "2.0.3", - "vinyl-sourcemaps-apply": "0.2.1" - } - }, - "gulp-concat": { - "version": "2.6.1", - "bundled": true, - "dev": true, - "requires": { - "concat-with-sourcemaps": "1.0.4", - "through2": "2.0.3", - "vinyl": "2.0.2" - }, - "dependencies": { - "clone-stats": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "replace-ext": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "vinyl": { - "version": "2.0.2", - "bundled": true, - "dev": true, - "requires": { - "clone": "1.0.2", - "clone-buffer": "1.0.0", - "clone-stats": "1.0.0", - "cloneable-readable": "1.0.0", - "is-stream": "1.1.0", - "remove-trailing-separator": "1.0.2", - "replace-ext": "1.0.0" - } - } - } - }, - "gulp-esformatter": { - "version": "5.0.0", - "bundled": true, - "dev": true, - "requires": { - "esformatter": "0.8.2", - "gulp-util": "3.0.8", - "through2": "2.0.3" - } - }, - "gulp-eslint": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "requires": { - "bufferstreams": "1.1.1", - "eslint": "3.19.0", - "gulp-util": "3.0.8" - } - }, - "gulp-if": { - "version": "2.0.2", - "bundled": true, - "dev": true, - "requires": { - "gulp-match": "1.0.3", - "ternary-stream": "2.0.1", - "through2": "2.0.3" - } - }, - "gulp-ignore": { - "version": "2.0.2", - "bundled": true, - "dev": true, - "requires": { - "gulp-match": "1.0.3", - "through2": "2.0.3" - } - }, - "gulp-jshint": { - "version": "2.0.4", - "bundled": true, - "dev": true, - "requires": { - "gulp-util": "3.0.8", - "lodash": "4.17.4", - "minimatch": "3.0.4", - "rcloader": "0.2.2", - "through2": "2.0.3" - } - }, - "gulp-match": { - "version": "1.0.3", - "bundled": true, - "dev": true, - "requires": { - "minimatch": "3.0.4" - } - }, - "gulp-mocha": { - "version": "2.2.0", - "bundled": true, - "dev": true, - "requires": { - "gulp-util": "3.0.8", - "mocha": "2.5.3", - "plur": "2.1.2", - "resolve-from": "1.0.1", - "temp": "0.8.3", - "through": "2.3.8" - } - }, - "gulp-rename": { - "version": "1.2.2", - "bundled": true, - "dev": true - }, - "gulp-replace": { - "version": "0.5.4", - "bundled": true, - "dev": true, - "requires": { - "istextorbinary": "1.0.2", - "readable-stream": "2.2.11", - "replacestream": "4.0.2" - } - }, - "gulp-sass": { - "version": "2.3.2", - "bundled": true, - "dev": true, - "requires": { - "gulp-util": "3.0.8", - "lodash.clonedeep": "4.5.0", - "node-sass": "3.13.1", - "through2": "2.0.3", - "vinyl-sourcemaps-apply": "0.2.1" - } - }, - "gulp-sourcemaps": { - "version": "1.6.0", - "bundled": true, - "dev": true, - "requires": { - "convert-source-map": "1.5.0", - "graceful-fs": "4.1.11", - "strip-bom": "2.0.0", - "through2": "2.0.3", - "vinyl": "1.2.0" - }, - "dependencies": { - "strip-bom": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "is-utf8": "0.2.1" - } - }, - "vinyl": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "requires": { - "clone": "1.0.2", - "clone-stats": "0.0.1", - "replace-ext": "0.0.1" - } - } - } - }, - "gulp-uglify": { - "version": "1.5.4", - "bundled": true, - "dev": true, - "requires": { - "deap": "1.0.0", - "fancy-log": "1.3.0", - "gulp-util": "3.0.8", - "isobject": "2.1.0", - "through2": "2.0.3", - "uglify-js": "2.6.4", - "uglify-save-license": "0.4.1", - "vinyl-sourcemaps-apply": "0.2.1" - } - }, - "gulp-util": { - "version": "3.0.8", - "bundled": true, - "dev": true, - "requires": { - "array-differ": "1.0.0", - "array-uniq": "1.0.3", - "beeper": "1.1.1", - "chalk": "1.1.3", - "dateformat": "2.0.0", - "fancy-log": "1.3.0", - "gulplog": "1.0.0", - "has-gulplog": "0.1.0", - "lodash._reescape": "3.0.0", - "lodash._reevaluate": "3.0.0", - "lodash._reinterpolate": "3.0.0", - "lodash.template": "3.6.2", - "minimist": "1.2.0", - "multipipe": "0.1.2", - "object-assign": "3.0.0", - "replace-ext": "0.0.1", - "through2": "2.0.3", - "vinyl": "0.5.3" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "bundled": true, - "dev": true - }, - "object-assign": { - "version": "3.0.0", - "bundled": true, - "dev": true - } - } - }, - "gulp-wrapper": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "gulp-util": "3.0.8", - "through2": "0.6.5" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "readable-stream": { - "version": "1.0.34", - "bundled": true, - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" - } - }, - "string_decoder": { - "version": "0.10.31", - "bundled": true, - "dev": true - }, - "through2": { - "version": "0.6.5", - "bundled": true, - "dev": true, - "requires": { - "readable-stream": "1.0.34", - "xtend": "4.0.1" - } - } - } - }, - "gulplog": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "glogg": "1.0.0" - } - }, - "handlebars": { - "version": "4.0.10", - "bundled": true, - "dev": true, - "requires": { - "async": "1.5.2", - "optimist": "0.6.1", - "source-map": "0.4.4", - "uglify-js": "2.6.4" - }, - "dependencies": { - "async": { - "version": "1.5.2", - "bundled": true, - "dev": true - }, - "source-map": { - "version": "0.4.4", - "bundled": true, - "dev": true, - "requires": { - "amdefine": "1.0.1" - } - } - } - }, - "har-schema": { - "version": "1.0.5", - "bundled": true, - "dev": true - }, - "har-validator": { - "version": "4.2.1", - "bundled": true, - "dev": true, - "requires": { - "ajv": "4.11.8", - "har-schema": "1.0.5" - } - }, - "has-ansi": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "2.1.1" - } - }, - "has-binary": { - "version": "0.1.7", - "bundled": true, - "dev": true, - "requires": { - "isarray": "0.0.1" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "bundled": true, - "dev": true - } - } - }, - "has-color": { - "version": "0.1.7", - "bundled": true, - "dev": true - }, - "has-cors": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "has-flag": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "has-gulplog": { - "version": "0.1.0", - "bundled": true, - "dev": true, - "requires": { - "sparkles": "1.0.0" - } - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true, - "dev": true - }, - "hawk": { - "version": "3.1.3", - "bundled": true, - "dev": true, - "requires": { - "boom": "2.10.1", - "cryptiles": "2.0.5", - "hoek": "2.16.3", - "sntp": "1.0.9" - } - }, - "hoek": { - "version": "2.16.3", - "bundled": true, - "dev": true - }, - "home-or-tmp": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "os-homedir": "1.0.2", - "os-tmpdir": "1.0.2" - } - }, - "hosted-git-info": { - "version": "2.4.2", - "bundled": true, - "dev": true - }, - "htmlparser2": { - "version": "3.8.3", - "bundled": true, - "dev": true, - "requires": { - "domelementtype": "1.3.0", - "domhandler": "2.3.0", - "domutils": "1.5.1", - "entities": "1.0.0", - "readable-stream": "1.1.14" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "readable-stream": { - "version": "1.1.14", - "bundled": true, - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" - } - }, - "string_decoder": { - "version": "0.10.31", - "bundled": true, - "dev": true - } - } - }, - "http-errors": { - "version": "1.6.1", - "bundled": true, - "dev": true, - "requires": { - "depd": "1.1.0", - "inherits": "2.0.3", - "setprototypeof": "1.0.3", - "statuses": "1.3.1" - } - }, - "http-proxy": { - "version": "1.16.2", - "bundled": true, - "dev": true, - "requires": { - "eventemitter3": "1.2.0", - "requires-port": "1.0.0" - } - }, - "http-signature": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "requires": { - "assert-plus": "0.2.0", - "jsprim": "1.4.0", - "sshpk": "1.13.1" - } - }, - "https-proxy-agent": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "agent-base": "2.1.1", - "debug": "2.6.8", - "extend": "3.0.1" - } - }, - "iconv-lite": { - "version": "0.4.15", - "bundled": true, - "dev": true - }, - "iectrl": { - "version": "0.1.2", - "bundled": true, - "dev": true, - "requires": { - "colors": "0.6.2", - "commander": "1.2.0", - "debug": "0.7.4", - "moment": "2.0.0", - "q": "0.9.7" - }, - "dependencies": { - "colors": { - "version": "0.6.2", - "bundled": true, - "dev": true - }, - "commander": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "requires": { - "keypress": "0.1.0" - } - }, - "debug": { - "version": "0.7.4", - "bundled": true, - "dev": true - } - } - }, - "ignore": { - "version": "3.3.3", - "bundled": true, - "dev": true - }, - "imurmurhash": { - "version": "0.1.4", - "bundled": true, - "dev": true - }, - "in-publish": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "indent-string": { - "version": "2.1.0", - "bundled": true, - "dev": true, - "requires": { - "repeating": "2.0.1" - } - }, - "indexof": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" - } - }, - "inherits": { - "version": "2.0.3", - "bundled": true, - "dev": true - }, - "inquirer": { - "version": "0.12.0", - "bundled": true, - "dev": true, - "requires": { - "ansi-escapes": "1.4.0", - "ansi-regex": "2.1.1", - "chalk": "1.1.3", - "cli-cursor": "1.0.2", - "cli-width": "2.1.0", - "figures": "1.7.0", - "lodash": "4.17.4", - "readline2": "1.0.1", - "run-async": "0.1.0", - "rx-lite": "3.1.2", - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "through": "2.3.8" - } - }, - "interpret": { - "version": "1.0.3", - "bundled": true, - "dev": true - }, - "invariant": { - "version": "2.2.2", - "bundled": true, - "dev": true, - "requires": { - "loose-envify": "1.3.1" - } - }, - "invert-kv": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "irregular-plurals": { - "version": "1.2.0", - "bundled": true, - "dev": true - }, - "is-arrayish": { - "version": "0.2.1", - "bundled": true, - "dev": true - }, - "is-binary-path": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "requires": { - "binary-extensions": "1.8.0" - } - }, - "is-buffer": { - "version": "1.1.5", - "bundled": true, - "dev": true - }, - "is-builtin-module": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "builtin-modules": "1.1.1" - } - }, - "is-dotfile": { - "version": "1.0.3", - "bundled": true, - "dev": true - }, - "is-equal-shallow": { - "version": "0.1.3", - "bundled": true, - "dev": true, - "requires": { - "is-primitive": "2.0.0" - } - }, - "is-extendable": { - "version": "0.1.1", - "bundled": true, - "dev": true - }, - "is-extglob": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "is-finite": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "number-is-nan": "1.0.1" - } - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "number-is-nan": "1.0.1" - } - }, - "is-glob": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "is-extglob": "1.0.0" - } - }, - "is-my-json-valid": { - "version": "2.16.0", - "bundled": true, - "dev": true, - "requires": { - "generate-function": "2.0.0", - "generate-object-property": "1.2.0", - "jsonpointer": "4.0.1", - "xtend": "4.0.1" - } - }, - "is-number": { - "version": "2.1.0", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "3.2.2" - } - }, - "is-path-cwd": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "is-path-in-cwd": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "is-path-inside": "1.0.0" - } - }, - "is-path-inside": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "path-is-inside": "1.0.2" - } - }, - "is-posix-bracket": { - "version": "0.1.1", - "bundled": true, - "dev": true - }, - "is-primitive": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "is-property": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "is-resolvable": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "tryit": "1.0.3" - } - }, - "is-stream": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "is-typedarray": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "is-utf8": { - "version": "0.2.1", - "bundled": true, - "dev": true - }, - "is-valid-glob": { - "version": "0.3.0", - "bundled": true, - "dev": true - }, - "isarray": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "isbinaryfile": { - "version": "3.0.2", - "bundled": true, - "dev": true - }, - "isexe": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "isobject": { - "version": "2.1.0", - "bundled": true, - "dev": true, - "requires": { - "isarray": "1.0.0" - } - }, - "isparta": { - "version": "4.0.0", - "bundled": true, - "dev": true, - "requires": { - "babel-core": "6.25.0", - "escodegen": "1.8.1", - "esprima": "2.7.3", - "istanbul": "0.4.5", - "mkdirp": "0.5.1", - "nomnomnomnom": "2.0.1", - "object-assign": "4.1.1", - "source-map": "0.5.6", - "which": "1.2.14" - }, - "dependencies": { - "esprima": { - "version": "2.7.3", - "bundled": true, - "dev": true - } - } - }, - "isstream": { - "version": "0.1.2", - "bundled": true, - "dev": true - }, - "istanbul": { - "version": "0.4.5", - "bundled": true, - "dev": true, - "requires": { - "abbrev": "1.0.9", - "async": "1.5.2", - "escodegen": "1.8.1", - "esprima": "2.7.3", - "glob": "5.0.15", - "handlebars": "4.0.10", - "js-yaml": "3.8.4", - "mkdirp": "0.5.1", - "nopt": "3.0.6", - "once": "1.4.0", - "resolve": "1.1.7", - "supports-color": "3.2.3", - "which": "1.2.14", - "wordwrap": "1.0.0" - }, - "dependencies": { - "abbrev": { - "version": "1.0.9", - "bundled": true, - "dev": true - }, - "async": { - "version": "1.5.2", - "bundled": true, - "dev": true - }, - "esprima": { - "version": "2.7.3", - "bundled": true, - "dev": true - }, - "glob": { - "version": "5.0.15", - "bundled": true, - "dev": true, - "requires": { - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - }, - "resolve": { - "version": "1.1.7", - "bundled": true, - "dev": true - }, - "supports-color": { - "version": "3.2.3", - "bundled": true, - "dev": true, - "requires": { - "has-flag": "1.0.0" - } - } - } - }, - "istextorbinary": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "binaryextensions": "1.0.1", - "textextensions": "1.0.2" - } - }, - "jade": { - "version": "0.26.3", - "bundled": true, - "dev": true, - "requires": { - "commander": "0.6.1", - "mkdirp": "0.3.0" - }, - "dependencies": { - "commander": { - "version": "0.6.1", - "bundled": true, - "dev": true - }, - "mkdirp": { - "version": "0.3.0", - "bundled": true, - "dev": true - } - } - }, - "js-base64": { - "version": "2.1.9", - "bundled": true, - "dev": true - }, - "js-tokens": { - "version": "3.0.1", - "bundled": true, - "dev": true - }, - "js-yaml": { - "version": "3.8.4", - "bundled": true, - "dev": true, - "requires": { - "argparse": "1.0.9", - "esprima": "3.1.3" - } - }, - "js2xmlparser": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "jsdoc": { - "version": "3.4.3", - "bundled": true, - "dev": true, - "requires": { - "bluebird": "3.4.7", - "catharsis": "0.8.8", - "escape-string-regexp": "1.0.5", - "espree": "3.1.7", - "js2xmlparser": "1.0.0", - "klaw": "1.3.1", - "marked": "0.3.6", - "mkdirp": "0.5.1", - "requizzle": "0.2.1", - "strip-json-comments": "2.0.1", - "taffydb": "2.6.2", - "underscore": "1.8.3" - }, - "dependencies": { - "acorn": { - "version": "3.3.0", - "bundled": true, - "dev": true - }, - "espree": { - "version": "3.1.7", - "bundled": true, - "dev": true, - "requires": { - "acorn": "3.3.0", - "acorn-jsx": "3.0.1" - } - } - } - }, - "jsesc": { - "version": "0.5.0", - "bundled": true, - "dev": true - }, - "jshint": { - "version": "2.9.4", - "bundled": true, - "dev": true, - "requires": { - "cli": "1.0.1", - "console-browserify": "1.1.0", - "exit": "0.1.2", - "htmlparser2": "3.8.3", - "lodash": "3.7.0", - "minimatch": "3.0.4", - "shelljs": "0.3.0", - "strip-json-comments": "1.0.4" - }, - "dependencies": { - "lodash": { - "version": "3.7.0", - "bundled": true, - "dev": true - }, - "shelljs": { - "version": "0.3.0", - "bundled": true, - "dev": true - }, - "strip-json-comments": { - "version": "1.0.4", - "bundled": true, - "dev": true - } - } - }, - "jshint-stylish": { - "version": "2.2.1", - "bundled": true, - "dev": true, - "requires": { - "beeper": "1.1.1", - "chalk": "1.1.3", - "log-symbols": "1.0.2", - "plur": "2.1.2", - "string-length": "1.0.1", - "text-table": "0.2.0" - } - }, - "json-schema": { - "version": "0.2.3", - "bundled": true, - "dev": true - }, - "json-stable-stringify": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "requires": { - "jsonify": "0.0.0" - } - }, - "json-stringify-safe": { - "version": "5.0.1", - "bundled": true, - "dev": true - }, - "json3": { - "version": "3.3.2", - "bundled": true, - "dev": true - }, - "json5": { - "version": "0.5.1", - "bundled": true, - "dev": true - }, - "jsonify": { - "version": "0.0.0", - "bundled": true, - "dev": true - }, - "jsonpointer": { - "version": "4.0.1", - "bundled": true, - "dev": true - }, - "jsprim": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.0.2", - "json-schema": "0.2.3", - "verror": "1.3.6" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "bundled": true, - "dev": true - } - } - }, - "karma": { - "version": "1.7.0", - "bundled": true, - "dev": true, - "requires": { - "bluebird": "3.4.7", - "body-parser": "1.17.2", - "chokidar": "1.7.0", - "colors": "1.1.2", - "combine-lists": "1.0.1", - "connect": "3.6.2", - "core-js": "2.4.1", - "di": "0.0.1", - "dom-serialize": "2.2.1", - "expand-braces": "0.1.2", - "glob": "7.1.2", - "graceful-fs": "4.1.11", - "http-proxy": "1.16.2", - "isbinaryfile": "3.0.2", - "lodash": "3.10.1", - "log4js": "0.6.38", - "mime": "1.3.6", - "minimatch": "3.0.4", - "optimist": "0.6.1", - "qjobs": "1.1.5", - "range-parser": "1.2.0", - "rimraf": "2.6.1", - "safe-buffer": "5.0.1", - "socket.io": "1.7.3", - "source-map": "0.5.6", - "tmp": "0.0.31", - "useragent": "2.1.13" - }, - "dependencies": { - "lodash": { - "version": "3.10.1", - "bundled": true, - "dev": true - } - } - }, - "karma-babel-preprocessor": { - "version": "6.0.1", - "bundled": true, - "dev": true, - "requires": { - "babel-core": "6.25.0" - } - }, - "karma-chai": { - "version": "0.1.0", - "bundled": true, - "dev": true - }, - "karma-chrome-launcher": { - "version": "0.2.3", - "bundled": true, - "dev": true, - "requires": { - "fs-access": "1.0.1", - "which": "1.2.14" - } - }, - "karma-commonjs": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "karma-coverage": { - "version": "0.5.5", - "bundled": true, - "dev": true, - "requires": { - "dateformat": "1.0.12", - "istanbul": "0.4.5", - "minimatch": "3.0.4", - "source-map": "0.5.6" - }, - "dependencies": { - "dateformat": { - "version": "1.0.12", - "bundled": true, - "dev": true, - "requires": { - "get-stdin": "4.0.1", - "meow": "3.7.0" - } - } - } - }, - "karma-firefox-launcher": { - "version": "0.1.7", - "bundled": true, - "dev": true - }, - "karma-ievms": { - "version": "0.1.0", - "bundled": true, - "dev": true, - "requires": { - "iectrl": "0.1.2" - } - }, - "karma-mocha": { - "version": "0.2.2", - "bundled": true, - "dev": true - }, - "karma-safari-launcher": { - "version": "0.1.1", - "bundled": true, - "dev": true - }, - "karma-sauce-launcher": { - "version": "0.3.1", - "bundled": true, - "dev": true, - "requires": { - "q": "1.5.0", - "sauce-connect-launcher": "0.13.0", - "saucelabs": "1.4.0", - "wd": "0.3.12" - }, - "dependencies": { - "q": { - "version": "1.5.0", - "bundled": true, - "dev": true - } - } - }, - "karma-sinon": { - "version": "1.0.5", - "bundled": true, - "dev": true - }, - "karma-source-map-support": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "requires": { - "source-map-support": "0.4.15" - } - }, - "keypress": { - "version": "0.1.0", - "bundled": true, - "dev": true - }, - "kind-of": { - "version": "3.2.2", - "bundled": true, - "dev": true, - "requires": { - "is-buffer": "1.1.5" - } - }, - "klaw": { - "version": "1.3.1", - "bundled": true, - "dev": true, - "requires": { - "graceful-fs": "4.1.11" - } - }, - "lazy-cache": { - "version": "1.0.4", - "bundled": true, - "dev": true - }, - "lazystream": { - "version": "0.1.0", - "bundled": true, - "dev": true, - "requires": { - "readable-stream": "1.0.34" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "readable-stream": { - "version": "1.0.34", - "bundled": true, - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" - } - }, - "string_decoder": { - "version": "0.10.31", - "bundled": true, - "dev": true - } - } - }, - "lcid": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "invert-kv": "1.0.0" - } - }, - "levn": { - "version": "0.3.0", - "bundled": true, - "dev": true, - "requires": { - "prelude-ls": "1.1.2", - "type-check": "0.3.2" - } - }, - "load-json-file": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "requires": { - "graceful-fs": "4.1.11", - "parse-json": "2.2.0", - "pify": "2.3.0", - "pinkie-promise": "2.0.1", - "strip-bom": "2.0.0" - }, - "dependencies": { - "strip-bom": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "is-utf8": "0.2.1" - } - } - } - }, - "lodash": { - "version": "4.17.4", - "bundled": true, - "dev": true - }, - "lodash._basecopy": { - "version": "3.0.1", - "bundled": true, - "dev": true - }, - "lodash._basetostring": { - "version": "3.0.1", - "bundled": true, - "dev": true - }, - "lodash._basevalues": { - "version": "3.0.0", - "bundled": true, - "dev": true - }, - "lodash._getnative": { - "version": "3.9.1", - "bundled": true, - "dev": true - }, - "lodash._isiterateecall": { - "version": "3.0.9", - "bundled": true, - "dev": true - }, - "lodash._reescape": { - "version": "3.0.0", - "bundled": true, - "dev": true - }, - "lodash._reevaluate": { - "version": "3.0.0", - "bundled": true, - "dev": true - }, - "lodash._reinterpolate": { - "version": "3.0.0", - "bundled": true, - "dev": true - }, - "lodash._root": { - "version": "3.0.1", - "bundled": true, - "dev": true - }, - "lodash.assign": { - "version": "4.2.0", - "bundled": true, - "dev": true - }, - "lodash.clonedeep": { - "version": "4.5.0", - "bundled": true, - "dev": true - }, - "lodash.escape": { - "version": "3.2.0", - "bundled": true, - "dev": true, - "requires": { - "lodash._root": "3.0.1" - } - }, - "lodash.isarguments": { - "version": "3.1.0", - "bundled": true, - "dev": true - }, - "lodash.isarray": { - "version": "3.0.4", - "bundled": true, - "dev": true - }, - "lodash.isequal": { - "version": "4.5.0", - "bundled": true, - "dev": true - }, - "lodash.isobject": { - "version": "3.0.2", - "bundled": true, - "dev": true - }, - "lodash.keys": { - "version": "3.1.2", - "bundled": true, - "dev": true, - "requires": { - "lodash._getnative": "3.9.1", - "lodash.isarguments": "3.1.0", - "lodash.isarray": "3.0.4" - } - }, - "lodash.merge": { - "version": "4.6.0", - "bundled": true, - "dev": true - }, - "lodash.restparam": { - "version": "3.6.1", - "bundled": true, - "dev": true - }, - "lodash.template": { - "version": "3.6.2", - "bundled": true, - "dev": true, - "requires": { - "lodash._basecopy": "3.0.1", - "lodash._basetostring": "3.0.1", - "lodash._basevalues": "3.0.0", - "lodash._isiterateecall": "3.0.9", - "lodash._reinterpolate": "3.0.0", - "lodash.escape": "3.2.0", - "lodash.keys": "3.1.2", - "lodash.restparam": "3.6.1", - "lodash.templatesettings": "3.1.1" - } - }, - "lodash.templatesettings": { - "version": "3.1.1", - "bundled": true, - "dev": true, - "requires": { - "lodash._reinterpolate": "3.0.0", - "lodash.escape": "3.2.0" - } - }, - "log-symbols": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "chalk": "1.1.3" - } - }, - "log4js": { - "version": "0.6.38", - "bundled": true, - "dev": true, - "requires": { - "readable-stream": "1.0.34", - "semver": "4.3.6" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "readable-stream": { - "version": "1.0.34", - "bundled": true, - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" - } - }, - "string_decoder": { - "version": "0.10.31", - "bundled": true, - "dev": true - } - } - }, - "lolex": { - "version": "1.3.2", - "bundled": true, - "dev": true - }, - "longest": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "loose-envify": { - "version": "1.3.1", - "bundled": true, - "dev": true, - "requires": { - "js-tokens": "3.0.1" - } - }, - "loud-rejection": { - "version": "1.6.0", - "bundled": true, - "dev": true, - "requires": { - "currently-unhandled": "0.4.1", - "signal-exit": "3.0.2" - } - }, - "lru-cache": { - "version": "2.7.3", - "bundled": true, - "dev": true - }, - "map-obj": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "marked": { - "version": "0.3.6", - "bundled": true, - "dev": true - }, - "media-typer": { - "version": "0.3.0", - "bundled": true, - "dev": true - }, - "meow": { - "version": "3.7.0", - "bundled": true, - "dev": true, - "requires": { - "camelcase-keys": "2.1.0", - "decamelize": "1.2.0", - "loud-rejection": "1.6.0", - "map-obj": "1.0.1", - "minimist": "1.2.0", - "normalize-package-data": "2.3.8", - "object-assign": "4.1.1", - "read-pkg-up": "1.0.1", - "redent": "1.0.0", - "trim-newlines": "1.0.0" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "bundled": true, - "dev": true - } - } - }, - "merge": { - "version": "1.2.0", - "bundled": true, - "dev": true - }, - "merge-stream": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "requires": { - "readable-stream": "2.2.11" - } - }, - "metal-jquery-adapter": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "metal-karma-config": { - "version": "2.3.1", - "bundled": true, - "dev": true, - "requires": { - "babel-plugin-transform-node-env-inline": "0.1.1", - "babel-preset-metal": "3.1.0", - "chai": "2.3.0", - "isparta": "4.0.0", - "karma-babel-preprocessor": "6.0.1", - "karma-chai": "0.1.0", - "karma-chrome-launcher": "0.2.3", - "karma-commonjs": "1.0.0", - "karma-coverage": "0.5.5", - "karma-mocha": "0.2.2", - "karma-sinon": "1.0.5", - "karma-source-map-support": "1.2.0", - "mocha": "2.5.3", - "sinon": "1.17.7" - } - }, - "metal-tools-build-amd": { - "version": "3.0.3", - "bundled": true, - "dev": true, - "requires": { - "babel-plugin-transform-es2015-modules-amd": "6.24.1", - "babel-preset-es2015": "6.24.1", - "babel-preset-metal-resolve-source": "1.0.2", - "bower": "1.8.0", - "gulp-babel-deps": "2.0.1", - "gulp-if": "2.0.2", - "gulp-sourcemaps": "1.6.0", - "merge": "1.2.0", - "stream-combiner": "0.2.2", - "stream-consume": "0.1.0", - "through2": "2.0.3", - "vinyl-fs": "2.4.4" - }, - "dependencies": { - "glob": { - "version": "5.0.15", - "bundled": true, - "dev": true, - "requires": { - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - }, - "glob-parent": { - "version": "3.1.0", - "bundled": true, - "dev": true, - "requires": { - "is-glob": "3.1.0", - "path-dirname": "1.0.2" - } - }, - "glob-stream": { - "version": "5.3.5", - "bundled": true, - "dev": true, - "requires": { - "extend": "3.0.1", - "glob": "5.0.15", - "glob-parent": "3.1.0", - "micromatch": "2.3.11", - "ordered-read-streams": "0.3.0", - "through2": "0.6.5", - "to-absolute-glob": "0.1.1", - "unique-stream": "2.2.1" - }, - "dependencies": { - "readable-stream": { - "version": "1.0.34", - "bundled": true, - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" - } - }, - "through2": { - "version": "0.6.5", - "bundled": true, - "dev": true, - "requires": { - "readable-stream": "1.0.34", - "xtend": "4.0.1" - } - } - } - }, - "is-extglob": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "is-glob": { - "version": "3.1.0", - "bundled": true, - "dev": true, - "requires": { - "is-extglob": "2.1.1" - } - }, - "isarray": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "lazystream": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "readable-stream": "2.2.11" - } - }, - "ordered-read-streams": { - "version": "0.3.0", - "bundled": true, - "dev": true, - "requires": { - "is-stream": "1.1.0", - "readable-stream": "2.2.11" - } - }, - "string_decoder": { - "version": "0.10.31", - "bundled": true, - "dev": true - }, - "strip-bom": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "is-utf8": "0.2.1" - } - }, - "unique-stream": { - "version": "2.2.1", - "bundled": true, - "dev": true, - "requires": { - "json-stable-stringify": "1.0.1", - "through2-filter": "2.0.0" - } - }, - "vinyl": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "requires": { - "clone": "1.0.2", - "clone-stats": "0.0.1", - "replace-ext": "0.0.1" - } - }, - "vinyl-fs": { - "version": "2.4.4", - "bundled": true, - "dev": true, - "requires": { - "duplexify": "3.5.0", - "glob-stream": "5.3.5", - "graceful-fs": "4.1.11", - "gulp-sourcemaps": "1.6.0", - "is-valid-glob": "0.3.0", - "lazystream": "1.0.0", - "lodash.isequal": "4.5.0", - "merge-stream": "1.0.1", - "mkdirp": "0.5.1", - "object-assign": "4.1.1", - "readable-stream": "2.2.11", - "strip-bom": "2.0.0", - "strip-bom-stream": "1.0.0", - "through2": "2.0.3", - "through2-filter": "2.0.0", - "vali-date": "1.0.0", - "vinyl": "1.2.0" - } - } - } - }, - "metal-tools-build-globals": { - "version": "2.0.2", - "bundled": true, - "dev": true, - "requires": { - "babel-preset-es2015": "6.24.1", - "babel-preset-metal-resolve-source": "1.0.2", - "gulp-babel-globals": "2.0.0", - "gulp-if": "2.0.2", - "gulp-sourcemaps": "1.6.0", - "merge": "1.2.0", - "stream-combiner": "0.2.2", - "stream-consume": "0.1.0", - "vinyl-fs": "2.4.4" - }, - "dependencies": { - "glob": { - "version": "5.0.15", - "bundled": true, - "dev": true, - "requires": { - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - }, - "glob-parent": { - "version": "3.1.0", - "bundled": true, - "dev": true, - "requires": { - "is-glob": "3.1.0", - "path-dirname": "1.0.2" - } - }, - "glob-stream": { - "version": "5.3.5", - "bundled": true, - "dev": true, - "requires": { - "extend": "3.0.1", - "glob": "5.0.15", - "glob-parent": "3.1.0", - "micromatch": "2.3.11", - "ordered-read-streams": "0.3.0", - "through2": "0.6.5", - "to-absolute-glob": "0.1.1", - "unique-stream": "2.2.1" - }, - "dependencies": { - "readable-stream": { - "version": "1.0.34", - "bundled": true, - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" - } - }, - "through2": { - "version": "0.6.5", - "bundled": true, - "dev": true, - "requires": { - "readable-stream": "1.0.34", - "xtend": "4.0.1" - } - } - } - }, - "is-extglob": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "is-glob": { - "version": "3.1.0", - "bundled": true, - "dev": true, - "requires": { - "is-extglob": "2.1.1" - } - }, - "isarray": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "lazystream": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "readable-stream": "2.2.11" - } - }, - "ordered-read-streams": { - "version": "0.3.0", - "bundled": true, - "dev": true, - "requires": { - "is-stream": "1.1.0", - "readable-stream": "2.2.11" - } - }, - "string_decoder": { - "version": "0.10.31", - "bundled": true, - "dev": true - }, - "strip-bom": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "is-utf8": "0.2.1" - } - }, - "unique-stream": { - "version": "2.2.1", - "bundled": true, - "dev": true, - "requires": { - "json-stable-stringify": "1.0.1", - "through2-filter": "2.0.0" - } - }, - "vinyl": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "requires": { - "clone": "1.0.2", - "clone-stats": "0.0.1", - "replace-ext": "0.0.1" - } - }, - "vinyl-fs": { - "version": "2.4.4", - "bundled": true, - "dev": true, - "requires": { - "duplexify": "3.5.0", - "glob-stream": "5.3.5", - "graceful-fs": "4.1.11", - "gulp-sourcemaps": "1.6.0", - "is-valid-glob": "0.3.0", - "lazystream": "1.0.0", - "lodash.isequal": "4.5.0", - "merge-stream": "1.0.1", - "mkdirp": "0.5.1", - "object-assign": "4.1.1", - "readable-stream": "2.2.11", - "strip-bom": "2.0.0", - "strip-bom-stream": "1.0.0", - "through2": "2.0.3", - "through2-filter": "2.0.0", - "vali-date": "1.0.0", - "vinyl": "1.2.0" - } - } - } - }, - "metal-tools-build-jquery": { - "version": "2.0.2", - "bundled": true, - "dev": true, - "requires": { - "gulp-if": "2.0.2", - "gulp-sourcemaps": "1.6.0", - "gulp-wrapper": "1.0.0", - "metal-jquery-adapter": "1.0.0", - "metal-tools-build-globals": "2.0.2", - "stream-combiner": "0.2.2", - "stream-consume": "0.1.0", - "vinyl-fs": "2.4.4" - }, - "dependencies": { - "glob": { - "version": "5.0.15", - "bundled": true, - "dev": true, - "requires": { - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - }, - "glob-parent": { - "version": "3.1.0", - "bundled": true, - "dev": true, - "requires": { - "is-glob": "3.1.0", - "path-dirname": "1.0.2" - } - }, - "glob-stream": { - "version": "5.3.5", - "bundled": true, - "dev": true, - "requires": { - "extend": "3.0.1", - "glob": "5.0.15", - "glob-parent": "3.1.0", - "micromatch": "2.3.11", - "ordered-read-streams": "0.3.0", - "through2": "0.6.5", - "to-absolute-glob": "0.1.1", - "unique-stream": "2.2.1" - }, - "dependencies": { - "readable-stream": { - "version": "1.0.34", - "bundled": true, - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" - } - }, - "through2": { - "version": "0.6.5", - "bundled": true, - "dev": true, - "requires": { - "readable-stream": "1.0.34", - "xtend": "4.0.1" - } - } - } - }, - "is-extglob": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "is-glob": { - "version": "3.1.0", - "bundled": true, - "dev": true, - "requires": { - "is-extglob": "2.1.1" - } - }, - "isarray": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "lazystream": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "readable-stream": "2.2.11" - } - }, - "ordered-read-streams": { - "version": "0.3.0", - "bundled": true, - "dev": true, - "requires": { - "is-stream": "1.1.0", - "readable-stream": "2.2.11" - } - }, - "string_decoder": { - "version": "0.10.31", - "bundled": true, - "dev": true - }, - "strip-bom": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "is-utf8": "0.2.1" - } - }, - "unique-stream": { - "version": "2.2.1", - "bundled": true, - "dev": true, - "requires": { - "json-stable-stringify": "1.0.1", - "through2-filter": "2.0.0" - } - }, - "vinyl": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "requires": { - "clone": "1.0.2", - "clone-stats": "0.0.1", - "replace-ext": "0.0.1" - } - }, - "vinyl-fs": { - "version": "2.4.4", - "bundled": true, - "dev": true, - "requires": { - "duplexify": "3.5.0", - "glob-stream": "5.3.5", - "graceful-fs": "4.1.11", - "gulp-sourcemaps": "1.6.0", - "is-valid-glob": "0.3.0", - "lazystream": "1.0.0", - "lodash.isequal": "4.5.0", - "merge-stream": "1.0.1", - "mkdirp": "0.5.1", - "object-assign": "4.1.1", - "readable-stream": "2.2.11", - "strip-bom": "2.0.0", - "strip-bom-stream": "1.0.0", - "through2": "2.0.3", - "through2-filter": "2.0.0", - "vali-date": "1.0.0", - "vinyl": "1.2.0" - } - } - } - }, - "metal-tools-soy": { - "version": "3.1.0", - "bundled": true, - "dev": true, - "requires": { - "glob-expand": "0.1.0", - "gulp-if": "2.0.2", - "gulp-ignore": "2.0.2", - "gulp-replace": "0.5.4", - "gulp-util": "3.0.8", - "gulp-wrapper": "1.0.0", - "merge": "1.2.0", - "soyparser": "0.2.5", - "stream-combiner": "0.2.2", - "stream-consume": "0.1.0", - "through2": "2.0.3", - "vinyl-fs": "2.4.4" - }, - "dependencies": { - "glob": { - "version": "5.0.15", - "bundled": true, - "dev": true, - "requires": { - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - }, - "glob-parent": { - "version": "3.1.0", - "bundled": true, - "dev": true, - "requires": { - "is-glob": "3.1.0", - "path-dirname": "1.0.2" - } - }, - "glob-stream": { - "version": "5.3.5", - "bundled": true, - "dev": true, - "requires": { - "extend": "3.0.1", - "glob": "5.0.15", - "glob-parent": "3.1.0", - "micromatch": "2.3.11", - "ordered-read-streams": "0.3.0", - "through2": "0.6.5", - "to-absolute-glob": "0.1.1", - "unique-stream": "2.2.1" - }, - "dependencies": { - "readable-stream": { - "version": "1.0.34", - "bundled": true, - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" - } - }, - "through2": { - "version": "0.6.5", - "bundled": true, - "dev": true, - "requires": { - "readable-stream": "1.0.34", - "xtend": "4.0.1" - } - } - } - }, - "is-extglob": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "is-glob": { - "version": "3.1.0", - "bundled": true, - "dev": true, - "requires": { - "is-extglob": "2.1.1" - } - }, - "isarray": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "lazystream": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "readable-stream": "2.2.11" - } - }, - "ordered-read-streams": { - "version": "0.3.0", - "bundled": true, - "dev": true, - "requires": { - "is-stream": "1.1.0", - "readable-stream": "2.2.11" - } - }, - "string_decoder": { - "version": "0.10.31", - "bundled": true, - "dev": true - }, - "strip-bom": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "is-utf8": "0.2.1" - } - }, - "unique-stream": { - "version": "2.2.1", - "bundled": true, - "dev": true, - "requires": { - "json-stable-stringify": "1.0.1", - "through2-filter": "2.0.0" - } - }, - "vinyl": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "requires": { - "clone": "1.0.2", - "clone-stats": "0.0.1", - "replace-ext": "0.0.1" - } - }, - "vinyl-fs": { - "version": "2.4.4", - "bundled": true, - "dev": true, - "requires": { - "duplexify": "3.5.0", - "glob-stream": "5.3.5", - "graceful-fs": "4.1.11", - "gulp-sourcemaps": "1.6.0", - "is-valid-glob": "0.3.0", - "lazystream": "1.0.0", - "lodash.isequal": "4.5.0", - "merge-stream": "1.0.1", - "mkdirp": "0.5.1", - "object-assign": "4.1.1", - "readable-stream": "2.2.11", - "strip-bom": "2.0.0", - "strip-bom-stream": "1.0.0", - "through2": "2.0.3", - "through2-filter": "2.0.0", - "vali-date": "1.0.0", - "vinyl": "1.2.0" - } - } - } - }, - "micromatch": { - "version": "2.3.11", - "bundled": true, - "dev": true, - "requires": { - "arr-diff": "2.0.0", - "array-unique": "0.2.1", - "braces": "1.8.5", - "expand-brackets": "0.1.5", - "extglob": "0.3.2", - "filename-regex": "2.0.1", - "is-extglob": "1.0.0", - "is-glob": "2.0.1", - "kind-of": "3.2.2", - "normalize-path": "2.1.1", - "object.omit": "2.0.1", - "parse-glob": "3.0.4", - "regex-cache": "0.4.3" - } - }, - "mime": { - "version": "1.3.6", - "bundled": true, - "dev": true - }, - "mime-db": { - "version": "1.27.0", - "bundled": true, - "dev": true - }, - "mime-types": { - "version": "2.1.15", - "bundled": true, - "dev": true, - "requires": { - "mime-db": "1.27.0" - } - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "dev": true, - "requires": { - "brace-expansion": "1.1.8" - } - }, - "minimist": { - "version": "0.0.8", - "bundled": true, - "dev": true - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "dev": true, - "requires": { - "minimist": "0.0.8" - } - }, - "mocha": { - "version": "2.5.3", - "bundled": true, - "dev": true, - "requires": { - "commander": "2.3.0", - "debug": "2.2.0", - "diff": "1.4.0", - "escape-string-regexp": "1.0.2", - "glob": "3.2.11", - "growl": "1.9.2", - "jade": "0.26.3", - "mkdirp": "0.5.1", - "supports-color": "1.2.0", - "to-iso-string": "0.0.2" - }, - "dependencies": { - "commander": { - "version": "2.3.0", - "bundled": true, - "dev": true - }, - "debug": { - "version": "2.2.0", - "bundled": true, - "dev": true, - "requires": { - "ms": "0.7.1" - } - }, - "escape-string-regexp": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "glob": { - "version": "3.2.11", - "bundled": true, - "dev": true, - "requires": { - "inherits": "2.0.3", - "minimatch": "0.3.0" - } - }, - "minimatch": { - "version": "0.3.0", - "bundled": true, - "dev": true, - "requires": { - "lru-cache": "2.7.3", - "sigmund": "1.0.1" - } - }, - "ms": { - "version": "0.7.1", - "bundled": true, - "dev": true - }, - "supports-color": { - "version": "1.2.0", - "bundled": true, - "dev": true - } - } - }, - "moment": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "mout": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "ms": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "mtil": { - "version": "0.1.3", - "bundled": true, - "dev": true - }, - "multipipe": { - "version": "0.1.2", - "bundled": true, - "dev": true, - "requires": { - "duplexer2": "0.0.2" - } - }, - "mute-stream": { - "version": "0.0.5", - "bundled": true, - "dev": true - }, - "nan": { - "version": "2.6.2", - "bundled": true, - "dev": true - }, - "natural-compare": { - "version": "1.4.0", - "bundled": true, - "dev": true - }, - "negotiator": { - "version": "0.6.1", - "bundled": true, - "dev": true - }, - "node-gyp": { - "version": "3.6.2", - "bundled": true, - "dev": true, - "requires": { - "fstream": "1.0.11", - "glob": "7.1.2", - "graceful-fs": "4.1.11", - "minimatch": "3.0.4", - "mkdirp": "0.5.1", - "nopt": "3.0.6", - "npmlog": "4.1.0", - "osenv": "0.1.4", - "request": "2.81.0", - "rimraf": "2.6.1", - "semver": "5.3.0", - "tar": "2.2.1", - "which": "1.2.14" - }, - "dependencies": { - "semver": { - "version": "5.3.0", - "bundled": true, - "dev": true - } - } - }, - "node-int64": { - "version": "0.3.3", - "bundled": true, - "dev": true - }, - "node-sass": { - "version": "3.13.1", - "bundled": true, - "dev": true, - "requires": { - "async-foreach": "0.1.3", - "chalk": "1.1.3", - "cross-spawn": "3.0.1", - "gaze": "1.1.2", - "get-stdin": "4.0.1", - "glob": "7.1.2", - "in-publish": "2.0.0", - "lodash.assign": "4.2.0", - "lodash.clonedeep": "4.5.0", - "meow": "3.7.0", - "mkdirp": "0.5.1", - "nan": "2.6.2", - "node-gyp": "3.6.2", - "npmlog": "4.1.0", - "request": "2.81.0", - "sass-graph": "2.2.4" - }, - "dependencies": { - "gaze": { - "version": "1.1.2", - "bundled": true, - "dev": true, - "requires": { - "globule": "1.2.0" - } - }, - "globule": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "requires": { - "glob": "7.1.2", - "lodash": "4.17.4", - "minimatch": "3.0.4" - } - } - } - }, - "nomnomnomnom": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "chalk": "0.4.0", - "underscore": "1.6.0" - }, - "dependencies": { - "ansi-styles": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "chalk": { - "version": "0.4.0", - "bundled": true, - "dev": true, - "requires": { - "ansi-styles": "1.0.0", - "has-color": "0.1.7", - "strip-ansi": "0.1.1" - } - }, - "strip-ansi": { - "version": "0.1.1", - "bundled": true, - "dev": true - }, - "underscore": { - "version": "1.6.0", - "bundled": true, - "dev": true - } - } - }, - "nopt": { - "version": "3.0.6", - "bundled": true, - "dev": true, - "requires": { - "abbrev": "1.1.0" - } - }, - "normalize-package-data": { - "version": "2.3.8", - "bundled": true, - "dev": true, - "requires": { - "hosted-git-info": "2.4.2", - "is-builtin-module": "1.0.0", - "semver": "4.3.6", - "validate-npm-package-license": "3.0.1" - } - }, - "normalize-path": { - "version": "2.1.1", - "bundled": true, - "dev": true, - "requires": { - "remove-trailing-separator": "1.0.2" - } - }, - "npm-path": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "requires": { - "which": "1.2.14" - } - }, - "npm-run": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "minimist": "1.2.0", - "npm-path": "1.1.0", - "npm-which": "2.0.0", - "serializerr": "1.0.3", - "spawn-sync": "1.0.15", - "sync-exec": "0.5.0" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "bundled": true, - "dev": true - } - } - }, - "npm-which": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "commander": "2.9.0", - "npm-path": "1.1.0", - "which": "1.2.14" - } - }, - "npmlog": { - "version": "4.1.0", - "bundled": true, - "dev": true, - "requires": { - "are-we-there-yet": "1.1.4", - "console-control-strings": "1.1.0", - "gauge": "2.7.4", - "set-blocking": "2.0.0" - } - }, - "null-check": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "oauth-sign": { - "version": "0.8.2", - "bundled": true, - "dev": true - }, - "object-assign": { - "version": "4.1.1", - "bundled": true, - "dev": true - }, - "object-component": { - "version": "0.0.3", - "bundled": true, - "dev": true - }, - "object.omit": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "for-own": "0.1.5", - "is-extendable": "0.1.1" - } - }, - "on-finished": { - "version": "2.3.0", - "bundled": true, - "dev": true, - "requires": { - "ee-first": "1.1.1" - } - }, - "once": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "requires": { - "wrappy": "1.0.2" - } - }, - "onetime": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "open": { - "version": "0.0.5", - "bundled": true, - "dev": true - }, - "optimist": { - "version": "0.6.1", - "bundled": true, - "dev": true, - "requires": { - "minimist": "0.0.8", - "wordwrap": "0.0.3" - }, - "dependencies": { - "wordwrap": { - "version": "0.0.3", - "bundled": true, - "dev": true - } - } - }, - "optionator": { - "version": "0.8.2", - "bundled": true, - "dev": true, - "requires": { - "deep-is": "0.1.3", - "fast-levenshtein": "2.0.6", - "levn": "0.3.0", - "prelude-ls": "1.1.2", - "type-check": "0.3.2", - "wordwrap": "1.0.0" - } - }, - "options": { - "version": "0.0.6", - "bundled": true, - "dev": true - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "os-locale": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "requires": { - "lcid": "1.0.0" - } - }, - "os-shim": { - "version": "0.1.3", - "bundled": true, - "dev": true - }, - "os-tmpdir": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "osenv": { - "version": "0.1.4", - "bundled": true, - "dev": true, - "requires": { - "os-homedir": "1.0.2", - "os-tmpdir": "1.0.2" - } - }, - "parse-glob": { - "version": "3.0.4", - "bundled": true, - "dev": true, - "requires": { - "glob-base": "0.3.0", - "is-dotfile": "1.0.3", - "is-extglob": "1.0.0", - "is-glob": "2.0.1" - } - }, - "parse-json": { - "version": "2.2.0", - "bundled": true, - "dev": true, - "requires": { - "error-ex": "1.3.1" - } - }, - "parsejson": { - "version": "0.0.3", - "bundled": true, - "dev": true, - "requires": { - "better-assert": "1.0.2" - } - }, - "parseqs": { - "version": "0.0.5", - "bundled": true, - "dev": true, - "requires": { - "better-assert": "1.0.2" - } - }, - "parseuri": { - "version": "0.0.5", - "bundled": true, - "dev": true, - "requires": { - "better-assert": "1.0.2" - } - }, - "parseurl": { - "version": "1.3.1", - "bundled": true, - "dev": true - }, - "path-dirname": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "path-exists": { - "version": "2.1.0", - "bundled": true, - "dev": true, - "requires": { - "pinkie-promise": "2.0.1" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "path-is-inside": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "path-parse": { - "version": "1.0.5", - "bundled": true, - "dev": true - }, - "path-type": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "requires": { - "graceful-fs": "4.1.11", - "pify": "2.3.0", - "pinkie-promise": "2.0.1" - } - }, - "performance-now": { - "version": "0.2.0", - "bundled": true, - "dev": true - }, - "pify": { - "version": "2.3.0", - "bundled": true, - "dev": true - }, - "pinkie": { - "version": "2.0.4", - "bundled": true, - "dev": true - }, - "pinkie-promise": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "pinkie": "2.0.4" - } - }, - "plur": { - "version": "2.1.2", - "bundled": true, - "dev": true, - "requires": { - "irregular-plurals": "1.2.0" - } - }, - "pluralize": { - "version": "1.2.1", - "bundled": true, - "dev": true - }, - "prelude-ls": { - "version": "1.1.2", - "bundled": true, - "dev": true - }, - "preserve": { - "version": "0.2.0", - "bundled": true, - "dev": true - }, - "private": { - "version": "0.1.7", - "bundled": true, - "dev": true - }, - "process-nextick-args": { - "version": "1.0.7", - "bundled": true, - "dev": true - }, - "progress": { - "version": "1.1.8", - "bundled": true, - "dev": true - }, - "protochain": { - "version": "1.0.5", - "bundled": true, - "dev": true - }, - "pseudomap": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "punycode": { - "version": "1.4.1", - "bundled": true, - "dev": true - }, - "q": { - "version": "0.9.7", - "bundled": true, - "dev": true - }, - "qjobs": { - "version": "1.1.5", - "bundled": true, - "dev": true - }, - "qs": { - "version": "6.4.0", - "bundled": true, - "dev": true - }, - "randomatic": { - "version": "1.1.7", - "bundled": true, - "dev": true, - "requires": { - "is-number": "3.0.0", - "kind-of": "4.0.0" - }, - "dependencies": { - "is-number": { - "version": "3.0.0", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "bundled": true, - "dev": true, - "requires": { - "is-buffer": "1.1.5" - } - } - } - }, - "kind-of": { - "version": "4.0.0", - "bundled": true, - "dev": true, - "requires": { - "is-buffer": "1.1.5" - } - } - } - }, - "range-parser": { - "version": "1.2.0", - "bundled": true, - "dev": true - }, - "raw-body": { - "version": "2.2.0", - "bundled": true, - "dev": true, - "requires": { - "bytes": "2.4.0", - "iconv-lite": "0.4.15", - "unpipe": "1.0.0" - } - }, - "rcfinder": { - "version": "0.1.9", - "bundled": true, - "dev": true, - "requires": { - "lodash.clonedeep": "4.5.0" - } - }, - "rcloader": { - "version": "0.2.2", - "bundled": true, - "dev": true, - "requires": { - "lodash.assign": "4.2.0", - "lodash.isobject": "3.0.2", - "lodash.merge": "4.6.0", - "rcfinder": "0.1.9" - } - }, - "read-pkg": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "requires": { - "load-json-file": "1.1.0", - "normalize-package-data": "2.3.8", - "path-type": "1.1.0" - } - }, - "read-pkg-up": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "requires": { - "find-up": "1.1.2", - "read-pkg": "1.1.0" - } - }, - "readable-stream": { - "version": "2.2.11", + "version": "1.1.0", "bundled": true, "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "1.0.7", - "safe-buffer": "5.0.1", - "string_decoder": "1.0.2", - "util-deprecate": "1.0.2" - } + "optional": true }, - "readdirp": { - "version": "2.1.0", + "ajv": { + "version": "4.11.8", "bundled": true, "dev": true, + "optional": true, "requires": { - "graceful-fs": "4.1.11", - "minimatch": "3.0.4", - "readable-stream": "2.2.11", - "set-immediate-shim": "1.0.1" + "co": "4.6.0", + "json-stable-stringify": "1.0.1" } }, - "readline2": { - "version": "1.0.1", + "ansi-regex": { + "version": "2.1.1", "bundled": true, - "dev": true, - "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "mute-stream": "0.0.5" - } + "dev": true }, - "rechoir": { - "version": "0.6.2", + "aproba": { + "version": "1.1.1", "bundled": true, "dev": true, - "requires": { - "resolve": "1.3.3" - } + "optional": true }, - "redent": { - "version": "1.0.0", + "are-we-there-yet": { + "version": "1.1.4", "bundled": true, "dev": true, + "optional": true, "requires": { - "indent-string": "2.1.0", - "strip-indent": "1.0.1" + "delegates": "1.0.0", + "readable-stream": "2.2.9" } }, - "regenerate": { - "version": "1.3.2", + "asn1": { + "version": "0.2.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, - "regenerator-runtime": { - "version": "0.10.5", + "assert-plus": { + "version": "0.2.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, - "regenerator-transform": { - "version": "0.9.11", + "asynckit": { + "version": "0.4.0", "bundled": true, "dev": true, - "requires": { - "babel-runtime": "6.23.0", - "babel-types": "6.25.0", - "private": "0.1.7" - } + "optional": true }, - "regex-cache": { - "version": "0.4.3", + "aws-sign2": { + "version": "0.6.0", "bundled": true, "dev": true, - "requires": { - "is-equal-shallow": "0.1.3", - "is-primitive": "2.0.0" - } + "optional": true }, - "regexpu-core": { - "version": "2.0.0", + "aws4": { + "version": "1.6.0", "bundled": true, "dev": true, - "requires": { - "regenerate": "1.3.2", - "regjsgen": "0.2.0", - "regjsparser": "0.1.5" - } + "optional": true }, - "regjsgen": { - "version": "0.2.0", + "balanced-match": { + "version": "0.4.2", "bundled": true, "dev": true }, - "regjsparser": { - "version": "0.1.5", + "bcrypt-pbkdf": { + "version": "1.0.1", "bundled": true, "dev": true, + "optional": true, "requires": { - "jsesc": "0.5.0" + "tweetnacl": "0.14.5" } }, - "remove-trailing-separator": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "repeat-element": { - "version": "1.1.2", - "bundled": true, - "dev": true - }, - "repeat-string": { - "version": "1.6.1", - "bundled": true, - "dev": true - }, - "repeating": { - "version": "2.0.1", + "block-stream": { + "version": "0.0.9", "bundled": true, "dev": true, "requires": { - "is-finite": "1.0.2" + "inherits": "2.0.3" } }, - "replace-ext": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "replacestream": { - "version": "4.0.2", + "boom": { + "version": "2.10.1", "bundled": true, "dev": true, "requires": { - "escape-string-regexp": "1.0.5", - "object-assign": "4.1.1", - "readable-stream": "2.2.11" + "hoek": "2.16.3" } }, - "request": { - "version": "2.81.0", + "brace-expansion": { + "version": "1.1.7", "bundled": true, "dev": true, "requires": { - "aws-sign2": "0.6.0", - "aws4": "1.6.0", - "caseless": "0.12.0", - "combined-stream": "1.0.5", - "extend": "3.0.1", - "forever-agent": "0.6.1", - "form-data": "2.1.4", - "har-validator": "4.2.1", - "hawk": "3.1.3", - "http-signature": "1.1.1", - "is-typedarray": "1.0.0", - "isstream": "0.1.2", - "json-stringify-safe": "5.0.1", - "mime-types": "2.1.15", - "oauth-sign": "0.8.2", - "performance-now": "0.2.0", - "qs": "6.4.0", - "safe-buffer": "5.0.1", - "stringstream": "0.0.5", - "tough-cookie": "2.3.2", - "tunnel-agent": "0.6.0", - "uuid": "3.0.1" + "balanced-match": "0.4.2", + "concat-map": "0.0.1" } }, - "require-directory": { - "version": "2.1.1", + "buffer-shims": { + "version": "1.0.0", "bundled": true, "dev": true }, - "require-main-filename": { - "version": "1.0.1", + "caseless": { + "version": "0.12.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, - "require-uncached": { - "version": "1.0.3", + "co": { + "version": "4.6.0", "bundled": true, "dev": true, - "requires": { - "caller-path": "0.1.0", - "resolve-from": "1.0.1" - } + "optional": true }, - "requires-port": { - "version": "1.0.0", + "code-point-at": { + "version": "1.1.0", "bundled": true, "dev": true }, - "requizzle": { - "version": "0.2.1", - "bundled": true, - "dev": true, - "requires": { - "underscore": "1.6.0" - }, - "dependencies": { - "underscore": { - "version": "1.6.0", - "bundled": true, - "dev": true - } - } - }, - "resolve": { - "version": "1.3.3", + "combined-stream": { + "version": "1.0.5", "bundled": true, "dev": true, "requires": { - "path-parse": "1.0.5" + "delayed-stream": "1.0.0" } }, - "resolve-from": { - "version": "1.0.1", + "concat-map": { + "version": "0.0.1", "bundled": true, "dev": true }, - "restore-cursor": { - "version": "1.0.1", + "console-control-strings": { + "version": "1.1.0", "bundled": true, - "dev": true, - "requires": { - "exit-hook": "1.1.1", - "onetime": "1.1.0" - } + "dev": true }, - "right-align": { - "version": "0.1.3", + "core-util-is": { + "version": "1.0.2", "bundled": true, - "dev": true, - "requires": { - "align-text": "0.1.4" - } + "dev": true }, - "rimraf": { - "version": "2.6.1", + "cryptiles": { + "version": "2.0.5", "bundled": true, "dev": true, "requires": { - "glob": "7.1.2" + "boom": "2.10.1" } }, - "rocambole": { - "version": "0.7.0", + "dashdash": { + "version": "1.14.1", "bundled": true, "dev": true, + "optional": true, "requires": { - "esprima": "2.7.3" + "assert-plus": "1.0.0" }, "dependencies": { - "esprima": { - "version": "2.7.3", + "assert-plus": { + "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true } } }, - "rocambole-indent": { - "version": "2.0.4", + "debug": { + "version": "2.6.8", "bundled": true, "dev": true, + "optional": true, "requires": { - "debug": "2.6.8", - "mout": "0.11.1", - "rocambole-token": "1.2.1" - }, - "dependencies": { - "mout": { - "version": "0.11.1", - "bundled": true, - "dev": true - } + "ms": "2.0.0" } }, - "rocambole-linebreak": { - "version": "1.0.2", + "deep-extend": { + "version": "0.4.2", "bundled": true, "dev": true, - "requires": { - "debug": "2.6.8", - "rocambole-token": "1.2.1", - "semver": "4.3.6" - } + "optional": true }, - "rocambole-node": { + "delayed-stream": { "version": "1.0.0", "bundled": true, "dev": true }, - "rocambole-token": { - "version": "1.2.1", + "delegates": { + "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, - "rocambole-whitespace": { - "version": "1.0.0", + "detect-libc": { + "version": "1.0.2", "bundled": true, "dev": true, - "requires": { - "debug": "2.6.8", - "repeat-string": "1.6.1", - "rocambole-token": "1.2.1" - } + "optional": true }, - "run-async": { - "version": "0.1.0", + "ecc-jsbn": { + "version": "0.1.1", "bundled": true, "dev": true, + "optional": true, "requires": { - "once": "1.4.0" + "jsbn": "0.1.1" } }, - "run-sequence": { - "version": "1.2.2", + "extend": { + "version": "3.0.1", "bundled": true, "dev": true, - "requires": { - "chalk": "1.1.3", - "gulp-util": "3.0.8" - } + "optional": true }, - "rx-lite": { - "version": "3.1.2", + "extsprintf": { + "version": "1.0.2", "bundled": true, "dev": true }, - "safe-buffer": { - "version": "5.0.1", + "forever-agent": { + "version": "0.6.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, - "samsam": { - "version": "1.1.2", + "form-data": { + "version": "2.1.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "asynckit": "0.4.0", + "combined-stream": "1.0.5", + "mime-types": "2.1.15" + } + }, + "fs.realpath": { + "version": "1.0.0", "bundled": true, "dev": true }, - "sass-graph": { - "version": "2.2.4", + "fstream": { + "version": "1.0.11", "bundled": true, "dev": true, "requires": { - "glob": "7.1.2", - "lodash": "4.17.4", - "scss-tokenizer": "0.2.3", - "yargs": "7.1.0" + "graceful-fs": "4.1.11", + "inherits": "2.0.3", + "mkdirp": "0.5.1", + "rimraf": "2.6.1" } }, - "sauce-connect-launcher": { - "version": "0.13.0", + "fstream-ignore": { + "version": "1.0.5", "bundled": true, "dev": true, + "optional": true, "requires": { - "adm-zip": "0.4.7", - "async": "1.4.0", - "lodash": "3.10.1", - "rimraf": "2.4.3" - }, - "dependencies": { - "async": { - "version": "1.4.0", - "bundled": true, - "dev": true - }, - "glob": { - "version": "5.0.15", - "bundled": true, - "dev": true, - "requires": { - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - }, - "lodash": { - "version": "3.10.1", - "bundled": true, - "dev": true - }, - "rimraf": { - "version": "2.4.3", - "bundled": true, - "dev": true, - "requires": { - "glob": "5.0.15" - } - } + "fstream": "1.0.11", + "inherits": "2.0.3", + "minimatch": "3.0.4" } }, - "saucelabs": { - "version": "1.4.0", + "gauge": { + "version": "2.7.4", "bundled": true, "dev": true, + "optional": true, "requires": { - "https-proxy-agent": "1.0.0" + "aproba": "1.1.1", + "console-control-strings": "1.1.0", + "has-unicode": "2.0.1", + "object-assign": "4.1.1", + "signal-exit": "3.0.2", + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wide-align": "1.1.2" } }, - "scss-tokenizer": { - "version": "0.2.3", + "getpass": { + "version": "0.1.7", "bundled": true, "dev": true, + "optional": true, "requires": { - "js-base64": "2.1.9", - "source-map": "0.4.4" + "assert-plus": "1.0.0" }, "dependencies": { - "source-map": { - "version": "0.4.4", + "assert-plus": { + "version": "1.0.0", "bundled": true, "dev": true, - "requires": { - "amdefine": "1.0.1" - } + "optional": true } } }, - "semver": { - "version": "4.3.6", - "bundled": true, - "dev": true - }, - "serializerr": { - "version": "1.0.3", + "glob": { + "version": "7.1.2", "bundled": true, "dev": true, "requires": { - "protochain": "1.0.5" + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" } }, - "set-blocking": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "set-immediate-shim": { - "version": "1.0.1", + "graceful-fs": { + "version": "4.1.11", "bundled": true, "dev": true }, - "setprototypeof": { - "version": "1.0.3", + "har-schema": { + "version": "1.0.5", "bundled": true, - "dev": true + "dev": true, + "optional": true }, - "shelljs": { - "version": "0.7.8", + "har-validator": { + "version": "4.2.1", "bundled": true, "dev": true, + "optional": true, "requires": { - "glob": "7.1.2", - "interpret": "1.0.3", - "rechoir": "0.6.2" + "ajv": "4.11.8", + "har-schema": "1.0.5" } }, - "sigmund": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "signal-exit": { - "version": "3.0.2", + "has-unicode": { + "version": "2.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, - "sinon": { - "version": "1.17.7", + "hawk": { + "version": "3.1.3", "bundled": true, "dev": true, "requires": { - "formatio": "1.1.1", - "lolex": "1.3.2", - "samsam": "1.1.2", - "util": "0.10.3" + "boom": "2.10.1", + "cryptiles": "2.0.5", + "hoek": "2.16.3", + "sntp": "1.0.9" } }, - "slash": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "slice-ansi": { - "version": "0.0.4", + "hoek": { + "version": "2.16.3", "bundled": true, "dev": true }, - "sntp": { - "version": "1.0.9", + "http-signature": { + "version": "1.1.1", "bundled": true, "dev": true, + "optional": true, "requires": { - "hoek": "2.16.3" + "assert-plus": "0.2.0", + "jsprim": "1.4.0", + "sshpk": "1.13.0" } }, - "socket.io": { - "version": "1.7.3", + "inflight": { + "version": "1.0.6", "bundled": true, "dev": true, "requires": { - "debug": "2.3.3", - "engine.io": "1.8.3", - "has-binary": "0.1.7", - "object-assign": "4.1.0", - "socket.io-adapter": "0.5.0", - "socket.io-client": "1.7.3", - "socket.io-parser": "2.3.1" - }, - "dependencies": { - "debug": { - "version": "2.3.3", - "bundled": true, - "dev": true, - "requires": { - "ms": "0.7.2" - } - }, - "ms": { - "version": "0.7.2", - "bundled": true, - "dev": true - }, - "object-assign": { - "version": "4.1.0", - "bundled": true, - "dev": true - } + "once": "1.4.0", + "wrappy": "1.0.2" } }, - "socket.io-adapter": { - "version": "0.5.0", + "inherits": { + "version": "2.0.3", + "bundled": true, + "dev": true + }, + "ini": { + "version": "1.3.4", "bundled": true, "dev": true, - "requires": { - "debug": "2.3.3", - "socket.io-parser": "2.3.1" - }, - "dependencies": { - "debug": { - "version": "2.3.3", - "bundled": true, - "dev": true, - "requires": { - "ms": "0.7.2" - } - }, - "ms": { - "version": "0.7.2", - "bundled": true, - "dev": true - } - } + "optional": true }, - "socket.io-client": { - "version": "1.7.3", + "is-fullwidth-code-point": { + "version": "1.0.0", "bundled": true, "dev": true, "requires": { - "backo2": "1.0.2", - "component-bind": "1.0.0", - "component-emitter": "1.2.1", - "debug": "2.3.3", - "engine.io-client": "1.8.3", - "has-binary": "0.1.7", - "indexof": "0.0.1", - "object-component": "0.0.3", - "parseuri": "0.0.5", - "socket.io-parser": "2.3.1", - "to-array": "0.1.4" - }, - "dependencies": { - "component-emitter": { - "version": "1.2.1", - "bundled": true, - "dev": true - }, - "debug": { - "version": "2.3.3", - "bundled": true, - "dev": true, - "requires": { - "ms": "0.7.2" - } - }, - "ms": { - "version": "0.7.2", - "bundled": true, - "dev": true - } + "number-is-nan": "1.0.1" } }, - "socket.io-parser": { - "version": "2.3.1", + "is-typedarray": { + "version": "1.0.0", "bundled": true, "dev": true, - "requires": { - "component-emitter": "1.1.2", - "debug": "2.2.0", - "isarray": "0.0.1", - "json3": "3.3.2" - }, - "dependencies": { - "debug": { - "version": "2.2.0", - "bundled": true, - "dev": true, - "requires": { - "ms": "0.7.1" - } - }, - "isarray": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "ms": { - "version": "0.7.1", - "bundled": true, - "dev": true - } - } + "optional": true }, - "source-map": { - "version": "0.5.6", + "isarray": { + "version": "1.0.0", "bundled": true, "dev": true }, - "source-map-support": { - "version": "0.4.15", + "isstream": { + "version": "0.1.2", "bundled": true, "dev": true, - "requires": { - "source-map": "0.5.6" - } + "optional": true }, - "soyparser": { - "version": "0.2.5", + "jodid25519": { + "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { - "merge": "1.2.0", - "tunic": "1.0.0" + "jsbn": "0.1.1" } }, - "sparkles": { - "version": "1.0.0", + "jsbn": { + "version": "0.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, - "spawn-sync": { - "version": "1.0.15", + "json-schema": { + "version": "0.2.3", "bundled": true, "dev": true, - "requires": { - "concat-stream": "1.6.0", - "os-shim": "0.1.3" - } + "optional": true }, - "spdx-correct": { - "version": "1.0.2", + "json-stable-stringify": { + "version": "1.0.1", "bundled": true, "dev": true, + "optional": true, "requires": { - "spdx-license-ids": "1.2.2" + "jsonify": "0.0.0" } }, - "spdx-expression-parse": { - "version": "1.0.4", - "bundled": true, - "dev": true - }, - "spdx-license-ids": { - "version": "1.2.2", + "json-stringify-safe": { + "version": "5.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, - "sprintf-js": { - "version": "1.0.3", + "jsonify": { + "version": "0.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, - "sshpk": { - "version": "1.13.1", + "jsprim": { + "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { - "asn1": "0.2.3", "assert-plus": "1.0.0", - "dashdash": "1.14.1", - "getpass": "0.1.7" + "extsprintf": "1.0.2", + "json-schema": "0.2.3", + "verror": "1.3.6" }, "dependencies": { "assert-plus": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true } } }, - "statuses": { - "version": "1.3.1", + "mime-db": { + "version": "1.27.0", "bundled": true, "dev": true }, - "stdin": { - "version": "0.0.1", + "mime-types": { + "version": "2.1.15", "bundled": true, - "dev": true + "dev": true, + "requires": { + "mime-db": "1.27.0" + } }, - "stream-combiner": { - "version": "0.2.2", + "minimatch": { + "version": "3.0.4", "bundled": true, "dev": true, "requires": { - "duplexer": "0.1.1", - "through": "2.3.8" + "brace-expansion": "1.1.7" } }, - "stream-consume": { - "version": "0.1.0", + "minimist": { + "version": "0.0.8", "bundled": true, "dev": true }, - "stream-shift": { - "version": "1.0.0", + "mkdirp": { + "version": "0.5.1", "bundled": true, - "dev": true + "dev": true, + "requires": { + "minimist": "0.0.8" + } }, - "string_decoder": { - "version": "1.0.2", + "ms": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "node-pre-gyp": { + "version": "0.6.39", "bundled": true, "dev": true, + "optional": true, "requires": { - "safe-buffer": "5.0.1" + "detect-libc": "1.0.2", + "hawk": "3.1.3", + "mkdirp": "0.5.1", + "nopt": "4.0.1", + "npmlog": "4.1.0", + "rc": "1.2.1", + "request": "2.81.0", + "rimraf": "2.6.1", + "semver": "5.3.0", + "tar": "2.2.1", + "tar-pack": "3.4.0" } }, - "string-length": { - "version": "1.0.1", + "nopt": { + "version": "4.0.1", "bundled": true, "dev": true, + "optional": true, "requires": { - "strip-ansi": "3.0.1" + "abbrev": "1.1.0", + "osenv": "0.1.4" } }, - "string-width": { - "version": "1.0.2", + "npmlog": { + "version": "4.1.0", "bundled": true, "dev": true, + "optional": true, "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" + "are-we-there-yet": "1.1.4", + "console-control-strings": "1.1.0", + "gauge": "2.7.4", + "set-blocking": "2.0.0" } }, - "stringstream": { - "version": "0.0.5", + "number-is-nan": { + "version": "1.0.1", "bundled": true, "dev": true }, - "strip-ansi": { - "version": "3.0.1", + "oauth-sign": { + "version": "0.8.2", + "bundled": true, + "dev": true, + "optional": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "once": { + "version": "1.4.0", "bundled": true, "dev": true, "requires": { - "ansi-regex": "2.1.1" + "wrappy": "1.0.2" } }, - "strip-bom": { - "version": "3.0.0", + "os-homedir": { + "version": "1.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, - "strip-bom-stream": { - "version": "1.0.0", + "os-tmpdir": { + "version": "1.0.2", "bundled": true, "dev": true, - "requires": { - "first-chunk-stream": "1.0.0", - "strip-bom": "2.0.0" - }, - "dependencies": { - "strip-bom": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "is-utf8": "0.2.1" - } - } - } + "optional": true }, - "strip-indent": { - "version": "1.0.1", + "osenv": { + "version": "0.1.4", "bundled": true, "dev": true, + "optional": true, "requires": { - "get-stdin": "4.0.1" + "os-homedir": "1.0.2", + "os-tmpdir": "1.0.2" } }, - "strip-json-comments": { - "version": "2.0.1", + "path-is-absolute": { + "version": "1.0.1", "bundled": true, "dev": true }, - "supports-color": { - "version": "2.0.0", + "performance-now": { + "version": "0.2.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, - "sync-exec": { - "version": "0.5.0", + "process-nextick-args": { + "version": "1.0.7", "bundled": true, "dev": true }, - "table": { - "version": "3.8.3", + "punycode": { + "version": "1.4.1", "bundled": true, "dev": true, - "requires": { - "ajv": "4.11.8", - "ajv-keywords": "1.5.1", - "chalk": "1.1.3", - "lodash": "4.17.4", - "slice-ansi": "0.0.4", - "string-width": "2.0.0" - }, - "dependencies": { - "is-fullwidth-code-point": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "string-width": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "is-fullwidth-code-point": "2.0.0", - "strip-ansi": "3.0.1" - } - } - } + "optional": true }, - "taffydb": { - "version": "2.6.2", - "bundled": true, - "dev": true - }, - "tar": { - "version": "2.2.1", + "qs": { + "version": "6.4.0", "bundled": true, "dev": true, - "requires": { - "block-stream": "0.0.9", - "fstream": "1.0.11", - "inherits": "2.0.3" - } + "optional": true }, - "tar-stream": { - "version": "1.1.5", + "rc": { + "version": "1.2.1", "bundled": true, "dev": true, + "optional": true, "requires": { - "bl": "0.9.5", - "end-of-stream": "1.4.0", - "readable-stream": "1.0.34", - "xtend": "4.0.1" + "deep-extend": "0.4.2", + "ini": "1.3.4", + "minimist": "1.2.0", + "strip-json-comments": "2.0.1" }, "dependencies": { - "end-of-stream": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "requires": { - "once": "1.4.0" - } - }, - "isarray": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "readable-stream": { - "version": "1.0.34", + "minimist": { + "version": "1.2.0", "bundled": true, "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" - } - }, - "string_decoder": { - "version": "0.10.31", - "bundled": true, - "dev": true + "optional": true } } }, - "temp": { - "version": "0.8.3", + "readable-stream": { + "version": "2.2.9", "bundled": true, "dev": true, "requires": { - "os-tmpdir": "1.0.2", - "rimraf": "2.2.8" - }, - "dependencies": { - "rimraf": { - "version": "2.2.8", - "bundled": true, - "dev": true - } + "buffer-shims": "1.0.0", + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "string_decoder": "1.0.1", + "util-deprecate": "1.0.2" } }, - "ternary-stream": { - "version": "2.0.1", + "request": { + "version": "2.81.0", "bundled": true, "dev": true, + "optional": true, "requires": { - "duplexify": "3.5.0", - "fork-stream": "0.0.4", - "merge-stream": "1.0.1", - "through2": "2.0.3" + "aws-sign2": "0.6.0", + "aws4": "1.6.0", + "caseless": "0.12.0", + "combined-stream": "1.0.5", + "extend": "3.0.1", + "forever-agent": "0.6.1", + "form-data": "2.1.4", + "har-validator": "4.2.1", + "hawk": "3.1.3", + "http-signature": "1.1.1", + "is-typedarray": "1.0.0", + "isstream": "0.1.2", + "json-stringify-safe": "5.0.1", + "mime-types": "2.1.15", + "oauth-sign": "0.8.2", + "performance-now": "0.2.0", + "qs": "6.4.0", + "safe-buffer": "5.0.1", + "stringstream": "0.0.5", + "tough-cookie": "2.3.2", + "tunnel-agent": "0.6.0", + "uuid": "3.0.1" } }, - "text-table": { - "version": "0.2.0", - "bundled": true, - "dev": true - }, - "textextensions": { - "version": "1.0.2", + "rimraf": { + "version": "2.6.1", "bundled": true, - "dev": true + "dev": true, + "requires": { + "glob": "7.1.2" + } }, - "through": { - "version": "2.3.8", + "safe-buffer": { + "version": "5.0.1", "bundled": true, "dev": true }, - "through2": { - "version": "2.0.3", + "semver": { + "version": "5.3.0", "bundled": true, "dev": true, - "requires": { - "readable-stream": "2.2.11", - "xtend": "4.0.1" - } + "optional": true }, - "through2-filter": { + "set-blocking": { "version": "2.0.0", "bundled": true, "dev": true, - "requires": { - "through2": "2.0.3", - "xtend": "4.0.1" - } + "optional": true }, - "time-stamp": { - "version": "1.1.0", + "signal-exit": { + "version": "3.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, - "tmp": { - "version": "0.0.31", + "sntp": { + "version": "1.0.9", "bundled": true, "dev": true, "requires": { - "os-tmpdir": "1.0.2" + "hoek": "2.16.3" } }, - "to-absolute-glob": { - "version": "0.1.1", + "sshpk": { + "version": "1.13.0", "bundled": true, "dev": true, + "optional": true, "requires": { - "extend-shallow": "2.0.1" + "asn1": "0.2.3", + "assert-plus": "1.0.0", + "bcrypt-pbkdf": "1.0.1", + "dashdash": "1.14.1", + "ecc-jsbn": "0.1.1", + "getpass": "0.1.7", + "jodid25519": "1.0.2", + "jsbn": "0.1.1", + "tweetnacl": "0.14.5" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + } } }, - "to-array": { - "version": "0.1.4", - "bundled": true, - "dev": true - }, - "to-fast-properties": { - "version": "1.0.3", - "bundled": true, - "dev": true - }, - "to-iso-string": { - "version": "0.0.2", - "bundled": true, - "dev": true - }, - "tough-cookie": { - "version": "2.3.2", + "string_decoder": { + "version": "1.0.1", "bundled": true, "dev": true, "requires": { - "punycode": "1.4.1" + "safe-buffer": "5.0.1" } }, - "trim-newlines": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "trim-right": { - "version": "1.0.1", + "string-width": { + "version": "1.0.2", "bundled": true, - "dev": true + "dev": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } }, - "tryit": { - "version": "1.0.3", + "stringstream": { + "version": "0.0.5", "bundled": true, - "dev": true + "dev": true, + "optional": true }, - "tunic": { - "version": "1.0.0", + "strip-ansi": { + "version": "3.0.1", "bundled": true, "dev": true, "requires": { - "mout": "0.11.1", - "mtil": "0.1.3" - }, - "dependencies": { - "mout": { - "version": "0.11.1", - "bundled": true, - "dev": true - } + "ansi-regex": "2.1.1" } }, - "tunnel-agent": { - "version": "0.6.0", + "strip-json-comments": { + "version": "2.0.1", "bundled": true, "dev": true, - "requires": { - "safe-buffer": "5.0.1" - } + "optional": true }, - "type-check": { - "version": "0.3.2", + "tar": { + "version": "2.2.1", "bundled": true, "dev": true, "requires": { - "prelude-ls": "1.1.2" + "block-stream": "0.0.9", + "fstream": "1.0.11", + "inherits": "2.0.3" } }, - "type-detect": { - "version": "0.1.1", - "bundled": true, - "dev": true - }, - "type-is": { - "version": "1.6.15", + "tar-pack": { + "version": "3.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { - "media-typer": "0.3.0", - "mime-types": "2.1.15" + "debug": "2.6.8", + "fstream": "1.0.11", + "fstream-ignore": "1.0.5", + "once": "1.4.0", + "readable-stream": "2.2.9", + "rimraf": "2.6.1", + "tar": "2.2.1", + "uid-number": "0.0.6" } }, - "typedarray": { - "version": "0.0.6", + "tough-cookie": { + "version": "2.3.2", "bundled": true, - "dev": true + "dev": true, + "optional": true, + "requires": { + "punycode": "1.4.1" + } }, - "uglify-js": { - "version": "2.6.4", + "tunnel-agent": { + "version": "0.6.0", "bundled": true, "dev": true, + "optional": true, "requires": { - "async": "0.2.10", - "source-map": "0.5.6", - "uglify-to-browserify": "1.0.2", - "yargs": "3.10.0" - }, - "dependencies": { - "camelcase": { - "version": "1.2.1", - "bundled": true, - "dev": true - }, - "cliui": { - "version": "2.1.0", - "bundled": true, - "dev": true, - "requires": { - "center-align": "0.1.3", - "right-align": "0.1.3", - "wordwrap": "0.0.2" - } - }, - "wordwrap": { - "version": "0.0.2", - "bundled": true, - "dev": true - }, - "yargs": { - "version": "3.10.0", - "bundled": true, - "dev": true, - "requires": { - "camelcase": "1.2.1", - "cliui": "2.1.0", - "decamelize": "1.2.0", - "window-size": "0.1.0" - } - } + "safe-buffer": "5.0.1" } }, - "uglify-save-license": { - "version": "0.4.1", + "tweetnacl": { + "version": "0.14.5", "bundled": true, - "dev": true + "dev": true, + "optional": true }, - "uglify-to-browserify": { - "version": "1.0.2", + "uid-number": { + "version": "0.0.6", "bundled": true, - "dev": true + "dev": true, + "optional": true }, - "ultron": { + "util-deprecate": { "version": "1.0.2", "bundled": true, "dev": true }, - "underscore": { - "version": "1.8.3", + "uuid": { + "version": "3.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, - "underscore-contrib": { - "version": "0.3.0", + "verror": { + "version": "1.3.6", "bundled": true, "dev": true, + "optional": true, "requires": { - "underscore": "1.6.0" - }, - "dependencies": { - "underscore": { - "version": "1.6.0", - "bundled": true, - "dev": true - } + "extsprintf": "1.0.2" } }, - "underscore.string": { - "version": "3.0.3", + "wide-align": { + "version": "1.1.2", "bundled": true, - "dev": true + "dev": true, + "optional": true, + "requires": { + "string-width": "1.0.2" + } }, - "unpipe": { - "version": "1.0.0", + "wrappy": { + "version": "1.0.2", "bundled": true, "dev": true - }, - "user-home": { - "version": "2.0.0", - "bundled": true, + } + } + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "gauge": { + "version": "2.7.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", + "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", + "dev": true, + "requires": { + "aproba": "1.2.0", + "console-control-strings": "1.1.0", + "has-unicode": "2.0.1", + "object-assign": "4.1.1", + "signal-exit": "3.0.2", + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wide-align": "1.1.2" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "dev": true, "requires": { - "os-homedir": "1.0.2" + "number-is-nan": "1.0.1" } }, - "useragent": { - "version": "2.1.13", - "bundled": true, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, "requires": { - "lru-cache": "2.2.4", - "tmp": "0.0.31" - }, - "dependencies": { - "lru-cache": { - "version": "2.2.4", - "bundled": true, - "dev": true - } + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + } + } + }, + "gaze": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/gaze/-/gaze-0.5.2.tgz", + "integrity": "sha1-QLcJU30k0dRXZ9takIaJ3+aaxE8=", + "dev": true, + "requires": { + "globule": "0.1.0" + } + }, + "generate-function": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz", + "integrity": "sha1-aFj+fAlpt9TpCTM3ZHrHn2DfvnQ=", + "dev": true + }, + "generate-object-property": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", + "integrity": "sha1-nA4cQDCM6AT0eDYYuTf6iPmdUNA=", + "dev": true, + "requires": { + "is-property": "1.0.2" + } + }, + "get-caller-file": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.2.tgz", + "integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=", + "dev": true + }, + "get-own-enumerable-property-symbols": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-2.0.1.tgz", + "integrity": "sha512-TtY/sbOemiMKPRUDDanGCSgBYe7Mf0vbRsWnBZ+9yghpZ1MvcpSpuZFjHdEeY/LZjZy0vdLjS77L6HosisFiug==", + "dev": true + }, + "get-pkg-repo": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/get-pkg-repo/-/get-pkg-repo-1.4.0.tgz", + "integrity": "sha1-xztInAbYDMVTbCyFP54FIyBWly0=", + "dev": true, + "requires": { + "hosted-git-info": "2.5.0", + "meow": "3.7.0", + "normalize-package-data": "2.4.0", + "parse-github-repo-url": "1.4.1", + "through2": "2.0.3" + } + }, + "get-port": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/get-port/-/get-port-3.2.0.tgz", + "integrity": "sha1-3Xzn3hh8Bsi/NTeWrHHgmfCYDrw=", + "dev": true + }, + "get-stdin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", + "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", + "dev": true + }, + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", + "dev": true + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, + "requires": { + "assert-plus": "1.0.0" + } + }, + "git-raw-commits": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-1.3.0.tgz", + "integrity": "sha1-C8hZbpDV/+c29/VUa9LRL3OrqsY=", + "dev": true, + "requires": { + "dargs": "4.1.0", + "lodash.template": "4.4.0", + "meow": "3.7.0", + "split2": "2.2.0", + "through2": "2.0.3" + }, + "dependencies": { + "lodash.template": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.4.0.tgz", + "integrity": "sha1-5zoDhcg1VZF0bgILmWecaQ5o+6A=", + "dev": true, + "requires": { + "lodash._reinterpolate": "3.0.0", + "lodash.templatesettings": "4.1.0" } }, - "util": { - "version": "0.10.3", - "bundled": true, + "lodash.templatesettings": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-4.1.0.tgz", + "integrity": "sha1-K01OlbpEDZFf8IvImeRVNmZxMxY=", + "dev": true, + "requires": { + "lodash._reinterpolate": "3.0.0" + } + } + } + }, + "git-remote-origin-url": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/git-remote-origin-url/-/git-remote-origin-url-2.0.0.tgz", + "integrity": "sha1-UoJlna4hBxRaERJhEq0yFuxfpl8=", + "dev": true, + "requires": { + "gitconfiglocal": "1.0.0", + "pify": "2.3.0" + } + }, + "git-semver-tags": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/git-semver-tags/-/git-semver-tags-1.2.3.tgz", + "integrity": "sha1-GItFOIK/nXojr9Mbq6U32rc4jV0=", + "dev": true, + "requires": { + "meow": "3.7.0", + "semver": "5.4.1" + } + }, + "gitconfiglocal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/gitconfiglocal/-/gitconfiglocal-1.0.0.tgz", + "integrity": "sha1-QdBF84UaXqiPA/JMocYXgRRGS5s=", + "dev": true, + "requires": { + "ini": "1.3.4" + } + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "glob-base": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", + "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", + "dev": true, + "requires": { + "glob-parent": "2.0.0", + "is-glob": "2.0.1" + } + }, + "glob-expand": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/glob-expand/-/glob-expand-0.1.0.tgz", + "integrity": "sha1-+rNWBjkewYFwPB8KonqHzQW/mjA=", + "dev": true, + "requires": { + "glob": "4.4.2", + "lodash": "1.2.1" + }, + "dependencies": { + "glob": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-4.4.2.tgz", + "integrity": "sha1-Pvk+KX7glsG5s/+x0hAlx4q2BUg=", "dev": true, "requires": { - "inherits": "2.0.1" - }, - "dependencies": { - "inherits": { - "version": "2.0.1", - "bundled": true, - "dev": true - } + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "2.0.10", + "once": "1.4.0" } }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "utils-merge": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "uuid": { - "version": "3.0.1", - "bundled": true, - "dev": true - }, - "vali-date": { - "version": "1.0.0", - "bundled": true, + "lodash": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-1.2.1.tgz", + "integrity": "sha1-7UexbkbwaytAMJto6RY8F+k+owQ=", "dev": true }, - "validate-npm-package-license": { - "version": "3.0.1", - "bundled": true, + "minimatch": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz", + "integrity": "sha1-jQh8OcazjAAbl/ynzm0OHoCvusc=", "dev": true, "requires": { - "spdx-correct": "1.0.2", - "spdx-expression-parse": "1.0.4" + "brace-expansion": "1.1.8" } - }, - "vargs": { - "version": "0.1.0", - "bundled": true, - "dev": true - }, - "verror": { - "version": "1.3.6", - "bundled": true, + } + } + }, + "glob-parent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "dev": true, + "requires": { + "is-glob": "2.0.1" + } + }, + "glob-stream": { + "version": "3.1.18", + "resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-3.1.18.tgz", + "integrity": "sha1-kXCl8St5Awb9/lmPMT+PeVT9FDs=", + "dev": true, + "requires": { + "glob": "4.5.3", + "glob2base": "0.0.12", + "minimatch": "2.0.10", + "ordered-read-streams": "0.1.0", + "through2": "0.6.5", + "unique-stream": "1.0.0" + }, + "dependencies": { + "glob": { + "version": "4.5.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-4.5.3.tgz", + "integrity": "sha1-xstz0yJsHv7wTePFbQEvAzd+4V8=", "dev": true, "requires": { - "extsprintf": "1.0.2" + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "2.0.10", + "once": "1.4.0" } }, - "vinyl": { - "version": "0.5.3", - "bundled": true, - "dev": true, - "requires": { - "clone": "1.0.2", - "clone-stats": "0.0.1", - "replace-ext": "0.0.1" - } + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true }, - "vinyl-sourcemaps-apply": { - "version": "0.2.1", - "bundled": true, + "minimatch": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz", + "integrity": "sha1-jQh8OcazjAAbl/ynzm0OHoCvusc=", "dev": true, "requires": { - "source-map": "0.5.6" + "brace-expansion": "1.1.8" } }, - "void-elements": { - "version": "2.0.1", - "bundled": true, - "dev": true - }, - "wd": { - "version": "0.3.12", - "bundled": true, + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", "dev": true, "requires": { - "archiver": "0.14.4", - "async": "1.0.0", - "lodash": "3.9.3", - "q": "1.4.1", - "request": "2.55.0", - "underscore.string": "3.0.3", - "vargs": "0.1.0" - }, - "dependencies": { - "asn1": { - "version": "0.1.11", - "bundled": true, - "dev": true - }, - "assert-plus": { - "version": "0.1.5", - "bundled": true, - "dev": true - }, - "async": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "aws-sign2": { - "version": "0.5.0", - "bundled": true, - "dev": true - }, - "bluebird": { - "version": "2.11.0", - "bundled": true, - "dev": true - }, - "caseless": { - "version": "0.9.0", - "bundled": true, - "dev": true - }, - "combined-stream": { - "version": "0.0.7", - "bundled": true, - "dev": true, - "requires": { - "delayed-stream": "0.0.5" - } - }, - "delayed-stream": { - "version": "0.0.5", - "bundled": true, - "dev": true - }, - "form-data": { - "version": "0.2.0", - "bundled": true, - "dev": true, - "requires": { - "async": "0.9.2", - "combined-stream": "0.0.7", - "mime-types": "2.0.14" - }, - "dependencies": { - "async": { - "version": "0.9.2", - "bundled": true, - "dev": true - } - } - }, - "har-validator": { - "version": "1.8.0", - "bundled": true, - "dev": true, - "requires": { - "bluebird": "2.11.0", - "chalk": "1.1.3", - "commander": "2.9.0", - "is-my-json-valid": "2.16.0" - } - }, - "hawk": { - "version": "2.3.1", - "bundled": true, - "dev": true, - "requires": { - "boom": "2.10.1", - "cryptiles": "2.0.5", - "hoek": "2.16.3", - "sntp": "1.0.9" - } - }, - "http-signature": { - "version": "0.10.1", - "bundled": true, - "dev": true, - "requires": { - "asn1": "0.1.11", - "assert-plus": "0.1.5", - "ctype": "0.5.3" - } - }, - "lodash": { - "version": "3.9.3", - "bundled": true, - "dev": true - }, - "mime-db": { - "version": "1.12.0", - "bundled": true, - "dev": true - }, - "mime-types": { - "version": "2.0.14", - "bundled": true, - "dev": true, - "requires": { - "mime-db": "1.12.0" - } - }, - "node-uuid": { - "version": "1.4.8", - "bundled": true, - "dev": true - }, - "oauth-sign": { - "version": "0.6.0", - "bundled": true, - "dev": true - }, - "q": { - "version": "1.4.1", - "bundled": true, - "dev": true - }, - "qs": { - "version": "2.4.2", - "bundled": true, - "dev": true - }, - "request": { - "version": "2.55.0", - "bundled": true, - "dev": true, - "requires": { - "aws-sign2": "0.5.0", - "bl": "0.9.5", - "caseless": "0.9.0", - "combined-stream": "0.0.7", - "forever-agent": "0.6.1", - "form-data": "0.2.0", - "har-validator": "1.8.0", - "hawk": "2.3.1", - "http-signature": "0.10.1", - "isstream": "0.1.2", - "json-stringify-safe": "5.0.1", - "mime-types": "2.0.14", - "node-uuid": "1.4.8", - "oauth-sign": "0.6.0", - "qs": "2.4.2", - "stringstream": "0.0.5", - "tough-cookie": "2.3.2", - "tunnel-agent": "0.4.3" - } - }, - "tunnel-agent": { - "version": "0.4.3", - "bundled": true, - "dev": true - } + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" } }, - "which": { - "version": "1.2.14", - "bundled": true, + "through2": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", + "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", "dev": true, "requires": { - "isexe": "2.0.0" + "readable-stream": "1.0.34", + "xtend": "4.0.1" } - }, - "which-module": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "wide-align": { - "version": "1.1.2", - "bundled": true, + } + } + }, + "glob-watcher": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/glob-watcher/-/glob-watcher-0.0.6.tgz", + "integrity": "sha1-uVtKjfdLOcgymLDAXJeLTZo7cQs=", + "dev": true, + "requires": { + "gaze": "0.5.2" + } + }, + "glob2base": { + "version": "0.0.12", + "resolved": "https://registry.npmjs.org/glob2base/-/glob2base-0.0.12.tgz", + "integrity": "sha1-nUGbPijxLoOjYhZKJ3BVkiycDVY=", + "dev": true, + "requires": { + "find-index": "0.1.1" + } + }, + "global-modules": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-0.2.3.tgz", + "integrity": "sha1-6lo77ULG1s6ZWk+KEmm12uIjgo0=", + "dev": true, + "requires": { + "global-prefix": "0.1.5", + "is-windows": "0.2.0" + } + }, + "global-prefix": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-0.1.5.tgz", + "integrity": "sha1-jTvGuNo8qBEqFg2NSW/wRiv+948=", + "dev": true, + "requires": { + "homedir-polyfill": "1.0.1", + "ini": "1.3.4", + "is-windows": "0.2.0", + "which": "1.3.0" + } + }, + "globals": { + "version": "9.18.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", + "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", + "dev": true + }, + "globby": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", + "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", + "dev": true, + "requires": { + "array-union": "1.0.2", + "arrify": "1.0.1", + "glob": "7.1.2", + "object-assign": "4.1.1", + "pify": "2.3.0", + "pinkie-promise": "2.0.1" + } + }, + "globule": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/globule/-/globule-0.1.0.tgz", + "integrity": "sha1-2cjt3h2nnRJaFRt5UzuXhnY0auU=", + "dev": true, + "requires": { + "glob": "3.1.21", + "lodash": "1.0.2", + "minimatch": "0.2.14" + }, + "dependencies": { + "glob": { + "version": "3.1.21", + "resolved": "https://registry.npmjs.org/glob/-/glob-3.1.21.tgz", + "integrity": "sha1-0p4KBV3qUTj00H7UDomC6DwgZs0=", "dev": true, "requires": { - "string-width": "1.0.2" + "graceful-fs": "1.2.3", + "inherits": "1.0.2", + "minimatch": "0.2.14" } }, - "window-size": { - "version": "0.1.0", - "bundled": true, - "dev": true - }, - "wordwrap": { - "version": "1.0.0", - "bundled": true, + "graceful-fs": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.3.tgz", + "integrity": "sha1-FaSAaldUfLLS2/J/QuiajDRRs2Q=", "dev": true }, - "wrap-ansi": { - "version": "2.1.0", - "bundled": true, - "dev": true, - "requires": { - "string-width": "1.0.2", - "strip-ansi": "3.0.1" - } - }, - "wrappy": { + "inherits": { "version": "1.0.2", - "bundled": true, - "dev": true - }, - "write": { - "version": "0.2.1", - "bundled": true, - "dev": true, - "requires": { - "mkdirp": "0.5.1" - } - }, - "ws": { - "version": "1.1.2", - "bundled": true, - "dev": true, - "requires": { - "options": "0.0.6", - "ultron": "1.0.2" - } - }, - "wtf-8": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "xmlhttprequest-ssl": { - "version": "1.5.3", - "bundled": true, - "dev": true - }, - "xtend": { - "version": "4.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/inherits/-/inherits-1.0.2.tgz", + "integrity": "sha1-ykMJ2t7mtUzAuNJH6NfHoJdb3Js=", "dev": true }, - "y18n": { - "version": "3.2.1", - "bundled": true, + "lodash": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-1.0.2.tgz", + "integrity": "sha1-j1dWDIO1n8JwvT1WG2kAQ0MOJVE=", "dev": true }, - "yallist": { - "version": "2.1.2", - "bundled": true, + "lru-cache": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", + "integrity": "sha1-bUUk6LlV+V1PW1iFHOId1y+06VI=", "dev": true }, - "yargs": { - "version": "7.1.0", - "bundled": true, - "dev": true, - "requires": { - "camelcase": "3.0.0", - "cliui": "3.2.0", - "decamelize": "1.2.0", - "get-caller-file": "1.0.2", - "os-locale": "1.4.0", - "read-pkg-up": "1.0.1", - "require-directory": "2.1.1", - "require-main-filename": "1.0.1", - "set-blocking": "2.0.0", - "string-width": "1.0.2", - "which-module": "1.0.0", - "y18n": "3.2.1", - "yargs-parser": "5.0.0" - }, - "dependencies": { - "camelcase": { - "version": "3.0.0", - "bundled": true, - "dev": true - } - } - }, - "yargs-parser": { - "version": "5.0.0", - "bundled": true, + "minimatch": { + "version": "0.2.14", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", + "integrity": "sha1-x054BXT2PG+aCQ6Q775u9TpqdWo=", "dev": true, "requires": { - "camelcase": "3.0.0" - }, - "dependencies": { - "camelcase": { - "version": "3.0.0", - "bundled": true, - "dev": true - } + "lru-cache": "2.7.3", + "sigmund": "1.0.1" } - }, - "yeast": { - "version": "0.1.2", - "bundled": true, + } + } + }, + "glogg": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/glogg/-/glogg-1.0.0.tgz", + "integrity": "sha1-f+DxmfV6yQbPUS/urY+Q7kooT8U=", + "dev": true, + "requires": { + "sparkles": "1.0.0" + } + }, + "got": { + "version": "6.7.1", + "resolved": "https://registry.npmjs.org/got/-/got-6.7.1.tgz", + "integrity": "sha1-JAzQV4WpoY5WHcG0S0HHY+8ejbA=", + "dev": true, + "requires": { + "create-error-class": "3.0.2", + "duplexer3": "0.1.4", + "get-stream": "3.0.0", + "is-redirect": "1.0.0", + "is-retry-allowed": "1.1.0", + "is-stream": "1.1.0", + "lowercase-keys": "1.0.0", + "safe-buffer": "5.1.1", + "timed-out": "4.0.1", + "unzip-response": "2.0.1", + "url-parse-lax": "1.0.0" + } + }, + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "dev": true + }, + "growl": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.9.2.tgz", + "integrity": "sha1-Dqd0NxXbjY3ixe3hd14bRayFwC8=", + "dev": true + }, + "gulp": { + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/gulp/-/gulp-3.9.1.tgz", + "integrity": "sha1-VxzkWSjdQK9lFPxAEYZgFsE4RbQ=", + "dev": true, + "requires": { + "archy": "1.0.0", + "chalk": "1.1.3", + "deprecated": "0.0.1", + "gulp-util": "3.0.8", + "interpret": "1.0.4", + "liftoff": "2.3.0", + "minimist": "1.2.0", + "orchestrator": "0.3.8", + "pretty-hrtime": "1.0.3", + "semver": "4.3.6", + "tildify": "1.2.0", + "v8flags": "2.1.1", + "vinyl-fs": "0.3.14" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true }, - "zip-stream": { - "version": "0.5.2", - "bundled": true, - "dev": true, - "requires": { - "compress-commons": "0.2.9", - "lodash": "3.2.0", - "readable-stream": "1.0.34" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "lodash": { - "version": "3.2.0", - "bundled": true, - "dev": true - }, - "readable-stream": { - "version": "1.0.34", - "bundled": true, - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" - } - }, - "string_decoder": { - "version": "0.10.31", - "bundled": true, - "dev": true - } - } + "semver": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-4.3.6.tgz", + "integrity": "sha1-MAvG4OhjdPe6YQaLWx7NV/xlMto=", + "dev": true } } }, + "gulp-if": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/gulp-if/-/gulp-if-2.0.2.tgz", + "integrity": "sha1-pJe351cwBQQcqivIt92jyARE1ik=", + "dev": true, + "requires": { + "gulp-match": "1.0.3", + "ternary-stream": "2.0.1", + "through2": "2.0.3" + } + }, + "gulp-ignore": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/gulp-ignore/-/gulp-ignore-2.0.2.tgz", + "integrity": "sha1-XC6ioKRALgq0orzRLv2SlTRNePI=", + "dev": true, + "requires": { + "gulp-match": "1.0.3", + "through2": "2.0.3" + } + }, + "gulp-match": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/gulp-match/-/gulp-match-1.0.3.tgz", + "integrity": "sha1-kcfA1/Kb7NZgbVfYCn+Hdqh6uo4=", + "dev": true, + "requires": { + "minimatch": "3.0.4" + } + }, "gulp-replace": { "version": "0.5.4", "resolved": "https://registry.npmjs.org/gulp-replace/-/gulp-replace-0.5.4.tgz", @@ -11052,7 +5019,7 @@ "integrity": "sha1-XIgDbPVl5d8FVYv8kR+GVt8hiIQ=", "dev": true, "requires": { - "clone": "1.0.2", + "clone": "1.0.3", "clone-stats": "0.0.1", "replace-ext": "0.0.1" } @@ -11149,14 +5116,15 @@ } }, "handlebars": { - "version": "4.0.10", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.10.tgz", - "integrity": "sha1-PTDHGLCaPZbyPqTMH0A8TTup/08=", + "version": "4.0.11", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.11.tgz", + "integrity": "sha1-Ywo13+ApS8KB7a5v/F0yn8eYLcw=", "dev": true, "requires": { "async": "1.5.2", "optimist": "0.6.1", - "source-map": "0.4.4" + "source-map": "0.4.4", + "uglify-js": "2.8.29" }, "dependencies": { "source-map": { @@ -11182,31 +5150,8 @@ "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=", "dev": true, "requires": { - "ajv": "5.2.3", + "ajv": "5.4.0", "har-schema": "2.0.0" - }, - "dependencies": { - "ajv": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.2.3.tgz", - "integrity": "sha1-wG9Zh3jETGsWGrr+NGa4GtGBTtI=", - "dev": true, - "requires": { - "co": "4.6.0", - "fast-deep-equal": "1.0.0", - "json-schema-traverse": "0.3.1", - "json-stable-stringify": "1.0.1" - } - }, - "json-stable-stringify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", - "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", - "dev": true, - "requires": { - "jsonify": "0.0.0" - } - } } }, "has": { @@ -11251,9 +5196,9 @@ "dev": true }, "has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", + "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", "dev": true }, "has-gulplog": { @@ -11305,7 +5250,7 @@ "boom": "4.3.1", "cryptiles": "3.1.2", "hoek": "4.2.0", - "sntp": "2.0.2" + "sntp": "2.1.0" } }, "hmac-drbg": { @@ -11351,12 +5296,12 @@ "dev": true }, "html-encoding-sniffer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.1.tgz", - "integrity": "sha1-eb96eF6klf5mFl5zQVPzY/9UN9o=", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz", + "integrity": "sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw==", "dev": true, "requires": { - "whatwg-encoding": "1.0.1" + "whatwg-encoding": "1.0.3" } }, "htmlescape": { @@ -11374,7 +5319,7 @@ "depd": "1.1.1", "inherits": "2.0.3", "setprototypeof": "1.0.3", - "statuses": "1.3.1" + "statuses": "1.4.0" } }, "http-proxy": { @@ -11398,16 +5343,46 @@ "sshpk": "1.13.1" } }, - "https-browserify": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-0.0.1.tgz", - "integrity": "sha1-P5E2XKvmC3ftDruiS0VOPgnZWoI=", - "dev": true - }, + "https-browserify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-0.0.1.tgz", + "integrity": "sha1-P5E2XKvmC3ftDruiS0VOPgnZWoI=", + "dev": true + }, + "https-proxy-agent": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-1.0.0.tgz", + "integrity": "sha1-NffabEjOTdv6JkiRrFk+5f+GceY=", + "dev": true, + "requires": { + "agent-base": "2.1.1", + "debug": "2.6.9", + "extend": "3.0.1" + } + }, + "husky": { + "version": "0.14.3", + "resolved": "https://registry.npmjs.org/husky/-/husky-0.14.3.tgz", + "integrity": "sha512-e21wivqHpstpoiWA/Yi8eFti8E+sQDSS53cpJsPptPs295QTOQR0ZwnHo2TXy1XOpZFD9rPOd3NpmqTK6uMLJA==", + "dev": true, + "requires": { + "is-ci": "1.0.10", + "normalize-path": "1.0.0", + "strip-indent": "2.0.0" + }, + "dependencies": { + "normalize-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-1.0.0.tgz", + "integrity": "sha1-MtDkcvkf80VwHBWoMRAY07CpA3k=", + "dev": true + } + } + }, "iconv-lite": { - "version": "0.4.13", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.13.tgz", - "integrity": "sha1-H4irpKsLFQjoMSrMOTRfNumS4vI=", + "version": "0.4.19", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", + "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==", "dev": true }, "ieee754": { @@ -11417,9 +5392,9 @@ "dev": true }, "ignore": { - "version": "3.3.5", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.5.tgz", - "integrity": "sha512-JLH93mL8amZQhh/p6mfQgVBH3M6epNq3DfsXsTSuSrInVjwyYlFE1nv2AgfRCC8PoOhM0jwQ5v8s9LgbK7yGDw==", + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.7.tgz", + "integrity": "sha512-YGG3ejvBNHRqu0559EOxxNFihD0AjpvHlC/pdGKd3X3ofe+CoJkYazwNJYTNebqpPKN+VVQbh4ZFn1DivMNuHA==", "dev": true }, "imurmurhash": { @@ -11475,24 +5450,71 @@ } }, "inquirer": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-0.12.0.tgz", - "integrity": "sha1-HvK/1jUE3wvHV4X/+MLEHfEvB34=", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz", + "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==", "dev": true, "requires": { - "ansi-escapes": "1.4.0", - "ansi-regex": "2.1.1", - "chalk": "1.1.3", - "cli-cursor": "1.0.2", + "ansi-escapes": "3.0.0", + "chalk": "2.3.0", + "cli-cursor": "2.1.0", "cli-width": "2.2.0", - "figures": "1.7.0", + "external-editor": "2.1.0", + "figures": "2.0.0", "lodash": "4.17.4", - "readline2": "1.0.1", - "run-async": "0.1.0", - "rx-lite": "3.1.2", - "string-width": "1.0.2", - "strip-ansi": "3.0.1", + "mute-stream": "0.0.7", + "run-async": "2.3.0", + "rx-lite": "4.0.8", + "rx-lite-aggregates": "4.0.8", + "string-width": "2.1.1", + "strip-ansi": "4.0.0", "through": "2.3.8" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", + "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", + "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "dev": true, + "requires": { + "ansi-styles": "3.2.0", + "escape-string-regexp": "1.0.5", + "supports-color": "4.5.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } + }, + "supports-color": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", + "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "dev": true, + "requires": { + "has-flag": "2.0.0" + } + } } }, "insert-module-globals": { @@ -11503,7 +5525,7 @@ "requires": { "combine-source-map": "0.7.2", "concat-stream": "1.5.2", - "is-buffer": "1.1.5", + "is-buffer": "1.1.6", "JSONStream": "1.3.1", "lexical-scope": "1.2.0", "process": "0.11.10", @@ -11554,13 +5576,13 @@ "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", "dev": true, "requires": { - "binary-extensions": "1.10.0" + "binary-extensions": "1.11.0" } }, "is-buffer": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.5.tgz", - "integrity": "sha1-Hzsm72E7IUuIy8ojzGwB2Hlh7sw=", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", "dev": true }, "is-builtin-module": { @@ -11584,7 +5606,7 @@ "integrity": "sha1-9zkzayYyNlBhqdSCcM1WrjNpMY4=", "dev": true, "requires": { - "ci-info": "1.1.1" + "ci-info": "1.1.2" } }, "is-date-object": { @@ -11630,13 +5652,10 @@ } }, "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dev": true, - "requires": { - "number-is-nan": "1.0.1" - } + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true }, "is-glob": { "version": "2.0.1", @@ -11745,6 +5764,12 @@ "integrity": "sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ=", "dev": true }, + "is-redirect": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-redirect/-/is-redirect-1.0.0.tgz", + "integrity": "sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ=", + "dev": true + }, "is-regex": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", @@ -11754,6 +5779,12 @@ "has": "1.0.1" } }, + "is-regexp": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-1.0.0.tgz", + "integrity": "sha1-/S2INUXEa6xaYz57mgnof6LLUGk=", + "dev": true + }, "is-relative": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-0.2.1.tgz", @@ -11772,6 +5803,12 @@ "tryit": "1.0.3" } }, + "is-retry-allowed": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz", + "integrity": "sha1-EaBgVotnM5REAz0BJaYaINVk+zQ=", + "dev": true + }, "is-stream": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", @@ -11859,6 +5896,16 @@ "isarray": "1.0.0" } }, + "isomorphic-fetch": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz", + "integrity": "sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk=", + "dev": true, + "requires": { + "node-fetch": "1.7.3", + "whatwg-fetch": "2.0.3" + } + }, "isstream": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", @@ -11876,7 +5923,7 @@ "escodegen": "1.8.1", "esprima": "2.7.3", "glob": "5.0.15", - "handlebars": "4.0.10", + "handlebars": "4.0.11", "js-yaml": "3.10.0", "mkdirp": "0.5.1", "nopt": "3.0.6", @@ -11896,7 +5943,8 @@ "esprima": "2.7.3", "estraverse": "1.9.3", "esutils": "2.0.2", - "optionator": "0.8.2" + "optionator": "0.8.2", + "source-map": "0.2.0" } }, "esprima": { @@ -11924,12 +5972,28 @@ "path-is-absolute": "1.0.1" } }, + "has-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", + "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", + "dev": true + }, "resolve": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", "dev": true }, + "source-map": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz", + "integrity": "sha1-2rc/vPwrqBm03gO9b26qSBZLP50=", + "dev": true, + "optional": true, + "requires": { + "amdefine": "1.0.1" + } + }, "supports-color": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", @@ -11948,9 +6012,9 @@ "dev": true }, "istanbul-lib-instrument": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-1.8.0.tgz", - "integrity": "sha1-ZvbJQhzJ7EcE928tsIS6kHiitTI=", + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-1.9.1.tgz", + "integrity": "sha512-RQmXeQ7sphar7k7O1wTNzVczF9igKpaeGQAG9qR2L+BS4DCJNTI9nytRmIVYevwO0bbq+2CXvJmYDuz0gMrywA==", "dev": true, "requires": { "babel-generator": "6.26.0", @@ -11996,12 +6060,55 @@ } } }, - "js-base64": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.3.2.tgz", - "integrity": "sha512-Y2/+DnfJJXT1/FCwUebUhLWb3QihxiSC42+ctHLGogmW2jPY6LCapMdFZXRvVP2z6qyKW7s6qncE/9gSqZiArw==", + "jest-get-type": { + "version": "21.2.0", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-21.2.0.tgz", + "integrity": "sha512-y2fFw3C+D0yjNSDp7ab1kcd6NUYfy3waPTlD8yWkAtiocJdBRQqNoRqVfMNxgj+IjT0V5cBIHJO0z9vuSSZ43Q==", "dev": true }, + "jest-validate": { + "version": "21.2.1", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-21.2.1.tgz", + "integrity": "sha512-k4HLI1rZQjlU+EC682RlQ6oZvLrE5SCh3brseQc24vbZTxzT/k/3urar5QMCVgjadmSO7lECeGdc6YxnM3yEGg==", + "dev": true, + "requires": { + "chalk": "2.3.0", + "jest-get-type": "21.2.0", + "leven": "2.1.0", + "pretty-format": "21.2.1" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", + "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", + "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "dev": true, + "requires": { + "ansi-styles": "3.2.0", + "escape-string-regexp": "1.0.5", + "supports-color": "4.5.0" + } + }, + "supports-color": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", + "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "dev": true, + "requires": { + "has-flag": "2.0.0" + } + } + } + }, "js-string-escape": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/js-string-escape/-/js-string-escape-1.0.1.tgz", @@ -12024,11 +6131,12 @@ "esprima": "4.0.0" } }, - "jschardet": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/jschardet/-/jschardet-1.5.1.tgz", - "integrity": "sha512-vE2hT1D0HLZCLLclfBSfkfTTedhVj0fubHpJBHKwwUWX0nSbhPAfk+SG9rTX95BYNmau8rGFfCeaT6T5OW1C2A==", - "dev": true + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true, + "optional": true }, "jsdom": { "version": "9.12.0", @@ -12040,19 +6148,19 @@ "acorn": "4.0.13", "acorn-globals": "3.1.0", "array-equal": "1.0.0", - "content-type-parser": "1.0.1", + "content-type-parser": "1.0.2", "cssom": "0.3.2", "cssstyle": "0.2.37", "escodegen": "1.9.0", - "html-encoding-sniffer": "1.0.1", - "nwmatcher": "1.4.2", + "html-encoding-sniffer": "1.0.2", + "nwmatcher": "1.4.3", "parse5": "1.5.1", "request": "2.83.0", "sax": "1.2.4", "symbol-tree": "3.2.2", "tough-cookie": "2.3.3", "webidl-conversions": "4.0.2", - "whatwg-encoding": "1.0.1", + "whatwg-encoding": "1.0.3", "whatwg-url": "4.8.0", "xml-name-validator": "2.0.1" } @@ -12090,6 +6198,12 @@ "jsonify": "0.0.0" } }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", @@ -12109,9 +6223,9 @@ "dev": true }, "jsonfile": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", - "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", "dev": true, "requires": { "graceful-fs": "4.1.11" @@ -12158,10 +6272,13 @@ } }, "jsx-ast-utils": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-1.4.1.tgz", - "integrity": "sha1-OGchPo3Xm/Ho8jAMDPwe+xgsDfE=", - "dev": true + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-2.0.1.tgz", + "integrity": "sha1-6AGxs5mF4g//yHtA43SAgOLcrH8=", + "dev": true, + "requires": { + "array-includes": "3.0.3" + } }, "karma": { "version": "1.7.1", @@ -12203,13 +6320,28 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz", "integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=", "dev": true + }, + "tmp": { + "version": "0.0.31", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.31.tgz", + "integrity": "sha1-jzirlDjhcxXl29izZX6L+yd65Kc=", + "dev": true, + "requires": { + "os-tmpdir": "1.0.2" + } } } }, + "karma-babel-preprocessor": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/karma-babel-preprocessor/-/karma-babel-preprocessor-7.0.0.tgz", + "integrity": "sha512-k8YUot8ZAAYhAeUxOsOGUEXW7AlB6SkoIVGfavEBCAdGHzWuraOBoR2wCxxdePUCvcItIxSUyQnOj6DuZdEJYA==", + "dev": true + }, "karma-browserify": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/karma-browserify/-/karma-browserify-5.1.1.tgz", - "integrity": "sha1-9kLXDXdtmrO3NSbFcyq8/qJAAxk=", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/karma-browserify/-/karma-browserify-5.1.2.tgz", + "integrity": "sha1-SAFjWdciMSo1MKodu6t2Y+Ai13k=", "dev": true, "requires": { "convert-source-map": "1.5.0", @@ -12292,6 +6424,18 @@ } } }, + "karma-sauce-launcher": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/karma-sauce-launcher/-/karma-sauce-launcher-1.1.0.tgz", + "integrity": "sha1-PQg89WWdZzarl7zuXYrNhq1SIhI=", + "dev": true, + "requires": { + "q": "1.5.1", + "sauce-connect-launcher": "0.17.0", + "saucelabs": "1.4.0", + "wd": "1.4.1" + } + }, "karma-sinon": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/karma-sinon/-/karma-sinon-1.0.5.tgz", @@ -12313,7 +6457,7 @@ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { - "is-buffer": "1.1.5" + "is-buffer": "1.1.6" } }, "labeled-stream-splicer": { @@ -12335,6 +6479,13 @@ } } }, + "lazy-cache": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", + "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", + "dev": true, + "optional": true + }, "lazystream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.0.tgz", @@ -12354,18 +6505,18 @@ } }, "lerna": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/lerna/-/lerna-2.4.0.tgz", - "integrity": "sha512-hpoIS0PuhIUpulMF4sQ/aWLUMoH8x7L5fSKF4cf1oNJhmC5FukTpR5fWe8EzmUszFo6Nj/bdJfN36OYDrEJAOA==", + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/lerna/-/lerna-2.5.1.tgz", + "integrity": "sha512-Qz2fajqCPtZf4SFQQpQ2R/Ml/RvGvTNuIHix/vAMMSAdbtnPe2QTw34vLD24Clfsfy8FEojy+tqsjejWKqkDFw==", "dev": true, "requires": { "async": "1.5.2", - "chalk": "2.1.0", + "chalk": "2.3.0", "cmd-shim": "2.0.2", "columnify": "1.5.4", "command-join": "2.0.0", - "conventional-changelog-cli": "1.3.4", - "conventional-recommended-bump": "1.0.2", + "conventional-changelog-cli": "1.3.5", + "conventional-recommended-bump": "1.0.3", "dedent": "0.7.0", "execa": "0.8.0", "find-up": "2.1.0", @@ -12383,6 +6534,7 @@ "minimatch": "3.0.4", "npmlog": "4.1.2", "p-finally": "1.0.0", + "package-json": "4.0.1", "path-exists": "3.0.0", "read-cmd-shim": "1.0.1", "read-pkg": "2.0.0", @@ -12398,54 +6550,24 @@ "yargs": "8.0.2" }, "dependencies": { - "ansi-escapes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.0.0.tgz", - "integrity": "sha512-O/klc27mWNUigtv0F8NJWbLF00OcegQalkqKURWdosW08YZKi4m6CnSUSvIZG1otNJbTWhN01Hhz389DW7mvDQ==", - "dev": true - }, - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, "ansi-styles": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", "dev": true, "requires": { - "color-convert": "1.9.0" + "color-convert": "1.9.1" } }, "chalk": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz", - "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", + "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", "dev": true, "requires": { "ansi-styles": "3.2.0", "escape-string-regexp": "1.0.5", - "supports-color": "4.4.0" - } - }, - "cli-cursor": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", - "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", - "dev": true, - "requires": { - "restore-cursor": "2.0.0" - } - }, - "figures": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", - "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", - "dev": true, - "requires": { - "escape-string-regexp": "1.0.5" + "supports-color": "4.5.0" } }, "find-up": { @@ -12457,17 +6579,6 @@ "locate-path": "2.0.0" } }, - "fs-extra": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.2.tgz", - "integrity": "sha1-+RcExT0bRh+JNFKwwwfZmXZHq2s=", - "dev": true, - "requires": { - "graceful-fs": "4.1.11", - "jsonfile": "4.0.0", - "universalify": "0.1.1" - } - }, "glob-parent": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", @@ -12491,46 +6602,12 @@ "pinkie-promise": "2.0.1" } }, - "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", - "dev": true - }, - "inquirer": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz", - "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==", - "dev": true, - "requires": { - "ansi-escapes": "3.0.0", - "chalk": "2.1.0", - "cli-cursor": "2.1.0", - "cli-width": "2.2.0", - "external-editor": "2.0.5", - "figures": "2.0.0", - "lodash": "4.17.4", - "mute-stream": "0.0.7", - "run-async": "2.3.0", - "rx-lite": "4.0.8", - "rx-lite-aggregates": "4.0.8", - "string-width": "2.1.1", - "strip-ansi": "4.0.0", - "through": "2.3.8" - } - }, "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", "dev": true }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, "is-glob": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", @@ -12540,15 +6617,6 @@ "is-extglob": "2.1.1" } }, - "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", - "dev": true, - "requires": { - "graceful-fs": "4.1.11" - } - }, "load-json-file": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-3.0.0.tgz", @@ -12561,21 +6629,6 @@ "strip-bom": "3.0.0" } }, - "mute-stream": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", - "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", - "dev": true - }, - "onetime": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", - "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", - "dev": true, - "requires": { - "mimic-fn": "1.1.0" - } - }, "parse-json": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-3.0.0.tgz", @@ -12624,58 +6677,14 @@ } }, "parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", - "dev": true, - "requires": { - "error-ex": "1.3.1" - } - } - } - }, - "restore-cursor": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", - "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", - "dev": true, - "requires": { - "onetime": "2.0.1", - "signal-exit": "3.0.2" - } - }, - "run-async": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", - "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", - "dev": true, - "requires": { - "is-promise": "2.1.0" - } - }, - "rx-lite": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz", - "integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ=", - "dev": true - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "2.0.0", - "strip-ansi": "4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "3.0.0" + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "1.3.1" + } + } } }, "strip-bom": { @@ -12685,9 +6694,9 @@ "dev": true }, "supports-color": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz", - "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", + "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", "dev": true, "requires": { "has-flag": "2.0.0" @@ -12695,6 +6704,12 @@ } } }, + "leven": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-2.1.0.tgz", + "integrity": "sha1-wuep93IJTe6dNCAq6KzORoeHVYA=", + "dev": true + }, "levn": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", @@ -12728,7 +6743,219 @@ "lodash.isstring": "4.0.1", "lodash.mapvalues": "4.6.0", "rechoir": "0.6.2", - "resolve": "1.4.0" + "resolve": "1.5.0" + } + }, + "lint-staged": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-4.3.0.tgz", + "integrity": "sha512-C/Zxslg0VRbsxwmCu977iIs+QyrmW2cyRCPUV5NDFYOH/jtRFHH8ch7ua2fH0voI/nVC3Tpg7DykfgMZySliKw==", + "dev": true, + "requires": { + "app-root-path": "2.0.1", + "chalk": "2.3.0", + "commander": "2.11.0", + "cosmiconfig": "1.1.0", + "execa": "0.8.0", + "is-glob": "4.0.0", + "jest-validate": "21.2.1", + "listr": "0.12.0", + "lodash": "4.17.4", + "log-symbols": "2.1.0", + "minimatch": "3.0.4", + "npm-which": "3.0.1", + "p-map": "1.2.0", + "staged-git-files": "0.0.4", + "stringify-object": "3.2.1" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", + "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", + "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "dev": true, + "requires": { + "ansi-styles": "3.2.0", + "escape-string-regexp": "1.0.5", + "supports-color": "4.5.0" + } + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-glob": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.0.tgz", + "integrity": "sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A=", + "dev": true, + "requires": { + "is-extglob": "2.1.1" + } + }, + "supports-color": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", + "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "dev": true, + "requires": { + "has-flag": "2.0.0" + } + } + } + }, + "listr": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/listr/-/listr-0.12.0.tgz", + "integrity": "sha1-a84sD1YD+klYDqF81qAMwOX6RRo=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "cli-truncate": "0.2.1", + "figures": "1.7.0", + "indent-string": "2.1.0", + "is-promise": "2.1.0", + "is-stream": "1.1.0", + "listr-silent-renderer": "1.1.1", + "listr-update-renderer": "0.2.0", + "listr-verbose-renderer": "0.4.1", + "log-symbols": "1.0.2", + "log-update": "1.0.2", + "ora": "0.2.3", + "p-map": "1.2.0", + "rxjs": "5.5.2", + "stream-to-observable": "0.1.0", + "strip-ansi": "3.0.1" + }, + "dependencies": { + "figures": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", + "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", + "dev": true, + "requires": { + "escape-string-regexp": "1.0.5", + "object-assign": "4.1.1" + } + }, + "log-symbols": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-1.0.2.tgz", + "integrity": "sha1-N2/3tY6jCGoPCfrMdGF+ylAeGhg=", + "dev": true, + "requires": { + "chalk": "1.1.3" + } + } + } + }, + "listr-silent-renderer": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/listr-silent-renderer/-/listr-silent-renderer-1.1.1.tgz", + "integrity": "sha1-kktaN1cVN3C/Go4/v3S4u/P5JC4=", + "dev": true + }, + "listr-update-renderer": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/listr-update-renderer/-/listr-update-renderer-0.2.0.tgz", + "integrity": "sha1-yoDhd5tOcCZoB+ju0a1qvjmFUPk=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "cli-truncate": "0.2.1", + "elegant-spinner": "1.0.1", + "figures": "1.7.0", + "indent-string": "3.2.0", + "log-symbols": "1.0.2", + "log-update": "1.0.2", + "strip-ansi": "3.0.1" + }, + "dependencies": { + "figures": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", + "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", + "dev": true, + "requires": { + "escape-string-regexp": "1.0.5", + "object-assign": "4.1.1" + } + }, + "indent-string": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", + "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", + "dev": true + }, + "log-symbols": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-1.0.2.tgz", + "integrity": "sha1-N2/3tY6jCGoPCfrMdGF+ylAeGhg=", + "dev": true, + "requires": { + "chalk": "1.1.3" + } + } + } + }, + "listr-verbose-renderer": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/listr-verbose-renderer/-/listr-verbose-renderer-0.4.1.tgz", + "integrity": "sha1-ggb0z21S3cWCfl/RSYng6WWTOjU=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "cli-cursor": "1.0.2", + "date-fns": "1.29.0", + "figures": "1.7.0" + }, + "dependencies": { + "cli-cursor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz", + "integrity": "sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc=", + "dev": true, + "requires": { + "restore-cursor": "1.0.1" + } + }, + "figures": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", + "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", + "dev": true, + "requires": { + "escape-string-regexp": "1.0.5", + "object-assign": "4.1.1" + } + }, + "onetime": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", + "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=", + "dev": true + }, + "restore-cursor": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz", + "integrity": "sha1-NGYfRohjJ/7SmRR5FSJS35LapUE=", + "dev": true, + "requires": { + "exit-hook": "1.1.1", + "onetime": "1.1.0" + } + } } }, "load-json-file": { @@ -12890,6 +7117,12 @@ "integrity": "sha1-LcvSwofLwKVcxCMovQxzYVDVPj8=", "dev": true }, + "lodash.merge": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.0.tgz", + "integrity": "sha1-aYhLoUSsM/5plzemCG3v+t0PicU=", + "dev": true + }, "lodash.restparam": { "version": "3.6.1", "resolved": "https://registry.npmjs.org/lodash.restparam/-/lodash.restparam-3.6.1.tgz", @@ -12923,6 +7156,95 @@ "lodash.escape": "3.2.0" } }, + "lodash.unescape": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.unescape/-/lodash.unescape-4.0.1.tgz", + "integrity": "sha1-vyJJiGzlFM2hEvrpIYzcBlIR/Jw=", + "dev": true + }, + "log-symbols": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.1.0.tgz", + "integrity": "sha512-zLeLrzMA1A2vRF1e/0Mo+LNINzi6jzBylHj5WqvQ/WK/5WCZt8si9SyN4p9llr/HRYvVR1AoXHRHl4WTHyQAzQ==", + "dev": true, + "requires": { + "chalk": "2.3.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", + "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", + "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "dev": true, + "requires": { + "ansi-styles": "3.2.0", + "escape-string-regexp": "1.0.5", + "supports-color": "4.5.0" + } + }, + "supports-color": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", + "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "dev": true, + "requires": { + "has-flag": "2.0.0" + } + } + } + }, + "log-update": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/log-update/-/log-update-1.0.2.tgz", + "integrity": "sha1-GZKfZMQJPS0ucHWh2tivWcKWuNE=", + "dev": true, + "requires": { + "ansi-escapes": "1.4.0", + "cli-cursor": "1.0.2" + }, + "dependencies": { + "ansi-escapes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz", + "integrity": "sha1-06ioOzGapneTZisT52HHkRQiMG4=", + "dev": true + }, + "cli-cursor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz", + "integrity": "sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc=", + "dev": true, + "requires": { + "restore-cursor": "1.0.1" + } + }, + "onetime": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", + "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=", + "dev": true + }, + "restore-cursor": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz", + "integrity": "sha1-NGYfRohjJ/7SmRR5FSJS35LapUE=", + "dev": true, + "requires": { + "exit-hook": "1.1.1", + "onetime": "1.1.0" + } + } + } + }, "log4js": { "version": "0.6.38", "resolved": "https://registry.npmjs.org/log4js/-/log4js-0.6.38.tgz", @@ -12959,12 +7281,34 @@ } } }, + "loglevel": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.6.0.tgz", + "integrity": "sha1-rgyqVhERSYxboTcj1vtjHSQAOTQ=", + "dev": true + }, + "loglevel-colored-level-prefix": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/loglevel-colored-level-prefix/-/loglevel-colored-level-prefix-1.0.0.tgz", + "integrity": "sha1-akAhj9x64V/HbD0PPmdsRlOIYD4=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "loglevel": "1.6.0" + } + }, "lolex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/lolex/-/lolex-1.3.2.tgz", "integrity": "sha1-fD2mL/yzDw9agKJWbKJORdigHzE=", "dev": true }, + "longest": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", + "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", + "dev": true + }, "loose-envify": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.3.1.tgz", @@ -12984,19 +7328,55 @@ "signal-exit": "3.0.2" } }, - "lru-cache": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", - "integrity": "sha1-bUUk6LlV+V1PW1iFHOId1y+06VI=", - "dev": true - }, - "make-dir": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.0.0.tgz", - "integrity": "sha1-l6ARdR6R3YfPre9Ygy67BJNt6Xg=", + "lowercase-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.0.tgz", + "integrity": "sha1-TjNms55/VFfjXxMkvfb4jQv8cwY=", + "dev": true + }, + "lru-cache": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.1.tgz", + "integrity": "sha512-q4spe4KTfsAS1SUHLO0wz8Qiyf1+vMIAgpRYioFYDMNqKfHQbg+AVDH3i4fvpl71/P1L0dBl+fQi+P37UYf0ew==", + "dev": true, + "requires": { + "pseudomap": "1.0.2", + "yallist": "2.1.2" + } + }, + "make-dir": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.1.0.tgz", + "integrity": "sha512-0Pkui4wLJ7rxvmfUvs87skoEaxmu0hCUApF8nonzpl7q//FWp9zu8W61Scz4sd/kUiqDxvUhtoam2efDyiBzcA==", + "dev": true, + "requires": { + "pify": "3.0.0" + }, + "dependencies": { + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } + } + }, + "make-plural": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/make-plural/-/make-plural-4.1.1.tgz", + "integrity": "sha512-triaMVDDYiB+OU1Mz6ht74+z0Bb/bzNESeMwRboSprI3GRWbOvfxEnpWI0eDixQtMPrC2C0revd4wmuck5GcoQ==", "dev": true, "requires": { - "pify": "2.3.0" + "minimist": "1.2.0" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true, + "optional": true + } } }, "map-cache": { @@ -13089,10 +7469,45 @@ "readable-stream": "2.3.3" } }, + "messageformat": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/messageformat/-/messageformat-1.1.0.tgz", + "integrity": "sha512-0Pw6VMOzuWTorRwGXyY0oeosd6zlTykYYHMNJtK4bOwc/1G7yqr3mSg1fd822nKpBcN6J3YvdTKC4TRWsl/fqw==", + "dev": true, + "requires": { + "glob": "7.0.6", + "make-plural": "4.1.1", + "messageformat-parser": "1.1.0", + "nopt": "3.0.6", + "reserved-words": "0.1.2" + }, + "dependencies": { + "glob": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.0.6.tgz", + "integrity": "sha1-IRuvr0nlJbjNkyYNFKsTYVKz9Xo=", + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + } + } + }, + "messageformat-parser": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/messageformat-parser/-/messageformat-parser-1.1.0.tgz", + "integrity": "sha512-Hwem6G3MsKDLS1FtBRGIs8T50P1Q00r3srS6QJePCFbad9fq0nYxwf3rnU2BreApRGhmpKMV7oZI06Sy1c9TPA==", + "dev": true + }, "metal": { - "version": "2.13.2", - "resolved": "https://registry.npmjs.org/metal/-/metal-2.13.2.tgz", - "integrity": "sha512-DqETxwvyW5I/3blSlxrr1eleLaLHItK1VJcGIL6hAVqSlUpYw0r+RXd8qWfIq6TMdjCU3/x/oGmWZyk+O4SZJw==", + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/metal/-/metal-2.14.0.tgz", + "integrity": "sha512-dk4MUJZ5Rj+sB9RgZcATU8QRDxHKPn85ymVWC+PamDhcIEYsY5Fg+I6vOQ1Bo4J+54z/k9KF2K7fmUIRtoRb+w==", "dev": true }, "metal-tools-soy": { @@ -13235,7 +7650,7 @@ "integrity": "sha1-XIgDbPVl5d8FVYv8kR+GVt8hiIQ=", "dev": true, "requires": { - "clone": "1.0.2", + "clone": "1.0.3", "clone-stats": "0.0.1", "replace-ext": "0.0.1" } @@ -13273,7 +7688,7 @@ "integrity": "sha1-9Yfb1hPE18kFBjn1iXMSdThjcWk=", "dev": true, "requires": { - "metal": "2.13.2" + "metal": "2.14.0" } }, "micromatch": { @@ -13419,6 +7834,12 @@ "minimatch": "0.3.0" } }, + "lru-cache": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", + "integrity": "sha1-bUUk6LlV+V1PW1iFHOId1y+06VI=", + "dev": true + }, "minimatch": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.3.0.tgz", @@ -13465,7 +7886,7 @@ "JSONStream": "1.3.1", "parents": "1.0.1", "readable-stream": "2.3.3", - "resolve": "1.4.0", + "resolve": "1.5.0", "stream-combiner2": "1.1.1", "subarg": "1.0.0", "through2": "2.0.3", @@ -13473,9 +7894,9 @@ } }, "moment": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.19.0.tgz", - "integrity": "sha1-RPZ172uUSUJ2JYGxwXn7Z55ZnWc=", + "version": "2.19.2", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.19.2.tgz", + "integrity": "sha512-Rf6jiHPEfxp9+dlzxPTmRHbvoFXsh2L/U8hOupUMpnuecHQmI6cF6lUbJl3QqKPko1u6ujO+FxtcajLVfLpAtA==", "dev": true }, "mout": { @@ -13535,11 +7956,18 @@ } }, "mute-stream": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.5.tgz", - "integrity": "sha1-j7+rsKmKJT0xhDMfno3rc3L6xsA=", + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", "dev": true }, + "nan": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.8.0.tgz", + "integrity": "sha1-7XFfP+neArV6XmJS2QqWZ14fCFo=", + "dev": true, + "optional": true + }, "natives": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/natives/-/natives-1.1.0.tgz", @@ -13558,6 +7986,16 @@ "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=", "dev": true }, + "node-fetch": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz", + "integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==", + "dev": true, + "requires": { + "encoding": "0.1.12", + "is-stream": "1.1.0" + } + }, "nopt": { "version": "3.0.6", "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", @@ -13588,11 +8026,14 @@ "remove-trailing-separator": "1.1.0" } }, - "normalize-range": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/normalize-range/-/normalize-range-0.1.2.tgz", - "integrity": "sha1-LRDAa9/TEuqXd2laTShDlFa3WUI=", - "dev": true + "npm-path": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/npm-path/-/npm-path-2.0.3.tgz", + "integrity": "sha1-Fc/04ciaONp39W9gVbJPl137K74=", + "dev": true, + "requires": { + "which": "1.3.0" + } }, "npm-run-path": { "version": "2.0.2", @@ -13603,6 +8044,17 @@ "path-key": "2.0.1" } }, + "npm-which": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/npm-which/-/npm-which-3.0.1.tgz", + "integrity": "sha1-kiXybsOihcIJyuZ8OxGmtKtxQKo=", + "dev": true, + "requires": { + "commander": "2.11.0", + "npm-path": "2.0.3", + "which": "1.3.0" + } + }, "npmlog": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", @@ -13621,12 +8073,6 @@ "integrity": "sha1-l33/1xdgErnsMNKjnbXPcqBDnt0=", "dev": true }, - "num2fraction": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/num2fraction/-/num2fraction-1.2.2.tgz", - "integrity": "sha1-b2gragJ6Tp3fpFZM0lidHU5mnt4=", - "dev": true - }, "number-is-nan": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", @@ -13634,9 +8080,9 @@ "dev": true }, "nwmatcher": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/nwmatcher/-/nwmatcher-1.4.2.tgz", - "integrity": "sha512-QMkCGQFYp5p+zwU3INntLmz1HMfSx9dMVJMYKmE1yuSf/22Wjo6VPFa405mCLUuQn9lbQvH2DZN9lt10ZNvtAg==", + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/nwmatcher/-/nwmatcher-1.4.3.tgz", + "integrity": "sha512-IKdSTiDWCarf2JTS5e9e2+5tPZGdkRJ79XjYV0pzK8Q9BpsFyBq1RGKxzs7Q8UBushGw7m6TzVKz6fcY99iSWw==", "dev": true }, "oauth-sign": { @@ -13663,17 +8109,6 @@ "integrity": "sha1-xUYBd4rVYPEULODgG8yotW0TQm0=", "dev": true }, - "object.assign": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.0.4.tgz", - "integrity": "sha1-scnMBE7xuf5jYG/BQau7MuFHMMw=", - "dev": true, - "requires": { - "define-properties": "1.1.2", - "function-bind": "1.1.1", - "object-keys": "1.0.11" - } - }, "object.defaults": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz", @@ -13749,10 +8184,13 @@ } }, "onetime": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", - "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=", - "dev": true + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "dev": true, + "requires": { + "mimic-fn": "1.1.0" + } }, "optimist": { "version": "0.6.1", @@ -13792,6 +8230,45 @@ "integrity": "sha1-7CLTEoBrtT5zF3Pnza788cZDEo8=", "dev": true }, + "ora": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/ora/-/ora-0.2.3.tgz", + "integrity": "sha1-N1J9Igrc1Tw5tzVx11QVbV22V6Q=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "cli-cursor": "1.0.2", + "cli-spinners": "0.1.2", + "object-assign": "4.1.1" + }, + "dependencies": { + "cli-cursor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz", + "integrity": "sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc=", + "dev": true, + "requires": { + "restore-cursor": "1.0.1" + } + }, + "onetime": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", + "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=", + "dev": true + }, + "restore-cursor": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz", + "integrity": "sha1-NGYfRohjJ/7SmRR5FSJS35LapUE=", + "dev": true, + "requires": { + "exit-hook": "1.1.1", + "onetime": "1.1.0" + } + } + } + }, "orchestrator": { "version": "0.3.8", "resolved": "https://registry.npmjs.org/orchestrator/-/orchestrator-0.3.8.tgz", @@ -13891,6 +8368,24 @@ "p-limit": "1.1.0" } }, + "p-map": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-1.2.0.tgz", + "integrity": "sha512-r6zKACMNhjPJMTl8KcFH4li//gkrXWfbD6feV8l6doRHlzljFWGJ2AP6iKaCJXyZmAUMOPtvbW7EXkbWO/pLEA==", + "dev": true + }, + "package-json": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/package-json/-/package-json-4.0.1.tgz", + "integrity": "sha1-iGmgQBJTZhxMTKPabCEh7VVfXu0=", + "dev": true, + "requires": { + "got": "6.7.1", + "registry-auth-token": "3.3.1", + "registry-url": "3.1.0", + "semver": "5.4.1" + } + }, "pako": { "version": "0.2.9", "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz", @@ -13912,8 +8407,8 @@ "integrity": "sha1-N8T5t+06tlx0gXtfJICTf7+XxxI=", "dev": true, "requires": { - "asn1.js": "4.9.1", - "browserify-aes": "1.0.8", + "asn1.js": "4.9.2", + "browserify-aes": "1.1.1", "create-hash": "1.1.3", "evp_bytestokey": "1.0.3", "pbkdf2": "3.0.14" @@ -14120,57 +8615,214 @@ } }, "pluralize": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-1.2.1.tgz", - "integrity": "sha1-0aIUg/0iu0HlihL6NCGCMUCJfEU=", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", + "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", "dev": true }, - "posix-getopt": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/posix-getopt/-/posix-getopt-1.2.0.tgz", - "integrity": "sha1-Su7rfa3mb8qKk2XdqfawBXQctiE=", + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, + "prepend-http": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", + "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=", + "dev": true + }, + "preserve": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", + "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", "dev": true }, - "postcss": { - "version": "5.2.18", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", + "prettier": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.8.2.tgz", + "integrity": "sha512-fHWjCwoRZgjP1rvLP7OGqOznq7xH1sHMQUFLX8qLRO79hI57+6xbc5vB904LxEkCfgFgyr3vv06JkafgCSzoZg==", + "dev": true + }, + "prettier-eslint": { + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/prettier-eslint/-/prettier-eslint-8.2.2.tgz", + "integrity": "sha512-zeR/ZfoENuKupTd+l49aUSCKGAheIPIpZFErK2xJhPfqubg2iJy2velL72AnGkgXsXiyLwAthxoXHoL2HASctw==", + "dev": true, + "requires": { + "common-tags": "1.4.0", + "dlv": "1.1.0", + "eslint": "4.11.0", + "indent-string": "3.2.0", + "lodash.merge": "4.6.0", + "loglevel-colored-level-prefix": "1.0.0", + "prettier": "1.8.2", + "pretty-format": "20.0.3", + "require-relative": "0.8.7", + "typescript": "2.6.1", + "typescript-eslint-parser": "8.0.1" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", + "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "indent-string": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", + "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", + "dev": true + }, + "pretty-format": { + "version": "20.0.3", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-20.0.3.tgz", + "integrity": "sha1-Ag41ClYKH+GpjcO+tsz/s4beixQ=", + "dev": true, + "requires": { + "ansi-regex": "2.1.1", + "ansi-styles": "3.2.0" + } + } + } + }, + "prettier-eslint-cli": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/prettier-eslint-cli/-/prettier-eslint-cli-4.4.0.tgz", + "integrity": "sha512-q7kAFt+JpUQJALs110mpaT0+NEMZ4tt1SgOmeNL1D+13rABH0nIMw8fy3NnaTMSmRH9Wfuct6jHSDyqdb9PpVQ==", "dev": true, "requires": { - "chalk": "1.1.3", - "js-base64": "2.3.2", - "source-map": "0.5.7", - "supports-color": "3.2.3" + "arrify": "1.0.1", + "babel-runtime": "6.26.0", + "boolify": "1.0.1", + "camelcase-keys": "4.2.0", + "chalk": "2.1.0", + "common-tags": "1.4.0", + "eslint": "4.11.0", + "find-up": "2.1.0", + "get-stdin": "5.0.1", + "glob": "7.1.2", + "ignore": "3.3.7", + "indent-string": "3.2.0", + "lodash.memoize": "4.1.2", + "loglevel-colored-level-prefix": "1.0.0", + "messageformat": "1.1.0", + "prettier-eslint": "8.2.2", + "rxjs": "5.5.2", + "yargs": "8.0.2" }, "dependencies": { + "ansi-styles": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", + "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + }, + "camelcase-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz", + "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=", + "dev": true, + "requires": { + "camelcase": "4.1.0", + "map-obj": "2.0.0", + "quick-lru": "1.1.0" + } + }, + "chalk": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz", + "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.0", + "escape-string-regexp": "1.0.5", + "supports-color": "4.5.0" + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "2.0.0" + } + }, + "get-stdin": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-5.0.1.tgz", + "integrity": "sha1-Ei4WFZHiH/TFJTAwVpPyDmOTo5g=", + "dev": true + }, + "indent-string": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", + "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", + "dev": true + }, + "lodash.memoize": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", + "integrity": "sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=", + "dev": true + }, + "map-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz", + "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=", + "dev": true + }, "supports-color": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", + "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", "dev": true, "requires": { - "has-flag": "1.0.0" + "has-flag": "2.0.0" } } } }, - "postcss-value-parser": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.0.tgz", - "integrity": "sha1-h/OPnxj3dKSrTIojL1xc6IcqnRU=", - "dev": true - }, - "prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", - "dev": true - }, - "preserve": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", - "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", - "dev": true + "pretty-format": { + "version": "21.2.1", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-21.2.1.tgz", + "integrity": "sha512-ZdWPGYAnYfcVP8yKA3zFjCn8s4/17TeYH28MXuC8vTp0o21eXjbFGcOAXZEaDaOFJjc3h2qa7HQNHNshhvoh2A==", + "dev": true, + "requires": { + "ansi-regex": "3.0.0", + "ansi-styles": "3.2.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", + "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + } + } }, "pretty-hrtime": { "version": "1.0.3", @@ -14179,9 +8831,9 @@ "dev": true }, "private": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/private/-/private-0.1.7.tgz", - "integrity": "sha1-aM5eih7woju1cMwoU3tTMqumPvE=", + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", + "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", "dev": true }, "process": { @@ -14197,11 +8849,31 @@ "dev": true }, "progress": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz", - "integrity": "sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.0.tgz", + "integrity": "sha1-ihvjZr+Pwj2yvSPxDG/pILQ4nR8=", "dev": true }, + "promise": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", + "integrity": "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==", + "dev": true, + "requires": { + "asap": "2.0.6" + } + }, + "prop-types": { + "version": "15.6.0", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.6.0.tgz", + "integrity": "sha1-zq8IMCL8RrSjX2nhPvda7Q1jmFY=", + "dev": true, + "requires": { + "fbjs": "0.8.16", + "loose-envify": "1.3.1", + "object-assign": "4.1.1" + } + }, "pseudomap": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", @@ -14228,9 +8900,9 @@ "dev": true }, "q": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/q/-/q-1.5.0.tgz", - "integrity": "sha1-3QG6ydBtMObyGa7LglPunr3DCPE=", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", + "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=", "dev": true }, "qjobs": { @@ -14257,6 +8929,12 @@ "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", "dev": true }, + "quick-lru": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz", + "integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=", + "dev": true + }, "randomatic": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", @@ -14282,7 +8960,7 @@ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { - "is-buffer": "1.1.5" + "is-buffer": "1.1.6" } } } @@ -14293,7 +8971,7 @@ "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", "dev": true, "requires": { - "is-buffer": "1.1.5" + "is-buffer": "1.1.6" } } } @@ -14307,6 +8985,16 @@ "safe-buffer": "5.1.1" } }, + "randomfill": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.3.tgz", + "integrity": "sha512-YL6GrhrWoic0Eq8rXVbMptH7dAxCs0J+mh5Y0euNekPPYaxEmdVGim6GdoxoRzKW2yJoU8tueifS7mYxvcFDEQ==", + "dev": true, + "requires": { + "randombytes": "2.0.5", + "safe-buffer": "5.1.1" + } + }, "range-parser": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", @@ -14323,12 +9011,24 @@ "http-errors": "1.6.2", "iconv-lite": "0.4.19", "unpipe": "1.0.0" + } + }, + "rc": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.2.tgz", + "integrity": "sha1-2M6ctX6NZNnHut2YdsfDTL48cHc=", + "dev": true, + "requires": { + "deep-extend": "0.4.2", + "ini": "1.3.4", + "minimist": "1.2.0", + "strip-json-comments": "2.0.1" }, "dependencies": { - "iconv-lite": { - "version": "0.4.19", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", - "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==", + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true } } @@ -14410,24 +9110,13 @@ "set-immediate-shim": "1.0.1" } }, - "readline2": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/readline2/-/readline2-1.0.1.tgz", - "integrity": "sha1-QQWWCP/BVHV7cV2ZidGZ/783LjU=", - "dev": true, - "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "mute-stream": "0.0.5" - } - }, "rechoir": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", "dev": true, "requires": { - "resolve": "1.4.0" + "resolve": "1.5.0" } }, "redent": { @@ -14438,6 +9127,17 @@ "requires": { "indent-string": "2.1.0", "strip-indent": "1.0.1" + }, + "dependencies": { + "strip-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", + "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", + "dev": true, + "requires": { + "get-stdin": "4.0.1" + } + } } }, "regenerate": { @@ -14460,7 +9160,7 @@ "requires": { "babel-runtime": "6.26.0", "babel-types": "6.26.0", - "private": "0.1.7" + "private": "0.1.8" } }, "regex-cache": { @@ -14483,6 +9183,25 @@ "regjsparser": "0.1.5" } }, + "registry-auth-token": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-3.3.1.tgz", + "integrity": "sha1-+w0yie4Nmtosu1KvXf5mywcNMAY=", + "dev": true, + "requires": { + "rc": "1.2.2", + "safe-buffer": "5.1.1" + } + }, + "registry-url": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-3.1.0.tgz", + "integrity": "sha1-PU74cPc93h138M+aOBQyRE4XSUI=", + "dev": true, + "requires": { + "rc": "1.2.2" + } + }, "regjsgen": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", @@ -14586,12 +9305,24 @@ "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", "dev": true }, + "require-from-string": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-1.2.1.tgz", + "integrity": "sha1-UpyczvJzgK3+yaL5ZbZJu+5jZBg=", + "dev": true + }, "require-main-filename": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", "dev": true }, + "require-relative": { + "version": "0.8.7", + "resolved": "https://registry.npmjs.org/require-relative/-/require-relative-0.8.7.tgz", + "integrity": "sha1-eZlTn8ngR6N5KPoZb44VY9q9Nt4=", + "dev": true + }, "require-uncached": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", @@ -14602,16 +9333,28 @@ "resolve-from": "1.0.1" } }, + "requireindex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/requireindex/-/requireindex-1.1.0.tgz", + "integrity": "sha1-5UBLgVV+91225JxacgBIk/4D4WI=", + "dev": true + }, "requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=", "dev": true }, + "reserved-words": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/reserved-words/-/reserved-words-0.1.2.tgz", + "integrity": "sha1-AKCUD5jNUBrqqsMWQR2a3FKzGrE=", + "dev": true + }, "resolve": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.4.0.tgz", - "integrity": "sha512-aW7sVKPufyHqOmyyLzg/J+8606v5nevBgaliIlV7nUpVMsDnoBGV/cbSLNjZAg9q0Cfd/+easKVKQ8vOu8fn1Q==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.5.0.tgz", + "integrity": "sha512-hgoSGrc3pjzAPHNBg+KnFcK2HwlHTs/YrAGUr6qgTVUZmXv1UEXXl0bZNBKMA9fud6lRYFdPGz0xXxycPzmmiw==", "dev": true, "requires": { "path-parse": "1.0.5" @@ -14634,13 +9377,23 @@ "dev": true }, "restore-cursor": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz", - "integrity": "sha1-NGYfRohjJ/7SmRR5FSJS35LapUE=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "dev": true, + "requires": { + "onetime": "2.0.1", + "signal-exit": "3.0.2" + } + }, + "right-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", + "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", "dev": true, + "optional": true, "requires": { - "exit-hook": "1.1.1", - "onetime": "1.1.0" + "align-text": "0.1.4" } }, "rimraf": { @@ -14663,18 +9416,18 @@ } }, "run-async": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-0.1.0.tgz", - "integrity": "sha1-yK1KXhEGYeQCp9IbUw4AnyX444k=", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", + "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", "dev": true, "requires": { - "once": "1.4.0" + "is-promise": "2.1.0" } }, "rx-lite": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-3.1.2.tgz", - "integrity": "sha1-Gc5QLKVyZl87ZHsQk5+X/RYV8QI=", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz", + "integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ=", "dev": true }, "rx-lite-aggregates": { @@ -14683,7 +9436,16 @@ "integrity": "sha1-dTuHqJoRyVRnxKwWJsTvxOBcZ74=", "dev": true, "requires": { - "rx-lite": "3.1.2" + "rx-lite": "4.0.8" + } + }, + "rxjs": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-5.5.2.tgz", + "integrity": "sha512-oRYoIKWBU3Ic37fLA5VJu31VqQO4bWubRntcHSJ+cwaDQBwdnZ9x4zmhJfm/nFQ2E82/I4loSioHnACamrKGgA==", + "dev": true, + "requires": { + "symbol-observable": "1.0.4" } }, "safe-buffer": { @@ -14698,6 +9460,64 @@ "integrity": "sha1-vsEf3IOp/aBjQBIQ5AF2wwJNFWc=", "dev": true }, + "sauce-connect-launcher": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/sauce-connect-launcher/-/sauce-connect-launcher-0.17.0.tgz", + "integrity": "sha1-kI2TEeyvF92bRkehQ1/UogcugM4=", + "dev": true, + "requires": { + "adm-zip": "0.4.7", + "async": "1.4.0", + "https-proxy-agent": "1.0.0", + "lodash": "3.10.1", + "rimraf": "2.4.3" + }, + "dependencies": { + "async": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/async/-/async-1.4.0.tgz", + "integrity": "sha1-Nfhvg8WeBCHQmc2akdgnj7V4wA0=", + "dev": true + }, + "glob": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "dev": true, + "requires": { + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "lodash": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz", + "integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=", + "dev": true + }, + "rimraf": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.4.3.tgz", + "integrity": "sha1-5bUclDekxYKtuVXp8oz42UXicq8=", + "dev": true, + "requires": { + "glob": "5.0.15" + } + } + } + }, + "saucelabs": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/saucelabs/-/saucelabs-1.4.0.tgz", + "integrity": "sha1-uTSpr52ih0s/QKrh/N5QpEZvXzg=", + "dev": true, + "requires": { + "https-proxy-agent": "1.0.0" + } + }, "sax": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", @@ -14728,6 +9548,12 @@ "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=", "dev": true }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", + "dev": true + }, "setprototypeof": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz", @@ -14781,17 +9607,6 @@ "jsonify": "0.0.0" } }, - "shelljs": { - "version": "0.7.8", - "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.7.8.tgz", - "integrity": "sha1-3svPh0sNHl+3LhSxZKloMEjprLM=", - "dev": true, - "requires": { - "glob": "7.1.2", - "interpret": "1.0.4", - "rechoir": "0.6.2" - } - }, "sigmund": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", @@ -14823,15 +9638,18 @@ "dev": true }, "slice-ansi": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz", - "integrity": "sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU=", - "dev": true + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", + "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "2.0.0" + } }, "sntp": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/sntp/-/sntp-2.0.2.tgz", - "integrity": "sha1-UGQRDwr4X3z9t9a2ekACjOUrSys=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/sntp/-/sntp-2.1.0.tgz", + "integrity": "sha512-FL1b58BDrqS3A11lJ0zEdnJ3UOKqVxawAkF3k7F0CVN7VQ34aZrV+G8BZ1WC9ZL7NyrwsW0oviwsWDgRuVYtJg==", "dev": true, "requires": { "hoek": "4.2.0" @@ -15072,14 +9890,24 @@ "requires": { "asn1": "0.2.3", "assert-plus": "1.0.0", + "bcrypt-pbkdf": "1.0.1", "dashdash": "1.14.1", - "getpass": "0.1.7" + "ecc-jsbn": "0.1.1", + "getpass": "0.1.7", + "jsbn": "0.1.1", + "tweetnacl": "0.14.5" } }, + "staged-git-files": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/staged-git-files/-/staged-git-files-0.0.4.tgz", + "integrity": "sha1-15fhtVHKemOd7AI33G60u5vhfTU=", + "dev": true + }, "statuses": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", - "integrity": "sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4=", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", + "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==", "dev": true }, "stream-browserify": { @@ -15147,6 +9975,12 @@ "readable-stream": "2.3.3" } }, + "stream-to-observable": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/stream-to-observable/-/stream-to-observable-0.1.0.tgz", + "integrity": "sha1-Rb8dny19wJvtgfHDB8Qw5ouEz/4=", + "dev": true + }, "string_decoder": { "version": "0.10.31", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", @@ -15154,14 +9988,41 @@ "dev": true }, "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "dev": true, "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" + "is-fullwidth-code-point": "2.0.0", + "strip-ansi": "4.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } + } + } + }, + "stringify-object": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/stringify-object/-/stringify-object-3.2.1.tgz", + "integrity": "sha512-jPcQYw/52HUPP8uOE4kkjxl5bB9LfHkKCTptIk3qw7ozP5XMIMlHMLjt00GGSwW6DJAf/njY5EU6Vpwl4LlBKQ==", + "dev": true, + "requires": { + "get-own-enumerable-property-symbols": "2.0.1", + "is-obj": "1.0.1", + "is-regexp": "1.0.0" } }, "stringstream": { @@ -15205,13 +10066,10 @@ "dev": true }, "strip-indent": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", - "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", - "dev": true, - "requires": { - "get-stdin": "4.0.1" - } + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz", + "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=", + "dev": true }, "strip-json-comments": { "version": "2.0.1", @@ -15228,7 +10086,7 @@ "byline": "5.0.0", "duplexer": "0.1.1", "minimist": "0.1.0", - "moment": "2.19.0", + "moment": "2.19.2", "through": "2.3.8" }, "dependencies": { @@ -15263,6 +10121,12 @@ "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", "dev": true }, + "symbol-observable": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.0.4.tgz", + "integrity": "sha1-Kb9hXUqnEhvdiYsi1LP5vE4qoD0=", + "dev": true + }, "symbol-tree": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.2.tgz", @@ -15279,48 +10143,69 @@ } }, "table": { - "version": "3.8.3", - "resolved": "https://registry.npmjs.org/table/-/table-3.8.3.tgz", - "integrity": "sha1-K7xULw/amGGnVdOUf+/Ys/UThV8=", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz", + "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==", "dev": true, "requires": { - "ajv": "4.11.8", - "ajv-keywords": "1.5.1", - "chalk": "1.1.3", + "ajv": "5.4.0", + "ajv-keywords": "2.1.1", + "chalk": "2.3.0", "lodash": "4.17.4", - "slice-ansi": "0.0.4", + "slice-ansi": "1.0.0", "string-width": "2.1.1" }, "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true + "ansi-styles": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", + "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "chalk": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", + "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", "dev": true, "requires": { - "is-fullwidth-code-point": "2.0.0", - "strip-ansi": "4.0.0" + "ansi-styles": "3.2.0", + "escape-string-regexp": "1.0.5", + "supports-color": "4.5.0" } }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "supports-color": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", + "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", "dev": true, "requires": { - "ansi-regex": "3.0.0" + "has-flag": "2.0.0" + } + } + } + }, + "tar-stream": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.5.5.tgz", + "integrity": "sha512-mQdgLPc/Vjfr3VWqWbfxW8yQNiJCbAZ+Gf6GDu1Cy0bdb33ofyiNGBtAY96jHFhDuivCwgW1H9DgTON+INiXgg==", + "dev": true, + "requires": { + "bl": "1.2.1", + "end-of-stream": "1.4.0", + "readable-stream": "2.3.3", + "xtend": "4.0.1" + }, + "dependencies": { + "end-of-stream": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.0.tgz", + "integrity": "sha1-epDYM+/abPpurA9JSduw+tOmMgY=", + "dev": true, + "requires": { + "once": "1.4.0" } } } @@ -15339,7 +10224,7 @@ "requires": { "graceful-fs": "4.1.11", "is-stream": "1.1.0", - "make-dir": "1.0.0", + "make-dir": "1.1.0", "pify": "2.3.0", "temp-dir": "1.0.0", "uuid": "3.1.0" @@ -15447,6 +10332,12 @@ "integrity": "sha1-dkpaEa9QVhkhsTPztE5hhofg9cM=", "dev": true }, + "timed-out": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", + "integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=", + "dev": true + }, "timers-browserify": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-1.4.2.tgz", @@ -15457,9 +10348,9 @@ } }, "tmp": { - "version": "0.0.31", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.31.tgz", - "integrity": "sha1-jzirlDjhcxXl29izZX6L+yd65Kc=", + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", "dev": true, "requires": { "os-tmpdir": "1.0.2" @@ -15562,6 +10453,13 @@ "safe-buffer": "5.1.1" } }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true, + "optional": true + }, "type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", @@ -15593,60 +10491,87 @@ "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", "dev": true }, - "typhonjs-ast-walker": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/typhonjs-ast-walker/-/typhonjs-ast-walker-0.1.1.tgz", - "integrity": "sha1-gUVUptrSnhyyy2K8io6GwXTBaOM=", + "typescript": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.6.1.tgz", + "integrity": "sha1-7znN6ierrAtQAkLWcmq5DgyEZjE=", "dev": true }, - "typhonjs-escomplex": { - "version": "0.0.12", - "resolved": "https://registry.npmjs.org/typhonjs-escomplex/-/typhonjs-escomplex-0.0.12.tgz", - "integrity": "sha1-wrDlpzOdeG3d03R7FT5/ZDPx/iA=", + "typescript-eslint-parser": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/typescript-eslint-parser/-/typescript-eslint-parser-8.0.1.tgz", + "integrity": "sha1-6MrFN9mW4Ww9uw18TVCXmeZ6/gw=", "dev": true, "requires": { - "babylon": "6.18.0", - "commander": "2.11.0", - "typhonjs-escomplex-module": "0.0.12", - "typhonjs-escomplex-project": "0.0.12" + "lodash.unescape": "4.0.1", + "semver": "5.4.1" } }, - "typhonjs-escomplex-commons": { - "version": "0.0.16", - "resolved": "https://registry.npmjs.org/typhonjs-escomplex-commons/-/typhonjs-escomplex-commons-0.0.16.tgz", - "integrity": "sha1-5oTo3ITTxsyVmKbb1hS3A/hqfUk=", + "ua-parser-js": { + "version": "0.7.17", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.17.tgz", + "integrity": "sha512-uRdSdu1oA1rncCQL7sCj8vSyZkgtL7faaw9Tc9rZ3mGgraQ7+Pdx7w5mnOSF3gw9ZNG6oc+KXfkon3bKuROm0g==", "dev": true }, - "typhonjs-escomplex-module": { - "version": "0.0.12", - "resolved": "https://registry.npmjs.org/typhonjs-escomplex-module/-/typhonjs-escomplex-module-0.0.12.tgz", - "integrity": "sha1-xZm7PeKzj/LYMmJa7iwgXxUxvmE=", - "dev": true, - "requires": { - "escomplex-plugin-metrics-module": "0.0.13", - "escomplex-plugin-syntax-babylon": "0.0.13", - "typhonjs-ast-walker": "0.1.1", - "typhonjs-escomplex-commons": "0.0.16", - "typhonjs-plugin-manager": "0.0.3" - } - }, - "typhonjs-escomplex-project": { - "version": "0.0.12", - "resolved": "https://registry.npmjs.org/typhonjs-escomplex-project/-/typhonjs-escomplex-project-0.0.12.tgz", - "integrity": "sha1-EKHWvzJ/czOKG9eHFZ/GMka5x5g=", + "uglify-js": { + "version": "2.8.29", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", + "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", "dev": true, + "optional": true, "requires": { - "escomplex-plugin-metrics-project": "0.0.13", - "typhonjs-escomplex-commons": "0.0.16", - "typhonjs-escomplex-module": "0.0.12", - "typhonjs-plugin-manager": "0.0.3" + "source-map": "0.5.7", + "uglify-to-browserify": "1.0.2", + "yargs": "3.10.0" + }, + "dependencies": { + "camelcase": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "dev": true, + "optional": true + }, + "cliui": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", + "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", + "dev": true, + "optional": true, + "requires": { + "center-align": "0.1.3", + "right-align": "0.1.3", + "wordwrap": "0.0.2" + } + }, + "wordwrap": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", + "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", + "dev": true, + "optional": true + }, + "yargs": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", + "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "dev": true, + "optional": true, + "requires": { + "camelcase": "1.2.1", + "cliui": "2.1.0", + "decamelize": "1.2.0", + "window-size": "0.1.0" + } + } } }, - "typhonjs-plugin-manager": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/typhonjs-plugin-manager/-/typhonjs-plugin-manager-0.0.3.tgz", - "integrity": "sha1-hN1eHQG0QRm95JPqZW3O+JJVq4Q=", - "dev": true + "uglify-to-browserify": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", + "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", + "dev": true, + "optional": true }, "ultron": { "version": "1.0.2", @@ -15666,6 +10591,16 @@ "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=", "dev": true }, + "underscore.string": { + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-3.3.4.tgz", + "integrity": "sha1-LCo/n4PmR2L9xF5s6sZRQoZCE9s=", + "dev": true, + "requires": { + "sprintf-js": "1.0.3", + "util-deprecate": "1.0.2" + } + }, "unique-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unique-stream/-/unique-stream-1.0.0.tgz", @@ -15684,6 +10619,12 @@ "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", "dev": true }, + "unzip-response": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/unzip-response/-/unzip-response-2.0.1.tgz", + "integrity": "sha1-0vD3N9FrBhXnKmk17QQhRXLVb5c=", + "dev": true + }, "url": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", @@ -15702,6 +10643,15 @@ } } }, + "url-parse-lax": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", + "integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=", + "dev": true, + "requires": { + "prepend-http": "1.0.4" + } + }, "user-home": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/user-home/-/user-home-1.1.1.tgz", @@ -15715,7 +10665,7 @@ "dev": true, "requires": { "lru-cache": "2.2.4", - "tmp": "0.0.31" + "tmp": "0.0.33" }, "dependencies": { "lru-cache": { @@ -15786,6 +10736,12 @@ "spdx-expression-parse": "1.0.4" } }, + "vargs": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/vargs/-/vargs-0.1.0.tgz", + "integrity": "sha1-a2GE2mUgzDIEzhtAfKwm2SYJ6/8=", + "dev": true + }, "verror": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", @@ -15803,7 +10759,7 @@ "integrity": "sha1-sEVbOPxeDPMNQyUTLkYZcMIJHN4=", "dev": true, "requires": { - "clone": "1.0.2", + "clone": "1.0.3", "clone-stats": "0.0.1", "replace-ext": "0.0.1" } @@ -15889,15 +10845,6 @@ } } }, - "vinyl-sourcemaps-apply": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/vinyl-sourcemaps-apply/-/vinyl-sourcemaps-apply-0.2.1.tgz", - "integrity": "sha1-q2VJ1h0XLCsbh75cUI0jnI74dwU=", - "dev": true, - "requires": { - "source-map": "0.5.7" - } - }, "vm-browserify": { "version": "0.0.4", "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", @@ -15913,6 +10860,12 @@ "integrity": "sha1-wGavtYK7HLQSjWDqkjkulNXp2+w=", "dev": true }, + "walkdir": { + "version": "0.0.11", + "resolved": "https://registry.npmjs.org/walkdir/-/walkdir-0.0.11.tgz", + "integrity": "sha1-oW0CXrkxvQO1LzCMrtD0D86+lTI=", + "dev": true + }, "watchify": { "version": "3.9.0", "resolved": "https://registry.npmjs.org/watchify/-/watchify-3.9.0.tgz", @@ -15920,7 +10873,7 @@ "dev": true, "requires": { "anymatch": "1.3.2", - "browserify": "14.4.0", + "browserify": "14.5.0", "chokidar": "1.7.0", "defined": "1.0.0", "outpipe": "1.1.1", @@ -15929,21 +10882,21 @@ }, "dependencies": { "browserify": { - "version": "14.4.0", - "resolved": "https://registry.npmjs.org/browserify/-/browserify-14.4.0.tgz", - "integrity": "sha1-CJo0Y69Y0OSNjNQHCz90ZU1avKk=", + "version": "14.5.0", + "resolved": "https://registry.npmjs.org/browserify/-/browserify-14.5.0.tgz", + "integrity": "sha512-gKfOsNQv/toWz+60nSPfYzuwSEdzvV2WdxrVPUbPD/qui44rAkB3t3muNtmmGYHqrG56FGwX9SUEQmzNLAeS7g==", "dev": true, "requires": { "assert": "1.4.1", "browser-pack": "6.0.2", "browser-resolve": "1.11.2", - "browserify-zlib": "0.1.4", + "browserify-zlib": "0.2.0", "buffer": "5.0.8", "cached-path-relative": "1.0.1", "concat-stream": "1.5.2", "console-browserify": "1.1.0", "constants-browserify": "1.0.0", - "crypto-browserify": "3.11.1", + "crypto-browserify": "3.12.0", "defined": "1.0.0", "deps-sort": "2.0.0", "domain-browser": "1.1.7", @@ -15958,7 +10911,7 @@ "JSONStream": "1.3.1", "labeled-stream-splicer": "2.0.0", "module-deps": "4.1.1", - "os-browserify": "0.1.2", + "os-browserify": "0.3.0", "parents": "1.0.1", "path-browserify": "0.0.0", "process": "0.11.10", @@ -15966,7 +10919,7 @@ "querystring-es3": "0.2.1", "read-only-stream": "2.0.0", "readable-stream": "2.3.3", - "resolve": "1.4.0", + "resolve": "1.5.0", "shasum": "1.0.2", "shell-quote": "1.6.1", "stream-browserify": "2.0.1", @@ -15983,6 +10936,15 @@ "xtend": "4.0.1" } }, + "browserify-zlib": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", + "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", + "dev": true, + "requires": { + "pako": "1.0.6" + } + }, "buffer": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.0.8.tgz", @@ -15999,6 +10961,18 @@ "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", "dev": true }, + "os-browserify": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", + "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", + "dev": true + }, + "pako": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.6.tgz", + "integrity": "sha512-lQe48YPsMJAig+yngZ87Lus+NF+3mtu7DVOBu6b/gHO1YpKwIj5AWjZ/TOS7i46HD/UixzWb1zeWDZfGZ3iYcg==", + "dev": true + }, "string_decoder": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", @@ -16019,6 +10993,182 @@ "defaults": "1.0.3" } }, + "wd": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/wd/-/wd-1.4.1.tgz", + "integrity": "sha512-C0wWd2X4SWWcyx5qxaixiZE4Vb07sl0yDfWHPeml8lDHSbmI9erE9BmTHIqOGoDxGgJ3/hkFmODQ7ZLKiF8+8Q==", + "dev": true, + "requires": { + "archiver": "1.3.0", + "async": "2.0.1", + "lodash": "4.16.2", + "mkdirp": "0.5.1", + "q": "1.4.1", + "request": "2.79.0", + "underscore.string": "3.3.4", + "vargs": "0.1.0" + }, + "dependencies": { + "assert-plus": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", + "integrity": "sha1-104bh+ev/A24qttwIfP+SBAasjQ=", + "dev": true + }, + "async": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/async/-/async-2.0.1.tgz", + "integrity": "sha1-twnMAoCpw28J9FNr6CPIOKkEniU=", + "dev": true, + "requires": { + "lodash": "4.16.2" + } + }, + "aws-sign2": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", + "integrity": "sha1-FDQt0428yU0OW4fXY81jYSwOeU8=", + "dev": true + }, + "boom": { + "version": "2.10.1", + "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", + "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=", + "dev": true, + "requires": { + "hoek": "2.16.3" + } + }, + "caseless": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", + "integrity": "sha1-cVuW6phBWTzDMGeSP17GDr2k99c=", + "dev": true + }, + "cryptiles": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", + "integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=", + "dev": true, + "requires": { + "boom": "2.10.1" + } + }, + "form-data": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.1.4.tgz", + "integrity": "sha1-M8GDrPGTJ27KqYFDpp6Uv+4XUNE=", + "dev": true, + "requires": { + "asynckit": "0.4.0", + "combined-stream": "1.0.5", + "mime-types": "2.1.17" + } + }, + "har-validator": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz", + "integrity": "sha1-zcvAgYgmWtEZtqWnyKtw7s+10n0=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "commander": "2.11.0", + "is-my-json-valid": "2.16.1", + "pinkie-promise": "2.0.1" + } + }, + "hawk": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", + "integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=", + "dev": true, + "requires": { + "boom": "2.10.1", + "cryptiles": "2.0.5", + "hoek": "2.16.3", + "sntp": "1.0.9" + } + }, + "hoek": { + "version": "2.16.3", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", + "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=", + "dev": true + }, + "http-signature": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", + "integrity": "sha1-33LiZwZs0Kxn+3at+OE0qPvPkb8=", + "dev": true, + "requires": { + "assert-plus": "0.2.0", + "jsprim": "1.4.1", + "sshpk": "1.13.1" + } + }, + "lodash": { + "version": "4.16.2", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.16.2.tgz", + "integrity": "sha1-PmJtuCcEimmSgaihJSJjJs/A5lI=", + "dev": true + }, + "q": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.4.1.tgz", + "integrity": "sha1-VXBbzZPF82c1MMLCy8DCs63cKG4=", + "dev": true + }, + "qs": { + "version": "6.3.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.3.2.tgz", + "integrity": "sha1-51vV9uJoEioqDgvaYwslUMFmUCw=", + "dev": true + }, + "request": { + "version": "2.79.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.79.0.tgz", + "integrity": "sha1-Tf5b9r6LjNw3/Pk+BLZVd3InEN4=", + "dev": true, + "requires": { + "aws-sign2": "0.6.0", + "aws4": "1.6.0", + "caseless": "0.11.0", + "combined-stream": "1.0.5", + "extend": "3.0.1", + "forever-agent": "0.6.1", + "form-data": "2.1.4", + "har-validator": "2.0.6", + "hawk": "3.1.3", + "http-signature": "1.1.1", + "is-typedarray": "1.0.0", + "isstream": "0.1.2", + "json-stringify-safe": "5.0.1", + "mime-types": "2.1.17", + "oauth-sign": "0.8.2", + "qs": "6.3.2", + "stringstream": "0.0.5", + "tough-cookie": "2.3.3", + "tunnel-agent": "0.4.3", + "uuid": "3.1.0" + } + }, + "sntp": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", + "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=", + "dev": true, + "requires": { + "hoek": "2.16.3" + } + }, + "tunnel-agent": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", + "integrity": "sha1-Y3PbdpCf5XDgjXNYM2Xtgop07us=", + "dev": true + } + } + }, "webidl-conversions": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", @@ -16026,14 +11176,20 @@ "dev": true }, "whatwg-encoding": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.1.tgz", - "integrity": "sha1-PGxFGhmO567FWx7GHQkgxngBpfQ=", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.3.tgz", + "integrity": "sha512-jLBwwKUhi8WtBfsMQlL4bUUcT8sMkAtQinscJAe/M4KHCkHuUJAF6vuB0tueNIw4c8ziO6AkRmgY+jL3a0iiPw==", "dev": true, "requires": { - "iconv-lite": "0.4.13" + "iconv-lite": "0.4.19" } }, + "whatwg-fetch": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz", + "integrity": "sha1-nITsLc9oGH/wC8ZOEnS0QhduHIQ=", + "dev": true + }, "whatwg-url": { "version": "4.8.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-4.8.0.tgz", @@ -16074,8 +11230,37 @@ "dev": true, "requires": { "string-width": "1.0.2" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + } } }, + "window-size": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", + "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", + "dev": true, + "optional": true + }, "wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", @@ -16090,6 +11275,28 @@ "requires": { "string-width": "1.0.2", "strip-ansi": "3.0.1" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + } } }, "wrappy": { @@ -16126,7 +11333,7 @@ "requires": { "detect-indent": "5.0.0", "graceful-fs": "4.1.11", - "make-dir": "1.0.0", + "make-dir": "1.1.0", "pify": "3.0.0", "sort-keys": "2.0.0", "write-file-atomic": "2.3.0" @@ -16223,12 +11430,6 @@ "yargs-parser": "7.0.0" }, "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, "camelcase": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", @@ -16244,12 +11445,6 @@ "locate-path": "2.0.0" } }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, "load-json-file": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", @@ -16292,25 +11487,6 @@ "read-pkg": "2.0.0" } }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "2.0.0", - "strip-ansi": "4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "3.0.0" - } - }, "strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", @@ -16341,6 +11517,18 @@ "resolved": "https://registry.npmjs.org/yeast/-/yeast-0.1.2.tgz", "integrity": "sha1-AI4G2AlDIMNy28L47XagymyKxBk=", "dev": true + }, + "zip-stream": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-1.2.0.tgz", + "integrity": "sha1-qLxF9MG0lpnGuQGYuqyqzbzUugQ=", + "dev": true, + "requires": { + "archiver-utils": "1.3.0", + "compress-commons": "1.2.2", + "lodash": "4.17.4", + "readable-stream": "2.3.3" + } } } } diff --git a/package.json b/package.json index 37a34252..224ba433 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,17 @@ { "private": true, "scripts": { - "compile": "gulp build:cjs", - "format": "gulp format", + "checkFormat": "npm run prettier -- --list-different", + "compile": "lerna run compile", + "format": "npm run prettier -- --write", "lerna": "lerna bootstrap -- --no-optional && npm install --no-optional", - "lint": "gulp lint", - "test": "gulp test && npm run test:isomorphic", - "test:coverage": "gulp test:coverage", - "test:coverage:open": "gulp test:coverage:open", + "lint": "eslint 'packages/metal*/{src,test}/**/*.js'", + "precommit": "lint-staged", + "prettier": "prettier-eslint 'packages/metal*/{src,test}/**/*.js'", + "test": "gulp soy && karma start && npm run test:isomorphic", + "test:coverage": "gulp soy && karma start karma-coverage.conf.js", "test:isomorphic": "gulp soy:isomorphic && mocha packages/metal-isomorphic/test/isomorphic.js --compilers js:babel-core/register", - "test:watch": "gulp test:watch" + "test:saucelabs": "gulp soy && karma start karma-saucelabs.conf.js" }, "devDependencies": { "babel-core": "^6.26.0", @@ -19,28 +21,39 @@ "babelify": "^7.3.0", "browserify": "^13.0.1", "chai": "^3.5.0", - "eslint-plugin-react": "^6.8.0", + "eslint": "^4.10.0", + "eslint-config-liferay": "^2.0.9", + "eslint-plugin-react": "^7.4.0", "gulp": "^3.8.11", - "gulp-babel": "^6.1.2", - "gulp-metal": "^1.0.0", "gulp-replace": "^0.5.4", + "husky": "^0.14.3", "jsdom": "^9.9.1", "jsdom-global": "^2.1.1", "karma": "^1.1.0", - "karma-browserify": "^5.0.5", + "karma-babel-preprocessor": "^7.0.0", + "karma-browserify": "^5.1.2", "karma-chai": "^0.1.0", "karma-chrome-launcher": "^1.0.1", - "karma-coverage": "^1.1.0", - "karma-mocha": "^1.0.1", + "karma-coverage": "^1.1.1", + "karma-mocha": "^1.3.0", + "karma-sauce-launcher": "~1.1.0", "karma-sinon": "^1.0.5", "karma-source-map-support": "^1.1.0", "lerna": "^2.2.0", + "lint-staged": "^4.3.0", "metal-tools-soy": "^2.4.0", "metal-useragent": "^2.1.2", "mocha": "^2.5.3", + "prettier-eslint-cli": "^4.4.0", "sinon": "^1.17.4", "watchify": "^3.7.0" }, + "lint-staged": { + "*.js": [ + "prettier-eslint --write", + "git add" + ] + }, "nyc": { "exclude": [ "packages/metal-incremental-dom/src/incremental-dom.js", diff --git a/packages/metal-assertions/README.md b/packages/metal-assertions/README.md index 09545e31..359a6574 100644 --- a/packages/metal-assertions/README.md +++ b/packages/metal-assertions/README.md @@ -1,3 +1,5 @@ # metal-assertions A collection of assertion methods for metal + +See [https://metaljs.com/](https://metaljs.com/) for documentation. diff --git a/packages/metal-assertions/package-lock.json b/packages/metal-assertions/package-lock.json index f9c637f5..7e4c66d6 100644 --- a/packages/metal-assertions/package-lock.json +++ b/packages/metal-assertions/package-lock.json @@ -64,7 +64,7 @@ "lodash": "4.17.4", "minimatch": "3.0.4", "path-is-absolute": "1.0.1", - "private": "0.1.7", + "private": "0.1.8", "slash": "1.0.0", "source-map": "0.5.7" } @@ -507,9 +507,9 @@ } }, "babel-preset-env": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.6.0.tgz", - "integrity": "sha512-OVgtQRuOZKckrILgMA5rvctvFZPv72Gua9Rt006AiPoB0DJKGN07UmaQA+qRrYgK71MVct8fFhT0EyNWYorVew==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.6.1.tgz", + "integrity": "sha512-W6VIyA6Ch9ePMI7VptNn2wBM6dbG0eSz25HEiL40nQXCsXGTGZSTZu1Iap+cj3Q0S5a7T9+529l/5Bkvd+afNA==", "requires": { "babel-plugin-check-es2015-constants": "6.22.0", "babel-plugin-syntax-trailing-function-commas": "6.22.0", @@ -538,7 +538,7 @@ "babel-plugin-transform-es2015-unicode-regex": "6.24.1", "babel-plugin-transform-exponentiation-operator": "6.24.1", "babel-plugin-transform-regenerator": "6.26.0", - "browserslist": "2.5.1", + "browserslist": "2.8.0", "invariant": "2.2.2", "semver": "5.4.1" } @@ -625,18 +625,18 @@ } }, "browserslist": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-2.5.1.tgz", - "integrity": "sha512-jAvM2ku7YDJ+leAq3bFH1DE0Ylw+F+EQDq4GkqZfgPEqpWYw9ofQH85uKSB9r3Tv7XDbfqVtE+sdvKJW7IlPJA==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-2.8.0.tgz", + "integrity": "sha512-iiWHM1Et6Q4TQpB7Ar6pxuM3TNMXasVJY4Y/oh3q38EwR3Z+IdZ9MyVf7PI4MJFB4xpwMcZgs9bEUnPG2E3TCA==", "requires": { - "caniuse-lite": "1.0.30000746", - "electron-to-chromium": "1.3.25" + "caniuse-lite": "1.0.30000760", + "electron-to-chromium": "1.3.27" } }, "caniuse-lite": { - "version": "1.0.30000746", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000746.tgz", - "integrity": "sha1-xk+Vo5Jc/TAgejCO12wa6W6gnqA=" + "version": "1.0.30000760", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000760.tgz", + "integrity": "sha1-7HIDlXQvHH7IlH/W3SYE53qPmP8=" }, "chalk": { "version": "1.1.3", @@ -687,9 +687,9 @@ } }, "electron-to-chromium": { - "version": "1.3.25", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.25.tgz", - "integrity": "sha1-RTshAJg20Jl9hgNWAf9srkeRxGA=" + "version": "1.3.27", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.27.tgz", + "integrity": "sha1-eOy4o5kGYYe7N07t412ccFZagD0=" }, "escape-string-regexp": { "version": "1.0.5", @@ -879,9 +879,9 @@ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "private": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/private/-/private-0.1.7.tgz", - "integrity": "sha1-aM5eih7woju1cMwoU3tTMqumPvE=" + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", + "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==" }, "regenerate": { "version": "1.3.3", @@ -900,7 +900,7 @@ "requires": { "babel-runtime": "6.26.0", "babel-types": "6.26.0", - "private": "0.1.7" + "private": "0.1.8" } }, "regexpu-core": { diff --git a/packages/metal-component/test/.eslintrc.json b/packages/metal-assertions/test/.eslintrc similarity index 60% rename from packages/metal-component/test/.eslintrc.json rename to packages/metal-assertions/test/.eslintrc index 92b466f1..902156c0 100644 --- a/packages/metal-component/test/.eslintrc.json +++ b/packages/metal-assertions/test/.eslintrc @@ -5,5 +5,9 @@ "globals": { "assert": true, "sinon": true + }, + "rules": { + "max-len": 0, + "require-jsdoc": 0 } -} +} \ No newline at end of file diff --git a/packages/metal-assertions/test/assertions.js b/packages/metal-assertions/test/assertions.js index e215c059..6bda9e24 100644 --- a/packages/metal-assertions/test/assertions.js +++ b/packages/metal-assertions/test/assertions.js @@ -189,5 +189,4 @@ describe('assertions', () => { }); }); }); - }); diff --git a/packages/metal-component/.eslintrc.json b/packages/metal-component/.eslintrc similarity index 100% rename from packages/metal-component/.eslintrc.json rename to packages/metal-component/.eslintrc diff --git a/packages/metal-component/README.md b/packages/metal-component/README.md index a3605092..8297d68f 100644 --- a/packages/metal-component/README.md +++ b/packages/metal-component/README.md @@ -1,3 +1,5 @@ # metal-component A component class for Metal.js. + +See [https://metaljs.com/](https://metaljs.com/) for documentation. diff --git a/packages/metal-component/package-lock.json b/packages/metal-component/package-lock.json index f9c637f5..7e4c66d6 100644 --- a/packages/metal-component/package-lock.json +++ b/packages/metal-component/package-lock.json @@ -64,7 +64,7 @@ "lodash": "4.17.4", "minimatch": "3.0.4", "path-is-absolute": "1.0.1", - "private": "0.1.7", + "private": "0.1.8", "slash": "1.0.0", "source-map": "0.5.7" } @@ -507,9 +507,9 @@ } }, "babel-preset-env": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.6.0.tgz", - "integrity": "sha512-OVgtQRuOZKckrILgMA5rvctvFZPv72Gua9Rt006AiPoB0DJKGN07UmaQA+qRrYgK71MVct8fFhT0EyNWYorVew==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.6.1.tgz", + "integrity": "sha512-W6VIyA6Ch9ePMI7VptNn2wBM6dbG0eSz25HEiL40nQXCsXGTGZSTZu1Iap+cj3Q0S5a7T9+529l/5Bkvd+afNA==", "requires": { "babel-plugin-check-es2015-constants": "6.22.0", "babel-plugin-syntax-trailing-function-commas": "6.22.0", @@ -538,7 +538,7 @@ "babel-plugin-transform-es2015-unicode-regex": "6.24.1", "babel-plugin-transform-exponentiation-operator": "6.24.1", "babel-plugin-transform-regenerator": "6.26.0", - "browserslist": "2.5.1", + "browserslist": "2.8.0", "invariant": "2.2.2", "semver": "5.4.1" } @@ -625,18 +625,18 @@ } }, "browserslist": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-2.5.1.tgz", - "integrity": "sha512-jAvM2ku7YDJ+leAq3bFH1DE0Ylw+F+EQDq4GkqZfgPEqpWYw9ofQH85uKSB9r3Tv7XDbfqVtE+sdvKJW7IlPJA==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-2.8.0.tgz", + "integrity": "sha512-iiWHM1Et6Q4TQpB7Ar6pxuM3TNMXasVJY4Y/oh3q38EwR3Z+IdZ9MyVf7PI4MJFB4xpwMcZgs9bEUnPG2E3TCA==", "requires": { - "caniuse-lite": "1.0.30000746", - "electron-to-chromium": "1.3.25" + "caniuse-lite": "1.0.30000760", + "electron-to-chromium": "1.3.27" } }, "caniuse-lite": { - "version": "1.0.30000746", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000746.tgz", - "integrity": "sha1-xk+Vo5Jc/TAgejCO12wa6W6gnqA=" + "version": "1.0.30000760", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000760.tgz", + "integrity": "sha1-7HIDlXQvHH7IlH/W3SYE53qPmP8=" }, "chalk": { "version": "1.1.3", @@ -687,9 +687,9 @@ } }, "electron-to-chromium": { - "version": "1.3.25", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.25.tgz", - "integrity": "sha1-RTshAJg20Jl9hgNWAf9srkeRxGA=" + "version": "1.3.27", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.27.tgz", + "integrity": "sha1-eOy4o5kGYYe7N07t412ccFZagD0=" }, "escape-string-regexp": { "version": "1.0.5", @@ -879,9 +879,9 @@ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "private": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/private/-/private-0.1.7.tgz", - "integrity": "sha1-aM5eih7woju1cMwoU3tTMqumPvE=" + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", + "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==" }, "regenerate": { "version": "1.3.3", @@ -900,7 +900,7 @@ "requires": { "babel-runtime": "6.26.0", "babel-types": "6.26.0", - "private": "0.1.7" + "private": "0.1.8" } }, "regexpu-core": { diff --git a/packages/metal-component/src/Component.js b/packages/metal-component/src/Component.js index 9d1c61ea..80cc808d 100644 --- a/packages/metal-component/src/Component.js +++ b/packages/metal-component/src/Component.js @@ -1,12 +1,21 @@ 'use strict'; -import { addListenersFromObj } from './events/events'; -import { getStaticProperty, isBoolean, isDefAndNotNull, isElement, isObject, isServerSide, isString, object } from 'metal'; -import { syncState } from './sync/sync'; -import { DomEventEmitterProxy, toElement } from 'metal-dom'; +import {addListenersFromObj} from './events/events'; +import { + getStaticProperty, + isBoolean, + isDefAndNotNull, + isElement, + isObject, + isServerSide, + isString, + object, +} from 'metal'; +import {syncState} from './sync/sync'; +import {DomEventEmitterProxy, toElement} from 'metal-dom'; import ComponentDataManager from './ComponentDataManager'; import ComponentRenderer from './ComponentRenderer'; -import { EventEmitter, EventHandler } from 'metal-events'; +import {EventEmitter, EventHandler} from 'metal-events'; /** * Component collects common behaviors to be followed by UI components, such @@ -73,15 +82,15 @@ import { EventEmitter, EventHandler } from 'metal-events'; class Component extends EventEmitter { /** * Constructor function for `Component`. - * @param {Object=} opt_config An object with the initial values for this + * @param {Object=} config An object with the initial values for this * component's state. - * @param {boolean|string|Element=} opt_parentElement The element where the + * @param {boolean|string|Element=} parentElement The element where the * component should be rendered. Can be given as a selector or an element. * If `false` is passed, the component won't be rendered automatically * after created. * @constructor */ - constructor(opt_config, opt_parentElement) { + constructor(config, parentElement) { super(); /** @@ -121,7 +130,7 @@ class Component extends EventEmitter { * @type {!Object} * @protected */ - this.initialConfig_ = opt_config || {}; + this.initialConfig_ = config || {}; /** * Whether the element was rendered. @@ -135,8 +144,8 @@ class Component extends EventEmitter { * `attach`. * @type {!Element} */ - this.DEFAULT_ELEMENT_PARENT = typeof document !== 'undefined' ? - document.body : null; + this.DEFAULT_ELEMENT_PARENT = + typeof document !== 'undefined' ? document.body : null; this.setShouldUseFacade(true); this.element = this.initialConfig_.element; @@ -152,8 +161,8 @@ class Component extends EventEmitter { this.created(); this.componentCreated_ = true; - if (opt_parentElement !== false) { - this.renderComponent(opt_parentElement); + if (parentElement !== false) { + this.renderComponent(parentElement); } } @@ -183,23 +192,24 @@ class Component extends EventEmitter { * appended to the DOM and any other action to be performed must be * implemented in this method, such as, binding DOM events. A component can * be re-attached multiple times. - * @param {(string|Element)=} opt_parentElement Optional parent element + * @param {(string|Element)=} parentElement Optional parent element * to render the component. - * @param {(string|Element)=} opt_siblingElement Optional sibling element + * @param {(string|Element)=} siblingElement Optional sibling element * to render the component before it. Relevant when the component needs * to be rendered before an existing element in the DOM. * @protected * @chainable + * @return {Component} */ - attach(opt_parentElement, opt_siblingElement) { + attach(parentElement, siblingElement) { if (!this.inDocument) { this.emit('willAttach'); this.willAttach(); - this.attachElement(opt_parentElement, opt_siblingElement); + this.attachElement(parentElement, siblingElement); this.inDocument = true; this.attachData_ = { - parent: opt_parentElement, - sibling: opt_siblingElement + parent: parentElement, + sibling: siblingElement, }; this.emit('attached', this.attachData_); this.attached(); @@ -218,18 +228,19 @@ class Component extends EventEmitter { /** * Attaches the component element into the DOM. - * @param {(string|Element)=} opt_parentElement Optional parent element + * @param {(string|Element)=} parentElement Optional parent element * to render the component. - * @param {(string|Element)=} opt_siblingElement Optional sibling element + * @param {(string|Element)=} siblingElement Optional sibling element * to render the component before it. Relevant when the component needs * to be rendered before an existing element in the DOM, e.g. * `component.attach(null, existingElement)`. */ - attachElement(opt_parentElement, opt_siblingElement) { + attachElement(parentElement, siblingElement) { const element = this.element; - if (element && (opt_siblingElement || !element.parentNode)) { - const parent = toElement(opt_parentElement) || this.DEFAULT_ELEMENT_PARENT; - parent.insertBefore(element, toElement(opt_siblingElement)); + if (element && (siblingElement || !element.parentNode)) { + const parent = + toElement(parentElement) || this.DEFAULT_ELEMENT_PARENT; // eslint-disable-line + parent.insertBefore(element, toElement(siblingElement)); } } @@ -258,6 +269,7 @@ class Component extends EventEmitter { * implemented in this method, such as, unbinding DOM events. A component * can be detached multiple times. * @chainable + * @return {Component} */ detach() { if (this.inDocument) { @@ -294,6 +306,7 @@ class Component extends EventEmitter { disposeInternal() { this.detach(); this.disposed(); + this.emit('disposed'); this.elementEventProxy_.dispose(); this.elementEventProxy_ = null; @@ -310,12 +323,13 @@ class Component extends EventEmitter { /** * Forces an update that ignores the `shouldUpdate` lifecycle method for * components whose render depends on external variables. + * @param {function()} callback */ - forceUpdate(opt_callback) { - this.forceUpdateCallback_ = opt_callback; + forceUpdate(callback) { + this.forceUpdateCallback_ = callback; this.updateRenderer_({ - forceUpdate: true + forceUpdate: true, }); } @@ -378,7 +392,7 @@ class Component extends EventEmitter { if (this.componentCreated_) { this.emit('elementChanged', { prevVal, - newVal + newVal, }); if (newVal && this.wasRendered) { this.syncVisible(this.dataManager_.get(this, 'visible')); @@ -409,8 +423,8 @@ class Component extends EventEmitter { handleComponentStateKeyChanged_(data) { this.updateRenderer_({ changes: { - [data.key]: data - } + [data.key]: data, + }, }); } @@ -494,17 +508,16 @@ class Component extends EventEmitter { * will always make sure that the constructor runs without rendering the * component, having the `render` step happen only after it has finished. * @param {!function()} Ctor The component's constructor function. - * @param {Object|Element=} opt_configOrElement Optional config data or parent + * @param {Object|Element=} configOrElement Optional config data or parent * for the component. - * @param {Element=} opt_element Optional parent for the component. + * @param {Element=} element Optional parent for the component. * @return {!Component} The rendered component's instance. */ - static render(Ctor, opt_configOrElement, opt_element) { - let config = opt_configOrElement; - let element = opt_element; - if (isElement(opt_configOrElement)) { + static render(Ctor, configOrElement, element) { + let config = configOrElement; + if (isElement(configOrElement)) { config = null; - element = opt_configOrElement; + element = configOrElement; } const instance = new Ctor(config, false); instance.renderComponent(element); @@ -517,52 +530,56 @@ class Component extends EventEmitter { * rendering the component, having the `render` step happen only after it * has finished. * @param {!function()} Ctor The component's constructor function. - * @param {Object|Element=} opt_configOrElement Optional config data or + * @param {Object|Element=} configOrElement Optional config data or * parent for the component. * @return {!String} The rendered component's content as string. */ - static renderToString(Ctor, opt_config) { + static renderToString(Ctor, configOrElement) { const rendererName = Ctor.RENDERER && Ctor.RENDERER.RENDERER_NAME; switch (rendererName) { - case 'jsx': - case 'soy': - case 'incremental-dom': { - if (typeof IncrementalDOM === 'undefined') { - throw new Error(`Error. Trying to render incremental dom ` + - `based component to string requires IncrementalDOM ` + - `implementation to be loaded.`); - } - // Incremental dom patches for components or nested components are - // isolated inside the component element. The following code intercepts - // incremental dom patches and collect results into temporary stack in - // order to successfully collect the final string of the outermost - // component after all nested components stack rendered. - const interceptedComponentStrings = []; - const patch = IncrementalDOM.patch; - const patchInterceptor = function() { - let currentElement = patch.apply(null, arguments); - interceptedComponentStrings.push(currentElement.innerHTML); - IncrementalDOM.patch = patch; - }; - IncrementalDOM.patch = patchInterceptor; - Component.render(Ctor, opt_config).dispose(); - return interceptedComponentStrings[0]; + case 'jsx': + case 'soy': + case 'incremental-dom': { + if (typeof IncrementalDOM === 'undefined') { + throw new Error( + `Error. Trying to render incremental dom ` + + `based component to string requires IncrementalDOM ` + + `implementation to be loaded.` + ); } - default: - throw new Error(`Error. Trying to render non incremental dom ` + - `based component to string.`); + // Incremental dom patches for components or nested components are + // isolated inside the component element. The following code intercepts + // incremental dom patches and collect results into temporary stack in + // order to successfully collect the final string of the outermost + // component after all nested components stack rendered. + const interceptedComponentStrings = []; + const patch = IncrementalDOM.patch; + const patchInterceptor = function(...args) { + let currentElement = patch(...args); + interceptedComponentStrings.push(currentElement.innerHTML); + IncrementalDOM.patch = patch; + }; + IncrementalDOM.patch = patchInterceptor; + Component.render(Ctor, configOrElement).dispose(); + return interceptedComponentStrings[0]; + } + default: + throw new Error( + `Error. Trying to render non incremental dom ` + + `based component to string.` + ); } - }; + } /** * Renders the component into the DOM via its `ComponentRenderer`. Stores the * given parent element to be used when the renderer is done (`informRendered`). - * @param {(string|Element|boolean)=} opt_parentElement Optional parent element + * @param {(string|Element|boolean)=} parentElement Optional parent element * to render the component. If set to `false`, the element won't be * attached to any element after rendering. In this case, `attach` should * be called manually later to actually attach it to the dom. */ - renderComponent(opt_parentElement) { + renderComponent(parentElement) { if (!this.hasRendererRendered_) { if (!isServerSide() && window.__METAL_DEV_TOOLS_HOOK__) { window.__METAL_DEV_TOOLS_HOOK__(this); @@ -571,7 +588,7 @@ class Component extends EventEmitter { } this.emit('render'); syncState(this); - this.attach(opt_parentElement); + this.attach(parentElement); this.wasRendered = true; } @@ -597,13 +614,13 @@ class Component extends EventEmitter { /** * Sets the value of all the specified state keys. - * @param {!Object.} values A map of state keys to the values they + * @param {!Object.} state A map of state keys to the values they * should be set to. - * @param {function()=} opt_callback An optional function that will be run + * @param {function()=} callback An optional function that will be run * after the next batched update is triggered. */ - setState(state, opt_callback) { - this.dataManager_.setState(this, state, opt_callback); + setState(state, callback) { + this.dataManager_.setState(this, state, callback); } /** @@ -633,7 +650,11 @@ class Component extends EventEmitter { this.dataManager_ = getStaticProperty(this.constructor, 'DATA_MANAGER'); this.dataManager_.setUp( this, - object.mixin({}, this.renderer_.getExtraDataConfig(this), Component.DATA) + object.mixin( + {}, + this.renderer_.getExtraDataConfig(this), + Component.DATA + ) // eslint-disable-line ); } @@ -755,7 +776,7 @@ Component.DATA = { */ children: { validator: Array.isArray, - value: [] + value: [], }, /** @@ -765,7 +786,7 @@ Component.DATA = { elementClasses: { setter: 'setterElementClassesFn_', validator: isString, - value: '' + value: '', }, /** @@ -776,7 +797,7 @@ Component.DATA = { */ events: { validator: 'validatorEventsFn_', - value: null + value: null, }, /** @@ -785,8 +806,8 @@ Component.DATA = { */ visible: { validator: isBoolean, - value: true - } + value: true, + }, }; /** @@ -834,7 +855,7 @@ Component.prototype[Component.COMPONENT_FLAG] = true; const proxyBlackList_ = { eventsChanged: true, stateChanged: true, - stateKeyChanged: true + stateKeyChanged: true, }; export default Component; diff --git a/packages/metal-component/src/ComponentDataManager.js b/packages/metal-component/src/ComponentDataManager.js index 54c332fd..0bcb02b5 100644 --- a/packages/metal-component/src/ComponentDataManager.js +++ b/packages/metal-component/src/ComponentDataManager.js @@ -1,6 +1,6 @@ 'use strict'; -import { object } from 'metal'; +import {object} from 'metal'; import State from 'metal-state'; const BLACKLIST = { @@ -10,10 +10,13 @@ const BLACKLIST = { refs: true, state: true, stateKey: true, - wasRendered: true + wasRendered: true, }; const DATA_MANAGER_DATA = '__DATA_MANAGER_DATA__'; +/** + * Class to handle Component Data + */ class ComponentDataManager { /** * Creates the `State` instance that will handle the main component data. @@ -22,7 +25,11 @@ class ComponentDataManager { * @protected */ createState_(component, data) { - const state = new State(component.getInitialConfig(), component, component); + const state = new State( + component.getInitialConfig(), + component, + component + ); // eslint-disable-line state.setKeysBlacklist(BLACKLIST); state.configState( object.mixin({}, data, State.getStateStatic(component.constructor)) @@ -102,10 +109,13 @@ class ComponentDataManager { * value if none is given). * @param {!Component} component * @param {!Object} data - * @param {State=} opt_state + * @param {State=} state */ - replaceNonInternal(component, data, opt_state) { - const state = opt_state || this.getManagerData(component).state_; + replaceNonInternal( + component, + data, + state = this.getManagerData(component).state_ + ) { const keys = state.getStateKeys(); for (let i = 0; i < keys.length; i++) { const key = keys[i]; @@ -122,13 +132,13 @@ class ComponentDataManager { /** * Sets the value of all the specified state keys. * @param {!Component} component - * @param {!Object.} values A map of state keys to the values they + * @param {!Object.} state A map of state keys to the values they * should be set to. - * @param {function()=} opt_callback An optional function that will be run + * @param {function()=} callback An optional function that will be run * after the next batched update is triggered. */ - setState(component, state, opt_callback) { - this.getManagerData(component).state_.setState(state, opt_callback); + setState(component, state, callback) { + this.getManagerData(component).state_.setState(state, callback); } /** diff --git a/packages/metal-component/src/ComponentRegistry.js b/packages/metal-component/src/ComponentRegistry.js index bf942d8a..82cda90c 100644 --- a/packages/metal-component/src/ComponentRegistry.js +++ b/packages/metal-component/src/ComponentRegistry.js @@ -1,6 +1,6 @@ 'use strict'; -import { getFunctionName } from 'metal'; +import {getFunctionName} from 'metal'; /** * The component registry is used to register components, so they can @@ -19,7 +19,9 @@ class ComponentRegistry { const constructorFn = ComponentRegistry.components_[name]; if (!constructorFn) { console.error( - `There's no constructor registered for the component named ${name}. + `There's no constructor registered for the component named ${ + name + }. Components need to be registered via ComponentRegistry.register.` ); } @@ -29,13 +31,12 @@ class ComponentRegistry { /** * Registers a component, so it can be found by its name. * @param {!Function} constructorFn The component's constructor function. - * @param {string=} opt_name Name of the registered component. If none is given + * @param {string=} name Name of the registered component. If none is given * the name defined by the NAME static variable will be used instead. If that * isn't set as well, the name of the constructor function will be used. * @static */ - static register(constructorFn, opt_name) { - let name = opt_name; + static register(constructorFn, name) { if (!name) { if (constructorFn.hasOwnProperty('NAME')) { name = constructorFn.NAME; diff --git a/packages/metal-component/src/ComponentRenderer.js b/packages/metal-component/src/ComponentRenderer.js index 343fbb6c..b2b07e0a 100644 --- a/packages/metal-component/src/ComponentRenderer.js +++ b/packages/metal-component/src/ComponentRenderer.js @@ -5,7 +5,6 @@ * required methods all renderers should have. */ class ComponentRenderer { - /** * Disposes of any data specific to the given component. * @param {!Component} component @@ -17,7 +16,6 @@ class ComponentRenderer { * Sub classes can override to return `State` config for properties that * should be added to the component. * @param {!Component} component - * @return {Object} */ getExtraDataConfig() {} diff --git a/packages/metal-component/src/all/component.js b/packages/metal-component/src/all/component.js index a16228a1..5735f850 100644 --- a/packages/metal-component/src/all/component.js +++ b/packages/metal-component/src/all/component.js @@ -6,5 +6,10 @@ import ComponentRegistry from '../ComponentRegistry'; import ComponentRenderer from '../ComponentRenderer'; export default Component; -export { Component, ComponentDataManager, ComponentRegistry, ComponentRenderer }; +export { + Component, + ComponentDataManager, + ComponentRegistry, + ComponentRenderer, +}; export * from '../events/events'; diff --git a/packages/metal-component/src/events/events.js b/packages/metal-component/src/events/events.js index bb36a65d..61948f60 100644 --- a/packages/metal-component/src/events/events.js +++ b/packages/metal-component/src/events/events.js @@ -1,6 +1,6 @@ 'use strict'; -import { getFunctionName, isFunction, isObject, isString } from 'metal'; +import {getFunctionName, isFunction, isObject, isString} from 'metal'; /** * Adds the listeners specified in the given object. @@ -16,7 +16,11 @@ export function addListenersFromObj(component, events) { if (info.fn) { let handle; if (info.selector) { - handle = component.delegate(eventNames[i], info.selector, info.fn); + handle = component.delegate( + eventNames[i], + info.selector, + info.fn + ); // eslint-disable-line } else { handle = component.on(eventNames[i], info.fn); } @@ -29,14 +33,13 @@ export function addListenersFromObj(component, events) { /** * Extracts listener info from the given value. * @param {!Component} component - * @param {!Component} component - * @param {function()|string|{selector:string,fn:function()|string}} value + * @param {function()|string|{selector:string,fn:function()}|string} value * @return {!{selector:string,fn:function()}} * @protected */ function extractListenerInfo_(component, value) { const info = { - fn: value + fn: value, }; if (isObject(value) && !isFunction(value)) { info.selector = value.selector; @@ -60,7 +63,6 @@ export function getComponentFn(component, fnName) { } else { console.error(`No function named ${fnName} was found in the component "${getFunctionName(component.constructor)}". Make sure that you specify - valid function names when adding inline listeners` - ); + valid function names when adding inline listeners`); } } diff --git a/packages/metal-component/src/sync/sync.js b/packages/metal-component/src/sync/sync.js index fe515e24..cec45595 100644 --- a/packages/metal-component/src/sync/sync.js +++ b/packages/metal-component/src/sync/sync.js @@ -1,6 +1,6 @@ 'use strict'; -import { isFunction } from 'metal'; +import {isFunction} from 'metal'; const SYNC_FNS_KEY = '__METAL_SYNC_FNS__'; @@ -24,7 +24,9 @@ function getSyncFns_(component) { const keys = component.getDataManager().getSyncKeys(component); let canCache = true; for (let i = 0; i < keys.length; i++) { - const name = `sync${keys[i].charAt(0).toUpperCase()}${keys[i].slice(1)}`; + const name = `sync${keys[i].charAt(0).toUpperCase()}${keys[i].slice( + 1 + )}`; const fn = component[name]; if (fn) { fns[keys[i]] = fn; @@ -41,16 +43,16 @@ function getSyncFns_(component) { /** * Calls "sync" functions for the given component's state. * @param {!Component} component - * @param {Object=} opt_changes When given, only the properties inside it will + * @param {Object=} changes When given, only the properties inside it will * be synced. Otherwise all state properties will be synced. */ -export function syncState(component, opt_changes) { +export function syncState(component, changes) { const syncFns = getSyncFns_(component); - const keys = Object.keys(opt_changes || syncFns); + const keys = Object.keys(changes || syncFns); for (let i = 0; i < keys.length; i++) { const fn = syncFns[keys[i]]; if (isFunction(fn)) { - const change = opt_changes && opt_changes[keys[i]]; + const change = changes && changes[keys[i]]; const manager = component.getDataManager(); fn.call( component, diff --git a/packages/metal-dom/test/.eslintrc.json b/packages/metal-component/test/.eslintrc similarity index 60% rename from packages/metal-dom/test/.eslintrc.json rename to packages/metal-component/test/.eslintrc index 92b466f1..902156c0 100644 --- a/packages/metal-dom/test/.eslintrc.json +++ b/packages/metal-component/test/.eslintrc @@ -5,5 +5,9 @@ "globals": { "assert": true, "sinon": true + }, + "rules": { + "max-len": 0, + "require-jsdoc": 0 } -} +} \ No newline at end of file diff --git a/packages/metal-component/test/Component.js b/packages/metal-component/test/Component.js index 4fc59a0a..7e751b2c 100644 --- a/packages/metal-component/test/Component.js +++ b/packages/metal-component/test/Component.js @@ -1,14 +1,14 @@ 'use strict'; -import { async, core } from 'metal'; -import { dom, features } from 'metal-dom'; -import { validators } from 'metal-state'; +import {async, core} from 'metal'; +import {dom, features} from 'metal-dom'; +import {validators} from 'metal-state'; import Component from '../src/Component'; import ComponentDataManager from '../src/ComponentDataManager'; import ComponentRenderer from '../src/ComponentRenderer'; describe('Component', function() { - var comp; + let comp; afterEach(function() { document.body.innerHTML = ''; @@ -37,7 +37,7 @@ describe('Component', function() { }); it('should run component render lifecycle', function() { - var renderListener = sinon.stub(); + let renderListener = sinon.stub(); class TestComponent extends Component { created() { this.on('render', renderListener); @@ -57,7 +57,7 @@ describe('Component', function() { }); it('should not run component render lifecycle if "false" is passed as second param', function() { - var renderListener = sinon.stub(); + let renderListener = sinon.stub(); class TestComponent extends Component { created() { this.on('render', renderListener); @@ -95,8 +95,7 @@ describe('Component', function() { }); it('should run "willAttach" lifecycle method when the component is about to attach', function() { - class TestComponent extends Component { - } + class TestComponent extends Component {} sinon.spy(TestComponent.prototype, 'willAttach'); comp = new TestComponent(); @@ -105,7 +104,7 @@ describe('Component', function() { }); it('should emit "willAttach" lifecycle event when the component is about to attach', function() { - var listener = sinon.stub(); + let listener = sinon.stub(); class TestComponent extends Component { created() { this.on('willAttach', listener); @@ -119,7 +118,7 @@ describe('Component', function() { it('should emit "attached" event when component is attached', function() { comp = new Component({}, false); - var listener = sinon.stub(); + let listener = sinon.stub(); comp.on('attached', listener); comp.attach('.parent', '.sibling'); assert.strictEqual(1, listener.callCount); @@ -130,15 +129,14 @@ describe('Component', function() { it('should return attach data via the `getAttachData` function', function() { comp = new Component({}, false); comp.attach('.parent', '.sibling'); - var attachData = comp.getAttachData(); + let attachData = comp.getAttachData(); assert.ok(attachData); assert.strictEqual('.parent', attachData.parent); assert.strictEqual('.sibling', attachData.sibling); }); it('should run "rendered" lifecycle method when the component is rendered', function() { - class TestComponent extends Component { - } + class TestComponent extends Component {} sinon.spy(TestComponent.prototype, 'rendered'); comp = new TestComponent(); @@ -147,7 +145,7 @@ describe('Component', function() { }); it('should emit "rendered" event when the component is rendered', function() { - var listener = sinon.stub(); + let listener = sinon.stub(); class TestComponent extends Component { created() { this.on('rendered', listener); @@ -166,8 +164,7 @@ describe('Component', function() { }); it('should run "willDetach" lifecycle method when the component is about to detach', function() { - class TestComponent extends Component { - } + class TestComponent extends Component {} sinon.spy(TestComponent.prototype, 'willDetach'); comp = new TestComponent(); @@ -180,7 +177,7 @@ describe('Component', function() { }); it('should emit "willDetach" lifecycle event when the component is about to detach', function() { - var listener = sinon.stub(); + let listener = sinon.stub(); class TestComponent extends Component { created() { this.on('willDetach', listener); @@ -200,7 +197,7 @@ describe('Component', function() { comp = new Component(); assert.ok(comp.element.parentNode); - var element = comp.element; + let element = comp.element; comp.dispose(); assert.ok(!element.parentNode); @@ -215,6 +212,21 @@ describe('Component', function() { comp.dispose(); assert.strictEqual(1, comp.disposed.callCount); }); + + it('should emit "disposed" event when component is disposed', function() { + let listener = sinon.stub(); + + comp = new Component({ + events: { + disposed: listener, + }, + }); + + assert.strictEqual(0, listener.callCount); + + comp.dispose(); + assert.strictEqual(1, listener.callCount); + }); }); describe('Element', function() { @@ -229,33 +241,33 @@ describe('Component', function() { }); it('should set component element', function() { - var element = document.createElement('div'); + let element = document.createElement('div'); document.body.appendChild(element); comp = new Component({ - element: element + element: element, }); assert.strictEqual(element, comp.element); }); it('should set component element from selector', function() { - var element = document.createElement('div'); + let element = document.createElement('div'); element.className = 'myClass'; document.body.appendChild(element); comp = new Component({ - element: '.myClass' + element: '.myClass', }); assert.strictEqual(element, comp.element); }); it('should keep previous element if selector doesn\'t match anything', function() { comp = new Component({ - element: '.myClass' + element: '.myClass', }); assert.ok(comp.element); - var element = document.createElement('div'); + let element = document.createElement('div'); comp.element = element; assert.strictEqual(element, comp.element); @@ -273,18 +285,18 @@ describe('Component', function() { describe('State', function() { it('should merge elementClasses with ELEMENT_CLASSES static hint', function() { - var CustomComponent = createCustomComponentClass(); + let CustomComponent = createCustomComponentClass(); CustomComponent.ELEMENT_CLASSES = 'static'; comp = new CustomComponent({ - elementClasses: 'class' + elementClasses: 'class', }); assert.strictEqual('class static', comp.elementClasses); }); it('should allow setting element to null', function() { comp = new Component(); - assert.doesNotThrow(() => comp.element = null); + assert.doesNotThrow(() => (comp.element = null)); assert.strictEqual(null, comp.element); }); @@ -295,7 +307,9 @@ describe('Component', function() { assert.ok(!comp.inDocument); }); - it('should update element display value according to visible state', function(done) { + it('should update element display value according to visible state', function( + done + ) { comp = new Component(); assert.ok(comp.visible); @@ -314,13 +328,15 @@ describe('Component', function() { it('should set display value on new element when changed', function() { comp = new Component({ - visible: false + visible: false, }); comp.element = document.createElement('div'); assert.strictEqual('none', comp.element.style.display); }); - it('should not throw error when trying to set display value before element is set', function(done) { + it('should not throw error when trying to set display value before element is set', function( + done + ) { comp = new Component({}, false); comp.visible = false; comp.once('stateSynced', function() { @@ -330,26 +346,26 @@ describe('Component', function() { }); it('should return initial config object received by the constructor', function() { - var config = {}; + let config = {}; comp = new Component(config); assert.strictEqual(config, comp.getInitialConfig()); }); it('should return an array with all state property names', function() { comp = new Component(); - var expected = ['children', 'elementClasses', 'events', 'visible']; + let expected = ['children', 'elementClasses', 'events', 'visible']; assert.deepEqual(expected, comp.getStateKeys().sort()); }); it('should return an object with all state properties', function() { comp = new Component({ - elementClasses: 'myClass' + elementClasses: 'myClass', }); - var expected = { + let expected = { children: [], elementClasses: 'myClass', events: null, - visible: true + visible: true, }; assert.deepEqual(expected, comp.getState()); }); @@ -358,7 +374,7 @@ describe('Component', function() { comp = new Component(); comp.setState({ elementClasses: 'myClass', - visible: false + visible: false, }); assert.strictEqual('myClass', comp.elementClasses); assert.ok(!comp.visible); @@ -366,15 +382,15 @@ describe('Component', function() { describe('events state key', function() { it('should attach events to specified functions', function() { - var CustomComponent = createCustomComponentClass(); + let CustomComponent = createCustomComponentClass(); CustomComponent.prototype.listener1 = sinon.stub(); const listener2 = sinon.stub(); comp = new CustomComponent({ events: { event1: 'listener1', - event2: listener2 - } + event2: listener2, + }, }); comp.emit('event1'); @@ -387,13 +403,13 @@ describe('Component', function() { }); it('should attach events when "events" state property value changes', function() { - var listener1 = sinon.stub(); - var listener2 = sinon.stub(); + let listener1 = sinon.stub(); + let listener2 = sinon.stub(); comp = new Component(); comp.events = { event1: listener1, - event2: listener2 + event2: listener2, }; comp.emit('event1'); @@ -406,17 +422,17 @@ describe('Component', function() { }); it('should detach unused events when value of the "events" state key is changed', function() { - var CustomComponent = createCustomComponentClass(); + let CustomComponent = createCustomComponentClass(); CustomComponent.prototype.listener1 = sinon.stub(); CustomComponent.prototype.listener2 = sinon.stub(); comp = new CustomComponent({ events: { - event1: 'listener1' - } + event1: 'listener1', + }, }); comp.events = { - event2: 'listener2' + event2: 'listener2', }; comp.emit('event1'); @@ -427,18 +443,20 @@ describe('Component', function() { }); }); - it('should synchronize state synchronously on render and asynchronously when state value changes', function(done) { - var CustomComponent = createCustomComponentClass(); + it('should synchronize state synchronously on render and asynchronously when state value changes', function( + done + ) { + let CustomComponent = createCustomComponentClass(); CustomComponent.STATE = { foo: { - value: 0 - } + value: 0, + }, }; CustomComponent.prototype.syncUnkown = sinon.spy(); CustomComponent.prototype.syncFoo = sinon.spy(); comp = new CustomComponent({ - foo: 10 + foo: 10, }); sinon.assert.notCalled(CustomComponent.prototype.syncUnkown); sinon.assert.callCount(CustomComponent.prototype.syncFoo, 1); @@ -460,21 +478,20 @@ describe('Component', function() { }); it('should fire sync methods for state keys defined by super classes as well', function() { - var CustomComponent = createCustomComponentClass(); + let CustomComponent = createCustomComponentClass(); CustomComponent.STATE = { foo: { - value: 0 - } + value: 0, + }, }; - class ChildComponent extends CustomComponent { - } + class ChildComponent extends CustomComponent {} ChildComponent.prototype.syncFoo = sinon.spy(); ChildComponent.prototype.syncBar = sinon.spy(); ChildComponent.STATE = { bar: { - value: 1 - } + value: 1, + }, }; comp = new ChildComponent(); @@ -482,16 +499,18 @@ describe('Component', function() { sinon.assert.callCount(comp.syncBar, 1); }); - it('should emit "stateSynced" event after state changes update the component', function(done) { - var CustomComponent = createCustomComponentClass(); + it('should emit "stateSynced" event after state changes update the component', function( + done + ) { + let CustomComponent = createCustomComponentClass(); CustomComponent.STATE = { foo: { - value: 0 - } + value: 0, + }, }; comp = new CustomComponent(); - var listener = sinon.stub(); + let listener = sinon.stub(); comp.on('stateSynced', listener); comp.foo = 1; comp.once('stateChanged', function(data) { @@ -501,19 +520,20 @@ describe('Component', function() { }); }); - it('should emit "rendered" event with "false" as the first arg when updated by the renderer', function(done) { + it('should emit "rendered" event with "false" as the first arg when updated by the renderer', function( + done + ) { class CustomRenderer extends ComponentRenderer.constructor { update(component) { component.informRendered(); } } - class TestComponent extends Component { - } + class TestComponent extends Component {} TestComponent.RENDERER = new CustomRenderer(); comp = new TestComponent(); - var listener = sinon.stub(); + let listener = sinon.stub(); comp.on('rendered', listener); comp.visible = false; @@ -525,9 +545,9 @@ describe('Component', function() { }); it('should not allow defining state key named components', function() { - var CustomComponent = createCustomComponentClass(); + let CustomComponent = createCustomComponentClass(); CustomComponent.STATE = { - components: {} + components: {}, }; assert.throws(function() { @@ -535,7 +555,9 @@ describe('Component', function() { }); }); - it('should allow changes to state in "willReceiveState" without triggering multiple renders', function(done) { + it('should allow changes to state in "willReceiveState" without triggering multiple renders', function( + done + ) { const renderStub = sinon.stub(); let count = 0; @@ -549,7 +571,7 @@ describe('Component', function() { } class TestComponent extends Component { - willReceiveState(changes) { + willReceiveState() { this.foo = 'foo' + count; count++; @@ -557,12 +579,12 @@ describe('Component', function() { } TestComponent.STATE = { bar: { - value: 'bar' + value: 'bar', }, foo: { - value: 'foo' - } + value: 'foo', + }, }; TestComponent.RENDERER = new CustomRenderer(); @@ -584,14 +606,15 @@ describe('Component', function() { }); }); - it('should pass changed state data to "willReceiveState" method', function(done) { - class TestComponent extends Component { - } + it('should pass changed state data to "willReceiveState" method', function( + done + ) { + class TestComponent extends Component {} TestComponent.prototype.willReceiveState = sinon.stub(); TestComponent.STATE = { foo: { - value: 'foo' - } + value: 'foo', + }, }; comp = new TestComponent(); @@ -604,8 +627,8 @@ describe('Component', function() { foo: { key: 'foo', newVal: 'foo2', - prevVal: 'foo' - } + prevVal: 'foo', + }, }); done(); @@ -615,13 +638,13 @@ describe('Component', function() { describe('Render', function() { it('should render component on body if no parent is specified', function() { - var CustomComponent = createCustomComponentClass(); + let CustomComponent = createCustomComponentClass(); comp = new CustomComponent(); assert.strictEqual(document.body, comp.element.parentNode); }); it('should render component on specified default parent if no parent is specified', function() { - var defaultParent = document.createElement('div'); + let defaultParent = document.createElement('div'); class CustomComponent extends Component { created() { @@ -633,20 +656,20 @@ describe('Component', function() { }); it('should render component on requested parent', function() { - var container = document.createElement('div'); + let container = document.createElement('div'); document.body.appendChild(container); - var CustomComponent = createCustomComponentClass(); + let CustomComponent = createCustomComponentClass(); comp = new CustomComponent({}, container); assert.strictEqual(container, comp.element.parentNode); }); it('should render component on requested parent selector', function() { - var container = document.createElement('div'); + let container = document.createElement('div'); container.className = 'myContainer'; document.body.appendChild(container); - var CustomComponent = createCustomComponentClass(); + let CustomComponent = createCustomComponentClass(); comp = new CustomComponent({}, '.myContainer'); assert.strictEqual(container, comp.element.parentNode); }); @@ -659,11 +682,11 @@ describe('Component', function() { } } - var container = document.createElement('div'); + let container = document.createElement('div'); comp = Component.render( CustomComponent, { - foo: 'fooValue' + foo: 'fooValue', }, container ); @@ -676,8 +699,7 @@ describe('Component', function() { }); it('should throw error when rendering non-incremental-dom component via Component.renderToString', function() { - class NotIncrementalDomComponent extends Component { - } + class NotIncrementalDomComponent extends Component {} assert.throws(function() { Component.renderToString(NotIncrementalDomComponent); }); @@ -691,11 +713,8 @@ describe('Component', function() { } } - var container = document.createElement('div'); - comp = Component.render( - CustomComponent, - container - ); + let container = document.createElement('div'); + comp = Component.render(CustomComponent, container); assert.ok(comp instanceof CustomComponent); assert.ok(comp.wasRendered); @@ -704,14 +723,14 @@ describe('Component', function() { }); it('should attach component on requested parent at specified position', function() { - var container = document.createElement('div'); - var sibling1 = document.createElement('div'); - var sibling2 = document.createElement('div'); + let container = document.createElement('div'); + let sibling1 = document.createElement('div'); + let sibling2 = document.createElement('div'); container.appendChild(sibling1); container.appendChild(sibling2); document.body.appendChild(container); - var CustomComponent = createCustomComponentClass(); + let CustomComponent = createCustomComponentClass(); comp = new CustomComponent(); comp.detach(); comp.attach(container, sibling2); @@ -722,15 +741,15 @@ describe('Component', function() { }); it('should attach component according to specified sibling selector', function() { - var container = document.createElement('div'); - var sibling1 = document.createElement('div'); - var sibling2 = document.createElement('div'); + let container = document.createElement('div'); + let sibling1 = document.createElement('div'); + let sibling2 = document.createElement('div'); sibling2.className = 'mySibling'; container.appendChild(sibling1); container.appendChild(sibling2); document.body.appendChild(container); - var CustomComponent = createCustomComponentClass(); + let CustomComponent = createCustomComponentClass(); comp = new CustomComponent(); comp.detach(); comp.attach(container, '.mySibling'); @@ -743,7 +762,7 @@ describe('Component', function() { describe('Updates', function() { it('should call renderer\'s update method if state changes', function(done) { - var CustomComponent = createCustomComponentClass(); + let CustomComponent = createCustomComponentClass(); comp = new CustomComponent(); const renderer = comp.getRenderer(); sinon.spy(renderer, 'update'); @@ -755,8 +774,10 @@ describe('Component', function() { }); }); - it('should not call renderer\'s update method if state changes before render', function(done) { - var CustomComponent = createCustomComponentClass(); + it('should not call renderer\'s update method if state changes before render', function( + done + ) { + let CustomComponent = createCustomComponentClass(); comp = new CustomComponent({}, false); const renderer = comp.getRenderer(); sinon.spy(renderer, 'update'); @@ -768,8 +789,10 @@ describe('Component', function() { }); }); - it('should not call renderer\'s update method if state changes while skipping updates', function(done) { - var CustomComponent = createCustomComponentClass(); + it('should not call renderer\'s update method if state changes while skipping updates', function( + done + ) { + let CustomComponent = createCustomComponentClass(); comp = new CustomComponent(); const renderer = comp.getRenderer(); sinon.spy(renderer, 'update'); @@ -802,15 +825,17 @@ describe('Component', function() { visible: { key: 'visible', prevVal: true, - newVal: false - } + newVal: false, + }, }; assert.strictEqual(1, renderer.update.callCount); assert.strictEqual(comp, renderer.update.args[0][0]); assert.deepEqual(expectedData, renderer.update.args[0][1].changes); }); - it('should not call the renderer\'s update method asynchronously if state changes', function(done) { + it('should not call the renderer\'s update method asynchronously if state changes', function( + done + ) { const CustomComponent = createCustomComponentClass(); CustomComponent.SYNC_UPDATES = true; @@ -839,10 +864,10 @@ describe('Component', function() { }); it('should invoke the "forceUpdate" callback argument after the rerender has completed', function() { - var CustomComponent = createCustomComponentClass(); + let CustomComponent = createCustomComponentClass(); comp = new CustomComponent(); - var listener = sinon.stub(); + let listener = sinon.stub(); comp.forceUpdate(listener); @@ -862,9 +887,9 @@ describe('Component', function() { it('should listen to events on the element through Component\'s "on" function', function() { comp = new Component(); - var element = comp.element; + let element = comp.element; element.onclick = null; - var listener = sinon.stub(); + let listener = sinon.stub(); comp.on('click', listener); dom.triggerEvent(element, 'click'); @@ -876,11 +901,13 @@ describe('Component', function() { }); it('should listen to delegate events on the element', function() { - var CustomComponent = createCustomComponentClass('
'); + let CustomComponent = createCustomComponentClass( + '
' + ); comp = new CustomComponent(); - var fooElement = comp.element.querySelector('.foo'); - var listener = sinon.stub(); + let fooElement = comp.element.querySelector('.foo'); + let listener = sinon.stub(); comp.delegate('click', '.foo', listener); dom.triggerEvent(fooElement, 'click'); @@ -892,23 +919,26 @@ describe('Component', function() { }); it('should listen to custom events on the element', function() { - var CustomComponent = createCustomComponentClass(); + let CustomComponent = createCustomComponentClass(); comp = new CustomComponent(); - var listener = sinon.stub(); + let listener = sinon.stub(); comp.on('transitionend', listener); - dom.triggerEvent(comp.element, features.checkAnimationEventName().transition); + dom.triggerEvent( + comp.element, + features.checkAnimationEventName().transition + ); assert.strictEqual(1, listener.callCount); }); it('should transfer events listened through "on" function to new element', function() { comp = new Component(); - var element = comp.element; - var listener = sinon.stub(); + let element = comp.element; + let listener = sinon.stub(); comp.on('click', listener); - var newElement = document.createElement('div'); + let newElement = document.createElement('div'); dom.enterDocument(newElement); comp.element = newElement; @@ -924,14 +954,16 @@ describe('Component', function() { }); it('should transfer delegate events listened on the component to the new element', function() { - var CustomComponent = createCustomComponentClass('
'); + let CustomComponent = createCustomComponentClass( + '
' + ); comp = new CustomComponent(); - var fooElement = comp.element.querySelector('.foo'); - var listener = sinon.stub(); + let fooElement = comp.element.querySelector('.foo'); + let listener = sinon.stub(); comp.delegate('click', '.foo', listener); - var newElement = document.createElement('div'); + let newElement = document.createElement('div'); dom.enterDocument(newElement); comp.element = newElement; dom.append(newElement, '
'); @@ -939,7 +971,7 @@ describe('Component', function() { dom.triggerEvent(fooElement, 'click'); assert.strictEqual(0, listener.callCount); - var newFooElement = newElement.querySelector('.foo'); + let newFooElement = newElement.querySelector('.foo'); dom.triggerEvent(newFooElement, 'click'); assert.strictEqual(1, listener.callCount); @@ -950,7 +982,7 @@ describe('Component', function() { it('should not reattach element listeners if its set to itself again', function() { comp = new Component(); - var listener = sinon.stub(); + let listener = sinon.stub(); comp.on('click', listener); comp.element.removeEventListener = sinon.stub(); @@ -961,10 +993,10 @@ describe('Component', function() { it('should listen to events on the element even before it\'s created', function() { comp = new Component({}, false); - var listener = sinon.stub(); + let listener = sinon.stub(); comp.on('click', listener); - var element = document.createElement('div'); + let element = document.createElement('div'); dom.enterDocument(element); comp.element = element; dom.triggerEvent(element, 'click'); @@ -973,10 +1005,10 @@ describe('Component', function() { it('should listen to delegate events on the element even before it\'s created', function() { comp = new Component({}, false); - var listener = sinon.stub(); + let listener = sinon.stub(); comp.delegate('click', '.foo', listener); - var element = document.createElement('div'); + let element = document.createElement('div'); dom.enterDocument(element); dom.append(element, '
'); comp.element = element; @@ -987,11 +1019,11 @@ describe('Component', function() { it('should not reatach element listeners that were detached when element changes', function() { comp = new Component(); - var listener = sinon.stub(); - var handle = comp.on('click', listener); + let listener = sinon.stub(); + let handle = comp.on('click', listener); handle.removeListener(); - var newElement = document.createElement('div'); + let newElement = document.createElement('div'); comp.element = newElement; dom.triggerEvent(newElement, 'click'); @@ -999,14 +1031,16 @@ describe('Component', function() { }); it('should not reatach delegate listeners that were detached when element changes', function() { - var CustomComponent = createCustomComponentClass('
'); + let CustomComponent = createCustomComponentClass( + '
' + ); comp = new CustomComponent(); - var listener = sinon.stub(); - var handle = comp.delegate('click', '.foo', listener); + let listener = sinon.stub(); + let handle = comp.delegate('click', '.foo', listener); handle.removeListener(); - var newElement = document.createElement('div'); + let newElement = document.createElement('div'); comp.element = newElement; dom.append(newElement, '
'); @@ -1015,11 +1049,11 @@ describe('Component', function() { }); it('should be able to detach element listener that was attached before element changed', function() { - var comp = new Component(); - var listener = sinon.stub(); - var handle = comp.on('click', listener); + let comp = new Component(); + let listener = sinon.stub(); + let handle = comp.on('click', listener); - var newElement = document.createElement('div'); + let newElement = document.createElement('div'); comp.element = newElement; handle.removeListener(); @@ -1028,13 +1062,15 @@ describe('Component', function() { }); it('should be able to detach delegate listener that was attached before element changed', function() { - var CustomComponent = createCustomComponentClass('
'); + let CustomComponent = createCustomComponentClass( + '
' + ); comp = new CustomComponent(); - var listener = sinon.stub(); - var handle = comp.delegate('click', '.foo', listener); + let listener = sinon.stub(); + let handle = comp.delegate('click', '.foo', listener); - var newElement = document.createElement('div'); + let newElement = document.createElement('div'); comp.element = newElement; dom.append(newElement, '
'); @@ -1056,50 +1092,44 @@ describe('Component', function() { }); it('should warn if validator fails on initial value', function() { - class TestComponent extends Component { - } + class TestComponent extends Component {} TestComponent.STATE = { foo: { - validator: validators.string - } + validator: validators.string, + }, }; comp = new TestComponent({ - foo: 10 + foo: 10, }); assert.strictEqual(1, console.error.callCount); }); }); it('should get the renderer instance', function() { - class TestComponent extends Component { - } + class TestComponent extends Component {} comp = new TestComponent(); - var renderer = comp.getRenderer(); + let renderer = comp.getRenderer(); assert.ok(renderer instanceof ComponentRenderer.constructor); }); it('should get the data manager', function() { - class TestComponent extends Component { - } + class TestComponent extends Component {} comp = new TestComponent(); assert.strictEqual(ComponentDataManager, comp.getDataManager()); }); it('should check if the given function is a component constructor', function() { - class TestComponent extends Component { - } + class TestComponent extends Component {} assert.ok(Component.isComponentCtor(Component)); assert.ok(Component.isComponentCtor(TestComponent)); - assert.ok(!Component.isComponentCtor(() => { - })); - var fn = () => { - }; - assert.ok(!Component.isComponentCtor(fn.bind(this))); + assert.ok(!Component.isComponentCtor(() => {})); + let fn = () => {}; + assert.ok(!Component.isComponentCtor(fn.bind(this))); // eslint-disable-line }); it('should pass instance of component to __METAL_DEV_TOOLS_HOOK__ on first render', function() { - var hookStub = sinon.stub(); + let hookStub = sinon.stub(); window.__METAL_DEV_TOOLS_HOOK__ = hookStub; class CustomComponent extends Component { constructor(...args) { @@ -1122,21 +1152,20 @@ describe('Component', function() { sinon.assert.calledWith(hookStub, comp); }); - function createCustomComponentClass(opt_rendererContentOrFn) { - class CustomComponent extends Component { - } - CustomComponent.RENDERER = createCustomRenderer(opt_rendererContentOrFn); + function createCustomComponentClass(rendererContentOrFn) { + class CustomComponent extends Component {} + CustomComponent.RENDERER = createCustomRenderer(rendererContentOrFn); return CustomComponent; } - function createCustomRenderer(opt_rendererContentOrFn) { + function createCustomRenderer(rendererContentOrFn) { class CustomRenderer extends ComponentRenderer.constructor { render(component) { super.render(component); - if (core.isFunction(opt_rendererContentOrFn)) { - opt_rendererContentOrFn(); + if (core.isFunction(rendererContentOrFn)) { + rendererContentOrFn(); } else { - component.element.innerHTML = opt_rendererContentOrFn; + component.element.innerHTML = rendererContentOrFn; } } } diff --git a/packages/metal-component/test/ComponentDataManager.js b/packages/metal-component/test/ComponentDataManager.js index d770fcb4..76cd03c9 100644 --- a/packages/metal-component/test/ComponentDataManager.js +++ b/packages/metal-component/test/ComponentDataManager.js @@ -25,31 +25,30 @@ describe('ComponentDataManager', function() { it('should add the specified properties to the given component', function() { ComponentDataManager.setUp(component, { foo: { - value: 'fooValue' - } + value: 'fooValue', + }, }); assert.strictEqual('fooValue', component.foo); }); it('should use component\'s config as initial state values', function() { initialConfig = { - foo: 'initialFoo' + foo: 'initialFoo', }; ComponentDataManager.setUp(component, { - foo: { - } + foo: {}, }); assert.strictEqual('initialFoo', component.foo); }); it('should use default state value when "undefined" is passed as initial value', function() { initialConfig = { - foo: undefined + foo: undefined, }; ComponentDataManager.setUp(component, { foo: { - value: 'defaultFoo' - } + value: 'defaultFoo', + }, }); assert.strictEqual(component.foo, 'defaultFoo'); @@ -58,8 +57,7 @@ describe('ComponentDataManager', function() { it('should throw error if attempting to add state property named "element"', function() { assert.throws(() => { ComponentDataManager.setUp(component, { - element: { - } + element: {}, }); }); }); @@ -67,8 +65,8 @@ describe('ComponentDataManager', function() { it('should add the state properties defined in STATE to the given component', function() { component.constructor.STATE = { foo: { - value: 'fooValue' - } + value: 'fooValue', + }, }; ComponentDataManager.setUp(component, {}); assert.strictEqual('fooValue', component.foo); @@ -78,25 +76,25 @@ describe('ComponentDataManager', function() { component.constructor.STATE = { bar: { internal: true, - value: 'initialBar' + value: 'initialBar', }, foo: { - value: 'initialFoo' + value: 'initialFoo', }, foo2: { - value: 'initialFoo2' - } + value: 'initialFoo2', + }, }; initialConfig = { bar: 'bar', foo: 'foo', - foo2: 'foo2' + foo2: 'foo2', }; ComponentDataManager.setUp(component, {}); ComponentDataManager.replaceNonInternal(component, { - foo: 'newFoo' + foo: 'newFoo', }); assert.strictEqual('newFoo', component.foo); assert.strictEqual('initialFoo2', component.foo2); @@ -105,18 +103,20 @@ describe('ComponentDataManager', function() { it('should return state instance', function() { ComponentDataManager.setUp(component, {}); - assert.ok(ComponentDataManager.getStateInstance(component) instanceof State); + assert.ok( + ComponentDataManager.getStateInstance(component) instanceof State + ); }); it('should return an object with state properties', function() { ComponentDataManager.setUp(component, { foo: { - value: 'fooValue' - } + value: 'fooValue', + }, }); - var expected = { - foo: 'fooValue' + let expected = { + foo: 'fooValue', }; assert.deepEqual(expected, ComponentDataManager.getState(component)); }); @@ -124,8 +124,8 @@ describe('ComponentDataManager', function() { it('should return list of state keys', function() { ComponentDataManager.setUp(component, { foo: { - value: 'fooValue' - } + value: 'fooValue', + }, }); assert.deepEqual(['foo'], ComponentDataManager.getStateKeys(component)); }); @@ -133,8 +133,8 @@ describe('ComponentDataManager', function() { it('should return list of sync keys', function() { ComponentDataManager.setUp(component, { foo: { - value: 'fooValue' - } + value: 'fooValue', + }, }); assert.deepEqual(['foo'], ComponentDataManager.getSyncKeys(component)); }); @@ -142,8 +142,8 @@ describe('ComponentDataManager', function() { it('should get value from state key', function() { ComponentDataManager.setUp(component, { foo: { - value: 'fooValue' - } + value: 'fooValue', + }, }); assert.strictEqual('fooValue', ComponentDataManager.get(component, 'foo')); }); @@ -151,12 +151,12 @@ describe('ComponentDataManager', function() { it('should set value for state key', function() { ComponentDataManager.setUp(component, { foo: { - value: 'fooValue' - } + value: 'fooValue', + }, }); ComponentDataManager.setState(component, { - foo: 'fooValue2' + foo: 'fooValue2', }); assert.strictEqual('fooValue2', component.foo); }); @@ -164,11 +164,11 @@ describe('ComponentDataManager', function() { it('should emit events from state on component', function() { ComponentDataManager.setUp(component, { foo: { - value: 'fooValue' - } + value: 'fooValue', + }, }); - var listener = sinon.stub(); + let listener = sinon.stub(); component.on('fooChanged', listener); component.foo = 'fooValue2'; diff --git a/packages/metal-component/test/ComponentRegistry.js b/packages/metal-component/test/ComponentRegistry.js index b17646e9..b0b1caa4 100644 --- a/packages/metal-component/test/ComponentRegistry.js +++ b/packages/metal-component/test/ComponentRegistry.js @@ -3,7 +3,7 @@ import ComponentRegistry from '../src/ComponentRegistry'; describe('ComponentRegistry', function() { - var originalConsoleFn = console.error; + let originalConsoleFn = console.error; beforeEach(function() { console.error = sinon.stub(); @@ -23,52 +23,60 @@ describe('ComponentRegistry', function() { }); it('should return constructor of registered components', function() { - class MyComponent1 { - } - class MyComponent2 { - } + class MyComponent1 {} + class MyComponent2 {} ComponentRegistry.register(MyComponent1, 'MyComponent1'); ComponentRegistry.register(MyComponent2, 'MyComponent2'); - assert.strictEqual(MyComponent1, ComponentRegistry.getConstructor('MyComponent1')); - assert.strictEqual(MyComponent2, ComponentRegistry.getConstructor('MyComponent2')); + assert.strictEqual( + MyComponent1, + ComponentRegistry.getConstructor('MyComponent1') + ); + assert.strictEqual( + MyComponent2, + ComponentRegistry.getConstructor('MyComponent2') + ); }); it('should set NAME static property of registered components', function() { - class MyComponent { - } + class MyComponent {} ComponentRegistry.register(MyComponent, 'MyName'); assert.strictEqual('MyName', MyComponent.NAME); }); it('should use NAME static property if no name is passed to ComponentRegistry.register', function() { - class MyComponent { - } + class MyComponent {} MyComponent.NAME = 'StaticName'; ComponentRegistry.register(MyComponent); - assert.strictEqual(MyComponent, ComponentRegistry.getConstructor('StaticName')); + assert.strictEqual( + MyComponent, + ComponentRegistry.getConstructor('StaticName') + ); }); it('should use function name if no name is passed to ComponentRegistry.register', function() { - class MyComponent { - } + class MyComponent {} ComponentRegistry.register(MyComponent); assert.strictEqual('MyComponent', MyComponent.NAME); - assert.strictEqual(MyComponent, ComponentRegistry.getConstructor('MyComponent')); + assert.strictEqual( + MyComponent, + ComponentRegistry.getConstructor('MyComponent') + ); }); it('should use function name if NAME is only set on super class and no name is passed to ComponentRegistry.register', function() { - class SuperComponent { - } + class SuperComponent {} SuperComponent.NAME = 'SuperComponent'; - class MyComponent extends SuperComponent { - } + class MyComponent extends SuperComponent {} ComponentRegistry.register(MyComponent); assert.strictEqual('MyComponent', MyComponent.NAME); - assert.strictEqual(MyComponent, ComponentRegistry.getConstructor('MyComponent')); + assert.strictEqual( + MyComponent, + ComponentRegistry.getConstructor('MyComponent') + ); }); }); diff --git a/packages/metal-component/test/ComponentRenderer.js b/packages/metal-component/test/ComponentRenderer.js index e813fb08..06832bb6 100644 --- a/packages/metal-component/test/ComponentRenderer.js +++ b/packages/metal-component/test/ComponentRenderer.js @@ -1,6 +1,6 @@ 'use strict'; -import { isElement, isFunction } from 'metal'; +import {isElement, isFunction} from 'metal'; import ComponentRenderer from '../src/ComponentRenderer'; describe('ComponentRenderer', function() { @@ -8,7 +8,7 @@ describe('ComponentRenderer', function() { beforeEach(function() { componentStub = { - informRendered: sinon.stub() + informRendered: sinon.stub(), }; }); @@ -24,7 +24,10 @@ describe('ComponentRenderer', function() { }); it('should return nothing by default from getExtraDataConfig', function() { - assert.equal(undefined, ComponentRenderer.getExtraDataConfig(componentStub)); + assert.equal( + undefined, + ComponentRenderer.getExtraDataConfig(componentStub) + ); }); it('should have a function called "update"', function() { diff --git a/packages/metal-component/test/events/events.js b/packages/metal-component/test/events/events.js index b0d85e81..ff10e7cc 100644 --- a/packages/metal-component/test/events/events.js +++ b/packages/metal-component/test/events/events.js @@ -1,7 +1,7 @@ 'use strict'; -import { addListenersFromObj, getComponentFn } from '../../src/events/events'; -import { append, triggerEvent } from 'metal-dom'; +import {addListenersFromObj, getComponentFn} from '../../src/events/events'; +import {append, triggerEvent} from 'metal-dom'; import Component from '../../src/Component'; describe('events', function() { @@ -22,13 +22,13 @@ describe('events', function() { describe('addListenersFromObj', function() { it('should attach events to specified functions', function() { - var listener1 = sinon.stub(); - var listener2 = sinon.stub(); + let listener1 = sinon.stub(); + let listener2 = sinon.stub(); comp = new Component(); addListenersFromObj(comp, { event1: listener1, - event2: listener2 + event2: listener2, }); comp.emit('event1'); @@ -41,13 +41,12 @@ describe('events', function() { }); it('should attach events to specified function names', function() { - class CustomComponent extends Component { - } + class CustomComponent extends Component {} CustomComponent.prototype.listener = sinon.stub(); comp = new CustomComponent(); addListenersFromObj(comp, { - event1: 'listener' + event1: 'listener', }); comp.emit('event1'); @@ -57,15 +56,14 @@ describe('events', function() { it('should warn if trying to attach event to unexisting function name', function() { comp = new Component(); addListenersFromObj(comp, { - event1: 'listener' + event1: 'listener', }); assert.strictEqual(1, console.error.callCount); }); it('should attach delegate events with specified selector', function() { - class CustomComponent extends Component { - } + class CustomComponent extends Component {} CustomComponent.prototype.listener = sinon.stub(); comp = new CustomComponent(); @@ -73,8 +71,8 @@ describe('events', function() { addListenersFromObj(comp, { click: { fn: 'listener', - selector: '.testButton' - } + selector: '.testButton', + }, }); triggerEvent(comp.element, 'click'); diff --git a/packages/metal-component/test/sync/sync.js b/packages/metal-component/test/sync/sync.js index 34319012..2b81f8c4 100644 --- a/packages/metal-component/test/sync/sync.js +++ b/packages/metal-component/test/sync/sync.js @@ -1,7 +1,7 @@ 'use strict'; import Component from '../../src/Component'; -import { syncState } from '../../src/sync/sync'; +import {syncState} from '../../src/sync/sync'; describe('sync', function() { let comp; @@ -13,15 +13,14 @@ describe('sync', function() { }); it('should call all "sync" methods on component', function() { - class TestComponent extends Component { - } + class TestComponent extends Component {} TestComponent.STATE = { bar: { - value: 'bar' + value: 'bar', }, foo: { - value: 'foo' - } + value: 'foo', + }, }; TestComponent.prototype.syncBar = sinon.stub(); TestComponent.prototype.syncFoo = sinon.stub(); @@ -37,15 +36,14 @@ describe('sync', function() { }); it('should call "sync" method for properties defined in changes object', function() { - class TestComponent extends Component { - } + class TestComponent extends Component {} TestComponent.STATE = { bar: { - value: 'bar' + value: 'bar', }, foo: { - value: 'foo' - } + value: 'foo', + }, }; TestComponent.prototype.syncBar = sinon.stub(); TestComponent.prototype.syncFoo = sinon.stub(); @@ -54,8 +52,8 @@ describe('sync', function() { syncState(comp, { foo: { newVal: 'newFoo', - prevVal: 'prevFoo' - } + prevVal: 'prevFoo', + }, }); assert.equal(0, comp.syncBar.callCount); assert.equal(1, comp.syncFoo.callCount); @@ -71,8 +69,8 @@ describe('sync', function() { } TestComponent.STATE = { foo: { - value: 'foo' - } + value: 'foo', + }, }; comp = new TestComponent({}, false); diff --git a/packages/metal-dom/README.md b/packages/metal-dom/README.md index 16e7c0e8..14d3bc85 100644 --- a/packages/metal-dom/README.md +++ b/packages/metal-dom/README.md @@ -1,3 +1,5 @@ # metal-dom A collection of utility functions for handling dom elements. + +See [https://metaljs.com/](https://metaljs.com/) for documentation. diff --git a/packages/metal-dom/package-lock.json b/packages/metal-dom/package-lock.json index f9c637f5..7e4c66d6 100644 --- a/packages/metal-dom/package-lock.json +++ b/packages/metal-dom/package-lock.json @@ -64,7 +64,7 @@ "lodash": "4.17.4", "minimatch": "3.0.4", "path-is-absolute": "1.0.1", - "private": "0.1.7", + "private": "0.1.8", "slash": "1.0.0", "source-map": "0.5.7" } @@ -507,9 +507,9 @@ } }, "babel-preset-env": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.6.0.tgz", - "integrity": "sha512-OVgtQRuOZKckrILgMA5rvctvFZPv72Gua9Rt006AiPoB0DJKGN07UmaQA+qRrYgK71MVct8fFhT0EyNWYorVew==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.6.1.tgz", + "integrity": "sha512-W6VIyA6Ch9ePMI7VptNn2wBM6dbG0eSz25HEiL40nQXCsXGTGZSTZu1Iap+cj3Q0S5a7T9+529l/5Bkvd+afNA==", "requires": { "babel-plugin-check-es2015-constants": "6.22.0", "babel-plugin-syntax-trailing-function-commas": "6.22.0", @@ -538,7 +538,7 @@ "babel-plugin-transform-es2015-unicode-regex": "6.24.1", "babel-plugin-transform-exponentiation-operator": "6.24.1", "babel-plugin-transform-regenerator": "6.26.0", - "browserslist": "2.5.1", + "browserslist": "2.8.0", "invariant": "2.2.2", "semver": "5.4.1" } @@ -625,18 +625,18 @@ } }, "browserslist": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-2.5.1.tgz", - "integrity": "sha512-jAvM2ku7YDJ+leAq3bFH1DE0Ylw+F+EQDq4GkqZfgPEqpWYw9ofQH85uKSB9r3Tv7XDbfqVtE+sdvKJW7IlPJA==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-2.8.0.tgz", + "integrity": "sha512-iiWHM1Et6Q4TQpB7Ar6pxuM3TNMXasVJY4Y/oh3q38EwR3Z+IdZ9MyVf7PI4MJFB4xpwMcZgs9bEUnPG2E3TCA==", "requires": { - "caniuse-lite": "1.0.30000746", - "electron-to-chromium": "1.3.25" + "caniuse-lite": "1.0.30000760", + "electron-to-chromium": "1.3.27" } }, "caniuse-lite": { - "version": "1.0.30000746", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000746.tgz", - "integrity": "sha1-xk+Vo5Jc/TAgejCO12wa6W6gnqA=" + "version": "1.0.30000760", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000760.tgz", + "integrity": "sha1-7HIDlXQvHH7IlH/W3SYE53qPmP8=" }, "chalk": { "version": "1.1.3", @@ -687,9 +687,9 @@ } }, "electron-to-chromium": { - "version": "1.3.25", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.25.tgz", - "integrity": "sha1-RTshAJg20Jl9hgNWAf9srkeRxGA=" + "version": "1.3.27", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.27.tgz", + "integrity": "sha1-eOy4o5kGYYe7N07t412ccFZagD0=" }, "escape-string-regexp": { "version": "1.0.5", @@ -879,9 +879,9 @@ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "private": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/private/-/private-0.1.7.tgz", - "integrity": "sha1-aM5eih7woju1cMwoU3tTMqumPvE=" + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", + "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==" }, "regenerate": { "version": "1.3.3", @@ -900,7 +900,7 @@ "requires": { "babel-runtime": "6.26.0", "babel-types": "6.26.0", - "private": "0.1.7" + "private": "0.1.8" } }, "regexpu-core": { diff --git a/packages/metal-dom/src/DomDelegatedEventHandle.js b/packages/metal-dom/src/DomDelegatedEventHandle.js index 563e8fde..b95fb22e 100644 --- a/packages/metal-dom/src/DomDelegatedEventHandle.js +++ b/packages/metal-dom/src/DomDelegatedEventHandle.js @@ -1,8 +1,8 @@ 'use strict'; -import { array, isString } from 'metal'; +import {array, isString} from 'metal'; import domData from './domData'; -import { EventHandle } from 'metal-events'; +import {EventHandle} from 'metal-events'; /** * This is a special EventHandle, that is responsible for dom delegated events @@ -15,13 +15,13 @@ class DomDelegatedEventHandle extends EventHandle { * @param {!Event} emitter Element the event was subscribed to. * @param {string} event The name of the event that was subscribed to. * @param {!Function} listener The listener subscribed to the event. - * @param {string=} opt_selector An optional selector used when delegating + * @param {string=} selector An optional selector used when delegating * the event. * @constructor */ - constructor(emitter, event, listener, opt_selector) { + constructor(emitter, event, listener, selector) { super(emitter, event, listener); - this.selector_ = opt_selector; + this.selector_ = selector; } /** @@ -31,7 +31,9 @@ class DomDelegatedEventHandle extends EventHandle { const delegating = domData.get(this.emitter_, 'delegating', {}); const listeners = domData.get(this.emitter_, 'listeners', {}); const selector = this.selector_; - const arr = isString(selector) ? delegating[this.event_].selectors : listeners; + const arr = isString(selector) + ? delegating[this.event_].selectors + : listeners; const key = isString(selector) ? selector : this.event_; array.remove(arr[key] || [], this.listener_); diff --git a/packages/metal-dom/src/DomEventEmitterProxy.js b/packages/metal-dom/src/DomEventEmitterProxy.js index 3fd44e9c..ebdb4d8b 100644 --- a/packages/metal-dom/src/DomEventEmitterProxy.js +++ b/packages/metal-dom/src/DomEventEmitterProxy.js @@ -1,7 +1,7 @@ 'use strict'; -import { delegate, on, supportsEvent } from './dom'; -import { EventEmitterProxy } from 'metal-events'; +import {delegate, on, supportsEvent} from './dom'; +import {EventEmitterProxy} from 'metal-events'; /** * DomEventEmitterProxy utility. It extends `EventEmitterProxy` to also accept @@ -23,7 +23,12 @@ class DomEventEmitterProxy extends EventEmitterProxy { const index = event.indexOf(':', 9); const eventName = event.substring(9, index); const selector = event.substring(index + 1); - return delegate(this.originEmitter_, eventName, selector, listener); + return delegate( + this.originEmitter_, + eventName, + selector, + listener + ); // eslint-disable-line } else { return on(this.originEmitter_, event, listener); } @@ -46,13 +51,16 @@ class DomEventEmitterProxy extends EventEmitterProxy { * Checks if the given event is supported by the origin element. * @param {string} event * @protected + * @return {boolean} */ isSupportedDomEvent_(event) { if (!this.originEmitter_ || !this.originEmitter_.addEventListener) { return true; } - return (this.isDelegateEvent_(event) && event.indexOf(':', 9) !== -1) || - supportsEvent(this.originEmitter_, event); + return ( + (this.isDelegateEvent_(event) && event.indexOf(':', 9) !== -1) || + supportsEvent(this.originEmitter_, event) + ); } /** @@ -63,7 +71,9 @@ class DomEventEmitterProxy extends EventEmitterProxy { * @override */ shouldProxyEvent_(event) { - return super.shouldProxyEvent_(event) && this.isSupportedDomEvent_(event); + return ( + super.shouldProxyEvent_(event) && this.isSupportedDomEvent_(event) + ); // eslint-disable-line } } diff --git a/packages/metal-dom/src/DomEventHandle.js b/packages/metal-dom/src/DomEventHandle.js index 6bc26939..7a7da2a7 100644 --- a/packages/metal-dom/src/DomEventHandle.js +++ b/packages/metal-dom/src/DomEventHandle.js @@ -1,6 +1,6 @@ 'use strict'; -import { EventHandle } from 'metal-events'; +import {EventHandle} from 'metal-events'; /** * This is a special EventHandle, that is responsible for dom events, instead @@ -13,20 +13,24 @@ class DomEventHandle extends EventHandle { * @param {!EventEmitter} emitter Emitter the event was subscribed to. * @param {string} event The name of the event that was subscribed to. * @param {!Function} listener The listener subscribed to the event. - * @param {boolean} opt_capture Flag indicating if listener should be triggered + * @param {boolean} capture Flag indicating if listener should be triggered * during capture phase, instead of during the bubbling phase. Defaults to false. * @constructor */ - constructor(emitter, event, listener, opt_capture) { + constructor(emitter, event, listener, capture) { super(emitter, event, listener); - this.capture_ = opt_capture; + this.capture_ = capture; } /** * @inheritDoc */ removeListener() { - this.emitter_.removeEventListener(this.event_, this.listener_, this.capture_); + this.emitter_.removeEventListener( + this.event_, + this.listener_, + this.capture_ + ); } } diff --git a/packages/metal-dom/src/all/dom.js b/packages/metal-dom/src/all/dom.js index d6c6728f..bb3dd17e 100644 --- a/packages/metal-dom/src/all/dom.js +++ b/packages/metal-dom/src/all/dom.js @@ -10,5 +10,12 @@ import globalEvalStyles from '../globalEvalStyles'; import '../events'; export * from '../dom'; -export { domData, DomEventEmitterProxy, DomEventHandle, features, globalEval, globalEvalStyles }; +export { + domData, + DomEventEmitterProxy, + DomEventHandle, + features, + globalEval, + globalEvalStyles, +}; export default dom; diff --git a/packages/metal-dom/src/dom.js b/packages/metal-dom/src/dom.js index a16e4d21..b8949917 100644 --- a/packages/metal-dom/src/dom.js +++ b/packages/metal-dom/src/dom.js @@ -7,5 +7,5 @@ import * as dom from './domNamed'; export default dom; -export { dom }; +export {dom}; export * from './domNamed'; diff --git a/packages/metal-dom/src/domData.js b/packages/metal-dom/src/domData.js index 34f2df43..c25800ca 100644 --- a/packages/metal-dom/src/domData.js +++ b/packages/metal-dom/src/domData.js @@ -1,27 +1,32 @@ 'use strict'; +import {isDef} from 'metal'; + const METAL_DATA = '__metal_data__'; +/** + * Set of utilities for dom data operations + */ class domData { /** * Gets Metal.js's data for the given element. * @param {!Element} element - * @param {string=} opt_name Optional property from the data to be returned. - * @param {*} opt_initialVal Optinal value to the set the requested property + * @param {string=} name Optional property from the data to be returned. + * @param {*=} initialValue Optional value to the set the requested property * to if it doesn't exist yet in the data. * @return {!Object} */ - static get(element, opt_name, opt_initialVal) { + static get(element, name, initialValue) { if (!element[METAL_DATA]) { element[METAL_DATA] = {}; } - if (!opt_name) { + if (!name) { return element[METAL_DATA]; } - if (!element[METAL_DATA][opt_name] && opt_initialVal) { - element[METAL_DATA][opt_name] = opt_initialVal; + if (!isDef(element[METAL_DATA][name]) && isDef(initialValue)) { + element[METAL_DATA][name] = initialValue; } - return element[METAL_DATA][opt_name]; + return element[METAL_DATA][name]; } /** @@ -32,6 +37,24 @@ class domData { static has(element) { return !!element[METAL_DATA]; } + + /** + * Sets Metal.js's data for the given element. + * @param {!Element} element + * @param {string=} name Property from the data to be set. + * @param {*=} value Value to be set on the element. + * @return {!Object|*} + */ + static set(element, name, value) { + if (!element[METAL_DATA]) { + element[METAL_DATA] = {}; + } + if (!name || !isDef(value)) { + return element[METAL_DATA]; + } + element[METAL_DATA][name] = value; + return element[METAL_DATA][name]; + } } export default domData; diff --git a/packages/metal-dom/src/domNamed.js b/packages/metal-dom/src/domNamed.js index 5e79d686..63e03434 100644 --- a/packages/metal-dom/src/domNamed.js +++ b/packages/metal-dom/src/domNamed.js @@ -1,6 +1,15 @@ 'use strict'; -import { isDef, isDefAndNotNull, isDocument, isDocumentFragment, isElement, isObject, isString, object } from 'metal'; +import { + isDef, + isDefAndNotNull, + isDocument, + isDocumentFragment, + isElement, + isObject, + isString, + object, +} from 'metal'; import domData from './domData'; import DomDelegatedEventHandle from './DomDelegatedEventHandle'; import DomEventHandle from './DomEventHandle'; @@ -16,7 +25,7 @@ const USE_CAPTURE = { focus: true, invalid: true, load: true, - scroll: true + scroll: true, }; /** @@ -137,7 +146,7 @@ function attachDelegateEvent_(element, eventName) { handleDelegateEvent_, !!USE_CAPTURE[eventName] ), - selectors: {} + selectors: {}, }; } } @@ -221,20 +230,26 @@ export function contains(element1, element2) { * that should match the event for the listener to be triggered. * @param {!function(!Object)} callback Function to be called when the event * is triggered. It will receive the normalized event object. - * @param {boolean=} opt_default Optional flag indicating if this is a default + * @param {boolean=} defaultListener Optional flag indicating if this is a default * listener. That means that it would only be executed after all non * default listeners, and only if the event isn't prevented via * `preventDefault`. * @return {!EventHandle} Can be used to remove the listener. */ -export function delegate(element, eventName, selectorOrTarget, callback, opt_default) { +export function delegate( + element, + eventName, + selectorOrTarget, + callback, + defaultListener +) { const customConfig = customEvents[eventName]; if (customConfig && customConfig.delegate) { eventName = customConfig.originalEvent; callback = customConfig.handler.bind(customConfig, callback); } - if (opt_default) { + if (defaultListener) { // Wrap callback so we don't set property directly on it. callback = callback.bind(); callback.defaultListener_ = true; @@ -260,17 +275,25 @@ export function delegate(element, eventName, selectorOrTarget, callback, opt_def * simulating browsers behaviour, avoiding event listeners to be called by triggerEvent method. * @param {Element} node Element to be checked. * @param {string} eventName The event name. + * @param {Object=} eventObj * @private + * @return {boolean} */ -function isAbleToInteractWith_(node, eventName, opt_eventObj) { - if (opt_eventObj && eventName === 'click' && opt_eventObj.button === 2) { +function isAbleToInteractWith_(node, eventName, eventObj) { + if (eventObj && eventName === 'click' && eventObj.button === 2) { // Firefox triggers "click" events on the document for right clicks. This // causes our delegate logic to trigger it for regular elements too, which // shouldn't happen. Ignoring them here. return false; } - const matchesSelector = ['BUTTON', 'INPUT', 'SELECT', 'TEXTAREA', 'FIELDSET']; + const matchesSelector = [ + 'BUTTON', + 'INPUT', + 'SELECT', + 'TEXTAREA', + 'FIELDSET', + ]; if (eventName === 'click' && matchesSelector.indexOf(node.tagName) > -1) { return !(node.disabled || parent(node, 'fieldset[disabled]')); } @@ -283,8 +306,11 @@ function isAbleToInteractWith_(node, eventName, opt_eventObj) { * @return {boolean} Whether variable is like a NodeList. */ export function isNodeListLike(val) { - return isDefAndNotNull(val) && typeof val.length === 'number' && - typeof val.item === 'function'; + return ( + isDefAndNotNull(val) && + typeof val.length === 'number' && + typeof val.item === 'function' + ); } /** @@ -350,8 +376,9 @@ export function hasClass(element, className) { * @private */ function hasClassWithNative_(element, className) { - return className.indexOf(' ') === -1 && - element.classList.contains(className); + return ( + className.indexOf(' ') === -1 && element.classList.contains(className) + ); } /** @@ -362,8 +389,10 @@ function hasClassWithNative_(element, className) { * @private */ function hasClassWithoutNative_(element, className) { - return (` ${element.className} `).indexOf(` ${className} `) >= 0 && - className.split(' ').length === 1; + return ( + ` ${element.className} `.indexOf(` ${className} `) >= 0 && + className.split(' ').length === 1 + ); } /** @@ -387,7 +416,12 @@ export function match(element, selector) { } const p = Element.prototype; - const m = p.matches || p.webkitMatchesSelector || p.mozMatchesSelector || p.msMatchesSelector || p.oMatchesSelector; + const m = + p.matches || + p.webkitMatchesSelector || + p.mozMatchesSelector || + p.msMatchesSelector || + p.oMatchesSelector; if (m) { return m.call(element, selector); } @@ -418,6 +452,7 @@ function matchFallback_(element, selector) { * selector, or null if there is none. * @param {!Element} element * @param {?string} selector + * @return {Element|null} */ export function next(element, selector) { do { @@ -448,11 +483,11 @@ function normalizeDelegateEvent_(event) { * @param {string} eventName The name of the event to listen to. * @param {!function(!Object)} callback Function to be called when the event is * triggered. It will receive the normalized event object. - * @param {boolean} opt_capture Flag indicating if listener should be triggered + * @param {boolean} capture Flag indicating if listener should be triggered * during capture phase, instead of during the bubbling phase. Defaults to false. * @return {!DomEventHandle} Can be used to remove the listener. */ -export function on(element, eventName, callback, opt_capture) { +export function on(element, eventName, callback, capture) { if (isString(element)) { return delegate(document, eventName, element, callback); } @@ -461,8 +496,8 @@ export function on(element, eventName, callback, opt_capture) { eventName = customConfig.originalEvent; callback = customConfig.handler.bind(customConfig, callback); } - element.addEventListener(eventName, callback, opt_capture); - return new DomEventHandle(element, eventName, callback, opt_capture); + element.addEventListener(eventName, callback, capture); + return new DomEventHandle(element, eventName, callback, capture); } /** @@ -478,7 +513,7 @@ export function on(element, eventName, callback, opt_capture) { export function once(element, eventName, callback) { const domEventHandle = on(element, eventName, function() { domEventHandle.removeListener(); - return callback.apply(this, arguments); + return callback.apply(this, arguments); // eslint-disable-line }); return domEventHandle; } @@ -494,6 +529,34 @@ export function parent(element, selector) { return closest(element.parentNode, selector); } +/** + * Inserts a node before first child of the parent. If child is a HTML string + * it will be converted to document fragment before prepending it to the parent. + * @param {!Element} parent The node to prepend to. + * @param {!(Element|NodeList|string)} child The thing to prepend to the parent. + * @return {!Element} The prepended child. + */ +export function prepend(parent, child) { + if (isString(child)) { + child = buildFragment(child); + } + + if (!isNodeListLike(child) && !isDefAndNotNull(parent.firstChild)) { + return append(parent, child); + } + + if (isNodeListLike(child)) { + const childArr = Array.prototype.slice.call(child); + for (let i = childArr.length - 1; i >= 0; i--) { + parent.insertBefore(childArr[i], parent.firstChild); + } + } else { + parent.insertBefore(child, parent.firstChild); + } + + return child; +} + /** * Registers a custom event. * @param {string} eventName The name of the custom event. @@ -631,7 +694,7 @@ export function supportsEvent(element, eventName) { /** * This triggers all default matched delegated listeners of a given event type. - * @param {!Array} defaultFns Array to collect default listeners in, instead + * @param {!Array} defFns Array to collect default listeners in, instead * @param {!Event} event * @return {boolean} False if at least one of the triggered callbacks returns * false, or true otherwise. @@ -668,7 +731,12 @@ function triggerDelegatedListeners_(container, event, defaultFns) { if (isAbleToInteractWith_(currElement, event.type, event)) { event.delegateTarget = currElement; ret &= triggerElementListeners_(currElement, event, defaultFns); - ret &= triggerSelectorListeners_(container, currElement, event, defaultFns); + ret &= triggerSelectorListeners_( + container, + currElement, + event, + defaultFns + ); } currElement = currElement.parentNode; } @@ -684,10 +752,17 @@ function triggerDelegatedListeners_(container, event, defaultFns) { * @return {Element} The converted element, or null if none was found. */ export function toElement(selectorOrElement) { - if (isElement(selectorOrElement) || isDocument(selectorOrElement) || isDocumentFragment(selectorOrElement)) { + if ( + isElement(selectorOrElement) || + isDocument(selectorOrElement) || + isDocumentFragment(selectorOrElement) + ) { return selectorOrElement; } else if (isString(selectorOrElement)) { - if (selectorOrElement[0] === '#' && selectorOrElement.indexOf(' ') === -1) { + if ( + selectorOrElement[0] === '#' && + selectorOrElement.indexOf(' ') === -1 + ) { return document.getElementById(selectorOrElement.substr(1)); } else { return document.querySelector(selectorOrElement); @@ -750,7 +825,9 @@ function toggleClassesWithoutNative_(element, classes) { elementClassName = `${elementClassName}${classes[i]} `; } else { const before = elementClassName.substring(0, classIndex); - const after = elementClassName.substring(classIndex + className.length); + const after = elementClassName.substring( + classIndex + className.length + ); // eslint-disable-line elementClassName = `${before} ${after}`; } } @@ -783,15 +860,15 @@ function triggerElementListeners_(element, event, defaultFns) { * NOTE: This should mostly be used for testing, not on real code. * @param {!Element} element The node that should trigger the event. * @param {string} eventName The name of the event to be triggred. - * @param {Object=} opt_eventObj An object with data that should be on the + * @param {Object=} eventObj An object with data that should be on the * triggered event's payload. */ -export function triggerEvent(element, eventName, opt_eventObj) { - if (isAbleToInteractWith_(element, eventName, opt_eventObj)) { - const eventObj = document.createEvent('HTMLEvents'); - eventObj.initEvent(eventName, true, true); - object.mixin(eventObj, opt_eventObj); - element.dispatchEvent(eventObj); +export function triggerEvent(element, eventName, eventObj) { + if (isAbleToInteractWith_(element, eventName, eventObj)) { + const payload = document.createEvent('HTMLEvents'); + payload.initEvent(eventName, true, true); + object.mixin(payload, eventObj); + element.dispatchEvent(payload); } } @@ -813,7 +890,7 @@ function triggerListeners_(listeners, event, element, defaultFns) { if (listeners[i].defaultListener_) { defaultFns.push({ element, - fn: listeners[i] + fn: listeners[i], }); } else { ret &= listeners[i](event); diff --git a/packages/metal-dom/src/events.js b/packages/metal-dom/src/events.js index 7d9cb148..63756e32 100644 --- a/packages/metal-dom/src/events.js +++ b/packages/metal-dom/src/events.js @@ -1,7 +1,7 @@ 'use strict'; -import { isServerSide } from 'metal'; -import { registerCustomEvent, contains } from './dom'; +import {isServerSide} from 'metal'; +import {registerCustomEvent, contains} from './dom'; import features from './features'; /** @@ -12,7 +12,7 @@ function registerEvents() { mouseenter: 'mouseover', mouseleave: 'mouseout', pointerenter: 'pointerover', - pointerleave: 'pointerout' + pointerleave: 'pointerout', }; Object.keys(mouseEventMap).forEach(function(eventName) { registerCustomEvent(eventName, { @@ -20,18 +20,22 @@ function registerEvents() { handler: function(callback, event) { const related = event.relatedTarget; const target = event.delegateTarget; - if (!related || (related !== target && !contains(target, related))) { + // eslint-disable-next-line + if ( + !related || + (related !== target && !contains(target, related)) + ) { event.customType = eventName; return callback(event); } }, - originalEvent: mouseEventMap[eventName] + originalEvent: mouseEventMap[eventName], }); }); const animationEventMap = { animation: 'animationend', - transition: 'transitionend' + transition: 'transitionend', }; Object.keys(animationEventMap).forEach(function(eventType) { const eventName = animationEventMap[eventType]; @@ -42,7 +46,7 @@ function registerEvents() { event.customType = eventName; return callback(event); }, - originalEvent: features.checkAnimationEventName()[eventType] + originalEvent: features.checkAnimationEventName()[eventType], }); }); } diff --git a/packages/metal-dom/src/features.js b/packages/metal-dom/src/features.js index 75f5c2ee..f90ca970 100644 --- a/packages/metal-dom/src/features.js +++ b/packages/metal-dom/src/features.js @@ -1,7 +1,7 @@ 'use strict'; -import { append } from './dom'; -import { string } from 'metal'; +import {append} from './dom'; +import {string} from 'metal'; /** * Class with static methods responsible for doing browser feature checks. @@ -17,7 +17,7 @@ class features { if (features.animationEventName_ === undefined) { features.animationEventName_ = { animation: features.checkAnimationEventName_('animation'), - transition: features.checkAnimationEventName_('transition') + transition: features.checkAnimationEventName_('transition'), }; } return features.animationEventName_; @@ -30,13 +30,27 @@ class features { */ static checkAnimationEventName_(type) { const prefixes = ['Webkit', 'MS', 'O', '']; - const typeTitleCase = string.replaceInterval(type, 0, 1, type.substring(0, 1).toUpperCase()); - const suffixes = [`${typeTitleCase}End`, `${typeTitleCase}End`, `${typeTitleCase}End`, `${type}end`]; + const typeTitleCase = string.replaceInterval( + type, + 0, + 1, + type.substring(0, 1).toUpperCase() + ); + const suffixes = [ + `${typeTitleCase}End`, + `${typeTitleCase}End`, + `${typeTitleCase}End`, + `${type}end`, + ]; if (!features.animationElement_) { features.animationElement_ = document.createElement('div'); } for (let i = 0; i < prefixes.length; i++) { - if (features.animationElement_.style[prefixes[i] + typeTitleCase] !== undefined) { + if ( + features.animationElement_.style[ + prefixes[i] + typeTitleCase + ] !== undefined // eslint-disable-line + ) { return prefixes[i].toLowerCase() + suffixes[i]; } } diff --git a/packages/metal-dom/src/globalEval.js b/packages/metal-dom/src/globalEval.js index 7c275515..954b5e62 100644 --- a/packages/metal-dom/src/globalEval.js +++ b/packages/metal-dom/src/globalEval.js @@ -1,7 +1,7 @@ 'use strict'; -import { async } from 'metal'; -import { exitDocument, once } from './dom'; +import {async} from 'metal'; +import {exitDocument, once} from './dom'; /** * Utility functions for running javascript code in the global scope. @@ -10,15 +10,15 @@ class globalEval { /** * Evaluates the given string in the global scope. * @param {string} text - * @param {function()=} opt_appendFn Optional function to append the node + * @param {function()=} appendFn Optional function to append the node * into document. * @return {Element} script */ - static run(text, opt_appendFn) { + static run(text, appendFn) { const script = document.createElement('script'); script.text = text; - if (opt_appendFn) { - opt_appendFn(script); + if (appendFn) { + appendFn(script); } else { document.head.appendChild(script); } @@ -29,25 +29,25 @@ class globalEval { /** * Evaluates the given javascript file in the global scope. * @param {string} src The file's path. - * @param {function()=} opt_callback Optional function to be called + * @param {function()=} defaultFn Optional function to be called * when the script has been run. - * @param {function()=} opt_appendFn Optional function to append the node + * @param {function()=} appendFn Optional function to append the node * into document. * @return {Element} script */ - static runFile(src, opt_callback, opt_appendFn) { + static runFile(src, defaultFn, appendFn) { const script = document.createElement('script'); script.src = src; const callback = function() { exitDocument(script); - opt_callback && opt_callback(); + defaultFn && defaultFn(); }; once(script, 'load', callback); once(script, 'error', callback); - if (opt_appendFn) { - opt_appendFn(script); + if (appendFn) { + appendFn(script); } else { document.head.appendChild(script); } @@ -58,15 +58,15 @@ class globalEval { /** * Evaluates the code referenced by the given script element. * @param {!Element} script - * @param {function()=} opt_callback Optional function to be called + * @param {function()=} defaultFn Optional function to be called * when the script has been run. - * @param {function()=} opt_appendFn Optional function to append the node + * @param {function()=} appendFn Optional function to append the node * into document. * @return {Element} script */ - static runScript(script, opt_callback, opt_appendFn) { + static runScript(script, defaultFn, appendFn) { const callback = function() { - opt_callback && opt_callback(); + defaultFn && defaultFn(); }; if (script.type && script.type !== 'text/javascript') { async.nextTick(callback); @@ -74,27 +74,27 @@ class globalEval { } exitDocument(script); if (script.src) { - return globalEval.runFile(script.src, opt_callback, opt_appendFn); + return globalEval.runFile(script.src, defaultFn, appendFn); } else { async.nextTick(callback); - return globalEval.run(script.text, opt_appendFn); + return globalEval.run(script.text, appendFn); } } /** * Evaluates any script tags present in the given element. * @param {!Element} element - * @param {function()=} opt_callback Optional function to be called + * @param {function()=} defaultFn Optional function to be called * when the script has been run. - * @param {function()=} opt_appendFn Optional function to append the node + * @param {function()=} appendFn Optional function to append the node * into document. */ - static runScriptsInElement(element, opt_callback, opt_appendFn) { + static runScriptsInElement(element, defaultFn, appendFn) { const scripts = element.querySelectorAll('script'); if (scripts.length) { - globalEval.runScriptsInOrder(scripts, 0, opt_callback, opt_appendFn); - } else if (opt_callback) { - async.nextTick(opt_callback); + globalEval.runScriptsInOrder(scripts, 0, defaultFn, appendFn); + } else if (defaultFn) { + async.nextTick(defaultFn); } } @@ -102,19 +102,28 @@ class globalEval { * Runs the given scripts elements in the order that they appear. * @param {!NodeList} scripts * @param {number} index - * @param {function()=} opt_callback Optional function to be called + * @param {function()=} defaultFn Optional function to be called * when the script has been run. - * @param {function()=} opt_appendFn Optional function to append the node + * @param {function()=} appendFn Optional function to append the node * into document. */ - static runScriptsInOrder(scripts, index, opt_callback, opt_appendFn) { - globalEval.runScript(scripts.item(index), function() { - if (index < scripts.length - 1) { - globalEval.runScriptsInOrder(scripts, index + 1, opt_callback, opt_appendFn); - } else if (opt_callback) { - async.nextTick(opt_callback); - } - }, opt_appendFn); + static runScriptsInOrder(scripts, index, defaultFn, appendFn) { + globalEval.runScript( + scripts.item(index), + function() { + if (index < scripts.length - 1) { + globalEval.runScriptsInOrder( + scripts, + index + 1, + defaultFn, + appendFn + ); // eslint-disable-line + } else if (defaultFn) { + async.nextTick(defaultFn); + } + }, + appendFn + ); } } diff --git a/packages/metal-dom/src/globalEvalStyles.js b/packages/metal-dom/src/globalEvalStyles.js index 27d6d902..a4094f46 100644 --- a/packages/metal-dom/src/globalEvalStyles.js +++ b/packages/metal-dom/src/globalEvalStyles.js @@ -1,7 +1,7 @@ 'use strict'; -import { async } from 'metal'; -import { once } from './dom'; +import {async} from 'metal'; +import {once} from './dom'; /** * Utility functions for running styles. @@ -10,15 +10,15 @@ class globalEvalStyles { /** * Evaluates the given style. * @param {string} text - * @param {function()=} opt_appendFn Optional function to append the node + * @param {function()=} appendFn Optional function to append the node * into document. * @return {Element} style */ - static run(text, opt_appendFn) { + static run(text, appendFn) { const style = document.createElement('style'); style.innerHTML = text; - if (opt_appendFn) { - opt_appendFn(style); + if (appendFn) { + appendFn(style); } else { document.head.appendChild(style); } @@ -28,32 +28,32 @@ class globalEvalStyles { /** * Evaluates the given style file. * @param {string} href The file's path. - * @param {function()=} opt_callback Optional function to be called + * @param {function()=} defaultFn Optional function to be called * when the styles has been run. - * @param {function()=} opt_appendFn Optional function to append the node + * @param {function()=} appendFn Optional function to append the node * into document. * @return {Element} style */ - static runFile(href, opt_callback, opt_appendFn) { + static runFile(href, defaultFn, appendFn) { const link = document.createElement('link'); link.rel = 'stylesheet'; link.href = href; - globalEvalStyles.runStyle(link, opt_callback, opt_appendFn); + globalEvalStyles.runStyle(link, defaultFn, appendFn); return link; } /** * Evaluates the code referenced by the given style/link element. * @param {!Element} style - * @param {function()=} opt_callback Optional function to be called + * @param {function()=} defaultFn Optional function to be called * when the script has been run. - * @param {function()=} opt_appendFn Optional function to append the node + * @param {function()=} appendFn Optional function to append the node * into document. * @return {Element} style */ - static runStyle(style, opt_callback, opt_appendFn) { + static runStyle(style, defaultFn, appendFn) { const callback = function() { - opt_callback && opt_callback(); + defaultFn && defaultFn(); }; if (style.rel && style.rel !== 'stylesheet') { async.nextTick(callback); @@ -67,8 +67,8 @@ class globalEvalStyles { once(style, 'error', callback); } - if (opt_appendFn) { - opt_appendFn(style); + if (appendFn) { + appendFn(style); } else { document.head.appendChild(style); } @@ -79,26 +79,26 @@ class globalEvalStyles { /** * Evaluates any style present in the given element. * @param {!Element} element - * @param {function()=} opt_callback Optional function to be called when the + * @param {function()=} defaultFn Optional function to be called when the * style has been run. - * @param {function()=} opt_appendFn Optional function to append the node + * @param {function()=} appendFn Optional function to append the node * into document. */ - static runStylesInElement(element, opt_callback, opt_appendFn) { + static runStylesInElement(element, defaultFn, appendFn) { const styles = element.querySelectorAll('style,link'); - if (styles.length === 0 && opt_callback) { - async.nextTick(opt_callback); + if (styles.length === 0 && defaultFn) { + async.nextTick(defaultFn); return; } let loadCount = 0; const callback = function() { - if (opt_callback && ++loadCount === styles.length) { - async.nextTick(opt_callback); + if (defaultFn && ++loadCount === styles.length) { + async.nextTick(defaultFn); } }; for (let i = 0; i < styles.length; i++) { - globalEvalStyles.runStyle(styles[i], callback, opt_appendFn); + globalEvalStyles.runStyle(styles[i], callback, appendFn); } } } diff --git a/packages/metal-dom/test/.eslintrc b/packages/metal-dom/test/.eslintrc new file mode 100644 index 00000000..790a71ae --- /dev/null +++ b/packages/metal-dom/test/.eslintrc @@ -0,0 +1,16 @@ +{ + "env": { + "mocha": true + }, + "globals": { + "after": true, + "assert": true, + "before": true, + "sinon": true + }, + "rules": { + "max-len": 0, + "no-invalid-this": 0, + "require-jsdoc": 0 + } +} \ No newline at end of file diff --git a/packages/metal-dom/test/DomDelegatedEventHandle.js b/packages/metal-dom/test/DomDelegatedEventHandle.js index 0fe87cd0..32dbfcfc 100644 --- a/packages/metal-dom/test/DomDelegatedEventHandle.js +++ b/packages/metal-dom/test/DomDelegatedEventHandle.js @@ -5,38 +5,30 @@ import DomDelegatedEventHandle from '../src/DomDelegatedEventHandle'; describe('DomDelegatedEventHandle', function() { it('should remove listener from the metal data listeners array', function() { - var element = document.createElement('div'); - var listeners = domData.get(element, 'listeners', {}); - listeners.click = [() => { - }, () => { - }, () => { - }]; - var fn = listeners.click[1]; + let element = document.createElement('div'); + let listeners = domData.get(element, 'listeners', {}); + listeners.click = [() => {}, () => {}, () => {}]; + let fn = listeners.click[1]; - var handle = new DomDelegatedEventHandle(element, 'click', fn); + let handle = new DomDelegatedEventHandle(element, 'click', fn); handle.removeListener(); assert.strictEqual(2, listeners.click.length); assert.strictEqual(-1, listeners.click.indexOf(fn)); }); it('should not throw error if trying to remove unexisting listener', function() { - var element = document.createElement('div'); - var listeners = domData.get(element, 'listeners', {}); - listeners.click = [() => { - }, () => { - }, () => { - }]; + let element = document.createElement('div'); + let listeners = domData.get(element, 'listeners', {}); + listeners.click = [() => {}, () => {}, () => {}]; - var handle = new DomDelegatedEventHandle(element, 'click', () => { - }); + let handle = new DomDelegatedEventHandle(element, 'click', () => {}); handle.removeListener(); assert.strictEqual(3, listeners.click.length); }); it('should not throw error if element has no listeners to be removed', function() { - var element = document.createElement('div'); - var handle = new DomDelegatedEventHandle(element, 'click', () => { - }); + let element = document.createElement('div'); + let handle = new DomDelegatedEventHandle(element, 'click', () => {}); assert.doesNotThrow(() => handle.removeListener()); }); }); diff --git a/packages/metal-dom/test/DomEventEmitterProxy.js b/packages/metal-dom/test/DomEventEmitterProxy.js index 13ea0602..abfe8226 100644 --- a/packages/metal-dom/test/DomEventEmitterProxy.js +++ b/packages/metal-dom/test/DomEventEmitterProxy.js @@ -3,7 +3,7 @@ import dom from '../src/dom'; import features from '../src/features'; import DomEventEmitterProxy from '../src/DomEventEmitterProxy'; -import { EventEmitter } from 'metal-events'; +import {EventEmitter} from 'metal-events'; describe('DomEventEmitterProxy', function() { afterEach(function() { @@ -11,11 +11,11 @@ describe('DomEventEmitterProxy', function() { }); it('should proxy event from event emitter origin to target', function() { - var origin = new EventEmitter(); - var target = new EventEmitter(); + let origin = new EventEmitter(); + let target = new EventEmitter(); new DomEventEmitterProxy(origin, target); - var listener = sinon.stub(); + let listener = sinon.stub(); target.on('event1', listener); origin.emit('event1', 1, 2); @@ -25,13 +25,13 @@ describe('DomEventEmitterProxy', function() { }); it('should proxy event from dom element origin to target', function() { - var origin = document.createElement('div'); + let origin = document.createElement('div'); document.body.appendChild(origin); - var target = new EventEmitter(); + let target = new EventEmitter(); new DomEventEmitterProxy(origin, target); - var listener = sinon.stub(); + let listener = sinon.stub(); target.on('click', listener); dom.triggerEvent(origin, 'click'); @@ -41,13 +41,13 @@ describe('DomEventEmitterProxy', function() { }); it('should proxy custom event from dom element origin to target', function() { - var origin = document.createElement('div'); + let origin = document.createElement('div'); document.body.appendChild(origin); - var target = new EventEmitter(); + let target = new EventEmitter(); new DomEventEmitterProxy(origin, target); - var listener = sinon.stub(); + let listener = sinon.stub(); target.on('transitionend', listener); dom.triggerEvent(origin, features.checkAnimationEventName().transition); @@ -55,10 +55,10 @@ describe('DomEventEmitterProxy', function() { }); it('should not proxy unsupported dom event from dom element', function() { - var origin = document.createElement('div'); + let origin = document.createElement('div'); origin.addEventListener = sinon.stub(); - var target = new EventEmitter(); + let target = new EventEmitter(); new DomEventEmitterProxy(origin, target); target.on('event1', sinon.stub()); @@ -66,10 +66,10 @@ describe('DomEventEmitterProxy', function() { }); it('should proxy event from document to target', function() { - var target = new EventEmitter(); + let target = new EventEmitter(); new DomEventEmitterProxy(document, target); - var listener = sinon.stub(); + let listener = sinon.stub(); target.on('click', listener); dom.triggerEvent(document, 'click'); @@ -77,16 +77,16 @@ describe('DomEventEmitterProxy', function() { }); it('should proxy delegate event from dom element origin to target', function() { - var origin = document.createElement('div'); + let origin = document.createElement('div'); dom.append(origin, ''); document.body.appendChild(origin); - var target = new EventEmitter(); + let target = new EventEmitter(); new DomEventEmitterProxy(origin, target); - var listener = sinon.stub(); + let listener = sinon.stub(); target.on('delegate:click:.testButton', listener); - var button = origin.querySelector('.testButton'); + let button = origin.querySelector('.testButton'); dom.triggerEvent(button, 'click'); assert.strictEqual(1, listener.callCount); @@ -95,16 +95,16 @@ describe('DomEventEmitterProxy', function() { }); it('should proxy delegate event that contains ":" in selector', function() { - var origin = document.createElement('div'); + let origin = document.createElement('div'); dom.append(origin, ''); document.body.appendChild(origin); - var target = new EventEmitter(); + let target = new EventEmitter(); new DomEventEmitterProxy(origin, target); - var listener = sinon.stub(); + let listener = sinon.stub(); target.on('delegate:click:[data-onclick="test:handleClick"]', listener); - var button = origin.querySelector('[data-onclick="test:handleClick"]'); + let button = origin.querySelector('[data-onclick="test:handleClick"]'); dom.triggerEvent(button, 'click'); assert.strictEqual(1, listener.callCount); @@ -112,10 +112,10 @@ describe('DomEventEmitterProxy', function() { }); it('should try to proxy event with "delegate:" prefix but no selector', function() { - var origin = document.createElement('div'); + let origin = document.createElement('div'); document.body.appendChild(origin); - var target = new EventEmitter(); + let target = new EventEmitter(); new DomEventEmitterProxy(origin, target); sinon.spy(dom, 'delegate'); @@ -127,16 +127,16 @@ describe('DomEventEmitterProxy', function() { }); it('should change the element that events are proxied from', function() { - var origin = document.createElement('div'); + let origin = document.createElement('div'); document.body.appendChild(origin); - var target = new EventEmitter(); - var proxy = new DomEventEmitterProxy(origin, target); + let target = new EventEmitter(); + let proxy = new DomEventEmitterProxy(origin, target); - var listener = sinon.stub(); + let listener = sinon.stub(); target.on('click', listener); - var origin2 = document.createElement('div'); + let origin2 = document.createElement('div'); document.body.appendChild(origin2); proxy.setOriginEmitter(origin2); @@ -151,11 +151,11 @@ describe('DomEventEmitterProxy', function() { }); it('should not proxy event emitter events after disposed', function() { - var origin = new EventEmitter(); - var target = new EventEmitter(); - var proxy = new DomEventEmitterProxy(origin, target); + let origin = new EventEmitter(); + let target = new EventEmitter(); + let proxy = new DomEventEmitterProxy(origin, target); - var listener = sinon.stub(); + let listener = sinon.stub(); target.on('event1', listener); proxy.dispose(); @@ -164,12 +164,12 @@ describe('DomEventEmitterProxy', function() { }); it('should not proxy dom events after disposed', function() { - var origin = document.createElement('div'); + let origin = document.createElement('div'); - var target = new EventEmitter(); - var proxy = new DomEventEmitterProxy(origin, target); + let target = new EventEmitter(); + let proxy = new DomEventEmitterProxy(origin, target); - var listener = sinon.stub(); + let listener = sinon.stub(); target.on('click', listener); proxy.dispose(); @@ -178,10 +178,10 @@ describe('DomEventEmitterProxy', function() { }); it('should not throw error if origin emitter is null', function() { - var target = new EventEmitter(); + let target = new EventEmitter(); new DomEventEmitterProxy(null, target); - var listener = sinon.stub(); + let listener = sinon.stub(); assert.doesNotThrow(() => target.on('click', listener)); }); }); diff --git a/packages/metal-dom/test/DomEventHandle.js b/packages/metal-dom/test/DomEventHandle.js index d075dc61..f4ac7577 100644 --- a/packages/metal-dom/test/DomEventHandle.js +++ b/packages/metal-dom/test/DomEventHandle.js @@ -4,11 +4,11 @@ import DomEventHandle from '../src/DomEventHandle'; describe('DomEventHandle', function() { it('should unsubscribe listener', function() { - var element = { - removeEventListener: sinon.stub() + let element = { + removeEventListener: sinon.stub(), }; - var listener = sinon.stub(); - var handle = new DomEventHandle(element, 'event', listener); + let listener = sinon.stub(); + let handle = new DomEventHandle(element, 'event', listener); handle.removeListener(); assert.strictEqual(1, element.removeEventListener.callCount); @@ -17,11 +17,11 @@ describe('DomEventHandle', function() { }); it('should unsubscribe listener attached on capture phase', function() { - var element = { - removeEventListener: sinon.stub() + let element = { + removeEventListener: sinon.stub(), }; - var listener = sinon.stub(); - var handle = new DomEventHandle(element, 'event', listener, true); + let listener = sinon.stub(); + let handle = new DomEventHandle(element, 'event', listener, true); handle.removeListener(); assert.strictEqual(1, element.removeEventListener.callCount); diff --git a/packages/metal-dom/test/dom.js b/packages/metal-dom/test/dom.js index 1700a72a..fdd8122b 100644 --- a/packages/metal-dom/test/dom.js +++ b/packages/metal-dom/test/dom.js @@ -1,12 +1,11 @@ 'use strict'; import dom from '../src/all/dom'; -import { object } from 'metal'; +import {object} from 'metal'; import UA from 'metal-useragent'; import DomEventHandle from '../src/DomEventHandle'; describe('dom', function() { - afterEach(function() { document.body.innerHTML = ''; }); @@ -19,7 +18,7 @@ describe('dom', function() { assert.strictEqual('class2', getClassNames(element)[1]); } - var element = document.createElement('div'); + const element = document.createElement('div'); dom.addClasses(element, 'class1 class2'); assertClassesAdded(); }); @@ -31,11 +30,11 @@ describe('dom', function() { assert.strictEqual('class2', getClassNames(element)[1]); } - var element1 = document.createElement('div'); - var element2 = document.createElement('div'); + let element1 = document.createElement('div'); + let element2 = document.createElement('div'); dom.append(document.body, element1); dom.append(document.body, element2); - var elements = document.querySelectorAll('div'); + let elements = document.querySelectorAll('div'); dom.addClasses(elements, 'class1 class2'); @@ -44,19 +43,19 @@ describe('dom', function() { }); it('should not throw error if addClasses is called with empty string', function() { - var element = document.createElement('div'); + let element = document.createElement('div'); assert.doesNotThrow(() => dom.addClasses(element, '')); }); it('should not add css classes twice to the same element', function() { - var element = document.createElement('div'); + let element = document.createElement('div'); dom.addClasses(element, 'class1 class2'); dom.addClasses(element, 'class1 class2'); assert.strictEqual('class1 class2', element.className.trim()); }); it('should check if an element has the requested css class', function() { - var element = document.createElement('div'); + let element = document.createElement('div'); dom.addClasses(element, 'class1 class2'); assert.ok(dom.hasClass(element, 'class1')); @@ -67,7 +66,7 @@ describe('dom', function() { }); it('should check if css classes are being removed', function() { - var element = document.createElement('div'); + let element = document.createElement('div'); dom.addClasses(element, 'class1 class2'); dom.removeClasses(element, 'class1'); @@ -81,11 +80,11 @@ describe('dom', function() { assert.ok(dom.hasClass(element, 'class2')); } - var element1 = document.createElement('div'); - var element2 = document.createElement('div'); + let element1 = document.createElement('div'); + let element2 = document.createElement('div'); dom.append(document.body, element1); dom.append(document.body, element2); - var elements = document.querySelectorAll('div'); + let elements = document.querySelectorAll('div'); dom.addClasses(elements, 'class1 class2'); dom.removeClasses(elements, 'class1'); @@ -95,12 +94,12 @@ describe('dom', function() { }); it('should not throw error if removeClasses is called with empty string', function() { - var element = document.createElement('div'); + let element = document.createElement('div'); assert.doesNotThrow(() => dom.removeClasses(element, '')); }); it('should do nothing if element or classes are not object and string in add/remove classes', function() { - var element = document.createElement('div'); + let element = document.createElement('div'); assert.doesNotThrow(function() { dom.addClasses(element); }); @@ -112,7 +111,7 @@ describe('dom', function() { }); it('should do nothing if element or classes are not object and string in toggle classes', function() { - var element = document.createElement('div'); + let element = document.createElement('div'); assert.doesNotThrow(function() { dom.toggleClasses(element); }); @@ -124,7 +123,7 @@ describe('dom', function() { }); it('should toggle classes in an element', function() { - var element = document.createElement('div'); + let element = document.createElement('div'); element.className = 'lorem'; dom.toggleClasses(element, 'lorem'); @@ -144,11 +143,17 @@ describe('dom', function() { element.className = 'lorem ipsum dolor sit amet'; dom.toggleClasses(element, 'lorem sit consectetur adipiscing elit'); - assert.strictEqual('ipsum dolor amet consectetur adipiscing elit', element.className); + assert.strictEqual( + 'ipsum dolor amet consectetur adipiscing elit', + element.className + ); element.className = 'lorem ipsum dolor sit amet'; dom.toggleClasses(element, 'adipiscing elit lorem sit consectetur'); - assert.strictEqual('ipsum dolor amet adipiscing elit consectetur', element.className); + assert.strictEqual( + 'ipsum dolor amet adipiscing elit consectetur', + element.className + ); }); it('should return false when checking if a classname with spaces exists', function() { @@ -164,9 +169,9 @@ describe('dom', function() { describe('contains', function() { it('should check if element contains another', function() { - var element1 = document.createElement('div'); - var element2 = document.createElement('div'); - var element3 = document.createElement('div'); + let element1 = document.createElement('div'); + let element2 = document.createElement('div'); + let element3 = document.createElement('div'); dom.append(element1, element2); dom.enterDocument(element3); @@ -182,8 +187,8 @@ describe('dom', function() { describe('manipulation', function() { it('should append html string to parent element', function() { - var parent = document.createElement('div'); - var childHtml = '
'; + let parent = document.createElement('div'); + let childHtml = '
'; dom.append(parent, childHtml); assert.strictEqual(childHtml, parent.innerHTML); @@ -191,16 +196,18 @@ describe('dom', function() { }); it('should append element to parent element', function() { - var parent = document.createElement('div'); - var child = document.createElement('div'); + let parent = document.createElement('div'); + let child = document.createElement('div'); dom.append(parent, child); assert.strictEqual(parent, child.parentNode); }); it('should append node list to parent element', function() { - var parent = document.createElement('div'); - var childFrag = dom.buildFragment('
'); + let parent = document.createElement('div'); + let childFrag = dom.buildFragment( + '
' + ); dom.append(parent, childFrag.childNodes); assert.strictEqual(2, parent.childNodes.length); @@ -208,9 +215,72 @@ describe('dom', function() { assert.strictEqual('myChild2', parent.childNodes[1].className); }); + it('should prepend an element into a div without first child', function() { + let parent = document.createElement('div'); + let elem = dom.buildFragment('

Hello World

'); + + dom.prepend(parent, elem); + + assert.strictEqual('

Hello World

', parent.innerHTML); + }); + + it('should prepend an element into a div', function() { + let parent = document.createElement('div'); + let p = document.createElement('p'); + let span = document.createElement('span'); + + dom.append(parent, p); + dom.prepend(parent, span); + + assert.strictEqual(parent.innerHTML, '

'); + }); + + it('should prepend a text into a div', function() { + let parent = document.createElement('div'); + + dom.append(parent, 'Some text'); + dom.prepend(parent, 'Headline: '); + + assert.strictEqual(parent.innerHTML, 'Headline: Some text'); + }); + + it('should prepend node list to empty parent element', function() { + let parent = document.createElement('div'); + + let childFrag = dom.buildFragment( + '
el1
el2
el3
' + ); + + dom.prepend(parent, childFrag.childNodes); + + assert.strictEqual(3, parent.childNodes.length); + assert.strictEqual('myChild', parent.childNodes[0].className.trim()); + assert.strictEqual('myChild2', parent.childNodes[1].className.trim()); + assert.strictEqual('myChild3', parent.childNodes[2].className.trim()); + }); + + it('should prepend node list to parent element with pre-existing children', function() { + let parent = document.createElement('div'); + let child = document.createElement('div'); + + dom.addClasses(child, 'child'); + dom.append(parent, child); + + let childFrag = dom.buildFragment( + '
el1
el2
el3
' + ); + + dom.prepend(parent, childFrag.childNodes); + assert.strictEqual(4, parent.childNodes.length); + assert.strictEqual('myChild', parent.childNodes[0].className.trim()); + assert.strictEqual('myChild2', parent.childNodes[1].className.trim()); + assert.strictEqual('myChild3', parent.childNodes[2].className.trim()); + assert.strictEqual('child', parent.childNodes[3].className.trim()); + }); + it('should replace an element with a requested element', function() { - var element1 = document.createElement('div'); - var element2 = document.createElement('div'); + let element1 = document.createElement('div'); + let element2 = document.createElement('div'); dom.append(document.body, element1); dom.replace(element1, element2); @@ -219,7 +289,7 @@ describe('dom', function() { }); it('should not remove element from parent if replacing it with itself', function() { - var element = document.createElement('div'); + let element = document.createElement('div'); dom.append(document.body, element); dom.replace(element, element); @@ -227,8 +297,8 @@ describe('dom', function() { }); it('should not throw error if trying to replace element that doesn\'t have a parent', function() { - var element1 = document.createElement('div'); - var element2 = document.createElement('div'); + let element1 = document.createElement('div'); + let element2 = document.createElement('div'); assert.doesNotThrow(function() { dom.replace(element1, element2); @@ -236,7 +306,7 @@ describe('dom', function() { }); it('should not throw error if null as passed as one of the elements for "replace"', function() { - var element = document.createElement('div'); + let element = document.createElement('div'); dom.append(document.body, element); assert.doesNotThrow(function() { @@ -254,14 +324,14 @@ describe('dom', function() { assert.ok(!dom.isNodeListLike(function() {})); assert.ok(!dom.isNodeListLike(null)); - var html = '
Hello World 1
Hello World 2
'; - var fragment = dom.buildFragment(html); + let html = '
Hello World 1
Hello World 2
'; + let fragment = dom.buildFragment(html); assert.ok(dom.isNodeListLike(fragment.childNodes)); }); it('should node enter document', function() { - var element = document.createElement('div'); + let element = document.createElement('div'); dom.enterDocument(element); assert.strictEqual(document.body, element.parentNode); }); @@ -273,14 +343,14 @@ describe('dom', function() { }); it('should node exit document', function() { - var element = document.createElement('div'); + let element = document.createElement('div'); dom.enterDocument(element); dom.exitDocument(element); assert.strictEqual(null, element.parentNode); }); it('should not throw error if "exitDocument" is called on element without parent', function() { - var element = document.createElement('div'); + let element = document.createElement('div'); assert.doesNotThrow(function() { dom.exitDocument(element); }); @@ -293,7 +363,7 @@ describe('dom', function() { }); it('should append string as document fragment to parent element', function() { - var parent = document.createElement('div'); + let parent = document.createElement('div'); sinon.stub(parent, 'appendChild'); dom.append(parent, '
'); @@ -305,8 +375,8 @@ describe('dom', function() { }); it('should create document fragment from string', function() { - var html = '
Hello World 1
Hello World 2
'; - var fragment = dom.buildFragment(html); + let html = '
Hello World 1
Hello World 2
'; + let fragment = dom.buildFragment(html); assert.ok(fragment); assert.strictEqual(11, fragment.nodeType); @@ -316,7 +386,7 @@ describe('dom', function() { }); it('should remove children from element', function() { - var element = document.createElement('div'); + let element = document.createElement('div'); element.innerHTML = '
0
1
'; dom.removeChildren(element); @@ -326,8 +396,8 @@ describe('dom', function() { describe('on', function() { it('should listen to event on requested element', function() { - var element = document.createElement('div'); - var listener = sinon.stub(); + let element = document.createElement('div'); + let listener = sinon.stub(); dom.on(element, 'myEvent', listener); assert.strictEqual(0, listener.callCount); @@ -336,10 +406,10 @@ describe('dom', function() { }); it('should be able to remove listener from return value of "on"', function() { - var element = document.createElement('div'); - var listener = sinon.stub(); + let element = document.createElement('div'); + let listener = sinon.stub(); - var handle = dom.on(element, 'myEvent', listener); + let handle = dom.on(element, 'myEvent', listener); assert.ok(handle instanceof DomEventHandle); handle.removeListener(); @@ -348,25 +418,25 @@ describe('dom', function() { }); it('should listen to event on document if selector is passed instead of element', function() { - var element = document.createElement('div'); + let element = document.createElement('div'); element.className = 'myClass'; dom.enterDocument(element); - var listener = sinon.stub(); + let listener = sinon.stub(); dom.on('.myClass', 'click', listener); dom.triggerEvent(element, 'click'); assert.strictEqual(1, listener.callCount); }); it('should listen to event on capture phase', function() { - var element = document.createElement('div'); - var parentElement = document.createElement('div'); + let element = document.createElement('div'); + let parentElement = document.createElement('div'); parentElement.appendChild(element); dom.enterDocument(parentElement); - var listener = sinon.stub(); + let listener = sinon.stub(); dom.on(element, 'click', listener); - var parentListener = sinon.stub(); + let parentListener = sinon.stub(); dom.on(parentElement, 'click', parentListener, true); dom.triggerEvent(element, 'click'); @@ -374,11 +444,11 @@ describe('dom', function() { }); it('should remove listener that was attached on capture phase', function() { - var element = document.createElement('div'); + let element = document.createElement('div'); dom.enterDocument(element); - var listener = sinon.stub(); - var handle = dom.on(element, 'click', listener, true); + let listener = sinon.stub(); + let handle = dom.on(element, 'click', listener, true); handle.removeListener(); dom.triggerEvent(element, 'click'); @@ -388,8 +458,8 @@ describe('dom', function() { describe('once', function() { it('should listen once to event on requested element', function() { - var element = document.createElement('div'); - var listener = sinon.stub(); + let element = document.createElement('div'); + let listener = sinon.stub(); dom.once(element, 'myEvent', listener); assert.strictEqual(0, listener.callCount); @@ -399,10 +469,10 @@ describe('dom', function() { }); it('should be able to remove listener from return value of "once"', function() { - var element = document.createElement('div'); - var listener = sinon.stub(); + let element = document.createElement('div'); + let listener = sinon.stub(); - var handle = dom.once(element, 'myEvent', listener); + let handle = dom.once(element, 'myEvent', listener); assert.ok(handle instanceof DomEventHandle); handle.removeListener(); @@ -413,8 +483,8 @@ describe('dom', function() { describe('triggerEvent', function() { it('should trigger dom event', function() { - var listener = sinon.stub(); - var element = document.createElement('div'); + let listener = sinon.stub(); + let element = document.createElement('div'); document.body.appendChild(element); element.addEventListener('click', listener); @@ -425,13 +495,13 @@ describe('dom', function() { }); it('should add specified payload keys to triggered event', function() { - var listener = sinon.stub(); - var element = document.createElement('div'); + let listener = sinon.stub(); + let element = document.createElement('div'); document.body.appendChild(element); element.addEventListener('click', listener); dom.triggerEvent(element, 'click', { - test: 'test' + test: 'test', }); assert.strictEqual(1, listener.callCount); assert.strictEqual('click', listener.args[0][0].type); @@ -440,10 +510,10 @@ describe('dom', function() { }); it('should not trigger dom click event for disabled elements', function() { - var input = document.createElement('input'); - var select = document.createElement('select'); - var button = document.createElement('button'); - var textarea = document.createElement('textarea'); + let input = document.createElement('input'); + let select = document.createElement('select'); + let button = document.createElement('button'); + let textarea = document.createElement('textarea'); input.disabled = true; select.disabled = true; button.disabled = true; @@ -453,10 +523,10 @@ describe('dom', function() { document.body.appendChild(button); document.body.appendChild(textarea); - var listener1 = sinon.stub(); - var listener2 = sinon.stub(); - var listener3 = sinon.stub(); - var listener4 = sinon.stub(); + let listener1 = sinon.stub(); + let listener2 = sinon.stub(); + let listener3 = sinon.stub(); + let listener4 = sinon.stub(); input.addEventListener('click', listener1); select.addEventListener('click', listener2); @@ -474,23 +544,23 @@ describe('dom', function() { }); it('should not trigger dom click event on a form control with a disabled fieldset parent', function() { - var parent = document.createElement('fieldset'); + let parent = document.createElement('fieldset'); parent.disabled = true; document.body.appendChild(parent); - var input = document.createElement('input'); - var select = document.createElement('select'); - var button = document.createElement('button'); - var textarea = document.createElement('textarea'); + let input = document.createElement('input'); + let select = document.createElement('select'); + let button = document.createElement('button'); + let textarea = document.createElement('textarea'); parent.appendChild(input); parent.appendChild(select); parent.appendChild(button); parent.appendChild(textarea); - var listener1 = sinon.stub(); - var listener2 = sinon.stub(); - var listener3 = sinon.stub(); - var listener4 = sinon.stub(); + let listener1 = sinon.stub(); + let listener2 = sinon.stub(); + let listener3 = sinon.stub(); + let listener4 = sinon.stub(); input.addEventListener('click', listener1); select.addEventListener('click', listener2); @@ -507,14 +577,14 @@ describe('dom', function() { }); it('should trigger click event listeners for non-disabled elements even with its parent being disabled', function() { - var element = document.createElement('fieldset'); + let element = document.createElement('fieldset'); element.innerHTML = ''; element.disabled = true; document.body.appendChild(element); - var target = element.querySelector('.match'); + let target = element.querySelector('.match'); - var listener = sinon.stub(); + let listener = sinon.stub(); target.addEventListener('click', listener); dom.triggerEvent(target, 'click'); @@ -523,20 +593,21 @@ describe('dom', function() { }); it('should keep bubling and triggering click event listeners for non-disabled elements', function() { - var element = document.createElement('div'); - element.innerHTML = '
' + + let element = document.createElement('div'); + element.innerHTML = + '
' + '
'; document.body.appendChild(element); - var span = element.querySelector('span'); + let span = element.querySelector('span'); - var listeners = sinon.stub(); + let listeners = sinon.stub(); dom.delegate(element, 'click', '.match', listeners); dom.triggerEvent(span, 'click'); // Firefox works in a diferent way. It stops bubbling events when it hits a // disabled element. - var spectedResult = UA.isFirefox ? 0 : 2; + let spectedResult = UA.isFirefox ? 0 : 2; assert.strictEqual(spectedResult, listeners.callCount); }); }); @@ -544,17 +615,18 @@ describe('dom', function() { describe('delegate', function() { describe('selector', function() { it('should trigger delegate listener for matched elements', function() { - var element = document.createElement('div'); - element.innerHTML = '
' + + let element = document.createElement('div'); + element.innerHTML = + '
' + '
' + '
' + '
' + '
'; document.body.appendChild(element); - var matchedElements = element.querySelectorAll('.match'); + let matchedElements = element.querySelectorAll('.match'); - var listenerTargets = []; - var listener = function(event) { + let listenerTargets = []; + let listener = function(event) { listenerTargets.push(event.delegateTarget); }; dom.delegate(element, 'click', '.match', listener); @@ -566,17 +638,18 @@ describe('dom', function() { }); it('should trigger delegate listener for "focus" event', function() { - var element = document.createElement('div'); - element.innerHTML = '
' + + let element = document.createElement('div'); + element.innerHTML = + '
' + '
' + '
' + '
' + '
'; document.body.appendChild(element); - var matchedElements = element.querySelectorAll('.match'); + let matchedElements = element.querySelectorAll('.match'); - var listenerTargets = []; - var listener = function(event) { + let listenerTargets = []; + let listener = function(event) { listenerTargets.push(event.delegateTarget); }; dom.delegate(element, 'focus', '.match', listener); @@ -588,17 +661,18 @@ describe('dom', function() { }); it('should only trigger delegate event starting from initial target', function() { - var element = document.createElement('div'); - element.innerHTML = '
' + + let element = document.createElement('div'); + element.innerHTML = + '
' + '
' + '
' + '
' + '
'; document.body.appendChild(element); - var matchedElements = element.querySelectorAll('.match'); + let matchedElements = element.querySelectorAll('.match'); - var listenerTargets = []; - var listener = function(event) { + let listenerTargets = []; + let listener = function(event) { listenerTargets.push(event.delegateTarget); }; dom.delegate(element, 'click', '.match', listener); @@ -609,7 +683,7 @@ describe('dom', function() { }); it('should trigger listener twice when two ancestors are delegating', function() { - var element = document.createElement('div'); + let element = document.createElement('div'); element.innerHTML = `
@@ -617,7 +691,7 @@ describe('dom', function() {
`; document.body.appendChild(element); - var listener = sinon.stub(); + let listener = sinon.stub(); dom.delegate(element, 'click', '.match', listener); dom.delegate(element.childNodes[0], 'click', '.match', listener); @@ -626,13 +700,13 @@ describe('dom', function() { }); it('should not trigger delegate event for parents of given element', function() { - var element = document.createElement('div'); + let element = document.createElement('div'); element.innerHTML = '
'; element.className = 'match'; document.body.appendChild(element); - var childElement = element.childNodes[0]; - var listener = sinon.stub(); + let childElement = element.childNodes[0]; + let listener = sinon.stub(); dom.delegate(childElement, 'click', '.match', listener); dom.triggerEvent(childElement, 'click'); @@ -640,17 +714,18 @@ describe('dom', function() { }); it('should stop triggering event if stopPropagation is called', function() { - var element = document.createElement('div'); - element.innerHTML = '
' + + let element = document.createElement('div'); + element.innerHTML = + '
' + '
' + '
' + '
' + '
'; document.body.appendChild(element); - var matchedElements = element.querySelectorAll('.match'); + let matchedElements = element.querySelectorAll('.match'); - var listenerTargets = []; - var listener = function(event) { + let listenerTargets = []; + let listener = function(event) { listenerTargets.push(event.delegateTarget); event.stopPropagation(); }; @@ -662,17 +737,18 @@ describe('dom', function() { }); it('should stop triggering event if stopImmediatePropagation is called', function() { - var element = document.createElement('div'); - element.innerHTML = '
' + + let element = document.createElement('div'); + element.innerHTML = + '
' + '
' + '
' + '
' + '
'; document.body.appendChild(element); - var matchedElements = element.querySelectorAll('.match'); + let matchedElements = element.querySelectorAll('.match'); - var listenerTargets = []; - var listener = function(event) { + let listenerTargets = []; + let listener = function(event) { listenerTargets.push(event.delegateTarget); event.stopImmediatePropagation(); }; @@ -684,13 +760,13 @@ describe('dom', function() { }); it('should run default listeners last', function() { - var element = document.createElement('div'); + let element = document.createElement('div'); element.innerHTML = '
'; document.body.appendChild(element); - var listener1 = sinon.stub(); - var listener2 = sinon.stub(); - var listener3 = sinon.stub(); + let listener1 = sinon.stub(); + let listener2 = sinon.stub(); + let listener3 = sinon.stub(); dom.delegate(element, 'click', '.match', listener1, true); dom.delegate(element, 'click', '.match', listener2); dom.delegate(element, 'click', '.root', listener3); @@ -705,12 +781,12 @@ describe('dom', function() { }); it('should pass correct delegateTarget to default listener', function() { - var element = document.createElement('div'); + let element = document.createElement('div'); element.innerHTML = '
'; document.body.appendChild(element); - var target; - var listener = function(event) { + let target; + let listener = function(event) { target = event.delegateTarget; }; dom.delegate(element, 'click', '.match', listener, true); @@ -721,30 +797,33 @@ describe('dom', function() { }); it('should not run default listener if event is prevented', function() { - var element = document.createElement('div'); + let element = document.createElement('div'); element.innerHTML = '
'; document.body.appendChild(element); - var listener = sinon.stub(); + let listener = sinon.stub(); dom.delegate(element, 'click', '.match', listener, true); - dom.delegate(element, 'click', '.match', event => event.preventDefault()); + dom.delegate(element, 'click', '.match', event => + event.preventDefault() + ); dom.triggerEvent(element.querySelector('.match'), 'click'); assert.strictEqual(0, listener.callCount); }); it('should cancel listener through returned handle', function() { - var element = document.createElement('div'); - element.innerHTML = '
' + + let element = document.createElement('div'); + element.innerHTML = + '
' + '
' + '
' + '
' + '
'; document.body.appendChild(element); - var matchedElements = element.querySelectorAll('.match'); + let matchedElements = element.querySelectorAll('.match'); - var listener1 = sinon.stub(); - var handle = dom.delegate(element, 'click', '.match', listener1); + let listener1 = sinon.stub(); + let handle = dom.delegate(element, 'click', '.match', listener1); handle.removeListener(); dom.triggerEvent(matchedElements[0], 'click'); @@ -752,16 +831,17 @@ describe('dom', function() { }); it('should clear delegateTarget from event object after event is done', function() { - var element = document.createElement('div'); - element.innerHTML = '
' + + let element = document.createElement('div'); + element.innerHTML = + '
' + '
' + '
' + '
' + '
'; document.body.appendChild(element); - var matchedElements = element.querySelectorAll('.match'); + let matchedElements = element.querySelectorAll('.match'); - var listener = sinon.stub(); + let listener = sinon.stub(); dom.delegate(element, 'click', '.match', listener); dom.triggerEvent(matchedElements[1], 'click'); @@ -769,13 +849,13 @@ describe('dom', function() { }); it('should not run click event listeners for disabled elements', function() { - var parent = document.createElement('div'); + let parent = document.createElement('div'); document.body.appendChild(parent); - var input = document.createElement('input'); - var select = document.createElement('select'); - var button = document.createElement('button'); - var textarea = document.createElement('textarea'); + let input = document.createElement('input'); + let select = document.createElement('select'); + let button = document.createElement('button'); + let textarea = document.createElement('textarea'); input.disabled = true; select.disabled = true; button.disabled = true; @@ -785,10 +865,10 @@ describe('dom', function() { parent.appendChild(button); parent.appendChild(textarea); - var listener1 = sinon.stub(); - var listener2 = sinon.stub(); - var listener3 = sinon.stub(); - var listener4 = sinon.stub(); + let listener1 = sinon.stub(); + let listener2 = sinon.stub(); + let listener3 = sinon.stub(); + let listener4 = sinon.stub(); dom.delegate(parent, 'click', input, listener1); dom.delegate(parent, 'click', select, listener2); @@ -806,23 +886,23 @@ describe('dom', function() { }); it('should not run click event listeners to an element with an disabled valid parent', function() { - var parent = document.createElement('fieldset'); + let parent = document.createElement('fieldset'); parent.disabled = true; document.body.appendChild(parent); - var input = document.createElement('input'); - var select = document.createElement('select'); - var button = document.createElement('button'); - var textarea = document.createElement('textarea'); + let input = document.createElement('input'); + let select = document.createElement('select'); + let button = document.createElement('button'); + let textarea = document.createElement('textarea'); parent.appendChild(input); parent.appendChild(select); parent.appendChild(button); parent.appendChild(textarea); - var listener1 = sinon.stub(); - var listener2 = sinon.stub(); - var listener3 = sinon.stub(); - var listener4 = sinon.stub(); + let listener1 = sinon.stub(); + let listener2 = sinon.stub(); + let listener3 = sinon.stub(); + let listener4 = sinon.stub(); dom.delegate(parent, 'click', input, listener1); dom.delegate(parent, 'click', select, listener2); @@ -840,37 +920,38 @@ describe('dom', function() { }); it('should run click event listeners to an element that have not the disabled attribute with a disabled parent using "dispatchEvent()"', function() { - var element = document.createElement('div'); - element.innerHTML = '
' + + let element = document.createElement('div'); + element.innerHTML = + '
' + '
'; document.body.appendChild(element); - var listener = sinon.stub(); + let listener = sinon.stub(); dom.delegate(element, 'click', '.match', listener); - var eventObj = document.createEvent('HTMLEvents'); + let eventObj = document.createEvent('HTMLEvents'); eventObj.initEvent('click', true, true); - var target = element.querySelector('.match'); + let target = element.querySelector('.match'); target.dispatchEvent(eventObj); // Firefox works in a diferent way. It stops bubbling events when it hits a // disabled element. - var expectedResult = UA.isFirefox ? 0 : 1; + let expectedResult = UA.isFirefox ? 0 : 1; assert.strictEqual(expectedResult, listener.callCount); }); }); describe('without selector', function() { it('should trigger delegate listener for specified element', function() { - var element = document.createElement('div'); + let element = document.createElement('div'); dom.enterDocument(element); - var child = document.createElement('div'); + let child = document.createElement('div'); dom.append(element, child); - var grandchild = document.createElement('div'); + let grandchild = document.createElement('div'); dom.append(child, grandchild); - var eventCopy; + let eventCopy; dom.delegate(element, 'click', child, function(event) { eventCopy = object.mixin({}, event); }); @@ -892,11 +973,11 @@ describe('dom', function() { }); it('should not add listener to container twice for the same event type', function() { - var element = document.createElement('div'); + let element = document.createElement('div'); dom.enterDocument(element); - var child1 = document.createElement('div'); + let child1 = document.createElement('div'); dom.append(element, child1); - var child2 = document.createElement('div'); + let child2 = document.createElement('div'); dom.append(element, child2); sinon.spy(element, 'addEventListener'); @@ -906,16 +987,16 @@ describe('dom', function() { }); it('should trigger all delegated listeners for right element', function() { - var element = document.createElement('div'); + let element = document.createElement('div'); dom.enterDocument(element); - var child1 = document.createElement('div'); + let child1 = document.createElement('div'); dom.append(element, child1); - var child2 = document.createElement('div'); + let child2 = document.createElement('div'); dom.append(element, child2); - var child1Listener1 = sinon.stub(); - var child1Listener2 = sinon.stub(); - var child2Listener = sinon.stub(); + let child1Listener1 = sinon.stub(); + let child1Listener2 = sinon.stub(); + let child2Listener = sinon.stub(); dom.delegate(element, 'click', child1, child1Listener1); dom.delegate(element, 'click', child1, child1Listener2); dom.delegate(element, 'click', child2, child2Listener); @@ -932,17 +1013,17 @@ describe('dom', function() { }); it('should not trigger listener twice when two ancestors are delegating', function() { - var element = document.createElement('div'); + let element = document.createElement('div'); dom.enterDocument(element); - var child = document.createElement('div'); + let child = document.createElement('div'); dom.append(element, child); - var grandchild = document.createElement('div'); + let grandchild = document.createElement('div'); dom.append(child, grandchild); - var greatgrandchild = document.createElement('div'); + let greatgrandchild = document.createElement('div'); dom.append(grandchild, greatgrandchild); - var listener1 = sinon.stub(); - var listener2 = sinon.stub(); + let listener1 = sinon.stub(); + let listener2 = sinon.stub(); dom.delegate(grandchild, 'click', greatgrandchild, listener1); dom.delegate(element, 'click', child, listener2); @@ -952,15 +1033,15 @@ describe('dom', function() { }); it('should not trigger listeners from ancestors when stopPropagation is called', function() { - var element = document.createElement('div'); + let element = document.createElement('div'); dom.enterDocument(element); - var child = document.createElement('div'); + let child = document.createElement('div'); dom.append(element, child); - var grandchild = document.createElement('div'); + let grandchild = document.createElement('div'); dom.append(child, grandchild); - var listener1 = sinon.stub(); - var listener2 = sinon.stub(); + let listener1 = sinon.stub(); + let listener2 = sinon.stub(); dom.delegate(element, 'click', grandchild, function(event) { event.stopPropagation(); }); @@ -973,15 +1054,15 @@ describe('dom', function() { }); it('should not trigger any other listeners when stopImmediatePropagation is called', function() { - var element = document.createElement('div'); + let element = document.createElement('div'); dom.enterDocument(element); - var child = document.createElement('div'); + let child = document.createElement('div'); dom.append(element, child); - var grandchild = document.createElement('div'); + let grandchild = document.createElement('div'); dom.append(child, grandchild); - var listener1 = sinon.stub(); - var listener2 = sinon.stub(); + let listener1 = sinon.stub(); + let listener2 = sinon.stub(); dom.delegate(element, 'click', grandchild, function(event) { event.stopImmediatePropagation(); }); @@ -994,30 +1075,30 @@ describe('dom', function() { }); it('should not trigger delegate "click" listener for right clicks', function() { - var element = document.createElement('div'); + let element = document.createElement('div'); dom.enterDocument(element); - var child = document.createElement('div'); + let child = document.createElement('div'); dom.append(element, child); - var listener = sinon.stub(); + let listener = sinon.stub(); dom.delegate(element, 'click', child, listener); dom.triggerEvent(child, 'click', { - button: 2 + button: 2, }); assert.strictEqual(0, listener.callCount); }); it('should run default listeners last', function() { - var element = document.createElement('div'); + let element = document.createElement('div'); dom.enterDocument(element); - var child = document.createElement('div'); + let child = document.createElement('div'); dom.append(element, child); - var grandchild = document.createElement('div'); + let grandchild = document.createElement('div'); dom.append(child, grandchild); - var listener1 = sinon.stub(); - var listener2 = sinon.stub(); - var listener3 = sinon.stub(); + let listener1 = sinon.stub(); + let listener2 = sinon.stub(); + let listener3 = sinon.stub(); dom.delegate(element, 'click', grandchild, listener1, true); dom.delegate(element, 'click', grandchild, listener2); dom.delegate(element, 'click', child, listener3); @@ -1032,12 +1113,12 @@ describe('dom', function() { }); it('should not run default listener if event is prevented', function() { - var element = document.createElement('div'); + let element = document.createElement('div'); dom.enterDocument(element); - var child = document.createElement('div'); + let child = document.createElement('div'); dom.append(element, child); - var listener = sinon.stub(); + let listener = sinon.stub(); dom.delegate(element, 'click', child, listener, true); dom.delegate(element, 'click', child, event => event.preventDefault()); @@ -1046,14 +1127,14 @@ describe('dom', function() { }); it('should cancel listener through returned handle', function() { - var element = document.createElement('div'); + let element = document.createElement('div'); dom.enterDocument(element); - var child = document.createElement('div'); + let child = document.createElement('div'); dom.append(element, child); - var listener1 = sinon.stub(); - var listener2 = sinon.stub(); - var handle = dom.delegate(element, 'click', child, listener1); + let listener1 = sinon.stub(); + let listener2 = sinon.stub(); + let handle = dom.delegate(element, 'click', child, listener1); dom.delegate(element, 'click', child, listener2); handle.removeListener(); @@ -1063,13 +1144,13 @@ describe('dom', function() { }); it('should cancel default listener through returned handle', function() { - var element = document.createElement('div'); + let element = document.createElement('div'); dom.enterDocument(element); - var child = document.createElement('div'); + let child = document.createElement('div'); dom.append(element, child); - var listener = sinon.stub(); - var handle = dom.delegate(element, 'click', child, listener, true); + let listener = sinon.stub(); + let handle = dom.delegate(element, 'click', child, listener, true); handle.removeListener(); dom.triggerEvent(child, 'click'); @@ -1077,12 +1158,12 @@ describe('dom', function() { }); it('should clear delegateTarget from event object after event is done', function() { - var element = document.createElement('div'); + let element = document.createElement('div'); dom.enterDocument(element); - var child = document.createElement('div'); + let child = document.createElement('div'); dom.append(element, child); - var listener = sinon.stub(); + let listener = sinon.stub(); dom.delegate(element, 'click', child, listener); dom.triggerEvent(child, 'click'); @@ -1113,9 +1194,9 @@ describe('dom', function() { }); it('should use matches function when available', function() { - var matchedElement = document.createElement('div'); + let matchedElement = document.createElement('div'); Element.prototype.matches = sinon.stub().returns(matchedElement); - var element = document.createElement('div'); + let element = document.createElement('div'); assert.strictEqual(matchedElement, dom.match(element, '.selector')); assert.strictEqual(1, element.matches.callCount); @@ -1123,10 +1204,12 @@ describe('dom', function() { }); it('should use webkitMatchesSelector function when available', function() { - var matchedElement = document.createElement('div'); + let matchedElement = document.createElement('div'); Element.prototype.matches = null; - Element.prototype.webkitMatchesSelector = sinon.stub().returns(matchedElement); - var element = document.createElement('div'); + Element.prototype.webkitMatchesSelector = sinon + .stub() + .returns(matchedElement); + let element = document.createElement('div'); assert.strictEqual(matchedElement, dom.match(element, '.selector')); assert.strictEqual(1, element.webkitMatchesSelector.callCount); @@ -1134,11 +1217,13 @@ describe('dom', function() { }); it('should use mozMatchesSelector function when available', function() { - var matchedElement = document.createElement('div'); + let matchedElement = document.createElement('div'); Element.prototype.matches = null; Element.prototype.webkitMatchesSelector = null; - Element.prototype.mozMatchesSelector = sinon.stub().returns(matchedElement); - var element = document.createElement('div'); + Element.prototype.mozMatchesSelector = sinon + .stub() + .returns(matchedElement); + let element = document.createElement('div'); assert.strictEqual(matchedElement, dom.match(element, '.selector')); assert.strictEqual(1, element.mozMatchesSelector.callCount); @@ -1146,12 +1231,14 @@ describe('dom', function() { }); it('should use msMatchesSelector function when available', function() { - var matchedElement = document.createElement('div'); + let matchedElement = document.createElement('div'); Element.prototype.matches = null; Element.prototype.webkitMatchesSelector = null; Element.prototype.mozMatchesSelector = null; - Element.prototype.msMatchesSelector = sinon.stub().returns(matchedElement); - var element = document.createElement('div'); + Element.prototype.msMatchesSelector = sinon + .stub() + .returns(matchedElement); + let element = document.createElement('div'); assert.strictEqual(matchedElement, dom.match(element, '.selector')); assert.strictEqual(1, element.msMatchesSelector.callCount); @@ -1159,13 +1246,13 @@ describe('dom', function() { }); it('should use oMatchesSelector function when available', function() { - var matchedElement = document.createElement('div'); + let matchedElement = document.createElement('div'); Element.prototype.matches = null; Element.prototype.webkitMatchesSelector = null; Element.prototype.mozMatchesSelector = null; Element.prototype.msMatchesSelector = null; Element.prototype.oMatchesSelector = sinon.stub().returns(matchedElement); - var element = document.createElement('div'); + let element = document.createElement('div'); assert.strictEqual(matchedElement, dom.match(element, '.selector')); assert.strictEqual(1, element.oMatchesSelector.callCount); @@ -1175,16 +1262,16 @@ describe('dom', function() { it('should return false for invalid node type', function() { Element.prototype.matches = sinon.stub(); - var element = document.createDocumentFragment(); + let element = document.createDocumentFragment(); assert.ok(!dom.match(element, 'selector')); assert.strictEqual(0, Element.prototype.matches.callCount); }); it('should fall back to using querySelectorAll when no others are available', function() { - var element = document.createElement('div'); + let element = document.createElement('div'); element.className = 'class1'; document.body.appendChild(element); - var element2 = document.createElement('div'); + let element2 = document.createElement('div'); element2.className = 'class2'; document.body.appendChild(element2); @@ -1205,9 +1292,9 @@ describe('dom', function() { dom.enterDocument( '
' ); - var element = dom.toElement('.element'); - var parent2 = dom.toElement('.parent1'); - var parent3 = dom.toElement('.parent2'); + let element = dom.toElement('.element'); + let parent2 = dom.toElement('.parent1'); + let parent3 = dom.toElement('.parent2'); assert.strictEqual(null, dom.parent(element, '.element')); assert.strictEqual(parent2, dom.parent(element, '.parent1')); assert.strictEqual(parent3, dom.parent(element, '.parent2')); @@ -1220,9 +1307,9 @@ describe('dom', function() { dom.enterDocument( '
' ); - var element = dom.toElement('.element'); - var parent2 = dom.toElement('.parent1'); - var parent3 = dom.toElement('.parent2'); + let element = dom.toElement('.element'); + let parent2 = dom.toElement('.parent1'); + let parent3 = dom.toElement('.parent2'); assert.strictEqual(element, dom.closest(element, '.element')); assert.strictEqual(parent2, dom.closest(element, '.parent1')); assert.strictEqual(parent3, dom.closest(element, '.parent2')); @@ -1235,9 +1322,9 @@ describe('dom', function() { dom.enterDocument( '
' ); - var element = dom.toElement('.rootElement'); - var sibling1 = dom.toElement('.sibling1'); - var sibling2 = dom.toElement('.sibling2'); + let element = dom.toElement('.rootElement'); + let sibling1 = dom.toElement('.sibling1'); + let sibling2 = dom.toElement('.sibling2'); assert.strictEqual(sibling1, dom.next(element, '.sibling1')); assert.strictEqual(sibling2, dom.next(element, '.sibling2')); assert.strictEqual(null, dom.next(element, '.sibling3')); @@ -1246,14 +1333,14 @@ describe('dom', function() { describe('toElement', function() { it('should return the element itself if one is given for conversion', function() { - var element = document.createElement('div'); + let element = document.createElement('div'); assert.strictEqual(element, dom.toElement(element)); assert.strictEqual(document, dom.toElement(document)); }); it('should return matching element if selector is given', function() { - var element = document.createElement('div'); + let element = document.createElement('div'); element.className = 'mySelector'; document.body.appendChild(element); @@ -1261,7 +1348,7 @@ describe('dom', function() { }); it('should return matching element when selector is id', function() { - var element = document.createElement('div'); + let element = document.createElement('div'); element.id = 'myId'; document.body.appendChild(element); @@ -1269,10 +1356,10 @@ describe('dom', function() { }); it('should return matching element when selector is inside id', function() { - var element = document.createElement('div'); + let element = document.createElement('div'); element.id = 'myId'; document.body.appendChild(element); - var element2 = document.createElement('div'); + let element2 = document.createElement('div'); element2.className = 'myClass'; dom.append(element, element2); @@ -1286,21 +1373,21 @@ describe('dom', function() { assert.strictEqual(null, dom.toElement(null)); }); - it('should return matching element if selector is document fragment', function () { - var frag1 = document.createDocumentFragment(); + it('should return matching element if selector is document fragment', function() { + let frag1 = document.createDocumentFragment(); assert.strictEqual(frag1, dom.toElement(frag1)); - var frag2 = document.createDocumentFragment(); + let frag2 = document.createDocumentFragment(); assert.strictEqual(frag2, dom.toElement(frag2)); - var frag3 = '#document-fragment'; + let frag3 = '#document-fragment'; assert.notStrictEqual(frag3, dom.toElement(frag3)); }); }); describe('supportsEvent', function() { it('should check if element supports event', function() { - var element = document.createElement('div'); + let element = document.createElement('div'); assert.ok(!dom.supportsEvent(element, 'lalala')); assert.ok(dom.supportsEvent(element, 'click')); @@ -1324,13 +1411,13 @@ describe('dom', function() { return listener(event); } }, - originalEvent: 'click' + originalEvent: 'click', }); }); it('should handle registered custom events', function() { - var listener = sinon.stub(); - var element = document.createElement('div'); + let listener = sinon.stub(); + let element = document.createElement('div'); dom.append(document.body, element); dom.on(element, 'myClick', listener); @@ -1343,19 +1430,19 @@ describe('dom', function() { }); it('should handle delegate for registered custom events', function() { - var element = document.createElement('div'); + let element = document.createElement('div'); dom.addClasses(element, 'mine'); dom.append(document.body, element); - var myElement = document.createElement('div'); + let myElement = document.createElement('div'); dom.addClasses(myElement, 'mine foo'); dom.append(element, myElement); - var fooElement = document.createElement('div'); + let fooElement = document.createElement('div'); dom.addClasses(fooElement, 'foo'); dom.append(element, fooElement); - var listener = sinon.stub(); + let listener = sinon.stub(); dom.delegate(element, 'myClick', '.foo', listener); dom.triggerEvent(element, 'click'); @@ -1376,7 +1463,7 @@ describe('dom', function() { describe('Helpers', function() { it('should check if element is empty', function() { - var element = document.createElement('div'); + let element = document.createElement('div'); assert.ok(dom.isEmpty(element)); element.innerHTML = 'foo'; @@ -1387,5 +1474,4 @@ describe('dom', function() { function getClassNames(element) { return element.className.trim().split(' '); } - }); diff --git a/packages/metal-dom/test/domData.js b/packages/metal-dom/test/domData.js index e1efebe1..ec11e865 100644 --- a/packages/metal-dom/test/domData.js +++ b/packages/metal-dom/test/domData.js @@ -3,19 +3,102 @@ import domData from '../src/domData'; describe('domData', function() { - it('should get data object from element', function() { - var data = domData.get(document.createElement('div')); - assert.ok(data); + describe('get', function() { + it('should get data object from element', function() { + let data = domData.get(document.createElement('div')); + assert.ok(data); + }); + + it('should return same data object for the same element', function() { + let element = document.createElement('div'); + assert.strictEqual(domData.get(element), domData.get(element)); + }); + + it('should return different data objects for the different elements', function() { + let element1 = document.createElement('div'); + let element2 = document.createElement('div'); + assert.notStrictEqual(domData.get(element1), domData.get(element2)); + }); + + it('should set initialValue only if value does not exist', function() { + let element = document.createElement('div'); + let key = domData.get(element, 'key', 'foo'); + assert.strictEqual(key, 'foo'); + + key = domData.get(element, 'key', 'bar'); + assert.strictEqual(key, 'foo'); + }); + + it('should allow initialValue to be falsy', function() { + let element = document.createElement('div'); + let key = domData.get(element, 'key', 0); + assert.strictEqual(key, 0); + + key = domData.get(element, 'key', 1); + assert.strictEqual(key, 0); + }); + + it('should not overwrite initialValue with undefined', function() { + let element = document.createElement('div'); + let key = domData.get(element, 'key', 'foo'); + assert.strictEqual(key, 'foo'); + + key = domData.get(element, 'key'); + assert.strictEqual(key, 'foo'); + }); }); - it('should return same data object for the same element', function() { - var element = document.createElement('div'); - assert.strictEqual(domData.get(element), domData.get(element)); + describe('has', function() { + it('should return false if no data object exists', function() { + let element = document.createElement('div'); + assert.strictEqual(domData.has(element), false); + }); + + it('should return true if data object exists', function() { + let element = document.createElement('div'); + domData.get(element); + assert.strictEqual(domData.has(element), true); + }); }); - it('should return different data objects for the different elements', function() { - var element1 = document.createElement('div'); - var element2 = document.createElement('div'); - assert.notStrictEqual(domData.get(element1), domData.get(element2)); + describe('set', function() { + it('should get data object from element', function() { + let element = document.createElement('div'); + domData.set(element, 'value', 20); + let data = domData.get(element); + assert.deepEqual(data, { + value: 20, + }); + }); + + it('should get data value from element', function() { + let element = document.createElement('img'); + domData.set(element, 'value', true); + let data = domData.get(element, 'value'); + assert.strictEqual(data, true); + }); + + it('should create data object without a value', function() { + let element = document.createElement('div'); + domData.set(element); + let data = domData.get(element); + assert.deepEqual(data, {}); + }); + + it('should overwrite a data value using set', function() { + let element = document.createElement('div'); + domData.set(element, 'value', true); + assert.strictEqual(domData.get(element, 'value'), true); + domData.set(element, 'value', 20); + assert.strictEqual(domData.get(element, 'value'), 20); + }); + + it('should set falsy value', function() { + let element = document.createElement('div'); + domData.set(element, 'value', false); + assert.strictEqual(domData.get(element, 'value'), false); + domData.set(element, 'value', 0); + assert.strictEqual(domData.get(element, 'value'), 0); + }); }); }); diff --git a/packages/metal-dom/test/events.js b/packages/metal-dom/test/events.js index 783cac5c..6ab322af 100644 --- a/packages/metal-dom/test/events.js +++ b/packages/metal-dom/test/events.js @@ -6,12 +6,12 @@ import '../src/events'; describe('Custom Events', function() { beforeEach(function() { - var element1 = document.createElement('div'); + let element1 = document.createElement('div'); dom.append(document.body, element1); - var element2 = document.createElement('div'); + let element2 = document.createElement('div'); dom.addClasses(element2, 'inner'); dom.append(element1, element2); - var element3 = document.createElement('div'); + let element3 = document.createElement('div'); dom.append(element2, element3); this.element1 = element1; @@ -20,85 +20,91 @@ describe('Custom Events', function() { }); it('should delegate mouseenter event', function() { - var listener = sinon.stub(); + let listener = sinon.stub(); dom.delegate(this.element1, 'mouseenter', '.inner', listener); dom.triggerEvent(this.element1, 'mouseover'); assert.strictEqual(0, listener.callCount); dom.triggerEvent(this.element2, 'mouseover', { - relatedTarget: this.element1 + relatedTarget: this.element1, }); assert.strictEqual(1, listener.callCount); assert.strictEqual('mouseenter', listener.args[0][0].customType); dom.triggerEvent(this.element2, 'mouseover', { - relatedTarget: this.element3 + relatedTarget: this.element3, }); assert.strictEqual(1, listener.callCount); }); it('should delegate mouseleave event', function() { - var listener = sinon.stub(); + let listener = sinon.stub(); dom.delegate(this.element1, 'mouseleave', '.inner', listener); dom.triggerEvent(this.element1, 'mouseout'); assert.strictEqual(0, listener.callCount); dom.triggerEvent(this.element2, 'mouseout', { - relatedTarget: this.element1 + relatedTarget: this.element1, }); assert.strictEqual(1, listener.callCount); assert.strictEqual('mouseleave', listener.args[0][0].customType); dom.triggerEvent(this.element2, 'mouseout', { - relatedTarget: this.element3 + relatedTarget: this.element3, }); assert.strictEqual(1, listener.callCount); }); it('should delegate pointerenter event', function() { - var listener = sinon.stub(); + let listener = sinon.stub(); dom.delegate(this.element1, 'pointerenter', '.inner', listener); dom.triggerEvent(this.element1, 'pointerover'); assert.strictEqual(0, listener.callCount); dom.triggerEvent(this.element2, 'pointerover', { - relatedTarget: this.element1 + relatedTarget: this.element1, }); assert.strictEqual(1, listener.callCount); assert.strictEqual('pointerenter', listener.args[0][0].customType); dom.triggerEvent(this.element2, 'pointerover', { - relatedTarget: this.element3 + relatedTarget: this.element3, }); assert.strictEqual(1, listener.callCount); }); it('should delegate pointerleave event', function() { - var listener = sinon.stub(); + let listener = sinon.stub(); dom.delegate(this.element1, 'pointerleave', '.inner', listener); dom.triggerEvent(this.element1, 'pointerout'); assert.strictEqual(0, listener.callCount); dom.triggerEvent(this.element2, 'pointerout', { - relatedTarget: this.element1 + relatedTarget: this.element1, }); assert.strictEqual(1, listener.callCount); assert.strictEqual('pointerleave', listener.args[0][0].customType); dom.triggerEvent(this.element2, 'pointerout', { - relatedTarget: this.element3 + relatedTarget: this.element3, }); assert.strictEqual(1, listener.callCount); }); it('should handle transitionend event', function() { - var listener = sinon.stub(); + let listener = sinon.stub(); dom.on(this.element1, 'transitionend', listener); - dom.triggerEvent(this.element1, features.checkAnimationEventName().transition); + dom.triggerEvent( + this.element1, + features.checkAnimationEventName().transition + ); assert.strictEqual(1, listener.callCount); assert.strictEqual('transitionend', listener.args[0][0].customType); }); it('should handle animationend event', function() { - var listener = sinon.stub(); + let listener = sinon.stub(); dom.on(this.element1, 'animationend', listener); - dom.triggerEvent(this.element1, features.checkAnimationEventName().animation); + dom.triggerEvent( + this.element1, + features.checkAnimationEventName().animation + ); assert.strictEqual(1, listener.callCount); assert.strictEqual('animationend', listener.args[0][0].customType); }); diff --git a/packages/metal-dom/test/features.js b/packages/metal-dom/test/features.js index 832be00c..7b3eb6e7 100644 --- a/packages/metal-dom/test/features.js +++ b/packages/metal-dom/test/features.js @@ -17,11 +17,11 @@ describe('features', function() { describe('Method checkAttrOrderChange', function() { it('should check if current browser changes attribute order', function() { - var result = features.checkAttrOrderChange(); + let result = features.checkAttrOrderChange(); assert.strictEqual(1, dom.append.callCount); - var element = dom.append.args[0][0]; - var original = dom.append.args[0][1]; + let element = dom.append.args[0][0]; + let original = dom.append.args[0][1]; assert.strictEqual(result, original !== element.innerHTML); }); @@ -45,39 +45,69 @@ describe('features', function() { it('should output default event name', function() { features.animationElement_ = { - style: {} + style: {}, }; - assert.strictEqual('animationend', features.checkAnimationEventName().animation); - assert.strictEqual('transitionend', features.checkAnimationEventName().transition); + assert.strictEqual( + 'animationend', + features.checkAnimationEventName().animation + ); + assert.strictEqual( + 'transitionend', + features.checkAnimationEventName().transition + ); }); it('should check for native browser support', function() { mockAnimationElementStyles(''); - assert.strictEqual('animationend', features.checkAnimationEventName().animation); - assert.strictEqual('transitionend', features.checkAnimationEventName().transition); + assert.strictEqual( + 'animationend', + features.checkAnimationEventName().animation + ); + assert.strictEqual( + 'transitionend', + features.checkAnimationEventName().transition + ); }); it('should check for Webkit browsers', function() { mockAnimationElementStyles('Webkit'); - assert.strictEqual('webkitAnimationEnd', features.checkAnimationEventName().animation); - assert.strictEqual('webkitTransitionEnd', features.checkAnimationEventName().transition); + assert.strictEqual( + 'webkitAnimationEnd', + features.checkAnimationEventName().animation + ); + assert.strictEqual( + 'webkitTransitionEnd', + features.checkAnimationEventName().transition + ); }); it('should check for MS browsers', function() { mockAnimationElementStyles('MS'); - assert.strictEqual('msAnimationEnd', features.checkAnimationEventName().animation); - assert.strictEqual('msTransitionEnd', features.checkAnimationEventName().transition); + assert.strictEqual( + 'msAnimationEnd', + features.checkAnimationEventName().animation + ); + assert.strictEqual( + 'msTransitionEnd', + features.checkAnimationEventName().transition + ); }); it('should check for Opera browsers', function() { mockAnimationElementStyles('O'); - assert.strictEqual('oAnimationEnd', features.checkAnimationEventName().animation); - assert.strictEqual('oTransitionEnd', features.checkAnimationEventName().transition); + assert.strictEqual( + 'oAnimationEnd', + features.checkAnimationEventName().animation + ); + assert.strictEqual( + 'oTransitionEnd', + features.checkAnimationEventName().transition + ); }); function mockAnimationElementStyles(browserPrefix) { features.animationElement_ = { - style: {} + style: {}, }; features.animationElement_.style[browserPrefix + 'animation'] = true; features.animationElement_.style[browserPrefix + 'transition'] = true; diff --git a/packages/metal-dom/test/globalEval.js b/packages/metal-dom/test/globalEval.js index cd03fd06..c764033b 100644 --- a/packages/metal-dom/test/globalEval.js +++ b/packages/metal-dom/test/globalEval.js @@ -1,6 +1,6 @@ 'use strict'; -import { async } from 'metal'; +import {async} from 'metal'; import * as dom from '../src/dom'; import globalEval from '../src/globalEval'; @@ -23,12 +23,12 @@ describe('globalEval', function() { }); it('should not leave created script tag in document after code is evaluated', function() { - var newScript = globalEval.run('var testScript = 2 + 2;'); + let newScript = globalEval.run('var testScript = 2 + 2;'); assert.ok(!newScript.parentNode); }); it('should evaluate script file in global scope', function(done) { - var newScript = globalEval.runFile('fixtures/script.js'); + let newScript = globalEval.runFile('fixtures/script.js'); dom.on(newScript, 'load', function() { assert.strictEqual(5, window.testScript); @@ -36,8 +36,10 @@ describe('globalEval', function() { }); }); - it('should remove created script tag after evaluated script file is loaded', function(done) { - var newScript = globalEval.runFile('fixtures/script.js'); + it('should remove created script tag after evaluated script file is loaded', function( + done + ) { + let newScript = globalEval.runFile('fixtures/script.js'); dom.on(newScript, 'load', function() { assert.ok(!newScript.parentNode); @@ -45,8 +47,10 @@ describe('globalEval', function() { }); }); - it('should remove created script tag after evaluated script file throws error', function(done) { - var newScript = globalEval.runFile('fixtures/unexistingScript.js'); + it('should remove created script tag after evaluated script file throws error', function( + done + ) { + let newScript = globalEval.runFile('fixtures/unexistingScript.js'); dom.on(newScript, 'error', function() { assert.ok(!newScript.parentNode); @@ -55,7 +59,7 @@ describe('globalEval', function() { }); it('should call callback function after script file is run', function(done) { - var newScript = globalEval.runFile('fixtures/script.js', function() { + const newScript = globalEval.runFile('fixtures/script.js', function() { assert.strictEqual(5, window.testScript); assert.ok(!newScript.parentNode); done(); @@ -63,8 +67,8 @@ describe('globalEval', function() { }); it('should be able to overwrite append function', function() { - var appendFn = sinon.stub(); - var script = document.createElement('script'); + let appendFn = sinon.stub(); + let script = document.createElement('script'); globalEval.runScript(script, null, appendFn); assert.strictEqual(1, appendFn.callCount); script.src = 'fixtures/script.js'; @@ -73,7 +77,7 @@ describe('globalEval', function() { }); it('should run code inside script tag in global scope', function() { - var script = document.createElement('script'); + let script = document.createElement('script'); script.text = 'var testScript = "script with code";'; globalEval.runScript(script); @@ -81,7 +85,7 @@ describe('globalEval', function() { }); it('should remove script element from the document when it\'s evaluated', function() { - var script = document.createElement('script'); + let script = document.createElement('script'); script.text = 'var testScript = "script with code";'; dom.enterDocument(script); @@ -90,8 +94,10 @@ describe('globalEval', function() { assert.ok(!script.parentNode); }); - it('should not evaluate script element with type different from javascript', function(done) { - var script = document.createElement('script'); + it('should not evaluate script element with type different from javascript', function( + done + ) { + let script = document.createElement('script'); script.text = 'Regular text file'; script.type = 'text/plain'; dom.enterDocument(script); @@ -104,8 +110,10 @@ describe('globalEval', function() { }); }); - it('should call callback function after script tag with inline content is run', function(done) { - var script = document.createElement('script'); + it('should call callback function after script tag with inline content is run', function( + done + ) { + let script = document.createElement('script'); script.text = 'var testScript = "script with code";'; dom.enterDocument(script); @@ -116,24 +124,28 @@ describe('globalEval', function() { }); }); - it('should run file referenced by specified script element in global scope', function(done) { - var script = document.createElement('script'); + it('should run file referenced by specified script element in global scope', function( + done + ) { + let script = document.createElement('script'); script.src = 'fixtures/script.js'; dom.enterDocument(script); - var newScript = globalEval.runScript(script); + let newScript = globalEval.runScript(script); dom.on(newScript, 'load', function() { assert.strictEqual(5, window.testScript); done(); }); }); - it('should call callback function after script tag with file src is run', function(done) { - var script = document.createElement('script'); + it('should call callback function after script tag with file src is run', function( + done + ) { + let script = document.createElement('script'); script.src = 'fixtures/script.js'; dom.enterDocument(script); - var newScript = globalEval.runScript(script, function() { + const newScript = globalEval.runScript(script, function() { assert.strictEqual(5, window.testScript); assert.ok(!newScript.parentNode); done(); @@ -141,7 +153,7 @@ describe('globalEval', function() { }); it('should run all script tags inside given element', function(done) { - var element = dom.buildFragment( + let element = dom.buildFragment( '
' ); globalEval.runScriptsInElement(element, function() { @@ -153,7 +165,7 @@ describe('globalEval', function() { }); it('should run script tags inside given element in order', function(done) { - var element = dom.buildFragment( + let element = dom.buildFragment( '
' ); @@ -164,29 +176,37 @@ describe('globalEval', function() { }); }); - it('should be able to overwrite append function from element', function(done) { - var element = dom.buildFragment( + it('should be able to overwrite append function from element', function( + done + ) { + let element = dom.buildFragment( '
' ); - var appendFn = sinon.spy(function(script) { + let appendFn = sinon.spy(function(script) { document.head.appendChild(script); }); - globalEval.runScriptsInElement(element, function() { - assert.strictEqual(2, appendFn.callCount); - done(); - }, appendFn); + globalEval.runScriptsInElement( + element, + function() { + assert.strictEqual(2, appendFn.callCount); + done(); + }, + appendFn + ); }); it('should not throw errors if trying to run scripts on element without any scripts', function() { - var element = dom.buildFragment('
'); + let element = dom.buildFragment('
'); assert.doesNotThrow(function() { globalEval.runScriptsInElement(element); }); }); - it('should call given callback on nextTick if no script tags exist in received element', function(done) { - var element = dom.buildFragment('
'); - var callback = sinon.stub(); + it('should call given callback on nextTick if no script tags exist in received element', function( + done + ) { + let element = dom.buildFragment('
'); + let callback = sinon.stub(); globalEval.runScriptsInElement(element, callback); assert.strictEqual(0, callback.callCount); async.nextTick(function() { diff --git a/packages/metal-dom/test/globalEvalStyles.js b/packages/metal-dom/test/globalEvalStyles.js index 811f0dd9..d4cbe7a8 100644 --- a/packages/metal-dom/test/globalEvalStyles.js +++ b/packages/metal-dom/test/globalEvalStyles.js @@ -1,6 +1,6 @@ 'use strict'; -import { async } from 'metal'; +import {async} from 'metal'; import * as dom from '../src/dom'; import globalEvalStyles from '../src/globalEvalStyles'; @@ -15,27 +15,29 @@ describe('globalEvalStyles', function() { afterEach(function() {}); it('should evaluate style code', function() { - var style = globalEvalStyles.run('body{background-color:rgb(255, 0, 0);}'); + let style = globalEvalStyles.run('body{background-color:rgb(255, 0, 0);}'); assertComputedStyle('backgroundColor', 'rgb(255, 0, 0)'); dom.exitDocument(style); }); it('should leave created style tag in document after code is evaluated', function() { - var style = globalEvalStyles.run(''); + let style = globalEvalStyles.run(''); assert.ok(style.parentNode); dom.exitDocument(style); }); it('should evaluate style file', function(done) { - var style = globalEvalStyles.runFile('fixtures/style.css', function() { + const style = globalEvalStyles.runFile('fixtures/style.css', function() { assertComputedStyle('backgroundColor', 'rgb(0, 255, 0)'); dom.exitDocument(style); done(); }); }); - it('should leave created style file in document after code is evaluated', function(done) { - var style = globalEvalStyles.runFile('fixtures/style.css', function() { + it('should leave created style file in document after code is evaluated', function( + done + ) { + const style = globalEvalStyles.runFile('fixtures/style.css', function() { assert.ok(style.parentNode); dom.exitDocument(style); done(); @@ -43,27 +45,31 @@ describe('globalEvalStyles', function() { }); it('should run code inside style tag in global scope', function() { - var style = document.createElement('style'); + let style = document.createElement('style'); style.innerHTML = 'body{background-color:rgb(255, 0, 0);}'; - var newStyle = globalEvalStyles.runStyle(style); + let newStyle = globalEvalStyles.runStyle(style); assertComputedStyle('backgroundColor', 'rgb(255, 0, 0)'); dom.exitDocument(newStyle); }); - it('should leave created style element in document after code is evaluated', function(done) { - var style = document.createElement('style'); + it('should leave created style element in document after code is evaluated', function( + done + ) { + let style = document.createElement('style'); style.innerHTML = 'body{background-color:rgb(255, 0, 0);}'; - var newStyle = globalEvalStyles.runStyle(style, function() { + const newStyle = globalEvalStyles.runStyle(style, function() { assert.ok(newStyle.parentNode); dom.exitDocument(newStyle); done(); }); }); - it('should not evaluate style element with tel different from stylesheet', function(done) { - var link = document.createElement('link'); + it('should not evaluate style element with tel different from stylesheet', function( + done + ) { + let link = document.createElement('link'); link.innerHTML = 'body{background-color:rgb(255, 0, 0);}'; link.rel = 'unknown'; dom.enterDocument(link); @@ -77,11 +83,11 @@ describe('globalEvalStyles', function() { }); it('should run file referenced by specified style element', function(done) { - var link = document.createElement('link'); + let link = document.createElement('link'); link.href = 'fixtures/style.css'; link.rel = 'stylesheet'; - var newStyle = globalEvalStyles.runStyle(link, function() { + const newStyle = globalEvalStyles.runStyle(link, function() { assertComputedStyle('backgroundColor', 'rgb(0, 255, 0)'); dom.exitDocument(newStyle); done(); @@ -89,9 +95,9 @@ describe('globalEvalStyles', function() { }); it('should be able to overwrite append function', function() { - var appendFn = sinon.stub(); - var style = document.createElement('style'); - var newStyle = globalEvalStyles.runStyle(style, null, appendFn); + let appendFn = sinon.stub(); + let style = document.createElement('style'); + let newStyle = globalEvalStyles.runStyle(style, null, appendFn); assert.strictEqual(1, appendFn.callCount); dom.exitDocument(newStyle); globalEvalStyles.run('', appendFn); @@ -99,7 +105,7 @@ describe('globalEvalStyles', function() { }); it('should run all styles tags inside given element', function(done) { - var element = dom.buildFragment( + let element = dom.buildFragment( '
' ); globalEvalStyles.runStylesInElement(element, function() { @@ -110,7 +116,7 @@ describe('globalEvalStyles', function() { }); it('should run styles tags inside given element in order', function(done) { - var element = dom.buildFragment( + let element = dom.buildFragment( '
' ); globalEvalStyles.runStylesInElement(element, function() { @@ -120,15 +126,17 @@ describe('globalEvalStyles', function() { }); it('should not throw errors if trying to run styles on element without any styles', function() { - var element = dom.buildFragment('
'); + let element = dom.buildFragment('
'); assert.doesNotThrow(function() { globalEvalStyles.runStylesInElement(element); }); }); - it('should call given callback on nextTick if no style tags exist in received element', function(done) { - var element = dom.buildFragment('
'); - var callback = sinon.stub(); + it('should call given callback on nextTick if no style tags exist in received element', function( + done + ) { + let element = dom.buildFragment('
'); + let callback = sinon.stub(); globalEvalStyles.runStylesInElement(element, callback); assert.strictEqual(0, callback.callCount); async.nextTick(function() { @@ -136,10 +144,11 @@ describe('globalEvalStyles', function() { done(); }); }); - }); - function assertComputedStyle(property, value) { - assert.strictEqual(value, window.getComputedStyle(document.body, null)[property]); + assert.strictEqual( + value, + window.getComputedStyle(document.body, null)[property] + ); } diff --git a/packages/metal-events/README.md b/packages/metal-events/README.md index 8974912e..3dad1e7b 100644 --- a/packages/metal-events/README.md +++ b/packages/metal-events/README.md @@ -1,3 +1,5 @@ # metal-events Classes responsible for emitting and listening to events. + +See [https://metaljs.com/](https://metaljs.com/) for documentation. diff --git a/packages/metal-events/package-lock.json b/packages/metal-events/package-lock.json index f9c637f5..7e4c66d6 100644 --- a/packages/metal-events/package-lock.json +++ b/packages/metal-events/package-lock.json @@ -64,7 +64,7 @@ "lodash": "4.17.4", "minimatch": "3.0.4", "path-is-absolute": "1.0.1", - "private": "0.1.7", + "private": "0.1.8", "slash": "1.0.0", "source-map": "0.5.7" } @@ -507,9 +507,9 @@ } }, "babel-preset-env": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.6.0.tgz", - "integrity": "sha512-OVgtQRuOZKckrILgMA5rvctvFZPv72Gua9Rt006AiPoB0DJKGN07UmaQA+qRrYgK71MVct8fFhT0EyNWYorVew==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.6.1.tgz", + "integrity": "sha512-W6VIyA6Ch9ePMI7VptNn2wBM6dbG0eSz25HEiL40nQXCsXGTGZSTZu1Iap+cj3Q0S5a7T9+529l/5Bkvd+afNA==", "requires": { "babel-plugin-check-es2015-constants": "6.22.0", "babel-plugin-syntax-trailing-function-commas": "6.22.0", @@ -538,7 +538,7 @@ "babel-plugin-transform-es2015-unicode-regex": "6.24.1", "babel-plugin-transform-exponentiation-operator": "6.24.1", "babel-plugin-transform-regenerator": "6.26.0", - "browserslist": "2.5.1", + "browserslist": "2.8.0", "invariant": "2.2.2", "semver": "5.4.1" } @@ -625,18 +625,18 @@ } }, "browserslist": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-2.5.1.tgz", - "integrity": "sha512-jAvM2ku7YDJ+leAq3bFH1DE0Ylw+F+EQDq4GkqZfgPEqpWYw9ofQH85uKSB9r3Tv7XDbfqVtE+sdvKJW7IlPJA==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-2.8.0.tgz", + "integrity": "sha512-iiWHM1Et6Q4TQpB7Ar6pxuM3TNMXasVJY4Y/oh3q38EwR3Z+IdZ9MyVf7PI4MJFB4xpwMcZgs9bEUnPG2E3TCA==", "requires": { - "caniuse-lite": "1.0.30000746", - "electron-to-chromium": "1.3.25" + "caniuse-lite": "1.0.30000760", + "electron-to-chromium": "1.3.27" } }, "caniuse-lite": { - "version": "1.0.30000746", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000746.tgz", - "integrity": "sha1-xk+Vo5Jc/TAgejCO12wa6W6gnqA=" + "version": "1.0.30000760", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000760.tgz", + "integrity": "sha1-7HIDlXQvHH7IlH/W3SYE53qPmP8=" }, "chalk": { "version": "1.1.3", @@ -687,9 +687,9 @@ } }, "electron-to-chromium": { - "version": "1.3.25", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.25.tgz", - "integrity": "sha1-RTshAJg20Jl9hgNWAf9srkeRxGA=" + "version": "1.3.27", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.27.tgz", + "integrity": "sha1-eOy4o5kGYYe7N07t412ccFZagD0=" }, "escape-string-regexp": { "version": "1.0.5", @@ -879,9 +879,9 @@ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "private": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/private/-/private-0.1.7.tgz", - "integrity": "sha1-aM5eih7woju1cMwoU3tTMqumPvE=" + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", + "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==" }, "regenerate": { "version": "1.3.3", @@ -900,7 +900,7 @@ "requires": { "babel-runtime": "6.26.0", "babel-types": "6.26.0", - "private": "0.1.7" + "private": "0.1.8" } }, "regexpu-core": { diff --git a/packages/metal-events/src/EventEmitter.js b/packages/metal-events/src/EventEmitter.js index 9c55a1b3..9902114c 100644 --- a/packages/metal-events/src/EventEmitter.js +++ b/packages/metal-events/src/EventEmitter.js @@ -1,16 +1,18 @@ 'use strict'; -import { array, Disposable, isFunction, isString } from 'metal'; +import {array, Disposable, isFunction, isString} from 'metal'; import EventHandle from './EventHandle'; const singleArray_ = [0]; /** * EventEmitter utility. - * @constructor * @extends {Disposable} */ class EventEmitter extends Disposable { + /** + * EventEmitter constructor + */ constructor() { super(); @@ -63,17 +65,17 @@ class EventEmitter extends Disposable { * Adds a listener to the end of the listeners array for the specified events. * @param {!(Array|string)} event * @param {!Function} listener - * @param {boolean} opt_default Flag indicating if this listener is a default + * @param {boolean} defaultListener Flag indicating if this listener is a default * action for this event. Default actions are run last, and only if no previous * listener call `preventDefault()` on the received event facade. * @return {!EventHandle} Can be used to remove the listener. */ - addListener(event, listener, opt_default) { + addListener(event, listener, defaultListener) { this.validateListener_(listener); const events = this.toEventsArray_(event); for (let i = 0; i < events.length; i++) { - this.addSingleListener_(events[i], listener, opt_default); + this.addSingleListener_(events[i], listener, defaultListener); } return new EventHandle(this, event, listener); @@ -83,21 +85,20 @@ class EventEmitter extends Disposable { * Adds a listener to the end of the listeners array for a single event. * @param {string} event * @param {!Function} listener - * @param {boolean} opt_default Flag indicating if this listener is a default + * @param {boolean} defaultListener Flag indicating if this listener is a default * action for this event. Default actions are run last, and only if no previous * listener call `preventDefault()` on the received event facade. - * @return {!EventHandle} Can be used to remove the listener. - * @param {Function=} opt_origin The original function that was added as a + * @param {Function=} origin The original function that was added as a * listener, if there is any. * @protected */ - addSingleListener_(event, listener, opt_default, opt_origin) { + addSingleListener_(event, listener, defaultListener, origin) { this.runListenerHandlers_(event); - if (opt_default || opt_origin) { + if (defaultListener || origin) { listener = { - default: opt_default, + default: defaultListener, fn: listener, - origin: opt_origin + origin: origin, }; } this.events_ = this.events_ || {}; @@ -117,7 +118,7 @@ class EventEmitter extends Disposable { facade.preventedDefault = true; }, target: this, - type: event + type: event, }; return facade; } @@ -143,7 +144,7 @@ class EventEmitter extends Disposable { return false; } - const args = array.slice(arguments, 1); + const args = array.slice(arguments, 1); // eslint-disable-line this.runListeners_(listeners, args, this.buildFacade_(event)); return true; } @@ -156,7 +157,9 @@ class EventEmitter extends Disposable { */ getRawListeners_(event) { const directListeners = toArray(this.events_ && this.events_[event]); - return directListeners.concat(toArray(this.events_ && this.events_['*'])); + return directListeners.concat( + toArray(this.events_ && this.events_['*']) + ); } /** @@ -176,7 +179,7 @@ class EventEmitter extends Disposable { */ listeners(event) { return this.getRawListeners_(event).map( - listener => listener.fn ? listener.fn : listener + listener => (listener.fn ? listener.fn : listener) ); } @@ -216,11 +219,14 @@ class EventEmitter extends Disposable { return; } + /** + * + */ function handlerInternal() { if (--amount === 0) { self.removeListener(event, handlerInternal); } - listener.apply(self, arguments); + listener.apply(self, arguments); // eslint-disable-line } self.addSingleListener_(event, handlerInternal, false, listener); @@ -236,14 +242,16 @@ class EventEmitter extends Disposable { */ matchesListener_(listenerObj, listener) { const fn = listenerObj.fn || listenerObj; - return fn === listener || - (listenerObj.origin && listenerObj.origin === listener); + return ( + fn === listener || + (listenerObj.origin && listenerObj.origin === listener) // eslint-disable-line + ); } /** * Removes a listener for the specified events. * Caution: changes array indices in the listener array behind the listener. - * @param {!(Array|string)} events + * @param {!(Array|string)} event * @param {!Function} listener * @return {!Object} Returns emitter, so calls can be chained. */ @@ -271,16 +279,19 @@ class EventEmitter extends Disposable { * @return {!EventHandle} Can be used to remove the listener. */ on() { - return this.addListener.apply(this, arguments); + return this.addListener.apply(this, arguments); // eslint-disable-line } /** * Adds handler that gets triggered when an event is listened to on this * instance. - * @param {!function()} + * @param {!function()} handler */ onListener(handler) { - this.listenerHandlers_ = this.addHandler_(this.listenerHandlers_, handler); + this.listenerHandlers_ = this.addHandler_( + this.listenerHandlers_, + handler + ); // eslint-disable-line } /** @@ -298,13 +309,13 @@ class EventEmitter extends Disposable { * Removes all listeners, or those of the specified events. It's not a good * idea to remove listeners that were added elsewhere in the code, * especially when it's on an emitter that you didn't create. - * @param {(Array|string)=} opt_events + * @param {(Array|string)=} event * @return {!Object} Returns emitter, so calls can be chained. */ - removeAllListeners(opt_events) { + removeAllListeners(event) { if (this.events_) { - if (opt_events) { - const events = this.toEventsArray_(opt_events); + if (event) { + const events = this.toEventsArray_(event); for (let i = 0; i < events.length; i++) { this.events_[events[i]] = null; } @@ -341,7 +352,7 @@ class EventEmitter extends Disposable { * @return {!Object} Returns emitter, so calls can be chained. */ removeListener() { - return this.off.apply(this, arguments); + return this.off.apply(this, arguments); // eslint-disable-line } /** @@ -363,7 +374,7 @@ class EventEmitter extends Disposable { * Runs the given listeners. * @param {!Array} listeners * @param {!Array} args - * @param (Object) facade + * @param {Object} facade * @protected */ runListeners_(listeners, args, facade) { @@ -427,6 +438,11 @@ class EventEmitter extends Disposable { } } +/** + * Converts to an array + * @param {Object} val + * @return {Array} + */ function toArray(val) { val = val || []; return Array.isArray(val) ? val : [val]; diff --git a/packages/metal-events/src/EventEmitterProxy.js b/packages/metal-events/src/EventEmitterProxy.js index eb702a52..314348f6 100644 --- a/packages/metal-events/src/EventEmitterProxy.js +++ b/packages/metal-events/src/EventEmitterProxy.js @@ -1,23 +1,25 @@ 'use strict'; -import { Disposable } from 'metal'; +import {Disposable} from 'metal'; /** * EventEmitterProxy utility. It's responsible for linking two EventEmitter * instances together, emitting events from the first emitter through the * second one. That means that listening to a supported event on the target * emitter will mean listening to it on the origin emitter as well. - * @param {EventEmitter} originEmitter Events originated on this emitter - * will be fired for the target emitter's listeners as well. - * @param {EventEmitter} targetEmitter Event listeners attached to this emitter - * will also be triggered when the event is fired by the origin emitter. - * @param {Object} opt_blacklist Optional blacklist of events that should not be - * proxied. - * @constructor * @extends {Disposable} */ class EventEmitterProxy extends Disposable { - constructor(originEmitter, targetEmitter, opt_blacklist, opt_whitelist) { + /** + * @param {EventEmitter} originEmitter Events originated on this emitter + * will be fired for the target emitter's listeners as well. + * @param {EventEmitter} targetEmitter Event listeners attached to this emitter + * will also be triggered when the event is fired by the origin emitter. + * @param {Object} blacklist Optional blacklist of events that should not be + * proxied. + * @param {Object} whitelist + */ + constructor(originEmitter, targetEmitter, blacklist, whitelist) { super(); /** @@ -25,7 +27,7 @@ class EventEmitterProxy extends Disposable { * @type {Object} * @protected */ - this.blacklist_ = opt_blacklist; + this.blacklist_ = blacklist; /** * The origin emitter. This emitter's events will be proxied through the @@ -64,7 +66,7 @@ class EventEmitterProxy extends Disposable { * @type {Object} * @protected */ - this.whitelist_ = opt_whitelist; + this.whitelist_ = whitelist; this.startProxy_(); } @@ -94,8 +96,8 @@ class EventEmitterProxy extends Disposable { * Emits the specified event type on the target emitter. * @protected */ - emitOnTarget_() { - this.targetEmitter_.emit.apply(this.targetEmitter_, arguments); + emitOnTarget_(...args) { + this.targetEmitter_.emit(...args); } /** @@ -130,9 +132,10 @@ class EventEmitterProxy extends Disposable { * @param {!EventEmitter} originEmitter */ setOriginEmitter(originEmitter) { - const events = this.originEmitter_ && this.proxiedEvents_ ? - Object.keys(this.proxiedEvents_) : - this.pendingEvents_; + const events = + this.originEmitter_ && this.proxiedEvents_ + ? Object.keys(this.proxiedEvents_) + : this.pendingEvents_; this.originEmitter_ = originEmitter; if (events) { this.removeListeners_(); diff --git a/packages/metal-events/src/EventHandle.js b/packages/metal-events/src/EventHandle.js index 6c1a1c53..fc992798 100644 --- a/packages/metal-events/src/EventHandle.js +++ b/packages/metal-events/src/EventHandle.js @@ -1,6 +1,6 @@ 'use strict'; -import { Disposable } from 'metal'; +import {Disposable} from 'metal'; /** * EventHandle utility. Holds information about an event subscription, and @@ -8,13 +8,15 @@ import { Disposable } from 'metal'; * EventHandle is a Disposable, but it's important to note that the * EventEmitter that created it is not the one responsible for disposing it. * That responsibility is for the code that holds a reference to it. - * @param {!EventEmitter} emitter Emitter the event was subscribed to. - * @param {string} event The name of the event that was subscribed to. - * @param {!Function} listener The listener subscribed to the event. - * @constructor * @extends {Disposable} */ class EventHandle extends Disposable { + /** + * EventHandle constructor + * @param {!EventEmitter} emitter Emitter the event was subscribed to. + * @param {string} event The name of the event that was subscribed to. + * @param {!Function} listener The listener subscribed to the event. + */ constructor(emitter, event, listener) { super(); diff --git a/packages/metal-events/src/EventHandler.js b/packages/metal-events/src/EventHandler.js index f76793e3..665c7824 100644 --- a/packages/metal-events/src/EventHandler.js +++ b/packages/metal-events/src/EventHandler.js @@ -1,14 +1,16 @@ 'use strict'; -import { Disposable } from 'metal'; +import {Disposable} from 'metal'; /** * EventHandler utility. It's useful for easily removing a group of * listeners from different EventEmitter instances. - * @constructor * @extends {Disposable} */ class EventHandler extends Disposable { + /** + * EventHandler constructor + */ constructor() { super(); @@ -26,9 +28,9 @@ class EventHandler extends Disposable { * method. * @param {...(!EventHandle)} var_args */ - add() { + add(...args) { for (let i = 0; i < arguments.length; i++) { - this.eventHandles_.push(arguments[i]); + this.eventHandles_.push(args[i]); } } diff --git a/packages/metal-events/src/events.js b/packages/metal-events/src/events.js index 4bb9487b..594a8a0a 100644 --- a/packages/metal-events/src/events.js +++ b/packages/metal-events/src/events.js @@ -6,4 +6,4 @@ import EventHandle from './EventHandle'; import EventHandler from './EventHandler'; export default EventEmitter; -export { EventEmitter, EventEmitterProxy, EventHandle, EventHandler }; +export {EventEmitter, EventEmitterProxy, EventHandle, EventHandler}; diff --git a/packages/metal-assertions/test/.eslintrc.json b/packages/metal-events/test/.eslintrc similarity index 51% rename from packages/metal-assertions/test/.eslintrc.json rename to packages/metal-events/test/.eslintrc index 92b466f1..f6269b7a 100644 --- a/packages/metal-assertions/test/.eslintrc.json +++ b/packages/metal-events/test/.eslintrc @@ -5,5 +5,10 @@ "globals": { "assert": true, "sinon": true + }, + "rules": { + "max-len": 0, + "no-invalid-this": 0, + "require-jsdoc": 0 } -} +} \ No newline at end of file diff --git a/packages/metal-events/test/EventEmitter.js b/packages/metal-events/test/EventEmitter.js index 2e0762ca..5aacc0da 100644 --- a/packages/metal-events/test/EventEmitter.js +++ b/packages/metal-events/test/EventEmitter.js @@ -12,7 +12,7 @@ describe('EventEmitter', function() { }); it('should emit and listen to events', function() { - var listener = sinon.stub(); + let listener = sinon.stub(); this.emitter.emit('event'); assert.strictEqual(0, listener.callCount); @@ -24,7 +24,7 @@ describe('EventEmitter', function() { }); it('should listen to multiple events on the same call', function() { - var listener = sinon.stub(); + let listener = sinon.stub(); this.emitter.on(['event1', 'event2'], listener); @@ -36,7 +36,7 @@ describe('EventEmitter', function() { }); it('should listen to events through `addListener`', function() { - var listener = sinon.stub(); + let listener = sinon.stub(); this.emitter.addListener(['event1', 'event2'], listener); @@ -48,7 +48,7 @@ describe('EventEmitter', function() { }); it('should listen to event a single time through `once`', function() { - var listener = sinon.stub(); + let listener = sinon.stub(); this.emitter.once('event', listener); assert.strictEqual(0, listener.callCount); @@ -61,7 +61,7 @@ describe('EventEmitter', function() { }); it('should listen to multiple events on the same call to `once`', function() { - var listener = sinon.stub(); + let listener = sinon.stub(); this.emitter.once(['event', 'event2'], listener); assert.strictEqual(0, listener.callCount); @@ -80,7 +80,7 @@ describe('EventEmitter', function() { }); it('should listen to event a fixed number of times through `many`', function() { - var listener = sinon.stub(); + let listener = sinon.stub(); this.emitter.many('event', 2, listener); assert.strictEqual(0, listener.callCount); @@ -96,7 +96,7 @@ describe('EventEmitter', function() { }); it('should listen to multiple events on the same call to `many`', function() { - var listener = sinon.stub(); + let listener = sinon.stub(); this.emitter.many(['event', 'event2'], 2, listener); @@ -120,7 +120,7 @@ describe('EventEmitter', function() { }); it('should ignore calls to `many` with non positive number', function() { - var listener = sinon.stub(); + let listener = sinon.stub(); this.emitter.many('event', 0, listener); this.emitter.emit('event'); @@ -132,11 +132,11 @@ describe('EventEmitter', function() { }); it('should run listeners in the order they were added', function() { - var order = ''; - var listener1 = function() { + let order = ''; + let listener1 = function() { order += '1'; }; - var listener2 = function() { + let listener2 = function() { order += '2'; }; @@ -148,9 +148,9 @@ describe('EventEmitter', function() { }); it('should return all listeners for given event type', function() { - var listener1 = sinon.stub(); - var listener2 = sinon.stub(); - var listener3 = sinon.stub(); + let listener1 = sinon.stub(); + let listener2 = sinon.stub(); + let listener3 = sinon.stub(); this.emitter.on('event', listener1); this.emitter.on('anotherEvent', listener2); @@ -162,8 +162,8 @@ describe('EventEmitter', function() { }); it('should detach events', function() { - var listener = sinon.stub(); - var listener2 = sinon.stub(); + let listener = sinon.stub(); + let listener2 = sinon.stub(); this.emitter.on('event', listener); this.emitter.on('event', listener2); @@ -175,8 +175,8 @@ describe('EventEmitter', function() { }); it('should detach listeners subscribed multiple times to same event', function() { - var listener = sinon.stub(); - var listener2 = sinon.stub(); + let listener = sinon.stub(); + let listener2 = sinon.stub(); this.emitter.on('event', listener); this.emitter.on('event', listener); @@ -190,11 +190,11 @@ describe('EventEmitter', function() { }); it('should detach events via return value', function() { - var listener = sinon.stub(); - var listener2 = sinon.stub(); + let listener = sinon.stub(); + let listener2 = sinon.stub(); this.emitter.on('event', listener); - var handle = this.emitter.on('event', listener2); + let handle = this.emitter.on('event', listener2); handle.removeListener(); this.emitter.emit('event'); @@ -203,8 +203,8 @@ describe('EventEmitter', function() { }); it('should detach events that were listened together', function() { - var listener = sinon.stub(); - var listener2 = sinon.stub(); + let listener = sinon.stub(); + let listener2 = sinon.stub(); this.emitter.on(['event', 'event2'], listener); this.emitter.on(['event', 'event2'], listener2); @@ -220,8 +220,8 @@ describe('EventEmitter', function() { }); it('should detach multiple events with the same call', function() { - var listener = sinon.stub(); - var listener2 = sinon.stub(); + let listener = sinon.stub(); + let listener2 = sinon.stub(); this.emitter.on('event', listener); this.emitter.on('event2', listener); @@ -238,11 +238,11 @@ describe('EventEmitter', function() { }); it('should detach events that were listened together via return value', function() { - var listener = sinon.stub(); - var listener2 = sinon.stub(); + let listener = sinon.stub(); + let listener2 = sinon.stub(); this.emitter.on(['event', 'event2'], listener); - var handle = this.emitter.on(['event', 'event2'], listener2); + let handle = this.emitter.on(['event', 'event2'], listener2); handle.removeListener(); this.emitter.emit('event'); @@ -255,7 +255,7 @@ describe('EventEmitter', function() { }); it('should detach events listened through `once`', function() { - var listener = sinon.stub(); + let listener = sinon.stub(); this.emitter.once('event', listener); this.emitter.off('event', listener); @@ -265,9 +265,9 @@ describe('EventEmitter', function() { }); it('should detach events listened through `once` via return value', function() { - var listener = sinon.stub(); + let listener = sinon.stub(); - var handle = this.emitter.once('event', listener); + let handle = this.emitter.once('event', listener); handle.removeListener(); this.emitter.emit('event'); @@ -275,7 +275,7 @@ describe('EventEmitter', function() { }); it('should detach events listened through `many`', function() { - var listener = sinon.stub(); + let listener = sinon.stub(); this.emitter.many('event', 2, listener); this.emitter.off('event', listener); @@ -285,7 +285,7 @@ describe('EventEmitter', function() { }); it('should detach events listened together through `many`', function() { - var listener = sinon.stub(); + let listener = sinon.stub(); this.emitter.many(['event', 'event2'], 2, listener); this.emitter.off(['event', 'event2'], listener); @@ -296,9 +296,9 @@ describe('EventEmitter', function() { }); it('should detach events listened together through `many` via return value', function() { - var listener = sinon.stub(); + let listener = sinon.stub(); - var handle = this.emitter.many(['event', 'event2'], 2, listener); + let handle = this.emitter.many(['event', 'event2'], 2, listener); handle.removeListener(); this.emitter.emit('event'); @@ -307,9 +307,9 @@ describe('EventEmitter', function() { }); it('should detach events listened through `many` via return value', function() { - var listener = sinon.stub(); + let listener = sinon.stub(); - var handle = this.emitter.many('event', 2, listener); + let handle = this.emitter.many('event', 2, listener); handle.removeListener(); this.emitter.emit('event'); @@ -317,8 +317,8 @@ describe('EventEmitter', function() { }); it('should detach events through `removeListener`', function() { - var listener = sinon.stub(); - var listener2 = sinon.stub(); + let listener = sinon.stub(); + let listener2 = sinon.stub(); this.emitter.on('event', listener); this.emitter.on('event', listener2); @@ -330,15 +330,17 @@ describe('EventEmitter', function() { }); it('should not throw error when detaching event type that was never used before', function() { - var listener = sinon.stub(); - assert.doesNotThrow(function() { - this.emitter.off('event', listener); - }.bind(this)); + let listener = sinon.stub(); + assert.doesNotThrow( + function() { + this.emitter.off('event', listener); + }.bind(this) + ); }); it('should remove all listeners', function() { - var listener1 = sinon.stub(); - var listener2 = sinon.stub(); + let listener1 = sinon.stub(); + let listener2 = sinon.stub(); this.emitter.on('event1', listener1); this.emitter.on('event2', listener2); @@ -352,8 +354,8 @@ describe('EventEmitter', function() { }); it('should remove all listeners of the given type', function() { - var listener1 = sinon.stub(); - var listener2 = sinon.stub(); + let listener1 = sinon.stub(); + let listener2 = sinon.stub(); this.emitter.on('event1', listener1); this.emitter.on('event2', listener2); @@ -367,9 +369,9 @@ describe('EventEmitter', function() { }); it('should remove all listeners of the given types', function() { - var listener1 = sinon.stub(); - var listener2 = sinon.stub(); - var listener3 = sinon.stub(); + let listener1 = sinon.stub(); + let listener2 = sinon.stub(); + let listener3 = sinon.stub(); this.emitter.on('event1', listener1); this.emitter.on('event2', listener2); @@ -391,7 +393,7 @@ describe('EventEmitter', function() { }); it('should only allow functions as listeners', function() { - var self = this; + let self = this; assert.throws(function() { self.emitter.addListener('event', {}); @@ -403,7 +405,7 @@ describe('EventEmitter', function() { }); it('should pass requested arguments to listener on emit', function() { - var listener = sinon.stub(); + let listener = sinon.stub(); this.emitter.on('event', listener); this.emitter.emit('event', 'arg1', 2); @@ -412,7 +414,7 @@ describe('EventEmitter', function() { }); it('should pass facade as last argument when requested', function() { - var listener = sinon.stub(); + let listener = sinon.stub(); this.emitter.setShouldUseFacade(true); this.emitter.on('event', listener); @@ -425,13 +427,13 @@ describe('EventEmitter', function() { sinon.match({ preventDefault: sinon.match.func, target: this.emitter, - type: 'event' + type: 'event', }) ); }); it('should set preventedDefault flag to true on facade when preventDefault is called', function() { - var listener = sinon.stub(); + let listener = sinon.stub(); this.emitter.setShouldUseFacade(true); this.emitter.once('event', function(event) { @@ -446,9 +448,9 @@ describe('EventEmitter', function() { }); it('should emit listener marked as default last', function() { - var listener1 = sinon.stub(); - var listener2 = sinon.stub(); - var listenerDefault = sinon.spy(function() { + let listener1 = sinon.stub(); + let listener2 = sinon.stub(); + let listenerDefault = sinon.spy(function() { assert.strictEqual(1, listener1.callCount); assert.strictEqual(1, listener2.callCount); }); @@ -462,11 +464,11 @@ describe('EventEmitter', function() { }); it('should not call default listener if "preventDefault" is called', function() { - var listener1 = sinon.spy(function(event) { + let listener1 = sinon.spy(function(event) { event.preventDefault(); }); - var listener2 = sinon.stub(); - var listenerDefault = sinon.stub(); + let listener2 = sinon.stub(); + let listenerDefault = sinon.stub(); this.emitter.setShouldUseFacade(true); this.emitter.on('event', listenerDefault, true); @@ -494,7 +496,7 @@ describe('EventEmitter', function() { }); it('should remove all listeners on dispose', function() { - var listener = sinon.stub(); + let listener = sinon.stub(); this.emitter.on('event', listener); this.emitter.dispose(); diff --git a/packages/metal-events/test/EventEmitterProxy.js b/packages/metal-events/test/EventEmitterProxy.js index 232f7d7e..2099bd82 100644 --- a/packages/metal-events/test/EventEmitterProxy.js +++ b/packages/metal-events/test/EventEmitterProxy.js @@ -5,11 +5,11 @@ import EventEmitterProxy from '../src/EventEmitterProxy'; describe('EventEmitterProxy', function() { it('should proxy event from origin to target', function() { - var origin = new EventEmitter(); - var target = new EventEmitter(); + let origin = new EventEmitter(); + let target = new EventEmitter(); new EventEmitterProxy(origin, target); - var listener = sinon.stub(); + let listener = sinon.stub(); target.on('event1', listener); origin.emit('event1', 1, 2); @@ -19,13 +19,13 @@ describe('EventEmitterProxy', function() { }); it('should not proxy blacklisted event', function() { - var origin = new EventEmitter(); - var target = new EventEmitter(); + let origin = new EventEmitter(); + let target = new EventEmitter(); new EventEmitterProxy(origin, target, { - event1: true + event1: true, }); - var listener = sinon.stub(); + let listener = sinon.stub(); target.on('event1', listener); origin.emit('event1', 1, 2); @@ -33,13 +33,13 @@ describe('EventEmitterProxy', function() { }); it('should proxy only whitelisted events', function() { - var origin = new EventEmitter(); - var target = new EventEmitter(); + let origin = new EventEmitter(); + let target = new EventEmitter(); new EventEmitterProxy(origin, target, null, { - event1: true + event1: true, }); - var listener = sinon.stub(); + let listener = sinon.stub(); target.on('event1', listener); target.on('event2', listener); origin.emit('event1', 1, 2); @@ -49,15 +49,20 @@ describe('EventEmitterProxy', function() { }); it('should not proxy event that is both whitelisted and blacklisted', function() { - var origin = new EventEmitter(); - var target = new EventEmitter(); - new EventEmitterProxy(origin, target, { - event1: true - }, { - event1: true - }); - - var listener = sinon.stub(); + let origin = new EventEmitter(); + let target = new EventEmitter(); + new EventEmitterProxy( + origin, + target, + { + event1: true, + }, + { + event1: true, + } + ); + + let listener = sinon.stub(); target.on('event1', listener); target.on('event2', listener); origin.emit('event1', 1, 2); @@ -67,13 +72,13 @@ describe('EventEmitterProxy', function() { }); it('should only emit proxied event once per listener', function() { - var origin = new EventEmitter(); - var target = new EventEmitter(); + let origin = new EventEmitter(); + let target = new EventEmitter(); new EventEmitterProxy(origin, target); - var listener1 = sinon.stub(); + let listener1 = sinon.stub(); target.on('event1', listener1); - var listener2 = sinon.stub(); + let listener2 = sinon.stub(); target.on('event1', listener2); origin.emit('event1', 1, 2); @@ -82,14 +87,14 @@ describe('EventEmitterProxy', function() { }); it('should change the emitter that events are proxied from', function() { - var origin = new EventEmitter(); - var target = new EventEmitter(); - var proxy = new EventEmitterProxy(origin, target); + let origin = new EventEmitter(); + let target = new EventEmitter(); + let proxy = new EventEmitterProxy(origin, target); - var listener = sinon.stub(); + let listener = sinon.stub(); target.on('event1', listener); - var origin2 = new EventEmitter(); + let origin2 = new EventEmitter(); proxy.setOriginEmitter(origin2); origin.emit('event1', 1, 2); @@ -102,13 +107,13 @@ describe('EventEmitterProxy', function() { }); it('should remove listeners after changing the emitter that events were proxied from', function() { - var target = new EventEmitter(); - var proxy = new EventEmitterProxy(new EventEmitter(), target); + let target = new EventEmitter(); + let proxy = new EventEmitterProxy(new EventEmitter(), target); - var listener = sinon.stub(); + let listener = sinon.stub(); target.on('event1', listener); - var origin2 = new EventEmitter(); + let origin2 = new EventEmitter(); proxy.setOriginEmitter(origin2); proxy.dispose(); @@ -117,27 +122,27 @@ describe('EventEmitterProxy', function() { }); it('should not throw error if origin emitter is set to null', function() { - var origin = new EventEmitter(); - var target = new EventEmitter(); - var proxy = new EventEmitterProxy(origin, target); + let origin = new EventEmitter(); + let target = new EventEmitter(); + let proxy = new EventEmitterProxy(origin, target); - var listener = sinon.stub(); + let listener = sinon.stub(); target.on('event1', listener); assert.doesNotThrow(() => proxy.setOriginEmitter(null)); }); it('should pass proxied events to new origin emitters, even when no emitter exists for a while', function() { - var origin = new EventEmitter(); - var target = new EventEmitter(); - var proxy = new EventEmitterProxy(origin, target); + let origin = new EventEmitter(); + let target = new EventEmitter(); + let proxy = new EventEmitterProxy(origin, target); - var listener = sinon.stub(); + let listener = sinon.stub(); target.on('event1', listener); proxy.setOriginEmitter(null); - var origin2 = new EventEmitter(); + let origin2 = new EventEmitter(); proxy.setOriginEmitter(origin2); origin.emit('event1', 1, 2); @@ -150,13 +155,13 @@ describe('EventEmitterProxy', function() { }); it('should allow manually choosing events to be proxied', function() { - var origin = new EventEmitter(); - var target = new EventEmitter(); + let origin = new EventEmitter(); + let target = new EventEmitter(); - var listener = sinon.stub(); + let listener = sinon.stub(); target.on('event1', listener); - var proxy = new EventEmitterProxy(origin, target); + let proxy = new EventEmitterProxy(origin, target); proxy.proxyEvent('event1'); origin.emit('event1', 1, 2); @@ -166,11 +171,11 @@ describe('EventEmitterProxy', function() { }); it('should not proxy events after disposed', function() { - var origin = new EventEmitter(); - var target = new EventEmitter(); - var proxy = new EventEmitterProxy(origin, target); + let origin = new EventEmitter(); + let target = new EventEmitter(); + let proxy = new EventEmitterProxy(origin, target); - var listener = sinon.stub(); + let listener = sinon.stub(); target.on('event1', listener); proxy.dispose(); diff --git a/packages/metal-events/test/EventHandle.js b/packages/metal-events/test/EventHandle.js index 2eb84890..e6baccb3 100644 --- a/packages/metal-events/test/EventHandle.js +++ b/packages/metal-events/test/EventHandle.js @@ -5,9 +5,9 @@ import EventEmitter from '../src/EventEmitter'; describe('EventHandle', function() { it('should unsubscribe the listener', function() { - var emitter = new EventEmitter(); - var listener = sinon.stub(); - var handle = new EventHandle(emitter, 'event', listener); + let emitter = new EventEmitter(); + let listener = sinon.stub(); + let handle = new EventHandle(emitter, 'event', listener); emitter.on('event', listener); emitter.on('event2', listener); @@ -21,18 +21,18 @@ describe('EventHandle', function() { }); it('should not throw error when removing listener on disposed emitter', function() { - var emitter = new EventEmitter(); - var listener = sinon.stub(); - var handle = new EventHandle(emitter, 'event', listener); + let emitter = new EventEmitter(); + let listener = sinon.stub(); + let handle = new EventHandle(emitter, 'event', listener); emitter.dispose(); handle.removeListener(); }); it('should remove listeners when disposed', function() { - var emitter = new EventEmitter(); - var listener = sinon.stub(); - var handle = new EventHandle(emitter, 'event', listener); + let emitter = new EventEmitter(); + let listener = sinon.stub(); + let handle = new EventHandle(emitter, 'event', listener); emitter.on('event', listener); handle.dispose(); emitter.emit('event'); diff --git a/packages/metal-events/test/EventHandler.js b/packages/metal-events/test/EventHandler.js index 19a84e10..a7a7b893 100644 --- a/packages/metal-events/test/EventHandler.js +++ b/packages/metal-events/test/EventHandler.js @@ -5,11 +5,11 @@ import EventHandler from '../src/EventHandler'; describe('EventHandler', function() { it('should remove all added listeners', function() { - var emitter1 = new EventEmitter(); - var emitter2 = new EventEmitter(); - var handler = new EventHandler(); - var listener1 = sinon.stub(); - var listener2 = sinon.stub(); + let emitter1 = new EventEmitter(); + let emitter2 = new EventEmitter(); + let handler = new EventHandler(); + let listener1 = sinon.stub(); + let listener2 = sinon.stub(); handler.add( emitter1.on('event1', listener1), @@ -43,9 +43,9 @@ describe('EventHandler', function() { }); it('should clear listeners on dispose', function() { - var emitter = new EventEmitter(); - var handler = new EventHandler(); - var listener = sinon.stub(); + let emitter = new EventEmitter(); + let handler = new EventHandler(); + let listener = sinon.stub(); handler.add(emitter.on('event', listener)); handler.dispose(); diff --git a/packages/metal-incremental-dom/.eslintrc b/packages/metal-incremental-dom/.eslintrc new file mode 100644 index 00000000..8ea512bf --- /dev/null +++ b/packages/metal-incremental-dom/.eslintrc @@ -0,0 +1,9 @@ +{ + "globals": { + "IncrementalDOM": true + }, + "rules": { + "prefer-rest-params": 0, + "require-jsdoc": 0 + } +} diff --git a/packages/metal-incremental-dom/README.md b/packages/metal-incremental-dom/README.md index 2cde0d35..bab645f1 100644 --- a/packages/metal-incremental-dom/README.md +++ b/packages/metal-incremental-dom/README.md @@ -1,3 +1,5 @@ # metal-incremental-dom A Component renderer for templates compiled to incremental dom. + +See [https://metaljs.com/](https://metaljs.com/) for documentation. diff --git a/packages/metal-incremental-dom/package-lock.json b/packages/metal-incremental-dom/package-lock.json index fd905d11..84282c1e 100644 --- a/packages/metal-incremental-dom/package-lock.json +++ b/packages/metal-incremental-dom/package-lock.json @@ -64,7 +64,7 @@ "lodash": "4.17.4", "minimatch": "3.0.4", "path-is-absolute": "1.0.1", - "private": "0.1.7", + "private": "0.1.8", "slash": "1.0.0", "source-map": "0.5.7" } @@ -507,9 +507,9 @@ } }, "babel-preset-env": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.6.0.tgz", - "integrity": "sha512-OVgtQRuOZKckrILgMA5rvctvFZPv72Gua9Rt006AiPoB0DJKGN07UmaQA+qRrYgK71MVct8fFhT0EyNWYorVew==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.6.1.tgz", + "integrity": "sha512-W6VIyA6Ch9ePMI7VptNn2wBM6dbG0eSz25HEiL40nQXCsXGTGZSTZu1Iap+cj3Q0S5a7T9+529l/5Bkvd+afNA==", "requires": { "babel-plugin-check-es2015-constants": "6.22.0", "babel-plugin-syntax-trailing-function-commas": "6.22.0", @@ -538,7 +538,7 @@ "babel-plugin-transform-es2015-unicode-regex": "6.24.1", "babel-plugin-transform-exponentiation-operator": "6.24.1", "babel-plugin-transform-regenerator": "6.26.0", - "browserslist": "2.5.1", + "browserslist": "2.8.0", "invariant": "2.2.2", "semver": "5.4.1" } @@ -625,18 +625,18 @@ } }, "browserslist": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-2.5.1.tgz", - "integrity": "sha512-jAvM2ku7YDJ+leAq3bFH1DE0Ylw+F+EQDq4GkqZfgPEqpWYw9ofQH85uKSB9r3Tv7XDbfqVtE+sdvKJW7IlPJA==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-2.8.0.tgz", + "integrity": "sha512-iiWHM1Et6Q4TQpB7Ar6pxuM3TNMXasVJY4Y/oh3q38EwR3Z+IdZ9MyVf7PI4MJFB4xpwMcZgs9bEUnPG2E3TCA==", "requires": { - "caniuse-lite": "1.0.30000746", - "electron-to-chromium": "1.3.25" + "caniuse-lite": "1.0.30000760", + "electron-to-chromium": "1.3.27" } }, "caniuse-lite": { - "version": "1.0.30000746", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000746.tgz", - "integrity": "sha1-xk+Vo5Jc/TAgejCO12wa6W6gnqA=" + "version": "1.0.30000760", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000760.tgz", + "integrity": "sha1-7HIDlXQvHH7IlH/W3SYE53qPmP8=" }, "chalk": { "version": "1.1.3", @@ -687,9 +687,9 @@ } }, "electron-to-chromium": { - "version": "1.3.25", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.25.tgz", - "integrity": "sha1-RTshAJg20Jl9hgNWAf9srkeRxGA=" + "version": "1.3.27", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.27.tgz", + "integrity": "sha1-eOy4o5kGYYe7N07t412ccFZagD0=" }, "escape-string-regexp": { "version": "1.0.5", @@ -889,9 +889,9 @@ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "private": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/private/-/private-0.1.7.tgz", - "integrity": "sha1-aM5eih7woju1cMwoU3tTMqumPvE=" + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", + "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==" }, "regenerate": { "version": "1.3.3", @@ -910,7 +910,7 @@ "requires": { "babel-runtime": "6.26.0", "babel-types": "6.26.0", - "private": "0.1.7" + "private": "0.1.8" } }, "regexpu-core": { diff --git a/packages/metal-incremental-dom/src/IncrementalDomRenderer.js b/packages/metal-incremental-dom/src/IncrementalDomRenderer.js index 969f26a4..8c64eaa0 100644 --- a/packages/metal-incremental-dom/src/IncrementalDomRenderer.js +++ b/packages/metal-incremental-dom/src/IncrementalDomRenderer.js @@ -1,12 +1,12 @@ 'use strict'; import './incremental-dom'; -import { getChanges, trackChanges } from './changes'; -import { clearData, getData } from './data'; -import { getOwner } from './children/children'; -import { getPatchingComponent, patch } from './render/patch'; -import { render, renderChild, renderFunction } from './render/render'; -import { Component, ComponentRenderer } from 'metal-component'; +import {getChanges, trackChanges} from './changes'; +import {clearData, getData} from './data'; +import {getOwner} from './children/children'; +import {getPatchingComponent, patch} from './render/patch'; +import {render, renderChild, renderFunction} from './render/render'; +import {Component, ComponentRenderer} from 'metal-component'; class IncrementalDomRenderer extends ComponentRenderer.constructor { /** @@ -110,19 +110,18 @@ class IncrementalDomRenderer extends ComponentRenderer.constructor { * through incremental dom function calls. If the first arg is a function * instead of a component instance, creates and renders this function, which * can either be a simple incremental dom function or a component constructor. - * @param {!Component} component * @param {!Component|function()} component Can be a component instance, a * simple incremental dom function or a component constructor. - * @param {Object|Element=} opt_dataOrElement Optional config data for the + * @param {Object|Element=} dataOrElement Optional config data for the * function, or parent for the rendered content. - * @param {Element=} opt_parent Optional parent for the rendered content. + * @param {Element=} parent Optional parent for the rendered content. * @return {!Component} The rendered component's instance. */ - render(component, opt_dataOrElement, opt_parent) { + render(component, dataOrElement, parent) { if (component instanceof Component) { this.patch(component); } else { - return renderFunction(this, component, opt_dataOrElement, opt_parent); + return renderFunction(this, component, dataOrElement, parent); } } @@ -156,7 +155,8 @@ class IncrementalDomRenderer extends ComponentRenderer.constructor { renderInsidePatch(component) { const changes = getChanges(component); - const shouldRender = !component.wasRendered || + const shouldRender = + !component.wasRendered || this.shouldUpdate(component, changes) || IncrementalDOM.currentPointer() !== component.element; if (shouldRender) { @@ -193,7 +193,9 @@ class IncrementalDomRenderer extends ComponentRenderer.constructor { return false; } if (component.shouldUpdate) { - return component.shouldUpdate(...this.buildShouldUpdateArgs(changes)); + return component.shouldUpdate( + ...this.buildShouldUpdateArgs(changes) + ); // eslint-disable-line } return true; } diff --git a/packages/metal-incremental-dom/src/all/incremental-dom.js b/packages/metal-incremental-dom/src/all/incremental-dom.js index 98b699d5..e2d8cc14 100644 --- a/packages/metal-incremental-dom/src/all/incremental-dom.js +++ b/packages/metal-incremental-dom/src/all/incremental-dom.js @@ -1,5 +1,5 @@ import HTML2IncDom from '../html/HTML2IncDom'; import IncrementalDomRenderer from '../IncrementalDomRenderer'; -export { HTML2IncDom }; +export {HTML2IncDom}; export default IncrementalDomRenderer; diff --git a/packages/metal-incremental-dom/src/changes.js b/packages/metal-incremental-dom/src/changes.js index d26b3ec7..829e6e5c 100644 --- a/packages/metal-incremental-dom/src/changes.js +++ b/packages/metal-incremental-dom/src/changes.js @@ -1,6 +1,6 @@ 'use strict'; -import { getData } from './data'; +import {getData} from './data'; /** * Clears the changes tracked so far. diff --git a/packages/metal-incremental-dom/src/children/children.js b/packages/metal-incremental-dom/src/children/children.js index 73420033..8369a5fa 100644 --- a/packages/metal-incremental-dom/src/children/children.js +++ b/packages/metal-incremental-dom/src/children/children.js @@ -1,8 +1,8 @@ 'use strict'; -import { buildCallFromConfig, buildConfigFromCall } from '../callArgs'; -import { isDef } from 'metal'; -import { startInterception, stopInterception } from '../incremental-dom-aop'; +import {buildCallFromConfig, buildConfigFromCall} from '../callArgs'; +import {isDef} from 'metal'; +import {startInterception, stopInterception} from '../incremental-dom-aop'; /** * Property identifying a specific object as a Metal.js child node, and @@ -24,8 +24,8 @@ export function captureChildren(component, callback, data) { callbackData_ = data; tree_ = { props: { - children: [] - } + children: [], + }, }; tree_.config = tree_.props; currentParent_ = tree_; @@ -33,7 +33,7 @@ export function captureChildren(component, callback, data) { startInterception({ elementClose: handleInterceptedCloseCall_, elementOpen: handleInterceptedOpenCall_, - text: handleInterceptedTextCall_ + text: handleInterceptedTextCall_, }); } @@ -57,19 +57,19 @@ export function getOwner(node) { /** * Renders a children tree through incremental dom. - * @param {!{args: Array, children: !Array, isText: ?boolean}} - * @param {function()=} opt_skipNode Optional function that is called for + * @param {!{args: Array, children: !Array, isText: ?boolean}} tree + * @param {function()=} skipNode Optional function that is called for * each node to be rendered. If it returns true, the node will be skipped. * @protected */ -export function renderChildTree(tree, opt_skipNode) { +export function renderChildTree(tree, skipNode) { if (isCapturing_) { // If capturing, just add the node directly to the captured tree. addChildToTree(tree); return; } - if (opt_skipNode && opt_skipNode.call(null, tree)) { + if (skipNode && skipNode.call(null, tree)) { return; } @@ -81,12 +81,12 @@ export function renderChildTree(tree, opt_skipNode) { let args = buildCallFromConfig(tree.tag, tree.props); args[0] = { tag: args[0], - owner: getOwner(tree) + owner: getOwner(tree), }; IncrementalDOM.elementOpen.apply(null, args); if (tree.props.children) { for (let i = 0; i < tree.props.children.length; i++) { - renderChildTree(tree.props.children[i], opt_skipNode); + renderChildTree(tree.props.children[i], skipNode); } } IncrementalDOM.elementClose(tree.tag); @@ -103,17 +103,18 @@ let tree_; /** * Adds a child element to the tree. * @param {!Array} args The arguments passed to the incremental dom call. - * @param {boolean=} opt_isText Optional flag indicating if the child is a + * @param {boolean=} isText Optional flag indicating if the child is a * text element. * @protected + * @return {Object} */ -function addChildCallToTree_(args, opt_isText) { +function addChildCallToTree_(args, isText = false) { const child = { parent: currentParent_, - [CHILD_OWNER]: owner_ + [CHILD_OWNER]: owner_, }; - if (opt_isText) { + if (isText) { child.text = args[0]; if (args.length > 1) { child.args = args; @@ -137,6 +138,7 @@ function addChildToTree(child) { * Handles an intercepted call to the `elementClose` function from incremental * dom. * @protected + * @return {Element | boolean} */ function handleInterceptedCloseCall_() { if (currentParent_ === tree_) { diff --git a/packages/metal-incremental-dom/src/cleanup/unused.js b/packages/metal-incremental-dom/src/cleanup/unused.js index ecb07801..6489a6d3 100644 --- a/packages/metal-incremental-dom/src/cleanup/unused.js +++ b/packages/metal-incremental-dom/src/cleanup/unused.js @@ -1,6 +1,6 @@ 'use strict'; -import { getData } from '../data'; +import {getData} from '../data'; let comps_ = []; let disposing_ = false; diff --git a/packages/metal-incremental-dom/src/html/HTML2IncDom.js b/packages/metal-incremental-dom/src/html/HTML2IncDom.js index 8b1004d3..e478db5e 100644 --- a/packages/metal-incremental-dom/src/html/HTML2IncDom.js +++ b/packages/metal-incremental-dom/src/html/HTML2IncDom.js @@ -3,7 +3,7 @@ import HTMLParser from './HTMLParser'; import unescape from './unescape'; -var parser_; +let parser_; class HTML2IncDom { /** @@ -32,16 +32,14 @@ class HTML2IncDom { static run(html) { HTML2IncDom.getParser()(html, { start: function(tag, attrs, unary) { - var fn = unary ? IncrementalDOM.elementVoid : IncrementalDOM.elementOpen; - var args = [ - tag, - null, - [] - ]; - for (var i = 0; i < attrs.length; i++) { + let fn = unary + ? IncrementalDOM.elementVoid + : IncrementalDOM.elementOpen; + let args = [tag, null, []]; + for (let i = 0; i < attrs.length; i++) { args.push(attrs[i].name, attrs[i].value); } - fn.apply(null, args); + fn(...args); }, end: function(tag) { @@ -50,7 +48,7 @@ class HTML2IncDom { chars: function(text) { IncrementalDOM.text(text, unescape); - } + }, }); } @@ -61,7 +59,7 @@ class HTML2IncDom { * any function that follows that same api, basically accepting the html * string and an object with `start`, `end` and `chars` functions to be called * during the parsing. - * @param {!function(string, !Object} newParser + * @param {!function(string, !Object)} newParser */ static setParser(newParser) { parser_ = newParser; diff --git a/packages/metal-incremental-dom/src/html/HTMLParser.js b/packages/metal-incremental-dom/src/html/HTMLParser.js index 0cb0aeb5..2b56d754 100644 --- a/packages/metal-incremental-dom/src/html/HTMLParser.js +++ b/packages/metal-incremental-dom/src/html/HTMLParser.js @@ -91,27 +91,39 @@ var startTag = /^<([-A-Za-z0-9_]+)((?:\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\s*=\s*(?: attr = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g; // Empty Elements - HTML 5 -var empty = makeMap("area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr"); +var empty = makeMap( + 'area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr' +); // Block Elements - HTML 5 -var block = makeMap("a,address,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video"); +var block = makeMap( + 'a,address,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video' +); // Inline Elements - HTML 5 -var inline = makeMap("abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var"); +var inline = makeMap( + 'abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var' +); // Elements that you can, intentionally, leave open // (and which close themselves) -var closeSelf = makeMap("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr"); +var closeSelf = makeMap('colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr'); // Attributes that have their values filled in disabled="disabled" -var fillAttrs = makeMap("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"); +var fillAttrs = makeMap( + 'checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected' +); // Special Elements (can contain anything) -var special = makeMap("script,style"); +var special = makeMap('script,style'); -var HTMLParser = function (html, handler) { - var index, chars, match, stack = [], last = html; - stack.last = function () { +var HTMLParser = function(html, handler) { + var index, + chars, + match, + stack = [], + last = html; + stack.last = function() { return this[this.length - 1]; }; @@ -120,10 +132,9 @@ var HTMLParser = function (html, handler) { // Make sure we're not in a script or style element if (!stack.last() || !special[stack.last()]) { - // Comment - if (html.indexOf(""); + if (html.indexOf(''); if (index >= 0) { if (handler.comment) @@ -133,7 +144,7 @@ var HTMLParser = function (html, handler) { } // end tag - } else if (html.indexOf("]*>"), function (all, text) { - text = text.replace(/|/g, "$1$2"); - if (handler.chars) - handler.chars(text); - - return ""; - }); + html = html.replace( + new RegExp('([\\s\\S]*?)]*>'), + function(all, text) { + text = text.replace( + /|/g, + '$1$2' + ); + if (handler.chars) handler.chars(text); + + return ''; + } + ); - parseEndTag("", stack.last()); + parseEndTag('', stack.last()); } - if (html == last) - throw "Parse Error: " + html; + if (html == last) throw 'Parse Error: ' + html; last = html; } @@ -191,57 +204,58 @@ var HTMLParser = function (html, handler) { // usually add anything they want to spans, and browsers allow it). // Note: this exception for "span" was added manually (i.e. it's not // present in the original code). - while (stack.last() && inline[stack.last()] && stack.last() !== 'span') { - parseEndTag("", stack.last()); + while ( + stack.last() && + inline[stack.last()] && + stack.last() !== 'span' + ) { + parseEndTag('', stack.last()); } } if (closeSelf[tagName] && stack.last() == tagName) { - parseEndTag("", tagName); + parseEndTag('', tagName); } unary = empty[tagName] || !!unary; - if (!unary) - stack.push(tagName); + if (!unary) stack.push(tagName); if (handler.start) { var attrs = []; - rest.replace(attr, function (match, name) { - var value = arguments[2] ? arguments[2] : - arguments[3] ? arguments[3] : - arguments[4] ? arguments[4] : - fillAttrs[name] ? name : ""; + rest.replace(attr, function(match, name) { + var value = arguments[2] + ? arguments[2] + : arguments[3] + ? arguments[3] + : arguments[4] + ? arguments[4] + : fillAttrs[name] ? name : ''; attrs.push({ name: name, value: value, - escaped: value.replace(/(^|[^\\])"/g, '$1\\\"') //" + escaped: value.replace(/(^|[^\\])"/g, '$1\\"') //" }); }); - if (handler.start) - handler.start(tagName, attrs, unary); + if (handler.start) handler.start(tagName, attrs, unary); } } function parseEndTag(tag, tagName) { // If no tag name is provided, clean shop - if (!tagName) - var pos = 0; - - // Find the closest opened tag of the same type + if (!tagName) var pos = 0; else + // Find the closest opened tag of the same type for (var pos = stack.length - 1; pos >= 0; pos--) - if (stack[pos] == tagName) - break; + if (stack[pos] == tagName) break; if (pos >= 0) { // Close all the open elements, up the stack for (var i = stack.length - 1; i >= pos; i--) - if (handler.end) - handler.end(stack[i]); + if (handler.end) handler.end(stack[i]); // Remove the open elements from the stack stack.length = pos; @@ -250,9 +264,9 @@ var HTMLParser = function (html, handler) { }; function makeMap(str) { - var obj = {}, items = str.split(","); - for (var i = 0; i < items.length; i++) - obj[items[i]] = true; + var obj = {}, + items = str.split(','); + for (var i = 0; i < items.length; i++) obj[items[i]] = true; return obj; } diff --git a/packages/metal-incremental-dom/src/html/unescape.js b/packages/metal-incremental-dom/src/html/unescape.js index 347eb9eb..1bc28b61 100644 --- a/packages/metal-incremental-dom/src/html/unescape.js +++ b/packages/metal-incremental-dom/src/html/unescape.js @@ -21,43 +21,43 @@ * @param {string} str The string to unescape. * @return {string} The unescaped {@code str} string. */ - function unescape(str) { - /** @type {!Object} */ - var seen = {'&': '&', '<': '<', '>': '>', '"': '"'}; - var div = document.createElement('div'); +function unescape(str) { + /** @type {!Object} */ + let seen = {'&': '&', '<': '<', '>': '>', '"': '"'}; + let div = document.createElement('div'); - // Match as many valid entity characters as possible. If the actual entity - // happens to be shorter, it will still work as innerHTML will return the - // trailing characters unchanged. Since the entity characters do not include - // open angle bracket, there is no chance of XSS from the innerHTML use. - // Since no whitespace is passed to innerHTML, whitespace is preserved. - return str.replace(HTML_ENTITY_PATTERN_, function(s, entity) { - // Check for cached entity. - var value = seen[s]; - if (value) { - return value; - } - // Check for numeric entity. - if (entity.charAt(0) === '#') { - // Prefix with 0 so that hex entities (e.g. ) parse as hex numbers. - var n = Number('0' + entity.substr(1)); - if (!isNaN(n)) { - value = String.fromCharCode(n); - } - } - // Fall back to innerHTML otherwise. - if (!value) { - // Append a non-entity character to avoid a bug in Webkit that parses - // an invalid entity at the end of innerHTML text as the empty string. - div.innerHTML = s + ' '; - // Then remove the trailing character from the result. - value = div.firstChild.nodeValue.slice(0, -1); - } - // Cache and return. - seen[s] = value; - return value; - }); - } + // Match as many valid entity characters as possible. If the actual entity + // happens to be shorter, it will still work as innerHTML will return the + // trailing characters unchanged. Since the entity characters do not include + // open angle bracket, there is no chance of XSS from the innerHTML use. + // Since no whitespace is passed to innerHTML, whitespace is preserved. + return str.replace(HTML_ENTITY_PATTERN_, function(s, entity) { + // Check for cached entity. + let value = seen[s]; + if (value) { + return value; + } + // Check for numeric entity. + if (entity.charAt(0) === '#') { + // Prefix with 0 so that hex entities (e.g. ) parse as hex numbers. + let n = Number('0' + entity.substr(1)); + if (!isNaN(n)) { + value = String.fromCharCode(n); + } + } + // Fall back to innerHTML otherwise. + if (!value) { + // Append a non-entity character to avoid a bug in Webkit that parses + // an invalid entity at the end of innerHTML text as the empty string. + div.innerHTML = s + ' '; + // Then remove the trailing character from the result. + value = div.firstChild.nodeValue.slice(0, -1); + } + // Cache and return. + seen[s] = value; + return value; + }); +} export default unescape; @@ -65,4 +65,4 @@ export default unescape; * Regular expression that matches an HTML entity. * @type {!RegExp} */ -var HTML_ENTITY_PATTERN_ = /&([^;\s<&]+);?/g; +const HTML_ENTITY_PATTERN_ = /&([^;\s<&]+);?/g; diff --git a/packages/metal-incremental-dom/src/incremental-dom-aop.js b/packages/metal-incremental-dom/src/incremental-dom-aop.js index bed50f39..b01bf5c3 100644 --- a/packages/metal-incremental-dom/src/incremental-dom-aop.js +++ b/packages/metal-incremental-dom/src/incremental-dom-aop.js @@ -55,7 +55,7 @@ const originalFns = { elementOpenEnd: IncrementalDOM.elementOpenEnd, elementOpenStart: IncrementalDOM.elementOpenStart, elementVoid: IncrementalDOM.elementVoid, - text: IncrementalDOM.text + text: IncrementalDOM.text, }; const fnStack = []; @@ -85,7 +85,7 @@ function getStack() { function buildHandleCall(name) { const data = { - name + name, }; const fn = handleCall.bind(data); return fn; @@ -95,7 +95,7 @@ function handleCall() { const name = this.name; // eslint-disable-line const stack = getStack(); const fn = (stack && stack[name]) || originalFns[name]; - return fn.apply(null, arguments); + return fn(...arguments); } IncrementalDOM.attr = buildHandleCall('attr'); diff --git a/packages/metal-incremental-dom/src/incremental-dom.js b/packages/metal-incremental-dom/src/incremental-dom.js index f476f793..c8cc54d5 100644 --- a/packages/metal-incremental-dom/src/incremental-dom.js +++ b/packages/metal-incremental-dom/src/incremental-dom.js @@ -1,6 +1,6 @@ import * as IncrementalDOM from 'incremental-dom'; import * as IncrementalDOMString from 'incremental-dom-string'; -import { isServerSide } from 'metal'; +import {isServerSide} from 'metal'; if (isServerSide()) { // Overrides global.IncrementalDOM virtual elements with incremental dom @@ -9,7 +9,10 @@ if (isServerSide()) { // browser. global.IncrementalDOM = IncrementalDOMString; } else { - var scope = (typeof exports !== 'undefined' && typeof global !== 'undefined') ? global : window; + let scope = + typeof exports !== 'undefined' && typeof global !== 'undefined' + ? global + : window; - scope.IncrementalDOM = IncrementalDOM; + scope.IncrementalDOM = IncrementalDOM; } diff --git a/packages/metal-incremental-dom/src/intercept.js b/packages/metal-incremental-dom/src/intercept.js index cc8ebee9..b7bcc8a5 100644 --- a/packages/metal-incremental-dom/src/intercept.js +++ b/packages/metal-incremental-dom/src/intercept.js @@ -66,7 +66,7 @@ const originalFns = { elementOpenEnd: IncrementalDOM.elementOpenEnd, elementOpenStart: IncrementalDOM.elementOpenStart, elementVoid: IncrementalDOM.elementVoid, - text: IncrementalDOM.text + text: IncrementalDOM.text, }; const fnStack = []; @@ -96,7 +96,7 @@ function getStack() { function buildHandleCall(name) { const data = { - name + name, }; const fn = handleCall.bind(data); return fn; @@ -106,7 +106,7 @@ function handleCall() { const name = this.name; // eslint-disable-line const stack = getStack(); const fn = (stack && stack[name]) || originalFns[name]; - return fn.apply(null, arguments); + return fn(...arguments); } IncrementalDOM.attr = buildHandleCall('attr'); diff --git a/packages/metal-incremental-dom/src/render/attributes.js b/packages/metal-incremental-dom/src/render/attributes.js index c4c94a7e..cc78f14e 100644 --- a/packages/metal-incremental-dom/src/render/attributes.js +++ b/packages/metal-incremental-dom/src/render/attributes.js @@ -1,10 +1,10 @@ 'use strict'; -import { isServerSide } from 'metal'; -import { delegate } from 'metal-dom'; -import { getComponentFn } from 'metal-component'; -import { getOriginalFn } from '../incremental-dom-aop'; -import { isBoolean, isDefAndNotNull, isString } from 'metal'; +import {isServerSide} from 'metal'; +import {delegate} from 'metal-dom'; +import {getComponentFn} from 'metal-component'; +import {getOriginalFn} from '../incremental-dom-aop'; +import {isBoolean, isDefAndNotNull, isString} from 'metal'; const HANDLE_SUFFIX = '__handle__'; const LISTENER_REGEX = /^(?:on([A-Z].+))|(?:data-on(.+))$/; diff --git a/packages/metal-incremental-dom/src/render/patch.js b/packages/metal-incremental-dom/src/render/patch.js index 501c815b..42a523db 100644 --- a/packages/metal-incremental-dom/src/render/patch.js +++ b/packages/metal-incremental-dom/src/render/patch.js @@ -1,8 +1,8 @@ 'use strict'; -import { append, exitDocument } from 'metal-dom'; -import { getData } from '../data'; -import { render } from './render'; +import {append, exitDocument} from 'metal-dom'; +import {getData} from '../data'; +import {render} from './render'; const patchingComponents_ = []; @@ -10,6 +10,7 @@ const patchingComponents_ = []; * Guarantees that the component's element has a parent. That's necessary * when calling incremental dom's `patchOuter` for now, as otherwise it will * throw an error if the element needs to be replaced. + * @param {Element} element * @return {Element} The parent, in case it was added. * @private */ @@ -30,11 +31,11 @@ function buildParentIfNecessary_(element) { * Calls incremental dom's patch function. * @param {!Component} component The component to patch. * @param {!Element} element The element the component should be patched on. - * @param {boolean=} opt_outer Flag indicating if `patchOuter` should be used + * @param {boolean=} outer Flag indicating if `patchOuter` should be used * instead of `patch`. * @private */ -function callPatch_(component, element, opt_outer) { +function callPatch_(component, element, outer) { patchingComponents_.push(component); const data = getData(component); @@ -43,7 +44,7 @@ function callPatch_(component, element, opt_outer) { data.render = render.bind(null, component); } - const patchFn = opt_outer ? IncrementalDOM.patchOuter : IncrementalDOM.patch; + const patchFn = outer ? IncrementalDOM.patchOuter : IncrementalDOM.patch; patchFn(element, data.render); patchingComponents_.pop(); diff --git a/packages/metal-incremental-dom/src/render/render.js b/packages/metal-incremental-dom/src/render/render.js index 3f86e097..2a1801cc 100644 --- a/packages/metal-incremental-dom/src/render/render.js +++ b/packages/metal-incremental-dom/src/render/render.js @@ -1,15 +1,32 @@ 'use strict'; -import { applyAttribute, convertListenerNamesToFns } from './attributes'; -import { buildConfigFromCall, buildCallFromConfig } from '../callArgs'; -import { captureChildren, getOwner, isChildTag, renderChildTree } from '../children/children'; -import { clearChanges } from '../changes'; -import { domData } from 'metal-dom'; -import { getData } from '../data'; -import { getCompatibilityModeData, getUid, isDef, isDefAndNotNull, isFunction, isString, object } from 'metal'; -import { disposeUnused, schedule } from '../cleanup/unused'; -import { getOriginalFn, startInterception, stopInterception } from '../incremental-dom-aop'; -import { Component, ComponentRegistry } from 'metal-component'; +import {applyAttribute, convertListenerNamesToFns} from './attributes'; +import {buildConfigFromCall, buildCallFromConfig} from '../callArgs'; +import { + captureChildren, + getOwner, + isChildTag, + renderChildTree, +} from '../children/children'; +import {clearChanges} from '../changes'; +import {domData} from 'metal-dom'; +import {getData} from '../data'; +import { + getCompatibilityModeData, + getUid, + isDef, + isDefAndNotNull, + isFunction, + isString, + object, +} from 'metal'; +import {disposeUnused, schedule} from '../cleanup/unused'; +import { + getOriginalFn, + startInterception, + stopInterception, +} from '../incremental-dom-aop'; +import {Component, ComponentRegistry} from 'metal-component'; const renderingComponents_ = []; const emptyChildren_ = []; @@ -131,7 +148,8 @@ function getRef_(owner, config) { if (compatData) { const ownerRenderer = owner.getRenderer(); const renderers = compatData.renderers; - const useKey = !renderers || + const useKey = + !renderers || renderers.indexOf(ownerRenderer) !== -1 || renderers.indexOf(ownerRenderer.RENDERER_NAME) !== -1; if (useKey && config.key && !config.ref) { @@ -171,7 +189,12 @@ function getSubComponent_(tagOrCtor, config, owner) { data.currCount[type] = data.currCount[type] || 0; key = `__METAL_IC__${type}_${data.currCount[type]++}`; } - comp = match_(data.prevComps ? data.prevComps[key] : null, Ctor, config, owner); + comp = match_( + data.prevComps ? data.prevComps[key] : null, + Ctor, + config, + owner + ); data.currComps = data.currComps || {}; data.currComps[key] = comp; } @@ -183,6 +206,7 @@ function getSubComponent_(tagOrCtor, config, owner) { * Handles the event of children having finished being captured. * @param {!Object} tree The captured children in tree format. * @private + * @return {Object} */ function handleChildrenCaptured_(tree, {props, tag}) { props.children = buildChildren_(tree.props.children); @@ -222,12 +246,13 @@ function handleInterceptedAttributesCall_(element, name, value) { * dom. * @param {string} tag * @private + * @return {Object} */ function handleInterceptedOpenCall_(tag) { if (isComponentTag_(tag)) { - return handleSubComponentCall_.apply(null, arguments); + return handleSubComponentCall_(...arguments); } else { - return handleRegularCall_.apply(null, arguments); + return handleRegularCall_(...arguments); } } @@ -254,7 +279,9 @@ function handleRegularCall_(...args) { config.key = generateKey_(comp, config.key); if (!getData(comp).rootElementReached) { - const elementClasses = comp.getDataManager().get(comp, 'elementClasses'); + const elementClasses = comp + .getDataManager() + .get(comp, 'elementClasses'); if (elementClasses) { addElementClasses_(elementClasses, config); } @@ -262,7 +289,7 @@ function handleRegularCall_(...args) { convertListenerNamesToFns(comp, config); const call = buildCallFromConfig(tag, config); - const node = getOriginalFn('elementOpen').apply(null, call); + const node = getOriginalFn('elementOpen')(...call); resetNodeData_(node); updateElementIfNotReached_(comp, node); @@ -283,7 +310,7 @@ function handleRegularCall_(...args) { function handleSubComponentCall_(...args) { captureChildren(getComponentBeingRendered(), handleChildrenCaptured_, { props: buildConfigFromCall(args), - tag: args[0] + tag: args[0], }); } @@ -297,7 +324,11 @@ function inheritElementClasses_(parent, config) { const parentData = getData(parent); const parentConfig = parentData.config; - if (!parentData.rootElementReached && parentConfig && isString(parentConfig.elementClasses)) { + if ( + !parentData.rootElementReached && + parentConfig && + isString(parentConfig.elementClasses) + ) { let currentClasses = ''; if (isString(config.elementClasses)) { currentClasses = `${config.elementClasses} `; @@ -314,7 +345,9 @@ function inheritElementClasses_(parent, config) { * @private */ export function isComponentTag_(tag) { - return isFunction(tag) || (isString(tag) && tag[0] === tag[0].toUpperCase()); + return ( + isFunction(tag) || (isString(tag) && tag[0] === tag[0].toUpperCase()) + ); // eslint-disable-line } /** @@ -377,7 +410,7 @@ function prepareRender_(component) { startInterception({ attributes: handleInterceptedAttributesCall_, - elementOpen: handleInterceptedOpenCall_ + elementOpen: handleInterceptedOpenCall_, }); } @@ -424,12 +457,13 @@ export function renderChild(child) { * Renders the contents for the given tag. * @param {!function()|string} tag * @param {!Object} config - * @param {Component=} opt_owner + * @param {Component=} owner * @private + * @return {Object} */ -function renderFromTag_(tag, config, opt_owner) { +function renderFromTag_(tag, config, owner) { if (isString(tag) || tag.prototype.getRenderer) { - const comp = renderSubComponent_(tag, config, opt_owner); + const comp = renderSubComponent_(tag, config, owner); updateElementIfNotReached_(getComponentBeingRendered(), comp.element); return comp.element; } else { @@ -443,12 +477,12 @@ function renderFromTag_(tag, config, opt_owner) { * @param {!IncrementalDomRenderer} renderer * @param {!function()} fnOrCtor Either a simple incremental dom function or a * component constructor. - * @param {Object|Element=} opt_dataOrElement Optional config data for the + * @param {Object|Element=} dataOrElement Optional config data for the * function or parent for the rendered content. - * @param {Element=} opt_parent Optional parent for the rendered content. + * @param {Element=} parent Optional parent for the rendered content. * @return {!Component} The rendered component's instance. */ -export function renderFunction(renderer, fnOrCtor, opt_dataOrElement, opt_parent) { +export function renderFunction(renderer, fnOrCtor, dataOrElement, parent) { if (!Component.isComponentCtor(fnOrCtor)) { const fn = fnOrCtor; class TempComponent extends Component { @@ -466,7 +500,7 @@ export function renderFunction(renderer, fnOrCtor, opt_dataOrElement, opt_parent TempComponent.RENDERER = renderer; fnOrCtor = TempComponent; } - return Component.render(fnOrCtor, opt_dataOrElement, opt_parent); + return Component.render(fnOrCtor, dataOrElement, parent); } /** @@ -476,15 +510,15 @@ export function renderFunction(renderer, fnOrCtor, opt_dataOrElement, opt_parent * updated instead. * @param {string|!function()} tagOrCtor The tag name or constructor function. * @param {!Object} config The config object for the sub component. - * @param {ComponentRenderer=} opt_owner + * @param {ComponentRenderer=} owner * @return {!Component} The updated sub component. * @private */ -function renderSubComponent_(tagOrCtor, config, opt_owner) { +function renderSubComponent_(tagOrCtor, config, owner) { const parent = getComponentBeingRendered(); - const owner = opt_owner || parent; + owner = owner || parent; - inheritElementClasses_(parent, config) + inheritElementClasses_(parent, config); const comp = getSubComponent_(tagOrCtor, config, owner); updateContext_(comp, parent); @@ -533,11 +567,14 @@ function resetNodeData_(node) { * Updates the given component's context according to the data from the * component that is currently being rendered. * @param {!Component} comp + * @param {!Component} parent * @protected */ function updateContext_(comp, parent) { const context = comp.context; - const childContext = parent.getChildContext ? parent.getChildContext() : null; + const childContext = parent.getChildContext + ? parent.getChildContext() + : null; // eslint-disable-line object.mixin(context, parent.context, childContext); comp.context = context; } diff --git a/packages/metal-incremental-dom/test/.eslintrc b/packages/metal-incremental-dom/test/.eslintrc new file mode 100644 index 00000000..790a71ae --- /dev/null +++ b/packages/metal-incremental-dom/test/.eslintrc @@ -0,0 +1,16 @@ +{ + "env": { + "mocha": true + }, + "globals": { + "after": true, + "assert": true, + "before": true, + "sinon": true + }, + "rules": { + "max-len": 0, + "no-invalid-this": 0, + "require-jsdoc": 0 + } +} \ No newline at end of file diff --git a/packages/metal-incremental-dom/test/.eslintrc.json b/packages/metal-incremental-dom/test/.eslintrc.json deleted file mode 100644 index be351a25..00000000 --- a/packages/metal-incremental-dom/test/.eslintrc.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "env": { - "mocha": true - }, - "globals": { - "assert": true, - "sinon": true, - "METAL_VERSION": true - } -} diff --git a/packages/metal-incremental-dom/test/IncrementalDomRenderer.js b/packages/metal-incremental-dom/test/IncrementalDomRenderer.js index a083a028..5687f07d 100644 --- a/packages/metal-incremental-dom/test/IncrementalDomRenderer.js +++ b/packages/metal-incremental-dom/test/IncrementalDomRenderer.js @@ -1,17 +1,17 @@ 'use strict'; -import { async, core, object } from 'metal'; +import {async, core, object} from 'metal'; import dom from 'metal-dom'; -import { getData } from '../src/data'; -import { sunset } from '../../../test-utils'; -import { CHILD_OWNER } from '../src/children/children'; -import { Component, ComponentRegistry } from 'metal-component'; +import {getData} from '../src/data'; +import {sunset} from '../../../test-utils'; +import {CHILD_OWNER} from '../src/children/children'; +import {Component, ComponentRegistry} from 'metal-component'; import IncrementalDomRenderer from '../src/IncrementalDomRenderer'; -var IncDom = IncrementalDOM; +let IncDom = IncrementalDOM; describe('IncrementalDomRenderer', function() { - var component; + let component; afterEach(function() { if (component) { @@ -21,8 +21,7 @@ describe('IncrementalDomRenderer', function() { describe('Default render', function() { it('should render empty div element by default', function() { - class TestComponent extends Component { - } + class TestComponent extends Component {} TestComponent.RENDERER = IncrementalDomRenderer; component = new TestComponent(); @@ -41,8 +40,7 @@ describe('IncrementalDomRenderer', function() { } } - class TestComponent extends Component { - } + class TestComponent extends Component {} TestComponent.RENDERER = new TestRenderer(); component = new TestComponent(); @@ -77,7 +75,7 @@ describe('IncrementalDomRenderer', function() { } } TestComponent.STATE = { - attr: {} + attr: {}, }; TestComponent.RENDERER = IncrementalDomRenderer; @@ -95,9 +93,9 @@ describe('IncrementalDomRenderer', function() { } TestComponent.RENDERER = IncrementalDomRenderer; - var element = document.createElement('span'); + let element = document.createElement('span'); component = new TestComponent({ - element: element + element: element, }); assert.strictEqual(element, component.element); assert.strictEqual('foo', component.element.getAttribute('foo')); @@ -105,7 +103,7 @@ describe('IncrementalDomRenderer', function() { }); it('should run component\'s "rendered" lifecycle method on first render', function() { - var calledArgs = []; + let calledArgs = []; class TestComponent extends Component { render() { IncDom.elementOpen('span', null, null, 'foo', 'foo'); @@ -135,8 +133,8 @@ describe('IncrementalDomRenderer', function() { TestComponent.RENDERER = IncrementalDomRenderer; TestComponent.STATE = { foo: { - value: 'foo' - } + value: 'foo', + }, }; component = new TestComponent(); @@ -160,8 +158,8 @@ describe('IncrementalDomRenderer', function() { TestComponent.RENDERER = IncrementalDomRenderer; TestComponent.STATE = { foo: { - value: 'foo' - } + value: 'foo', + }, }; TestComponent.SYNC_UPDATES = true; @@ -188,8 +186,7 @@ describe('IncrementalDomRenderer', function() { } TestComponent.RENDERER = IncrementalDomRenderer; TestComponent.STATE = { - foo: { - } + foo: {}, }; TestComponent.SYNC_UPDATES = true; @@ -241,8 +238,10 @@ describe('IncrementalDomRenderer', function() { assert.equal(component.shouldUpdate.callCount, 0); }); - it('should run component\'s "rendered" lifecycle method on updates', function(done) { - var calledArgs = []; + it('should run component\'s "rendered" lifecycle method on updates', function( + done + ) { + let calledArgs = []; class TestComponent extends Component { render() { IncDom.elementOpen('div'); @@ -257,8 +256,8 @@ describe('IncrementalDomRenderer', function() { TestComponent.RENDERER = IncrementalDomRenderer; TestComponent.STATE = { foo: { - value: 'foo' - } + value: 'foo', + }, }; component = new TestComponent(); @@ -281,9 +280,9 @@ describe('IncrementalDomRenderer', function() { } TestComponent.RENDERER = IncrementalDomRenderer; - var element = document.createElement('div'); + let element = document.createElement('div'); component = new TestComponent({ - element: element + element: element, }); assert.notStrictEqual(element, component.element); assert.strictEqual('SPAN', component.element.tagName); @@ -297,11 +296,11 @@ describe('IncrementalDomRenderer', function() { } TestComponent.RENDERER = IncrementalDomRenderer; - var element = document.createElement('div'); - var parent = document.createElement('div'); + let element = document.createElement('div'); + let parent = document.createElement('div'); component = new TestComponent( { - element: element + element: element, }, parent ); @@ -319,7 +318,9 @@ describe('IncrementalDomRenderer', function() { assert.ok(!component.element); }); - it('should reposition component on requested parent when its content is back after an update', function(done) { + it('should reposition component on requested parent when its content is back after an update', function( + done + ) { class TestComponent extends Component { render() { if (!this.noElement) { @@ -329,16 +330,15 @@ describe('IncrementalDomRenderer', function() { } TestComponent.RENDERER = IncrementalDomRenderer; TestComponent.STATE = { - noElement: { - } + noElement: {}, }; - var parent = document.createElement('div'); + let parent = document.createElement('div'); component = new TestComponent({}, parent); assert.ok(component.element); assert.strictEqual(parent, component.element.parentNode); - var prevElement = component.element; + let prevElement = component.element; component.noElement = true; component.once('stateSynced', function() { assert.ok(!component.element); @@ -362,7 +362,7 @@ describe('IncrementalDomRenderer', function() { TestComponent.RENDERER = IncrementalDomRenderer; component = new TestComponent({ - elementClasses: 'test' + elementClasses: 'test', }); assert.ok(dom.hasClass(component.element, 'test')); @@ -374,22 +374,32 @@ describe('IncrementalDomRenderer', function() { }); }); - it('should add/remove css classes by using both "class" and "elementClasses"', function(done) { + it('should add/remove css classes by using both "class" and "elementClasses"', function( + done + ) { class TestComponent extends Component { render() { - var cssClass = this.foo ? 'foo' : 'bar'; - IncDom.elementVoid('button', null, [], 'foo', 'foo', 'class', cssClass); + let cssClass = this.foo ? 'foo' : 'bar'; + IncDom.elementVoid( + 'button', + null, + [], + 'foo', + 'foo', + 'class', + cssClass + ); } } TestComponent.RENDERER = IncrementalDomRenderer; TestComponent.STATE = { foo: { - value: true - } + value: true, + }, }; component = new TestComponent({ - elementClasses: 'test' + elementClasses: 'test', }); assert.ok(dom.hasClass(component.element, 'foo')); assert.ok(!dom.hasClass(component.element, 'bar')); @@ -413,9 +423,12 @@ describe('IncrementalDomRenderer', function() { TestComponent.RENDERER = IncrementalDomRenderer; component = new TestComponent({ - elementClasses: 'test2 test3' + elementClasses: 'test2 test3', }); - assert.strictEqual('test1 test2 test3', component.element.getAttribute('class')); + assert.strictEqual( + 'test1 test2 test3', + component.element.getAttribute('class') + ); }); it('should store references to node elements via "ref"', function() { @@ -431,8 +444,14 @@ describe('IncrementalDomRenderer', function() { component = new TestComponent(); assert.strictEqual(component.element, component.refs.root); - assert.strictEqual(component.element.childNodes[0], component.refs.child1); - assert.strictEqual(component.element.childNodes[1], component.refs.child2); + assert.strictEqual( + component.element.childNodes[0], + component.refs.child1 + ); + assert.strictEqual( + component.element.childNodes[1], + component.refs.child2 + ); }); }); @@ -449,15 +468,18 @@ describe('IncrementalDomRenderer', function() { } TestComponent.RENDERER = IncrementalDomRenderer; - var element = document.createElement('div'); + let element = document.createElement('div'); dom.append(element, '
foo
'); - var innerElement = element.querySelector('.inner'); + let innerElement = element.querySelector('.inner'); component = new TestComponent({ - element: element + element: element, }); assert.strictEqual(element, component.element); - assert.strictEqual(innerElement, component.element.querySelector('.inner')); + assert.strictEqual( + innerElement, + component.element.querySelector('.inner') + ); assert.strictEqual('foo', component.element.textContent); }); @@ -473,15 +495,18 @@ describe('IncrementalDomRenderer', function() { } TestComponent.RENDERER = IncrementalDomRenderer; - var element = document.createElement('div'); + let element = document.createElement('div'); dom.append(element, 'foo'); - var innerElement = element.querySelector('.inner'); + let innerElement = element.querySelector('.inner'); component = new TestComponent({ - element: element + element: element, }); assert.strictEqual(element, component.element); - assert.notStrictEqual(innerElement, component.element.querySelector('.inner')); + assert.notStrictEqual( + innerElement, + component.element.querySelector('.inner') + ); assert.strictEqual('foo', component.element.textContent); }); @@ -497,15 +522,18 @@ describe('IncrementalDomRenderer', function() { } TestComponent.RENDERER = IncrementalDomRenderer; - var element = document.createElement('div'); + let element = document.createElement('div'); dom.append(element, '
foo
'); - var innerElement = element.querySelector('.inner2'); + let innerElement = element.querySelector('.inner2'); component = new TestComponent({ - element: element + element: element, }); assert.strictEqual(element, component.element); - assert.strictEqual(innerElement, component.element.querySelector('.inner')); + assert.strictEqual( + innerElement, + component.element.querySelector('.inner') + ); assert.strictEqual('foo', component.element.textContent); assert.ok(dom.hasClass(innerElement, 'inner')); assert.ok(!dom.hasClass(innerElement, 'inner2')); @@ -580,12 +608,12 @@ describe('IncrementalDomRenderer', function() { TestComponent.RENDERER = IncrementalDomRenderer; TestComponent.prototype.handleClick = sinon.stub(); - var element = document.createElement('div'); + let element = document.createElement('div'); element.setAttribute('data-onclick', 'handleClick'); dom.enterDocument(element); component = new TestComponent({ - element: element + element: element, }); dom.triggerEvent(component.element, 'click'); @@ -628,11 +656,11 @@ describe('IncrementalDomRenderer', function() { TestComponent.RENDERER = IncrementalDomRenderer; TestComponent.prototype.handleClick = sinon.stub(); - var element = document.createElement('div'); + let element = document.createElement('div'); dom.append(element, '
'); - var innerElement = element.childNodes[0]; + let innerElement = element.childNodes[0]; component = new TestComponent({ - element: element + element: element, }); assert.strictEqual(innerElement, component.element.childNodes[0]); @@ -643,7 +671,13 @@ describe('IncrementalDomRenderer', function() { it('should provide delegateTarget as the element that the listener was attached to', function() { class TestComponent extends Component { render() { - IncDom.elementOpen('div', null, null, 'onClick', 'handleElementClick'); + IncDom.elementOpen( + 'div', + null, + null, + 'onClick', + 'handleElementClick' + ); IncDom.elementOpen('div', null, null, 'onClick', 'handleClick'); IncDom.elementVoid('div', null, null, 'class', 'inner'); IncDom.elementClose('div'); @@ -652,17 +686,17 @@ describe('IncrementalDomRenderer', function() { } TestComponent.RENDERER = IncrementalDomRenderer; - var event1; + let event1; TestComponent.prototype.handleElementClick = function(event) { event1 = object.mixin({}, event); }; - var event2; + let event2; TestComponent.prototype.handleClick = function(event) { event2 = object.mixin({}, event); }; component = new TestComponent(); - var innerElement = component.element.querySelector('.inner'); + let innerElement = component.element.querySelector('.inner'); dom.triggerEvent(innerElement, 'click'); assert.ok(event1); @@ -671,10 +705,15 @@ describe('IncrementalDomRenderer', function() { assert.ok(event2); assert.strictEqual(innerElement, event2.target); - assert.strictEqual(component.element.childNodes[0], event2.delegateTarget); + assert.strictEqual( + component.element.childNodes[0], + event2.delegateTarget + ); }); - it('should remove unused inline listeners when dom is updated', function(done) { + it('should remove unused inline listeners when dom is updated', function( + done + ) { class TestComponent extends Component { render() { IncDom.elementOpen('div'); @@ -690,8 +729,8 @@ describe('IncrementalDomRenderer', function() { TestComponent.RENDERER = IncrementalDomRenderer; TestComponent.STATE = { keydown: { - value: true - } + value: true, + }, }; TestComponent.prototype.handleClick = sinon.stub(); TestComponent.prototype.handleKeydown = sinon.stub(); @@ -712,14 +751,14 @@ describe('IncrementalDomRenderer', function() { class TestComponent extends Component { render() { IncDom.elementOpen('div'); - var fn = this.switch ? this.handleClick2 : this.handleClick; + let fn = this.switch ? this.handleClick2 : this.handleClick; IncDom.elementVoid('div', null, null, 'onClick', fn); IncDom.elementClose('div'); } } TestComponent.RENDERER = IncrementalDomRenderer; TestComponent.STATE = { - switch: {} + switch: {}, }; TestComponent.prototype.handleClick = sinon.stub(); TestComponent.prototype.handleClick2 = sinon.stub(); @@ -744,8 +783,7 @@ describe('IncrementalDomRenderer', function() { sinon.stub(this, 'handleClick'); } - handleClick() { - } + handleClick() {} render() { IncDom.elementVoid('div', null, null, 'data-onclick', 'handleClick'); @@ -759,7 +797,7 @@ describe('IncrementalDomRenderer', function() { component.dispose(); component = new TestComponent({ - element + element, }); dom.triggerEvent(element, 'click'); assert.equal(1, component.handleClick.callCount); @@ -767,7 +805,7 @@ describe('IncrementalDomRenderer', function() { }); describe('Nested Components', function() { - var ChildComponent; + let ChildComponent; beforeEach(function() { class ChildComponentClass extends Component { @@ -782,8 +820,8 @@ describe('IncrementalDomRenderer', function() { ChildComponent.RENDERER = IncrementalDomRenderer; ChildComponent.STATE = { foo: { - value: 'foo' - } + value: 'foo', + }, }; ChildComponent.prototype.handleClick = sinon.stub(); ComponentRegistry.register(ChildComponent, 'ChildComponent'); @@ -800,7 +838,7 @@ describe('IncrementalDomRenderer', function() { TestComponent.RENDERER = IncrementalDomRenderer; component = new TestComponent(); - var child = component.components.child; + let child = component.components.child; assert.ok(child); assert.ok(child instanceof ChildComponent); assert.strictEqual(child, component.refs.child); @@ -817,8 +855,11 @@ describe('IncrementalDomRenderer', function() { TestComponent.RENDERER = IncrementalDomRenderer; component = new TestComponent(); - var child = component.components.child; - assert.strictEqual(child.element, component.element.querySelector('child')); + let child = component.components.child; + assert.strictEqual( + child.element, + component.element.querySelector('child') + ); assert.strictEqual('foo', child.element.textContent); assert.ok(child.element.hasAttribute('data-child')); }); @@ -837,7 +878,7 @@ describe('IncrementalDomRenderer', function() { sinon.spy(ChildComponent.prototype, 'attached'); component = new TestComponent(); - var child = component.components.child; + let child = component.components.child; assert.strictEqual(1, child.rendered.callCount); assert.ok(child.rendered.args[0][0]); assert.strictEqual(1, child.attached.callCount); @@ -847,14 +888,22 @@ describe('IncrementalDomRenderer', function() { class TestComponent extends Component { render() { IncDom.elementOpen('div'); - IncDom.elementVoid('ChildComponent', null, null, 'ref', 'child', 'foo', 'bar'); + IncDom.elementVoid( + 'ChildComponent', + null, + null, + 'ref', + 'child', + 'foo', + 'bar' + ); IncDom.elementClose('div'); } } TestComponent.RENDERER = IncrementalDomRenderer; component = new TestComponent(); - var child = component.components.child; + let child = component.components.child; assert.strictEqual('bar', child.foo); assert.strictEqual('bar', child.element.textContent); }); @@ -863,40 +912,58 @@ describe('IncrementalDomRenderer', function() { class TestComponent extends Component { render() { IncDom.elementOpen('div'); - IncDom.elementVoid('ChildComponent', null, null, 'ref', 'child', 'foo', this.foo); + IncDom.elementVoid( + 'ChildComponent', + null, + null, + 'ref', + 'child', + 'foo', + this.foo + ); IncDom.elementClose('div'); } } TestComponent.RENDERER = IncrementalDomRenderer; TestComponent.STATE = { foo: { - value: 'foo' - } + value: 'foo', + }, }; component = new TestComponent(); component.foo = 'bar'; component.once('stateSynced', function() { - var child = component.components.child; + let child = component.components.child; assert.strictEqual('bar', child.foo); assert.strictEqual('bar', child.element.textContent); done(); }); }); - it('should run component\'s lifecycle methods when updated as sub component', function(done) { + it('should run component\'s lifecycle methods when updated as sub component', function( + done + ) { class TestComponent extends Component { render() { IncDom.elementOpen('div'); - IncDom.elementVoid('ChildComponent', null, null, 'ref', 'child', 'foo', this.foo); + IncDom.elementVoid( + 'ChildComponent', + null, + null, + 'ref', + 'child', + 'foo', + this.foo + ); IncDom.elementClose('div'); } } TestComponent.RENDERER = IncrementalDomRenderer; TestComponent.STATE = { foo: { - value: 'foo' - } + value: 'foo', + }, }; sinon.spy(ChildComponent.prototype, 'rendered'); @@ -905,7 +972,7 @@ describe('IncrementalDomRenderer', function() { component.foo = 'bar'; component.once('stateSynced', function() { - var child = component.components.child; + let child = component.components.child; assert.strictEqual(2, child.rendered.callCount); assert.ok(!child.rendered.args[1][0]); assert.strictEqual(1, child.attached.callCount); @@ -913,25 +980,35 @@ describe('IncrementalDomRenderer', function() { }); }); - it('should not try to rerender sub component later when state changes during parent rendering', function(done) { + it('should not try to rerender sub component later when state changes during parent rendering', function( + done + ) { class TestComponent extends Component { render() { IncDom.elementOpen('div'); - IncDom.elementVoid('ChildComponent', null, null, 'ref', 'child', 'foo', this.foo); + IncDom.elementVoid( + 'ChildComponent', + null, + null, + 'ref', + 'child', + 'foo', + this.foo + ); IncDom.elementClose('div'); } } TestComponent.RENDERER = IncrementalDomRenderer; TestComponent.STATE = { foo: { - value: 'foo' - } + value: 'foo', + }, }; component = new TestComponent(); component.foo = 'bar'; component.once('stateSynced', function() { - var child = component.components.child; + let child = component.components.child; sinon.spy(child, 'render'); child.once('stateSynced', function() { assert.strictEqual(0, child.render.callCount); @@ -940,25 +1017,35 @@ describe('IncrementalDomRenderer', function() { }); }); - it('should rerender sub component when state changes after parent rendering', function(done) { + it('should rerender sub component when state changes after parent rendering', function( + done + ) { class TestComponent extends Component { render() { IncDom.elementOpen('div'); - IncDom.elementVoid('ChildComponent', null, null, 'ref', 'child', 'foo', this.foo); + IncDom.elementVoid( + 'ChildComponent', + null, + null, + 'ref', + 'child', + 'foo', + this.foo + ); IncDom.elementClose('div'); } } TestComponent.RENDERER = IncrementalDomRenderer; TestComponent.STATE = { foo: { - value: 'foo' - } + value: 'foo', + }, }; component = new TestComponent(); component.foo = 'bar'; component.once('stateSynced', function() { - var child = component.components.child; + let child = component.components.child; child.foo = 'bar2'; sinon.spy(child, 'render'); child.once('stateSynced', function() { @@ -969,7 +1056,9 @@ describe('IncrementalDomRenderer', function() { }); }); - it('should not remove sub component key when this sub component updates itself', function(done) { + it('should not remove sub component key when this sub component updates itself', function( + done + ) { class TestComponent extends Component { render() { IncDom.elementOpen('div'); @@ -980,13 +1069,16 @@ describe('IncrementalDomRenderer', function() { TestComponent.RENDERER = IncrementalDomRenderer; component = new TestComponent(); - var child = component.components.child; + let child = component.components.child; assert.strictEqual('childKey', child.element.__incrementalDOMData.key); child.foo = 'bar'; child.once('stateSynced', function() { assert.strictEqual('childKey', child.element.__incrementalDOMData.key); - assert.strictEqual(child.element, component.element.querySelector('child')); + assert.strictEqual( + child.element, + component.element.querySelector('child') + ); assert.strictEqual('bar', child.element.textContent); done(); }); @@ -1026,16 +1118,18 @@ describe('IncrementalDomRenderer', function() { TestComponent.RENDERER = IncrementalDomRenderer; component = new TestComponent(); - var child = component.components.child; + let child = component.components.child; assert.strictEqual(0, child.handleClick.callCount); - var button = child.element.querySelector('button'); + let button = child.element.querySelector('button'); dom.triggerEvent(button, 'click'); assert.strictEqual(1, child.handleClick.callCount); }); - it('should detach unused sub component inline listeners after parent update', function(done) { + it('should detach unused sub component inline listeners after parent update', function( + done + ) { class TestChildComponent extends Component { render() { if (this.removeEvent) { @@ -1049,24 +1143,30 @@ describe('IncrementalDomRenderer', function() { TestChildComponent.prototype.handleClick = sinon.stub(); TestChildComponent.RENDERER = IncrementalDomRenderer; TestChildComponent.STATE = { - removeEvent: { - } + removeEvent: {}, }; class TestComponent extends Component { render() { IncDom.elementOpen('div'); - IncDom.elementVoid(TestChildComponent, null, null, 'ref', 'child', 'removeEvent', this.removeEvent); + IncDom.elementVoid( + TestChildComponent, + null, + null, + 'ref', + 'child', + 'removeEvent', + this.removeEvent + ); IncDom.elementClose('div'); } } TestComponent.RENDERER = IncrementalDomRenderer; TestComponent.STATE = { - removeEvent: { - } + removeEvent: {}, }; component = new TestComponent(); - var child = component.components.child; + let child = component.components.child; dom.triggerEvent(child.element, 'click'); assert.strictEqual(1, child.handleClick.callCount); @@ -1096,8 +1196,10 @@ describe('IncrementalDomRenderer', function() { assert.strictEqual('bar', component.element.childNodes[0].textContent); }); - it('should reuse sub component even when it receives no ref', function(done) { - var creationCount = 0; + it('should reuse sub component even when it receives no ref', function( + done + ) { + let creationCount = 0; class TestChildComponent extends Component { created() { creationCount++; @@ -1111,8 +1213,7 @@ describe('IncrementalDomRenderer', function() { } TestChildComponent.RENDERER = IncrementalDomRenderer; TestChildComponent.STATE = { - foo: { - } + foo: {}, }; class TestComponent extends Component { @@ -1125,8 +1226,8 @@ describe('IncrementalDomRenderer', function() { TestComponent.RENDERER = IncrementalDomRenderer; TestComponent.STATE = { foo: { - value: 'foo' - } + value: 'foo', + }, }; component = new TestComponent(); @@ -1164,11 +1265,10 @@ describe('IncrementalDomRenderer', function() { } TestComponent.RENDERER = IncrementalDomRenderer; TestComponent.STATE = { - add: { - } + add: {}, }; - var children = []; + let children = []; sinon.stub(ChildComponent.prototype, 'created', function() { children.push(this); }); @@ -1192,13 +1292,21 @@ describe('IncrementalDomRenderer', function() { assert.strictEqual('foo', component.element.childNodes[1].textContent); assert.strictEqual('CHILD', component.element.childNodes[2].tagName); assert.strictEqual('bar', component.element.childNodes[2].textContent); - assert.strictEqual(component.element.childNodes[1], children[0].element); - assert.strictEqual(component.element.childNodes[2], children[1].element); + assert.strictEqual( + component.element.childNodes[1], + children[0].element + ); + assert.strictEqual( + component.element.childNodes[2], + children[1].element + ); done(); }); }); - it('should reuse correct children according to their "key" after an update', function(done) { + it('should reuse correct children according to their "key" after an update', function( + done + ) { class TestComponent extends Component { render() { IncDom.elementOpen('div'); @@ -1214,11 +1322,10 @@ describe('IncrementalDomRenderer', function() { } TestComponent.RENDERER = IncrementalDomRenderer; TestComponent.STATE = { - switch: { - } + switch: {}, }; - var children = []; + let children = []; sinon.stub(ChildComponent.prototype, 'created', function() { children.push(this); }); @@ -1233,13 +1340,21 @@ describe('IncrementalDomRenderer', function() { component.once('stateSynced', function() { assert.strictEqual(2, component.element.childNodes.length); assert.strictEqual(2, children.length); - assert.strictEqual(component.element.childNodes[0], children[1].element); - assert.strictEqual(component.element.childNodes[1], children[0].element); + assert.strictEqual( + component.element.childNodes[0], + children[1].element + ); + assert.strictEqual( + component.element.childNodes[1], + children[0].element + ); done(); }); }); - it('should not reuse component that was created in another parent', function(done) { + it('should not reuse component that was created in another parent', function( + done + ) { const grandChildInstances = []; class GrandChildComponent extends Component { created() { @@ -1262,14 +1377,20 @@ describe('IncrementalDomRenderer', function() { class TestComponent extends Component { render() { - IncDom.elementVoid(TestChildComponent, null, null, 'ref', 'child' + this.number); + IncDom.elementVoid( + TestChildComponent, + null, + null, + 'ref', + 'child' + this.number + ); } } TestComponent.RENDERER = IncrementalDomRenderer; TestComponent.STATE = { number: { - value: 1 - } + value: 1, + }, }; component = new TestComponent(); @@ -1280,12 +1401,17 @@ describe('IncrementalDomRenderer', function() { assert.strictEqual(2, grandChildInstances.length); assert.ok(grandChildInstances[0].isDisposed()); assert.ok(!grandChildInstances[1].isDisposed()); - assert.strictEqual(grandChildInstances[1].element, component.element.querySelector('span')); + assert.strictEqual( + grandChildInstances[1].element, + component.element.querySelector('span') + ); done(); }); }); - it('should not throw error trying to reuse component that was disposed', function(done) { + it('should not throw error trying to reuse component that was disposed', function( + done + ) { const childInstances = []; class TestChildComponent extends Component { created() { @@ -1304,8 +1430,7 @@ describe('IncrementalDomRenderer', function() { } TestComponent.RENDERER = IncrementalDomRenderer; TestComponent.STATE = { - foo: { - } + foo: {}, }; component = new TestComponent(); @@ -1322,11 +1447,13 @@ describe('IncrementalDomRenderer', function() { }); }); - it('should reuse previous internal state data on sub component rerender', function(done) { + it('should reuse previous internal state data on sub component rerender', function( + done + ) { ChildComponent.STATE = { foo: { - internal: true - } + internal: true, + }, }; class TestComponent extends Component { @@ -1335,19 +1462,26 @@ describe('IncrementalDomRenderer', function() { if (this.noFoo) { IncDom.elementVoid(ChildComponent, null, null, 'ref', 'child'); } else { - IncDom.elementVoid(ChildComponent, null, null, 'ref', 'child', 'foo', 'foo'); + IncDom.elementVoid( + ChildComponent, + null, + null, + 'ref', + 'child', + 'foo', + 'foo' + ); } IncDom.elementClose('div'); } } TestComponent.RENDERER = IncrementalDomRenderer; TestComponent.STATE = { - noFoo: { - } + noFoo: {}, }; component = new TestComponent(); - var child = component.components.child; + let child = component.components.child; assert.strictEqual('foo', child.foo); component.noFoo = true; @@ -1357,11 +1491,13 @@ describe('IncrementalDomRenderer', function() { }); }); - it('should not reuse previous non internal state data on sub component rerender', function(done) { + it('should not reuse previous non internal state data on sub component rerender', function( + done + ) { ChildComponent.STATE = { foo: { - value: 'defaultFoo' - } + value: 'defaultFoo', + }, }; class TestComponent extends Component { @@ -1370,19 +1506,26 @@ describe('IncrementalDomRenderer', function() { if (this.noFoo) { IncDom.elementVoid(ChildComponent, null, null, 'ref', 'child'); } else { - IncDom.elementVoid(ChildComponent, null, null, 'ref', 'child', 'foo', 'foo'); + IncDom.elementVoid( + ChildComponent, + null, + null, + 'ref', + 'child', + 'foo', + 'foo' + ); } IncDom.elementClose('div'); } } TestComponent.RENDERER = IncrementalDomRenderer; TestComponent.STATE = { - noFoo: { - } + noFoo: {}, }; component = new TestComponent(); - var child = component.components.child; + let child = component.components.child; assert.strictEqual('foo', child.foo); component.noFoo = true; @@ -1423,8 +1566,11 @@ describe('IncrementalDomRenderer', function() { TestComponent.RENDERER = IncrementalDomRenderer; component = new TestComponent(); - var child = component.components.child; - assert.strictEqual(child.element, component.element.querySelector('child')); + let child = component.components.child; + assert.strictEqual( + child.element, + component.element.querySelector('child') + ); assert.strictEqual('foo', child.element.textContent); assert.ok(child.element.hasAttribute('data-child')); }); @@ -1444,9 +1590,12 @@ describe('IncrementalDomRenderer', function() { TestComponent.RENDERER = IncrementalDomRenderer; component = new TestComponent(); - var child = component.components.child; + let child = component.components.child; assert.strictEqual('bar', child.foo); - assert.strictEqual(child.element, component.element.querySelector('child')); + assert.strictEqual( + child.element, + component.element.querySelector('child') + ); assert.strictEqual('bar', child.element.textContent); assert.ok(child.element.hasAttribute('data-child')); }); @@ -1462,9 +1611,12 @@ describe('IncrementalDomRenderer', function() { TestComponent.RENDERER = IncrementalDomRenderer; component = new TestComponent(); - var child = component.components.child; + let child = component.components.child; assert.ok(child instanceof ChildComponent); - assert.strictEqual(child.element, component.element.querySelector('child')); + assert.strictEqual( + child.element, + component.element.querySelector('child') + ); assert.strictEqual('foo', child.element.textContent); assert.ok(child.element.hasAttribute('data-child')); }); @@ -1473,31 +1625,41 @@ describe('IncrementalDomRenderer', function() { class TestComponent extends Component { render() { IncDom.elementOpen('div'); - IncDom.elementVoid(ChildComponent, null, [], 'ref', 'child', 'foo', this.foo); + IncDom.elementVoid( + ChildComponent, + null, + [], + 'ref', + 'child', + 'foo', + this.foo + ); IncDom.elementClose('div'); } } TestComponent.RENDERER = IncrementalDomRenderer; TestComponent.STATE = { - foo: {} + foo: {}, }; component = new TestComponent({ - foo: 'foo' + foo: 'foo', }); - var child = component.components.child; + let child = component.components.child; assert.strictEqual('foo', child.foo); component.foo = 'bar'; component.once('stateSynced', function() { - var newChild = component.components.child; + let newChild = component.components.child; assert.strictEqual(child, newChild); assert.strictEqual('bar', child.foo); done(); }); }); - it('should not reuse component with same key if constructor is different"', function(done) { + it('should not reuse component with same key if constructor is different"', function( + done + ) { class TestChildComponent extends Component { render() { IncDom.elementVoid('div'); @@ -1518,19 +1680,18 @@ describe('IncrementalDomRenderer', function() { } TestComponent.RENDERER = IncrementalDomRenderer; TestComponent.STATE = { - switch: { - } + switch: {}, }; component = new TestComponent(); - var child = component.components.child; + let child = component.components.child; assert.ok(child instanceof ChildComponent); assert.strictEqual(child.element, component.element.childNodes[0]); assert.strictEqual('CHILD', child.element.tagName); component.switch = true; component.once('stateSynced', function() { - var newChild = component.components.child; + let newChild = component.components.child; assert.notStrictEqual(child, newChild); assert.ok(newChild instanceof TestChildComponent); assert.strictEqual(newChild.element, component.element.childNodes[0]); @@ -1541,7 +1702,9 @@ describe('IncrementalDomRenderer', function() { }); }); - it('should call "detached" lifecycle function and event when sub component is removed', function(done) { + it('should call "detached" lifecycle function and event when sub component is removed', function( + done + ) { class TestComponent extends Component { render() { IncDom.elementOpen('div'); @@ -1553,12 +1716,11 @@ describe('IncrementalDomRenderer', function() { } TestComponent.RENDERER = IncrementalDomRenderer; TestComponent.STATE = { - remove: { - } + remove: {}, }; component = new TestComponent(); - var child = component.components.child; + let child = component.components.child; assert.ok(!child.isDisposed()); sinon.spy(child, 'detached'); @@ -1611,11 +1773,13 @@ describe('IncrementalDomRenderer', function() { TestComponent.RENDERER = IncrementalDomRenderer; component = new TestComponent(); - var child = component.components.child; + let child = component.components.child; assert.strictEqual(child.element, component.element); }); - it('should position previously empty child component correctly inside parent', function(done) { + it('should position previously empty child component correctly inside parent', function( + done + ) { class TestChildComponent extends Component { render() { if (!this.empty) { @@ -1627,8 +1791,8 @@ describe('IncrementalDomRenderer', function() { TestChildComponent.STATE = { empty: { value: true, - internal: true - } + internal: true, + }, }; class TestComponent extends Component { @@ -1641,7 +1805,7 @@ describe('IncrementalDomRenderer', function() { TestComponent.RENDERER = IncrementalDomRenderer; component = new TestComponent(); - var child = component.components.child; + let child = component.components.child; assert.ok(!child.element); assert.strictEqual(0, component.element.childNodes.length); @@ -1654,25 +1818,35 @@ describe('IncrementalDomRenderer', function() { }); }); - it('should not render sub component with SYNC_UPDATES twice', function(done) { + it('should not render sub component with SYNC_UPDATES twice', function( + done + ) { ChildComponent.SYNC_UPDATES = true; class TestComponent extends Component { render() { IncDom.elementOpen('div'); - IncDom.elementVoid(ChildComponent, null, null, 'ref', 'child', 'foo', this.foo); + IncDom.elementVoid( + ChildComponent, + null, + null, + 'ref', + 'child', + 'foo', + this.foo + ); IncDom.elementClose('div'); } } TestComponent.RENDERER = IncrementalDomRenderer; TestComponent.STATE = { foo: { - value: 'foo' - } + value: 'foo', + }, }; component = new TestComponent(); - var child = component.components.child; + let child = component.components.child; sinon.spy(child, 'render'); component.foo = 'bar'; @@ -1684,8 +1858,7 @@ describe('IncrementalDomRenderer', function() { describe('Children data', function() { it('should pass tree of incremental dom calls as "children"', function() { - class TestChildComponent extends Component { - } + class TestChildComponent extends Component {} TestChildComponent.RENDERER = IncrementalDomRenderer; class TestComponent extends Component { @@ -1702,10 +1875,10 @@ describe('IncrementalDomRenderer', function() { TestComponent.RENDERER = IncrementalDomRenderer; component = new TestComponent(); - var child = component.components.child; + let child = component.components.child; assert.ok(child instanceof TestChildComponent); - var children = child.children; + let children = child.children; assert.ok(children); assert.strictEqual(1, children.length); @@ -1741,11 +1914,14 @@ describe('IncrementalDomRenderer', function() { TestComponent.RENDERER = IncrementalDomRenderer; component = new TestComponent(); - var child = component.components.child; + let child = component.components.child; assert.ok(child instanceof TestChildComponent); assert.strictEqual(1, child.element.childNodes.length); assert.strictEqual('SPAN', child.element.childNodes[0].tagName); - assert.strictEqual('Hello World', child.element.childNodes[0].textContent); + assert.strictEqual( + 'Hello World', + child.element.childNodes[0].textContent + ); }); it('should render empty string children', function() { @@ -1770,7 +1946,7 @@ describe('IncrementalDomRenderer', function() { TestComponent.RENDERER = IncrementalDomRenderer; component = new TestComponent(); - var child = component.components.child; + let child = component.components.child; assert.strictEqual('foo bar', child.element.textContent); }); @@ -1798,7 +1974,7 @@ describe('IncrementalDomRenderer', function() { TestComponent.RENDERER = IncrementalDomRenderer; component = new TestComponent(); - var child = component.components.child; + let child = component.components.child; assert.strictEqual(1, child.element.childNodes.length); assert.strictEqual('SPAN', child.element.childNodes[0].tagName); assert.ok(dom.hasClass(child.element.childNodes[0], 'second')); @@ -1816,7 +1992,13 @@ describe('IncrementalDomRenderer', function() { class TestNestedChildComponent extends Component { render() { - IncDom.elementOpen(TestChildComponent, null, null, 'ref', 'nestedChild1'); + IncDom.elementOpen( + TestChildComponent, + null, + null, + 'ref', + 'nestedChild1' + ); IncDom.elementOpen('div'); this.children.forEach(IncrementalDomRenderer.renderChild); IncDom.elementClose('div'); @@ -1828,7 +2010,13 @@ describe('IncrementalDomRenderer', function() { class TestComponent extends Component { render() { IncDom.elementOpen('div'); - IncDom.elementOpen(TestNestedChildComponent, null, null, 'ref', 'child1'); + IncDom.elementOpen( + TestNestedChildComponent, + null, + null, + 'ref', + 'child1' + ); IncDom.elementVoid(TestChildComponent, null, null, 'ref', 'child2'); IncDom.elementClose(TestNestedChildComponent); IncDom.elementClose('div'); @@ -1837,8 +2025,8 @@ describe('IncrementalDomRenderer', function() { TestComponent.RENDERER = IncrementalDomRenderer; component = new TestComponent(); - var child1 = component.components.child1; - var child2 = component.components.child2; + let child1 = component.components.child1; + let child2 = component.components.child2; assert.ok(child1 instanceof TestNestedChildComponent); assert.ok(child2 instanceof TestChildComponent); assert.ok(child1.components.nestedChild1 instanceof TestChildComponent); @@ -1846,7 +2034,10 @@ describe('IncrementalDomRenderer', function() { assert.ok(!child1.components.child2); assert.strictEqual(child1.element, component.element.childNodes[0]); - assert.strictEqual(child2.element, child1.element.childNodes[0].childNodes[0]); + assert.strictEqual( + child2.element, + child1.element.childNodes[0].childNodes[0] + ); }); it('should add dom element references to the component that requested them', function() { @@ -1882,7 +2073,7 @@ describe('IncrementalDomRenderer', function() { TestComponent.RENDERER = IncrementalDomRenderer; component = new TestComponent(); - var childEl = component.refs.childEl; + let childEl = component.refs.childEl; assert.ok(childEl); assert.ok(core.isElement(childEl)); assert.strictEqual('SPAN', childEl.tagName); @@ -1928,9 +2119,13 @@ describe('IncrementalDomRenderer', function() { render() { IncrementalDOM.elementOpen('child'); if (this.children.length) { - this.children[0].props = object.mixin({}, this.children[0].props, { - foo: 'changedFoo' - }); + this.children[0].props = object.mixin( + {}, + this.children[0].props, + { + foo: 'changedFoo', + } + ); this.children.forEach(IncrementalDomRenderer.renderChild); } if (this.foo) { @@ -1941,8 +2136,7 @@ describe('IncrementalDomRenderer', function() { } TestChildComponent.RENDERER = IncrementalDomRenderer; TestChildComponent.STATE = { - foo: { - } + foo: {}, }; class TestNestedChildComponent extends Component { @@ -1965,7 +2159,10 @@ describe('IncrementalDomRenderer', function() { component = new TestComponent(); assert.strictEqual(1, component.element.childNodes.length); - assert.strictEqual('changedFoo', component.element.childNodes[0].textContent); + assert.strictEqual( + 'changedFoo', + component.element.childNodes[0].textContent + ); }); it('should render correctly when recursive children are used', function() { @@ -1996,9 +2193,9 @@ describe('IncrementalDomRenderer', function() { TestComponent.RENDERER = IncrementalDomRenderer; component = new TestComponent(); - var child = component.components.child; - var child2 = component.components.child2; - var child3 = component.components.child3; + let child = component.components.child; + let child2 = component.components.child2; + let child3 = component.components.child3; assert.ok(child instanceof TestChildComponent); assert.ok(child2 instanceof TestChildComponent); assert.ok(child3 instanceof TestChildComponent); @@ -2011,27 +2208,40 @@ describe('IncrementalDomRenderer', function() { assert.strictEqual('CHILD', child2.element.childNodes[0].tagName); assert.strictEqual(child3.element, child2.element.childNodes[0]); assert.strictEqual(1, child3.element.childNodes.length); - assert.strictEqual('Hello World', child2.element.childNodes[0].textContent); + assert.strictEqual( + 'Hello World', + child2.element.childNodes[0].textContent + ); }); - it('should pass same children array when there are no children', function(done) { + it('should pass same children array when there are no children', function( + done + ) { class TestComponent extends Component { render() { IncDom.elementOpen('div'); - IncDom.elementVoid(ChildComponent, null, null, 'ref', 'child', 'foo', this.foo); + IncDom.elementVoid( + ChildComponent, + null, + null, + 'ref', + 'child', + 'foo', + this.foo + ); IncDom.elementClose('div'); } } TestComponent.RENDERER = IncrementalDomRenderer; TestComponent.STATE = { foo: { - value: 'foo' - } + value: 'foo', + }, }; component = new TestComponent(); - var child = component.components.child; - var children = child.children; + let child = component.components.child; + let children = child.children; assert.ok(children); component.foo = 'foo2'; @@ -2061,13 +2271,15 @@ describe('IncrementalDomRenderer', function() { TestComponent.RENDERER = IncrementalDomRenderer; component = new TestComponent(); - var child = component.components.child; - var child2 = component.components.child2; + let child = component.components.child; + let child2 = component.components.child2; assert.strictEqual(child.element, child2.element); assert.notStrictEqual(component.element, child.element); }); - it('should reuse children components when rerendered after update', function(done) { + it('should reuse children components when rerendered after update', function( + done + ) { class TestChildComponent extends Component { render() { IncrementalDOM.elementOpen('div'); @@ -2079,8 +2291,8 @@ describe('IncrementalDomRenderer', function() { TestChildComponent.RENDERER = IncrementalDomRenderer; TestChildComponent.STATE = { foo: { - value: 'foo' - } + value: 'foo', + }, }; class TestComponent extends Component { @@ -2117,7 +2329,7 @@ describe('IncrementalDomRenderer', function() { class TestChildComponent extends Component { getChildContext() { return { - bar: 'bar' + bar: 'bar', }; } @@ -2132,14 +2344,20 @@ describe('IncrementalDomRenderer', function() { class TestComponent extends Component { getChildContext() { return { - foo: 'foo' + foo: 'foo', }; } render() { IncDom.elementOpen('div'); IncDom.elementOpen(TestChildComponent, null, null, 'ref', 'child'); - IncDom.elementVoid(TestGrandChildComponent, null, null, 'ref', 'grandChild'); + IncDom.elementVoid( + TestGrandChildComponent, + null, + null, + 'ref', + 'grandChild' + ); IncDom.elementClose(TestChildComponent); IncDom.elementClose('div'); } @@ -2147,8 +2365,8 @@ describe('IncrementalDomRenderer', function() { TestComponent.RENDERER = IncrementalDomRenderer; component = new TestComponent(); - var child = component.components.child; - var grandChild = component.components.grandChild; + let child = component.components.child; + let grandChild = component.components.grandChild; assert.ok(child instanceof TestChildComponent); assert.ok(grandChild instanceof TestGrandChildComponent); assert.ok(!component.context.foo); @@ -2167,12 +2385,12 @@ describe('IncrementalDomRenderer', function() { } TestChildComponent.RENDERER = IncrementalDomRenderer; - var element = document.createElement('div'); - var tempComp; + let element = document.createElement('div'); + let tempComp; class TestComponent extends Component { getChildContext() { return { - foo: 'foo' + foo: 'foo', }; } @@ -2181,7 +2399,7 @@ describe('IncrementalDomRenderer', function() { } rendered() { - var fn = () => { + let fn = () => { IncDom.elementVoid(TestChildComponent, null, null, 'ref', 'child'); }; tempComp = IncrementalDomRenderer.render(fn, element); @@ -2190,7 +2408,7 @@ describe('IncrementalDomRenderer', function() { TestComponent.RENDERER = IncrementalDomRenderer; component = new TestComponent(); - var child = tempComp.components.child; + let child = tempComp.components.child; assert.ok(child instanceof TestChildComponent); assert.ok(!component.context.foo); assert.ok(!component.context.bar); @@ -2198,11 +2416,13 @@ describe('IncrementalDomRenderer', function() { }); describe('Dispose Unused Sub Components', function() { - it('should dispose sub components that are unused after an update', function(done) { + it('should dispose sub components that are unused after an update', function( + done + ) { class TestComponent extends Component { render() { IncDom.elementOpen('div'); - for (var i = 1; i <= this.count; i++) { + for (let i = 1; i <= this.count; i++) { IncDom.elementVoid('ChildComponent', null, ['ref', 'child' + i]); } IncDom.elementClose('div'); @@ -2211,11 +2431,11 @@ describe('IncrementalDomRenderer', function() { TestComponent.RENDERER = IncrementalDomRenderer; TestComponent.STATE = { count: { - value: 3 - } + value: 3, + }, }; component = new TestComponent(); - var subComps = object.mixin({}, component.components); + let subComps = object.mixin({}, component.components); assert.strictEqual(3, Object.keys(subComps).length); assert.ok(subComps.child1); assert.ok(subComps.child2); @@ -2235,7 +2455,9 @@ describe('IncrementalDomRenderer', function() { }); }); - it('should dispose unused sub component before triggering update rerender', function(done) { + it('should dispose unused sub component before triggering update rerender', function( + done + ) { class TestComponent extends Component { render() { IncDom.elementOpen('div'); @@ -2248,11 +2470,11 @@ describe('IncrementalDomRenderer', function() { TestComponent.RENDERER = IncrementalDomRenderer; TestComponent.STATE = { foo: { - value: 'foo' - } + value: 'foo', + }, }; component = new TestComponent(); - var child = component.components.child; + let child = component.components.child; sinon.spy(child, 'render'); component.foo = 'bar'; @@ -2264,7 +2486,9 @@ describe('IncrementalDomRenderer', function() { }); }); - it('should dispose sub components from "children" that are unused after an update', function(done) { + it('should dispose sub components from "children" that are unused after an update', function( + done + ) { class TestChildComponent extends Component { render() { IncDom.elementOpen('div'); @@ -2275,8 +2499,8 @@ describe('IncrementalDomRenderer', function() { TestChildComponent.RENDERER = IncrementalDomRenderer; TestChildComponent.STATE = { index: { - value: 0 - } + value: 0, + }, }; class TestComponent extends Component { @@ -2290,8 +2514,8 @@ describe('IncrementalDomRenderer', function() { TestComponent.RENDERER = IncrementalDomRenderer; component = new TestComponent(); - var child = component.components.child; - var item1 = component.components.item1; + let child = component.components.child; + let item1 = component.components.item1; assert.ok(item1); assert.ok(!component.components.item2); assert.ok(!item1.isDisposed()); @@ -2306,12 +2530,20 @@ describe('IncrementalDomRenderer', function() { }); }); - it('should dispose sub components from sub components that are unused after a parent update', function(done) { + it('should dispose sub components from sub components that are unused after a parent update', function( + done + ) { class TestChildComponent extends Component { render() { IncDom.elementOpen('div'); if (!this.remove) { - IncDom.elementOpen(ChildComponent, null, null, 'ref', 'innerChild'); + IncDom.elementOpen( + ChildComponent, + null, + null, + 'ref', + 'innerChild' + ); IncDom.elementClose(ChildComponent); } IncDom.elementClose('div'); @@ -2319,24 +2551,30 @@ describe('IncrementalDomRenderer', function() { } TestChildComponent.RENDERER = IncrementalDomRenderer; TestChildComponent.STATE = { - remove: { - } + remove: {}, }; class TestComponent extends Component { render() { - IncDom.elementVoid(TestChildComponent, null, null, 'ref', 'child', 'remove', this.remove); + IncDom.elementVoid( + TestChildComponent, + null, + null, + 'ref', + 'child', + 'remove', + this.remove + ); } } TestComponent.RENDERER = IncrementalDomRenderer; TestComponent.STATE = { - remove: { - } + remove: {}, }; component = new TestComponent(); - var child = component.components.child; - var innerChild = child.components.innerChild; + let child = component.components.child; + let innerChild = child.components.innerChild; assert.ok(innerChild); component.remove = true; @@ -2350,7 +2588,9 @@ describe('IncrementalDomRenderer', function() { }); }); - it('should not remove reusable element from disposed component', function(done) { + it('should not remove reusable element from disposed component', function( + done + ) { class TestChildComponent extends Component { render() { IncDom.elementOpen('child'); @@ -2360,37 +2600,53 @@ describe('IncrementalDomRenderer', function() { } TestChildComponent.STATE = { index: { - value: 0 - } + value: 0, + }, }; TestChildComponent.RENDERER = IncrementalDomRenderer; class TestComponent extends Component { render() { IncDom.elementOpen(TestChildComponent, null, null, 'ref', 'child'); - IncDom.elementVoid(ChildComponent, null, null, 'foo', 'foo1', 'ref', 'grandchild1'); - IncDom.elementVoid(ChildComponent, null, null, 'foo', 'foo2', 'ref', 'grandchild2'); + IncDom.elementVoid( + ChildComponent, + null, + null, + 'foo', + 'foo1', + 'ref', + 'grandchild1' + ); + IncDom.elementVoid( + ChildComponent, + null, + null, + 'foo', + 'foo2', + 'ref', + 'grandchild2' + ); IncDom.elementClose(TestChildComponent); } } TestComponent.RENDERER = IncrementalDomRenderer; component = new TestComponent(); - var child = component.components.child; - var child1 = component.components.grandchild1; + let child = component.components.child; + let child1 = component.components.grandchild1; assert.ok(child1); assert.strictEqual('foo1', child1.foo); assert.strictEqual(child1.element, child.element.childNodes[0]); assert.ok(!child1.isDisposed()); assert.ok(!component.components.foo2); - var child1Element = child1.element; + let child1Element = child1.element; child.index = 1; child.once('stateSynced', function() { assert.ok(!component.components.grandchild1); assert.ok(child1.isDisposed()); - var child2 = component.components.grandchild2; + let child2 = component.components.grandchild2; assert.ok(child2); assert.strictEqual('foo2', child2.foo); assert.strictEqual(child2.element, child.element.childNodes[0]); @@ -2400,7 +2656,9 @@ describe('IncrementalDomRenderer', function() { }); }); - it('should not remove reusable element from disposed component\'s sub components', function(done) { + it('should not remove reusable element from disposed component\'s sub components', function( + done + ) { class TestChildComponent extends Component { render() { IncDom.elementVoid(ChildComponent, null, null, 'ref', 'child'); @@ -2421,12 +2679,11 @@ describe('IncrementalDomRenderer', function() { } TestComponent.RENDERER = IncrementalDomRenderer; TestComponent.STATE = { - switch: { - } + switch: {}, }; component = new TestComponent(); - var child = component.components.child1; + let child = component.components.child1; assert.ok(child instanceof TestChildComponent); assert.strictEqual(child.element, component.element.childNodes[0]); @@ -2443,7 +2700,9 @@ describe('IncrementalDomRenderer', function() { }); }); - it('should not dispose new sub component with same ref as unused sub component', function(done) { + it('should not dispose new sub component with same ref as unused sub component', function( + done + ) { class TestChildComponent extends Component { render() { IncrementalDOM.elementVoid('child'); @@ -2464,16 +2723,15 @@ describe('IncrementalDomRenderer', function() { } TestComponent.RENDERER = IncrementalDomRenderer; TestComponent.STATE = { - switch: { - } + switch: {}, }; component = new TestComponent(); - var child = component.components.child; + let child = component.components.child; assert.ok(child instanceof ChildComponent); component.switch = true; component.once('stateSynced', function() { - var newChild = component.components.child; + let newChild = component.components.child; assert.ok(newChild instanceof TestChildComponent); assert.notStrictEqual(child, newChild); assert.ok(child.isDisposed()); @@ -2483,7 +2741,9 @@ describe('IncrementalDomRenderer', function() { }); }); - it('should not dispose unused sub component if "skipNextChildrenDisposal" is called', function(done) { + it('should not dispose unused sub component if "skipNextChildrenDisposal" is called', function( + done + ) { class TestComponent extends Component { render() { IncDom.elementOpen('div'); @@ -2496,11 +2756,11 @@ describe('IncrementalDomRenderer', function() { TestComponent.RENDERER = IncrementalDomRenderer; TestComponent.STATE = { foo: { - value: 'foo' - } + value: 'foo', + }, }; component = new TestComponent(); - var child = component.components.child; + let child = component.components.child; sinon.spy(child, 'render'); component.foo = 'bar'; @@ -2547,7 +2807,15 @@ describe('IncrementalDomRenderer', function() { core.enableCompatibilityMode(); class TestComponent extends Component { render() { - IncDom.elementVoid(ChildComponent, null, null, 'key', 'keyChild', 'ref', 'refChild'); + IncDom.elementVoid( + ChildComponent, + null, + null, + 'key', + 'keyChild', + 'ref', + 'refChild' + ); } } TestComponent.RENDERER = IncrementalDomRenderer; @@ -2559,11 +2827,10 @@ describe('IncrementalDomRenderer', function() { }); it('should store component references via "key" when renderer is enabled by compatibility mode', function() { - class TestRendererClass extends IncrementalDomRenderer.constructor { - } + class TestRendererClass extends IncrementalDomRenderer.constructor {} const TestRenderer = new TestRendererClass(); core.enableCompatibilityMode({ - renderers: [TestRenderer] + renderers: [TestRenderer], }); class TestComponent extends Component { @@ -2579,12 +2846,11 @@ describe('IncrementalDomRenderer', function() { }); it('should store component references via "key" when renderer is enabled by compatibility mode via its name', function() { - class TestRendererClass extends IncrementalDomRenderer.constructor { - } + class TestRendererClass extends IncrementalDomRenderer.constructor {} const TestRenderer = new TestRendererClass(); TestRenderer.RENDERER_NAME = 'test'; core.enableCompatibilityMode({ - renderers: ['test'] + renderers: ['test'], }); class TestComponent extends Component { @@ -2600,11 +2866,10 @@ describe('IncrementalDomRenderer', function() { }); it('should not store component references via "key" when renderer is not enabled by compatibility mode', function() { - class TestRendererClass extends IncrementalDomRenderer.constructor { - } + class TestRendererClass extends IncrementalDomRenderer.constructor {} const TestRenderer = new TestRendererClass(); core.enableCompatibilityMode({ - renderers: [TestRenderer] + renderers: [TestRenderer], }); class TestComponent extends Component { @@ -2618,40 +2883,45 @@ describe('IncrementalDomRenderer', function() { assert.ok(!component.components.child); }); - describe('Sunset Tests', sunset(function() { - it('should not store component references via "key" on compatibility mode after version 3.x', function() { - core.enableCompatibilityMode(); - class TestComponent extends Component { - render() { - IncDom.elementVoid(ChildComponent, null, null, 'key', 'child'); + describe( + 'Sunset Tests', + sunset(function() { + it('should not store component references via "key" on compatibility mode after version 3.x', function() { + core.enableCompatibilityMode(); + class TestComponent extends Component { + render() { + IncDom.elementVoid(ChildComponent, null, null, 'key', 'child'); + } } - } - TestComponent.RENDERER = IncrementalDomRenderer; + TestComponent.RENDERER = IncrementalDomRenderer; - component = new TestComponent(); - assert.ok(!component.components.child); - }); - })); + component = new TestComponent(); + assert.ok(!component.components.child); + }); + }) + ); }); }); describe('Function - shouldUpdate', function() { - it('should only rerender after state change if "shouldUpdate" returns true', function(done) { + it('should only rerender after state change if "shouldUpdate" returns true', function( + done + ) { class TestComponent extends Component { render() {} shouldUpdate(changes) { - return changes.foo && (changes.foo.prevVal !== changes.foo.newVal); + return changes.foo && changes.foo.prevVal !== changes.foo.newVal; } } TestComponent.RENDERER = IncrementalDomRenderer; TestComponent.STATE = { bar: { - value: 'bar' + value: 'bar', }, foo: { - value: 'foo' - } + value: 'foo', + }, }; component = new TestComponent(); @@ -2677,7 +2947,9 @@ describe('IncrementalDomRenderer', function() { IncrementalDOM.skipNode.restore(); }); - it('should not rerender child component if its "shouldUpdate" returns false', function(done) { + it('should not rerender child component if its "shouldUpdate" returns false', function( + done + ) { class TestChildComponent extends Component { render() { IncDom.elementOpen('span'); @@ -2702,17 +2974,20 @@ describe('IncrementalDomRenderer', function() { TestComponent.RENDERER = IncrementalDomRenderer; TestComponent.STATE = { foo: { - value: 'foo' - } + value: 'foo', + }, }; component = new TestComponent(); - var child = component.components.child; + let child = component.components.child; component.foo = 'foo2'; component.once('stateSynced', function() { assert.strictEqual(1, IncrementalDOM.skipNode.callCount); - assert.strictEqual('foo2', component.element.childNodes[0].textContent); + assert.strictEqual( + 'foo2', + component.element.childNodes[0].textContent + ); assert.strictEqual(child.element, component.element.childNodes[1]); assert.strictEqual('SPAN', child.element.tagName); assert.strictEqual('Child', child.element.textContent); @@ -2721,7 +2996,9 @@ describe('IncrementalDomRenderer', function() { }); }); - it('should correctly reposition child component even if its "shouldUpdate" returns false', function(done) { + it('should correctly reposition child component even if its "shouldUpdate" returns false', function( + done + ) { class TestChildComponent extends Component { render() { IncDom.elementOpen('span'); @@ -2750,12 +3027,11 @@ describe('IncrementalDomRenderer', function() { } TestComponent.RENDERER = IncrementalDomRenderer; TestComponent.STATE = { - wrap: { - } + wrap: {}, }; component = new TestComponent(); - var child = component.components.child; + let child = component.components.child; assert.strictEqual(1, component.element.childNodes.length); assert.strictEqual(child.element, component.element.childNodes[0]); assert.strictEqual('SPAN', child.element.tagName); @@ -2765,14 +3041,19 @@ describe('IncrementalDomRenderer', function() { component.once('stateSynced', function() { assert.strictEqual(1, component.element.childNodes.length); assert.ok(dom.hasClass(component.element.childNodes[0], 'wrapper')); - assert.strictEqual(child.element, component.element.childNodes[0].childNodes[0]); + assert.strictEqual( + child.element, + component.element.childNodes[0].childNodes[0] + ); assert.strictEqual('SPAN', child.element.tagName); assert.strictEqual('Child', child.element.textContent); done(); }); }); - it('should skip child update without error if it had no element before', function(done) { + it('should skip child update without error if it had no element before', function( + done + ) { class TestChildComponent extends Component { render() {} @@ -2793,12 +3074,12 @@ describe('IncrementalDomRenderer', function() { TestComponent.RENDERER = IncrementalDomRenderer; TestComponent.STATE = { foo: { - value: 'foo' - } + value: 'foo', + }, }; component = new TestComponent(); - var child = component.components.child; + let child = component.components.child; sinon.spy(child, 'render'); component.foo = 'foo2'; @@ -2813,7 +3094,9 @@ describe('IncrementalDomRenderer', function() { }); describe('Function - willUpdate', function() { - it('should run "willUpdate" lifecycle method when the component is about to render', function(done) { + it('should run "willUpdate" lifecycle method when the component is about to render', function( + done + ) { class TestComponent extends Component { render() {} } @@ -2821,8 +3104,8 @@ describe('IncrementalDomRenderer', function() { TestComponent.RENDERER = IncrementalDomRenderer; TestComponent.STATE = { foo: { - value: 'foo' - } + value: 'foo', + }, }; component = new TestComponent(); @@ -2836,8 +3119,8 @@ describe('IncrementalDomRenderer', function() { foo: { key: 'foo', newVal: 'foo2', - prevVal: 'foo' - } + prevVal: 'foo', + }, }); done(); @@ -2845,8 +3128,9 @@ describe('IncrementalDomRenderer', function() { }); }); - it('should run "willUpdate" lifecycle method of nested component when it is about to render', function(done) { - const listener = sinon.stub(); + it('should run "willUpdate" lifecycle method of nested component when it is about to render', function( + done + ) { class TestChildComponent extends Component { render() {} } @@ -2854,22 +3138,30 @@ describe('IncrementalDomRenderer', function() { TestChildComponent.RENDERER = IncrementalDomRenderer; TestChildComponent.STATE = { foo: { - value: 'foo' - } + value: 'foo', + }, }; class TestComponent extends Component { render() { IncDom.elementOpen('div'); - IncDom.elementVoid(TestChildComponent, null, null, 'ref', 'child', 'foo', this.foo); + IncDom.elementVoid( + TestChildComponent, + null, + null, + 'ref', + 'child', + 'foo', + this.foo + ); IncDom.elementClose('div'); } } TestComponent.RENDERER = IncrementalDomRenderer; TestComponent.STATE = { foo: { - value: 'foo' - } + value: 'foo', + }, }; component = new TestComponent(); @@ -2884,7 +3176,7 @@ describe('IncrementalDomRenderer', function() { assert.deepEqual(child.willUpdate.args[0][0].foo, { key: 'foo', newVal: 'foo2', - prevVal: 'foo' + prevVal: 'foo', }); done(); @@ -2895,7 +3187,7 @@ describe('IncrementalDomRenderer', function() { describe('Componentless function tags', function() { it('should render componentless function passed as incremental dom tag', function() { - var TestFunction = ({foo}) => { + let TestFunction = ({foo}) => { IncDom.elementOpen('span'); IncDom.text(foo); return IncDom.elementClose('span'); @@ -2918,7 +3210,7 @@ describe('IncrementalDomRenderer', function() { }); it('should render children from componentless function passed as incremental dom tag', function() { - var TestFunction = ({children}) => { + let TestFunction = ({children}) => { IncDom.elementOpen('span'); children.forEach(IncrementalDomRenderer.renderChild); return IncDom.elementClose('span'); @@ -2939,35 +3231,40 @@ describe('IncrementalDomRenderer', function() { assert.strictEqual(0, Object.keys(component.components).length); assert.strictEqual(1, component.element.childNodes.length); assert.strictEqual('SPAN', component.element.childNodes[0].tagName); - assert.strictEqual('children', component.element.childNodes[0].textContent); + assert.strictEqual( + 'children', + component.element.childNodes[0].textContent + ); }); it('should render componentless function via "IncrementalDomRenderer.render"', function() { - var fn = props => { + let fn = props => { IncDom.elementOpen('span', null, null, 'foo', props.foo); IncDom.text('bar'); IncDom.elementClose('span'); }; - var container = document.createElement('span'); + let container = document.createElement('span'); IncrementalDomRenderer.render( fn, { - foo: 'fooValue' + foo: 'fooValue', }, container ); assert.strictEqual(1, container.childNodes.length); - assert.strictEqual('fooValue', container.childNodes[0].getAttribute('foo')); + assert.strictEqual( + 'fooValue', + container.childNodes[0].getAttribute('foo') + ); assert.strictEqual('bar', container.childNodes[0].textContent); }); }); describe('Dispose', function() { it('should remove component with ref from owner', function() { - class Child extends Component { - } + class Child extends Component {} Child.RENDERER = IncrementalDomRenderer; class TestComponent extends Component { @@ -2978,7 +3275,7 @@ describe('IncrementalDomRenderer', function() { TestComponent.RENDERER = IncrementalDomRenderer; component = new TestComponent(); - var child = component.components.child; + let child = component.components.child; child.dispose(); assert.ok(child.isDisposed()); @@ -2986,8 +3283,7 @@ describe('IncrementalDomRenderer', function() { }); it('should not remove different component with same ref from owner', function() { - class Child extends Component { - } + class Child extends Component {} Child.RENDERER = IncrementalDomRenderer; class TestComponent extends Component { @@ -2998,7 +3294,7 @@ describe('IncrementalDomRenderer', function() { TestComponent.RENDERER = IncrementalDomRenderer; component = new TestComponent(); - var child = component.components.child; + let child = component.components.child; component.components.child = new Child(); child.dispose(); @@ -3011,12 +3307,16 @@ describe('IncrementalDomRenderer', function() { describe('IncrementalDomRenderer.isIncDomNode', function() { it('should check if given data is an incremental dom node', function() { assert.ok(!IncrementalDomRenderer.isIncDomNode({})); - assert.ok(!IncrementalDomRenderer.isIncDomNode({ - tag: 'span' - })); - assert.ok(IncrementalDomRenderer.isIncDomNode({ - [CHILD_OWNER]: true - })); + assert.ok( + !IncrementalDomRenderer.isIncDomNode({ + tag: 'span', + }) + ); + assert.ok( + IncrementalDomRenderer.isIncDomNode({ + [CHILD_OWNER]: true, + }) + ); }); }); diff --git a/packages/metal-incremental-dom/test/callArgs.js b/packages/metal-incremental-dom/test/callArgs.js index 8662689a..ce9b4549 100644 --- a/packages/metal-incremental-dom/test/callArgs.js +++ b/packages/metal-incremental-dom/test/callArgs.js @@ -1,29 +1,32 @@ 'use strict'; -import { buildCallFromConfig, buildConfigFromCall } from '../src/callArgs'; +import {buildCallFromConfig, buildConfigFromCall} from '../src/callArgs'; describe('callArgs', function() { it('should build configuration object from incremental dom call', function() { - var config = buildConfigFromCall([ + let config = buildConfigFromCall([ 'span', 'key', ['static1', 'staticVal1', 'static2', 'staticVal2'], 'attr1', - 'attrVal1' + 'attrVal1', ]); - assert.deepEqual({ - key: 'key', - static1: 'staticVal1', - static2: 'staticVal2', - attr1: 'attrVal1' - }, config); + assert.deepEqual( + { + key: 'key', + static1: 'staticVal1', + static2: 'staticVal2', + attr1: 'attrVal1', + }, + config + ); }); it('should build incremental dom call from configuration object', function() { const call = buildCallFromConfig('span', { key: 'key', attr1: 'attrVal1', - attr2: 'attrVal2' + attr2: 'attrVal2', }); assert.equal(7, call.length); diff --git a/packages/metal-incremental-dom/test/changes.js b/packages/metal-incremental-dom/test/changes.js index 1f903d8f..863d7881 100644 --- a/packages/metal-incremental-dom/test/changes.js +++ b/packages/metal-incremental-dom/test/changes.js @@ -1,7 +1,7 @@ 'use strict'; -import { clearChanges, getChanges, trackChanges } from '../src/changes'; -import { getData } from '../src/data'; +import {clearChanges, getChanges, trackChanges} from '../src/changes'; +import {getData} from '../src/data'; import Component from 'metal-component'; describe('changes', function() { @@ -19,15 +19,18 @@ describe('changes', function() { component.visible = false; const changes = getChanges(component); - assert.deepEqual({ - props: { - visible: { - key: 'visible', - newVal: false, - prevVal: true - } - } - }, changes); + assert.deepEqual( + { + props: { + visible: { + key: 'visible', + newVal: false, + prevVal: true, + }, + }, + }, + changes + ); }); it('should clear changes for a given component', function() { diff --git a/packages/metal-incremental-dom/test/children/children.js b/packages/metal-incremental-dom/test/children/children.js index edf24ce6..6afff046 100644 --- a/packages/metal-incremental-dom/test/children/children.js +++ b/packages/metal-incremental-dom/test/children/children.js @@ -1,15 +1,20 @@ 'use strict'; import dom from 'metal-dom'; -import { sunset } from '../../../../test-utils'; -import { captureChildren, getOwner, renderChildTree, CHILD_OWNER } from '../../src/children/children'; +import {sunset} from '../../../../test-utils'; +import { + captureChildren, + getOwner, + renderChildTree, + CHILD_OWNER, +} from '../../src/children/children'; describe('children', function() { it('should capture children calls to incremental dom', function(done) { captureChildren({}, function(tree) { assert.strictEqual(1, tree.props.children.length); - var node = tree.props.children[0]; + let node = tree.props.children[0]; assert.ok(!node.text); assert.strictEqual('span', node.tag); assert.ok(node.props); @@ -32,10 +37,7 @@ describe('children', function() { it('should return the captured tree\'s given owner object', function(done) { const owner = {}; captureChildren(owner, function(tree) { - assert.strictEqual( - owner, - getOwner(tree.props.children[0]) - ); + assert.strictEqual(owner, getOwner(tree.props.children[0])); done(); }); @@ -43,22 +45,21 @@ describe('children', function() { IncrementalDOM.elementClose('div'); }); - it('should store args for text nodes when they contain more than just the text', function(done) { + it('should store args for text nodes when they contain more than just the text', function( + done + ) { captureChildren({}, function(tree) { - var node = tree.props.children[0]; + let node = tree.props.children[0]; assert.strictEqual('No args', node.text); assert.ok(!node.args); node = tree.props.children[1]; assert.strictEqual('With args', node.text); - assert.deepEqual([ - node.text, - formatFn - ], node.args); + assert.deepEqual([node.text, formatFn], node.args); done(); }); - var formatFn = val => val; + const formatFn = val => val; IncrementalDOM.text('No args'); IncrementalDOM.text('With args', formatFn); IncrementalDOM.elementClose('div'); @@ -71,7 +72,7 @@ describe('children', function() { origElementOpen = IncrementalDOM.elementOpen; IncrementalDOM.elementOpen = function(...args) { args[0] = args[0].tag; - origElementOpen.apply(null, args); + origElementOpen(...args); }; }); @@ -80,7 +81,7 @@ describe('children', function() { }); it('should render captured children via incremental dom', function() { - var element = document.createElement('div'); + let element = document.createElement('div'); IncrementalDOM.patch(element, () => { renderChildTree({ @@ -89,19 +90,19 @@ describe('children', function() { children: [ { args: ['Hello World'], - text: 'Hello World' - } + text: 'Hello World', + }, ], class: 'test', foo: 'bar', - key: 'key' - } + key: 'key', + }, }); }); assert.strictEqual(1, element.childNodes.length); - var spanElement = element.childNodes[0]; + let spanElement = element.childNodes[0]; assert.strictEqual('SPAN', spanElement.tagName); assert.ok(dom.hasClass(spanElement, 'test')); assert.strictEqual('bar', spanElement.getAttribute('foo')); @@ -110,7 +111,7 @@ describe('children', function() { }); it('should skip rendering children node when skipNode function returns true', function() { - var element = document.createElement('div'); + let element = document.createElement('div'); function skipNode(node) { if (node.props && node.props.id === 'skip') { @@ -118,52 +119,60 @@ describe('children', function() { } } IncrementalDOM.patch(element, () => { - renderChildTree({ - tag: 'span', - props: { - children: [ - { - tag: 'span', - props: { - id: 'beforeSkip' - } - }, - { - tag: 'span', - props: { - id: 'skip' - } - }, - { - tag: 'span', - props: { - id: 'afterSkip' - } - } - ], - id: 'parent' - } - }, skipNode); + renderChildTree( + { + tag: 'span', + props: { + children: [ + { + tag: 'span', + props: { + id: 'beforeSkip', + }, + }, + { + tag: 'span', + props: { + id: 'skip', + }, + }, + { + tag: 'span', + props: { + id: 'afterSkip', + }, + }, + ], + id: 'parent', + }, + }, + skipNode + ); }); assert.strictEqual(1, element.childNodes.length); - var child = element.childNodes[0]; + let child = element.childNodes[0]; assert.strictEqual(2, child.childNodes.length); assert.strictEqual('beforeSkip', child.childNodes[0].id); assert.strictEqual('afterSkip', child.childNodes[1].id); }); - it('should render text nodes that have been changed after capture', function(done) { + it('should render text nodes that have been changed after capture', function( + done + ) { captureChildren({}, function(tree) { - var element = document.createElement('div'); + let element = document.createElement('div'); tree.props.children[0].text = 'New Text'; IncrementalDOM.patch(element, () => { renderChildTree(tree.props.children[0]); }); assert.strictEqual(1, element.childNodes.length); - assert.strictEqual('New Text Formatted', element.childNodes[0].textContent); + assert.strictEqual( + 'New Text Formatted', + element.childNodes[0].textContent + ); done(); }); @@ -172,12 +181,14 @@ describe('children', function() { }); }); - it('should keep original renderer for children that have been recaptured by another1', function(done) { - var renderer1 = {}; - var renderer2 = {}; + it('should keep original renderer for children that have been recaptured by another1', function( + done + ) { + let renderer1 = {}; + let renderer2 = {}; captureChildren(renderer2, function(tree) { - var element = tree.props.children[0]; + let element = tree.props.children[0]; assert.strictEqual('div', element.tag); assert.strictEqual(renderer2, getOwner(element)); assert.strictEqual(1, element.props.children.length); @@ -200,28 +211,33 @@ describe('children', function() { children: [ { text: 'Hello World', - [CHILD_OWNER]: renderer1 + [CHILD_OWNER]: renderer1, }, - ] + ], }, - [CHILD_OWNER]: renderer1 + [CHILD_OWNER]: renderer1, }); IncrementalDOM.elementClose('div'); IncrementalDOM.elementClose('div'); }); - describe('Sunset Tests', sunset(function() { - it('should not have "config" object inside each child after version 3.x', function(done) { - captureChildren({}, function(tree) { - assert.strictEqual(1, tree.props.children.length); + describe( + 'Sunset Tests', + sunset(function() { + it('should not have "config" object inside each child after version 3.x', function( + done + ) { + captureChildren({}, function(tree) { + assert.strictEqual(1, tree.props.children.length); + + let node = tree.props.children[0]; + assert.ok(!node.config, 'Remove "config" for version 3.x'); + done(); + }); - var node = tree.props.children[0]; - assert.ok(!node.config, 'Remove "config" for version 3.x'); - done(); + IncrementalDOM.elementVoid('span', null, null, 'foo', 'bar'); + IncrementalDOM.elementClose('div'); }); - - IncrementalDOM.elementVoid('span', null, null, 'foo', 'bar'); - IncrementalDOM.elementClose('div'); - }); - })); + }) + ); }); diff --git a/packages/metal-incremental-dom/test/cleanup/unused.js b/packages/metal-incremental-dom/test/cleanup/unused.js index db9ba3c3..82a03987 100644 --- a/packages/metal-incremental-dom/test/cleanup/unused.js +++ b/packages/metal-incremental-dom/test/cleanup/unused.js @@ -2,12 +2,12 @@ import Component from 'metal-component'; import IncrementalDomRenderer from '../../src/IncrementalDomRenderer'; -import { disposeUnused, schedule } from '../../src/cleanup/unused'; -import { getData } from '../../src/data'; +import {disposeUnused, schedule} from '../../src/cleanup/unused'; +import {getData} from '../../src/data'; describe('unused', function() { - var comp; - var grandchild; + let comp; + let grandchild; beforeEach(function() { class GrandChild extends Component { @@ -43,7 +43,7 @@ describe('unused', function() { }); it('should dispose scheduled components', function() { - var comps = [comp.components.child1, comp.components.child2]; + let comps = [comp.components.child1, comp.components.child2]; schedule(comps); disposeUnused(); @@ -52,7 +52,7 @@ describe('unused', function() { }); it('should not dispose scheduled components that have received a new parent', function() { - var comps = [comp.components.child1, comp.components.child2]; + let comps = [comp.components.child1, comp.components.child2]; schedule(comps); getData(comps[0]).parent = comp; disposeUnused(); @@ -62,7 +62,7 @@ describe('unused', function() { }); it('should not dispose scheduled components that have been disposed before scheduled', function() { - var comps = [comp.components.child1, comp.components.child2]; + let comps = [comp.components.child1, comp.components.child2]; comps[0].dispose(); schedule(comps); sinon.spy(comps[0], 'dispose'); @@ -74,7 +74,7 @@ describe('unused', function() { }); it('should not dispose scheduled components that have been disposed after scheduled', function() { - var comps = [comp.components.child1, comp.components.child2]; + let comps = [comp.components.child1, comp.components.child2]; schedule(comps); comps[0].dispose(); sinon.spy(comps[0], 'dispose'); @@ -90,7 +90,7 @@ describe('unused', function() { disposeUnused(); }); - var comps = [comp.components.child1]; + let comps = [comp.components.child1]; schedule(comps); assert.doesNotThrow(() => disposeUnused()); @@ -98,7 +98,7 @@ describe('unused', function() { }); it('should not throw error when disposing component that has an owner that was previously disposed', function() { - var comps = [comp.components.child2, grandchild]; + let comps = [comp.components.child2, grandchild]; schedule(comps); assert.doesNotThrow(() => disposeUnused()); }); diff --git a/packages/metal-incremental-dom/test/data.js b/packages/metal-incremental-dom/test/data.js index 7ab02534..2ca549bb 100644 --- a/packages/metal-incremental-dom/test/data.js +++ b/packages/metal-incremental-dom/test/data.js @@ -1,6 +1,6 @@ 'use strict'; -import { clearData, getData } from '../src/data'; +import {clearData, getData} from '../src/data'; describe('data', function() { it('should return an empty object on the first "getData" call for an object', function() { diff --git a/packages/metal-incremental-dom/test/html/HTML2IncDom.js b/packages/metal-incremental-dom/test/html/HTML2IncDom.js index 9ca88ce1..f58aa852 100644 --- a/packages/metal-incremental-dom/test/html/HTML2IncDom.js +++ b/packages/metal-incremental-dom/test/html/HTML2IncDom.js @@ -4,36 +4,36 @@ import HTML2IncDom from '../../src/html/HTML2IncDom'; describe('HTML2IncDom', function() { it('should render html inside element via incremental dom', function() { - var element = document.createElement('div'); - var htmlStr = '
Foo
'; + let element = document.createElement('div'); + let htmlStr = '
Foo
'; IncrementalDOM.patch(element, () => HTML2IncDom.run(htmlStr)); assert.strictEqual(htmlStr, element.innerHTML); }); it('should render link element inside its span parent via incremental dom', function() { - var element = document.createElement('div'); - var htmlStr = 'Foo'; + let element = document.createElement('div'); + let htmlStr = 'Foo'; IncrementalDOM.patch(element, () => HTML2IncDom.run(htmlStr)); assert.strictEqual(htmlStr, element.innerHTML); }); it('should render escaped html inside element via incremental dom', function() { - var element = document.createElement('div'); + let element = document.createElement('div'); IncrementalDOM.patch(element, () => HTML2IncDom.run(''Foo'')); assert.strictEqual('\'Foo\'', element.textContent); }); it('should render void elements from html via incremental dom', function() { - var element = document.createElement('div'); - var htmlStr = ''; + let element = document.createElement('div'); + let htmlStr = ''; IncrementalDOM.patch(element, () => HTML2IncDom.run(htmlStr)); assert.strictEqual(htmlStr, element.innerHTML); }); it('should build function for rendering html via incremental dom', function() { - var element = document.createElement('div'); - var htmlStr = '
Foo
'; - var fn = HTML2IncDom.buildFn(htmlStr); + let element = document.createElement('div'); + let htmlStr = '
Foo
'; + let fn = HTML2IncDom.buildFn(htmlStr); assert.strictEqual(0, element.childNodes.length); IncrementalDOM.patch(element, fn); @@ -52,10 +52,13 @@ describe('HTML2IncDom', function() { handlers.end('div'); }); - var element = document.createElement('div'); - var htmlStr = '
Foo
'; + let element = document.createElement('div'); + let htmlStr = '
Foo
'; IncrementalDOM.patch(element, () => HTML2IncDom.run(htmlStr)); - assert.strictEqual('
Foo-CustomParser
', element.innerHTML); + assert.strictEqual( + '
Foo-CustomParser
', + element.innerHTML + ); }); }); }); diff --git a/packages/metal-incremental-dom/test/incremental-dom-aop.js b/packages/metal-incremental-dom/test/incremental-dom-aop.js index adff6fad..27282653 100644 --- a/packages/metal-incremental-dom/test/incremental-dom-aop.js +++ b/packages/metal-incremental-dom/test/incremental-dom-aop.js @@ -2,10 +2,14 @@ import core from 'metal'; import dom from 'metal-dom'; -import { getOriginalFns, startInterception, stopInterception } from '../src/incremental-dom-aop'; +import { + getOriginalFns, + startInterception, + stopInterception, +} from '../src/incremental-dom-aop'; describe('incremental-dom-aop', function() { - var element; + let element; beforeEach(function() { element = document.createElement('div'); @@ -19,7 +23,7 @@ describe('incremental-dom-aop', function() { describe('Original Functions', function() { it('should return the original functions', function() { - var originalFns = getOriginalFns(); + let originalFns = getOriginalFns(); assert.ok(originalFns); assert.ok(originalFns.attr); assert.ok(originalFns.attributes); @@ -34,9 +38,9 @@ describe('incremental-dom-aop', function() { describe('elementOpen', function() { it('should intercept elementOpen calls with specified function', function() { - var fn = sinon.stub(); + let fn = sinon.stub(); startInterception({ - elementOpen: fn + elementOpen: fn, }); IncrementalDOM.elementOpen('div', 'key', 'statics', 'name', 'value'); @@ -49,9 +53,9 @@ describe('incremental-dom-aop', function() { }); it('should stop intercepting elementOpen calls', function() { - var fn = sinon.stub(); + let fn = sinon.stub(); startInterception({ - elementOpen: fn + elementOpen: fn, }); stopInterception(); @@ -66,11 +70,11 @@ describe('incremental-dom-aop', function() { describe('elementVoid', function() { it('should intercept elementOpen and elementClose from elementVoid calls with specified function', function() { - var openFn = sinon.stub(); - var closeFn = sinon.stub(); + let openFn = sinon.stub(); + let closeFn = sinon.stub(); startInterception({ elementClose: closeFn, - elementOpen: openFn + elementOpen: openFn, }); IncrementalDOM.elementVoid('div', 'key', 'statics', 'name', 'value'); @@ -84,9 +88,9 @@ describe('incremental-dom-aop', function() { }); it('should stop intercepting elementOpen from elementVoid calls', function() { - var fn = sinon.stub(); + let fn = sinon.stub(); startInterception({ - elementOpen: fn + elementOpen: fn, }); stopInterception(); @@ -97,9 +101,9 @@ describe('incremental-dom-aop', function() { describe('elementOpenStart/elementOpenEnd', function() { it('should intercept elementOpen from elementOpenEnd calls with specified function', function() { - var fn = sinon.stub(); + let fn = sinon.stub(); startInterception({ - elementOpen: fn + elementOpen: fn, }); IncrementalDOM.elementOpenStart('div', 'key', 'statics'); @@ -117,9 +121,9 @@ describe('incremental-dom-aop', function() { }); it('should stop intercepting elementOpen from elementOpenEnd calls', function() { - var fn = sinon.stub(); + let fn = sinon.stub(); startInterception({ - elementOpen: fn + elementOpen: fn, }); stopInterception(); @@ -134,9 +138,9 @@ describe('incremental-dom-aop', function() { describe('text', function() { it('should intercept "text" calls with specified function', function() { - var fn = sinon.stub(); + let fn = sinon.stub(); startInterception({ - text: fn + text: fn, }); IncrementalDOM.text('foo'); @@ -145,9 +149,9 @@ describe('incremental-dom-aop', function() { }); it('should stop intercepting "text" calls', function() { - var fn = sinon.stub(); + let fn = sinon.stub(); startInterception({ - text: fn + text: fn, }); stopInterception(); @@ -158,13 +162,17 @@ describe('incremental-dom-aop', function() { describe('attributes', function() { it('should intercept attribute calls with specified function', function() { - var fn = sinon.stub(); + let fn = sinon.stub(); startInterception({ - attributes: fn + attributes: fn, }); - var element = document.createElement('div'); - IncrementalDOM.attributes[IncrementalDOM.symbols.default](element, 'name', 'value'); + let element = document.createElement('div'); + IncrementalDOM.attributes[IncrementalDOM.symbols.default]( + element, + 'name', + 'value' + ); assert.strictEqual(1, fn.callCount); assert.ok(core.isElement(fn.args[0][0])); @@ -173,13 +181,17 @@ describe('incremental-dom-aop', function() { }); it('should stop intercepting attribute calls', function() { - var fn = sinon.stub(); + let fn = sinon.stub(); startInterception({ - attributes: fn + attributes: fn, }); stopInterception(); - IncrementalDOM.attributes[IncrementalDOM.symbols.default](element, 'name', 'value'); + IncrementalDOM.attributes[IncrementalDOM.symbols.default]( + element, + 'name', + 'value' + ); assert.strictEqual(0, fn.callCount); }); }); @@ -190,13 +202,13 @@ describe('incremental-dom-aop', function() { }); it('should use last registered function for intercepting', function() { - var fn = sinon.stub(); + let fn = sinon.stub(); startInterception({ - elementOpen: fn + elementOpen: fn, }); - var fn2 = sinon.stub(); + let fn2 = sinon.stub(); startInterception({ - elementOpen: fn2 + elementOpen: fn2, }); IncrementalDOM.elementOpen('div'); @@ -205,13 +217,13 @@ describe('incremental-dom-aop', function() { }); it('should revert to previous registered function when stopping interception', function() { - var fn = sinon.stub(); + let fn = sinon.stub(); startInterception({ - elementOpen: fn + elementOpen: fn, }); - var fn2 = sinon.stub(); + let fn2 = sinon.stub(); startInterception({ - elementOpen: fn2 + elementOpen: fn2, }); stopInterception(); diff --git a/packages/metal-incremental-dom/test/render/attributes.js b/packages/metal-incremental-dom/test/render/attributes.js index 7a7bc536..ca67ad53 100644 --- a/packages/metal-incremental-dom/test/render/attributes.js +++ b/packages/metal-incremental-dom/test/render/attributes.js @@ -1,7 +1,10 @@ 'use strict'; import {isFunction} from 'metal'; -import { applyAttribute, convertListenerNamesToFns } from '../../src/render/attributes'; +import { + applyAttribute, + convertListenerNamesToFns, +} from '../../src/render/attributes'; import dom from 'metal-dom'; import Component from 'metal-component'; @@ -52,13 +55,12 @@ describe('attributes', function() { describe('listeners', function() { it('should register the method name inside the listener', function() { - class TestComponent extends Component { - } + class TestComponent extends Component {} TestComponent.prototype.handleClick = function() {}; component = new TestComponent(); let config = { - 'data-onclick': 'handleClick' + 'data-onclick': 'handleClick', }; convertListenerNamesToFns(component, config); @@ -66,8 +68,7 @@ describe('attributes', function() { }); it('should attach listeners functions passed to "data-on" attributes', function() { - class TestComponent extends Component { - } + class TestComponent extends Component {} component = new TestComponent(); const element = document.createElement('div'); @@ -81,8 +82,7 @@ describe('attributes', function() { }); it('should attach listeners functions passed to "on" attributes', function() { - class TestComponent extends Component { - } + class TestComponent extends Component {} component = new TestComponent(); const element = document.createElement('div'); @@ -96,8 +96,7 @@ describe('attributes', function() { }); it('should not set attribute for listener references on elements', function() { - class TestComponent extends Component { - } + class TestComponent extends Component {} component = new TestComponent(); const element = document.createElement('div'); @@ -119,11 +118,10 @@ describe('attributes', function() { dom.registerCustomEvent('test-event', { delegate: true, handler: (callback, event) => callback(event), - originalEvent: 'click' + originalEvent: 'click', }); - class TestComponent extends Component { - } + class TestComponent extends Component {} component = new TestComponent(); const element = document.createElement('div'); @@ -139,11 +137,10 @@ describe('attributes', function() { dom.registerCustomEvent('test-event', { delegate: true, handler: (callback, event) => callback(event), - originalEvent: 'click' + originalEvent: 'click', }); - class TestComponent extends Component { - } + class TestComponent extends Component {} component = new TestComponent(); const element = document.createElement('div'); @@ -156,8 +153,7 @@ describe('attributes', function() { }); it('should remove unused inline listeners when attributes are removed', function() { - class TestComponent extends Component { - } + class TestComponent extends Component {} component = new TestComponent(); const element = document.createElement('div'); @@ -171,8 +167,7 @@ describe('attributes', function() { }); it('should replace inline listeners when attributes values change', function() { - class TestComponent extends Component { - } + class TestComponent extends Component {} TestComponent.prototype.handleClick = sinon.stub(); TestComponent.prototype.handleClick2 = sinon.stub(); component = new TestComponent(); diff --git a/packages/metal-isomorphic/test/fixtures/MyComponent.js b/packages/metal-isomorphic/test/fixtures/MyComponent.js index decce20d..e897c26f 100644 --- a/packages/metal-isomorphic/test/fixtures/MyComponent.js +++ b/packages/metal-isomorphic/test/fixtures/MyComponent.js @@ -3,15 +3,14 @@ import Soy from 'metal-soy'; import templates from './MyComponent.soy.js'; -class MyComponent extends Component { -} +class MyComponent extends Component {} MyComponent.STATE = { message: { - value: '' - } + value: '', + }, }; Soy.register(MyComponent, templates); -export default MyComponent; \ No newline at end of file +export default MyComponent; diff --git a/packages/metal-isomorphic/test/fixtures/MyJSXComponent.js b/packages/metal-isomorphic/test/fixtures/MyJSXComponent.js index 928702b2..28d13568 100644 --- a/packages/metal-isomorphic/test/fixtures/MyJSXComponent.js +++ b/packages/metal-isomorphic/test/fixtures/MyJSXComponent.js @@ -10,8 +10,8 @@ class MyJSXComponent extends JSXComponent { MyJSXComponent.PROPS = { message: { - value: '' - } + value: '', + }, }; -export default MyJSXComponent; \ No newline at end of file +export default MyJSXComponent; diff --git a/packages/metal-isomorphic/test/isomorphic.js b/packages/metal-isomorphic/test/isomorphic.js index 7152991e..4478181f 100644 --- a/packages/metal-isomorphic/test/isomorphic.js +++ b/packages/metal-isomorphic/test/isomorphic.js @@ -1,15 +1,15 @@ import Component from 'metal-component'; import MyComponent from './fixtures/MyComponent'; import MyJSXComponent from './fixtures/MyJSXComponent'; +import {assert} from 'chai'; import jsdomGlobal from 'jsdom-global'; -import { assert } from 'chai'; describe('Isomorphic Rendering', () => { it('should render soy component to string', () => { assert.ok(!global.document); const htmlString = Component.renderToString(MyComponent, { - message: 'Hello, Soy!' + message: 'Hello, Soy!', }); assert.equal(htmlString, '
Hello, Soy!
'); @@ -19,7 +19,7 @@ describe('Isomorphic Rendering', () => { assert.ok(!global.document); const htmlString = Component.renderToString(MyJSXComponent, { - message: 'Hello, JSX!' + message: 'Hello, JSX!', }); assert.equal(htmlString, '
Hello, JSX!
'); diff --git a/packages/metal-jsx/.eslintrc.json b/packages/metal-jsx/.eslintrc similarity index 66% rename from packages/metal-jsx/.eslintrc.json rename to packages/metal-jsx/.eslintrc index 81c52662..5f83befd 100644 --- a/packages/metal-jsx/.eslintrc.json +++ b/packages/metal-jsx/.eslintrc @@ -5,8 +5,5 @@ }, "plugins": [ "react" - ], - "rules": { - "react/jsx-uses-vars": [2] - } + ] } diff --git a/packages/metal-jsx/README.md b/packages/metal-jsx/README.md index d39f7132..f5dd60b3 100644 --- a/packages/metal-jsx/README.md +++ b/packages/metal-jsx/README.md @@ -1,3 +1,5 @@ # metal-jsx A JSX templates renderer to be used with Metal.js's Component class. + +See [https://metaljs.com/docs/guides/jsx-components.html](https://metaljs.com/docs/guides/jsx-components.html) for documentation. diff --git a/packages/metal-jsx/package-lock.json b/packages/metal-jsx/package-lock.json index b45b5193..91563676 100644 --- a/packages/metal-jsx/package-lock.json +++ b/packages/metal-jsx/package-lock.json @@ -64,7 +64,7 @@ "lodash": "4.17.4", "minimatch": "3.0.4", "path-is-absolute": "1.0.1", - "private": "0.1.7", + "private": "0.1.8", "slash": "1.0.0", "source-map": "0.5.7" } @@ -521,9 +521,9 @@ } }, "babel-preset-env": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.6.0.tgz", - "integrity": "sha512-OVgtQRuOZKckrILgMA5rvctvFZPv72Gua9Rt006AiPoB0DJKGN07UmaQA+qRrYgK71MVct8fFhT0EyNWYorVew==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.6.1.tgz", + "integrity": "sha512-W6VIyA6Ch9ePMI7VptNn2wBM6dbG0eSz25HEiL40nQXCsXGTGZSTZu1Iap+cj3Q0S5a7T9+529l/5Bkvd+afNA==", "requires": { "babel-plugin-check-es2015-constants": "6.22.0", "babel-plugin-syntax-trailing-function-commas": "6.22.0", @@ -552,7 +552,7 @@ "babel-plugin-transform-es2015-unicode-regex": "6.24.1", "babel-plugin-transform-exponentiation-operator": "6.24.1", "babel-plugin-transform-regenerator": "6.26.0", - "browserslist": "2.5.1", + "browserslist": "2.8.0", "invariant": "2.2.2", "semver": "5.4.1" } @@ -647,18 +647,18 @@ } }, "browserslist": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-2.5.1.tgz", - "integrity": "sha512-jAvM2ku7YDJ+leAq3bFH1DE0Ylw+F+EQDq4GkqZfgPEqpWYw9ofQH85uKSB9r3Tv7XDbfqVtE+sdvKJW7IlPJA==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-2.8.0.tgz", + "integrity": "sha512-iiWHM1Et6Q4TQpB7Ar6pxuM3TNMXasVJY4Y/oh3q38EwR3Z+IdZ9MyVf7PI4MJFB4xpwMcZgs9bEUnPG2E3TCA==", "requires": { - "caniuse-lite": "1.0.30000746", - "electron-to-chromium": "1.3.25" + "caniuse-lite": "1.0.30000760", + "electron-to-chromium": "1.3.27" } }, "caniuse-lite": { - "version": "1.0.30000746", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000746.tgz", - "integrity": "sha1-xk+Vo5Jc/TAgejCO12wa6W6gnqA=" + "version": "1.0.30000760", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000760.tgz", + "integrity": "sha1-7HIDlXQvHH7IlH/W3SYE53qPmP8=" }, "chalk": { "version": "1.1.3", @@ -709,9 +709,9 @@ } }, "electron-to-chromium": { - "version": "1.3.25", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.25.tgz", - "integrity": "sha1-RTshAJg20Jl9hgNWAf9srkeRxGA=" + "version": "1.3.27", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.27.tgz", + "integrity": "sha1-eOy4o5kGYYe7N07t412ccFZagD0=" }, "escape-string-regexp": { "version": "1.0.5", @@ -901,9 +901,9 @@ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "private": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/private/-/private-0.1.7.tgz", - "integrity": "sha1-aM5eih7woju1cMwoU3tTMqumPvE=" + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", + "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==" }, "regenerate": { "version": "1.3.3", @@ -922,7 +922,7 @@ "requires": { "babel-runtime": "6.26.0", "babel-types": "6.26.0", - "private": "0.1.7" + "private": "0.1.8" } }, "regexpu-core": { diff --git a/packages/metal-jsx/src/DangerouslySetHTML.js b/packages/metal-jsx/src/DangerouslySetHTML.js index a29de329..eb5531a8 100644 --- a/packages/metal-jsx/src/DangerouslySetHTML.js +++ b/packages/metal-jsx/src/DangerouslySetHTML.js @@ -1,7 +1,7 @@ 'use strict'; import Component from './JSXComponent'; -import { Config } from 'metal-state'; +import {Config} from 'metal-state'; /** * JSXComponent that renders html passed in. diff --git a/packages/metal-jsx/src/JSXComponent.js b/packages/metal-jsx/src/JSXComponent.js index 6c4cc840..6bbef471 100644 --- a/packages/metal-jsx/src/JSXComponent.js +++ b/packages/metal-jsx/src/JSXComponent.js @@ -1,7 +1,7 @@ 'use strict'; import './iDOMHelpers'; -import { object } from 'metal'; +import {object} from 'metal'; import Component from 'metal-component'; import IncrementalDomRenderer from 'metal-incremental-dom'; import JSXDataManager from './JSXDataManager'; @@ -50,7 +50,13 @@ class JSXComponent extends Component { * @return {Object} Object containing props */ otherProps() { - const removeKeys = [...this.getDataManager().getPropsInstance(this).getStateKeys(), 'key', 'ref']; + const removeKeys = [ + ...this.getDataManager() + .getPropsInstance(this) + .getStateKeys(), + 'key', + 'ref', + ]; const retObj = object.mixin({}, this.props); diff --git a/packages/metal-jsx/src/JSXDataManager.js b/packages/metal-jsx/src/JSXDataManager.js index 2cdd1ef0..0fc48703 100644 --- a/packages/metal-jsx/src/JSXDataManager.js +++ b/packages/metal-jsx/src/JSXDataManager.js @@ -1,9 +1,12 @@ 'use strict'; -import { getStaticProperty, object } from 'metal'; -import { ComponentDataManager } from 'metal-component'; +import {getStaticProperty, object} from 'metal'; +import {ComponentDataManager} from 'metal-component'; import State from 'metal-state'; +/** + * DataManager for JSX + */ class JSXDataManager extends ComponentDataManager.constructor { /** * Manually adds props that weren't configured via `PROPS`. @@ -36,16 +39,18 @@ class JSXDataManager extends ComponentDataManager.constructor { const data = this.getManagerData(comp); data.props_ = new State(comp.getInitialConfig(), comp.props, comp); - data.props_.configState(object.mixin( - {}, - config, - getStaticProperty(ctor, 'PROPS', State.mergeState) - )); + data.props_.configState( + object.mixin( + {}, + config, + getStaticProperty(ctor, 'PROPS', State.mergeState) + ) + ); this.addUnconfiguredProps_(comp, data.props_, comp.getInitialConfig()); data.state_ = new State({}, comp.state, comp); data.state_.setEventData({ - type: 'state' + type: 'state', }); data.state_.configState(State.getStateStatic(ctor)); } @@ -104,7 +109,12 @@ class JSXDataManager extends ComponentDataManager.constructor { } const props = this.getManagerData(component).props_; - ComponentDataManager.replaceNonInternal.call(this, component, data, props); + ComponentDataManager.replaceNonInternal.call( + this, + component, + data, + props + ); // eslint-disable-line this.addUnconfiguredProps_(component, props, data); if (component.propsChanged) { component.propsChanged(prevProps); diff --git a/packages/metal-jsx/src/JSXRenderer.js b/packages/metal-jsx/src/JSXRenderer.js index f3eb183b..d54b71dd 100644 --- a/packages/metal-jsx/src/JSXRenderer.js +++ b/packages/metal-jsx/src/JSXRenderer.js @@ -1,6 +1,6 @@ 'use strict'; -import { isDefAndNotNull } from 'metal'; +import {isDefAndNotNull} from 'metal'; import IncrementalDomRenderer from 'metal-incremental-dom'; const COUNT_PROP = '__metalJsxCount'; @@ -53,6 +53,7 @@ class JSXRenderer extends IncrementalDomRenderer.constructor { /** * Increments the number of children in the current element. + * @return {number} */ incElementCount() { const node = IncrementalDOM.currentElement(); diff --git a/packages/metal-jsx/src/all/jsx.js b/packages/metal-jsx/src/all/jsx.js index a267d2fb..141b5c58 100644 --- a/packages/metal-jsx/src/all/jsx.js +++ b/packages/metal-jsx/src/all/jsx.js @@ -1,8 +1,8 @@ 'use strict'; -import { validators, Config } from 'metal-state'; +import {validators, Config} from 'metal-state'; import DangerouslySetHTML from '../DangerouslySetHTML'; import JSXComponent from '../JSXComponent'; export default JSXComponent; -export { DangerouslySetHTML, validators, Config, JSXComponent }; +export {DangerouslySetHTML, validators, Config, JSXComponent}; diff --git a/packages/metal-jsx/src/iDOMHelpers.js b/packages/metal-jsx/src/iDOMHelpers.js index f931e890..1dd7756b 100644 --- a/packages/metal-jsx/src/iDOMHelpers.js +++ b/packages/metal-jsx/src/iDOMHelpers.js @@ -9,7 +9,10 @@ import JSXRenderer from './JSXRenderer'; * https://github.com/jridgewell/babel-plugin-incremental-dom#runtime */ -const scope = (typeof exports !== 'undefined' && typeof global !== 'undefined') ? global : window; +const scope = + typeof exports !== 'undefined' && typeof global !== 'undefined' + ? global + : window; scope.iDOMHelpers = scope.iDOMHelpers || {}; @@ -27,16 +30,21 @@ scope.iDOMHelpers.forOwn = function(object, iterator) { }; scope.iDOMHelpers.jsxWrapper = function(elementClosure, args) { - const wrapper = args ? function() { - return elementClosure.apply(this, args); - } : elementClosure; + const wrapper = args + ? function() { + return elementClosure.apply(this, args); // eslint-disable-line + } + : elementClosure; wrapper.__jsxDOMWrapper = true; return wrapper; }; scope.iDOMHelpers.renderArbitrary = function(child) { const type = typeof child; - if (type === 'number' || (type === 'string' || child && child instanceof String)) { + if ( + type === 'number' || + (type === 'string' || (child && child instanceof String)) + ) { IncrementalDOM.text(child); } else if (type === 'function' && child.__jsxDOMWrapper) { child(); diff --git a/packages/metal-jsx/test/.eslintrc b/packages/metal-jsx/test/.eslintrc new file mode 100644 index 00000000..28b22103 --- /dev/null +++ b/packages/metal-jsx/test/.eslintrc @@ -0,0 +1,23 @@ +{ + "env": { + "mocha": true + }, + "globals": { + "assert": true, + "sinon": true + }, + "parserOptions": { + "ecmaFeatures": { + "jsx": true + } + }, + "plugins": [ + "react" + ], + "rules": { + "max-len": 0, + "no-invalid-this": 0, + "no-unused-vars": 0, + "require-jsdoc": 0 + } +} \ No newline at end of file diff --git a/packages/metal-jsx/test/.eslintrc.json b/packages/metal-jsx/test/.eslintrc.json deleted file mode 100644 index 92b466f1..00000000 --- a/packages/metal-jsx/test/.eslintrc.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "env": { - "mocha": true - }, - "globals": { - "assert": true, - "sinon": true - } -} diff --git a/packages/metal-jsx/test/DangerouslySetHTML.js b/packages/metal-jsx/test/DangerouslySetHTML.js index 64d78f7e..755f8b76 100644 --- a/packages/metal-jsx/test/DangerouslySetHTML.js +++ b/packages/metal-jsx/test/DangerouslySetHTML.js @@ -4,7 +4,7 @@ import DangerouslySetHTML from '../src/DangerouslySetHTML'; import JSXComponent from '../src/JSXComponent'; describe('JSXComponent', function() { - var component; + let component; afterEach(function() { if (component) { @@ -23,14 +23,14 @@ describe('JSXComponent', function() { }); it('should render with html content', function() { - var content = '

hello

world
'; + let content = '

hello

world
'; component = new DangerouslySetHTML({content: content}); assert.strictEqual(content, component.element.innerHTML); }); it('should render inside of another component', function() { - var content = '

hello

world
'; + let content = '

hello

world
'; class TestComponent extends JSXComponent { render() { diff --git a/packages/metal-jsx/test/JSXComponent.js b/packages/metal-jsx/test/JSXComponent.js index 26ede454..fce3e10f 100644 --- a/packages/metal-jsx/test/JSXComponent.js +++ b/packages/metal-jsx/test/JSXComponent.js @@ -1,11 +1,11 @@ 'use strict'; -import { async } from 'metal'; +import {async} from 'metal'; import dom from 'metal-dom'; import JSXComponent from '../src/JSXComponent'; describe('JSXComponent', function() { - var component; + let component; afterEach(function() { if (component) { @@ -27,8 +27,7 @@ describe('JSXComponent', function() { }); it('should not throw error if no jsx function is implemented', function() { - class TestComponent extends JSXComponent { - } + class TestComponent extends JSXComponent {} component = new TestComponent(); assert.strictEqual('DIV', component.element.tagName); @@ -38,9 +37,11 @@ describe('JSXComponent', function() { it('should attach inline listeners', function() { class TestComponent extends JSXComponent { render() { - return
- -
; + return ( +
+
+ ); } } TestComponent.prototype.handleClick = sinon.stub(); @@ -59,14 +60,16 @@ describe('JSXComponent', function() { class TestComponent extends JSXComponent { render() { - return
- -
; + return ( +
+ +
+ ); } } component = new TestComponent(); - var child = component.components.child; + let child = component.components.child; assert.ok(child); assert.strictEqual('DIV', child.element.tagName); assert.ok(dom.hasClass(child.element, 'child')); @@ -83,14 +86,16 @@ describe('JSXComponent', function() { class TestComponent extends JSXComponent { render() { - return
- -
; + return ( +
+ +
+ ); } } component = new TestComponent(); - var child = component.components.child; + let child = component.components.child; assert.strictEqual('Foo', child.element.textContent); }); @@ -131,9 +136,7 @@ describe('JSXComponent', function() { it('should be able to render only some of the received children', function() { class ChildComponent extends JSXComponent { render() { - return
- {this.props.children[1]} -
; + return
{this.props.children[1]}
; } } @@ -147,12 +150,12 @@ describe('JSXComponent', function() { Children Test 3
- ); + ); } } component = new TestComponent(); - var child = component.components.child; + let child = component.components.child; assert.strictEqual(1, child.element.childNodes.length); assert.strictEqual('SPAN', child.element.childNodes[0].tagName); assert.strictEqual('Children Test 2', child.element.textContent); @@ -161,10 +164,12 @@ describe('JSXComponent', function() { it('should be able to get the data passed to children', function() { class ChildComponent extends JSXComponent { render() { - return
- {this.props.children[0].config.foo} - {this.props.children} -
; + return ( +
+ {this.props.children[0].config.foo} + {this.props.children} +
+ ); } } @@ -176,16 +181,19 @@ describe('JSXComponent', function() { Children Test
- ); + ); } } component = new TestComponent(); - var child = component.components.child; + let child = component.components.child; assert.strictEqual(2, child.element.childNodes.length); assert.strictEqual('foo', child.element.childNodes[0].textContent); assert.strictEqual('SPAN', child.element.childNodes[1].tagName); - assert.strictEqual('Children Test', child.element.childNodes[1].textContent); + assert.strictEqual( + 'Children Test', + child.element.childNodes[1].textContent + ); }); }); @@ -197,11 +205,11 @@ describe('JSXComponent', function() { } } - var container = document.createElement('div'); + let container = document.createElement('div'); component = JSXComponent.render( TestComponent, { - foo: 'fooValue' + foo: 'fooValue', }, container ); @@ -215,14 +223,14 @@ describe('JSXComponent', function() { }); it('should render componentless functions via "JSXComponent.render"', function() { - var fn = props => { + let fn = props => { return
{props.foo}
; }; - var container = document.createElement('div'); + let container = document.createElement('div'); JSXComponent.render( fn, { - foo: 'fooValue' + foo: 'fooValue', }, container ); @@ -234,11 +242,8 @@ describe('JSXComponent', function() { }); it('should render jsx element via "JSXComponent.render"', function() { - var container = document.createElement('div'); - JSXComponent.render( -
foo
, - container - ); + let container = document.createElement('div'); + JSXComponent.render(
foo
, container); assert.strictEqual(1, container.childNodes.length); assert.strictEqual('DIV', container.childNodes[0].tagName); @@ -249,12 +254,11 @@ describe('JSXComponent', function() { describe('STATE and PROPS', function() { it('should allow specifying configuration for props', function() { - class TestComponent extends JSXComponent { - } + class TestComponent extends JSXComponent {} TestComponent.PROPS = { foo: { - value: 'defaultFoo' - } + value: 'defaultFoo', + }, }; component = new TestComponent(); @@ -262,12 +266,11 @@ describe('JSXComponent', function() { }); it('should allow specifying internal state', function() { - class TestComponent extends JSXComponent { - } + class TestComponent extends JSXComponent {} TestComponent.STATE = { foo: { - value: 'defaultFoo' - } + value: 'defaultFoo', + }, }; component = new TestComponent(); @@ -289,26 +292,28 @@ describe('JSXComponent', function() { } TestComponent.STATE = { foo: { - value: 'foo' - } + value: 'foo', + }, }; component = new TestComponent(); - var child = component.components.child; + let child = component.components.child; component.state.foo = 'foo2'; component.once('rendered', function() { assert.strictEqual('foo2', child.element.textContent); assert.strictEqual(1, child.propsChanged.callCount); - var prevProps = child.propsChanged.args[0][0]; + let prevProps = child.propsChanged.args[0][0]; assert.strictEqual('foo', prevProps.foo); assert.strictEqual('foo2', child.props.foo); done(); }); }); - it('should allow changes to state in "willReceiveProps" without triggering multiple renders', function(done) { + it('should allow changes to state in "willReceiveProps" without triggering multiple renders', function( + done + ) { const renderStub = sinon.stub(); let count = 0; @@ -316,7 +321,11 @@ describe('JSXComponent', function() { render() { renderStub(); - return
{this.props.bar}:{this.state.foo}
; + return ( +
+ {this.props.bar}:{this.state.foo} +
+ ); } willReceiveProps(data) { @@ -327,13 +336,13 @@ describe('JSXComponent', function() { } TestComponent.STATE = { foo: { - value: 'foo' - } + value: 'foo', + }, }; TestComponent.PROPS = { bar: { - value: 'bar' - } + value: 'bar', + }, }; component = new TestComponent(); @@ -355,14 +364,15 @@ describe('JSXComponent', function() { }); }); - it('should pass changed props data to "willReceiveProps" method', function(done) { - class TestComponent extends JSXComponent { - } + it('should pass changed props data to "willReceiveProps" method', function( + done + ) { + class TestComponent extends JSXComponent {} TestComponent.prototype.willReceiveProps = sinon.stub(); TestComponent.PROPS = { foo: { - value: 'foo' - } + value: 'foo', + }, }; component = new TestComponent(); @@ -375,8 +385,8 @@ describe('JSXComponent', function() { foo: { key: 'foo', newVal: 'foo2', - prevVal: 'foo' - } + prevVal: 'foo', + }, }); done(); @@ -386,7 +396,7 @@ describe('JSXComponent', function() { it('component.element and child.element should be the same', function() { class ChildComponent extends JSXComponent { render() { - return
; + return
; } } @@ -397,14 +407,14 @@ describe('JSXComponent', function() { } component = new ParentComponent(); - var child = component.refs.child; + let child = component.refs.child; assert.strictEqual(component.element, child.element); }); it('should receive elementClasses from parent component', function() { class ChildComponent extends JSXComponent { render() { - return
; + return
; } } @@ -422,7 +432,7 @@ describe('JSXComponent', function() { it('should not apply undefined class', function() { class ChildComponent extends JSXComponent { render() { - return
; + return
; } } @@ -439,7 +449,7 @@ describe('JSXComponent', function() { it('should not create duplicate classes', function() { class ChildComponent extends JSXComponent { render() { - return
; + return
; } } @@ -456,7 +466,7 @@ describe('JSXComponent', function() { it('should pass elementClasses through higher order components', function() { class GrandChildComponent extends JSXComponent { render() { - return
; + return
; } } @@ -480,7 +490,9 @@ describe('JSXComponent', function() { }); describe('shouldUpdate', function() { - it('should not rerender after props change if shouldUpdate returns false', function(done) { + it('should not rerender after props change if shouldUpdate returns false', function( + done + ) { class TestComponent extends JSXComponent { render() {} @@ -490,8 +502,8 @@ describe('JSXComponent', function() { } TestComponent.PROPS = { foo: { - value: 'defaultFoo' - } + value: 'defaultFoo', + }, }; component = new TestComponent(); @@ -503,7 +515,9 @@ describe('JSXComponent', function() { }); }); - it('should not rerender after state change if shouldUpdate returns false', function(done) { + it('should not rerender after state change if shouldUpdate returns false', function( + done + ) { class TestComponent extends JSXComponent { render() {} @@ -513,8 +527,8 @@ describe('JSXComponent', function() { } TestComponent.STATE = { foo: { - value: 'defaultFoo' - } + value: 'defaultFoo', + }, }; component = new TestComponent(); @@ -528,7 +542,9 @@ describe('JSXComponent', function() { }); describe('SYNC_UPDATES', function() { - it('should update parent component with SYNC_UPDATES during child render', function(done) { + it('should update parent component with SYNC_UPDATES during child render', function( + done + ) { class ChildComponent extends JSXComponent { attached() { this.props.updateFoo('Child'); @@ -541,18 +557,23 @@ describe('JSXComponent', function() { class TestComponent extends JSXComponent { render() { - return
- {this.state.foo} - {this.state.show ? this.state.foo += newFoo} /> : null} -
; + return ( +
+ {this.state.foo} + {this.state.show ? ( + (this.state.foo += newFoo)} + /> + ) : null} +
+ ); } } TestComponent.STATE = { foo: { - value: 'foo' + value: 'foo', }, - show: { - } + show: {}, }; TestComponent.SYNC_UPDATES = true; @@ -566,7 +587,9 @@ describe('JSXComponent', function() { }); }); - it('should update parent component with SYNC_UPDATES during root child render', function(done) { + it('should update parent component with SYNC_UPDATES during root child render', function( + done + ) { class ChildComponent extends JSXComponent { attached() { this.props.updateFoo('Child'); @@ -579,17 +602,19 @@ describe('JSXComponent', function() { class TestComponent extends JSXComponent { render() { - return this.state.show ? - this.state.foo += newFoo} /> : - null; + return this.state.show ? ( + (this.state.foo += newFoo)} + /> + ) : null; } } TestComponent.STATE = { foo: { - value: 'foo' + value: 'foo', }, - show: { - } + show: {}, }; TestComponent.SYNC_UPDATES = true; @@ -604,7 +629,7 @@ describe('JSXComponent', function() { }); describe('otherProps', function() { - var component; + let component; afterEach(function() { if (component) { @@ -637,10 +662,7 @@ describe('JSXComponent', function() { component = new TestComponent({baz: 'qux', foo: 'bar'}); - assert.deepEqual( - component.otherProps(), - {baz: 'qux'} - ); + assert.deepEqual(component.otherProps(), {baz: 'qux'}); }); it('should ignore key and ref', function() { @@ -652,10 +674,7 @@ describe('JSXComponent', function() { component = new TestComponent({key: 'bar', ref: 'qux'}); - assert.deepEqual( - component.otherProps(), - {} - ); + assert.deepEqual(component.otherProps(), {}); }); }); }); diff --git a/packages/metal-jsx/test/JSXDataManager.js b/packages/metal-jsx/test/JSXDataManager.js index d2b2465d..9b3fd9fc 100644 --- a/packages/metal-jsx/test/JSXDataManager.js +++ b/packages/metal-jsx/test/JSXDataManager.js @@ -5,8 +5,8 @@ import IncrementalDomRenderer from 'metal-incremental-dom'; import JSXDataManager from '../src/JSXDataManager'; describe('JSXDataManager', function() { - var component; - var component2; + let component; + let component2; afterEach(function() { if (component) { @@ -18,8 +18,7 @@ describe('JSXDataManager', function() { }); it('should create "props" and "state" objects in component', function() { - class TestComponent extends Component { - } + class TestComponent extends Component {} TestComponent.DATA_MANAGER = JSXDataManager; component = new TestComponent(); @@ -29,13 +28,12 @@ describe('JSXDataManager', function() { describe('state', function() { it('should add properties from STATE to `state` variable', function() { - class TestComponent extends Component { - } + class TestComponent extends Component {} TestComponent.DATA_MANAGER = JSXDataManager; TestComponent.STATE = { foo: { - value: 'defaultFoo' - } + value: 'defaultFoo', + }, }; component = new TestComponent(); @@ -46,24 +44,22 @@ describe('JSXDataManager', function() { }); it('should not use constructor values for properties in STATE', function() { - class TestComponent extends Component { - } + class TestComponent extends Component {} TestComponent.DATA_MANAGER = JSXDataManager; TestComponent.STATE = { foo: { - value: 'defaultFoo' - } + value: 'defaultFoo', + }, }; component = new TestComponent({ - foo: 'foo' + foo: 'foo', }); assert.strictEqual('defaultFoo', component.state.foo); }); it('should not include default component data in "state"', function() { - class TestComponent extends Component { - } + class TestComponent extends Component {} TestComponent.DATA_MANAGER = JSXDataManager; component = new TestComponent(); @@ -73,13 +69,12 @@ describe('JSXDataManager', function() { }); it('should keep state objects different between component instances', function() { - class TestComponent extends Component { - } + class TestComponent extends Component {} TestComponent.DATA_MANAGER = JSXDataManager; TestComponent.STATE = { foo: { - value: 'defaultFoo' - } + value: 'defaultFoo', + }, }; component = new TestComponent(); @@ -95,7 +90,9 @@ describe('JSXDataManager', function() { assert.equal('foo2', component2.state.foo); }); - it('should run setState\'s callback after component is rerendered', function(done) { + it('should run setState\'s callback after component is rerendered', function( + done + ) { class TestComponent extends Component { render() {} } @@ -103,22 +100,25 @@ describe('JSXDataManager', function() { TestComponent.RENDERER = IncrementalDomRenderer; TestComponent.STATE = { foo: { - value: 'defaultFoo' - } + value: 'defaultFoo', + }, }; component = new TestComponent(); sinon.spy(component, 'render'); - component.setState({ - foo: 'newFoo' - }, () => { - assert.strictEqual(1, component.render.callCount); - done(); - }); + component.setState( + { + foo: 'newFoo', + }, + () => { + assert.strictEqual(1, component.render.callCount); + done(); + } + ); }); - it('should now allow changes to a component\'s props cause changes to another\s', function() { + it('should now allow changes to a component\'s props cause changes to anothers', function() { class TestComponent extends Component { render() {} } @@ -136,13 +136,12 @@ describe('JSXDataManager', function() { describe('props', function() { it('should add properties from PROPS to `props` variable', function() { - class TestComponent extends Component { - } + class TestComponent extends Component {} TestComponent.DATA_MANAGER = JSXDataManager; TestComponent.PROPS = { foo: { - value: 'defaultFoo' - } + value: 'defaultFoo', + }, }; component = new TestComponent(); @@ -153,40 +152,37 @@ describe('JSXDataManager', function() { }); it('should use constructor values for properties in PROPS', function() { - class TestComponent extends Component { - } + class TestComponent extends Component {} TestComponent.DATA_MANAGER = JSXDataManager; TestComponent.PROPS = { foo: { - value: 'defaultFoo' - } + value: 'defaultFoo', + }, }; component = new TestComponent({ - foo: 'foo' + foo: 'foo', }); assert.strictEqual('foo', component.props.foo); }); it('should use default prop value when "undefined" is passed as initial value', function() { - class TestComponent extends Component { - } + class TestComponent extends Component {} TestComponent.DATA_MANAGER = JSXDataManager; TestComponent.PROPS = { foo: { - value: 'defaultFoo' - } + value: 'defaultFoo', + }, }; component = new TestComponent({ - foo: undefined + foo: undefined, }); assert.strictEqual('defaultFoo', component.props.foo); }); it('should include default component data in "props"', function() { - class TestComponent extends Component { - } + class TestComponent extends Component {} TestComponent.DATA_MANAGER = JSXDataManager; component = new TestComponent(); @@ -196,13 +192,12 @@ describe('JSXDataManager', function() { }); it('should keep prop objects different between component instances', function() { - class TestComponent extends Component { - } + class TestComponent extends Component {} TestComponent.DATA_MANAGER = JSXDataManager; TestComponent.PROPS = { foo: { - value: 'defaultFoo' - } + value: 'defaultFoo', + }, }; component = new TestComponent(); @@ -219,88 +214,84 @@ describe('JSXDataManager', function() { }); it('should return value from "props" when "get" is called', function() { - class TestComponent extends Component { - } + class TestComponent extends Component {} TestComponent.DATA_MANAGER = JSXDataManager; TestComponent.PROPS = { foo: { - value: 'defaultPropsFoo' - } + value: 'defaultPropsFoo', + }, }; TestComponent.STATE = { foo: { - value: 'defaultStateFoo' - } + value: 'defaultStateFoo', + }, }; component = new TestComponent(); assert.strictEqual('defaultPropsFoo', component.props.foo); assert.strictEqual('defaultStateFoo', component.state.foo); - var manager = component.getDataManager(); + let manager = component.getDataManager(); assert.strictEqual('defaultPropsFoo', manager.get(component, 'foo')); }); it('should return the "State" instance for props from "getPropsInstance"', function() { - class TestComponent extends Component { - } + class TestComponent extends Component {} TestComponent.DATA_MANAGER = JSXDataManager; TestComponent.PROPS = { foo: { - value: 'defaultPropsFoo' - } + value: 'defaultPropsFoo', + }, }; TestComponent.STATE = { foo: { - value: 'defaultStateFoo' - } + value: 'defaultStateFoo', + }, }; component = new TestComponent(); - var propsInstance = component.getDataManager().getPropsInstance(component); + let propsInstance = component + .getDataManager() + .getPropsInstance(component); assert.ok(propsInstance); assert.equal('defaultPropsFoo', propsInstance.get('foo')); }); it('should return keys from "props" when "getSyncKeys" is called', function() { - class TestComponent extends Component { - } + class TestComponent extends Component {} TestComponent.DATA_MANAGER = JSXDataManager; TestComponent.PROPS = { - foo: { - } + foo: {}, }; TestComponent.STATE = { - bar: { - } + bar: {}, }; component = new TestComponent(); - var manager = component.getDataManager(); - var expected = ['children', 'elementClasses', 'events', 'foo', 'visible']; + let manager = component.getDataManager(); + let expected = ['children', 'elementClasses', 'events', 'foo', 'visible']; assert.deepEqual(expected, manager.getSyncKeys(component).sort()); }); }); describe('replaceNonInternal', function() { it('should replace props with given values', function() { - class TestComponent extends Component { - } + class TestComponent extends Component {} TestComponent.DATA_MANAGER = JSXDataManager; TestComponent.PROPS = { bar: { - value: 'defaultBar' + value: 'defaultBar', }, foo: { - value: 'defaultFoo' - } + value: 'defaultFoo', + }, }; component = new TestComponent(); - var manager = component.getDataManager(); + let manager = component.getDataManager(); manager.replaceNonInternal(component, { bar: 'bar', - foo: 'foo' + foo: 'foo', }); assert.strictEqual('bar', component.props.bar); @@ -308,22 +299,21 @@ describe('JSXDataManager', function() { }); it('should replace props with default values if no value is given', function() { - class TestComponent extends Component { - } + class TestComponent extends Component {} TestComponent.DATA_MANAGER = JSXDataManager; TestComponent.PROPS = { bar: { - value: 'defaultBar' + value: 'defaultBar', }, foo: { - value: 'defaultFoo' - } + value: 'defaultFoo', + }, }; component = new TestComponent(); - var manager = component.getDataManager(); + let manager = component.getDataManager(); manager.replaceNonInternal(component, { - bar: 'bar' + bar: 'bar', }); assert.strictEqual('bar', component.props.bar); @@ -331,38 +321,36 @@ describe('JSXDataManager', function() { }); it('should not replace state values', function() { - class TestComponent extends Component { - } + class TestComponent extends Component {} TestComponent.DATA_MANAGER = JSXDataManager; TestComponent.STATE = { foo: { - value: 'defaultFoo' - } + value: 'defaultFoo', + }, }; component = new TestComponent(); - var manager = component.getDataManager(); + let manager = component.getDataManager(); manager.replaceNonInternal(component, { - foo: 'foo' + foo: 'foo', }); assert.strictEqual('defaultFoo', component.state.foo); }); it('should manually set prop values not specified in PROPS', function() { - class TestComponent extends Component { - } + class TestComponent extends Component {} TestComponent.DATA_MANAGER = JSXDataManager; TestComponent.PROPS = { bar: { - value: 'defaultBar' - } + value: 'defaultBar', + }, }; component = new TestComponent(); - var manager = component.getDataManager(); + let manager = component.getDataManager(); manager.replaceNonInternal(component, { bar: 'bar', - foo: 'foo' + foo: 'foo', }); assert.strictEqual('bar', component.props.bar); @@ -370,20 +358,19 @@ describe('JSXDataManager', function() { }); it('should call "propsChanged" lifecycle method when props are replaced', function() { - class TestComponent extends Component { - } + class TestComponent extends Component {} TestComponent.prototype.propsChanged = sinon.stub(); TestComponent.DATA_MANAGER = JSXDataManager; TestComponent.PROPS = { foo: { - value: 'defaultFoo' - } + value: 'defaultFoo', + }, }; component = new TestComponent(); - var manager = component.getDataManager(); + let manager = component.getDataManager(); manager.replaceNonInternal(component, { - foo: 'foo' + foo: 'foo', }); assert.strictEqual(1, component.propsChanged.callCount); diff --git a/packages/metal-jsx/test/JSXRenderer.js b/packages/metal-jsx/test/JSXRenderer.js index b69dc9e3..a36f44a6 100644 --- a/packages/metal-jsx/test/JSXRenderer.js +++ b/packages/metal-jsx/test/JSXRenderer.js @@ -31,7 +31,7 @@ describe('JSXRenderer', function() { it('should render returned contents from variable in "render" function', function() { class TestComponent extends TestJSXComponent { render() { - var jsx =
Hello World
; + let jsx =
Hello World
; return jsx; } } @@ -59,18 +59,20 @@ describe('JSXRenderer', function() { Children Test 3
- ); + ); } } component = new TestComponent(); - var child = component.components.child; + let child = component.components.child; assert.strictEqual('SPAN', child.element.tagName); assert.strictEqual(1, child.element.childNodes.length); assert.strictEqual('Children Test 2', child.element.textContent); }); - it('should reuse child empty component when it renders content for the first time', function(done) { + it('should reuse child empty component when it renders content for the first time', function( + done + ) { class Wrapper extends TestJSXComponent { render() { return this.props.children; @@ -88,24 +90,25 @@ describe('JSXRenderer', function() { } } Child.STATE = { - show: { - } + show: {}, }; class TestComponent extends TestJSXComponent { render() { - return -
- -
-
; + return ( + +
+ +
+
+ ); } } const element = document.createElement('div'); dom.enterDocument(element); component = new TestComponent({ - element + element, }); assert.strictEqual(1, childInstances.length); const child = childInstances[0]; @@ -120,7 +123,9 @@ describe('JSXRenderer', function() { }); }); - it('should reuse child empty component when its parent makes it render content for the first time', function(done) { + it('should reuse child empty component when its parent makes it render content for the first time', function( + done + ) { class Wrapper extends TestJSXComponent { render() { return this.props.children; @@ -140,22 +145,23 @@ describe('JSXRenderer', function() { class TestComponent extends TestJSXComponent { render() { - return -
- -
-
; + return ( + +
+ +
+
+ ); } } TestComponent.STATE = { - show: { - } + show: {}, }; const element = document.createElement('div'); dom.enterDocument(element); component = new TestComponent({ - element + element, }); assert.strictEqual(1, childInstances.length); const child = childInstances[0]; @@ -178,8 +184,8 @@ describe('JSXRenderer', function() { } TestComponent.PROPS = { foo: { - value: 'defaultFoo' - } + value: 'defaultFoo', + }, }; component = new TestComponent(); @@ -200,8 +206,8 @@ describe('JSXRenderer', function() { } TestComponent.STATE = { foo: { - value: 'defaultFoo' - } + value: 'defaultFoo', + }, }; component = new TestComponent(); @@ -219,12 +225,10 @@ describe('JSXRenderer', function() { shouldUpdate() {} } TestComponent.PROPS = { - bar: { - } + bar: {}, }; TestComponent.STATE = { - foo: { - } + foo: {}, }; component = new TestComponent(); @@ -253,12 +257,10 @@ describe('JSXRenderer', function() { willUpdate() {} } TestComponent.PROPS = { - bar: { - } + bar: {}, }; TestComponent.STATE = { - foo: { - } + foo: {}, }; component = new TestComponent(); @@ -295,19 +297,20 @@ describe('JSXRenderer', function() { class TestComponent extends TestJSXComponent { render() { - return
- - {this.state.foo} -
; + return ( +
+ + {this.state.foo} +
+ ); } } TestComponent.STATE = { - foo: { - } + foo: {}, }; component = new TestComponent(); - var childNodes = component.element.childNodes; + let childNodes = component.element.childNodes; assert.equal(2, childNodes.length); component.state.foo = 'foo'; @@ -320,32 +323,44 @@ describe('JSXRenderer', function() { }); }); - it('should reuse component rendered after a conditionally rendered component', function(done) { + it('should reuse component rendered after a conditionally rendered component', function( + done + ) { class ChildComponent extends TestJSXComponent { render() { return Child; } } - class ChildComponent2 extends ChildComponent { - } + class ChildComponent2 extends ChildComponent {} class TestComponent extends TestJSXComponent { render() { - return
- {!this.props.hide &&
} -
-
; + return ( +
+ {!this.props.hide && ( +
+ +
+ )} +
+ +
+
+ ); } } TestComponent.PROPS = { - hide: { - } + hide: {}, }; class ParentComponent extends TestJSXComponent { render() { - return
; + return ( +
+ +
+ ); } } @@ -374,15 +389,16 @@ describe('JSXRenderer', function() { it('should reuse elements with keys after moving around', function(done) { class TestComponent extends TestJSXComponent { render() { - return
- - -
; + return ( +
+ + +
+ ); } } TestComponent.PROPS = { - switch: { - } + switch: {}, }; component = new TestComponent(); @@ -410,15 +426,16 @@ describe('JSXRenderer', function() { class TestComponent extends TestJSXComponent { render() { - return
- - -
; + return ( +
+ + +
+ ); } } TestComponent.PROPS = { - switch: { - } + switch: {}, }; component = new TestComponent(); @@ -447,16 +464,18 @@ describe('JSXRenderer', function() { } ChildComponent.PROPS = { foo: { - value: 'initialFoo' - } + value: 'initialFoo', + }, }; class TestComponent extends TestJSXComponent { render() { - return
-
Test
- -
; + return ( +
+
Test
+ +
+ ); } } @@ -473,13 +492,17 @@ describe('JSXRenderer', function() { it('should reuse elements correctly after a child update', function(done) { class ChildComponent extends TestJSXComponent { render() { - return
{this.props.foo}
; + return ( +
+ {this.props.foo} +
+ ); } } ChildComponent.PROPS = { foo: { - value: 'initialFoo' - } + value: 'initialFoo', + }, }; class TestComponent extends TestJSXComponent { @@ -490,7 +513,7 @@ describe('JSXRenderer', function() { component = new TestComponent(); const child = component.refs.child; - var spanEl = child.element.childNodes[0]; + let spanEl = child.element.childNodes[0]; component.refs.child.props.foo = 'newFoo'; component.refs.child.once('stateSynced', function() { @@ -499,7 +522,9 @@ describe('JSXRenderer', function() { }); }); - it('should reuse elements correctly after update from previously empty child', function(done) { + it('should reuse elements correctly after update from previously empty child', function( + done + ) { let child; class ChildComponent extends TestJSXComponent { created() { @@ -512,16 +537,18 @@ describe('JSXRenderer', function() { } ChildComponent.STATE = { first: { - value: true - } + value: true, + }, }; class TestComponent extends TestJSXComponent { render() { - return
-
First child element
- -
; + return ( +
+
First child element
+ +
+ ); } } diff --git a/packages/metal-soy-bundle/README.md b/packages/metal-soy-bundle/README.md index 85dd8078..a49dfcb3 100644 --- a/packages/metal-soy-bundle/README.md +++ b/packages/metal-soy-bundle/README.md @@ -4,3 +4,5 @@ metal-soy-bundle A bundle containing all the closure dependencies required by soy files compiled to incremental-dom. Note that this bundle was built by hand, and some features were deliberately removed to make the resulting bundle smaller, like escaping (which shouldn't be necessary for incremental dom anyway) and bidi directives (which will be added back soon). + +See [https://metaljs.com/](https://metaljs.com/) for documentation. diff --git a/packages/metal-soy-bundle/package-lock.json b/packages/metal-soy-bundle/package-lock.json index 37f00daa..3fe583ac 100644 --- a/packages/metal-soy-bundle/package-lock.json +++ b/packages/metal-soy-bundle/package-lock.json @@ -107,7 +107,7 @@ "lodash": "4.17.4", "minimatch": "3.0.4", "path-is-absolute": "1.0.1", - "private": "0.1.7", + "private": "0.1.8", "slash": "1.0.0", "source-map": "0.5.7" } @@ -550,9 +550,9 @@ } }, "babel-preset-env": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.6.0.tgz", - "integrity": "sha512-OVgtQRuOZKckrILgMA5rvctvFZPv72Gua9Rt006AiPoB0DJKGN07UmaQA+qRrYgK71MVct8fFhT0EyNWYorVew==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.6.1.tgz", + "integrity": "sha512-W6VIyA6Ch9ePMI7VptNn2wBM6dbG0eSz25HEiL40nQXCsXGTGZSTZu1Iap+cj3Q0S5a7T9+529l/5Bkvd+afNA==", "requires": { "babel-plugin-check-es2015-constants": "6.22.0", "babel-plugin-syntax-trailing-function-commas": "6.22.0", @@ -581,7 +581,7 @@ "babel-plugin-transform-es2015-unicode-regex": "6.24.1", "babel-plugin-transform-exponentiation-operator": "6.24.1", "babel-plugin-transform-regenerator": "6.26.0", - "browserslist": "2.5.1", + "browserslist": "2.8.0", "invariant": "2.2.2", "semver": "5.4.1" } @@ -688,18 +688,18 @@ } }, "browserslist": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-2.5.1.tgz", - "integrity": "sha512-jAvM2ku7YDJ+leAq3bFH1DE0Ylw+F+EQDq4GkqZfgPEqpWYw9ofQH85uKSB9r3Tv7XDbfqVtE+sdvKJW7IlPJA==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-2.8.0.tgz", + "integrity": "sha512-iiWHM1Et6Q4TQpB7Ar6pxuM3TNMXasVJY4Y/oh3q38EwR3Z+IdZ9MyVf7PI4MJFB4xpwMcZgs9bEUnPG2E3TCA==", "requires": { - "caniuse-lite": "1.0.30000746", - "electron-to-chromium": "1.3.25" + "caniuse-lite": "1.0.30000760", + "electron-to-chromium": "1.3.27" } }, "caniuse-lite": { - "version": "1.0.30000746", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000746.tgz", - "integrity": "sha1-xk+Vo5Jc/TAgejCO12wa6W6gnqA=" + "version": "1.0.30000760", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000760.tgz", + "integrity": "sha1-7HIDlXQvHH7IlH/W3SYE53qPmP8=" }, "chalk": { "version": "1.1.3", @@ -723,9 +723,9 @@ } }, "clone": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.2.tgz", - "integrity": "sha1-Jgt6meux7f4kdTgXX3gyQ8sZ0Uk=" + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.3.tgz", + "integrity": "sha1-KY1+IjFmD0DAA8LtMUDezz9TCF8=" }, "clone-buffer": { "version": "1.0.0", @@ -811,7 +811,7 @@ "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", "requires": { - "clone": "1.0.2" + "clone": "1.0.3" } }, "deprecated": { @@ -892,9 +892,9 @@ } }, "electron-to-chromium": { - "version": "1.3.25", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.25.tgz", - "integrity": "sha1-RTshAJg20Jl9hgNWAf9srkeRxGA=" + "version": "1.3.27", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.27.tgz", + "integrity": "sha1-eOy4o5kGYYe7N07t412ccFZagD0=" }, "end-of-stream": { "version": "0.1.5", @@ -1548,9 +1548,9 @@ } }, "is-buffer": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.5.tgz", - "integrity": "sha1-Hzsm72E7IUuIy8ojzGwB2Hlh7sw=" + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" }, "is-dotfile": { "version": "1.0.3", @@ -1726,7 +1726,7 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "requires": { - "is-buffer": "1.1.5" + "is-buffer": "1.1.6" } }, "liftoff": { @@ -1742,7 +1742,7 @@ "lodash.isstring": "4.0.1", "lodash.mapvalues": "4.6.0", "rechoir": "0.6.2", - "resolve": "1.4.0" + "resolve": "1.5.0" } }, "lodash": { @@ -2134,9 +2134,9 @@ "integrity": "sha1-t+PqQkNaTJsnWdmeDyAesZWALuE=" }, "private": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/private/-/private-0.1.7.tgz", - "integrity": "sha1-aM5eih7woju1cMwoU3tTMqumPvE=" + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", + "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==" }, "process-nextick-args": { "version": "1.0.7", @@ -2165,7 +2165,7 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "requires": { - "is-buffer": "1.1.5" + "is-buffer": "1.1.6" } } } @@ -2175,7 +2175,7 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", "requires": { - "is-buffer": "1.1.5" + "is-buffer": "1.1.6" } } } @@ -2196,7 +2196,7 @@ "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", "requires": { - "resolve": "1.4.0" + "resolve": "1.5.0" } }, "regenerate": { @@ -2216,7 +2216,7 @@ "requires": { "babel-runtime": "6.26.0", "babel-types": "6.26.0", - "private": "0.1.7" + "private": "0.1.8" } }, "regex-cache": { @@ -2325,9 +2325,9 @@ } }, "resolve": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.4.0.tgz", - "integrity": "sha512-aW7sVKPufyHqOmyyLzg/J+8606v5nevBgaliIlV7nUpVMsDnoBGV/cbSLNjZAg9q0Cfd/+easKVKQ8vOu8fn1Q==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.5.0.tgz", + "integrity": "sha512-hgoSGrc3pjzAPHNBg+KnFcK2HwlHTs/YrAGUr6qgTVUZmXv1UEXXl0bZNBKMA9fud6lRYFdPGz0xXxycPzmmiw==", "requires": { "path-parse": "1.0.5" } @@ -2546,7 +2546,7 @@ "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.5.3.tgz", "integrity": "sha1-sEVbOPxeDPMNQyUTLkYZcMIJHN4=", "requires": { - "clone": "1.0.2", + "clone": "1.0.3", "clone-stats": "0.0.1", "replace-ext": "0.0.1" } diff --git a/packages/metal-incremental-dom/.eslintrc.json b/packages/metal-soy/.eslintrc similarity index 71% rename from packages/metal-incremental-dom/.eslintrc.json rename to packages/metal-soy/.eslintrc index 6b06731d..4376a325 100644 --- a/packages/metal-incremental-dom/.eslintrc.json +++ b/packages/metal-soy/.eslintrc @@ -1,5 +1,6 @@ { "globals": { + "goog": true, "IncrementalDOM": true } -} +} \ No newline at end of file diff --git a/packages/metal-soy/.eslintrc.json b/packages/metal-soy/.eslintrc.json deleted file mode 100644 index bea5b805..00000000 --- a/packages/metal-soy/.eslintrc.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "globals": { - "goog": true, - "IncrementalDOM": true, - "soy": true, - "soydata": true - } -} diff --git a/packages/metal-soy/README.md b/packages/metal-soy/README.md index 0ef4d838..70b1b409 100644 --- a/packages/metal-soy/README.md +++ b/packages/metal-soy/README.md @@ -1,3 +1,5 @@ # metal-soy A soy templates renderer to be used with Metal.js's Component class. + +See [https://metaljs.com/docs/guides/soy-components.html](https://metaljs.com/docs/guides/soy-components.html) for documentation. diff --git a/packages/metal-soy/package-lock.json b/packages/metal-soy/package-lock.json index f9c637f5..7e4c66d6 100644 --- a/packages/metal-soy/package-lock.json +++ b/packages/metal-soy/package-lock.json @@ -64,7 +64,7 @@ "lodash": "4.17.4", "minimatch": "3.0.4", "path-is-absolute": "1.0.1", - "private": "0.1.7", + "private": "0.1.8", "slash": "1.0.0", "source-map": "0.5.7" } @@ -507,9 +507,9 @@ } }, "babel-preset-env": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.6.0.tgz", - "integrity": "sha512-OVgtQRuOZKckrILgMA5rvctvFZPv72Gua9Rt006AiPoB0DJKGN07UmaQA+qRrYgK71MVct8fFhT0EyNWYorVew==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.6.1.tgz", + "integrity": "sha512-W6VIyA6Ch9ePMI7VptNn2wBM6dbG0eSz25HEiL40nQXCsXGTGZSTZu1Iap+cj3Q0S5a7T9+529l/5Bkvd+afNA==", "requires": { "babel-plugin-check-es2015-constants": "6.22.0", "babel-plugin-syntax-trailing-function-commas": "6.22.0", @@ -538,7 +538,7 @@ "babel-plugin-transform-es2015-unicode-regex": "6.24.1", "babel-plugin-transform-exponentiation-operator": "6.24.1", "babel-plugin-transform-regenerator": "6.26.0", - "browserslist": "2.5.1", + "browserslist": "2.8.0", "invariant": "2.2.2", "semver": "5.4.1" } @@ -625,18 +625,18 @@ } }, "browserslist": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-2.5.1.tgz", - "integrity": "sha512-jAvM2ku7YDJ+leAq3bFH1DE0Ylw+F+EQDq4GkqZfgPEqpWYw9ofQH85uKSB9r3Tv7XDbfqVtE+sdvKJW7IlPJA==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-2.8.0.tgz", + "integrity": "sha512-iiWHM1Et6Q4TQpB7Ar6pxuM3TNMXasVJY4Y/oh3q38EwR3Z+IdZ9MyVf7PI4MJFB4xpwMcZgs9bEUnPG2E3TCA==", "requires": { - "caniuse-lite": "1.0.30000746", - "electron-to-chromium": "1.3.25" + "caniuse-lite": "1.0.30000760", + "electron-to-chromium": "1.3.27" } }, "caniuse-lite": { - "version": "1.0.30000746", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000746.tgz", - "integrity": "sha1-xk+Vo5Jc/TAgejCO12wa6W6gnqA=" + "version": "1.0.30000760", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000760.tgz", + "integrity": "sha1-7HIDlXQvHH7IlH/W3SYE53qPmP8=" }, "chalk": { "version": "1.1.3", @@ -687,9 +687,9 @@ } }, "electron-to-chromium": { - "version": "1.3.25", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.25.tgz", - "integrity": "sha1-RTshAJg20Jl9hgNWAf9srkeRxGA=" + "version": "1.3.27", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.27.tgz", + "integrity": "sha1-eOy4o5kGYYe7N07t412ccFZagD0=" }, "escape-string-regexp": { "version": "1.0.5", @@ -879,9 +879,9 @@ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "private": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/private/-/private-0.1.7.tgz", - "integrity": "sha1-aM5eih7woju1cMwoU3tTMqumPvE=" + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", + "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==" }, "regenerate": { "version": "1.3.3", @@ -900,7 +900,7 @@ "requires": { "babel-runtime": "6.26.0", "babel-types": "6.26.0", - "private": "0.1.7" + "private": "0.1.8" } }, "regexpu-core": { diff --git a/packages/metal-soy/src/Soy.js b/packages/metal-soy/src/Soy.js index 9ab41d2e..70f39950 100644 --- a/packages/metal-soy/src/Soy.js +++ b/packages/metal-soy/src/Soy.js @@ -1,15 +1,18 @@ 'use strict'; import 'metal-soy-bundle'; -import { ComponentRegistry } from 'metal-component'; -import { isFunction, isObject, isString, object } from 'metal'; -import { validators, Config } from 'metal-state'; -import IncrementalDomRenderer, { HTML2IncDom } from 'metal-incremental-dom'; +import {ComponentRegistry} from 'metal-component'; +import {isFunction, isObject, isString, object} from 'metal'; +import {validators, Config} from 'metal-state'; +import IncrementalDomRenderer, {HTML2IncDom} from 'metal-incremental-dom'; import SoyAop from './SoyAop'; // The injected data that will be passed to soy templates. let ijData = {}; +/** + * Soy Renderer + */ class Soy extends IncrementalDomRenderer.constructor { /** * Adds the template params to the component's state, if they don't exist yet. @@ -79,13 +82,19 @@ class Soy extends IncrementalDomRenderer.constructor { * @return {!function()} */ getTemplate(namespace, templateName) { - return function(opt_data, opt_ignored, opt_ijData) { + return function(data, ignored, ijData) { if (!goog.loadedModules_[namespace]) { throw new Error( - `No template with namespace "${namespace}" has been loaded yet.` + `No template with namespace "${ + namespace + }" has been loaded yet.` ); } - return goog.loadedModules_[namespace][templateName](opt_data, opt_ignored, opt_ijData); + return goog.loadedModules_[namespace][templateName]( + data, + ignored, + ijData + ); }; } @@ -98,10 +107,12 @@ class Soy extends IncrementalDomRenderer.constructor { * @param {Object} data The data the template was called with. * @protected */ - handleInterceptedCall_(originalFn, opt_data = {}) { + handleInterceptedCall_(originalFn, data = {}) { const args = [originalFn.componentCtor, null, []]; - for (let key in opt_data) { - args.push(key, opt_data[key]); + for (let key in data) { + if (Object.prototype.hasOwnProperty.call(data, key)) { + args.push(key, data[key]); + } } IncrementalDOM.elementVoid.apply(null, args); } @@ -111,6 +122,7 @@ class Soy extends IncrementalDomRenderer.constructor { * @param {!Component} component * @param {string} name * @protected + * @return {boolean} */ isHtmlParam_(component, name) { const state = component.getDataManager().getStateInstance(component); @@ -118,7 +130,9 @@ class Soy extends IncrementalDomRenderer.constructor { return true; } - const elementTemplate = SoyAop.getOriginalFn(component.constructor.TEMPLATE); + const elementTemplate = SoyAop.getOriginalFn( + component.constructor.TEMPLATE + ); const type = (elementTemplate.types || {})[name] || ''; return type.split('|').indexOf('html') !== -1; } @@ -152,7 +166,10 @@ class Soy extends IncrementalDomRenderer.constructor { if (isFunction(elementTemplate) && !component.render) { elementTemplate = SoyAop.getOriginalFn(elementTemplate); SoyAop.startInterception(this.handleInterceptedCall_); - const data = this.buildTemplateData_(component, elementTemplate.params || []); + const data = this.buildTemplateData_( + component, + elementTemplate.params || [] + ); elementTemplate(data, null, ijData); SoyAop.stopInterception(); } else { @@ -208,7 +225,11 @@ class Soy extends IncrementalDomRenderer.constructor { * @return {!function()} */ toIncDom(value) { - if (isObject(value) && isString(value.content) && (value.contentKind === 'HTML')) { + if ( + isObject(value) && + isString(value.content) && + value.contentKind === 'HTML' + ) { value = value.content; } if (isString(value)) { @@ -222,9 +243,4 @@ const soyRenderer_ = new Soy(); soyRenderer_.RENDERER_NAME = 'soy'; export default soyRenderer_; -export { - Config, - soyRenderer_ as Soy, - SoyAop, - validators -}; +export {Config, soyRenderer_ as Soy, SoyAop, validators}; diff --git a/packages/metal-soy/src/SoyAop.js b/packages/metal-soy/src/SoyAop.js index a59eb135..dee929c2 100644 --- a/packages/metal-soy/src/SoyAop.js +++ b/packages/metal-soy/src/SoyAop.js @@ -25,18 +25,19 @@ const SoyAop = { * is set, or otherwise just calling the original function instead. * @param {!function()} originalFn The original template function that was * intercepted. - * @param {Object} opt_data Template data object. - * @param {*} opt_ignored - * @param {Object} opt_ijData Template injected data object. + * @param {Object=} data Template data object. + * @param {*=} ignored + * @param {Object=} ijData Template injected data object. * @return {*} The return value of the function that is called to handle this * interception. */ - handleTemplateCall_: function(originalFn, opt_data, opt_ignored, opt_ijData) { - const interceptFn = SoyAop.interceptFns_[SoyAop.interceptFns_.length - 1]; + handleTemplateCall_: function(originalFn, data, ignored, ijData) { + const interceptFn = + SoyAop.interceptFns_[SoyAop.interceptFns_.length - 1]; // eslint-disable-line if (interceptFn) { - return interceptFn.call(null, originalFn, opt_data, opt_ignored, opt_ijData); + return interceptFn.call(null, originalFn, data, ignored, ijData); } else { - return originalFn.call(null, opt_data, opt_ignored, opt_ijData); + return originalFn.call(null, data, ignored, ijData); } }, @@ -75,7 +76,7 @@ const SoyAop = { */ stopInterception: function() { SoyAop.interceptFns_.pop(); - } + }, }; export default SoyAop; diff --git a/packages/metal-soy/test/.eslintrc b/packages/metal-soy/test/.eslintrc new file mode 100644 index 00000000..f6269b7a --- /dev/null +++ b/packages/metal-soy/test/.eslintrc @@ -0,0 +1,14 @@ +{ + "env": { + "mocha": true + }, + "globals": { + "assert": true, + "sinon": true + }, + "rules": { + "max-len": 0, + "no-invalid-this": 0, + "require-jsdoc": 0 + } +} \ No newline at end of file diff --git a/packages/metal-soy/test/.eslintrc.json b/packages/metal-soy/test/.eslintrc.json deleted file mode 100644 index 92b466f1..00000000 --- a/packages/metal-soy/test/.eslintrc.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "env": { - "mocha": true - }, - "globals": { - "assert": true, - "sinon": true - } -} diff --git a/packages/metal-soy/test/Soy.js b/packages/metal-soy/test/Soy.js index bdd49444..63d118e8 100644 --- a/packages/metal-soy/test/Soy.js +++ b/packages/metal-soy/test/Soy.js @@ -2,25 +2,28 @@ import dom from 'metal-dom'; import Component from 'metal-component'; -import { Events as EventsComponent } from './assets/Events.soy.js'; -import { ComputedData as ComputedDataComponent } from './assets/ComputedData.soy.js'; -import { ExternalTemplate as ExternalTemplateComponent } from './assets/ExternalTemplate.soy.js'; -import { Functions as FunctionsComponent } from './assets/Functions.soy.js'; -import { HelloWorld as HelloWorldComponent, templates as helloWorldTemplates } from './assets/HelloWorld.soy.js'; -import { HigherOrder as HigherOrderComponent } from './assets/HigherOrder.soy.js'; -import { HtmlContent as HtmlContentComponent } from './assets/HtmlContent.soy.js'; -import { IJData as IJDataComponent } from './assets/IJData.soy.js'; -import { Nested as NestedComponent } from './assets/Nested.soy.js'; -import { NestedDataAll as NestedDataAllComponent } from './assets/NestedDataAll.soy.js'; -import { NestedLevels as NestedLevelsComponent } from './assets/NestedLevels.soy.js'; -import { NestedMultiple as NestedMultipleComponent } from './assets/NestedMultiple.soy.js'; -import { NestedNoData as NestedNoDataComponent } from './assets/NestedNoData.soy.js'; -import { TemplateData as TemplateDataComponent } from './assets/TemplateData.soy.js'; +import {Events as EventsComponent} from './assets/Events.soy.js'; +import {ComputedData as ComputedDataComponent} from './assets/ComputedData.soy.js'; +import {ExternalTemplate as ExternalTemplateComponent} from './assets/ExternalTemplate.soy.js'; +import {Functions as FunctionsComponent} from './assets/Functions.soy.js'; +import { + HelloWorld as HelloWorldComponent, + templates as helloWorldTemplates, +} from './assets/HelloWorld.soy.js'; +import {HigherOrder as HigherOrderComponent} from './assets/HigherOrder.soy.js'; +import {HtmlContent as HtmlContentComponent} from './assets/HtmlContent.soy.js'; +import {IJData as IJDataComponent} from './assets/IJData.soy.js'; +import {Nested as NestedComponent} from './assets/Nested.soy.js'; +import {NestedDataAll as NestedDataAllComponent} from './assets/NestedDataAll.soy.js'; +import {NestedLevels as NestedLevelsComponent} from './assets/NestedLevels.soy.js'; +import {NestedMultiple as NestedMultipleComponent} from './assets/NestedMultiple.soy.js'; +import {NestedNoData as NestedNoDataComponent} from './assets/NestedNoData.soy.js'; +import {TemplateData as TemplateDataComponent} from './assets/TemplateData.soy.js'; import Soy from '../src/Soy'; describe('Soy', function() { - var comp; + let comp; afterEach(function() { if (comp) { @@ -38,14 +41,14 @@ describe('Soy', function() { it('should add soy param as state keys automatically', function() { comp = new HelloWorldComponent({ - name: 'Foo' + name: 'Foo', }); assert.strictEqual('Foo', comp.name); }); it('should pass state values to "render template"', function() { comp = new HelloWorldComponent({ - name: 'Foo' + name: 'Foo', }); assert.strictEqual('SPAN', comp.element.tagName); assert.strictEqual('Hello Foo!', comp.element.textContent); @@ -53,7 +56,7 @@ describe('Soy', function() { it('should update content when state values change', function(done) { comp = new HelloWorldComponent({ - name: 'Foo' + name: 'Foo', }); comp.name = 'Bar'; @@ -79,7 +82,9 @@ describe('Soy', function() { delete HelloWorldComponent.prototype.shouldUpdate; }); - it('should not trigger update when changed state key is not used by template', function(done) { + it('should not trigger update when changed state key is not used by template', function( + done + ) { comp = new HelloWorldComponent(); comp.visible = false; comp.once('stateSynced', function() { @@ -88,7 +93,9 @@ describe('Soy', function() { }); }); - it('should not trigger update when shouldUpdate returns false', function(done) { + it('should not trigger update when shouldUpdate returns false', function( + done + ) { HelloWorldComponent.prototype.shouldUpdate = function() { return false; }; @@ -101,7 +108,9 @@ describe('Soy', function() { }); }); - it('should trigger update when state key is not used by template if component shouldUpdate returns true', function(done) { + it('should trigger update when state key is not used by template if component shouldUpdate returns true', function( + done + ) { HelloWorldComponent.prototype.shouldUpdate = function() { return true; }; @@ -115,16 +124,21 @@ describe('Soy', function() { }); }); - it('should pass state values to "prepareStateForRender" and use them in the template', function(done) { + it('should pass state values to "prepareStateForRender" and use them in the template', function( + done + ) { ComputedDataComponent.prototype.shouldUpdate = function() { return true; }; ComputedDataComponent.prototype.prepareStateForRender = function(data) { - data.name = data.name.split('').reverse().join(''); + data.name = data.name + .split('') + .reverse() + .join(''); }; - comp = new ComputedDataComponent({ name: 'Foo' }); + comp = new ComputedDataComponent({name: 'Foo'}); assert.strictEqual('ooF', comp.element.textContent); @@ -139,21 +153,20 @@ describe('Soy', function() { it('should not add sub template soy params as state keys', function() { comp = new TemplateDataComponent({ - foo: 'foo' + foo: 'foo', }); assert.ok(!comp.foo); }); it('should pass non state config data to sub templates', function() { comp = new TemplateDataComponent({ - foo: 'foo' + foo: 'foo', }); assert.strictEqual('foo', comp.element.textContent); }); it('should not throw error if rendering component with no templates', function() { - class NoTemplateComponent extends Component { - } + class NoTemplateComponent extends Component {} NoTemplateComponent.RENDERER = Soy; assert.doesNotThrow(function() { @@ -161,12 +174,12 @@ describe('Soy', function() { }); }); - it('should not throw error if updating component with no templates', function(done) { - class NoTemplateComponent extends Component { - } + it('should not throw error if updating component with no templates', function( + done + ) { + class NoTemplateComponent extends Component {} NoTemplateComponent.STATE = { - foo: { - } + foo: {}, }; NoTemplateComponent.RENDERER = Soy; @@ -189,7 +202,7 @@ describe('Soy', function() { it('should allow specifying injected data content', function() { Soy.setInjectedData({ - content: 'Foo' + content: 'Foo', }); comp = new IJDataComponent(); assert.strictEqual('DIV', comp.element.tagName); @@ -204,8 +217,7 @@ describe('Soy', function() { }); it('should allow registering template with any name for a component', function() { - class TestComponent extends Component { - } + class TestComponent extends Component {} Soy.register(TestComponent, helloWorldTemplates, 'content'); comp = new TestComponent(); @@ -215,12 +227,10 @@ describe('Soy', function() { }); it('should use last component registration for the same template', function() { - class TestComponent extends Component { - } + class TestComponent extends Component {} Soy.register(TestComponent, helloWorldTemplates, 'content'); - class TestComponent2 extends Component { - } + class TestComponent2 extends Component {} Soy.register(TestComponent2, helloWorldTemplates, 'content'); assert.strictEqual(TestComponent.TEMPLATE, TestComponent2.TEMPLATE); @@ -240,42 +250,44 @@ describe('Soy', function() { }); it('should not throw error if soy template doesn\'t have params/types info', function() { - class TestComponent extends Component { - } - Soy.register( - TestComponent, - { - render: () => IncrementalDOM.elementVoid('div') - } - ); - assert.doesNotThrow(() => comp = new TestComponent()); + class TestComponent extends Component {} + Soy.register(TestComponent, { + render: () => IncrementalDOM.elementVoid('div'), + }); + assert.doesNotThrow(() => (comp = new TestComponent())); }); }); describe('HTML attributes', function() { it('should render html string attributes correctly', function() { comp = new HtmlContentComponent({ - content: 'HTML Content' + content: 'HTML Content', }); assert.strictEqual(1, comp.element.childNodes.length); assert.strictEqual('SPAN', comp.element.childNodes[0].tagName); assert.ok(dom.hasClass(comp.element.childNodes[0], 'custom')); - assert.strictEqual('HTML Content', comp.element.childNodes[0].textContent); + assert.strictEqual( + 'HTML Content', + comp.element.childNodes[0].textContent + ); }); it('should render html sanitized object attributes correctly', function() { comp = new HtmlContentComponent({ content: { content: 'HTML Content', - contentKind: 'HTML' - } + contentKind: 'HTML', + }, }); assert.strictEqual(1, comp.element.childNodes.length); assert.strictEqual('SPAN', comp.element.childNodes[0].tagName); assert.ok(dom.hasClass(comp.element.childNodes[0], 'custom')); - assert.strictEqual('HTML Content', comp.element.childNodes[0].textContent); + assert.strictEqual( + 'HTML Content', + comp.element.childNodes[0].textContent + ); }); }); @@ -306,7 +318,7 @@ describe('Soy', function() { }); it('should bind function listeners to component', function() { - var context; + let context; FunctionsComponent.prototype.handleClick = function() { context = this; }; @@ -326,7 +338,7 @@ describe('Soy', function() { it('should render and instantiate nested components', function() { comp = new NestedComponent(); - var nested = comp.components.hello; + let nested = comp.components.hello; assert.ok(nested instanceof HelloWorldComponent); assert.strictEqual(nested.element, comp.element.childNodes[0]); assert.strictEqual('Hello World!', nested.element.textContent); @@ -334,10 +346,10 @@ describe('Soy', function() { it('should pass data to nested components', function() { comp = new NestedComponent({ - name: 'Foo' + name: 'Foo', }); - var nested = comp.components.hello; + let nested = comp.components.hello; assert.ok(nested instanceof HelloWorldComponent); assert.strictEqual(nested.element, comp.element.childNodes[0]); assert.strictEqual('Hello Foo!', nested.element.textContent); @@ -345,10 +357,10 @@ describe('Soy', function() { it('should pass data via `data="all"` to nested components', function() { comp = new NestedDataAllComponent({ - name: 'Foo' + name: 'Foo', }); - var nested = comp.components.hello; + let nested = comp.components.hello; assert.ok(nested instanceof HelloWorldComponent); assert.strictEqual(nested.element, comp.element.childNodes[0]); assert.strictEqual('Hello Foo!', nested.element.textContent); @@ -357,19 +369,22 @@ describe('Soy', function() { it('should render and instantiate nested components even without ref', function() { comp = new NestedNoDataComponent(); assert.strictEqual(1, comp.element.childNodes.length); - assert.strictEqual('Hello World!', comp.element.childNodes[0].textContent); + assert.strictEqual( + 'Hello World!', + comp.element.childNodes[0].textContent + ); }); it('should render and instantiate nested components inside nested components', function() { comp = new NestedLevelsComponent({ - name: 'Foo' + name: 'Foo', }); - var nested = comp.components.nested; + let nested = comp.components.nested; assert.ok(nested instanceof NestedComponent); assert.strictEqual(nested.element, comp.element.childNodes[0]); - var nested2 = nested.components.hello; + let nested2 = nested.components.hello; assert.ok(nested2 instanceof HelloWorldComponent); assert.strictEqual(nested2.element, nested.element.childNodes[0]); assert.strictEqual('Hello Foo!', nested2.element.textContent); @@ -377,15 +392,15 @@ describe('Soy', function() { it('should render and instantiate multiple nested components', function() { comp = new NestedMultipleComponent({ - count: 2 + count: 2, }); - var nested1 = comp.components.hello1; + let nested1 = comp.components.hello1; assert.ok(nested1 instanceof HelloWorldComponent); assert.strictEqual(nested1.element, comp.element.childNodes[0]); assert.strictEqual('Hello World!', nested1.element.textContent); - var nested2 = comp.components.hello2; + let nested2 = comp.components.hello2; assert.ok(nested2 instanceof HelloWorldComponent); assert.strictEqual(nested2.element, comp.element.childNodes[1]); assert.strictEqual('Hello World!', nested2.element.textContent); @@ -394,18 +409,20 @@ describe('Soy', function() { describe('Soy.getTemplate', function() { it('should not throw error if called for undeclared namespace', function() { - assert.doesNotThrow(() => Soy.getTemplate('Undeclared.incrementaldom', 'render')); + assert.doesNotThrow(() => + Soy.getTemplate('Undeclared.incrementaldom', 'render') + ); }); it('should throw error if returned function is called for undeclared namespace', function() { - var template = Soy.getTemplate('Undeclared.incrementaldom', 'render'); + let template = Soy.getTemplate('Undeclared.incrementaldom', 'render'); assert.throws(template); }); it('should not throw error if namespace is declared before returned function is called', function() { - var template = Soy.getTemplate('DeclaredLater.incrementaldom', 'render'); - var module = { - render: sinon.stub() + let template = Soy.getTemplate('DeclaredLater.incrementaldom', 'render'); + let module = { + render: sinon.stub(), }; goog.loadModule(function() { goog.module('DeclaredLater.incrementaldom'); @@ -418,40 +435,40 @@ describe('Soy', function() { describe('Soy.toHtmlString', function() { it('should convert given incremental dom function into an html string', function() { - var fn = function() { + let fn = function() { IncrementalDOM.elementOpen('div', null, [], 'class', 'toHtmlString'); IncrementalDOM.text('To Convert'); IncrementalDOM.elementClose('div'); }; - var str = Soy.toHtmlString(fn); + let str = Soy.toHtmlString(fn); assert.strictEqual('
To Convert
', str); }); }); describe('Soy.toIncDom', function() { it('should convert given html string into an incremental dom function', function() { - var str = '
To Convert
'; - var fn = Soy.toIncDom(str); + let str = '
To Convert
'; + let fn = Soy.toIncDom(str); - var element = document.createElement('div'); + let element = document.createElement('div'); IncrementalDOM.patch(element, fn); assert.strictEqual(str, element.innerHTML); }); it('should convert given sanitized html object into an incremental dom function', function() { - var str = '
To Convert
'; - var fn = Soy.toIncDom({ + let str = '
To Convert
'; + let fn = Soy.toIncDom({ content: str, - contentKind: 'HTML' + contentKind: 'HTML', }); - var element = document.createElement('div'); + let element = document.createElement('div'); IncrementalDOM.patch(element, fn); assert.strictEqual(str, element.innerHTML); }); it('should not try to convert param that is not a string or a sanitized html object', function() { - var fn = sinon.stub(); + let fn = sinon.stub(); assert.strictEqual(fn, Soy.toIncDom(fn)); }); }); diff --git a/packages/metal-soy/test/SoyAop.js b/packages/metal-soy/test/SoyAop.js index fe5886da..7ab6ffc9 100644 --- a/packages/metal-soy/test/SoyAop.js +++ b/packages/metal-soy/test/SoyAop.js @@ -1,6 +1,6 @@ 'use strict'; -import { object } from 'metal'; +import {object} from 'metal'; import SoyAop from '../src/SoyAop'; describe('SoyAop', function() { @@ -9,16 +9,16 @@ describe('SoyAop', function() { }); it('should intercept calls to template functions that were registered', function() { - var templates = { + let templates = { fn1: sinon.stub(), fn2: sinon.stub(), - fn3: sinon.stub() + fn3: sinon.stub(), }; - var originals = object.mixin({}, templates); + let originals = object.mixin({}, templates); SoyAop.registerForInterception(templates, 'fn1'); SoyAop.registerForInterception(templates, 'fn2'); - var interceptor = sinon.stub(); + let interceptor = sinon.stub(); SoyAop.startInterception(interceptor); templates.fn1(); @@ -35,15 +35,15 @@ describe('SoyAop', function() { }); it('should get original function', function() { - var templates = { + let templates = { fn1: sinon.stub(), - fn2: sinon.stub() + fn2: sinon.stub(), }; - var originals = object.mixin({}, templates); + let originals = object.mixin({}, templates); SoyAop.registerForInterception(templates, 'fn1'); SoyAop.registerForInterception(templates, 'fn2'); - var interceptor = sinon.stub(); + let interceptor = sinon.stub(); SoyAop.startInterception(interceptor); assert.notStrictEqual(originals.fn1, templates.fn1); @@ -56,36 +56,42 @@ describe('SoyAop', function() { }); it('should pass correct params to intercepted call', function() { - var templates = { + let templates = { fn1: sinon.stub(), - fn2: sinon.stub() + fn2: sinon.stub(), }; SoyAop.registerForInterception(templates, 'fn1'); SoyAop.registerForInterception(templates, 'fn2'); - var interceptor = sinon.stub(); + let interceptor = sinon.stub(); SoyAop.startInterception(interceptor); - var data = {}; - var ijData = {}; + let data = {}; + let ijData = {}; templates.fn1(data, null, ijData); - assert.strictEqual(SoyAop.getOriginalFn(templates.fn1), interceptor.args[0][0]); + assert.strictEqual( + SoyAop.getOriginalFn(templates.fn1), + interceptor.args[0][0] + ); assert.strictEqual(data, interceptor.args[0][1]); assert.strictEqual(ijData, interceptor.args[0][3]); templates.fn2(data, null, ijData); - assert.strictEqual(SoyAop.getOriginalFn(templates.fn2), interceptor.args[1][0]); + assert.strictEqual( + SoyAop.getOriginalFn(templates.fn2), + interceptor.args[1][0] + ); assert.strictEqual(data, interceptor.args[1][1]); assert.strictEqual(ijData, interceptor.args[1][3]); }); it('should stop intercepting calls to template functions', function() { - var templates = { - fn: sinon.stub() + let templates = { + fn: sinon.stub(), }; SoyAop.registerForInterception(templates, 'fn'); - var interceptor = sinon.stub(); + let interceptor = sinon.stub(); SoyAop.startInterception(interceptor); SoyAop.stopInterception(interceptor); @@ -95,12 +101,12 @@ describe('SoyAop', function() { }); it('should restart intercepting calls to template functions', function() { - var templates = { - fn: sinon.stub() + let templates = { + fn: sinon.stub(), }; SoyAop.registerForInterception(templates, 'fn'); - var interceptor = sinon.stub(); + let interceptor = sinon.stub(); SoyAop.startInterception(interceptor); SoyAop.stopInterception(interceptor); SoyAop.startInterception(interceptor); @@ -111,13 +117,13 @@ describe('SoyAop', function() { }); it('should go back to previous intercepting function when interception is stopped', function() { - var templates = { - fn: sinon.stub() + let templates = { + fn: sinon.stub(), }; SoyAop.registerForInterception(templates, 'fn'); - var interceptor1 = sinon.stub(); - var interceptor2 = sinon.stub(); + let interceptor1 = sinon.stub(); + let interceptor2 = sinon.stub(); SoyAop.startInterception(interceptor1); SoyAop.startInterception(interceptor2); @@ -141,11 +147,11 @@ describe('SoyAop', function() { }); it('should register templates after interception has already started', function() { - var interceptor = sinon.stub(); + let interceptor = sinon.stub(); SoyAop.startInterception(interceptor); - var templates = { - fn: sinon.stub() + let templates = { + fn: sinon.stub(), }; SoyAop.registerForInterception(templates, 'fn'); @@ -157,12 +163,12 @@ describe('SoyAop', function() { it('should not replace template function if it has already been replaced', function() { SoyAop.startInterception(sinon.stub()); - var templates = { - fn: sinon.stub() + let templates = { + fn: sinon.stub(), }; SoyAop.registerForInterception(templates, 'fn'); - var replacedFn = templates.fn; + let replacedFn = templates.fn; SoyAop.registerForInterception(templates, 'fn'); assert.strictEqual(replacedFn, templates.fn); }); diff --git a/packages/metal-state/.eslintrc b/packages/metal-state/.eslintrc new file mode 100644 index 00000000..d4cadde2 --- /dev/null +++ b/packages/metal-state/.eslintrc @@ -0,0 +1,5 @@ +{ + "rules": { + "no-invalid-this": 0 + } +} \ No newline at end of file diff --git a/packages/metal-state/README.md b/packages/metal-state/README.md index cf6eb331..0f39ee68 100644 --- a/packages/metal-state/README.md +++ b/packages/metal-state/README.md @@ -1,3 +1,5 @@ # metal-state A class that adds support for watchable, configurable state. + +See [https://metaljs.com/docs/guides/state.html](https://metaljs.com/docs/guides/state.html) for documentation. diff --git a/packages/metal-state/package-lock.json b/packages/metal-state/package-lock.json index f9c637f5..7e4c66d6 100644 --- a/packages/metal-state/package-lock.json +++ b/packages/metal-state/package-lock.json @@ -64,7 +64,7 @@ "lodash": "4.17.4", "minimatch": "3.0.4", "path-is-absolute": "1.0.1", - "private": "0.1.7", + "private": "0.1.8", "slash": "1.0.0", "source-map": "0.5.7" } @@ -507,9 +507,9 @@ } }, "babel-preset-env": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.6.0.tgz", - "integrity": "sha512-OVgtQRuOZKckrILgMA5rvctvFZPv72Gua9Rt006AiPoB0DJKGN07UmaQA+qRrYgK71MVct8fFhT0EyNWYorVew==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.6.1.tgz", + "integrity": "sha512-W6VIyA6Ch9ePMI7VptNn2wBM6dbG0eSz25HEiL40nQXCsXGTGZSTZu1Iap+cj3Q0S5a7T9+529l/5Bkvd+afNA==", "requires": { "babel-plugin-check-es2015-constants": "6.22.0", "babel-plugin-syntax-trailing-function-commas": "6.22.0", @@ -538,7 +538,7 @@ "babel-plugin-transform-es2015-unicode-regex": "6.24.1", "babel-plugin-transform-exponentiation-operator": "6.24.1", "babel-plugin-transform-regenerator": "6.26.0", - "browserslist": "2.5.1", + "browserslist": "2.8.0", "invariant": "2.2.2", "semver": "5.4.1" } @@ -625,18 +625,18 @@ } }, "browserslist": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-2.5.1.tgz", - "integrity": "sha512-jAvM2ku7YDJ+leAq3bFH1DE0Ylw+F+EQDq4GkqZfgPEqpWYw9ofQH85uKSB9r3Tv7XDbfqVtE+sdvKJW7IlPJA==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-2.8.0.tgz", + "integrity": "sha512-iiWHM1Et6Q4TQpB7Ar6pxuM3TNMXasVJY4Y/oh3q38EwR3Z+IdZ9MyVf7PI4MJFB4xpwMcZgs9bEUnPG2E3TCA==", "requires": { - "caniuse-lite": "1.0.30000746", - "electron-to-chromium": "1.3.25" + "caniuse-lite": "1.0.30000760", + "electron-to-chromium": "1.3.27" } }, "caniuse-lite": { - "version": "1.0.30000746", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000746.tgz", - "integrity": "sha1-xk+Vo5Jc/TAgejCO12wa6W6gnqA=" + "version": "1.0.30000760", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000760.tgz", + "integrity": "sha1-7HIDlXQvHH7IlH/W3SYE53qPmP8=" }, "chalk": { "version": "1.1.3", @@ -687,9 +687,9 @@ } }, "electron-to-chromium": { - "version": "1.3.25", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.25.tgz", - "integrity": "sha1-RTshAJg20Jl9hgNWAf9srkeRxGA=" + "version": "1.3.27", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.27.tgz", + "integrity": "sha1-eOy4o5kGYYe7N07t412ccFZagD0=" }, "escape-string-regexp": { "version": "1.0.5", @@ -879,9 +879,9 @@ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "private": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/private/-/private-0.1.7.tgz", - "integrity": "sha1-aM5eih7woju1cMwoU3tTMqumPvE=" + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", + "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==" }, "regenerate": { "version": "1.3.3", @@ -900,7 +900,7 @@ "requires": { "babel-runtime": "6.26.0", "babel-types": "6.26.0", - "private": "0.1.7" + "private": "0.1.8" } }, "regexpu-core": { diff --git a/packages/metal-state/src/Config.js b/packages/metal-state/src/Config.js index 2e3826cb..0e24f3f8 100644 --- a/packages/metal-state/src/Config.js +++ b/packages/metal-state/src/Config.js @@ -1,6 +1,5 @@ 'use strict'; -import { object } from 'metal'; import validators from './validators'; /** @@ -28,9 +27,9 @@ import validators from './validators'; */ const Config = { /** - * An object that contains a validator function. - * @typedef {!Object} ConfigWithValidator - */ + * An object that contains a validator function. + * @typedef {!Object} ConfigWithValidator + */ /** * Function that creates `State` object with an `any` validator. @@ -127,12 +126,12 @@ const Config = { /** * Adds the `internal` flag to the `State` configuration. - * @param {boolean} required Flag to set "internal" to. True by default. + * @param {boolean} internal Flag to set "internal" to. True by default. * @return {!Object} `State` configuration object. */ internal(internal = true) { return mergeConfig(this, { - internal + internal, }); }, @@ -143,7 +142,7 @@ const Config = { */ required(required = true) { return mergeConfig(this, { - required + required, }); }, @@ -154,7 +153,7 @@ const Config = { */ setter(setter) { return mergeConfig(this, { - setter + setter, }); }, @@ -165,7 +164,7 @@ const Config = { */ validator(validator) { return mergeConfig(this, { - validator + validator, }); }, @@ -176,7 +175,7 @@ const Config = { */ value(value) { return mergeConfig(this, { - value + value, }); }, @@ -187,7 +186,7 @@ const Config = { */ valueFn(valueFn) { return mergeConfig(this, { - valueFn + valueFn, }); }, @@ -198,9 +197,9 @@ const Config = { */ writeOnce(writeOnce = false) { return mergeConfig(this, { - writeOnce + writeOnce, }); - } + }, }; /** @@ -213,13 +212,14 @@ function destructShapeOfConfigs(shape) { const retShape = {}; - keys.forEach( - key => { - const value = shape[key]; + keys.forEach(key => { + const value = shape[key]; - retShape[key] = value.config && value.config.validator ? value.config.validator : destructShapeOfConfigs(value); - } - ); + retShape[key] = + value.config && value.config.validator + ? value.config.validator + : destructShapeOfConfigs(value); + }); return retShape; } @@ -232,19 +232,20 @@ function destructShapeOfConfigs(shape) { */ function mergeConfig(context, config) { let obj = context; - if (obj === Config) { - obj = Object.create(Config); - obj.config = {}; - } - object.mixin(obj.config, config); + const objConfig = obj.config || {}; + + obj = Object.create(Config); + obj.config = {}; + + Object.assign(obj.config, objConfig, config); return obj; } /** -* Calls validators with provided argument. -* @param {string} name The name of the validator. -* @param {!function()} -*/ + * Calls validators with provided argument. + * @param {string} name The name of the validator. + * @return {function()} + */ function setExplicitValueValidators(name) { return function(arg) { return this.validator(validators[name](arg)); @@ -252,10 +253,10 @@ function setExplicitValueValidators(name) { } /** -* Calls validators with a single nested config. -* @param {string} name The name of the validator. -* @return {!function()} -*/ + * Calls validators with a single nested config. + * @param {string} name The name of the validator. + * @return {!function()} + */ function setNestedValidators(name) { return function(arg) { return this.validator(validators[name](arg.config.validator)); @@ -263,10 +264,10 @@ function setNestedValidators(name) { } /** -* Adds primitive type validators to the config object. -* @param {string} name The name of the validator. -* @return {!function()} -*/ + * Adds primitive type validators to the config object. + * @param {string} name The name of the validator. + * @return {!function()} + */ function setPrimitiveValidators(name) { return function() { return this.validator(validators[name]); diff --git a/packages/metal-state/src/State.js b/packages/metal-state/src/State.js index 47bacb66..0db18bc3 100644 --- a/packages/metal-state/src/State.js +++ b/packages/metal-state/src/State.js @@ -1,7 +1,16 @@ 'use strict'; -import { async, getStaticProperty, isDef, isDefAndNotNull, isFunction, isObject, isString, object } from 'metal'; -import { EventEmitter } from 'metal-events'; +import { + async, + getStaticProperty, + isDef, + isDefAndNotNull, + isFunction, + isObject, + isString, + object, +} from 'metal'; +import {EventEmitter} from 'metal-events'; /** * State adds support for having object properties that can be watched for @@ -13,15 +22,15 @@ import { EventEmitter } from 'metal-events'; class State extends EventEmitter { /** * Constructor function for `State`. - * @param {Object=} opt_config Optional config object with initial values to + * @param {Object=} config Optional config object with initial values to * set state properties to. - * @param {Object=} opt_obj Optional object that should hold the state + * @param {Object=} obj Optional object that should hold the state * properties. If none is given, they will be added directly to `this` * instead. - * @param {Object=} opt_context Optional context to call functions (like + * @param {Object=} context Optional context to call functions (like * validators and setters) on. Defaults to `this`. */ - constructor(opt_config, opt_obj, opt_context) { + constructor(config, obj, context) { super(); /** @@ -29,7 +38,7 @@ class State extends EventEmitter { * @type {!Object} * @protected */ - this.context_ = opt_context || this; + this.context_ = context || this; /** * Map of keys that can not be used as state keys. @@ -43,7 +52,7 @@ class State extends EventEmitter { * @type {!Object} * @protected */ - this.obj_ = opt_obj || this; + this.obj_ = obj || this; this.eventData_ = null; @@ -64,7 +73,7 @@ class State extends EventEmitter { this.stateConfigs_ = {}; - this.initialValues_ = object.mixin({}, opt_config); + this.initialValues_ = object.mixin({}, config); this.setShouldUseFacade(true); this.configStateFromStaticHint_(); @@ -72,7 +81,7 @@ class State extends EventEmitter { Object.defineProperty(this.obj_, State.STATE_REF_KEY, { configurable: true, enumerable: false, - value: this + value: this, }); } @@ -85,11 +94,14 @@ class State extends EventEmitter { const config = this.stateConfigs_[name]; if (config.required) { const info = this.getStateInfo(name); - const value = info.state === State.KeyStates.INITIALIZED ? - this.get(name) : - this.initialValues_[name]; + const value = + info.state === State.KeyStates.INITIALIZED + ? this.get(name) + : this.initialValues_[name]; if (!isDefAndNotNull(value)) { - let errorMessage = `The property called "${name}" is required but didn't receive a value.`; + let errorMessage = `The property called "${ + name + }" is required but didn't receive a value.`; if (this.shouldThrowValidationError()) { throw new Error(errorMessage); } else { @@ -124,7 +136,9 @@ class State extends EventEmitter { assertValidStateKeyName_(name) { if (this.keysBlacklist_ && this.keysBlacklist_[name]) { throw new Error( - `It's not allowed to create a state key with the name "${name}".` + `It's not allowed to create a state key with the name "${ + name + }".` ); } } @@ -144,7 +158,7 @@ class State extends EventEmitter { }, set: function(val) { this[State.STATE_REF_KEY].setStateKeyValue_(name, val); - } + }, }; } @@ -152,14 +166,14 @@ class State extends EventEmitter { * Calls the requested function, running the appropriate code for when it's * passed as an actual function object or just the function's name. * @param {!Function|string} fn Function, or name of the function to run. - * @param {!Array} An optional array of parameters to be passed to the + * @param {!Array} args optional array of parameters to be passed to the * function that will be called. * @return {*} The return value of the called function. * @protected */ callFunction_(fn, args) { if (isString(fn)) { - return this.context_[fn].apply(this.context_, args); + return this.context_[fn].apply(this.context_, args); // eslint-disable-line } else if (isFunction(fn)) { return fn.apply(this.context_, args); } @@ -192,10 +206,11 @@ class State extends EventEmitter { callValidator_(name, value) { const config = this.stateConfigs_[name]; if (config.validator) { - const validatorReturn = this.callFunction_( - config.validator, - [value, name, this.context_] - ); + const validatorReturn = this.callFunction_(config.validator, [ + value, + name, + this.context_, + ]); this.assertValidatorReturnInstanceOfError_(validatorReturn); return validatorReturn; } @@ -237,33 +252,32 @@ class State extends EventEmitter { * first time. * @param {!Object.|string} configs An object that maps * configuration options for keys to be added to the state. - * @param {boolean|Object|*=} opt_context The context where the added state + * @param {boolean|Object|*=} context The context where the added state * keys will be defined (defaults to `this`), or false if they shouldn't * be defined at all. */ - configState(configs, opt_context) { + configState(configs, context) { const names = Object.keys(configs); if (names.length === 0) { return; } - if (opt_context !== false) { + if (context !== false) { const props = {}; for (let i = 0; i < names.length; i++) { const name = names[i]; this.assertValidStateKeyName_(name); props[name] = this.buildKeyPropertyDef_(name); } - Object.defineProperties( - opt_context || this.obj_, - props - ); + Object.defineProperties(context || this.obj_, props); } this.stateConfigs_ = configs; for (let i = 0; i < names.length; i++) { const name = names[i]; - configs[name] = configs[name].config ? configs[name].config : configs[name]; + configs[name] = configs[name].config + ? configs[name].config + : configs[name]; this.assertGivenIfRequired_(names[i]); this.validateInitialValue_(names[i]); } @@ -282,8 +296,9 @@ class State extends EventEmitter { ctor[staticKey] = ctor[staticKey] || {}; - defineContext = ctor[staticKey][ctor.name] ? false : - ctor.prototype; + defineContext = ctor[staticKey][ctor.name] + ? false + : ctor.prototype; // eslint-disable-line ctor[staticKey][ctor.name] = true; } this.configState(State.getStateStatic(ctor), defineContext); @@ -329,13 +344,12 @@ class State extends EventEmitter { /** * Returns an object that maps state keys to their values. - * @param {Array=} opt_names A list of names of the keys that should + * @param {Array=} names A list of names of the keys that should * be returned. If none is given, the whole state will be returned. * @return {Object.} */ - getState(opt_names) { + getState(names = this.getStateKeys()) { const state = {}; - const names = opt_names || this.getStateKeys(); for (let i = 0; i < names.length; i++) { state[names[i]] = this.get(names[i]); @@ -406,8 +420,10 @@ class State extends EventEmitter { */ hasBeenSet(name) { const info = this.getStateInfo(name); - return info.state === State.KeyStates.INITIALIZED || - this.hasInitialValue_(name); + return ( + info.state === State.KeyStates.INITIALIZED || + this.hasInitialValue_(name) // eslint-disable-line + ); } /** @@ -417,8 +433,10 @@ class State extends EventEmitter { * @protected */ hasInitialValue_(name) { - return this.initialValues_.hasOwnProperty(name) && - isDef(this.initialValues_[name]); + return ( + this.initialValues_.hasOwnProperty(name) && + isDef(this.initialValues_[name]) + ); } /** @@ -441,11 +459,14 @@ class State extends EventEmitter { */ informChange_(name, prevVal) { if (this.shouldInformChange_(name, prevVal)) { - const data = object.mixin({ - key: name, - newVal: this.get(name), - prevVal: prevVal - }, this.eventData_); + const data = object.mixin( + { + key: name, + newVal: this.get(name), + prevVal: prevVal, + }, + this.eventData_ + ); this.context_.emit(`${name}Changed`, data); this.context_.emit('stateKeyChanged', data); this.scheduleBatchEvent_(data); @@ -500,9 +521,12 @@ class State extends EventEmitter { scheduleBatchEvent_(changeData) { if (!this.scheduledBatchData_) { async.nextTick(this.emitBatchEvent_, this); - this.scheduledBatchData_ = object.mixin({ - changes: {} - }, this.eventData_); + this.scheduledBatchData_ = object.mixin( + { + changes: {}, + }, + this.eventData_ + ); } const name = changeData.key; @@ -521,7 +545,6 @@ class State extends EventEmitter { * actually needed. * @param {string} name * @param {*} value - * @return {*} */ set(name, value) { if (this.hasStateKey(name)) { @@ -532,7 +555,6 @@ class State extends EventEmitter { /** * Sets the default value of the requested state key. * @param {string} name The name of the key. - * @return {*} */ setDefaultValue(name) { const config = this.stateConfigs_[name]; @@ -546,7 +568,7 @@ class State extends EventEmitter { /** * Sets data to be sent with all events emitted from this instance. - * @param {Object} + * @param {Object} data */ setEventData(data) { this.eventData_ = data; @@ -555,7 +577,6 @@ class State extends EventEmitter { /** * Sets the initial value of the requested state key. * @param {string} name The name of the key. - * @return {*} * @protected */ setInitialValue_(name) { @@ -567,7 +588,7 @@ class State extends EventEmitter { /** * Sets a map of keys that are not valid state keys. - * @param {!Object} + * @param {!Object} blacklist */ setKeysBlacklist(blacklist) { this.keysBlacklist_ = blacklist; @@ -577,13 +598,13 @@ class State extends EventEmitter { * Sets the value of all the specified state keys. * @param {!Object.} values A map of state keys to the values they * should be set to. - * @param {function()=} opt_callback An optional function that will be run + * @param {function()=} callback An optional function that will be run * after the next batched update is triggered. */ - setState(values, opt_callback) { + setState(values, callback) { Object.keys(values).forEach(name => this.set(name, values[name])); - if (opt_callback && this.scheduledBatchData_) { - this.context_.once('stateChanged', opt_callback); + if (callback && this.scheduledBatchData_) { + this.context_.once('stateChanged', callback); } } @@ -596,9 +617,11 @@ class State extends EventEmitter { * @protected */ setStateKeyValue_(name, value) { - if (this.warnIfDisposed_(name) || + if ( + this.warnIfDisposed_(name) || !this.canSetState(name) || - !this.validateKeyValue_(name, value)) { + !this.validateKeyValue_(name, value) + ) { return; } @@ -624,8 +647,10 @@ class State extends EventEmitter { */ shouldInformChange_(name, prevVal) { const info = this.getStateInfo(name); - return (info.state === State.KeyStates.INITIALIZED) && - (isObject(prevVal) || prevVal !== this.get(name)); + return ( + info.state === State.KeyStates.INITIALIZED && + (isObject(prevVal) || prevVal !== this.get(name)) + ); } /** @@ -643,9 +668,10 @@ class State extends EventEmitter { * @protected */ validateInitialValue_(name) { - if (this.initialValues_.hasOwnProperty(name) && - !this.callValidator_(name, this.initialValues_[name])) { - + if ( + this.initialValues_.hasOwnProperty(name) && + !this.callValidator_(name, this.initialValues_[name]) + ) { delete this.initialValues_[name]; } } @@ -660,8 +686,10 @@ class State extends EventEmitter { */ validateKeyValue_(name, value) { const info = this.getStateInfo(name); - return info.state === State.KeyStates.INITIALIZING || - this.callValidator_(name, value); + return ( + info.state === State.KeyStates.INITIALIZING || + this.callValidator_(name, value) + ); } /** @@ -674,7 +702,9 @@ class State extends EventEmitter { const disposed = this.isDisposed(); if (disposed) { console.warn( - `Error. Trying to access property "${name}" on disposed instance` + `Error. Trying to access property "${ + name + }" on disposed instance` ); } return disposed; @@ -702,7 +732,7 @@ State.STATE_STATIC_HINT_CONFIGURED = '__METAL_STATE_STATIC_HINT_CONFIGURED__'; State.KeyStates = { UNINITIALIZED: undefined, INITIALIZING: 1, - INITIALIZED: 2 + INITIALIZED: 2, }; export default State; diff --git a/packages/metal-state/src/all/state.js b/packages/metal-state/src/all/state.js index d4694fea..ef616a46 100644 --- a/packages/metal-state/src/all/state.js +++ b/packages/metal-state/src/all/state.js @@ -5,4 +5,4 @@ import Config from '../Config'; import State from '../State'; export default State; -export { validators, Config, State }; +export {validators, Config, State}; diff --git a/packages/metal-state/src/validators.js b/packages/metal-state/src/validators.js index 7c57ce3a..790eb1be 100644 --- a/packages/metal-state/src/validators.js +++ b/packages/metal-state/src/validators.js @@ -1,12 +1,10 @@ 'use strict'; -import { getFunctionName, isDefAndNotNull } from 'metal'; +import {getFunctionName, isDefAndNotNull} from 'metal'; -const ERROR_ARRAY_OF_TYPE = 'Expected an array of single type.'; const ERROR_OBJECT_OF_TYPE = 'Expected object of one type.'; const ERROR_ONE_OF = 'Expected one of the following values:'; const ERROR_ONE_OF_TYPE = 'Expected one of given types.'; -const ERROR_SHAPE_OF = 'Expected object with a specific shape.'; /** * Provides access to various type validators that will return an @@ -30,6 +28,9 @@ const validators = { * @return {!function()} */ arrayOf: function(validator) { + if (isInvalid(validators.func(validator))) { + throwConfigError('function', validator, 'arrayOf'); + } return maybe((value, name, context) => { const result = validators.array(value, name, context); if (isInvalid(result)) { @@ -61,6 +62,9 @@ const validators = { * @return {!function()} */ objectOf: function(validator) { + if (isInvalid(validators.func(validator))) { + throwConfigError('function', validator, 'objectOf'); + } return maybe((value, name, context) => { for (let key in value) { if (isInvalid(validator(value[key]))) { @@ -83,10 +87,13 @@ const validators = { if (isInvalid(result)) { return result; } - return arrayOfValues.indexOf(value) === -1 ? - composeError( - composeOneOfErrorMessage(arrayOfValues), name, context - ) : true; + return arrayOfValues.indexOf(value) === -1 + ? composeError( + composeOneOfErrorMessage(arrayOfValues), + name, + context + ) // eslint-disable-line + : true; }); }, @@ -99,13 +106,20 @@ const validators = { */ oneOfType: function(arrayOfTypeValidators) { return maybe((value, name, context) => { - const result = validators.array(arrayOfTypeValidators, name, context); + const result = validators.array( + arrayOfTypeValidators, + name, + context + ); // eslint-disable-line if (isInvalid(result)) { return result; } for (let i = 0; i < arrayOfTypeValidators.length; i++) { - if (!isInvalid(arrayOfTypeValidators[i](value, name, context))) { + // eslint-disable-next-line + if ( + !isInvalid(arrayOfTypeValidators[i](value, name, context)) + ) { return true; } } @@ -120,27 +134,33 @@ const validators = { * @return {!function()} */ shapeOf: function(shape) { + if (isInvalid(validators.object(shape))) { + throwConfigError('object', shape, 'shapeOf'); + } return maybe((value, name, context) => { - const result = validators.object(shape, name, context); - if (isInvalid(result)) { - return result; + const valueResult = validators.object(value, name, context); + if (isInvalid(valueResult)) { + return valueResult; } - for (let key in shape) { - let validator = shape[key]; - let required = false; - if (validator.config) { - required = validator.config.required; - validator = validator.config.validator; - } - if ((required && !isDefAndNotNull(value[key])) || - isInvalid(validator(value[key]))) { - return composeError(ERROR_SHAPE_OF, name, context); + if (Object.prototype.hasOwnProperty.call(shape, key)) { + let validator = shape[key]; + let required = false; + if (validator.config) { + required = validator.config.required; + validator = validator.config.validator; + } + if ( + (required && !isDefAndNotNull(value[key])) || + isInvalid(validator(value[key])) + ) { + return validator(value[key], `${name}.${key}`, context); + } } } return true; }); - } + }, }; /** @@ -178,10 +198,12 @@ function composeError(error, name, context) { const renderer = context && context.getRenderer && context.getRenderer(); const parent = renderer && renderer.getParent && renderer.getParent(); const parentName = parent ? getFunctionName(parent.constructor) : null; - const location = parentName ? `Check render method of '${parentName}'.` : ''; + const location = parentName + ? `Check render method of '${parentName}'.` + : ''; return new Error( - `Warning: Invalid state passed to '${name}'. ` + - `${error} Passed to '${compName}'. ${location}` + `Invalid state passed to '${name}'.` + + ` ${error} Passed to '${compName}'. ${location}` ); } @@ -221,10 +243,26 @@ function isInvalid(result) { */ function maybe(typeValidator) { return (value, name, context) => { - return isDefAndNotNull(value) ? typeValidator(value, name, context) : true; + return isDefAndNotNull(value) + ? typeValidator(value, name, context) + : true; // eslint-disable-line }; } +/** + * Throws error if validator is invoked with incorrect type. + * @param {string} expectedType String representing the expected type. + * @param {*} value The value to match the type of. + * @param {!string} name Name of the function the validator is intended for. + */ +function throwConfigError(expectedType, value, name) { + const type = getType(value); + throw new Error( + `Expected type ${expectedType}, but received type ${type}. passed to ${ + name + }.` + ); +} /** * Checks if all the items of the given array pass the given validator. @@ -237,7 +275,11 @@ function maybe(typeValidator) { function validateArrayItems(validator, value, name, context) { for (let i = 0; i < value.length; i++) { if (isInvalid(validator(value[i], name, context))) { - return composeError(ERROR_ARRAY_OF_TYPE, name, context); + let itemValidatorError = validator(value[i], name, context); + let errorMessage = `Validator for ${name}[${i}] says: "${ + itemValidatorError + }"`; + return composeError(errorMessage, name, context); } } return true; @@ -254,7 +296,9 @@ function validateArrayItems(validator, value, name, context) { function validateType(expectedType, value, name, context) { const type = getType(value); if (type !== expectedType) { - const msg = `Expected type '${expectedType}', but received type '${type}'.`; + const msg = `Expected type '${expectedType}', but received type '${ + type + }'.`; return composeError(msg, name, context); } return true; diff --git a/packages/metal-state/test/.eslintrc b/packages/metal-state/test/.eslintrc new file mode 100644 index 00000000..f6269b7a --- /dev/null +++ b/packages/metal-state/test/.eslintrc @@ -0,0 +1,14 @@ +{ + "env": { + "mocha": true + }, + "globals": { + "assert": true, + "sinon": true + }, + "rules": { + "max-len": 0, + "no-invalid-this": 0, + "require-jsdoc": 0 + } +} \ No newline at end of file diff --git a/packages/metal-state/test/.eslintrc.json b/packages/metal-state/test/.eslintrc.json deleted file mode 100644 index 92b466f1..00000000 --- a/packages/metal-state/test/.eslintrc.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "env": { - "mocha": true - }, - "globals": { - "assert": true, - "sinon": true - } -} diff --git a/packages/metal-state/test/Config.js b/packages/metal-state/test/Config.js index 23c17dec..67314d62 100644 --- a/packages/metal-state/test/Config.js +++ b/packages/metal-state/test/Config.js @@ -5,102 +5,121 @@ import Config from '../src/Config'; describe('Config', function() { it('should return config with "internal" flag set to true by default', function() { - var config = Config.internal(); + let config = Config.internal(); assert.ok(core.isObject(config)); - var expected = { - internal: true + let expected = { + internal: true, }; assert.deepEqual(expected, config.config); }); it('should return config with "internal" flag set to the given vaue', function() { - var internal = false; - var config = Config.internal(internal); + let internal = false; + let config = Config.internal(internal); assert.ok(core.isObject(config)); - assert.deepEqual({ - internal - }, config.config); + assert.deepEqual( + { + internal, + }, + config.config + ); }); it('should return config with "required" flag set to true by default', function() { - var config = Config.required(); + let config = Config.required(); assert.ok(core.isObject(config)); - var expected = { - required: true + let expected = { + required: true, }; assert.deepEqual(expected, config.config); }); it('should return config with "required" flag set to the given vaue', function() { - var required = false; - var config = Config.required(required); + let required = false; + let config = Config.required(required); assert.ok(core.isObject(config)); - assert.deepEqual({ - required - }, config.config); + assert.deepEqual( + { + required, + }, + config.config + ); }); it('should return config with specified "value"', function() { - var value = 10; - var config = Config.value(10); + let value = 10; + let config = Config.value(10); assert.ok(core.isObject(config)); - assert.deepEqual({ - value - }, config.config); + assert.deepEqual( + { + value, + }, + config.config + ); }); it('should return config with specified "valueFn"', function() { - var valueFn = () => {}; - var config = Config.valueFn(valueFn); + let valueFn = () => {}; + let config = Config.valueFn(valueFn); assert.ok(core.isObject(config)); - assert.deepEqual({ - valueFn - }, config.config); + assert.deepEqual( + { + valueFn, + }, + config.config + ); }); it('should return config with "writeOnce" flag set to false by default', function() { - var config = Config.writeOnce(); + let config = Config.writeOnce(); assert.ok(core.isObject(config)); - var expected = { - writeOnce: false + let expected = { + writeOnce: false, }; assert.deepEqual(expected, config.config); }); it('should return config with "writeOnce" flag set to the given vaue', function() { - var writeOnce = true; - var config = Config.writeOnce(writeOnce); + let writeOnce = true; + let config = Config.writeOnce(writeOnce); assert.ok(core.isObject(config)); - assert.deepEqual({ - writeOnce - }, config.config); + assert.deepEqual( + { + writeOnce, + }, + config.config + ); }); it('should return config with specified "setter"', function() { - var setter = () => { - }; - var config = Config.setter(setter); + let setter = () => {}; + let config = Config.setter(setter); assert.ok(core.isObject(config)); - assert.deepEqual({ - setter - }, config.config); + assert.deepEqual( + { + setter, + }, + config.config + ); }); it('should return config with specified "validator"', function() { - var validator = () => { - }; - var config = Config.validator(validator); + let validator = () => {}; + let config = Config.validator(validator); assert.ok(core.isObject(config)); - assert.deepEqual({ - validator - }, config.config); + assert.deepEqual( + { + validator, + }, + config.config + ); }); it('should return config with "any" validator from "validators"', function() { - var config = Config.any(); + let config = Config.any(); assert.ok(core.isObject(config)); assert.ok(core.isFunction(config.config.validator)); assert.ok(config.config.validator(10)); @@ -108,7 +127,7 @@ describe('Config', function() { }); it('should return config with "array" validator from "validators"', function() { - var config = Config.array(); + let config = Config.array(); assert.ok(core.isObject(config)); assert.ok(core.isFunction(config.config.validator)); assert.ok(config.config.validator(['one'])); @@ -116,7 +135,7 @@ describe('Config', function() { }); it('should return config with "arrayOf" validator from "validators"', function() { - var config = Config.arrayOf(Config.number()); + let config = Config.arrayOf(Config.number()); assert.ok(core.isObject(config)); assert.ok(core.isFunction(config.config.validator)); assert.ok(config.config.validator([1, 2])); @@ -124,8 +143,36 @@ describe('Config', function() { assert.ok(config.config.validator(['one']) instanceof Error); }); + it('should return config with "arrayOf" validator inheriting "shapeOf" and "oneOf" from "validators"', function() { + let shape = { + one: Config.bool().value(false), + two: Config.string(), + three: Config.oneOf(['propOne', 'propTwo', 'propThree']).value('propOne'), + four: Config.number().required(), + }; + let configShape = Config.arrayOf(Config.shapeOf(shape)); + assert.ok(core.isObject(configShape)); + assert.ok(core.isFunction(configShape.config.validator)); + assert.ok( + configShape.config.validator({ + one: false, + two: 30, + three: 'anything', + }) instanceof Error + ); + assert.ok(configShape.config.validator([1, 2]) instanceof Error); + assert.ok( + configShape.config.validator({ + one: false, + two: 'is String!', + three: 'propOne', + four: 30, + }) + ); + }); + it('should return config with "bool" validator from "validators"', function() { - var config = Config.bool(); + let config = Config.bool(); assert.ok(core.isObject(config)); assert.ok(core.isFunction(config.config.validator)); assert.ok(config.config.validator(true)); @@ -133,7 +180,7 @@ describe('Config', function() { }); it('should return config with "func" validator from "validators"', function() { - var config = Config.func(); + let config = Config.func(); assert.ok(core.isObject(config)); assert.ok(core.isFunction(config.config.validator)); assert.ok(config.config.validator(function() {})); @@ -141,12 +188,10 @@ describe('Config', function() { }); it('should return config with "instanceOf" validator from "validators"', function() { - class TestClass { - } - class TestClass2 { - } + class TestClass {} + class TestClass2 {} - var config = Config.instanceOf(TestClass); + let config = Config.instanceOf(TestClass); assert.ok(core.isObject(config)); assert.ok(core.isFunction(config.config.validator)); assert.ok(config.config.validator(new TestClass())); @@ -154,7 +199,7 @@ describe('Config', function() { }); it('should return config with "number" validator from "validators"', function() { - var config = Config.number(); + let config = Config.number(); assert.ok(core.isObject(config)); assert.ok(core.isFunction(config.config.validator)); assert.ok(config.config.validator(10)); @@ -162,7 +207,7 @@ describe('Config', function() { }); it('should return config with "object" validator from "validators"', function() { - var config = Config.object(); + let config = Config.object(); assert.ok(core.isObject(config)); assert.ok(core.isFunction(config.config.validator)); assert.ok(config.config.validator({})); @@ -170,7 +215,7 @@ describe('Config', function() { }); it('should return config with "objectOf" validator from "validators"', function() { - var config = Config.objectOf(Config.number()); + let config = Config.objectOf(Config.number()); assert.ok(core.isObject(config)); assert.ok(core.isFunction(config.config.validator)); assert.ok(config.config.validator({foo: 1})); @@ -178,25 +223,25 @@ describe('Config', function() { }); it('should return config with "oneOf" validator from "validators"', function() { - var config = Config.oneOf([1, 'one']); - assert.ok(core.isObject(config)); - assert.ok(core.isFunction(config.config.validator)); - assert.ok(config.config.validator(1)); - assert.ok(config.config.validator('one')); - assert.ok(config.config.validator(2) instanceof Error); - assert.ok(config.config.validator(false) instanceof Error); - - var config = Config.oneOf([1, 'one']).required(); - assert.ok(core.isObject(config)); - assert.ok(core.isFunction(config.config.validator)); - assert.ok(config.config.validator(1)); - assert.ok(config.config.validator('one')); - assert.ok(config.config.validator(2) instanceof Error); - assert.ok(config.config.validator(false) instanceof Error); + const config1 = Config.oneOf([1, 'one']); + assert.ok(core.isObject(config1)); + assert.ok(core.isFunction(config1.config.validator)); + assert.ok(config1.config.validator(1)); + assert.ok(config1.config.validator('one')); + assert.ok(config1.config.validator(2) instanceof Error); + assert.ok(config1.config.validator(false) instanceof Error); + + const config2 = Config.oneOf([1, 'one']).required(); + assert.ok(core.isObject(config2)); + assert.ok(core.isFunction(config2.config.validator)); + assert.ok(config2.config.validator(1)); + assert.ok(config2.config.validator('one')); + assert.ok(config2.config.validator(2) instanceof Error); + assert.ok(config2.config.validator(false) instanceof Error); }); it('should return config with "oneOfType" validator from "validators"', function() { - var config = Config.oneOfType([Config.string(), Config.number()]); + let config = Config.oneOfType([Config.string(), Config.number()]); assert.ok(core.isObject(config)); assert.ok(core.isFunction(config.config.validator)); assert.ok(config.config.validator(1)); @@ -206,37 +251,37 @@ describe('Config', function() { }); it('should return config with "shapeOf" validator from "validators"', function() { - var shape = { + let shape = { one: Config.string(), two: { three: { - four: Config.number() - } + four: Config.number(), + }, }, - five: Config.arrayOf(Config.string()) + five: Config.arrayOf(Config.string()), }; - var pass = { + let pass = { one: 'one', two: { three: { - four: 4 - } + four: 4, + }, }, - five: ['five'] + five: ['five'], }; - var fail = { + let fail = { one: 'one', two: { three: { - four: 'four' - } + four: 'four', + }, }, - five: 5 + five: 5, }; - var config = Config.arrayOf(Config.shapeOf(shape)); + let config = Config.arrayOf(Config.shapeOf(shape)); assert.ok(core.isObject(config)); assert.ok(core.isFunction(config.config.validator)); assert.ok(config.config.validator(pass)); @@ -244,7 +289,7 @@ describe('Config', function() { }); it('should return config with "string" validator from "validators"', function() { - var config = Config.string(); + let config = Config.string(); assert.ok(core.isObject(config)); assert.ok(core.isFunction(config.config.validator)); assert.ok(config.config.validator('test')); @@ -252,9 +297,11 @@ describe('Config', function() { }); it('should return config with data from multiple calls', function() { - var setter = () => { - }; - var config = Config.required(true).number().value(10).setter(setter); + let setter = () => {}; + let config = Config.required(true) + .number() + .value(10) + .setter(setter); assert.ok(core.isObject(config)); assert.strictEqual(4, Object.keys(config.config).length); @@ -265,4 +312,26 @@ describe('Config', function() { assert.ok(config.config.validator(10)); assert.ok(config.config.validator('test') instanceof Error); }); + + it('should not mutate config object with subsequent method calls', function() { + const config = Config.string(); + const config2 = config.oneOf(['1', '2']); + const config3 = config2.required(); + + assert.notDeepEqual(config, config2); + assert.notDeepEqual(config, config3); + assert.notDeepEqual(config2, config3); + + assert.ok(config.config.validator(1) instanceof Error); + assert.ok(config2.config.validator(1) instanceof Error); + assert.ok(config3.config.validator(1) instanceof Error); + + assert.ok(config.config.validator('1')); + assert.ok(config2.config.validator('1')); + assert.ok(config3.config.validator('3') instanceof Error); + + assert.isTrue(config3.config.required); + assert.isUndefined(config.config.required); + assert.isUndefined(config2.config.required); + }); }); diff --git a/packages/metal-state/test/State.js b/packages/metal-state/test/State.js index 2a1e5fdd..1ff6eb43 100644 --- a/packages/metal-state/test/State.js +++ b/packages/metal-state/test/State.js @@ -1,90 +1,89 @@ 'use strict'; -import { async } from 'metal'; +import {async} from 'metal'; import EventEmitter from 'metal-events'; import State from '../src/State'; describe('State', function() { it('should add keys to the state', function() { - var state = new State(); + let state = new State(); state.configState({ key1: {}, - key2: {} + key2: {}, }); - var keys = Object.keys(state.getState()); + let keys = Object.keys(state.getState()); assert.strictEqual(2, keys.length); assert.strictEqual('key1', keys[0]); assert.strictEqual('key2', keys[1]); }); it('should make state keys enumerable', function() { - var state = new State(); + let state = new State(); state.configState({ key1: {}, - key2: {} + key2: {}, }); - var keys = Object.keys(state); + let keys = Object.keys(state); assert.notStrictEqual(-1, keys.indexOf('key1')); assert.notStrictEqual(-1, keys.indexOf('key2')); }); it('should not allow adding state key with name contained in key blacklist', function() { - class Test extends State { - } + class Test extends State {} - var test = new Test(); + let test = new Test(); test.setKeysBlacklist({ - invalid: true + invalid: true, }); assert.throws(function() { test.configState({ - invalid: {} + invalid: {}, }); }); }); it('should get a state key\'s config object', function() { - var state = new State(); + let state = new State(); state.configState({ key1: { - a: 2 - } + a: 2, + }, }); - var expected = { - a: 2 + let expected = { + a: 2, }; assert.deepEqual(expected, state.getStateKeyConfig('key1')); }); it('should use config object from "config" key', function() { - var state = new State(); + let state = new State(); state.configState({ key1: { config: { - a: 2 - } - } + a: 2, + }, + }, }); - var expected = { - a: 2 + let expected = { + a: 2, }; assert.deepEqual(expected, state.getStateKeyConfig('key1')); }); it('should return null if requesting config object of non existing key', function() { - var state = new State(); + let state = new State(); assert.strictEqual(undefined, state.getStateKeyConfig('key1')); }); it('should set and get state values', function() { - var state = new State(); + let state = new State(); state.configState({ key1: {}, - key2: {} + key2: {}, }); assert.strictEqual(undefined, state.key1); @@ -98,22 +97,22 @@ describe('State', function() { }); it('should get state key value through "get" method', function() { - var state = new State(); + let state = new State(); state.configState({ key1: { - value: 2 - } + value: 2, + }, }); assert.strictEqual(2, state.get('key1')); }); it('should set state key value through "set" method', function() { - var state = new State(); + let state = new State(); state.configState({ key1: { - value: 2 - } + value: 2, + }, }); state.set('key1', 3); @@ -121,97 +120,95 @@ describe('State', function() { }); it('should set default state key value', function() { - var state = createStateInstance(); + let state = createStateInstance(); assert.strictEqual(1, state.key1); assert.strictEqual(2, state.key2); }); it('should set default state key value with raw value', function() { - var state = new State(); + let state = new State(); state.configState({ key1: { - value: 1 - } + value: 1, + }, }); assert.strictEqual(1, state.key1); }); it('should set default state key value from function', function() { - var state = new State(); + let state = new State(); state.configState({ key1: { valueFn: function() { return 1; - } - } + }, + }, }); assert.strictEqual(1, state.key1); }); it('should set default state key value from function name', function() { - var state = new State(); + let state = new State(); state.returns1 = function() { return 1; }; state.configState({ key1: { - valueFn: 'returns1' - } + valueFn: 'returns1', + }, }); assert.strictEqual(1, state.key1); }); it('should ignore invalid valueFn function', function() { - var state = new State(); + let state = new State(); state.configState({ key1: { - valueFn: 1 - } + valueFn: 1, + }, }); assert.strictEqual(undefined, state.key1); }); it('should not use valueFn function if value is also defined', function() { - var state = new State(); + let state = new State(); state.configState({ key1: { value: '', valueFn: function() { return '1'; - } - } + }, + }, }); assert.strictEqual('', state.key1); }); it('should override default state key value', function() { - var state = new State({ + let state = new State({ key1: 10, - key2: 20 + key2: 20, + }); + state.configState({ + key1: { + value: 1, + }, + key2: { + value: 2, + }, }); - state.configState( - { - key1: { - value: 1 - }, - key2: { - value: 2 - } - } - ); assert.strictEqual(10, state.key1); assert.strictEqual(20, state.key2); }); it('should change initial state key value', function() { - var state = createStateInstance(); + let state = createStateInstance(); state.key1 = 10; @@ -219,12 +216,12 @@ describe('State', function() { }); it('should initialize state values lazily', function() { - var state = new State(); - var valueFn = sinon.stub().returns(2); + let state = new State(); + let valueFn = sinon.stub().returns(2); state.configState({ key1: { - valueFn: valueFn - } + valueFn: valueFn, + }, }); assert.strictEqual(0, valueFn.callCount); @@ -233,10 +230,12 @@ describe('State', function() { assert.strictEqual(1, valueFn.callCount); }); - it('should pass value, name and context args to validator function', function(done) { - var state = new State(); - var keyName = 'key1'; - var value = 2; + it('should pass value, name and context args to validator function', function( + done + ) { + let state = new State(); + let keyName = 'key1'; + let value = 2; state.configState({ [keyName]: { validator: function(val, name, context) { @@ -245,22 +244,22 @@ describe('State', function() { assert.strictEqual(state, context); done(); - } - } + }, + }, }); state[keyName] = value; }); it('should validate new state values', function() { - var state = new State(); + let state = new State(); state.configState({ key1: { validator: function(val) { return val > 0; }, - value: 1 - } + value: 1, + }, }); state.key1 = -1; @@ -271,15 +270,15 @@ describe('State', function() { }); it('should validate new state values through function name', function() { - var state = new State(); + let state = new State(); state.isPositive = function(val) { return val > 0; }; state.configState({ key1: { validator: 'isPositive', - value: 1 - } + value: 1, + }, }); state.key1 = -1; @@ -290,52 +289,48 @@ describe('State', function() { }); it('should validate initial state values', function() { - var state = new State({ - key1: -10 + let state = new State({ + key1: -10, + }); + state.configState({ + key1: { + validator: function(val) { + return val > 0; + }, + value: 1, + }, }); - state.configState( - { - key1: { - validator: function(val) { - return val > 0; - }, - value: 1 - } - } - ); assert.strictEqual(1, state.key1); }); it('should not overwrite default value with "undefined" initial value', function() { - var state = new State({ - key1: undefined + let state = new State({ + key1: undefined, }); state.configState({ key1: { - value: 'value1' - } + value: 'value1', + }, }); assert.equal(state.key1, 'value1'); }); it('should allow accessing other state properties in validator', function() { - var state = new State({ - key1: 1 + let state = new State({ + key1: 1, }); - state.configState( - { - key1: { - validator: function(val) { - return val < this.key2; - } + state.configState({ + key1: { + validator: function(val) { + return val < this.key2; }, - key2: { - value: 2 - } - } - ); + }, + key2: { + value: 2, + }, + }); assert.strictEqual(1, state.key1); state.key1 = 3; @@ -346,32 +341,30 @@ describe('State', function() { }); it('should not validate default state values', function() { - var state = new State(); + let state = new State(); state.configState({ key1: { validator: function(val) { return val > 0; }, - value: -1 - } + value: -1, + }, }); assert.strictEqual(-1, state.key1); }); it('should emit error if validator returns an Error', function() { - var originalConsoleFn = console.error; + let originalConsoleFn = console.error; console.error = sinon.stub(); - var state = new State(); - state.configState( - { - key1: { - validator: function(val) { - return val; - } - } - } - ); + let state = new State(); + state.configState({ + key1: { + validator: function(val) { + return val; + }, + }, + }); state.key1 = 1; assert.ok(!console.error.called); @@ -383,20 +376,19 @@ describe('State', function() { }); it('should emit validator error even for "undefined" initial values', function() { - var originalConsoleFn = console.error; + let originalConsoleFn = console.error; console.error = sinon.stub(); - class Test extends State { - } + class Test extends State {} Test.STATE = { key1: { validator: function() { return new Error(); - } - } + }, + }, }; new Test({ - key1: undefined + key1: undefined, }); assert.ok(console.error.called); @@ -409,18 +401,16 @@ describe('State', function() { return true; } } - var state = new Test(); - state.configState( - { - key1: { - validator: function() { - return new Error(); - } - } - } - ); + let state = new Test(); + state.configState({ + key1: { + validator: function() { + return new Error(); + }, + }, + }); - assert.throws(() => state.key1 = 1); + assert.throws(() => (state.key1 = 1)); }); it('should not throw error if validator returns an Error and shouldThrowValidationError is false', function() { @@ -429,28 +419,26 @@ describe('State', function() { return false; } } - var state = new Test(); - state.configState( - { - key1: { - validator: function() { - return new Error(); - } - } - } - ); + let state = new Test(); + state.configState({ + key1: { + validator: function() { + return new Error(); + }, + }, + }); - assert.doesNotThrow(() => state.key1 = 1); + assert.doesNotThrow(() => (state.key1 = 1)); assert.strictEqual(1, state.key1); }); it('should change state new value through setter', function() { - var state = new State(); + let state = new State(); state.configState({ key1: { setter: Math.abs, - value: -1 - } + value: -1, + }, }); assert.strictEqual(1, state.key1); @@ -463,13 +451,13 @@ describe('State', function() { }); it('should change state new value through setter name', function() { - var state = new State(); + let state = new State(); state.makePositive = Math.abs; state.configState({ key1: { setter: 'makePositive', - value: -1 - } + value: -1, + }, }); assert.strictEqual(1, state.key1); @@ -482,14 +470,14 @@ describe('State', function() { }); it('should pass the state key\'s current value to setter', function() { - var state = new State(); + let state = new State(); state.configState({ key1: { setter: (newValue, currentValue) => { return currentValue ? currentValue + ':' + newValue : newValue; }, - value: 'first' - } + value: 'first', + }, }); assert.strictEqual('first', state.key1); @@ -502,42 +490,39 @@ describe('State', function() { }); it('should allow setting a writeOnce with initial value', function() { - var state = new State({ - key1: 2 + let state = new State({ + key1: 2, + }); + state.configState({ + key1: { + value: 1, + writeOnce: true, + }, }); - state.configState( - { - key1: { - value: 1, - writeOnce: true - } - } - ); assert.strictEqual(2, state.key1); }); it('should allow setting a writeOnce state value before it has been written', function() { - var state = new State(); + let state = new State(); state.configState({ key1: { value: 1, - writeOnce: true - } + writeOnce: true, + }, }); state.key1 = 2; assert.strictEqual(2, state.key1); }); - it('should not allow changing a writeOnce state value after it has been written', function() { - var state = new State(); + let state = new State(); state.configState({ key1: { value: 1, - writeOnce: true - } + writeOnce: true, + }, }); assert.strictEqual(1, state.key1); @@ -558,40 +543,38 @@ describe('State', function() { }); it('should log error if required property gets no initial value via configState', function() { - var state = new State({ - key2: 'initialValue' + let state = new State({ + key2: 'initialValue', }); state.configState({ - key1: {} + key1: {}, }); assert.strictEqual(0, console.error.callCount); - state.configState( - { - key2: { - required: true - } - } - ); + state.configState({ + key2: { + required: true, + }, + }); assert.strictEqual(0, console.error.callCount); state.configState({ key3: { - required: true - } + required: true, + }, }); assert.strictEqual(1, console.error.callCount); }); it('should log error if required property is set to null or undefined', function() { - var state = new State({ - key: 'initialValue' + let state = new State({ + key: 'initialValue', }); state.configState({ key: { - required: true - } + required: true, + }, }); assert.strictEqual(0, console.error.callCount); @@ -611,31 +594,29 @@ describe('State', function() { return true; } } - var state = new Test({ - key2: 'initialValue' + let state = new Test({ + key2: 'initialValue', }); assert.doesNotThrow(() => { state.configState({ - key1: {} + key1: {}, }); }); assert.doesNotThrow(() => { - state.configState( - { - key2: { - required: true - } - } - ); + state.configState({ + key2: { + required: true, + }, + }); }); assert.throws(() => { state.configState({ key3: { - required: true - } + required: true, + }, }); }); }); @@ -646,15 +627,15 @@ describe('State', function() { return true; } } - var state = new Test({ - key: 'initialValue' + let state = new Test({ + key: 'initialValue', }); assert.doesNotThrow(() => { state.configState({ key: { - required: true - } + required: true, + }, }); }); @@ -679,8 +660,8 @@ describe('State', function() { } Test.STATE = { key: { - required: true - } + required: true, + }, }; assert.throws(() => { @@ -690,17 +671,17 @@ describe('State', function() { }); it('should emit event when a state key\'s value changes', function() { - var state = new State({ - key1: 10 + let state = new State({ + key1: 10, }); state.configState({ key1: { value: 1, - writeOnce: true - } + writeOnce: true, + }, }); - var listener = sinon.stub(); + let listener = sinon.stub(); state.on('key1Changed', listener); state.key1 = 2; @@ -713,17 +694,17 @@ describe('State', function() { }); it('should emit stateKeyChanged event when a state key\'s value changes', function() { - var state = new State({ - key1: 10 + let state = new State({ + key1: 10, }); state.configState({ key1: { value: 1, - writeOnce: true - } + writeOnce: true, + }, }); - var listener = sinon.stub(); + let listener = sinon.stub(); state.on('stateKeyChanged', listener); state.key1 = 2; @@ -736,8 +717,8 @@ describe('State', function() { }); it('should not emit events when state value doesn\'t change', function() { - var state = createStateInstance(); - var listener = sinon.stub(); + let state = createStateInstance(); + let listener = sinon.stub(); state.on('key1Changed', listener); state.key1 = state.key1; @@ -745,10 +726,10 @@ describe('State', function() { }); it('should emit events even when state value doesn\'t change if value is an object', function() { - var state = createStateInstance(); + let state = createStateInstance(); state.key1 = {}; - var listener = sinon.stub(); + let listener = sinon.stub(); state.on('key1Changed', listener); state.key1 = state.key1; @@ -756,10 +737,10 @@ describe('State', function() { }); it('should emit events even when state value doesn\'t change if value is an array', function() { - var state = createStateInstance(); + let state = createStateInstance(); state.key1 = []; - var listener = sinon.stub(); + let listener = sinon.stub(); state.on('key1Changed', listener); state.key1 = state.key1; @@ -767,24 +748,26 @@ describe('State', function() { }); it('should emit events even when state value doesn\'t change if value is a function', function() { - var state = createStateInstance(); + let state = createStateInstance(); state.key1 = function() {}; - var listener = sinon.stub(); + let listener = sinon.stub(); state.on('key1Changed', listener); state.key1 = state.key1; assert.strictEqual(1, listener.callCount); }); - it('should emit a preemptive batch event with all state changes for the cycle for providing a hook point', function(done) { - var state = createStateInstance(); + it('should emit a preemptive batch event with all state changes for the cycle for providing a hook point', function( + done + ) { + let state = createStateInstance(); - state.on('stateWillChange', function(data) { + state.on('stateWillChange', function() { state.key2 = 20; }); - state.on('stateChanged', function(data, facade) { + state.on('stateChanged', function(data) { assert.strictEqual(1, data.changes.key1.prevVal); assert.strictEqual(10, data.changes.key1.newVal); assert.strictEqual(2, data.changes.key2.prevVal); @@ -795,8 +778,10 @@ describe('State', function() { state.key1 = 10; }); - it('should emit a batch event with all state changes for the cycle', function(done) { - var state = createStateInstance(); + it('should emit a batch event with all state changes for the cycle', function( + done + ) { + let state = createStateInstance(); state.on('stateChanged', function(data, facade) { assert.strictEqual(2, Object.keys(data.changes).length); @@ -817,17 +802,17 @@ describe('State', function() { }); it('should pass given event data with change events', function() { - var state = new State({ - key1: 10 + let state = new State({ + key1: 10, }); state.configState({ - key1: {} + key1: {}, }); state.setEventData({ - foo: 'bar' + foo: 'bar', }); - var listener = sinon.stub(); + let listener = sinon.stub(); state.on('key1Changed', listener); state.key1 = 2; @@ -835,21 +820,23 @@ describe('State', function() { foo: 'bar', key: 'key1', newVal: 2, - prevVal: 10 + prevVal: 10, }; assert.strictEqual(1, listener.callCount); assert.deepEqual(expected, listener.args[0][0]); }); - it('should call callback function from setState asynchronously after the batch event is triggered', function(done) { - var state = createStateInstance(); + it('should call callback function from setState asynchronously after the batch event is triggered', function( + done + ) { + let state = createStateInstance(); - var listener = sinon.stub(); + let listener = sinon.stub(); state.on('stateChanged', listener); - var newState = { + let newState = { key1: 12, - key2: 21 + key2: 21, }; state.setState(newState, function() { assert.strictEqual(1, listener.callCount); @@ -858,31 +845,31 @@ describe('State', function() { }); it('should get all state values', function() { - var state = createStateInstance(); + let state = createStateInstance(); state.key1 = 10; - var stateObj = state.getState(); + let stateObj = state.getState(); assert.strictEqual(2, Object.keys(stateObj).length); assert.strictEqual(10, stateObj.key1); assert.strictEqual(2, stateObj.key2); }); it('should get values for the specified state keys', function() { - var state = createStateInstance(); + let state = createStateInstance(); state.key1 = 10; - var stateObj = state.getState(['key1']); + let stateObj = state.getState(['key1']); assert.strictEqual(1, Object.keys(stateObj).length); assert.strictEqual(10, stateObj.key1); }); it('should set all state values', function() { - var state = createStateInstance(); + let state = createStateInstance(); state.setState({ key1: 10, - key2: 20 + key2: 20, }); assert.strictEqual(10, state.key1); @@ -890,11 +877,11 @@ describe('State', function() { }); it('should not change properties that are not state keys via "setState"', function() { - var state = createStateInstance(); + let state = createStateInstance(); state.myVar = 1; state.setState({ key1: 10, - myVar: 2 + myVar: 2, }); assert.strictEqual(10, state.key1); @@ -902,12 +889,12 @@ describe('State', function() { }); it('should check if a state key\'s value has already been set', function() { - var state = new State({ - key1: 1 + let state = new State({ + key1: 1, }); state.configState({ key1: {}, - key2: {} + key2: {}, }); assert.ok(state.hasBeenSet('key1')); @@ -918,7 +905,7 @@ describe('State', function() { }); it('should not run setter, validator or events for removed state keys', function() { - var state = new State(); + let state = new State(); state.configState({ key1: { setter: function(val) { @@ -926,10 +913,10 @@ describe('State', function() { }, validator: function(val) { return val > 0; - } - } + }, + }, }); - var listener = sinon.stub(); + let listener = sinon.stub(); state.on('key1Changed', listener); state.removeStateKey('key1'); @@ -942,145 +929,141 @@ describe('State', function() { describe('Static STATE', function() { function createTestClass() { - class Test extends State { - } + class Test extends State {} return Test; } it('should automatically add state keys defined by STATE', function() { - var Test = createTestClass(); + let Test = createTestClass(); Test.STATE = { key1: { - value: 1 - } + value: 1, + }, }; - var test = new Test(); + let test = new Test(); assert.strictEqual(1, test.key1); }); it('should use config object from constructor to initialize state', function() { - var Test = createTestClass(); + let Test = createTestClass(); Test.STATE = { key1: { - value: 1 - } + value: 1, + }, }; - var test = new Test({ - key1: 2 + let test = new Test({ + key1: 2, }); assert.strictEqual(2, test.key1); }); it('should merge STATE from super class', function() { - var Test = createTestClass(); + let Test = createTestClass(); Test.STATE = { key1: { - value: 1 + value: 1, }, key2: { - value: 2 - } + value: 2, + }, }; - class ChildTest extends Test { - } + class ChildTest extends Test {} ChildTest.STATE = { key1: { - value: -1 + value: -1, }, key3: { - value: 3 - } + value: 3, + }, }; - var child = new ChildTest(); + let child = new ChildTest(); assert.strictEqual(-1, child.key1); assert.strictEqual(2, child.key2); assert.strictEqual(3, child.key3); - var test = new Test(); + let test = new Test(); assert.strictEqual(1, test.key1); assert.strictEqual(2, test.key2); assert.strictEqual(undefined, test.key3); }); it('should get STATE property value of given constructor', function() { - var Test = createTestClass(); + let Test = createTestClass(); Test.STATE = { key1: { - value: 1 + value: 1, }, key2: { - value: 2 - } + value: 2, + }, }; - class ChildTest extends Test { - } + class ChildTest extends Test {} ChildTest.STATE = { key1: { - value: -1 + value: -1, }, key3: { - value: 3 - } + value: 3, + }, }; - assert.deepEqual({ - key1: { - value: -1 - }, - key2: { - value: 2 + assert.deepEqual( + { + key1: { + value: -1, + }, + key2: { + value: 2, + }, + key3: { + value: 3, + }, }, - key3: { - value: 3 - } - }, State.getStateStatic(ChildTest)); + State.getStateStatic(ChildTest) + ); }); it('should conflict STATE properties from instance with previous instances', function() { - var Test = createTestClass(); + let Test = createTestClass(); Test.STATE = { - key1: { - } + key1: {}, }; - var test1 = new Test({ - key1: 'foo1' + let test1 = new Test({ + key1: 'foo1', }); assert.strictEqual('foo1', test1.key1); - var test2 = new Test({ - key1: 'foo2' + let test2 = new Test({ + key1: 'foo2', }); assert.strictEqual('foo2', test2.key1); assert.strictEqual('foo1', test1.key1); }); it('should configure static STATE with multiple levels of class inheritance', function() { - var Test = createTestClass(); + let Test = createTestClass(); Test.STATE = { - key1: { - } + key1: {}, }; - class Child extends Test { - } + class Child extends Test {} Child.STATE = { - key2: { - } + key2: {}, }; - var test = new Test({ - key1: 'foo1' + let test = new Test({ + key1: 'foo1', }); assert.strictEqual('foo1', test.key1); - var child = new Child({ - key2: 'foo2' + let child = new Child({ + key2: 'foo2', }); assert.strictEqual('foo1', test.key1); assert.strictEqual('foo2', child.key2); @@ -1089,28 +1072,27 @@ describe('State', function() { describe('Separate object', function() { it('should add state properties to given object', function() { - var obj = {}; - var state = new State({}, obj); + let obj = {}; + let state = new State({}, obj); state.configState({ key1: {}, - key2: {} + key2: {}, }); - var keys = Object.keys(obj); + let keys = Object.keys(obj); assert.strictEqual(2, keys.length); assert.deepEqual(['key1', 'key2'], keys.sort()); }); it('should add state properties from STATE static variable to object under given name', function() { - class Test extends State { - } + class Test extends State {} Test.STATE = { key1: { - value: 1 - } + value: 1, + }, }; - var obj = {}; + let obj = {}; new Test({}, obj); assert.strictEqual(1, obj.key1); }); @@ -1125,29 +1107,26 @@ describe('State', function() { Test.STATE = { key1: { setter: 'setFn', - value: 1 - } + value: 1, + }, }; - var obj = { + let obj = { setFn(val) { return 'obj:' + val; - } + }, }; new Test({}, obj, obj); assert.strictEqual('obj:1', obj.key1); }); it('should use given context object when emitting change events', function() { - class Test extends State { - } + class Test extends State {} Test.STATE = { - key1: { - } + key1: {}, }; - class Test2 extends EventEmitter { - } + class Test2 extends EventEmitter {} const obj = new Test2(); const listener = sinon.stub(); obj.on('key1Changed', listener); @@ -1161,27 +1140,30 @@ describe('State', function() { const expected = { key: 'key1', newVal: 2, - prevVal: undefined + prevVal: undefined, }; assert.deepEqual(expected, listener.args[0][0]); }); it('should pass given context object when calling validator', function() { - var validator = sinon.stub().returns(true); - class Test extends State { - } + let validator = sinon.stub().returns(true); + class Test extends State {} Test.STATE = { key1: { - validator - } + validator, + }, }; - var obj = {}; - var context = {}; - var key1 = 1; - new Test({ - key1 - }, obj, context); + let obj = {}; + let context = {}; + let key1 = 1; + new Test( + { + key1, + }, + obj, + context + ); assert.strictEqual(1, obj.key1); assert.strictEqual(1, validator.callCount); assert.strictEqual(1, validator.args[0][0]); @@ -1190,26 +1172,26 @@ describe('State', function() { }); it('should remove state properties from object under given name', function() { - var obj = {}; - var state = new State({}, obj); + let obj = {}; + let state = new State({}, obj); state.configState({ key1: {}, - key2: {} + key2: {}, }); state.removeStateKey('key1'); - var keys = Object.keys(obj); + let keys = Object.keys(obj); assert.strictEqual(1, keys.length); assert.deepEqual('key2', keys[0]); }); it('should create new object with same state properties when getState is called', function() { - var obj = {}; - var state = new State({}, obj); + let obj = {}; + let state = new State({}, obj); state.configState({ key1: {}, - key2: {} + key2: {}, }); assert.deepEqual(obj, state.getState()); @@ -1217,14 +1199,14 @@ describe('State', function() { }); it('should emit event when state property changes', function() { - var obj = {}; - var state = new State({}, obj); + let obj = {}; + let state = new State({}, obj); state.configState({ key1: {}, - key2: {} + key2: {}, }); - var listener = sinon.stub(); + let listener = sinon.stub(); state.on('key1Changed', listener); obj.key1 = 'newVal'; @@ -1252,8 +1234,10 @@ describe('State', function() { console.warn = originalWarnFn; }); - it('should not throw error when trying to emit scheduled stateChanged after disposed', function(done) { - var state = createStateInstance(); + it('should not throw error when trying to emit scheduled stateChanged after disposed', function( + done + ) { + let state = createStateInstance(); state.key1 = 10; state.dispose(); @@ -1263,38 +1247,38 @@ describe('State', function() { }); it('should warn if trying to get state property after disposed', function() { - var state = createStateInstance(); + let state = createStateInstance(); state.dispose(); assert.doesNotThrow(() => state.key1); assert.strictEqual(1, console.warn.callCount); }); it('should warn if trying to set state property after disposed', function() { - var state = createStateInstance(); + let state = createStateInstance(); state.dispose(); - assert.doesNotThrow(() => state.key1 = 'new'); + assert.doesNotThrow(() => (state.key1 = 'new')); assert.strictEqual(1, console.warn.callCount); }); it('should warn if trying to use "setState" after disposed', function() { - var state = createStateInstance(); + let state = createStateInstance(); state.dispose(); assert.doesNotThrow(() => { state.setState({ - key1: 'new' + key1: 'new', }); }); assert.strictEqual(1, console.warn.callCount); }); it('should not throw error if trying to use "getState" after disposed', function() { - var state = createStateInstance(); + let state = createStateInstance(); state.dispose(); assert.doesNotThrow(() => state.getState()); }); it('should not throw error if trying to use "getStateKeyConfig" after disposed', function() { - var state = createStateInstance(); + let state = createStateInstance(); state.dispose(); assert.doesNotThrow(() => state.getStateKeyConfig()); }); @@ -1302,14 +1286,14 @@ describe('State', function() { }); function createStateInstance() { - var state = new State(); + let state = new State(); state.configState({ key1: { - value: 1 + value: 1, }, key2: { - value: 2 - } + value: 2, + }, }); return state; diff --git a/packages/metal-state/test/validators.js b/packages/metal-state/test/validators.js index 7c8aec14..37e73138 100644 --- a/packages/metal-state/test/validators.js +++ b/packages/metal-state/test/validators.js @@ -55,6 +55,29 @@ describe('validators', function() { assert.isTrue(validator(function() {})); }); + it('should throw error if a non-function is passed to arrayOf', function() { + assert.throws(function() { + validators.arrayOf(2); + }, 'Expected type function, but received type number. passed to arrayOf.'); + }); + + it('should return detailed error message when nested validator in arrayOf fails', function() { + const arrayOfStrings = validators.arrayOf(validators.string); + + const context = { + constructor: { + name: 'componentName', + }, + }; + + const result = arrayOfStrings(['1', 2], 'arrayName', context); + + assert.equal( + result.message, + `Invalid state passed to 'arrayName'. Validator for arrayName[1] says: "Error: Invalid state passed to 'arrayName'. Expected type 'string', but received type 'number'. Passed to 'componentName'. " Passed to 'componentName'. ` + ); + }); + it('should validate an array of a single type', function() { const arrayOfNumbers = validators.arrayOf(validators.number); @@ -66,10 +89,8 @@ describe('validators', function() { }); it('should validate an instance of a class', function() { - class TestClass { - } - class TestClass2 { - } + class TestClass {} + class TestClass2 {} const instanceOfFn = validators.instanceOf(TestClass); @@ -91,12 +112,7 @@ describe('validators', function() { }); it('should validate equality against an array of values', function() { - const validator = validators.oneOf( - [ - 'one', - 1 - ] - ); + const validator = validators.oneOf(['one', 1]); assert.isTrue(validator('one')); assert.isTrue(validator(1)); @@ -110,12 +126,10 @@ describe('validators', function() { }); it('should validate one of certain types', function() { - const oneOfType = validators.oneOfType( - [ - validators.string, - validators.number - ] - ); + const oneOfType = validators.oneOfType([ + validators.string, + validators.number, + ]); assert.isTrue(oneOfType('test')); @@ -125,44 +139,56 @@ describe('validators', function() { }); it('should fail if an array is not supplied to oneOfType', function() { - const validator = validators.oneOfType( - { - one: validators.string - } - ); + const validator = validators.oneOfType({ + one: validators.string, + }); assert.ok(validator({}) instanceof Error); }); + it('should throw error if a non-function is passed to objectOf', function() { + assert.throws(function() { + validators.objectOf(2); + }, 'Expected type function, but received type number. passed to objectOf.'); + }); + it('should validate an object with certain types of values', function() { const objectOf = validators.objectOf(validators.number); - assert.isTrue(objectOf({ - a: 1, - b: 2 - })); + assert.isTrue( + objectOf({ + a: 1, + b: 2, + }) + ); - assert.ok(objectOf({ + assert.ok( + objectOf({ a: '1', - b: '2' - }) instanceof Error); + b: '2', + }) instanceof Error + ); }); it('should validate a shape of an object', function() { const shape = validators.shapeOf({ a: validators.string, - b: validators.number + b: validators.number, }); - assert.isTrue(shape({ - a: '1', - b: 2 - })); + assert.isTrue( + shape({ + a: '1', + b: 2, + }) + ); - assert.ok(shape({ + assert.ok( + shape({ a: '1', - b: '2' - }) instanceof Error); + b: '2', + }) instanceof Error + ); }); it('should validate a shape nested within a shape', function() { @@ -171,39 +197,71 @@ describe('validators', function() { b: { config: { required: true, - validator: validators.string - } - } - }) + validator: validators.string, + }, + }, + }), }); - assert.isTrue(shape({ - a: { - b: 'test' - } - })); + assert.isTrue( + shape({ + a: { + b: 'test', + }, + }) + ); - assert.ok(shape({ + assert.ok( + shape({ a: { - b: 1 - } - }) instanceof Error); + b: 1, + }, + }) instanceof Error + ); - assert.ok(shape({ - a: 1 - }) instanceof Error); + assert.ok( + shape({ + a: 1, + }) instanceof Error + ); }); it('should return validator function instead of running it if no arg is passed to type validator', function() { - var validatorFn = validators.bool(); + let validatorFn = validators.bool(); assert.isTrue(core.isFunction(validatorFn)); assert.isTrue(validatorFn(true)); assert.ok(validatorFn('true') instanceof Error); }); - it('should fail if an object is not supplied to shape', function() { - const validator = validators.shapeOf(1); - assert.ok(validator({}) instanceof Error); + it('should throw error if a non-object is passed to shapeOf', function() { + assert.throws(function() { + validators.shapeOf(2); + }, 'Expected type object, but received type number. passed to shapeOf.'); + }); + + it('should return detailed error message when nested validator in shapeOf fails', function() { + const shape = validators.shapeOf({ + key: validators.string, + }); + + const context = { + constructor: { + name: 'componentName', + }, + }; + + const result = shape( + { + key: 2, + }, + 'objectName', + context + ); + + assert.equal( + result.message, + `Invalid state passed to 'objectName.key'. Expected type 'string', but received type 'number'. Passed to 'componentName'. ` + ); }); it('should emit warning message', function() { @@ -211,7 +269,8 @@ describe('validators', function() { const NAME = 'name'; const PARENT_COMPONENT_NAME = 'parentComponent'; - const ERROR_MESSAGE = `Error: Warning: Invalid state passed to '${NAME}'. ` + + const ERROR_MESSAGE = + `Error: Invalid state passed to '${NAME}'. ` + `Expected type 'string', but received type 'number'. ` + `Passed to '${COMPONENT_NAME}'. Check render ` + `method of '${PARENT_COMPONENT_NAME}'.`; @@ -222,15 +281,15 @@ describe('validators', function() { getParent: () => { return { constructor: { - name: PARENT_COMPONENT_NAME - } + name: PARENT_COMPONENT_NAME, + }, }; - } + }, }; }, constructor: { - name: COMPONENT_NAME - } + name: COMPONENT_NAME, + }, }; const resultError = validators.string(1, NAME, context); diff --git a/packages/metal-web-component/package-lock.json b/packages/metal-web-component/package-lock.json index 65ab2703..e9918c21 100644 --- a/packages/metal-web-component/package-lock.json +++ b/packages/metal-web-component/package-lock.json @@ -3,7 +3,7 @@ "lockfileVersion": 1, "dependencies": { "@webcomponents/webcomponentsjs": { - "version": "github:webcomponents/webcomponentsjs#eb9edd87fb7662ff56aef786b8cd5e229d3342fb" + "version": "github:webcomponents/webcomponentsjs#1913eb6cf975a598fc04cd8a4371f787b4a32088" }, "ansi-regex": { "version": "2.1.1", @@ -67,7 +67,7 @@ "lodash": "4.17.4", "minimatch": "3.0.4", "path-is-absolute": "1.0.1", - "private": "0.1.7", + "private": "0.1.8", "slash": "1.0.0", "source-map": "0.5.7" } @@ -510,9 +510,9 @@ } }, "babel-preset-env": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.6.0.tgz", - "integrity": "sha512-OVgtQRuOZKckrILgMA5rvctvFZPv72Gua9Rt006AiPoB0DJKGN07UmaQA+qRrYgK71MVct8fFhT0EyNWYorVew==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.6.1.tgz", + "integrity": "sha512-W6VIyA6Ch9ePMI7VptNn2wBM6dbG0eSz25HEiL40nQXCsXGTGZSTZu1Iap+cj3Q0S5a7T9+529l/5Bkvd+afNA==", "requires": { "babel-plugin-check-es2015-constants": "6.22.0", "babel-plugin-syntax-trailing-function-commas": "6.22.0", @@ -541,7 +541,7 @@ "babel-plugin-transform-es2015-unicode-regex": "6.24.1", "babel-plugin-transform-exponentiation-operator": "6.24.1", "babel-plugin-transform-regenerator": "6.26.0", - "browserslist": "2.5.1", + "browserslist": "2.8.0", "invariant": "2.2.2", "semver": "5.4.1" } @@ -628,18 +628,18 @@ } }, "browserslist": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-2.5.1.tgz", - "integrity": "sha512-jAvM2ku7YDJ+leAq3bFH1DE0Ylw+F+EQDq4GkqZfgPEqpWYw9ofQH85uKSB9r3Tv7XDbfqVtE+sdvKJW7IlPJA==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-2.8.0.tgz", + "integrity": "sha512-iiWHM1Et6Q4TQpB7Ar6pxuM3TNMXasVJY4Y/oh3q38EwR3Z+IdZ9MyVf7PI4MJFB4xpwMcZgs9bEUnPG2E3TCA==", "requires": { - "caniuse-lite": "1.0.30000746", - "electron-to-chromium": "1.3.25" + "caniuse-lite": "1.0.30000760", + "electron-to-chromium": "1.3.27" } }, "caniuse-lite": { - "version": "1.0.30000746", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000746.tgz", - "integrity": "sha1-xk+Vo5Jc/TAgejCO12wa6W6gnqA=" + "version": "1.0.30000760", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000760.tgz", + "integrity": "sha1-7HIDlXQvHH7IlH/W3SYE53qPmP8=" }, "chalk": { "version": "1.1.3", @@ -690,9 +690,9 @@ } }, "electron-to-chromium": { - "version": "1.3.25", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.25.tgz", - "integrity": "sha1-RTshAJg20Jl9hgNWAf9srkeRxGA=" + "version": "1.3.27", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.27.tgz", + "integrity": "sha1-eOy4o5kGYYe7N07t412ccFZagD0=" }, "escape-string-regexp": { "version": "1.0.5", @@ -813,16 +813,16 @@ } }, "metal": { - "version": "2.13.2", - "resolved": "https://registry.npmjs.org/metal/-/metal-2.13.2.tgz", - "integrity": "sha512-DqETxwvyW5I/3blSlxrr1eleLaLHItK1VJcGIL6hAVqSlUpYw0r+RXd8qWfIq6TMdjCU3/x/oGmWZyk+O4SZJw==" + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/metal/-/metal-2.14.0.tgz", + "integrity": "sha512-dk4MUJZ5Rj+sB9RgZcATU8QRDxHKPn85ymVWC+PamDhcIEYsY5Fg+I6vOQ1Bo4J+54z/k9KF2K7fmUIRtoRb+w==" }, "metal-events": { - "version": "2.13.2", - "resolved": "https://registry.npmjs.org/metal-events/-/metal-events-2.13.2.tgz", - "integrity": "sha512-iEuqr5+T87Bq114wV/okNzwS25i/c4jqmIZ6IBLPFTD1Gxbk6qEiklnWf7Z2iVbqPYOz+2LgL130Nt2U4eb9tA==", + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/metal-events/-/metal-events-2.14.0.tgz", + "integrity": "sha512-LKV9EOMRzM1Sb5BD4Hfcy7aaepCCRrDVbMOq9O48KuGXawKG4XTZcLhR6J1dFI3UzF+BeO11Kh1v+4DxUAH1CA==", "requires": { - "metal": "2.13.2" + "metal": "2.14.0" } }, "metal-state": { @@ -830,8 +830,8 @@ "resolved": "https://registry.npmjs.org/metal-state/-/metal-state-2.7.0.tgz", "integrity": "sha1-VWis04wc2O/Mr7kAiWDVCN9/olI=", "requires": { - "metal": "2.13.2", - "metal-events": "2.13.2" + "metal": "2.14.0", + "metal-events": "2.14.0" } }, "metal-useragent": { @@ -839,7 +839,7 @@ "resolved": "https://registry.npmjs.org/metal-useragent/-/metal-useragent-2.1.3.tgz", "integrity": "sha1-9Yfb1hPE18kFBjn1iXMSdThjcWk=", "requires": { - "metal": "2.13.2" + "metal": "2.14.0" } }, "minimatch": { @@ -912,9 +912,9 @@ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "private": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/private/-/private-0.1.7.tgz", - "integrity": "sha1-aM5eih7woju1cMwoU3tTMqumPvE=" + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", + "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==" }, "regenerate": { "version": "1.3.3", @@ -933,7 +933,7 @@ "requires": { "babel-runtime": "6.26.0", "babel-types": "6.26.0", - "private": "0.1.7" + "private": "0.1.8" } }, "regexpu-core": { diff --git a/packages/metal-web-component/src/define_web_component.js b/packages/metal-web-component/src/define_web_component.js index 1746724d..e0989ae5 100644 --- a/packages/metal-web-component/src/define_web_component.js +++ b/packages/metal-web-component/src/define_web_component.js @@ -1,5 +1,5 @@ -import State, { mergeState } from 'metal-state'; -import { getStaticProperty, isObject } from 'metal'; +import State, {mergeState} from 'metal-state'; +import {getStaticProperty, isObject} from 'metal'; /** * Register a custom element for a given Metal component. @@ -74,15 +74,19 @@ export function defineWebComponent(tagName, Ctor) { if (useShadowDOM) { element = this.attachShadow({ - mode: 'open' + mode: 'open', }); } - let opts = {}; + const opts = {}; for (let i = 0, l = observedAttributes.length; i < l; i++) { - opts[observedAttributes[i]] = this.deserializeValue_( + const deserializedValue = this.deserializeValue_( this.getAttribute(observedAttributes[i]) ); + + if (deserializedValue) { + opts[observedAttributes[i]] = deserializedValue; + } } this.component = new Ctor(opts, element); this.componentHasProps = hasProps; @@ -96,6 +100,7 @@ export function defineWebComponent(tagName, Ctor) { * * @memberof CustomElement * @param {?} value attribute value that should be parsed. + * @return {Object} */ deserializeValue_: function(value) { let retVal; @@ -128,13 +133,13 @@ export function defineWebComponent(tagName, Ctor) { emit: function(...data) { const eventData = data.pop(); const event = new CustomEvent(eventData.type, { - detail: data + detail: data, }); this.dispatchEvent(event); - } + }, }); window.customElements.define(tagName, CustomElement); -}; +} export default defineWebComponent; diff --git a/packages/metal-web-component/test/.eslintrc b/packages/metal-web-component/test/.eslintrc new file mode 100644 index 00000000..1547409b --- /dev/null +++ b/packages/metal-web-component/test/.eslintrc @@ -0,0 +1,16 @@ +{ + "env": { + "mocha": true + }, + "globals": { + "assert": true, + "before": true, + "IncrementalDOM": true, + "sinon": true + }, + "rules": { + "max-len": 0, + "no-invalid-this": 0, + "require-jsdoc": 0 + } +} \ No newline at end of file diff --git a/packages/metal-web-component/test/.eslintrc.json b/packages/metal-web-component/test/.eslintrc.json deleted file mode 100644 index f361917d..00000000 --- a/packages/metal-web-component/test/.eslintrc.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "env": { - "mocha": true - }, - "globals": { - "assert": true, - "sinon": true, - "IncrementalDOM": true - } -} diff --git a/packages/metal-web-component/test/define_web_component.js b/packages/metal-web-component/test/define_web_component.js index 17e5c008..8ba8783d 100644 --- a/packages/metal-web-component/test/define_web_component.js +++ b/packages/metal-web-component/test/define_web_component.js @@ -3,9 +3,9 @@ import Component from 'metal-component'; import Soy from 'metal-soy'; import UA from 'metal-useragent'; -import { JSXComponent } from 'metal-jsx'; +import {JSXComponent} from 'metal-jsx'; -import { defineWebComponent } from '../src/define_web_component'; +import {defineWebComponent} from '../src/define_web_component'; describe('Web components', function() { let el; @@ -81,7 +81,10 @@ describe('Web components', function() { document.body.appendChild(el); - assert.equal(el.shadowRoot.innerHTML, '
'); + assert.equal( + el.shadowRoot.innerHTML, + '
' + ); }); it('should render custom element via html', function() { @@ -91,19 +94,26 @@ describe('Web components', function() { document.body.innerHTML = innerHTML; - assert.equal(document.body.innerHTML, '
'); + assert.equal( + document.body.innerHTML, + '
' + ); }); it('should render custom element via html when useshadowdom is true', function() { const tagName = createWebComponent('custom-test-element-07'); - const innerHTML = '<' + tagName + ' useshadowdom="true">'; + const innerHTML = + '<' + tagName + ' useshadowdom="true">'; document.body.innerHTML = innerHTML; el = document.querySelector(tagName); - assert.equal(el.shadowRoot.innerHTML, '
'); + assert.equal( + el.shadowRoot.innerHTML, + '
' + ); }); it('should deserialize attribute if json is passed', function() { @@ -127,6 +137,15 @@ describe('Web components', function() { assert.isUndefined(title.key1); assert.equal(title.key3, 'value3'); }); + + it('should have the default state value after rendering', function() { + const tagName = createWebComponent('custom-test-element-09'); + el = document.createElement(tagName); + + document.body.appendChild(el); + + assert.equal(el.component.title, 'default title'); + }); }); describe('Define JSX component', function() { @@ -186,7 +205,10 @@ describe('Web components', function() { document.body.appendChild(el); - assert.equal(el.shadowRoot.innerHTML, '
'); + assert.equal( + el.shadowRoot.innerHTML, + '
' + ); }); it('should render custom element via html', function() { @@ -196,19 +218,26 @@ describe('Web components', function() { document.body.innerHTML = innerHTML; - assert.equal(document.body.innerHTML, '
'); + assert.equal( + document.body.innerHTML, + '
' + ); }); it('should render custom element via html when useshadowdom is true', function() { const tagName = createJSXWebComponent('custom-jsx-test-element-07'); - const innerHTML = '<' + tagName + ' useshadowdom="true">'; + const innerHTML = + '<' + tagName + ' useshadowdom="true">'; document.body.innerHTML = innerHTML; el = document.querySelector(tagName); - assert.equal(el.shadowRoot.innerHTML, '
'); + assert.equal( + el.shadowRoot.innerHTML, + '
' + ); }); it('should deserialize attribute if json is passed', function() { @@ -240,15 +269,16 @@ describe('Web components', function() { class WebComponent extends JSXComponent { render() { IncrementalDOM.elementVoid('div', null, [ - 'title', WebComponent.PROPS.title.value + 'title', + WebComponent.PROPS.title.value, ]); } } WebComponent.PROPS = { title: { - value: 'default title' - } + value: 'default title', + }, }; defineWebComponent(tagName, WebComponent); @@ -263,16 +293,17 @@ describe('Web components', function() { WebComponent.STATE = { title: { - value: 'default title' - } + value: 'default title', + }, }; Soy.register(WebComponent, { render: () => { IncrementalDOM.elementVoid('div', null, [ - 'title', WebComponent.STATE.title.value + 'title', + WebComponent.STATE.title.value, ]); - } + }, }); defineWebComponent(tagName, WebComponent); @@ -282,7 +313,7 @@ describe('Web components', function() { function isSafariVersion(version) { if (!UA.isSafari) return false; - const nav = window && window.navigator || {}; - return !!(new RegExp('Version\/' + version).exec(nav.userAgent)); + const nav = (window && window.navigator) || {}; + return !!new RegExp('Version/' + version).exec(nav.userAgent); } }); diff --git a/packages/metal-web-component/webcomponents_polyfill.js b/packages/metal-web-component/webcomponents_polyfill.js index bd913f72..da674a5e 100644 --- a/packages/metal-web-component/webcomponents_polyfill.js +++ b/packages/metal-web-component/webcomponents_polyfill.js @@ -1,9 +1,11 @@ +/* eslint no-var: 0 */ if (window.navigator.userAgent.indexOf('MSIE') === -1) { var script = document.createElement('script'); script.crossOrigin = 'anonymous'; - script.src = '/base/packages/metal-web-component/node_modules/@webcomponents/webcomponentsjs/webcomponents-lite.js'; + script.src = + '/base/packages/metal-web-component/node_modules/@webcomponents/webcomponentsjs/webcomponents-lite.js'; script.type = 'text/javascript'; document.body.appendChild(script); -} \ No newline at end of file +} diff --git a/packages/metal/README.md b/packages/metal/README.md index 524d03f3..5c6bb03c 100644 --- a/packages/metal/README.md +++ b/packages/metal/README.md @@ -1,3 +1,5 @@ # metal Core functions from Metal.js, with utilities for dealing with arrays, objects and others. + +See [https://metaljs.com/](https://metaljs.com/) for documentation. diff --git a/packages/metal/package-lock.json b/packages/metal/package-lock.json index f9c637f5..7e4c66d6 100644 --- a/packages/metal/package-lock.json +++ b/packages/metal/package-lock.json @@ -64,7 +64,7 @@ "lodash": "4.17.4", "minimatch": "3.0.4", "path-is-absolute": "1.0.1", - "private": "0.1.7", + "private": "0.1.8", "slash": "1.0.0", "source-map": "0.5.7" } @@ -507,9 +507,9 @@ } }, "babel-preset-env": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.6.0.tgz", - "integrity": "sha512-OVgtQRuOZKckrILgMA5rvctvFZPv72Gua9Rt006AiPoB0DJKGN07UmaQA+qRrYgK71MVct8fFhT0EyNWYorVew==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.6.1.tgz", + "integrity": "sha512-W6VIyA6Ch9ePMI7VptNn2wBM6dbG0eSz25HEiL40nQXCsXGTGZSTZu1Iap+cj3Q0S5a7T9+529l/5Bkvd+afNA==", "requires": { "babel-plugin-check-es2015-constants": "6.22.0", "babel-plugin-syntax-trailing-function-commas": "6.22.0", @@ -538,7 +538,7 @@ "babel-plugin-transform-es2015-unicode-regex": "6.24.1", "babel-plugin-transform-exponentiation-operator": "6.24.1", "babel-plugin-transform-regenerator": "6.26.0", - "browserslist": "2.5.1", + "browserslist": "2.8.0", "invariant": "2.2.2", "semver": "5.4.1" } @@ -625,18 +625,18 @@ } }, "browserslist": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-2.5.1.tgz", - "integrity": "sha512-jAvM2ku7YDJ+leAq3bFH1DE0Ylw+F+EQDq4GkqZfgPEqpWYw9ofQH85uKSB9r3Tv7XDbfqVtE+sdvKJW7IlPJA==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-2.8.0.tgz", + "integrity": "sha512-iiWHM1Et6Q4TQpB7Ar6pxuM3TNMXasVJY4Y/oh3q38EwR3Z+IdZ9MyVf7PI4MJFB4xpwMcZgs9bEUnPG2E3TCA==", "requires": { - "caniuse-lite": "1.0.30000746", - "electron-to-chromium": "1.3.25" + "caniuse-lite": "1.0.30000760", + "electron-to-chromium": "1.3.27" } }, "caniuse-lite": { - "version": "1.0.30000746", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000746.tgz", - "integrity": "sha1-xk+Vo5Jc/TAgejCO12wa6W6gnqA=" + "version": "1.0.30000760", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000760.tgz", + "integrity": "sha1-7HIDlXQvHH7IlH/W3SYE53qPmP8=" }, "chalk": { "version": "1.1.3", @@ -687,9 +687,9 @@ } }, "electron-to-chromium": { - "version": "1.3.25", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.25.tgz", - "integrity": "sha1-RTshAJg20Jl9hgNWAf9srkeRxGA=" + "version": "1.3.27", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.27.tgz", + "integrity": "sha1-eOy4o5kGYYe7N07t412ccFZagD0=" }, "escape-string-regexp": { "version": "1.0.5", @@ -879,9 +879,9 @@ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "private": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/private/-/private-0.1.7.tgz", - "integrity": "sha1-aM5eih7woju1cMwoU3tTMqumPvE=" + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", + "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==" }, "regenerate": { "version": "1.3.3", @@ -900,7 +900,7 @@ "requires": { "babel-runtime": "6.26.0", "babel-types": "6.26.0", - "private": "0.1.7" + "private": "0.1.8" } }, "regexpu-core": { diff --git a/packages/metal/src/array/array.js b/packages/metal/src/array/array.js index 3ae0872c..b12fdad9 100644 --- a/packages/metal/src/array/array.js +++ b/packages/metal/src/array/array.js @@ -1,7 +1,8 @@ 'use strict'; -import { isDef } from '../core'; - +/** + * Set of utilities for array operations + */ class array { /** * Checks if the given arrays have the same content. @@ -40,11 +41,10 @@ class array { /** * Transforms the input nested array to become flat. * @param {Array.<*|Array.<*>>} arr Nested array to flatten. - * @param {Array.<*>} opt_output Optional output array. + * @param {Array.<*>=} output Optional output array. * @return {Array.<*>} Flat array. */ - static flatten(arr, opt_output) { - var output = opt_output || []; + static flatten(arr, output = []) { for (let i = 0; i < arr.length; i++) { if (Array.isArray(arr[i])) { array.flatten(arr[i], output); @@ -65,7 +65,7 @@ class array { static remove(arr, obj) { const i = arr.indexOf(obj); let rv; - if ( (rv = i >= 0) ) { + if ((rv = i >= 0)) { array.removeAt(arr, i); } return rv; @@ -86,14 +86,13 @@ class array { * is faster and working on all array-like objects (like arguments). * @param {!Object} arr Array-like object to slice. * @param {number} start The index that should start the slice. - * @param {number=} opt_end The index where the slice should end, not + * @param {number=} end The index where the slice should end, not * included in the final array. If not given, all elements after the * start index will be included. * @return {!Array} */ - static slice(arr, start, opt_end) { + static slice(arr, start, end = arr.length) { const sliced = []; - const end = isDef(opt_end) ? opt_end : arr.length; for (let i = start; i < end; i++) { sliced.push(arr[i]); } diff --git a/packages/metal/src/async/async.js b/packages/metal/src/async/async.js index 51cb48b2..dd006052 100644 --- a/packages/metal/src/async/async.js +++ b/packages/metal/src/async/async.js @@ -1,4 +1,4 @@ -/*! +/* ! * Polyfill from Google's Closure Library. * Copyright 2013 The Closure Library Authors. All Rights Reserved. */ @@ -7,7 +7,6 @@ const async = {}; - /** * Throw an item without interrupting the current execution context. For * example, if processing a group of items in a loop, sometimes it is useful @@ -22,31 +21,27 @@ async.throwException = function(exception) { }); }; - /** * Fires the provided callback just before the current callstack unwinds, or as * soon as possible after the current JS execution context. * @param {function(this:THIS)} callback - * @param {THIS=} opt_context Object to use as the "this value" when calling + * @param {THIS=} context Object to use as the "this value" when calling * the provided function. * @template THIS */ -async.run = function(callback, opt_context) { +async.run = function(callback, context) { if (!async.run.workQueueScheduled_) { // Nothing is currently scheduled, schedule it now. async.nextTick(async.run.processWorkQueue); async.run.workQueueScheduled_ = true; } - async.run.workQueue_.push( - new async.run.WorkItem_(callback, opt_context)); + async.run.workQueue_.push(new async.run.WorkItem_(callback, context)); }; - /** @private {boolean} */ async.run.workQueueScheduled_ = false; - /** @private {!Array.} */ async.run.workQueue_ = []; @@ -75,7 +70,6 @@ async.run.processWorkQueue = function() { async.run.workQueueScheduled_ = false; }; - /** * @constructor * @final @@ -92,20 +86,19 @@ async.run.WorkItem_ = function(fn, scope) { this.scope = scope; }; - /** * Fires the provided callbacks as soon as possible after the current JS * execution context. setTimeout(…, 0) always takes at least 5ms for legacy * reasons. * @param {function(this:SCOPE)} callback Callback function to fire as soon as * possible. - * @param {SCOPE=} opt_context Object in whose scope to call the listener. + * @param {SCOPE=} context Object in whose scope to call the listener. * @template SCOPE */ -async.nextTick = function(callback, opt_context) { +async.nextTick = function(callback, context) { let cb = callback; - if (opt_context) { - cb = callback.bind(opt_context); + if (context) { + cb = callback.bind(context); } cb = async.nextTick.wrapCallback_(cb); // Introduced and currently only supported by IE10. @@ -119,12 +112,12 @@ async.nextTick = function(callback, opt_context) { } // Look for and cache the custom fallback version of setImmediate. if (!async.nextTick.setImmediate_) { + // eslint-disable-next-line async.nextTick.setImmediate_ = async.nextTick.getSetImmediateEmulator_(); } async.nextTick.setImmediate_(cb); }; - /** * Cache for the setImmediate implementation. * @type {function(function())} @@ -132,7 +125,6 @@ async.nextTick = function(callback, opt_context) { */ async.nextTick.setImmediate_ = null; - /** * Determines the best possible implementation to run a function as soon as * the JS event loop is idle. @@ -156,8 +148,12 @@ async.nextTick.getSetImmediateEmulator_ = function() { // an iframe based polyfill in browsers that have postMessage and // document.addEventListener. The latter excludes IE8 because it has a // synchronous postMessage implementation. - if (typeof Channel === 'undefined' && typeof window !== 'undefined' && - window.postMessage && window.addEventListener) { + if ( + typeof Channel === 'undefined' && + typeof window !== 'undefined' && + window.postMessage && + window.addEventListener + ) { /** @constructor */ Channel = function() { // Make an empty, invisible iframe. @@ -185,7 +181,7 @@ async.nextTick.getSetImmediateEmulator_ = function() { this.port2 = { postMessage: function() { win.postMessage(message, origin); - } + }, }; }; } @@ -202,7 +198,7 @@ async.nextTick.getSetImmediateEmulator_ = function() { }; return function(cb) { tail.next = { - cb: cb + cb: cb, }; tail = tail.next; channel.port2.postMessage(0); @@ -210,8 +206,10 @@ async.nextTick.getSetImmediateEmulator_ = function() { } // Implementation for IE6-8: Script elements fire an asynchronous // onreadystatechange event when inserted into the DOM. - if (typeof document !== 'undefined' && 'onreadystatechange' in - document.createElement('script')) { + if ( + typeof document !== 'undefined' && + 'onreadystatechange' in document.createElement('script') + ) { return function(cb) { let script = document.createElement('script'); script.onreadystatechange = function() { @@ -232,7 +230,6 @@ async.nextTick.getSetImmediateEmulator_ = function() { }; }; - /** * Helper function that is overrided to protect callbacks with entry point * monitor if the application monitors entry points. @@ -240,8 +237,8 @@ async.nextTick.getSetImmediateEmulator_ = function() { * @return {function()} The wrapped callback. * @private */ -async.nextTick.wrapCallback_ = function(opt_returnValue) { - return opt_returnValue; +async.nextTick.wrapCallback_ = function(callback) { + return callback; }; export default async; diff --git a/packages/metal/src/core.js b/packages/metal/src/core.js index 4ab49ecc..52118e70 100644 --- a/packages/metal/src/core.js +++ b/packages/metal/src/core.js @@ -7,5 +7,5 @@ import * as core from './coreNamed'; export default core; -export { core }; +export {core}; export * from './coreNamed'; diff --git a/packages/metal/src/coreNamed.js b/packages/metal/src/coreNamed.js index 34e94919..d829da0c 100644 --- a/packages/metal/src/coreNamed.js +++ b/packages/metal/src/coreNamed.js @@ -19,7 +19,7 @@ let uniqueIdCounter_ = 1; * @type {String} * @protected */ -export const UID_PROPERTY = `core_${((Math.random() * 1e9) >>> 0)}`; +export const UID_PROPERTY = `core_${(Math.random() * 1e9) >>> 0}`; /** * When defining a class Foo with an abstract method bar(), you can do: @@ -50,7 +50,7 @@ export function disableCompatibilityMode() { * using "key" to keep working like before. NOTE: this may cause * problems, since "key" is meant to be used differently. Only use this * if it's not possible to upgrade the code to use "ref" instead. - * @param {Object=} opt_data Optional object with data to specify more + * @param {Object=} data Optional object with data to specify more * details, such as: * - renderers {Array} the template renderers that should be in * compatibility mode, either their constructors or strings @@ -58,8 +58,8 @@ export function disableCompatibilityMode() { * that extend from IncrementalDomRenderer. * @type {Object} */ -export function enableCompatibilityMode(opt_data = {}) { - compatibilityModeData_ = opt_data; +export function enableCompatibilityMode(data = {}) { + compatibilityModeData_ = data; } /** @@ -112,17 +112,24 @@ export function getFunctionName(fn) { * be recalculated even if this function is called multiple times. * @param {!function()} ctor Class constructor. * @param {string} propertyName Property name to be merged. - * @param {function(*, *):*=} opt_mergeFn Function that receives the merged + * @param {function(*, *):*=} mergeFn Function that receives the merged * value of the property so far and the next value to be merged to it. * Should return these two merged together. If not passed the final property * will be the first truthy value among ancestors. + * @return {Object} */ -export function getStaticProperty(ctor, propertyName, opt_mergeFn) { +export function getStaticProperty( + ctor, + propertyName, + mergeFn = getFirstTruthy_ +) { const mergedName = propertyName + '_MERGED'; if (!ctor.hasOwnProperty(mergedName)) { - let merged = ctor.hasOwnProperty(propertyName) ? ctor[propertyName] : null; + // eslint-disable-next-line + let merged = ctor.hasOwnProperty(propertyName) + ? ctor[propertyName] + : null; if (ctor.__proto__ && !ctor.__proto__.isPrototypeOf(Function)) { - const mergeFn = opt_mergeFn || getFirstTruthy_; merged = mergeFn( merged, getStaticProperty(ctor.__proto__, propertyName, mergeFn) @@ -134,34 +141,35 @@ export function getStaticProperty(ctor, propertyName, opt_mergeFn) { } /** - * Gets an unique id. If `opt_object` argument is passed, the object is + * Gets an unique id. If `object` argument is passed, the object is * mutated with an unique id. Consecutive calls with the same object * reference won't mutate the object again, instead the current object uid * returns. See {@link UID_PROPERTY}. - * @param {Object=} opt_object Optional object to be mutated with the uid. If + * @param {Object=} object Optional object to be mutated with the uid. If * not specified this method only returns the uid. - * @param {boolean=} opt_noInheritance Optional flag indicating if this + * @param {boolean=} noInheritance Optional flag indicating if this * object's uid property can be inherited from parents or not. * @throws {Error} when invoked to indicate the method should be overridden. + * @return {number} */ -export function getUid(opt_object, opt_noInheritance) { - if (opt_object) { - let id = opt_object[UID_PROPERTY]; - if (opt_noInheritance && !opt_object.hasOwnProperty(UID_PROPERTY)) { +export function getUid(object, noInheritance) { + if (object) { + let id = object[UID_PROPERTY]; + if (noInheritance && !object.hasOwnProperty(UID_PROPERTY)) { id = null; } - return id || (opt_object[UID_PROPERTY] = uniqueIdCounter_++); + return id || (object[UID_PROPERTY] = uniqueIdCounter_++); } return uniqueIdCounter_++; } /** * The identity function. Returns its first argument. - * @param {*=} opt_returnValue The single value that will be returned. + * @param {*=} returnValue The single value that will be returned. * @return {?} The first argument. */ -export function identityFunction(opt_returnValue) { - return opt_returnValue; +export function identityFunction(returnValue) { + return returnValue; } /** @@ -262,7 +270,7 @@ export function isWindow(val) { */ export function isObject(val) { const type = typeof val; - return type === 'object' && val !== null || type === 'function'; + return (type === 'object' && val !== null) || type === 'function'; } /** @@ -290,15 +298,16 @@ export function isString(val) { * @return {boolean} */ export function isServerSide() { - return typeof process !== 'undefined' && + return ( + typeof process !== 'undefined' && typeof process.env !== 'undefined' && process.env.NODE_ENV !== 'test' && - !process.browser; + !process.browser + ); } /** * Null function used for default values of callbacks, etc. * @return {void} Nothing. */ -export function nullFunction() { -} +export function nullFunction() {} diff --git a/packages/metal/src/disposable/Disposable.js b/packages/metal/src/disposable/Disposable.js index f8788bd2..d92ea2f6 100644 --- a/packages/metal/src/disposable/Disposable.js +++ b/packages/metal/src/disposable/Disposable.js @@ -8,6 +8,9 @@ * @constructor */ class Disposable { + /** + * Disposable constructor + */ constructor() { /** * Flag indicating if this instance has already been disposed. diff --git a/packages/metal/src/metal.js b/packages/metal/src/metal.js index 89ce955b..795af88f 100644 --- a/packages/metal/src/metal.js +++ b/packages/metal/src/metal.js @@ -8,5 +8,5 @@ import object from './object/object'; import string from './string/string'; export * from './core'; -export { array, async, Disposable, object, string }; +export {array, async, Disposable, object, string}; export default core; diff --git a/packages/metal/src/object/object.js b/packages/metal/src/object/object.js index 7ab47767..71ba8dc5 100644 --- a/packages/metal/src/object/object.js +++ b/packages/metal/src/object/object.js @@ -1,5 +1,8 @@ 'use strict'; +/** + * Set of utilities for object operations + */ class object { /** * Copies all the members of a source object to a target object. @@ -7,10 +10,14 @@ class object { * @param {...Object} var_args The objects from which values will be copied. * @return {Object} Returns the target object reference. */ - static mixin(target) { - let key, source; - for (let i = 1; i < arguments.length; i++) { - source = arguments[i]; + static mixin(target, ...args) { + let key; + let source; + for (let i = 0; i < args.length; i++) { + source = args[i]; + // Possible prototype chain leak, breaks 1 metal-dom and + // 1 metal-incremental-dom test if guard-for-in rule is addressed + // eslint-disable-next-line for (key in source) { target[key] = source[key]; } @@ -21,12 +28,11 @@ class object { /** * Returns an object based on its fully qualified external name. * @param {string} name The fully qualified name. - * @param {object=} opt_obj The object within which to look; default is + * @param {object=} scope The object within which to look; default is * window. * @return {?} The value (object or primitive) or, if not found, undefined. */ - static getObjectByName(name, opt_obj) { - const scope = opt_obj || window; + static getObjectByName(name, scope = window) { const parts = name.split('.'); return parts.reduce((part, key) => part[key], scope); } @@ -50,6 +56,8 @@ class object { /** * Checks if the two given objects are equal. This is done via a shallow * check, including only the keys directly contained by the 2 objects. + * @param {Object} obj1 + * @param {Object} obj2 * @return {boolean} */ static shallowEqual(obj1, obj2) { diff --git a/packages/metal/src/string/string.js b/packages/metal/src/string/string.js index 27c806ec..bf44dff1 100644 --- a/packages/metal/src/string/string.js +++ b/packages/metal/src/string/string.js @@ -1,5 +1,8 @@ 'use strict'; +/** + * Set of utilities for string operations + */ class string { /** * Compares the given strings without taking the case into account. @@ -29,29 +32,33 @@ class string { * @return {string} Copy of the string with normalized breaking spaces. */ static collapseBreakingSpaces(str) { - return str.replace(/[\t\r\n ]+/g, ' ').replace(/^[\t\r\n ]+|[\t\r\n ]+$/g, ''); + return str + .replace(/[\t\r\n ]+/g, ' ') + .replace(/^[\t\r\n ]+|[\t\r\n ]+$/g, ''); } /** - * Escapes characters in the string that are not safe to use in a RegExp. - * @param {*} str The string to escape. If not a string, it will be casted - * to one. - * @return {string} A RegExp safe, escaped copy of {@code s}. - */ + * Escapes characters in the string that are not safe to use in a RegExp. + * @param {*} str The string to escape. If not a string, it will be casted + * to one. + * @return {string} A RegExp safe, escaped copy of {@code s}. + */ static escapeRegex(str) { return String(str) - .replace(/([-()\[\]{}+?*.$\^|,:# a + b); + let prop = core.getStaticProperty(Test3, 'FOO', (a, b) => a + b); assert.equal(prop, 6); }); it('should not recalculate static property after set for the first time', function() { - class Test1 { - } + class Test1 {} Test1.FOO = 1; - class Test2 extends Test1 { - } + class Test2 extends Test1 {} Test2.FOO = 2; - class Test3 extends Test2 { - } + class Test3 extends Test2 {} Test3.FOO = 3; const mergeFn = sinon.stub().returns(1); - var prop = core.getStaticProperty(Test3, 'FOO', mergeFn); + let prop = core.getStaticProperty(Test3, 'FOO', mergeFn); assert.equal(2, mergeFn.callCount); assert.equal(prop, core.getStaticProperty(Test3, 'FOO', mergeFn)); @@ -105,8 +94,8 @@ describe('core', function() { it('should return the first arg passed to identity function', function() { assert.strictEqual(1, core.identityFunction(1)); - var obj = { - a: 2 + let obj = { + a: 2, }; assert.strictEqual(obj, core.identityFunction(obj)); }); @@ -154,9 +143,11 @@ describe('core', function() { assert.ok(!core.isPromise(null)); assert.ok(!core.isPromise(undefined)); - assert.ok(core.isPromise({ - then: core.nullFunction - })); + assert.ok( + core.isPromise({ + then: core.nullFunction, + }) + ); }); it('should check if var is string', function() { @@ -187,27 +178,33 @@ describe('core', function() { }); it('should check if var is element', function() { - assert.ok(core.isElement({ - nodeType: 1 - })); + assert.ok( + core.isElement({ + nodeType: 1, + }) + ); assert.ok(!core.isElement({})); assert.ok(!core.isElement(null)); assert.ok(!core.isElement(true)); }); it('should check if var is document', function() { - assert.ok(core.isDocument({ - nodeType: 9 - })); - assert.ok(!core.isDocument({ - nodeType: 1 - })); + assert.ok( + core.isDocument({ + nodeType: 9, + }) + ); + assert.ok( + !core.isDocument({ + nodeType: 1, + }) + ); assert.ok(!core.isDocument({})); assert.ok(!core.isDocument(null)); assert.ok(!core.isDocument(true)); }); - it('should check if var is document fragment', function () { + it('should check if var is document fragment', function() { assert.ok(!core.isDocumentFragment(null)); assert.ok(!core.isDocumentFragment({nodeType: 0})); assert.ok(!core.isDocumentFragment({nodeType: 9})); @@ -220,12 +217,16 @@ describe('core', function() { return; } - assert.ok(!core.isWindow({ - nodeType: 9 - })); - assert.ok(!core.isWindow({ - nodeType: 1 - })); + assert.ok( + !core.isWindow({ + nodeType: 9, + }) + ); + assert.ok( + !core.isWindow({ + nodeType: 1, + }) + ); assert.ok(core.isWindow(window)); assert.ok(!core.isWindow(null)); assert.ok(!core.isWindow(true)); @@ -264,8 +265,7 @@ describe('core', function() { describe('getFunctionName', function() { it('should return the name of the given function', function() { - function myFunction() { - } + function myFunction() {} assert.strictEqual('myFunction', core.getFunctionName(myFunction)); }); }); diff --git a/packages/metal/test/disposable/Disposable.js b/packages/metal/test/disposable/Disposable.js index b4517d5a..8c98b61e 100644 --- a/packages/metal/test/disposable/Disposable.js +++ b/packages/metal/test/disposable/Disposable.js @@ -4,7 +4,7 @@ import Disposable from '../../src/disposable/Disposable'; describe('Disposable', function() { it('should correctly inform if the instance has been disposed', function() { - var disposable = new Disposable(); + let disposable = new Disposable(); assert.ok(!disposable.isDisposed()); @@ -13,28 +13,25 @@ describe('Disposable', function() { }); it('should call `disposeInternal` when running `dispose`', function() { - class TestDisposable extends Disposable { - } + class TestDisposable extends Disposable {} TestDisposable.prototype.disposeInternal = sinon.stub(); - var testDisposable = new TestDisposable(); + let testDisposable = new TestDisposable(); testDisposable.dispose(); assert.strictEqual(1, testDisposable.disposeInternal.callCount); }); it('should not dispose more than once', function() { - class TestDisposable extends Disposable { - } + class TestDisposable extends Disposable {} TestDisposable.prototype.disposeInternal = sinon.stub(); - var testDisposable = new TestDisposable(); + let testDisposable = new TestDisposable(); testDisposable.dispose(); testDisposable.dispose(); assert.strictEqual(1, testDisposable.disposeInternal.callCount); - }); }); diff --git a/packages/metal/test/object/object.js b/packages/metal/test/object/object.js index 9db26d8b..3a6468f7 100644 --- a/packages/metal/test/object/object.js +++ b/packages/metal/test/object/object.js @@ -4,15 +4,21 @@ import object from '../../src/object/object'; describe('object', function() { it('should mixin object arguments', function() { - var original = {}; + let original = {}; - var mixin = object.mixin(original, { - a: 1 - }, { - b: 1 - }, { - b: 2 - }, null); + let mixin = object.mixin( + original, + { + a: 1, + }, + { + b: 1, + }, + { + b: 2, + }, + null + ); assert.strictEqual(original, mixin); assert.strictEqual(1, mixin.a); @@ -21,9 +27,9 @@ describe('object', function() { }); it('should mixin array arguments', function() { - var original = []; + let original = []; - var mixin = object.mixin(original, [null, 2, 3], [1]); + let mixin = object.mixin(original, [null, 2, 3], [1]); assert.strictEqual(original, mixin); assert.deepEqual([1, 2, 3], mixin); @@ -35,52 +41,52 @@ describe('object', function() { return; } window.Foo = { - Bar: 1 + Bar: 1, }; assert.strictEqual(1, object.getObjectByName('Foo.Bar')); assert.strictEqual(undefined, object.getObjectByName('Foo.Bar.None')); }); it('should get object by name from object', function() { - var obj = { + let obj = { Foo: { - Bar: 1 - } + Bar: 1, + }, }; assert.strictEqual(1, object.getObjectByName('Foo.Bar', obj)); assert.strictEqual(undefined, object.getObjectByName('Foo.Bar.None', obj)); }); it('should map an object\'s content to a new object', function() { - var obj = { + let obj = { a: 1, - b: 2 + b: 2, }; - var mappedObj = object.map(obj, (key, value) => key + ':' + value); - var expectedObj = { + let mappedObj = object.map(obj, (key, value) => key + ':' + value); + let expectedObj = { a: 'a:1', - b: 'b:2' + b: 'b:2', }; assert.deepEqual(expectedObj, mappedObj); }); it('should check if two objects are shallowly equal', function() { - var obj1 = {}; + let obj1 = {}; assert.ok(object.shallowEqual(obj1, obj1)); - var obj2 = { - a: 1 + let obj2 = { + a: 1, }; assert.ok(!object.shallowEqual(obj1, obj2)); - var obj3 = { - a: 1 + let obj3 = { + a: 1, }; assert.ok(!object.shallowEqual(obj1, obj3)); assert.ok(object.shallowEqual(obj2, obj3)); - var obj4 = { - a: 2 + let obj4 = { + a: 2, }; assert.ok(!object.shallowEqual(obj1, obj4)); assert.ok(!object.shallowEqual(obj2, obj4)); diff --git a/packages/metal/test/string/string.js b/packages/metal/test/string/string.js index e27a4921..4309384c 100644 --- a/packages/metal/test/string/string.js +++ b/packages/metal/test/string/string.js @@ -15,7 +15,10 @@ describe('string', function() { }); it('should collapse breaking spaces', function() { - assert.strictEqual('foo bar', string.collapseBreakingSpaces(' foo bar ')); + assert.strictEqual( + 'foo bar', + string.collapseBreakingSpaces(' foo bar ') + ); }); it('should generate random strings', function() { @@ -27,8 +30,8 @@ describe('string', function() { }); it('should escape regex', function() { - var spec = '()[]{}+-?*.$^|,:#