From 23423eca1298031408e4b2bdff798a07011bf3ba Mon Sep 17 00:00:00 2001 From: Marco Pasqualetti Date: Wed, 6 May 2020 17:56:33 +0200 Subject: [PATCH 01/47] fix indentation on gobblefile.js --- gobblefile.js | 323 +++++++++++++++++++++++++++----------------------- 1 file changed, 174 insertions(+), 149 deletions(-) diff --git a/gobblefile.js b/gobblefile.js index 93b6926087..288bb19118 100755 --- a/gobblefile.js +++ b/gobblefile.js @@ -28,13 +28,13 @@ const banner = `/* * @warning keep aliases aligned with jsconfig.json */ const ractiveAliases = rollupAlias({ - resolve: ['.js'], + resolve: ['.js'], - src: path.resolve('./src'), - config: path.resolve('./src/config'), - parse: path.resolve('./src/parse'), - shared: path.resolve('./src/shared'), - utils: path.resolve('./src/utils'), + src: path.resolve('./src'), + config: path.resolve('./src/config'), + parse: path.resolve('./src/parse'), + shared: path.resolve('./src/shared'), + utils: path.resolve('./src/utils') }); const ractiveRollupPlugins = [ractiveAliases]; @@ -54,47 +54,54 @@ const lib = gobble('lib').moveTo('lib'); const manifest = gobble('manifests').transform(replacePlaceholders); const sandbox = gobble('sandbox'); -module.exports = ({ - 'dev:browser'() { - const lib = buildUmdLib('ractive.js', ractiveRollupPlugins); - const tests = buildBrowserTests(); - return gobble([lib, tests, sandbox, qunit]); - }, - 'bundle:test'() { - const lib = buildUmdLib('ractive.js', ractiveRollupPlugins.concat( - ractiveAliases, - istanbul({ - exclude: [ - 'src/polyfills/*.js' - ] - }) - )); - const browserTests = buildBrowserTests(); - const nodeTests = buildNodeTests(); - return gobble([lib, qunit, browserTests, nodeTests]); - }, - 'bundle:release'() { - const runtimeModulesToIgnore = ['parse/_parse.js']; - - const esRegular = buildESLib('ractive.mjs', ractiveRollupPlugins); - const esRuntime = buildESLib('runtime.mjs', ractiveRollupPlugins.concat(skipModule(runtimeModulesToIgnore))); - - const umdRegular = buildUmdLib('ractive.js', ractiveRollupPlugins); - const umdRuntime = buildUmdLib('runtime.js', ractiveRollupPlugins.concat(skipModule(runtimeModulesToIgnore))); - - const libEs = gobble([esRegular, esRuntime]); - const libUmd = gobble([umdRegular, umdRuntime]); - const libUmdMin = libUmd.transform('uglifyjs', { ext: '.min.js', preamble: banner }); - - return gobble([libEs, libUmd, libUmdMin, bin, lib, typings, manifest]); - }, - 'bundle:dev'() { - const libEs = buildESLib('ractive.mjs', ractiveRollupPlugins); - const libUmd = buildUmdLib('ractive.js', ractiveRollupPlugins); - - return gobble([libEs, libUmd, bin, lib, typings, manifest]); - } -})[gobble.env()](); +module.exports = { + 'dev:browser'() { + const lib = buildUmdLib('ractive.js', ractiveRollupPlugins); + const tests = buildBrowserTests(); + return gobble([lib, tests, sandbox, qunit]); + }, + 'bundle:test'() { + const lib = buildUmdLib( + 'ractive.js', + ractiveRollupPlugins.concat( + ractiveAliases, + istanbul({ + exclude: ['src/polyfills/*.js'] + }) + ) + ); + const browserTests = buildBrowserTests(); + const nodeTests = buildNodeTests(); + return gobble([lib, qunit, browserTests, nodeTests]); + }, + 'bundle:release'() { + const runtimeModulesToIgnore = ['parse/_parse.js']; + + const esRegular = buildESLib('ractive.mjs', ractiveRollupPlugins); + const esRuntime = buildESLib( + 'runtime.mjs', + ractiveRollupPlugins.concat(skipModule(runtimeModulesToIgnore)) + ); + + const umdRegular = buildUmdLib('ractive.js', ractiveRollupPlugins); + const umdRuntime = buildUmdLib( + 'runtime.js', + ractiveRollupPlugins.concat(skipModule(runtimeModulesToIgnore)) + ); + + const libEs = gobble([esRegular, esRuntime]); + const libUmd = gobble([umdRegular, umdRuntime]); + const libUmdMin = libUmd.transform('uglifyjs', { ext: '.min.js', preamble: banner }); + + return gobble([libEs, libUmd, libUmdMin, bin, lib, typings, manifest]); + }, + 'bundle:dev'() { + const libEs = buildESLib('ractive.mjs', ractiveRollupPlugins); + const libUmd = buildUmdLib('ractive.js', ractiveRollupPlugins); + + return gobble([libEs, libUmd, bin, lib, typings, manifest]); + } +}[gobble.env()](); //////////////////////////////////////////////////////////////////////////////// @@ -102,98 +109,103 @@ module.exports = ({ // Builds a UMD bundle of Ractive function buildUmdLib(dest, plugins = []) { - return src.transform(rollup, { - plugins: plugins, - input: 'Ractive.js', - output: { - name: 'Ractive', - format: 'umd', - file: dest, - sourcemap: true, - banner: banner, - noConflict: true - }, - cache: false - }).transform(transpile, { accept: ['.js'] }).transform(replacePlaceholders); + return src + .transform(rollup, { + plugins: plugins, + input: 'Ractive.js', + output: { + name: 'Ractive', + format: 'umd', + file: dest, + sourcemap: true, + banner: banner, + noConflict: true + }, + cache: false + }) + .transform(transpile, { accept: ['.js'] }) + .transform(replacePlaceholders); } // Builds an ES bundle of Ractive function buildESLib(dest, plugins = []) { - return src.transform(rollup, { - plugins: plugins, - input: 'Ractive.js', - output: { - format: 'es', - file: dest, - sourcemap: true, - banner: banner - }, - cache: false - }).transform(transpile, { accept: ['.js', '.mjs'] }).transform(replacePlaceholders); + return src + .transform(rollup, { + plugins: plugins, + input: 'Ractive.js', + output: { + format: 'es', + file: dest, + sourcemap: true, + banner: banner + }, + cache: false + }) + .transform(transpile, { accept: ['.js', '.mjs'] }) + .transform(replacePlaceholders); } // Builds a UMD bundle for browser/PhantomJS tests. function buildBrowserTests() { - return gobble([ - browserTests, - browserTests.transform(buildTestEntryPoint, { dir: 'browser' }) - ]) - .transform(copy) - .transform(rollup, { - input: 'index.js', - output: { - name: 'RactiveBrowserTests', - format: 'iife', - file: 'tests-browser.js', - globals: { - qunit: 'QUnit', - simulant: 'simulant' - }, - sourcemap: true - }, - external: ['qunit', 'simulant'], - cache: false - }); + return gobble([browserTests, browserTests.transform(buildTestEntryPoint, { dir: 'browser' })]) + .transform(copy) + .transform(rollup, { + input: 'index.js', + output: { + name: 'RactiveBrowserTests', + format: 'iife', + file: 'tests-browser.js', + globals: { + qunit: 'QUnit', + simulant: 'simulant' + }, + sourcemap: true + }, + external: ['qunit', 'simulant'], + cache: false + }); } // Builds a CJS bundle for node tests. function buildNodeTests() { - return gobble([ - nodeTests, - nodeTests.transform(buildTestEntryPoint, { dir: 'node' }) - ]) - .transform(copy) - .transform(rollup, { - input: 'index.js', - output: { - format: 'cjs', - file: 'tests-node.js', - sourcemap: true - }, - external: ['cheerio'], - cache: false - }); + return gobble([nodeTests, nodeTests.transform(buildTestEntryPoint, { dir: 'node' })]) + .transform(copy) + .transform(rollup, { + input: 'index.js', + output: { + format: 'cjs', + file: 'tests-node.js', + sourcemap: true + }, + external: ['cheerio'], + cache: false + }); } /* Rollup plugins */ // Replaces a modules content with a null export to omit module contents. function skipModule(excludedModules) { - return { - name: 'skipModule', - transform: function (src, modulePath) { - const moduleRelativePath = path.relative(path.join(__dirname, 'src'), modulePath).split(path.sep).join('/'); - const isModuleExcluded = excludedModules.indexOf(moduleRelativePath) > -1; - - const source = new MagicString(src); - const sourceLength = src.length; - - const transformCode = isModuleExcluded ? source.overwrite(0, sourceLength, 'export default null;'): source; - const transformMap = transformCode.generateMap({ hires: true }); - - return { code: transformCode.toString(), map: transformMap.toString() }; - } - }; + return { + name: 'skipModule', + transform: function(src, modulePath) { + const moduleRelativePath = path + .relative(path.join(__dirname, 'src'), modulePath) + .split(path.sep) + .join('/'); + const isModuleExcluded = excludedModules.indexOf(moduleRelativePath) > -1; + + const source = new MagicString(src); + const sourceLength = src.length; + + const transformCode = isModuleExcluded + ? source.overwrite(0, sourceLength, 'export default null;') + : source; + const transformMap = transformCode.generateMap({ hires: true }); + + return { code: transformCode.toString(), map: transformMap.toString() }; + } + }; } /* Gobble transforms */ @@ -201,51 +213,64 @@ function skipModule(excludedModules) { // Essentially gobble-buble but takes out the middleman. // eslint-disable-next-line no-unused-vars function transpile(src, options) { - return buble.transform(src, { - target: { ie: 9 }, - transforms: { modules: false } - }); + return buble.transform(src, { + target: { ie: 9 }, + transforms: { modules: false } + }); } // Builds an entrypoint in the designated directory that imports all test specs // and calls them one after the other in tree-listing order. function buildTestEntryPoint(inDir, outDir, options) { - const _options = Object.assign({ dir: '' }, options); - const testPaths = fsPlus.listTreeSync(path.join(inDir, _options.dir)).filter(testPath => fsPlus.isFileSync(testPath) && path.extname(testPath) === '.js'); - const testImports = testPaths.map((testPath, index) => `import test${index} from './${path.relative(inDir, testPath).replace(/\\/g, '/')}';`).join('\n'); - const testCalls = testPaths.map((testPath, index) => `test${index}();`).join('\n'); - fs.writeFileSync(path.join(outDir, 'index.js'), `${testImports}\n${testCalls}`, 'utf8'); - return Promise.resolve(); + const _options = Object.assign({ dir: '' }, options); + const testPaths = fsPlus + .listTreeSync(path.join(inDir, _options.dir)) + .filter(testPath => fsPlus.isFileSync(testPath) && path.extname(testPath) === '.js'); + const testImports = testPaths + .map( + (testPath, index) => + `import test${index} from './${path.relative(inDir, testPath).replace(/\\/g, '/')}';` + ) + .join('\n'); + const testCalls = testPaths.map((testPath, index) => `test${index}();`).join('\n'); + fs.writeFileSync(path.join(outDir, 'index.js'), `${testImports}\n${testCalls}`, 'utf8'); + return Promise.resolve(); } // Looks for placeholders in the code and replaces them. // eslint-disable-next-line no-unused-vars function replacePlaceholders(src, options) { - return Object.keys(placeholders).reduce((out, placeholder) => { - return out.replace(new RegExp(`${placeholder}`, 'g'), placeholders[placeholder]); - }, src); + return Object.keys(placeholders).reduce((out, placeholder) => { + return out.replace(new RegExp(`${placeholder}`, 'g'), placeholders[placeholder]); + }, src); } // This is because Gobble's grab and Rollup's resolution is broken // https://github.com/gobblejs/gobble/issues/89 // https://github.com/rollup/rollup/issues/1291 function copy(inputdir, outputdir, options) { - const _options = Object.assign({ dir: '.' }, options); - fsPlus.copySync(path.join(inputdir, _options.dir), outputdir); - return Promise.resolve(); + const _options = Object.assign({ dir: '.' }, options); + fsPlus.copySync(path.join(inputdir, _options.dir), outputdir); + return Promise.resolve(); } function rollup(indir, outdir, options) { - if (!options.input) throw new Error('You must supply `options.input`'); - if (!options.output || !options.output.file) throw new Error('You must supply `options.output.file`'); - - const inputOptions = Object.assign({}, options, { output: undefined, input: path.join(indir, options.input) }); - const outputOptions = Object.assign({}, options.output, { file: path.join(outdir, options.output.file) }); - - inputOptions.onwarn = function(msg, warn) { - if (msg.code === 'CIRCULAR_DEPENDENCY') return; - warn(msg); - }; - - return rollupLib.rollup(inputOptions).then(bundle => bundle.write(outputOptions)); + if (!options.input) throw new Error('You must supply `options.input`'); + if (!options.output || !options.output.file) + throw new Error('You must supply `options.output.file`'); + + const inputOptions = Object.assign({}, options, { + output: undefined, + input: path.join(indir, options.input) + }); + const outputOptions = Object.assign({}, options.output, { + file: path.join(outdir, options.output.file) + }); + + inputOptions.onwarn = function(msg, warn) { + if (msg.code === 'CIRCULAR_DEPENDENCY') return; + warn(msg); + }; + + return rollupLib.rollup(inputOptions).then(bundle => bundle.write(outputOptions)); } From d6f904380c4fff531cdeb3e719e3961a2d402737 Mon Sep 17 00:00:00 2001 From: Marco Pasqualetti Date: Wed, 6 May 2020 20:16:46 +0200 Subject: [PATCH 02/47] add npmrc with save-dev=true --- .npmrc | 1 + 1 file changed, 1 insertion(+) create mode 100644 .npmrc diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000000..4b00b9dde1 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +save-dev=true From 85fb673e4f322f10f0350a24648e209d34f9c64b Mon Sep 17 00:00:00 2001 From: Marco Pasqualetti Date: Wed, 6 May 2020 20:21:15 +0200 Subject: [PATCH 03/47] add typescript - rewrite utils/cleanCss in ts for test purpose --- .editorconfig | 6 +- .vscode/extensions.json | 6 + .vscode/settings.json | 5 +- gobblefile.js | 20 +--- package-lock.json | 240 ++++++++++++++++++++++++++-------------- package.json | 6 +- src/utils/cleanCss.js | 18 --- src/utils/cleanCss.ts | 30 +++++ tsconfig.json | 19 ++++ 9 files changed, 222 insertions(+), 128 deletions(-) create mode 100644 .vscode/extensions.json delete mode 100644 src/utils/cleanCss.js create mode 100644 src/utils/cleanCss.ts create mode 100644 tsconfig.json diff --git a/.editorconfig b/.editorconfig index 5149edd2aa..19f37b6c7c 100644 --- a/.editorconfig +++ b/.editorconfig @@ -6,14 +6,10 @@ end_of_line = lf insert_final_newline = true trim_trailing_whitespace = true -[*.js] +[*.{js,ts}] indent_style = space indent_size = 2 [*.md] indent_style = space indent_size = 4 - -[*.ts] -indent_style = space -indent_size = 4 diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000000..ca3f38f20b --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,6 @@ +{ + "recommendations": [ + "editorconfig.editorconfig", + "ms-vscode.vscode-typescript-tslint-plugin" + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json index 4a858004ec..e66b171daf 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -14,5 +14,6 @@ "statusBarItem.hoverBackground": "#00919b", "statusBar.foreground": "#15202b" }, - "peacock.color": "#00c1ce" -} \ No newline at end of file + "peacock.color": "#00c1ce", + "typescript.tsdk": "node_modules/typescript/lib" +} diff --git a/gobblefile.js b/gobblefile.js index 288bb19118..1211392a44 100755 --- a/gobblefile.js +++ b/gobblefile.js @@ -7,7 +7,7 @@ const fsPlus = require('fs-plus'); const gobble = require('gobble'); const buble = require('@evs-chris/buble'); const rollupLib = require('rollup'); -const rollupAlias = require('rollup-plugin-alias'); +const rollupTypescript = require('@rollup/plugin-typescript'); const istanbul = require('rollup-plugin-istanbul'); const MagicString = require('magic-string'); @@ -22,22 +22,7 @@ const banner = `/* License: MIT */`; -/** - * Ractive aliases - * - * @warning keep aliases aligned with jsconfig.json - */ -const ractiveAliases = rollupAlias({ - resolve: ['.js'], - - src: path.resolve('./src'), - config: path.resolve('./src/config'), - parse: path.resolve('./src/parse'), - shared: path.resolve('./src/shared'), - utils: path.resolve('./src/utils') -}); - -const ractiveRollupPlugins = [ractiveAliases]; +const ractiveRollupPlugins = [rollupTypescript()]; const placeholders = { BUILD_PLACEHOLDER_VERSION: version }; @@ -64,7 +49,6 @@ module.exports = { const lib = buildUmdLib( 'ractive.js', ractiveRollupPlugins.concat( - ractiveAliases, istanbul({ exclude: ['src/polyfills/*.js'] }) diff --git a/package-lock.json b/package-lock.json index c1ed450469..5877c7d888 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,7 +7,7 @@ "@evs-chris/buble": { "version": "0.15.2", "resolved": "https://registry.npmjs.org/@evs-chris/buble/-/buble-0.15.2.tgz", - "integrity": "sha1-zss9+7kugFSGZRmZgpXXGQErNtQ=", + "integrity": "sha512-wlf43iwfrodZh1dIK7992A2Uy4jPH+y/ohj8TYnp01tCedDrZk1s7Hpd/ae+oTPGpSInds1GIzvP0foJf5iCUA==", "dev": true, "requires": { "acorn": "^3.3.0", @@ -30,6 +30,58 @@ } } }, + "@rollup/plugin-typescript": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-3.1.1.tgz", + "integrity": "sha512-VPY1MbzIJT+obpav9Kns4MlipVJ1FuefwzO4s1uCVXAzVWya+bhhNauOmmqR/hy1zj7tePfh3t9iBN+HbIzyRA==", + "dev": true, + "requires": { + "@rollup/pluginutils": "^3.0.1", + "resolve": "^1.14.1" + }, + "dependencies": { + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + } + } + }, + "@rollup/pluginutils": { + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.0.10.tgz", + "integrity": "sha512-d44M7t+PjmMrASHbhgpSbVgtL6EFyX7J4mYxwQ/c5eoaE6N2VgCgEcWVzNnwycIloti+/MpwFr8qfw+nRw00sw==", + "dev": true, + "requires": { + "@types/estree": "0.0.39", + "estree-walker": "^1.0.1", + "picomatch": "^2.2.2" + }, + "dependencies": { + "estree-walker": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz", + "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==", + "dev": true + } + } + }, + "@types/estree": { + "version": "0.0.39", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", + "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", + "dev": true + }, "@types/node": { "version": "12.0.8", "resolved": "https://registry.npmjs.org/@types/node/-/node-12.0.8.tgz", @@ -159,7 +211,7 @@ "anymatch": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", - "integrity": "sha1-VT3Lj5HjyImEXf26NMd3IbkLnXo=", + "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", "dev": true, "requires": { "micromatch": "^2.1.5", @@ -201,7 +253,7 @@ "arr-flatten": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha1-NgSLv/TntH4TZkQxbJlmnqWukfE=", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", "dev": true }, "arr-union": { @@ -252,7 +304,7 @@ "arraybuffer.slice": { "version": "0.0.7", "resolved": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz", - "integrity": "sha1-O7xCdd1YTMGxCAm4nU6LY6aednU=", + "integrity": "sha512-wGUIVQXuehL5TCqQun8OW81jGzAWycqzFF8lFp+GOM5BXLYj3bKNsYC4daB7n6XjCqxQA/qgTJ+8ANR3acjrog==", "dev": true }, "arrify": { @@ -294,7 +346,7 @@ "async-limiter": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", - "integrity": "sha1-ePrtjD0HSrgfIrTphdeehzj3IPg=", + "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==", "dev": true }, "asynckit": { @@ -329,7 +381,7 @@ "babel-generator": { "version": "6.26.1", "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz", - "integrity": "sha1-GERAjTuPDTWkBOp6wYDwh6YBvZA=", + "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", "dev": true, "requires": { "babel-messages": "^6.23.0", @@ -394,7 +446,7 @@ "globals": { "version": "9.18.0", "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", - "integrity": "sha1-qjiWs+abSH8X4x7SFD1pqOMMLYo=", + "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", "dev": true } } @@ -414,7 +466,7 @@ "babylon": { "version": "6.18.0", "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", - "integrity": "sha1-ry87iPpvXB5MY00aD46sT1WzleM=", + "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", "dev": true }, "backo2": { @@ -823,7 +875,7 @@ "circular-json": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", - "integrity": "sha1-gVyZ6oT2gJUp0vRXkb34JxE1LWY=", + "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", "dev": true }, "class-utils": { @@ -1005,7 +1057,7 @@ "content-type": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", - "integrity": "sha1-4TjMdeBAxyexlm/l5fjJruJW/js=", + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==", "dev": true }, "convert-source-map": { @@ -1152,7 +1204,7 @@ "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "requires": { "ms": "2.0.0" @@ -1295,7 +1347,7 @@ "doctrine": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", - "integrity": "sha1-XNAfwQFiG0LEzX9dGmYkNxbT850=", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", "dev": true, "requires": { "esutils": "^2.0.2" @@ -1542,7 +1594,7 @@ "es6-promise": { "version": "4.2.4", "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.4.tgz", - "integrity": "sha1-3EIhwrFlGHYL2MOaUtjzVvwA7Sk=", + "integrity": "sha512-/NdNZVJg+uZgtm9eS3O6lrOLYmQag2DjdEXuPaHlZ6RuVqgqaVZfgYCepEIKsLqwdQArOPtC3XzRLqGGfT8KQQ==", "dev": true }, "es6-promisify": { @@ -1658,7 +1710,7 @@ "ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha1-QfuyAkPlCxK+DwS43tvwdSDOhB0=", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "^1.9.0" @@ -1678,7 +1730,7 @@ "debug": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha1-W7WgZyYotkFJVmuhaBnmFRjGcmE=", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", "dev": true, "requires": { "ms": "2.0.0" @@ -1742,13 +1794,13 @@ "eslint-visitor-keys": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", - "integrity": "sha1-PzGA+y4pEBdxastMnW1bXDSmqB0=", + "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==", "dev": true }, "espree": { "version": "3.5.4", "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz", - "integrity": "sha1-sPRHGHyKi+2US4FaZgvd9d610ac=", + "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==", "dev": true, "requires": { "acorn": "^5.5.0", @@ -1781,7 +1833,7 @@ "esrecurse": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", - "integrity": "sha1-AHo7n9vCs7uH5IeeoZyS/b05Qs8=", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", "dev": true, "requires": { "estraverse": "^4.1.0" @@ -2304,7 +2356,8 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -2325,12 +2378,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -2345,17 +2400,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -2472,7 +2530,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -2484,6 +2543,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -2498,6 +2558,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -2505,12 +2566,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.3.5", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -2529,6 +2592,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -2609,7 +2673,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -2621,6 +2686,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -2706,7 +2772,8 @@ "safe-buffer": { "version": "5.1.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -2742,6 +2809,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -2761,6 +2829,7 @@ "version": "3.0.1", "bundled": true, "dev": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -2804,12 +2873,14 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "yallist": { "version": "3.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true } } }, @@ -2843,7 +2914,7 @@ "glob": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha1-wZyd+aAocC1nhhI4SmVSQExjbRU=", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -3389,7 +3460,7 @@ "inquirer": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz", - "integrity": "sha1-ndLyrXZdyrH/BEO0kUQqILoifck=", + "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==", "dev": true, "requires": { "ansi-escapes": "^3.0.0", @@ -3417,7 +3488,7 @@ "ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha1-QfuyAkPlCxK+DwS43tvwdSDOhB0=", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "^1.9.0" @@ -3443,7 +3514,7 @@ "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha1-q5Pyeo3BPSjKyBXEYhQ6bZASrp4=", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "dev": true, "requires": { "is-fullwidth-code-point": "^2.0.0", @@ -3479,7 +3550,7 @@ "invariant": { "version": "2.2.4", "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", - "integrity": "sha1-YQ88ksk1nOHbYW5TgAjSP/NRWOY=", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", "dev": true, "requires": { "loose-envify": "^1.0.0" @@ -3659,7 +3730,7 @@ "is-path-in-cwd": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz", - "integrity": "sha1-WsSLNF72dTOb1sekipEhELJBz1I=", + "integrity": "sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ==", "dev": true, "requires": { "is-path-inside": "^1.0.0" @@ -3677,7 +3748,7 @@ "is-plain-object": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha1-LBY7P6+xtgbZ0Xko8FwqHDjgdnc=", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", "dev": true, "requires": { "isobject": "^3.0.1" @@ -3721,7 +3792,7 @@ "is-resolvable": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", - "integrity": "sha1-+xj4fOH+uSUWnJpAfBkxijIG7Yg=", + "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", "dev": true }, "is-typedarray": { @@ -3899,7 +3970,7 @@ "jest-docblock": { "version": "21.2.0", "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-21.2.0.tgz", - "integrity": "sha1-UVKcOzDV/RWdpgwnzu3Blfr41BQ=", + "integrity": "sha512-5IZ7sY9dBAYSV+YjQ0Ovb540Ku7AO9Z5o2Cg789xj167iQuZ2cG+z0f3Uct6WeYLbU6aQiM2pCs7sZ+4dotydw==", "dev": true }, "js-reporters": { @@ -4494,7 +4565,7 @@ "karma-chrome-launcher": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/karma-chrome-launcher/-/karma-chrome-launcher-2.2.0.tgz", - "integrity": "sha1-zxudBxNswY/iOTJ9JGVMPbw2is8=", + "integrity": "sha512-uf/ZVpAabDBPvdPdveyk1EPgbnloPvFFGgmRhYLTDH7gEB4nZdSBk8yTU47w1g/drLSx5uMOkjKk7IWKfWg/+w==", "dev": true, "requires": { "fs-access": "^1.0.0", @@ -4570,7 +4641,7 @@ "karma-sauce-launcher": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/karma-sauce-launcher/-/karma-sauce-launcher-1.2.0.tgz", - "integrity": "sha1-byVY3e889Wh5+idUDIrp+L/Ra8o=", + "integrity": "sha512-lEhtGRGS+3Yw6JSx/vJY9iQyHNtTjcojrSwNzqNUOaDceKDu9dPZqA/kr69bUO9G2T6GKbu8AZgXqy94qo31Jg==", "dev": true, "requires": { "q": "^1.5.0", @@ -5029,7 +5100,7 @@ "log-driver": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.7.tgz", - "integrity": "sha1-Y7lQIfBwL+36LJuwok53l9cYcdg=", + "integrity": "sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg==", "dev": true }, "log4js": { @@ -5141,7 +5212,7 @@ "matcher-collection": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/matcher-collection/-/matcher-collection-1.0.5.tgz", - "integrity": "sha1-LuCVQ4Nyy4iE8FgjQTjAXGROwzk=", + "integrity": "sha512-nUCmzKipcJEwYsBVAFh5P+d7JBuhJaW1xs85Hara9xuMLqtCVUrW6DSC0JVIkluxEH2W45nPBM/wjHtBXa/tYA==", "dev": true, "requires": { "minimatch": "^3.0.2" @@ -5222,13 +5293,13 @@ "mimic-fn": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha1-ggyGo5M0ZA6ZUWkovQP8qIBX0CI=", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", "dev": true }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { "brace-expansion": "^1.1.7" @@ -5399,7 +5470,7 @@ "normalize-package-data": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "integrity": "sha1-EvlaMH1YNSB1oEkHuErIvpisAS8=", + "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", "dev": true, "requires": { "hosted-git-info": "^2.1.4", @@ -5705,7 +5776,7 @@ "parse5": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/parse5/-/parse5-3.0.3.tgz", - "integrity": "sha1-BC95L/3TaFFVHPTp4Gazh0q0W1w=", + "integrity": "sha512-rgO9Zg5LLLkfJF9E6CCmXlSE4UVceloys8JrFqCcHloC3usd/kJCyPDwH2SOlzix2j3xaP9sUX3e8+kvkuleAA==", "dev": true, "requires": { "@types/node": "*" @@ -5812,6 +5883,12 @@ "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", "dev": true }, + "picomatch": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "dev": true + }, "pify": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", @@ -5842,7 +5919,7 @@ "pluralize": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", - "integrity": "sha1-KYuJ34uTsCIdv0Ia0rGx6iP8Z3c=", + "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", "dev": true }, "posix-character-classes": { @@ -6011,7 +6088,7 @@ "qjobs": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/qjobs/-/qjobs-1.2.0.tgz", - "integrity": "sha1-xF6cYYAL0IfviNfiVkI73Unl0HE=", + "integrity": "sha512-8YOJEHtxpySA3fFDyCRxA+UUV+fA+rTWnuWvylOK/NCjhY+b4ocCtmu8TtsWb+mYeU+GCHf/S66KZF/AsteKHg==", "dev": true }, "qs": { @@ -6023,7 +6100,7 @@ "qunitjs": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/qunitjs/-/qunitjs-2.4.1.tgz", - "integrity": "sha1-iKugVani7D2+v6rQJHGyywAsUws=", + "integrity": "sha512-by/2zYvsNdS6Q6Ev6UJ3qJK+OYVlTzWlQ4afaeYMhVh1dd2K3N1ZZKCrCm3WSWPnz5ELMT8WyJRcVy5PXT2y+Q==", "dev": true, "requires": { "chokidar": "1.6.1", @@ -6194,13 +6271,13 @@ "regenerator-runtime": { "version": "0.11.1", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", - "integrity": "sha1-vgWtf5v30i4Fb5cmzuUBf78Z4uk=", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", "dev": true }, "regex-cache": { "version": "0.4.4", "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", - "integrity": "sha1-db3FiioUls7EihKDW8VMjVYjNt0=", + "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", "dev": true, "requires": { "is-equal-shallow": "^0.1.3" @@ -6452,7 +6529,7 @@ "rimraf": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "integrity": "sha1-LtgVDSShbqhlHm1u8PR8QVjOejY=", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", "dev": true, "requires": { "glob": "^7.0.5" @@ -6461,22 +6538,13 @@ "rollup": { "version": "0.55.5", "resolved": "https://registry.npmjs.org/rollup/-/rollup-0.55.5.tgz", - "integrity": "sha1-L4jDAPfPJLXsLcqKarpzsE4IfpM=", + "integrity": "sha512-2hke9NOy332kxvnmMQOgl7DHm94zihNyYJNd8ZLWo4U0EjFvjUkeWa0+ge+70bTg+mY0xJ7NUsf5kIhDtrGrtA==", "dev": true }, - "rollup-plugin-alias": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/rollup-plugin-alias/-/rollup-plugin-alias-1.5.2.tgz", - "integrity": "sha512-ODeZXhTxpD48sfcYLAFc1BGrsXKDj7o1CSNH3uYbdK3o0NxyMmaQPTNgW+ko+am92DLC8QSTe4kyxTuEkI5S5w==", - "dev": true, - "requires": { - "slash": "^3.0.0" - } - }, "rollup-plugin-istanbul": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/rollup-plugin-istanbul/-/rollup-plugin-istanbul-2.0.1.tgz", - "integrity": "sha1-9WLTeLQIKFXvA15jwE2e4b1gHCA=", + "integrity": "sha512-5X1ExH74moFY/pHqCrAZQ0V8RyEMCmrUSuo1t1bDzv9UHTd54s79ALDaK8N87PgNzA6UuKtBVAP/tsaSYzIUVQ==", "dev": true, "requires": { "istanbul-lib-instrument": "^1.9.1", @@ -6495,7 +6563,7 @@ "rsvp": { "version": "3.6.2", "resolved": "https://registry.npmjs.org/rsvp/-/rsvp-3.6.2.tgz", - "integrity": "sha1-LpZJFZmpbN4bUV1WdKj3qRRSkmo=", + "integrity": "sha512-OfWGQTb9vnwRjwtA2QwpG2ICclHC3pgXZO5xt8H2EfgDquO0qVdSb5T88L4qJVAEugbS56pAuV4XZM58UX8ulw==", "dev": true }, "run-async": { @@ -6718,16 +6786,10 @@ "string-width": "^1.0.1" } }, - "slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true - }, "slice-ansi": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", - "integrity": "sha1-BE8aSdiEL/MHqta1Be0Xi9lQE00=", + "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", "dev": true, "requires": { "is-fullwidth-code-point": "^2.0.0" @@ -6975,7 +7037,7 @@ "source-map-support": { "version": "0.4.18", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", - "integrity": "sha1-Aoam3ovkJkEzhZTpfM6nXwosWF8=", + "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", "dev": true, "requires": { "source-map": "^0.5.6" @@ -7222,7 +7284,7 @@ "table": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz", - "integrity": "sha1-ozRHN1OR52atNNNIbm4q7chNLjY=", + "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==", "dev": true, "requires": { "ajv": "^5.2.3", @@ -7242,7 +7304,7 @@ "ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha1-QfuyAkPlCxK+DwS43tvwdSDOhB0=", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "^1.9.0" @@ -7268,7 +7330,7 @@ "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha1-q5Pyeo3BPSjKyBXEYhQ6bZASrp4=", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "dev": true, "requires": { "is-fullwidth-code-point": "^2.0.0", @@ -7412,7 +7474,7 @@ "tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha1-bTQzWIl2jSGyvNoKonfO07G/rfk=", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", "dev": true, "requires": { "os-tmpdir": "~1.0.2" @@ -7496,6 +7558,12 @@ "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", "dev": true }, + "tslib": { + "version": "1.11.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.2.tgz", + "integrity": "sha512-tTSkux6IGPnUGUd1XAZHcpu85MOkIl5zX49pO+jfsie3eP0B6pyhOlLXm3cAC6T7s+euSDDUUV+Acop5WmtkVg==", + "dev": true + }, "tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", @@ -7537,6 +7605,12 @@ "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", "dev": true }, + "typescript": { + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.8.3.tgz", + "integrity": "sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w==", + "dev": true + }, "uglify-js": { "version": "2.4.24", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.4.24.tgz", @@ -7575,7 +7649,7 @@ "ultron": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz", - "integrity": "sha1-n+FTahCmZKZSZqHjzPhf02MCvJw=", + "integrity": "sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og==", "dev": true }, "unc-path-regex": { @@ -7827,7 +7901,7 @@ "vlq": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/vlq/-/vlq-0.2.3.tgz", - "integrity": "sha1-jz5DKM9jsVQMDWfhsneDhviXWyY=", + "integrity": "sha512-DRibZL6DsNhIgYQ+wNdWDL2SL3bKPlVrRiBqV5yuMm++op8W4kGFtaQfCs4KEJn0wBZcHVHJ3eoywX8983k1ow==", "dev": true }, "void-elements": { @@ -7879,7 +7953,7 @@ }, "async": { "version": "2.0.1", - "resolved": "http://registry.npmjs.org/async/-/async-2.0.1.tgz", + "resolved": "https://registry.npmjs.org/async/-/async-2.0.1.tgz", "integrity": "sha1-twnMAoCpw28J9FNr6CPIOKkEniU=", "dev": true, "requires": { @@ -7894,13 +7968,13 @@ }, "minimist": { "version": "0.0.8", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true }, "mkdirp": { "version": "0.5.1", - "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "dev": true, "requires": { @@ -7928,7 +8002,7 @@ "which": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", - "integrity": "sha1-/wS9/AEO5UfXgL7DjhrBwnd9JTo=", + "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", "dev": true, "requires": { "isexe": "^2.0.0" @@ -8016,7 +8090,7 @@ "ws": { "version": "3.3.3", "resolved": "https://registry.npmjs.org/ws/-/ws-3.3.3.tgz", - "integrity": "sha1-8c+E/i1ekB686U767OeF8YeiKPI=", + "integrity": "sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA==", "dev": true, "requires": { "async-limiter": "~1.0.0", diff --git a/package.json b/package.json index 0ee7534b4d..85fa13f162 100755 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "typings": "typings/ractive.d.ts", "devDependencies": { "@evs-chris/buble": "^0.15.2", + "@rollup/plugin-typescript": "^3.1.1", "cheerio": "^1.0.0-rc.3", "coveralls": "^3.0.4", "electron": "^3.1.11", @@ -33,8 +34,9 @@ "puppeteer": "^1.17.0", "qunitjs": "^2.4.1", "rollup": "^0.55.3", - "rollup-plugin-alias": "^1.5.2", - "rollup-plugin-istanbul": "^2" + "rollup-plugin-istanbul": "^2", + "tslib": "^1.11.2", + "typescript": "^3.8.3" }, "scripts": { "start": "gobble --env=dev:browser serve", diff --git a/src/utils/cleanCss.js b/src/utils/cleanCss.js deleted file mode 100644 index 999b839a12..0000000000 --- a/src/utils/cleanCss.js +++ /dev/null @@ -1,18 +0,0 @@ -const remove = /\/\*(?:[\s\S]*?)\*\//g; -const escape = /url\(\s*(['"])(?:\\[\s\S]|(?!\1).)*\1\s*\)|url\((?:\\[\s\S]|[^)])*\)|(['"])(?:\\[\s\S]|(?!\2).)*\2/gi; -const value = /\0(\d+)/g; - -// Removes comments and strings from the given CSS to make it easier to parse. -// Callback receives the cleaned CSS and a function which can be used to put -// the removed strings back in place after parsing is done. -export default function(css, callback, additionalReplaceRules = []) { - const values = []; - const reconstruct = css => css.replace(value, (match, n) => values[n]); - css = css.replace(escape, match => `\0${values.push(match) - 1}`).replace(remove, ''); - - additionalReplaceRules.forEach(pattern => { - css = css.replace(pattern, match => `\0${values.push(match) - 1}`); - }); - - return callback(css, reconstruct); -} diff --git a/src/utils/cleanCss.ts b/src/utils/cleanCss.ts new file mode 100644 index 0000000000..c801711fbf --- /dev/null +++ b/src/utils/cleanCss.ts @@ -0,0 +1,30 @@ +const remove = /\/\*(?:[\s\S]*?)\*\//g; +const escape = /url\(\s*(['"])(?:\\[\s\S]|(?!\1).)*\1\s*\)|url\((?:\\[\s\S]|[^)])*\)|(['"])(?:\\[\s\S]|(?!\2).)*\2/gi; +const value = /\0(\d+)/g; + +/** + * Removes comments and strings from the given CSS to make it easier to parse. + * + * @param css + * @param callback receives the cleaned CSS and a function which can be used to put the removed strings + * back in place after parsing is done. + * @param additionalReplaceRules + */ +export default function( + css: string, + callback: Function, + additionalReplaceRules: Array = [] +): object | string { + const values: Array = []; + const reconstruct = function(css: string): string { + return css.replace(value, (_match: string, n: number) => values[n]); + }; + + css = css.replace(escape, match => `\0${values.push(match) - 1}`).replace(remove, ''); + + additionalReplaceRules.forEach(pattern => { + css = css.replace(pattern, (match: string) => `\0${values.push(match) - 1}`); + }); + + return callback(css, reconstruct); +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000000..72241a7080 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "baseUrl": ".", + "paths": { + "src/*": ["src/*"], + "config/*": ["src/config/*"], + "parse/*": ["src/parse/*"], + "shared/*": ["src/shared/*"], + "utils/*": ["src/utils/*"] + }, + "allowJs": true, + "target": "es5", + "noUnusedLocals": true, + "noUnusedParameters": true + }, + "include": [ + "./src/**/*" + ] +} From c995077ca9050cb14e5edaad9eb96c175d33d017 Mon Sep 17 00:00:00 2001 From: Marco Pasqualetti Date: Thu, 7 May 2020 01:25:29 +0200 Subject: [PATCH 04/47] WIP support ts inside eslint --- .eslintrc | 5 +- package-lock.json | 940 ++++++++++++++--------- package.json | 10 +- src/.eslintrc | 17 +- src/model/Computation.js | 2 +- src/model/specials/SharedModel.js | 1 - tests/browser/aliases.js | 2 - tests/browser/components/async.js | 1 - tests/browser/events/dom-proxy-events.js | 6 +- tests/browser/misc.js | 2 +- tests/browser/parse.js | 2 - 11 files changed, 594 insertions(+), 394 deletions(-) diff --git a/.eslintrc b/.eslintrc index cf94c01406..529a2a145a 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,5 +1,8 @@ { - "extends": "eslint:recommended", + "root": true, + "extends": [ + "eslint:recommended" + ], "env": { "es6": true }, diff --git a/package-lock.json b/package-lock.json index 5877c7d888..85dfe024cf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,6 +4,69 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@babel/code-frame": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", + "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", + "dev": true, + "requires": { + "@babel/highlight": "^7.8.3" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.5.tgz", + "integrity": "sha512-/8arLKUFq882w4tWGj9JYzRpAlZgiWUJ+dtteNTDqrRBz9Iguck9Rn3ykuBDoUwh2TO4tSAJlrxDUOXWklJe4g==", + "dev": true + }, + "@babel/highlight": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.9.0.tgz", + "integrity": "sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.9.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, "@evs-chris/buble": { "version": "0.15.2", "resolved": "https://registry.npmjs.org/@evs-chris/buble/-/buble-0.15.2.tgz", @@ -76,18 +139,159 @@ } } }, + "@types/eslint-visitor-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", + "integrity": "sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==", + "dev": true + }, "@types/estree": { "version": "0.0.39", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", "dev": true }, + "@types/json-schema": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.4.tgz", + "integrity": "sha512-8+KAKzEvSUdeo+kmqnKrqgeE+LcA0tjYWFY7RPProVYwnqDjukzO+3b6dLD56rYX5TdWejnEOLJYOIeh4CXKuA==", + "dev": true + }, "@types/node": { "version": "12.0.8", "resolved": "https://registry.npmjs.org/@types/node/-/node-12.0.8.tgz", "integrity": "sha512-b8bbUOTwzIY3V5vDTY1fIJ+ePKDUBqt2hC2woVGotdQQhG/2Sh62HOKHrT7ab+VerXAcPyAiTEipPu/FsreUtg==", "dev": true }, + "@typescript-eslint/eslint-plugin": { + "version": "2.31.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.31.0.tgz", + "integrity": "sha512-iIC0Pb8qDaoit+m80Ln/aaeu9zKQdOLF4SHcGLarSeY1gurW6aU4JsOPMjKQwXlw70MvWKZQc6S2NamA8SJ/gg==", + "dev": true, + "requires": { + "@typescript-eslint/experimental-utils": "2.31.0", + "functional-red-black-tree": "^1.0.1", + "regexpp": "^3.0.0", + "tsutils": "^3.17.1" + }, + "dependencies": { + "regexpp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", + "dev": true + } + } + }, + "@typescript-eslint/experimental-utils": { + "version": "2.31.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.31.0.tgz", + "integrity": "sha512-MI6IWkutLYQYTQgZ48IVnRXmLR/0Q6oAyJgiOror74arUMh7EWjJkADfirZhRsUMHeLJ85U2iySDwHTSnNi9vA==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.3", + "@typescript-eslint/typescript-estree": "2.31.0", + "eslint-scope": "^5.0.0", + "eslint-utils": "^2.0.0" + }, + "dependencies": { + "eslint-scope": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.0.0.tgz", + "integrity": "sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + } + } + }, + "@typescript-eslint/parser": { + "version": "2.31.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.31.0.tgz", + "integrity": "sha512-uph+w6xUOlyV2DLSC6o+fBDzZ5i7+3/TxAsH4h3eC64tlga57oMb96vVlXoMwjR/nN+xyWlsnxtbDkB46M2EPQ==", + "dev": true, + "requires": { + "@types/eslint-visitor-keys": "^1.0.0", + "@typescript-eslint/experimental-utils": "2.31.0", + "@typescript-eslint/typescript-estree": "2.31.0", + "eslint-visitor-keys": "^1.1.0" + } + }, + "@typescript-eslint/typescript-estree": { + "version": "2.31.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.31.0.tgz", + "integrity": "sha512-vxW149bXFXXuBrAak0eKHOzbcu9cvi6iNcJDzEtOkRwGHxJG15chiAQAwhLOsk+86p9GTr/TziYvw+H9kMaIgA==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "eslint-visitor-keys": "^1.1.0", + "glob": "^7.1.6", + "is-glob": "^4.0.1", + "lodash": "^4.17.15", + "semver": "^6.3.0", + "tsutils": "^3.17.1" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.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.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, "abbrev": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", @@ -167,23 +371,17 @@ } }, "ajv": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", - "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "version": "6.12.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.2.tgz", + "integrity": "sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ==", "dev": true, "requires": { - "co": "^4.6.0", - "fast-deep-equal": "^1.0.0", + "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.3.0" + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" } }, - "ajv-keywords": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz", - "integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=", - "dev": true - }, "amdefine": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", @@ -191,9 +389,9 @@ "dev": true }, "ansi-escapes": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", - "integrity": "sha1-9zIHu4EgfXX9bIPxJa8m7qN4yjA=", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", + "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", "dev": true }, "ansi-regex": { @@ -280,21 +478,6 @@ "integrity": "sha1-42jqFfibxwaff/uJrsOmx9SsItQ=", "dev": true }, - "array-union": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", - "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", - "dev": true, - "requires": { - "array-uniq": "^1.0.1" - } - }, - "array-uniq": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", - "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", - "dev": true - }, "array-unique": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", @@ -307,12 +490,6 @@ "integrity": "sha512-wGUIVQXuehL5TCqQun8OW81jGzAWycqzFF8lFp+GOM5BXLYj3bKNsYC4daB7n6XjCqxQA/qgTJ+8ANR3acjrog==", "dev": true }, - "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", - "dev": true - }, "asn1": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", @@ -331,6 +508,12 @@ "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", "dev": true }, + "astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "dev": true + }, "async": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", @@ -779,15 +962,6 @@ } } }, - "caller-path": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", - "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", - "dev": true, - "requires": { - "callsites": "^0.2.0" - } - }, "callsite": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz", @@ -795,9 +969,9 @@ "dev": true }, "callsites": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", - "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true }, "camelcase": { @@ -836,9 +1010,9 @@ } }, "chardet": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", - "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=", + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", "dev": true }, "cheerio": { @@ -872,12 +1046,6 @@ "readdirp": "^2.0.0" } }, - "circular-json": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", - "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", - "dev": true - }, "class-utils": { "version": "0.3.6", "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", @@ -923,15 +1091,9 @@ "dev": true }, "cli-width": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", - "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", - "dev": true - }, - "co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", + "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", "dev": true }, "code-point-at": { @@ -951,18 +1113,18 @@ } }, "color-convert": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.2.tgz", - "integrity": "sha512-3NUJZdhMhcdPn8vJ9v2UQJoH0qqoGUkYTgFEPZaPjEtwmmKUfNV46zZmgB2M5M4DCEQHMaCfWHCxiBflLm04Tg==", + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, "requires": { - "color-name": "1.1.1" + "color-name": "1.1.3" } }, "color-name": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.1.tgz", - "integrity": "sha1-SxQVMEz1ACjqgWQ2Q72C6gWANok=", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, "colors": { @@ -1023,17 +1185,6 @@ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "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.2.2", - "typedarray": "^0.0.6" - } - }, "connect": { "version": "3.7.0", "resolved": "https://registry.npmjs.org/connect/-/connect-3.7.0.tgz", @@ -1121,12 +1272,14 @@ } }, "cross-spawn": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", "dev": true, "requires": { - "lru-cache": "^4.0.1", + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", "shebang-command": "^1.2.0", "which": "^1.2.9" } @@ -1293,21 +1446,6 @@ } } }, - "del": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", - "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=", - "dev": true, - "requires": { - "globby": "^5.0.0", - "is-path-cwd": "^1.0.0", - "is-path-in-cwd": "^1.0.0", - "object-assign": "^4.0.1", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "rimraf": "^2.2.8" - } - }, "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -1345,9 +1483,9 @@ "dev": true }, "doctrine": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", - "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", "dev": true, "requires": { "esutils": "^2.0.2" @@ -1475,6 +1613,12 @@ } } }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, "encodeurl": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", @@ -1656,49 +1800,47 @@ } }, "eslint": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.19.1.tgz", - "integrity": "sha512-bT3/1x1EbZB7phzYu7vCr1v3ONuzDtX8WjuM9c0iYxe+cq+pwcKEoQjl7zd3RpC6YOLgnSy3cTN58M2jcoPDIQ==", + "version": "5.14.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.14.0.tgz", + "integrity": "sha512-jrOhiYyENRrRnWlMYANlGZTqb89r2FuRT+615AabBoajhNjeh9ywDNlh2LU9vTqf0WYN+L3xdXuIi7xuj/tK9w==", "dev": true, "requires": { - "ajv": "^5.3.0", - "babel-code-frame": "^6.22.0", + "@babel/code-frame": "^7.0.0", + "ajv": "^6.9.1", "chalk": "^2.1.0", - "concat-stream": "^1.6.0", - "cross-spawn": "^5.1.0", - "debug": "^3.1.0", - "doctrine": "^2.1.0", - "eslint-scope": "^3.7.1", + "cross-spawn": "^6.0.5", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "eslint-scope": "^4.0.0", + "eslint-utils": "^1.3.1", "eslint-visitor-keys": "^1.0.0", - "espree": "^3.5.4", - "esquery": "^1.0.0", + "espree": "^5.0.1", + "esquery": "^1.0.1", "esutils": "^2.0.2", - "file-entry-cache": "^2.0.0", + "file-entry-cache": "^5.0.1", "functional-red-black-tree": "^1.0.1", "glob": "^7.1.2", - "globals": "^11.0.1", - "ignore": "^3.3.3", + "globals": "^11.7.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", - "inquirer": "^3.0.6", - "is-resolvable": "^1.0.0", - "js-yaml": "^3.9.1", + "inquirer": "^6.2.2", + "js-yaml": "^3.12.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.3.0", - "lodash": "^4.17.4", - "minimatch": "^3.0.2", + "lodash": "^4.17.11", + "minimatch": "^3.0.4", "mkdirp": "^0.5.1", "natural-compare": "^1.4.0", "optionator": "^0.8.2", "path-is-inside": "^1.0.2", - "pluralize": "^7.0.0", "progress": "^2.0.0", - "regexpp": "^1.0.1", - "require-uncached": "^1.0.3", - "semver": "^5.3.0", + "regexpp": "^2.0.1", + "semver": "^5.5.1", "strip-ansi": "^4.0.0", - "strip-json-comments": "~2.0.1", - "table": "4.0.2", - "text-table": "~0.2.0" + "strip-json-comments": "^2.0.1", + "table": "^5.2.3", + "text-table": "^0.2.0" }, "dependencies": { "ansi-regex": { @@ -1717,9 +1859,9 @@ } }, "chalk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", - "integrity": "sha1-GMSasWoDe26wFSzIPjRxM4IVtm4=", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, "requires": { "ansi-styles": "^3.2.1", @@ -1728,29 +1870,50 @@ } }, "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "dev": true, "requires": { - "ms": "2.0.0" + "ms": "^2.1.1" + } + }, + "eslint-utils": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", + "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" } }, "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true }, "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", "dev": true, "requires": { - "minimist": "0.0.8" + "minimist": "^1.2.5" } }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, "strip-ansi": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", @@ -1761,9 +1924,9 @@ } }, "supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha1-HGszdALCE3YF7+GfEP7DkPb6q1Q=", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, "requires": { "has-flag": "^3.0.0" @@ -1782,35 +1945,51 @@ } }, "eslint-scope": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.1.tgz", - "integrity": "sha1-PWPD7f2gLgbgGkUq2IyqzHzctug=", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", + "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", "dev": true, "requires": { "esrecurse": "^4.1.0", "estraverse": "^4.1.1" } }, + "eslint-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.0.0.tgz", + "integrity": "sha512-0HCPuJv+7Wv1bACm8y5/ECVfYdfsAm9xmVb7saeFlxjPYALefjhbYoCkBjPdPzGH8wWyTpAez82Fh3VKYEZ8OA==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, "eslint-visitor-keys": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", - "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz", + "integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==", "dev": true }, "espree": { - "version": "3.5.4", - "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz", - "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-5.0.1.tgz", + "integrity": "sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A==", "dev": true, "requires": { - "acorn": "^5.5.0", - "acorn-jsx": "^3.0.0" + "acorn": "^6.0.7", + "acorn-jsx": "^5.0.0", + "eslint-visitor-keys": "^1.0.0" }, "dependencies": { "acorn": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.1.tgz", - "integrity": "sha512-d+nbxBUGKg7Arpsvbnlq61mc12ek3EY8EQldM3GPAhWJ1UVxC6TDGbIvUMNU6obBX3i1+ptCIzV4vq0gFPEGVQ==", + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz", + "integrity": "sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==", + "dev": true + }, + "acorn-jsx": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.2.0.tgz", + "integrity": "sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==", "dev": true } } @@ -1822,12 +2001,20 @@ "dev": true }, "esquery": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", - "integrity": "sha1-QGxRZYsfWZGl+bYrHcJbAOPlxwg=", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz", + "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==", "dev": true, "requires": { - "estraverse": "^4.0.0" + "estraverse": "^5.1.0" + }, + "dependencies": { + "estraverse": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.1.0.tgz", + "integrity": "sha512-FyohXK+R0vE+y1nHLoBM7ZTyqRpqAlhdZHCWIWEviFLiGB8b04H6bQs8G+XTthacvT8VuwvteiP7RJSxMs8UEw==", + "dev": true + } } }, "esrecurse": { @@ -1840,9 +2027,9 @@ } }, "estraverse": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", - "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", "dev": true }, "estree-walker": { @@ -1930,13 +2117,13 @@ } }, "external-editor": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", - "integrity": "sha1-BFURz9jRM/OEZnPRBHwVTiFK09U=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", "dev": true, "requires": { - "chardet": "^0.4.0", - "iconv-lite": "^0.4.17", + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", "tmp": "^0.0.33" } }, @@ -2003,9 +2190,9 @@ "dev": true }, "fast-deep-equal": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", - "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz", + "integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==", "dev": true }, "fast-diff": { @@ -2054,13 +2241,12 @@ } }, "file-entry-cache": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", - "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", "dev": true, "requires": { - "flat-cache": "^1.2.1", - "object-assign": "^4.0.1" + "flat-cache": "^2.0.1" } }, "filename-regex": { @@ -2185,15 +2371,39 @@ "dev": true }, "flat-cache": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.0.tgz", - "integrity": "sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", "dev": true, "requires": { - "circular-json": "^0.3.1", - "del": "^2.0.2", - "graceful-fs": "^4.1.2", - "write": "^0.2.1" + "flatted": "^2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" + }, + "dependencies": { + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } } }, "flatted": { @@ -2967,25 +3177,11 @@ } }, "globals": { - "version": "11.7.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.7.0.tgz", - "integrity": "sha512-K8BNSPySfeShBQXsahYB/AbbWruVOTyVpgoIDnl8odPpeSfP2J5QO2oLFFdl2j7GfDCtZj2bMKar2T49itTPCg==", + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "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.1", - "arrify": "^1.0.0", - "glob": "^7.0.3", - "object-assign": "^4.0.1", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, "gobble": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/gobble/-/gobble-0.12.0.tgz", @@ -3400,20 +3596,30 @@ "dev": true }, "iconv-lite": { - "version": "0.4.23", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz", - "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "dev": true, "requires": { "safer-buffer": ">= 2.1.2 < 3" } }, "ignore": { - "version": "3.3.10", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", - "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==", + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", "dev": true }, + "import-fresh": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", + "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", @@ -3458,24 +3664,23 @@ "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==", + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz", + "integrity": "sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ==", "dev": true, "requires": { - "ansi-escapes": "^3.0.0", - "chalk": "^2.0.0", + "ansi-escapes": "^3.2.0", + "chalk": "^2.4.2", "cli-cursor": "^2.1.0", "cli-width": "^2.0.0", - "external-editor": "^2.0.4", + "external-editor": "^3.0.3", "figures": "^2.0.0", - "lodash": "^4.3.0", + "lodash": "^4.17.12", "mute-stream": "0.0.7", "run-async": "^2.2.0", - "rx-lite": "^4.0.8", - "rx-lite-aggregates": "^4.0.8", + "rxjs": "^6.4.0", "string-width": "^2.1.0", - "strip-ansi": "^4.0.0", + "strip-ansi": "^5.1.0", "through": "^2.3.6" }, "dependencies": { @@ -3495,9 +3700,9 @@ } }, "chalk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", - "integrity": "sha1-GMSasWoDe26wFSzIPjRxM4IVtm4=", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, "requires": { "ansi-styles": "^3.2.1", @@ -3511,6 +3716,12 @@ "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + }, "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", @@ -3519,21 +3730,40 @@ "requires": { "is-fullwidth-code-point": "^2.0.0", "strip-ansi": "^4.0.0" + }, + "dependencies": { + "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-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", "dev": true, "requires": { - "ansi-regex": "^3.0.0" + "ansi-regex": "^4.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + } } }, "supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha1-HGszdALCE3YF7+GfEP7DkPb6q1Q=", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, "requires": { "has-flag": "^3.0.0" @@ -3721,30 +3951,6 @@ } } }, - "is-path-cwd": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", - "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=", - "dev": true - }, - "is-path-in-cwd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz", - "integrity": "sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ==", - "dev": true, - "requires": { - "is-path-inside": "^1.0.0" - } - }, - "is-path-inside": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", - "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", - "dev": true, - "requires": { - "path-is-inside": "^1.0.1" - } - }, "is-plain-object": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", @@ -3774,12 +3980,6 @@ "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", "dev": true }, - "is-promise": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", - "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", - "dev": true - }, "is-relative": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", @@ -3789,12 +3989,6 @@ "is-unc-path": "^1.0.0" } }, - "is-resolvable": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", - "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", - "dev": true - }, "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", @@ -4021,9 +4215,9 @@ "dev": true }, "json-schema-traverse": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", - "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true }, "json-stable-stringify-without-jsonify": { @@ -5458,6 +5652,12 @@ "integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==", "dev": true }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, "nopt": { "version": "3.0.6", "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", @@ -5735,6 +5935,15 @@ "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, "parse-filepath": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.2.tgz", @@ -5839,6 +6048,12 @@ "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", "dev": true }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, "path-parse": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", @@ -5916,12 +6131,6 @@ "integrity": "sha1-tUGO8EOd5UJfxJlQQtztFPsqhP8=", "dev": true }, - "pluralize": { - "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-character-classes": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", @@ -5963,9 +6172,9 @@ "dev": true }, "progress": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.0.tgz", - "integrity": "sha1-ihvjZr+Pwj2yvSPxDG/pILQ4nR8=", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", "dev": true }, "progress-stream": { @@ -6294,9 +6503,9 @@ } }, "regexpp": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-1.1.0.tgz", - "integrity": "sha1-DjUW3Qt5BPQT0tQZPc5GGMOmias=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", + "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", "dev": true }, "remove-trailing-separator": { @@ -6451,16 +6660,6 @@ "integrity": "sha1-eZlTn8ngR6N5KPoZb44VY9q9Nt4=", "dev": true }, - "require-uncached": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", - "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", - "dev": true, - "requires": { - "caller-path": "^0.1.0", - "resolve-from": "^1.0.0" - } - }, "requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", @@ -6487,9 +6686,9 @@ } }, "resolve-from": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", - "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true }, "resolve-url": { @@ -6567,27 +6766,18 @@ "dev": true }, "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=", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", "dev": true }, - "rx-lite-aggregates": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz", - "integrity": "sha1-dTuHqJoRyVRnxKwWJsTvxOBcZ74=", + "rxjs": { + "version": "6.5.5", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.5.tgz", + "integrity": "sha512-WfQI+1gohdf0Dai/Bbmk5L5ItH5tYqm3ki2c5GdWhKjalzjg93N3avFjVStyZZz+A2Em+ZxKH5bNghw9UeylGQ==", "dev": true, "requires": { - "rx-lite": "*" + "tslib": "^1.9.0" } }, "safe-buffer": { @@ -6787,14 +6977,25 @@ } }, "slice-ansi": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", - "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", "dev": true, "requires": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", "is-fullwidth-code-point": "^2.0.0" }, "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.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", @@ -7282,77 +7483,53 @@ "dev": true }, "table": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz", - "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==", + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", + "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", "dev": true, "requires": { - "ajv": "^5.2.3", - "ajv-keywords": "^2.1.0", - "chalk": "^2.1.0", - "lodash": "^4.17.4", - "slice-ansi": "1.0.0", - "string-width": "^2.1.1" + "ajv": "^6.10.2", + "lodash": "^4.17.14", + "slice-ansi": "^2.1.0", + "string-width": "^3.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=", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", - "integrity": "sha1-GMSasWoDe26wFSzIPjRxM4IVtm4=", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.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 }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + }, "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", "dev": true, "requires": { + "emoji-regex": "^7.0.1", "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" + "strip-ansi": "^5.1.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": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha1-HGszdALCE3YF7+GfEP7DkPb6q1Q=", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", "dev": true, "requires": { - "has-flag": "^3.0.0" + "ansi-regex": "^4.1.0" } } } @@ -7564,6 +7741,15 @@ "integrity": "sha512-tTSkux6IGPnUGUd1XAZHcpu85MOkIl5zX49pO+jfsie3eP0B6pyhOlLXm3cAC6T7s+euSDDUUV+Acop5WmtkVg==", "dev": true }, + "tsutils": { + "version": "3.17.1", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.17.1.tgz", + "integrity": "sha512-kzeQ5B8H3w60nFY2g8cJIuH7JDpsALXySGtwGJ0p2LSjLgay3NdIpqq5SoOBe46bKDW2iq25irHCr8wjomUS2g==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + }, "tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", @@ -8062,27 +8248,27 @@ "dev": true }, "write": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", - "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", + "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", "dev": true, "requires": { "mkdirp": "^0.5.1" }, "dependencies": { "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true }, "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", "dev": true, "requires": { - "minimist": "0.0.8" + "minimist": "^1.2.5" } } } diff --git a/package.json b/package.json index 85fa13f162..e4f213d9c0 100755 --- a/package.json +++ b/package.json @@ -11,10 +11,12 @@ "devDependencies": { "@evs-chris/buble": "^0.15.2", "@rollup/plugin-typescript": "^3.1.1", + "@typescript-eslint/eslint-plugin": "^2.31.0", + "@typescript-eslint/parser": "^2.31.0", "cheerio": "^1.0.0-rc.3", "coveralls": "^3.0.4", "electron": "^3.1.11", - "eslint": "^4.19.1", + "eslint": "^5.14.0", "eslint-plugin-prettier": "^2.7", "fs-plus": "^3.1.1", "gobble": "^0.12.0", @@ -55,9 +57,9 @@ "lint:bin": "eslint bin lib", "lint:fix:bin": "eslint --fix bin lib", "lint:perf": "", - "bundle:dev": "gobble --env=bundle:dev build .build --force", - "bundle:test": "gobble --env=bundle:test build .build --force", - "bundle:release": "gobble --env=bundle:release build .build --force", + "bundle:dev": "gobble --env=bundle:dev build .build --f", + "bundle:test": "gobble --env=bundle:test build .build --f", + "bundle:release": "gobble --env=bundle:release build .build --f", "test:electron": "karma start karma/electron.conf.js", "test:chrome": "karma start karma/chrome.conf.js", "test:coverage": "istanbul report --root .build/coverage --dir .build/coverage/combined", diff --git a/src/.eslintrc b/src/.eslintrc index fa31d25c2e..803b6e1254 100644 --- a/src/.eslintrc +++ b/src/.eslintrc @@ -1,6 +1,21 @@ { + "extends": [ + "plugin:@typescript-eslint/recommended" + ], + "parser": "@typescript-eslint/parser", "env": { "browser": true, "node": true - } + }, + "overrides": [{ + // disable typescript rules for JS files + "files": ["*.js"], + "rules": { + "@typescript-eslint/explicit-function-return-type": ["off"], + "@typescript-eslint/no-use-before-define": ["off"], + "@typescript-eslint/no-var-requires": ["off"], + "@typescript-eslint/no-empty-function": ["off"], + "@typescript-eslint/camelcase": ["off"] + } + }] } diff --git a/src/model/Computation.js b/src/model/Computation.js index 882c459e8d..713f5a1bb6 100755 --- a/src/model/Computation.js +++ b/src/model/Computation.js @@ -1,4 +1,3 @@ -/* global console */ /* eslint no-console:"off" */ import { capture, startCapturing, stopCapturing } from 'src/global/capture'; @@ -34,6 +33,7 @@ export default class Computation extends Model { get setRoot() { if (this.signature.setter) return this; + return undefined; } get(shouldCapture, opts) { diff --git a/src/model/specials/SharedModel.js b/src/model/specials/SharedModel.js index e26787619f..06c3786c13 100644 --- a/src/model/specials/SharedModel.js +++ b/src/model/specials/SharedModel.js @@ -1,4 +1,3 @@ -/* global global */ import Model from '../Model'; import { base } from 'config/environment'; diff --git a/tests/browser/aliases.js b/tests/browser/aliases.js index 12bd0aaafb..e288365af0 100644 --- a/tests/browser/aliases.js +++ b/tests/browser/aliases.js @@ -4,8 +4,6 @@ import { test } from 'qunit'; export default function() { initModule('aliases'); - /* global navigator */ - test('simple template aliases', t => { new Ractive({ el: fixture, diff --git a/tests/browser/components/async.js b/tests/browser/components/async.js index 62e894da85..afd7ef588d 100644 --- a/tests/browser/components/async.js +++ b/tests/browser/components/async.js @@ -1,4 +1,3 @@ -/* global document */ import { initModule } from '../../helpers/test-config'; import { test } from 'qunit'; diff --git a/tests/browser/events/dom-proxy-events.js b/tests/browser/events/dom-proxy-events.js index 3381325a27..d495ff082c 100644 --- a/tests/browser/events/dom-proxy-events.js +++ b/tests/browser/events/dom-proxy-events.js @@ -486,10 +486,10 @@ export default function() { ractive.on('bar-reproxy', (ctx, arg1) => { t.equal(arg1, 'qux'); }); - ractive.on('bizz-reproxy', function() { + ractive.on('bizz-reproxy', function (...args) { // original args are implicitly included... - t.equal(arguments.length, 2); - t.equal(arguments[1], 'buzz'); + t.equal(args.length, 2); + t.equal(args[1], 'buzz'); }); const component = ractive.findComponent('Component'); diff --git a/tests/browser/misc.js b/tests/browser/misc.js index 8816f21517..f463cd02e9 100644 --- a/tests/browser/misc.js +++ b/tests/browser/misc.js @@ -1377,7 +1377,7 @@ export default function() { const ractive = new Ractive(); const obj = { foo: 'bar' }; - obj.constructor = obj.constructor; + // obj.constructor = obj.constructor; ractive.set(obj); t.equal(ractive.get('foo'), 'bar'); diff --git a/tests/browser/parse.js b/tests/browser/parse.js index 84bc8da5f3..37c0d5d76b 100644 --- a/tests/browser/parse.js +++ b/tests/browser/parse.js @@ -2,8 +2,6 @@ import tests from '../helpers/samples/parse'; import { initModule } from '../helpers/test-config'; import { test } from 'qunit'; -/* global navigator */ - export default function() { initModule('parse.js'); From c807ff0d2560eb9f27ed8303f6c86c9791835817 Mon Sep 17 00:00:00 2001 From: Giovanni Piller Cottrer Date: Thu, 7 May 2020 20:22:01 +0200 Subject: [PATCH 05/47] renames .eslintrc to .eslintrc.json --- .eslintrc => .eslintrc.json | 0 tests/browser/{.eslintrc => .eslintrc.json} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename .eslintrc => .eslintrc.json (100%) rename tests/browser/{.eslintrc => .eslintrc.json} (100%) diff --git a/.eslintrc b/.eslintrc.json similarity index 100% rename from .eslintrc rename to .eslintrc.json diff --git a/tests/browser/.eslintrc b/tests/browser/.eslintrc.json similarity index 100% rename from tests/browser/.eslintrc rename to tests/browser/.eslintrc.json From 2c2947dfbdc9f55d1be876ca3db1c0e294bcc066 Mon Sep 17 00:00:00 2001 From: Giovanni Piller Cottrer Date: Thu, 7 May 2020 20:24:54 +0200 Subject: [PATCH 06/47] adds vscode-eslint to vscode extensions recommendations --- .vscode/extensions.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.vscode/extensions.json b/.vscode/extensions.json index ca3f38f20b..63e46524ce 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,6 +1,7 @@ { "recommendations": [ "editorconfig.editorconfig", - "ms-vscode.vscode-typescript-tslint-plugin" + "ms-vscode.vscode-typescript-tslint-plugin", + "dbaeumer.vscode-eslint" ] } From df176ad4ee4d7de451618f7d2f3e094361fed2eb Mon Sep 17 00:00:00 2001 From: Giovanni Piller Cottrer Date: Thu, 7 May 2020 21:10:18 +0200 Subject: [PATCH 07/47] linting --- src/.eslintrc | 3 ++- src/Ractive/config/wrapPrototypeMethod.js | 4 ++-- src/Ractive/construct.js | 4 ++-- src/Ractive/initialise.js | 3 +-- src/Ractive/prototype/observe.js | 2 +- src/Ractive/prototype/observe/Pattern.js | 2 +- src/Ractive/prototype/once.js | 4 ++-- src/events/fireEvent.js | 2 +- src/extend/_extend.js | 2 +- src/model/Model.js | 2 +- src/model/ModelBase.js | 4 ++-- src/parse/utils/cleanup.js | 2 +- src/shared/getRactiveContext.js | 5 ++-- src/shared/set.js | 4 ++-- src/utils/log.js | 28 +++++++++++------------ src/view/items/Component.js | 2 +- src/view/items/Element.js | 2 +- src/view/items/Triple.js | 2 +- src/view/items/shared/EventDirective.js | 2 ++ tests/browser/.eslintrc.json | 21 +++++++++-------- tests/browser/events/dom-proxy-events.js | 2 +- 21 files changed, 54 insertions(+), 48 deletions(-) diff --git a/src/.eslintrc b/src/.eslintrc index 803b6e1254..3291b09ad7 100644 --- a/src/.eslintrc +++ b/src/.eslintrc @@ -15,7 +15,8 @@ "@typescript-eslint/no-use-before-define": ["off"], "@typescript-eslint/no-var-requires": ["off"], "@typescript-eslint/no-empty-function": ["off"], - "@typescript-eslint/camelcase": ["off"] + "@typescript-eslint/camelcase": ["off"], + "@typescript-eslint/no-this-alias": ["off"] } }] } diff --git a/src/Ractive/config/wrapPrototypeMethod.js b/src/Ractive/config/wrapPrototypeMethod.js index 8a5ee5dcaa..0d8e498373 100755 --- a/src/Ractive/config/wrapPrototypeMethod.js +++ b/src/Ractive/config/wrapPrototypeMethod.js @@ -4,14 +4,14 @@ import { isFunction } from 'utils/is'; export default function wrap(parent, name, method) { if (!/_super/.test(method)) return method; - function wrapper() { + function wrapper(...args) { const superMethod = getSuperMethod(wrapper._parent, name); const hasSuper = '_super' in this; const oldSuper = this._super; this._super = superMethod; - const result = method.apply(this, arguments); + const result = method.apply(this, args); if (hasSuper) { this._super = oldSuper; diff --git a/src/Ractive/construct.js b/src/Ractive/construct.js index 2ab9ed8ec2..23ccf1eaab 100755 --- a/src/Ractive/construct.js +++ b/src/Ractive/construct.js @@ -48,7 +48,7 @@ export default function construct(ractive, options) { // plugins that need to run at construct if (isArray(options.use)) { - ractive.use.apply(ractive, options.use.filter(p => p.construct)); + ractive.use(...options.use.filter(p => p.construct)); } hooks.construct.fire(ractive, options); @@ -98,7 +98,7 @@ function getAdaptors(ractive, protoAdapt, options) { srcs.push(ractive.parent.viewmodel.adaptors); } - return combine.apply(null, srcs); + return combine(...srcs); function lookup(adaptor) { if (isString(adaptor)) { diff --git a/src/Ractive/initialise.js b/src/Ractive/initialise.js index 2eff640783..edb39219c6 100755 --- a/src/Ractive/initialise.js +++ b/src/Ractive/initialise.js @@ -22,8 +22,7 @@ export default function initialise(ractive, userOptions, options) { config.init(ractive.constructor, ractive, userOptions); // call any passed in plugins - if (isArray(userOptions.use)) - ractive.use.apply(ractive, userOptions.use.filter(p => !p.construct)); + if (isArray(userOptions.use)) ractive.use(...userOptions.use.filter(p => !p.construct)); hooks.config.fire(ractive); diff --git a/src/Ractive/prototype/observe.js b/src/Ractive/prototype/observe.js index 91e40ac4f9..6a245a8d00 100755 --- a/src/Ractive/prototype/observe.js +++ b/src/Ractive/prototype/observe.js @@ -46,7 +46,7 @@ export default function observe(keypath, callback, options) { // add observers to the Ractive instance, so they can be // cancelled on ractive.teardown() - this._observers.push.apply(this._observers, observers); + this._observers.push(...observers); return { cancel: () => observers.forEach(o => o.cancel()), diff --git a/src/Ractive/prototype/observe/Pattern.js b/src/Ractive/prototype/observe/Pattern.js index d472023b1e..a29b4fdb36 100755 --- a/src/Ractive/prototype/observe/Pattern.js +++ b/src/Ractive/prototype/observe/Pattern.js @@ -188,7 +188,7 @@ function updateOld(observer, vals, partial) { const args = [olds[k], vals[k], k]; const parts = observer.pattern.exec(k); if (parts) { - args.push.apply(args, parts.slice(1)); + args.push(...parts.slice(1)); } observer.oldValues[k] = observer.oldFn.apply(observer.oldContext, args); }); diff --git a/src/Ractive/prototype/once.js b/src/Ractive/prototype/once.js index 33f29c4692..cf184c5a4b 100644 --- a/src/Ractive/prototype/once.js +++ b/src/Ractive/prototype/once.js @@ -1,6 +1,6 @@ export default function Ractive$once(eventName, handler) { - const listener = this.on(eventName, function() { - handler.apply(this, arguments); + const listener = this.on(eventName, (...args) => { + handler(...args); listener.cancel(); }); diff --git a/src/events/fireEvent.js b/src/events/fireEvent.js index b5552bb54d..458392aff1 100644 --- a/src/events/fireEvent.js +++ b/src/events/fireEvent.js @@ -33,7 +33,7 @@ function variants(name, initial) { if (base) { // include non-this-namespaced versions if (parts.length > 2) { - result.push.apply(result, variants(name, false)); + result.push(...variants(name, false)); } else { result.push('*'); result.push(name); diff --git a/src/extend/_extend.js b/src/extend/_extend.js index ac7c6135ed..67ccb13380 100755 --- a/src/extend/_extend.js +++ b/src/extend/_extend.js @@ -110,7 +110,7 @@ function extendOne(Parent, options = {}, Target) { defineProperty(Child, 'helpers', { writable: true, value: proto.helpers }); - if (isArray(options.use)) Child.use.apply(Child, options.use); + if (isArray(options.use)) Child.use(...options.use); return Child; } diff --git a/src/model/Model.js b/src/model/Model.js index c1b50d80ba..da1af314e1 100755 --- a/src/model/Model.js +++ b/src/model/Model.js @@ -1,5 +1,5 @@ import ModelBase, { checkDataLink, maybeBind, shuffle } from './ModelBase'; -import LinkModel from './LinkModel'; // eslint-disable-line no-unused-vars +import './LinkModel'; import getComputationSignature from 'src/Ractive/helpers/getComputationSignature'; import { capture } from 'src/global/capture'; import { isArray, isEqual, isNumeric, isObjectLike, isUndefined } from 'utils/is'; diff --git a/src/model/ModelBase.js b/src/model/ModelBase.js index 8e457ca4ef..d13e0a6585 100755 --- a/src/model/ModelBase.js +++ b/src/model/ModelBase.js @@ -46,7 +46,7 @@ export default class ModelBase { if (key === '*') { matches = []; existingMatches.forEach(model => { - matches.push.apply(matches, model.getValueChildren(model.get())); + matches.push(...model.getValueChildren(model.get())); }); } else { matches = existingMatches.map(model => model.joinKey(key)); @@ -89,7 +89,7 @@ export default class ModelBase { const computed = this.computed; if (computed) { - children.push.apply(children, objectKeys(computed).map(k => this.joinKey(k))); + children.push(...objectKeys(computed).map(k => this.joinKey(k))); } return children; diff --git a/src/parse/utils/cleanup.js b/src/parse/utils/cleanup.js index f15d816732..a6c462547e 100755 --- a/src/parse/utils/cleanup.js +++ b/src/parse/utils/cleanup.js @@ -105,7 +105,7 @@ export default function cleanup( item.l.forEach(s => (s.l = 1)); item.l.unshift(i + 1, 0); - items.splice.apply(items, item.l); + items.splice(...item.l); delete item.l; // TODO would be nice if there was a way around this } diff --git a/src/shared/getRactiveContext.js b/src/shared/getRactiveContext.js index 5c5df0dfbc..0aa3d980a9 100755 --- a/src/shared/getRactiveContext.js +++ b/src/shared/getRactiveContext.js @@ -8,13 +8,14 @@ export default function getRactiveContext(ractive, ...assigns) { ractive.fragment || ractive._fakeFragment || (ractive._fakeFragment = new FakeFragment(ractive)); - return fragment.getContext.apply(fragment, assigns); + return fragment.getContext(...assigns); } export function getContext(...assigns) { if (!this.ctx) this.ctx = new extern.Context(this); assigns.unshift(create(this.ctx)); - return assign.apply(null, assigns); + + return assign(...assigns); } export class FakeFragment { diff --git a/src/shared/set.js b/src/shared/set.js index f15dce5c24..b4b738cfa5 100755 --- a/src/shared/set.js +++ b/src/shared/set.js @@ -99,12 +99,12 @@ export function build(ractive, keypath, value, isolated) { if (isObject(keypath)) { for (const k in keypath) { if (hasOwn(keypath, k)) { - sets.push.apply(sets, gather(ractive, k, null, isolated).map(m => [m, keypath[k], k])); + sets.push(...gather(ractive, k, null, isolated).map(m => [m, keypath[k], k])); } } } else { // set a single keypath - sets.push.apply(sets, gather(ractive, keypath, null, isolated).map(m => [m, value, keypath])); + sets.push(...gather(ractive, keypath, null, isolated).map(m => [m, value, keypath])); } return sets; diff --git a/src/utils/log.js b/src/utils/log.js index eb79f22db5..d3a563d93a 100644 --- a/src/utils/log.js +++ b/src/utils/log.js @@ -43,7 +43,7 @@ Found a bug? Raise an issue: } const message = 'WELCOME_MESSAGE' in Ractive ? Ractive.WELCOME_MESSAGE : welcomeMessage; const hasGroup = !!console.groupCollapsed; - if (hasGroup) console.groupCollapsed.apply(console, welcomeIntro); + if (hasGroup) console.groupCollapsed(...welcomeIntro); console.log(message); if (hasGroup) { console.groupEnd(welcomeIntro); @@ -78,16 +78,16 @@ Found a bug? Raise an issue: } } - console.warn.apply( - console, - ['%cRactive.js: %c' + message, 'color: rgb(114, 157, 52);', 'color: rgb(85, 85, 85);'].concat( - args - ) + console.warn( + '%cRactive.js: %c' + message, + 'color: rgb(114, 157, 52);', + 'color: rgb(85, 85, 85);', + ...args ); }; - log = function() { - console.log.apply(console, arguments); + log = function(...args) { + console.log(...args); }; } else { printWarning = log = welcome = noop; @@ -102,9 +102,9 @@ function fatal(message, ...args) { throw new Error(message); } -function logIfDebug() { +function logIfDebug(...args) { if (Ractive.DEBUG) { - log.apply(null, arguments); + log(...args); } } @@ -124,15 +124,15 @@ function warnOnce(message, ...args) { printWarning(message, args); } -function warnIfDebug() { +function warnIfDebug(...args) { if (Ractive.DEBUG) { - warn.apply(null, arguments); + warn(...args); } } -function warnOnceIfDebug() { +function warnOnceIfDebug(...args) { if (Ractive.DEBUG) { - warnOnce.apply(null, arguments); + warnOnce(...args); } } diff --git a/src/view/items/Component.js b/src/view/items/Component.js index 9110e86ddd..681c266b24 100755 --- a/src/view/items/Component.js +++ b/src/view/items/Component.js @@ -210,7 +210,7 @@ export default class Component extends Item { getContext(...assigns) { assigns.unshift(this.instance); - return getRactiveContext.apply(null, assigns); + return getRactiveContext(...assigns); } rebound(update) { diff --git a/src/view/items/Element.js b/src/view/items/Element.js index d2f492830c..274491496f 100755 --- a/src/view/items/Element.js +++ b/src/view/items/Element.js @@ -190,7 +190,7 @@ export default class Element extends ContainerItem { if (!this.ctx) this.ctx = new Context(this.up, this); assigns.unshift(create(this.ctx)); - return assign.apply(null, assigns); + return assign(...assigns); } off(event, callback, capture = false) { diff --git a/src/view/items/Triple.js b/src/view/items/Triple.js index c49b11f683..1bd506df27 100755 --- a/src/view/items/Triple.js +++ b/src/view/items/Triple.js @@ -49,7 +49,7 @@ export default class Triple extends Mustache { const queryAllResult = node.querySelectorAll(selector); if (queryAllResult) { - result.push.apply(result, queryAllResult); + result.push(...queryAllResult); } } } diff --git a/src/view/items/shared/EventDirective.js b/src/view/items/shared/EventDirective.js index 4feead8b7d..95737578c1 100755 --- a/src/view/items/shared/EventDirective.js +++ b/src/view/items/shared/EventDirective.js @@ -46,6 +46,8 @@ export default class EventDirective { return model ? model.get() : undefined; }); try { + // todo check if passing null as this is necessary for getFunction output + // eslint-disable-next-line prefer-spread args = getFunction(args.s, rs.length).apply(null, rs); } catch (err) { args = null; diff --git a/tests/browser/.eslintrc.json b/tests/browser/.eslintrc.json index 17d49b1adf..82f9013ad9 100644 --- a/tests/browser/.eslintrc.json +++ b/tests/browser/.eslintrc.json @@ -1,11 +1,14 @@ { - "env": { - "browser": true, - "qunit": true - }, - "globals": { - "Ractive": true, - "fixture": true, - "simulant": true - } + "env": { + "browser": true, + "qunit": true + }, + "globals": { + "Ractive": true, + "fixture": true, + "simulant": true + }, + "rules": { + "prefer-arrow-callback": ["off"] + } } diff --git a/tests/browser/events/dom-proxy-events.js b/tests/browser/events/dom-proxy-events.js index d495ff082c..63e9141ffe 100644 --- a/tests/browser/events/dom-proxy-events.js +++ b/tests/browser/events/dom-proxy-events.js @@ -486,7 +486,7 @@ export default function() { ractive.on('bar-reproxy', (ctx, arg1) => { t.equal(arg1, 'qux'); }); - ractive.on('bizz-reproxy', function (...args) { + ractive.on('bizz-reproxy', function(...args) { // original args are implicitly included... t.equal(args.length, 2); t.equal(args[1], 'buzz'); From 0d47326e351de5e17015b3a47d1d0cde7342df09 Mon Sep 17 00:00:00 2001 From: Giovanni Piller Cottrer Date: Thu, 7 May 2020 21:24:58 +0200 Subject: [PATCH 08/47] updates to eslint 6.8.0 --- .vscode/settings.json | 5 +- package-lock.json | 372 +++++++++++++++++---------- package.json | 2 +- src/utils/log.js | 1 - tests/browser/events/method-calls.js | 1 - tests/browser/init/config.js | 9 +- tests/browser/init/registries.js | 5 +- tests/browser/methods/observe.js | 4 +- tests/browser/parse.js | 2 +- tests/browser/partials.js | 3 +- tests/browser/references.js | 2 +- tests/browser/render/elements.js | 1 - tests/browser/render/misc.js | 2 - tests/browser/render/output.js | 2 +- tests/browser/twoway.js | 1 - tests/node/parse.js | 2 +- tests/node/toHTML.js | 2 +- 17 files changed, 259 insertions(+), 157 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index e66b171daf..be7f0012b0 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -15,5 +15,8 @@ "statusBar.foreground": "#15202b" }, "peacock.color": "#00c1ce", - "typescript.tsdk": "node_modules/typescript/lib" + "typescript.tsdk": "node_modules/typescript/lib", + "editor.codeActionsOnSave": { + "source.fixAll.eslint": true + } } diff --git a/package-lock.json b/package-lock.json index 85dfe024cf..642f7e9a02 100644 --- a/package-lock.json +++ b/package-lock.json @@ -139,6 +139,12 @@ } } }, + "@types/color-name": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", + "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", + "dev": true + }, "@types/eslint-visitor-keys": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", @@ -389,10 +395,21 @@ "dev": true }, "ansi-escapes": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", - "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", - "dev": true + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.1.tgz", + "integrity": "sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA==", + "dev": true, + "requires": { + "type-fest": "^0.11.0" + }, + "dependencies": { + "type-fest": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.11.0.tgz", + "integrity": "sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ==", + "dev": true + } + } }, "ansi-regex": { "version": "2.1.1", @@ -1076,12 +1093,12 @@ } }, "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=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", "dev": true, "requires": { - "restore-cursor": "^2.0.0" + "restore-cursor": "^3.1.0" } }, "cli-spinner": { @@ -1614,9 +1631,9 @@ } }, "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, "encodeurl": { @@ -1800,53 +1817,54 @@ } }, "eslint": { - "version": "5.14.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.14.0.tgz", - "integrity": "sha512-jrOhiYyENRrRnWlMYANlGZTqb89r2FuRT+615AabBoajhNjeh9ywDNlh2LU9vTqf0WYN+L3xdXuIi7xuj/tK9w==", + "version": "6.8.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.8.0.tgz", + "integrity": "sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", - "ajv": "^6.9.1", + "ajv": "^6.10.0", "chalk": "^2.1.0", "cross-spawn": "^6.0.5", "debug": "^4.0.1", "doctrine": "^3.0.0", - "eslint-scope": "^4.0.0", - "eslint-utils": "^1.3.1", - "eslint-visitor-keys": "^1.0.0", - "espree": "^5.0.1", + "eslint-scope": "^5.0.0", + "eslint-utils": "^1.4.3", + "eslint-visitor-keys": "^1.1.0", + "espree": "^6.1.2", "esquery": "^1.0.1", "esutils": "^2.0.2", "file-entry-cache": "^5.0.1", "functional-red-black-tree": "^1.0.1", - "glob": "^7.1.2", - "globals": "^11.7.0", + "glob-parent": "^5.0.0", + "globals": "^12.1.0", "ignore": "^4.0.6", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", - "inquirer": "^6.2.2", - "js-yaml": "^3.12.0", + "inquirer": "^7.0.0", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.3.0", - "lodash": "^4.17.11", + "lodash": "^4.17.14", "minimatch": "^3.0.4", "mkdirp": "^0.5.1", "natural-compare": "^1.4.0", - "optionator": "^0.8.2", - "path-is-inside": "^1.0.2", + "optionator": "^0.8.3", "progress": "^2.0.0", "regexpp": "^2.0.1", - "semver": "^5.5.1", - "strip-ansi": "^4.0.0", - "strip-json-comments": "^2.0.1", + "semver": "^6.1.2", + "strip-ansi": "^5.2.0", + "strip-json-comments": "^3.0.1", "table": "^5.2.3", - "text-table": "^0.2.0" + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" }, "dependencies": { "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, "ansi-styles": { @@ -1887,6 +1905,36 @@ "eslint-visitor-keys": "^1.1.0" } }, + "glob-parent": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "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.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + }, "minimist": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", @@ -1908,21 +1956,41 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, + "optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "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", + "word-wrap": "~1.2.3" + } + }, "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true }, "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", "dev": true, "requires": { - "ansi-regex": "^3.0.0" + "ansi-regex": "^4.1.0" } }, + "strip-json-comments": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.0.tgz", + "integrity": "sha512-e6/d0eBu7gHtdCqFt0xJr642LdToM5/cN4Qb9DbHjVx1CP5RyeM+zH7pbecEmDv/lBqb0QH+6Uqq75rxFPkM0w==", + "dev": true + }, "supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -1945,9 +2013,9 @@ } }, "eslint-scope": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", - "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.0.0.tgz", + "integrity": "sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw==", "dev": true, "requires": { "esrecurse": "^4.1.0", @@ -1970,20 +2038,20 @@ "dev": true }, "espree": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-5.0.1.tgz", - "integrity": "sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-6.2.1.tgz", + "integrity": "sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw==", "dev": true, "requires": { - "acorn": "^6.0.7", - "acorn-jsx": "^5.0.0", - "eslint-visitor-keys": "^1.0.0" + "acorn": "^7.1.1", + "acorn-jsx": "^5.2.0", + "eslint-visitor-keys": "^1.1.0" }, "dependencies": { "acorn": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz", - "integrity": "sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.1.tgz", + "integrity": "sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg==", "dev": true }, "acorn-jsx": { @@ -2232,9 +2300,9 @@ } }, "figures": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", - "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", "dev": true, "requires": { "escape-string-regexp": "^1.0.5" @@ -3177,10 +3245,13 @@ } }, "globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "dev": true, + "requires": { + "type-fest": "^0.8.1" + } }, "gobble": { "version": "0.12.0", @@ -3664,56 +3735,77 @@ "dev": true }, "inquirer": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz", - "integrity": "sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.1.0.tgz", + "integrity": "sha512-5fJMWEmikSYu0nv/flMc475MhGbB7TSPd/2IpFV4I4rMklboCH2rQjYY5kKiYGHqUF9gvaambupcJFFG9dvReg==", "dev": true, "requires": { - "ansi-escapes": "^3.2.0", - "chalk": "^2.4.2", - "cli-cursor": "^2.1.0", + "ansi-escapes": "^4.2.1", + "chalk": "^3.0.0", + "cli-cursor": "^3.1.0", "cli-width": "^2.0.0", "external-editor": "^3.0.3", - "figures": "^2.0.0", - "lodash": "^4.17.12", - "mute-stream": "0.0.7", - "run-async": "^2.2.0", - "rxjs": "^6.4.0", - "string-width": "^2.1.0", - "strip-ansi": "^5.1.0", + "figures": "^3.0.0", + "lodash": "^4.17.15", + "mute-stream": "0.0.8", + "run-async": "^2.4.0", + "rxjs": "^6.5.3", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", "through": "^2.3.6" }, "dependencies": { "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", "dev": true }, "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", "dev": true, "requires": { - "color-convert": "^1.9.0" + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" } }, "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", "dev": true, "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" } }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "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=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true }, "lodash": { @@ -3722,51 +3814,39 @@ "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", "dev": true }, + "mute-stream": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", + "dev": true + }, "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", "dev": true, "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "dependencies": { - "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" - } - } + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" } }, "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", "dev": true, "requires": { - "ansi-regex": "^4.1.0" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - } + "ansi-regex": "^5.0.0" } }, "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", "dev": true, "requires": { - "has-flag": "^3.0.0" + "has-flag": "^4.0.0" } } } @@ -5485,9 +5565,9 @@ } }, "mimic-fn": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "dev": true }, "minimatch": { @@ -5877,12 +5957,12 @@ } }, "onetime": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", - "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.0.tgz", + "integrity": "sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q==", "dev": true, "requires": { - "mimic-fn": "^1.0.0" + "mimic-fn": "^2.1.0" } }, "optimist": { @@ -6042,12 +6122,6 @@ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, - "path-is-inside": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", - "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", - "dev": true - }, "path-key": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", @@ -6698,12 +6772,12 @@ "dev": true }, "restore-cursor": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", - "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", "dev": true, "requires": { - "onetime": "^2.0.0", + "onetime": "^5.1.0", "signal-exit": "^3.0.2" } }, @@ -7500,6 +7574,12 @@ "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "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", @@ -7775,6 +7855,12 @@ "prelude-ls": "~1.1.2" } }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + }, "type-is": { "version": "1.6.16", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.16.tgz", @@ -8048,6 +8134,12 @@ "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", "dev": true }, + "v8-compile-cache": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz", + "integrity": "sha512-usZBT3PW+LOjM25wbqIlZwPeJV+3OSz3M1k1Ws8snlW39dZyYL9lOGC5FgPVHfk0jKmjiDV8Z0mIbVQPiwFs7g==", + "dev": true + }, "v8flags": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-2.1.1.tgz", @@ -8235,6 +8327,12 @@ } } }, + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true + }, "wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", diff --git a/package.json b/package.json index e4f213d9c0..c75db0e7c3 100755 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "cheerio": "^1.0.0-rc.3", "coveralls": "^3.0.4", "electron": "^3.1.11", - "eslint": "^5.14.0", + "eslint": "^6.8.0", "eslint-plugin-prettier": "^2.7", "fs-plus": "^3.1.1", "gobble": "^0.12.0", diff --git a/src/utils/log.js b/src/utils/log.js index d3a563d93a..a161cddfa4 100644 --- a/src/utils/log.js +++ b/src/utils/log.js @@ -1,4 +1,3 @@ -/* global console */ /* eslint no-console:"off" */ import { hasConsole } from '../config/environment'; diff --git a/tests/browser/events/method-calls.js b/tests/browser/events/method-calls.js index 2794bb7e1e..972cafcab2 100644 --- a/tests/browser/events/method-calls.js +++ b/tests/browser/events/method-calls.js @@ -1,4 +1,3 @@ -/*global window */ import { fire } from 'simulant'; import { initModule } from '../../helpers/test-config'; import { test } from 'qunit'; diff --git a/tests/browser/init/config.js b/tests/browser/init/config.js index 2ee79c8c03..be6270edd4 100644 --- a/tests/browser/init/config.js +++ b/tests/browser/init/config.js @@ -39,7 +39,9 @@ export default function() { 'noCSSTransform' ]; - const actualDefaults = expectedDefaults.filter(key => Ractive.defaults.hasOwnProperty(key)); + const actualDefaults = expectedDefaults.filter(key => + Object.prototype.hasOwnProperty.call(Ractive.defaults, key) + ); t.strictEqual(Ractive.defaults, Ractive.prototype, 'defaults aliases prototype'); t.deepEqual(actualDefaults, expectedDefaults, 'defaults contain expected keys'); @@ -92,7 +94,10 @@ export default function() { const expectedPrototypeRegistries = ['helpers', 'computed']; expectedInstanceRegistries.forEach(registry => { - t.ok(ractive.hasOwnProperty(registry), `Instance has ${registry} registry`); + t.ok( + Object.prototype.hasOwnProperty.call(ractive, registry), + `Instance has ${registry} registry` + ); }); expectedPrototypeRegistries.forEach(registry => { diff --git a/tests/browser/init/registries.js b/tests/browser/init/registries.js index 263118753f..dcfc84599f 100644 --- a/tests/browser/init/registries.js +++ b/tests/browser/init/registries.js @@ -27,7 +27,10 @@ export default function() { registryLocation[name].foo = definition; - t.ok(registryLocation.hasOwnProperty(name), `should have ${name} global registry`); + t.ok( + Object.prototype.hasOwnProperty.call(registryLocation, name), + `should have ${name} global registry` + ); t.strictEqual( ractive[name].foo, registryLocation[name].foo, diff --git a/tests/browser/methods/observe.js b/tests/browser/methods/observe.js index f13eaf5e65..c1479858b3 100644 --- a/tests/browser/methods/observe.js +++ b/tests/browser/methods/observe.js @@ -1838,7 +1838,7 @@ export default function() { t.ok(o === '' && v !== o, 'old value is empty string and new is ' + v); }, old(o, n) { - if (!this.hasOwnProperty('old')) this.old = n; + if (!Object.prototype.hasOwnProperty.call(this, 'old')) this.old = n; return this.old; } }, @@ -1917,7 +1917,7 @@ export default function() { }, old(o, n, k, p) { t.ok(k === 'foo.val' && p === 'val'); - if (!this.hasOwnProperty('old')) this.old = n; + if (!Object.prototype.hasOwnProperty.call(this, 'old')) this.old = n; return this.old; } }, diff --git a/tests/browser/parse.js b/tests/browser/parse.js index 37c0d5d76b..06f2949012 100644 --- a/tests/browser/parse.js +++ b/tests/browser/parse.js @@ -18,7 +18,7 @@ export default function() { // disable for tests unless explicitly specified // we can just test the signatures, so set false theTest.options = theTest.options || { csp: false }; - if (!theTest.options.hasOwnProperty('csp')) { + if (!Object.prototype.hasOwnProperty.call(theTest.options, 'csp')) { theTest.options.csp = false; } if (theTest.error) { diff --git a/tests/browser/partials.js b/tests/browser/partials.js index 1b42bb30a5..b3fb3daadb 100644 --- a/tests/browser/partials.js +++ b/tests/browser/partials.js @@ -1,4 +1,3 @@ -/* global document */ import { initModule, hasUsableConsole, onWarn } from '../helpers/test-config'; import { fire } from 'simulant'; import { test } from 'qunit'; @@ -254,7 +253,7 @@ export default function() { el: fixture }); - t.ok(!ractive.partials.hasOwnProperty('foo')); + t.ok(!Object.prototype.hasOwnProperty.call(ractive.partials, 'foo')); t.deepEqual(Component.partials.foo, [{ t: 7, e: 'p', f: [{ t: 2, r: 'foo' }] }]); }); diff --git a/tests/browser/references.js b/tests/browser/references.js index 1cae423545..6f58604444 100644 --- a/tests/browser/references.js +++ b/tests/browser/references.js @@ -90,7 +90,7 @@ export default function() { }); test('@global special ref gives access to the vm global object', t => { - /* global global, window */ + /* global global */ const target = typeof global !== 'undefined' ? global : window; const r = new Ractive({ el: fixture, diff --git a/tests/browser/render/elements.js b/tests/browser/render/elements.js index 282dd1d966..7fc5c11f9a 100644 --- a/tests/browser/render/elements.js +++ b/tests/browser/render/elements.js @@ -1,4 +1,3 @@ -/*global document, HTMLParagraphElement */ import { initModule } from '../../helpers/test-config'; import { test } from 'qunit'; diff --git a/tests/browser/render/misc.js b/tests/browser/render/misc.js index 8adaad8892..b383b460eb 100644 --- a/tests/browser/render/misc.js +++ b/tests/browser/render/misc.js @@ -1,8 +1,6 @@ import { initModule } from '../../helpers/test-config'; import { test } from 'qunit'; -/* globals window, document */ - export default function() { initModule('render/misc'); diff --git a/tests/browser/render/output.js b/tests/browser/render/output.js index 8ead21d47c..b21c6dbc9a 100644 --- a/tests/browser/render/output.js +++ b/tests/browser/render/output.js @@ -91,7 +91,7 @@ export default function() { const target = {}; for (const key in source) { - if (source.hasOwnProperty(key)) { + if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = deepClone(source[key]); } } diff --git a/tests/browser/twoway.js b/tests/browser/twoway.js index 1e9157c111..ac973fa8ac 100644 --- a/tests/browser/twoway.js +++ b/tests/browser/twoway.js @@ -1,4 +1,3 @@ -/* global document */ import { fire } from 'simulant'; import { hasUsableConsole, onWarn, initModule } from '../helpers/test-config'; import { test } from 'qunit'; diff --git a/tests/node/parse.js b/tests/node/parse.js index e942bd7f41..85809ff86d 100644 --- a/tests/node/parse.js +++ b/tests/node/parse.js @@ -8,7 +8,7 @@ export default function() { // disable for tests unless explicitly specified // we can just test the signatures, so set csp false parseTest.options = parseTest.options || { csp: false }; - if (!parseTest.options.hasOwnProperty('csp')) { + if (!Object.prototype.hasOwnProperty.call(parseTest.options, 'csp')) { parseTest.options.csp = false; } diff --git a/tests/node/toHTML.js b/tests/node/toHTML.js index e4ad72e74e..baa3ce32fa 100644 --- a/tests/node/toHTML.js +++ b/tests/node/toHTML.js @@ -27,7 +27,7 @@ function deepClone(source) { const target = {}; for (const key in source) { - if (source.hasOwnProperty(key)) { + if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = deepClone(source[key]); } } From a89aac026f6f53a77c940040af56d6ce168bb5a1 Mon Sep 17 00:00:00 2001 From: Marco Pasqualetti Date: Tue, 12 May 2020 16:51:44 +0200 Subject: [PATCH 09/47] fix for error writing tsconfig.json https://github.com/microsoft/TypeScript/issues/14538#issuecomment-559074255 --- tsconfig.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index 72241a7080..cf6b4419f0 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,7 +11,8 @@ "allowJs": true, "target": "es5", "noUnusedLocals": true, - "noUnusedParameters": true + "noUnusedParameters": true, + "noEmit": true }, "include": [ "./src/**/*" From d04918dc98bca9a9aaf2261c5b1159f9073f731e Mon Sep 17 00:00:00 2001 From: Marco Pasqualetti Date: Tue, 12 May 2020 17:07:08 +0200 Subject: [PATCH 10/47] setup documentation with typedoc --- .gitignore | 3 ++ package-lock.json | 129 ++++++++++++++++++++++++++++++++++++++++++++-- package.json | 4 +- tsconfig.json | 10 +++- 4 files changed, 141 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 0baa6b3a6e..b6d8f13a43 100755 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,6 @@ perf/control/* # Log files *.log + +# Documentation +docs diff --git a/package-lock.json b/package-lock.json index 642f7e9a02..81445add32 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2559,7 +2559,7 @@ "fs-constants": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", - "integrity": "sha1-a+Dem+mYzhavivwkSXue6bfM2a0=", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", "dev": true }, "fs-exists-sync": { @@ -3553,6 +3553,12 @@ } } }, + "highlight.js": { + "version": "10.0.3", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.0.3.tgz", + "integrity": "sha512-9FG7SSzv9yOY5CGGxfI6NDm7xLYtMOjKtPBxw7Zff3t5UcRcUNTGEeS8lNjhceL34KeetLMoGMFTGoaa83HwyQ==", + "dev": true + }, "homedir-polyfill": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz", @@ -5436,6 +5442,12 @@ "yallist": "^2.1.2" } }, + "lunr": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.8.tgz", + "integrity": "sha512-oxMeX/Y35PNFuZoHp+jUj5OSEmLCaIH4KTFJh7a93cHBoFmpw2IoPs22VIz7vyO2YUnx2Tn9dzIwO2P/4quIRg==", + "dev": true + }, "magic-string": { "version": "0.22.5", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.22.5.tgz", @@ -5483,6 +5495,12 @@ "object-visit": "^1.0.0" } }, + "marked": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-1.0.0.tgz", + "integrity": "sha512-Wo+L1pWTVibfrSr+TTtMuiMfNzmZWiOPeO7rZsQUY5bgsxpHesBEcIWJloWVTFnrMXnf/TL30eTFSGJddmQAng==", + "dev": true + }, "matcher-collection": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/matcher-collection/-/matcher-collection-1.0.5.tgz", @@ -5546,7 +5564,7 @@ "mime": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha1-Ms2eXGRVO9WNGaVor0Uqz/BJgbE=", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", "dev": true }, "mime-db": { @@ -7035,6 +7053,17 @@ "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", "dev": true }, + "shelljs": { + "version": "0.8.4", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.4.tgz", + "integrity": "sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==", + "dev": true, + "requires": { + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" + } + }, "signal-exit": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", @@ -7877,6 +7906,100 @@ "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", "dev": true }, + "typedoc": { + "version": "0.17.6", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.17.6.tgz", + "integrity": "sha512-pQiYnhG3yJk7939cv2n8uFoTsSgy5Hfiw0dgOQYa9nT9Ya1013dMctQdAXMj8JbNu7KhcauQyq9Zql9D/TziLw==", + "dev": true, + "requires": { + "fs-extra": "^8.1.0", + "handlebars": "^4.7.6", + "highlight.js": "^10.0.0", + "lodash": "^4.17.15", + "lunr": "^2.3.8", + "marked": "1.0.0", + "minimatch": "^3.0.0", + "progress": "^2.0.3", + "shelljs": "^0.8.4", + "typedoc-default-themes": "^0.10.1" + }, + "dependencies": { + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true, + "optional": true + }, + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "dev": true + }, + "handlebars": { + "version": "4.7.6", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.6.tgz", + "integrity": "sha512-1f2BACcBfiwAfStCKZNrUCgqNZkGsAT7UM3kkYtXuLo0KnaVfjKOyf7PRzB6++aK9STyT1Pd2ZCPe3EGOXleXA==", + "dev": true, + "requires": { + "minimist": "^1.2.5", + "neo-async": "^2.6.0", + "source-map": "^0.6.1", + "uglify-js": "^3.1.4", + "wordwrap": "^1.0.0" + } + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "uglify-js": { + "version": "3.9.2", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.9.2.tgz", + "integrity": "sha512-zGVwKslUAD/EeqOrD1nQaBmXIHl1Vw371we8cvS8I6mYK9rmgX5tv8AAeJdfsQ3Kk5mGax2SVV/AizxdNGhl7Q==", + "dev": true, + "optional": true, + "requires": { + "commander": "~2.20.3" + } + } + } + }, + "typedoc-default-themes": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/typedoc-default-themes/-/typedoc-default-themes-0.10.1.tgz", + "integrity": "sha512-SuqAQI0CkwhqSJ2kaVTgl37cWs733uy9UGUqwtcds8pkFK8oRF4rZmCq+FXTGIb9hIUOu40rf5Kojg0Ha6akeg==", + "dev": true, + "requires": { + "lunr": "^2.3.8" + } + }, "typescript": { "version": "3.8.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.8.3.tgz", @@ -8274,7 +8397,7 @@ "websocket-extensions": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.3.tgz", - "integrity": "sha1-XS/yKXcAPsaHpLhwc9+7rBRszyk=", + "integrity": "sha512-nqHUnMXmBzT0w570r2JpJxfiSD1IzoI+HGVdd3aZ0yNi3ngvQ4jv1dtHt5VGxfI2yj5yqImPhOK4vmIh2xMbGg==", "dev": true }, "which": { diff --git a/package.json b/package.json index c75db0e7c3..1cc544adb7 100755 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "rollup": "^0.55.3", "rollup-plugin-istanbul": "^2", "tslib": "^1.11.2", + "typedoc": "^0.17.6", "typescript": "^3.8.3" }, "scripts": { @@ -69,6 +70,7 @@ "build:ci:pr": "sh ./scripts/build-ci-pr.sh", "build:ci:dev": "sh ./scripts/build-ci-dev.sh", "report:coveralls": "cat .build/coverage/combined/lcov.info | coveralls", - "release:manual": "sh ./scripts/release-manual.sh" + "release:manual": "sh ./scripts/release-manual.sh", + "doc": "typedoc" } } diff --git a/tsconfig.json b/tsconfig.json index cf6b4419f0..c81fcdb7d4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,5 +16,13 @@ }, "include": [ "./src/**/*" - ] + ], + "typedocOptions": { + "inputFiles": [ + "./src" + ], + "mode": "modules", + "out": "docs", + "excludePrivate": true + } } From 111b59838ea1732d7794a983ea2476437c5a2111 Mon Sep 17 00:00:00 2001 From: Marco Pasqualetti Date: Wed, 13 May 2020 18:27:23 +0200 Subject: [PATCH 11/47] prototype toHTML to ts --- src/Ractive/prototype/toHTML.js | 3 --- src/Ractive/prototype/toHTML.ts | 8 ++++++++ tsconfig.json | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) delete mode 100644 src/Ractive/prototype/toHTML.js create mode 100644 src/Ractive/prototype/toHTML.ts diff --git a/src/Ractive/prototype/toHTML.js b/src/Ractive/prototype/toHTML.js deleted file mode 100644 index 1ac311be00..0000000000 --- a/src/Ractive/prototype/toHTML.js +++ /dev/null @@ -1,3 +0,0 @@ -export default function Ractive$toHTML() { - return this.fragment.toString(true); -} diff --git a/src/Ractive/prototype/toHTML.ts b/src/Ractive/prototype/toHTML.ts new file mode 100644 index 0000000000..ea883e73c8 --- /dev/null +++ b/src/Ractive/prototype/toHTML.ts @@ -0,0 +1,8 @@ +/** + * Returns a chunk of HTML representing the current state of the instance. + * This is most useful when you're using Ractive in node.js, as it allows + * you to serve fully-rendered pages (good for SEO and initial pageload performance) to the client. + */ +export default function Ractive$toHTML(): string { + return this.fragment.toString(true); +} diff --git a/tsconfig.json b/tsconfig.json index c81fcdb7d4..3570c884fd 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -19,7 +19,7 @@ ], "typedocOptions": { "inputFiles": [ - "./src" + "./src/Ractive" ], "mode": "modules", "out": "docs", From 2922e18fb6aa0086a37112250e745cd1b807ffea Mon Sep 17 00:00:00 2001 From: Marco Pasqualetti Date: Wed, 13 May 2020 19:04:50 +0200 Subject: [PATCH 12/47] add documentation for observe --- src/Ractive/prototype/observe.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/Ractive/prototype/observe.js b/src/Ractive/prototype/observe.js index 6a245a8d00..76001fd9c0 100755 --- a/src/Ractive/prototype/observe.js +++ b/src/Ractive/prototype/observe.js @@ -7,6 +7,28 @@ import PatternObserver from './observe/Pattern'; import ArrayObserver from './observe/Array'; import { keys } from 'utils/object'; +/** + * Observes the data at a particular keypath. + * Unless specified otherwise, the callback will be fired immediately, + * with `undefined` as `oldValue`. Thereafter it will be called whenever the observed keypath changes. + * + * @example ractive.observe(keypath, callback[, options]) + * @example ractive.observe(map[, options]) + * + * @param keypath The keypath to observe, or a group of space-separated keypaths. + * Any of the keys can be a `*` character, which is treated as a wildcard. A `**` means recursive. + * The difference between `*` and `**` is that `*` provides your callback function value and keypath + * arguments containing the path of the what actually changed, at any level of the keypath. + * So instead of getting the same parent value on every change, you get the changed value from whatever arbitrarily + * deep keypath changed. + * + * @param callback The function that will be called, with `newValue`, `oldValue` and keypath as arguments + * (see Observers for more nuance regarding these arguments), whenever the observed keypath changes value. + * By default the function will be called with ractive as this. Any wildcards in the keypath will have their + * matches passed to the callback at the end of the arguments list as well. + * + * @param options A map of keypath-observer pairs. + */ export default function observe(keypath, callback, options) { const observers = []; let map; From 894ef4e7995c976c108da8ae19f54763a4884930 Mon Sep 17 00:00:00 2001 From: Marco Pasqualetti Date: Thu, 14 May 2020 19:00:32 +0200 Subject: [PATCH 13/47] refactor: convert utils/is to ts --- src/utils/is.js | 53 ----------------------------------------- src/utils/is.ts | 63 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 53 deletions(-) delete mode 100644 src/utils/is.js create mode 100644 src/utils/is.ts diff --git a/src/utils/is.js b/src/utils/is.js deleted file mode 100644 index e6f6828cc6..0000000000 --- a/src/utils/is.js +++ /dev/null @@ -1,53 +0,0 @@ -const toString = Object.prototype.toString; -const arrayLikePattern = /^\[object (?:Array|FileList)\]$/; - -export function isArrayLike(obj) { - return arrayLikePattern.test(toString.call(obj)); -} - -export const isArray = Array.isArray; - -export function isEqual(a, b) { - if (a === null && b === null) { - return true; - } - - if (isObjectType(a) || isObjectType(b)) { - return false; - } - - return a === b; -} - -// http://stackoverflow.com/questions/18082/validate-numbers-in-javascript-isnumeric -export function isNumeric(thing) { - return !isNaN(parseFloat(thing)) && isFinite(thing); -} - -export function isObject(thing) { - return thing && toString.call(thing) === '[object Object]'; -} - -export function isObjectLike(thing) { - return !!(thing && (isObjectType(thing) || isFunction(thing))); -} - -export function isObjectType(thing) { - return typeof thing === 'object'; -} - -export function isFunction(thing) { - return typeof thing === 'function'; -} - -export function isString(thing) { - return typeof thing === 'string'; -} - -export function isNumber(thing) { - return typeof thing === 'number'; -} - -export function isUndefined(thing) { - return thing === undefined; -} diff --git a/src/utils/is.ts b/src/utils/is.ts new file mode 100644 index 0000000000..d02311408f --- /dev/null +++ b/src/utils/is.ts @@ -0,0 +1,63 @@ +const toString = Object.prototype.toString; + +/* Basic */ + +export function isString(thing: unknown): thing is string { + return typeof thing === 'string'; +} + +export function isUndefined(thing: unknown): thing is undefined { + return thing === undefined; +} + +export function isFunction(thing: unknown): thing is Function { + return typeof thing === 'function'; +} + +export function isNumber(thing: unknown): thing is number { + return typeof thing === 'number'; +} + +/** + * @see http://stackoverflow.com/questions/18082/validate-numbers-in-javascript-isnumeric + */ +export function isNumeric(thing: string | number): boolean { + return !isNaN(parseFloat(thing as string)) && isFinite(thing as number); +} + +/* Object */ + +export function isObject(thing: unknown): boolean { + return thing && toString.call(thing) === '[object Object]'; +} + +export function isObjectType(thing: unknown): thing is object { + return typeof thing === 'object'; +} + +export function isObjectLike(thing: unknown): boolean { + return !!(thing && (isObjectType(thing) || isFunction(thing))); +} + +/* Array */ + +export const isArray = Array.isArray; + +const arrayLikePattern = /^\[object (?:Array|FileList)\]$/; +export function isArrayLike(obj: unknown): boolean { + return arrayLikePattern.test(toString.call(obj)); +} + +/* Misc */ + +export function isEqual(a: object, b: object): boolean { + if (a === null && b === null) { + return true; + } + + if (isObjectType(a) || isObjectType(b)) { + return false; + } + + return a === b; +} From 406842079553d5d4df01d6c5bc1c533dc3796cd5 Mon Sep 17 00:00:00 2001 From: Marco Pasqualetti Date: Thu, 14 May 2020 20:21:20 +0200 Subject: [PATCH 14/47] refactor: convert noop to ts --- src/utils/noop.js | 1 - src/utils/noop.ts | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) delete mode 100644 src/utils/noop.js create mode 100644 src/utils/noop.ts diff --git a/src/utils/noop.js b/src/utils/noop.js deleted file mode 100644 index 6ab80bc8d7..0000000000 --- a/src/utils/noop.js +++ /dev/null @@ -1 +0,0 @@ -export default function() {} diff --git a/src/utils/noop.ts b/src/utils/noop.ts new file mode 100644 index 0000000000..f5b222a65e --- /dev/null +++ b/src/utils/noop.ts @@ -0,0 +1,2 @@ +// eslint-disable-next-line @typescript-eslint/no-empty-function +export default function(): void {} From c057886cde7a322e9c58b10c9957b6b3c3aa4ebf Mon Sep 17 00:00:00 2001 From: Marco Pasqualetti Date: Fri, 15 May 2020 08:02:00 +0200 Subject: [PATCH 15/47] refactor: convert utils/object to ts --- src/types/PlainObject.ts | 3 +++ src/utils/{object.js => object.ts} | 34 +++++++++++++++++------------- tsconfig.json | 1 + 3 files changed, 23 insertions(+), 15 deletions(-) create mode 100644 src/types/PlainObject.ts rename src/utils/{object.js => object.ts} (68%) diff --git a/src/types/PlainObject.ts b/src/types/PlainObject.ts new file mode 100644 index 0000000000..7020a622d5 --- /dev/null +++ b/src/types/PlainObject.ts @@ -0,0 +1,3 @@ +export interface PlainObject { + [key: string]: never; +} diff --git a/src/utils/object.js b/src/utils/object.ts similarity index 68% rename from src/utils/object.js rename to src/utils/object.ts index 47292f280b..a847bbf938 100644 --- a/src/utils/object.js +++ b/src/utils/object.ts @@ -1,8 +1,24 @@ -export function hasOwn(obj, prop) { +import { PlainObject } from 'types/PlainObject'; + +const obj = Object; + +// TODO might worth to convert into a class with only static methods? + +export const assign = obj.assign; + +export const create = obj.create; + +export const defineProperty = obj.defineProperty; + +export const defineProperties = obj.defineProperties; + +export const keys = obj.keys; + +export function hasOwn(obj: object, prop: string): boolean { return Object.prototype.hasOwnProperty.call(obj, prop); } -export function fillGaps(target, ...sources) { +export function fillGaps(target: PlainObject, ...sources: Array): PlainObject { for (let i = 0; i < sources.length; i++) { const source = sources[i]; for (const key in source) { @@ -15,7 +31,7 @@ export function fillGaps(target, ...sources) { return target; } -export function toPairs(obj = {}) { +export function toPairs(obj: PlainObject = {}): Array { const pairs = []; for (const key in obj) { // Source can be a prototype-less object. @@ -24,15 +40,3 @@ export function toPairs(obj = {}) { } return pairs; } - -const obj = Object; - -export const assign = obj.assign; - -export const create = obj.create; - -export const defineProperty = obj.defineProperty; - -export const defineProperties = obj.defineProperties; - -export const keys = obj.keys; diff --git a/tsconfig.json b/tsconfig.json index 3570c884fd..52d0dd90f0 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,6 +6,7 @@ "config/*": ["src/config/*"], "parse/*": ["src/parse/*"], "shared/*": ["src/shared/*"], + "types/*": ["src/types/*"], "utils/*": ["src/utils/*"] }, "allowJs": true, From 588524521c589c2f0ca327c16794182120ddada8 Mon Sep 17 00:00:00 2001 From: Marco Pasqualetti Date: Fri, 15 May 2020 08:21:11 +0200 Subject: [PATCH 16/47] refactor: convert shared.keypath to ts --- src/shared/{keypaths.js => keypaths.ts} | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) rename src/shared/{keypaths.js => keypaths.ts} (75%) diff --git a/src/shared/keypaths.js b/src/shared/keypaths.ts similarity index 75% rename from src/shared/keypaths.js rename to src/shared/keypaths.ts index c39d0b5d6d..e156db71bc 100644 --- a/src/shared/keypaths.js +++ b/src/shared/keypaths.ts @@ -5,7 +5,7 @@ const splitPattern = /([^\\](?:\\\\)*)\./; const escapeKeyPattern = /\\|\./g; const unescapeKeyPattern = /((?:\\)+)\1|\\(\.)/g; -export function escapeKey(key) { +export function escapeKey(key: string): string { if (isString(key)) { return key.replace(escapeKeyPattern, '\\$&'); } @@ -13,13 +13,13 @@ export function escapeKey(key) { return key; } -export function normalise(ref) { +export function normalise(ref: string): string { return ref ? ref.replace(refPattern, '.$1') : ''; } -export function splitKeypath(keypath) { +export function splitKeypath(keypath: string): Array { const result = []; - let match; + let match: RegExpExecArray; keypath = normalise(keypath); @@ -34,7 +34,7 @@ export function splitKeypath(keypath) { return result; } -export function unescapeKey(key) { +export function unescapeKey(key: string): string { if (isString(key)) { return key.replace(unescapeKeyPattern, '$1$2'); } From b4fc26da15e9436d6b8e18f5087f80e524233479 Mon Sep 17 00:00:00 2001 From: Marco Pasqualetti Date: Fri, 15 May 2020 08:40:53 +0200 Subject: [PATCH 17/47] refactor: replace Array<*> with *[] --- src/shared/keypaths.ts | 2 +- src/utils/cleanCss.ts | 4 ++-- src/utils/object.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/shared/keypaths.ts b/src/shared/keypaths.ts index e156db71bc..47dca370a7 100644 --- a/src/shared/keypaths.ts +++ b/src/shared/keypaths.ts @@ -17,7 +17,7 @@ export function normalise(ref: string): string { return ref ? ref.replace(refPattern, '.$1') : ''; } -export function splitKeypath(keypath: string): Array { +export function splitKeypath(keypath: string): string[] { const result = []; let match: RegExpExecArray; diff --git a/src/utils/cleanCss.ts b/src/utils/cleanCss.ts index c801711fbf..4c25c1bfc2 100644 --- a/src/utils/cleanCss.ts +++ b/src/utils/cleanCss.ts @@ -13,9 +13,9 @@ const value = /\0(\d+)/g; export default function( css: string, callback: Function, - additionalReplaceRules: Array = [] + additionalReplaceRules: RegExp[] = [] ): object | string { - const values: Array = []; + const values: string[] = []; const reconstruct = function(css: string): string { return css.replace(value, (_match: string, n: number) => values[n]); }; diff --git a/src/utils/object.ts b/src/utils/object.ts index a847bbf938..f086d44a3d 100644 --- a/src/utils/object.ts +++ b/src/utils/object.ts @@ -18,7 +18,7 @@ export function hasOwn(obj: object, prop: string): boolean { return Object.prototype.hasOwnProperty.call(obj, prop); } -export function fillGaps(target: PlainObject, ...sources: Array): PlainObject { +export function fillGaps(target: PlainObject, ...sources: PlainObject[]): PlainObject { for (let i = 0; i < sources.length; i++) { const source = sources[i]; for (const key in source) { @@ -31,7 +31,7 @@ export function fillGaps(target: PlainObject, ...sources: Array): P return target; } -export function toPairs(obj: PlainObject = {}): Array { +export function toPairs(obj: PlainObject = {}): PlainObject[] { const pairs = []; for (const key in obj) { // Source can be a prototype-less object. From 6336bc3a8f6d03e8b3d84091479c843208941b90 Mon Sep 17 00:00:00 2001 From: Marco Pasqualetti Date: Fri, 15 May 2020 08:45:36 +0200 Subject: [PATCH 18/47] refactor: convert utils/array to ts --- src/utils/{array.js => array.ts} | 35 ++++++++++++++------------------ 1 file changed, 15 insertions(+), 20 deletions(-) rename src/utils/{array.js => array.ts} (75%) diff --git a/src/utils/array.js b/src/utils/array.ts similarity index 75% rename from src/utils/array.js rename to src/utils/array.ts index 8462863c9b..33c0283ad8 100644 --- a/src/utils/array.js +++ b/src/utils/array.ts @@ -1,6 +1,8 @@ import { isArray, isString, isUndefined } from './is'; -export function addToArray(array, value) { +// TODO refine types on params and return + +export function addToArray(array: unknown[], value: unknown): void { const index = array.indexOf(value); if (index === -1) { @@ -8,19 +10,12 @@ export function addToArray(array, value) { } } -export function arrayContains(array, value) { - for (let i = 0, c = array.length; i < c; i++) { - if (array[i] == value) { - return true; - } - } - - return false; +export function arrayContains(array: unknown[], value: unknown): boolean { + const valueIndex = array.indexOf(value); + return valueIndex !== -1; } -export function arrayContentsMatch(a, b) { - let i; - +export function arrayContentsMatch(a, b): boolean { if (!isArray(a) || !isArray(b)) { return false; } @@ -29,7 +24,7 @@ export function arrayContentsMatch(a, b) { return false; } - i = a.length; + let i = a.length; while (i--) { if (a[i] !== b[i]) { return false; @@ -39,7 +34,7 @@ export function arrayContentsMatch(a, b) { return true; } -export function ensureArray(x) { +export function ensureArray(x: unknown): unknown { if (isString(x)) { return [x]; } @@ -51,11 +46,11 @@ export function ensureArray(x) { return x; } -export function lastItem(array) { +export function lastItem(array: unknown[]): unknown { return array[array.length - 1]; } -export function removeFromArray(array, member) { +export function removeFromArray(array: unknown[], member: unknown): void { if (!array) { return; } @@ -67,7 +62,7 @@ export function removeFromArray(array, member) { } } -export function combine(...arrays) { +export function combine(...arrays): unknown[] { const res = arrays.concat.apply([], arrays); let i = res.length; while (i--) { @@ -78,7 +73,7 @@ export function combine(...arrays) { return res; } -export function toArray(arrayLike) { +export function toArray(arrayLike): Array { const array = []; let i = arrayLike.length; while (i--) { @@ -88,7 +83,7 @@ export function toArray(arrayLike) { return array; } -export function findMap(array, fn) { +export function findMap(array, fn): unknown { const len = array.length; for (let i = 0; i < len; i++) { const result = fn(array[i]); @@ -96,7 +91,7 @@ export function findMap(array, fn) { } } -export function buildNewIndices(one, two, comparator) { +export function buildNewIndices(one, two, comparator): unknown { let oldArray = one; let newArray = two; if (comparator) { From 7a2e46874abd2e9d08ff53c9e46c353f7ad503d3 Mon Sep 17 00:00:00 2001 From: Marco Pasqualetti Date: Fri, 15 May 2020 09:22:26 +0200 Subject: [PATCH 19/47] refactor: convert protype/find to ts --- src/Ractive/prototype/find.js | 17 --------------- src/Ractive/prototype/find.ts | 40 +++++++++++++++++++++++++++++++++++ src/types/Options.ts | 6 ++++++ 3 files changed, 46 insertions(+), 17 deletions(-) delete mode 100644 src/Ractive/prototype/find.js create mode 100644 src/Ractive/prototype/find.ts create mode 100644 src/types/Options.ts diff --git a/src/Ractive/prototype/find.js b/src/Ractive/prototype/find.js deleted file mode 100644 index f78aa5153e..0000000000 --- a/src/Ractive/prototype/find.js +++ /dev/null @@ -1,17 +0,0 @@ -export default function Ractive$find(selector, options = {}) { - if (!this.rendered) - throw new Error( - `Cannot call ractive.find('${selector}') unless instance is rendered to the DOM` - ); - - let node = this.fragment.find(selector, options); - if (node) return node; - - if (options.remote) { - for (let i = 0; i < this._children.length; i++) { - if (!this._children[i].instance.fragment.rendered) continue; - node = this._children[i].instance.find(selector, options); - if (node) return node; - } - } -} diff --git a/src/Ractive/prototype/find.ts b/src/Ractive/prototype/find.ts new file mode 100644 index 0000000000..0c6c1fa219 --- /dev/null +++ b/src/Ractive/prototype/find.ts @@ -0,0 +1,40 @@ +import { FindOptions } from 'src/types/Options'; + +/** + * Returns the first element inside a given Ractive instance matching a CSS selector. + * This is similar to doing `this.el.querySelector(selector)` (though it doesn't actually use `querySelector()`). + * + * @example + * + * ``` + * var r = Ractive({ + * el: '#main', + * template: '#tpl' + * }) + * + * setTimeout(() => { + * var p = r.find('p.target') + * console.log(p.outerHTML) + * }, 1000) + * ``` + * + * @param selector A CSS selector representing the element to find. + * @param options + */ +export default function Ractive$find(selector: string, options: FindOptions = {}): HTMLElement { + if (!this.rendered) + throw new Error( + `Cannot call ractive.find('${selector}') unless instance is rendered to the DOM` + ); + + let node = this.fragment.find(selector, options); + if (node) return node; + + if (options.remote) { + for (let i = 0; i < this._children.length; i++) { + if (!this._children[i].instance.fragment.rendered) continue; + node = this._children[i].instance.find(selector, options); + if (node) return node; + } + } +} diff --git a/src/types/Options.ts b/src/types/Options.ts new file mode 100644 index 0000000000..238b684190 --- /dev/null +++ b/src/types/Options.ts @@ -0,0 +1,6 @@ +export interface FindOptions { + /** + * Include attached children that are not rendered in anchors when looking for matching elements + */ + remote?: boolean; +} From 61137f8d743edbc55392cdbd12b22c5714f8d023 Mon Sep 17 00:00:00 2001 From: Marco Pasqualetti Date: Fri, 15 May 2020 10:18:57 +0200 Subject: [PATCH 20/47] refactor: convert protype/findComponent to ts --- src/Ractive/prototype.js | 2 +- src/Ractive/prototype/findComponent.js | 22 ---------- src/Ractive/prototype/findComponent.ts | 61 ++++++++++++++++++++++++++ 3 files changed, 62 insertions(+), 23 deletions(-) delete mode 100644 src/Ractive/prototype/findComponent.js create mode 100644 src/Ractive/prototype/findComponent.ts diff --git a/src/Ractive/prototype.js b/src/Ractive/prototype.js index 87b15548a4..9d0c4dc6ed 100644 --- a/src/Ractive/prototype.js +++ b/src/Ractive/prototype.js @@ -6,8 +6,8 @@ import detach from './prototype/detach'; import detachChild from './prototype/detachChild'; import find from './prototype/find'; import findAll from './prototype/findAll'; -import findAllComponents from './prototype/findAllComponents'; import findComponent from './prototype/findComponent'; +import findAllComponents from './prototype/findAllComponents'; import findContainer from './prototype/findContainer'; import findParent from './prototype/findParent'; import fire from './prototype/fire'; diff --git a/src/Ractive/prototype/findComponent.js b/src/Ractive/prototype/findComponent.js deleted file mode 100644 index 29c39d8bb2..0000000000 --- a/src/Ractive/prototype/findComponent.js +++ /dev/null @@ -1,22 +0,0 @@ -import { isObjectType } from 'utils/is'; - -export default function Ractive$findComponent(selector, options = {}) { - if (isObjectType(selector)) { - options = selector; - selector = ''; - } - - let child = this.fragment.findComponent(selector, options); - if (child) return child; - - if (options.remote) { - if (!selector && this._children.length) return this._children[0].instance; - for (let i = 0; i < this._children.length; i++) { - // skip children that are or should be in an anchor - if (this._children[i].target) continue; - if (this._children[i].name === selector) return this._children[i].instance; - child = this._children[i].instance.findComponent(selector, options); - if (child) return child; - } - } -} diff --git a/src/Ractive/prototype/findComponent.ts b/src/Ractive/prototype/findComponent.ts new file mode 100644 index 0000000000..772cbf1d81 --- /dev/null +++ b/src/Ractive/prototype/findComponent.ts @@ -0,0 +1,61 @@ +import { isObjectType } from 'utils/is'; +import { FindOptions } from 'src/types/Options'; + +// TODO replace unkown with Ractive after we create ractive file + +/** + * Find the first component belonging to this instance. + */ +export function Ractive$findComponent(opts?: FindOptions): unknown; + +export function Ractive$findComponent(name: string, opts?: FindOptions): unknown; + +/** + * Returns the first component inside a given Ractive instance with the given `name` (or the first component of any kind if no name is given). + * + * @example + * ``` + * var Component = Ractive.extend({ + * template: 'Component {{number}}' + * }) + * + * var r = Ractive({ + * el: '#main', + * template: '#tpl', + * components: { + * Component: Component + * } + * }) + * + * setTimeout(() => { + * var c = r.findComponent('Component') + * console.log(c.toHTML()) + * }, 1000) + * ``` + * + * @param name The name of the component to find. + * @param options + */ +export default function Ractive$findComponent( + name: string | FindOptions, + options: FindOptions = {} +): unknown { + if (isObjectType(name)) { + options = name; + name = ''; + } + + let child = this.fragment.findComponent(name, options); + if (child) return child; + + if (options.remote) { + if (!name && this._children.length) return this._children[0].instance; + for (let i = 0; i < this._children.length; i++) { + // skip children that are or should be in an anchor + if (this._children[i].target) continue; + if (this._children[i].name === name) return this._children[i].instance; + child = this._children[i].instance.findComponent(name, options); + if (child) return child; + } + } +} From 2479c24e1d4e058bc1a4b6becb1edb7adbb206ba Mon Sep 17 00:00:00 2001 From: Marco Pasqualetti Date: Fri, 15 May 2020 12:07:50 +0200 Subject: [PATCH 21/47] refactor: convert TransitionManager to ts inline functions in the file have been converted to private static functions --- src/global/TransitionManager.js | 167 ----------------------------- src/global/TransitionManager.ts | 179 ++++++++++++++++++++++++++++++++ 2 files changed, 179 insertions(+), 167 deletions(-) delete mode 100755 src/global/TransitionManager.js create mode 100755 src/global/TransitionManager.ts diff --git a/src/global/TransitionManager.js b/src/global/TransitionManager.js deleted file mode 100755 index 27850f1faf..0000000000 --- a/src/global/TransitionManager.js +++ /dev/null @@ -1,167 +0,0 @@ -import { removeFromArray } from 'utils/array'; -import { isFunction } from 'utils/is'; - -let id = 0; - -export default class TransitionManager { - constructor(callback, parent) { - this.callback = callback; - this.parent = parent; - - this.intros = []; - this.outros = []; - - this.children = []; - this.totalChildren = this.outroChildren = 0; - - this.detachQueue = []; - this.outrosComplete = false; - - this.id = id++; - - if (parent) { - parent.addChild(this); - } - } - - add(transition) { - const list = transition.isIntro ? this.intros : this.outros; - transition.starting = true; - list.push(transition); - } - - addChild(child) { - this.children.push(child); - - this.totalChildren += 1; - this.outroChildren += 1; - } - - checkStart() { - if (this.parent && this.parent.started) this.start(); - } - - decrementOutros() { - this.outroChildren -= 1; - check(this); - } - - decrementTotal() { - this.totalChildren -= 1; - check(this); - } - - detachNodes() { - let len = this.detachQueue.length; - for (let i = 0; i < len; i++) this.detachQueue[i].detach(); - len = this.children.length; - for (let i = 0; i < len; i++) this.children[i].detachNodes(); - this.detachQueue = []; - } - - ready() { - if (this.detachQueue.length) detachImmediate(this); - } - - remove(transition) { - const list = transition.isIntro ? this.intros : this.outros; - removeFromArray(list, transition); - check(this); - } - - start() { - this.started = true; - this.children.forEach(c => c.start()); - this.intros.concat(this.outros).forEach(t => t.start()); - check(this); - } -} - -function check(tm) { - if (!tm.started || tm.outros.length || tm.outroChildren) return; - - // If all outros are complete, and we haven't already done this, - // we notify the parent if there is one, otherwise - // start detaching nodes - if (!tm.outrosComplete) { - tm.outrosComplete = true; - - if (tm.parent) tm.parent.decrementOutros(tm); - - if (allOutrosComplete(tm)) { - tm.detachNodes(); - } - } - - // Once everything is done, we can notify parent transition - // manager and call the callback - if (!tm.intros.length && !tm.totalChildren) { - if (isFunction(tm.callback)) { - tm.callback(); - } - - if (tm.parent && !tm.notifiedTotal) { - tm.notifiedTotal = true; - tm.parent.decrementTotal(); - } - } -} - -function allOutrosComplete(manager) { - return !manager || (manager.outrosComplete && allOutrosComplete(manager.parent)); -} - -// check through the detach queue to see if a node is up or downstream from a -// transition and if not, go ahead and detach it -function detachImmediate(manager) { - const queue = manager.detachQueue; - const outros = collectAllOutros(manager); - - if (!outros.length) { - manager.detachNodes(); - } else { - let i = queue.length; - let j = 0; - let node, trans; - const nqueue = (manager.detachQueue = []); - - start: while (i--) { - node = queue[i].node; - j = outros.length; - while (j--) { - trans = outros[j].element.node; - // check to see if the node is, contains, or is contained by the transitioning node - if (trans === node || trans.contains(node) || node.contains(trans)) { - nqueue.push(queue[i]); - continue start; - } - } - - // no match, we can drop it - queue[i].detach(); - } - } -} - -function collectAllOutros(manager, _list) { - let list = _list; - - // if there's no list, we're starting at the root to build one - if (!list) { - list = []; - let parent = manager; - while (parent.parent) parent = parent.parent; - return collectAllOutros(parent, list); - } else { - // grab all outros from child managers - let i = manager.children.length; - while (i--) { - list = collectAllOutros(manager.children[i], list); - } - - // grab any from this manager if there are any - if (manager.outros.length) list = list.concat(manager.outros); - - return list; - } -} diff --git a/src/global/TransitionManager.ts b/src/global/TransitionManager.ts new file mode 100755 index 0000000000..e7a5192e0e --- /dev/null +++ b/src/global/TransitionManager.ts @@ -0,0 +1,179 @@ +import { removeFromArray } from 'utils/array'; +import { isFunction } from 'utils/is'; + +let id = 0; + +export default class TransitionManager { + private callback: Function; + private parent: TransitionManager; + + private intros = []; + private outros = []; + private children = []; + + private totalChildren = 0; + private outroChildren = 0; + + public detachQueue = []; + private outrosComplete = false; + + id: number; + + private started: boolean; + + private notifiedTotal: boolean; + + constructor(callback: Function, parent: TransitionManager) { + this.callback = callback; + this.parent = parent; + + this.id = id++; + + if (parent) { + parent.addChild(this); + } + } + + public add(transition): void { + const list = transition.isIntro ? this.intros : this.outros; + transition.starting = true; + list.push(transition); + } + + public addChild(child: TransitionManager): void { + this.children.push(child); + + this.totalChildren += 1; + this.outroChildren += 1; + } + + public checkStart(): void { + if (this.parent && this.parent.started) this.start(); + } + + private decrementOutros(): void { + this.outroChildren -= 1; + this.check(); + } + + private decrementTotal(): void { + this.totalChildren -= 1; + this.check(); + } + + private detachNodes(): void { + let len = this.detachQueue.length; + for (let i = 0; i < len; i++) this.detachQueue[i].detach(); + len = this.children.length; + for (let i = 0; i < len; i++) this.children[i].detachNodes(); + this.detachQueue = []; + } + + public ready(): void { + if (this.detachQueue.length) this.detachImmediate(); + } + + public remove(transition): void { + const list = transition.isIntro ? this.intros : this.outros; + removeFromArray(list, transition); + this.check(); + } + + public start(): void { + this.started = true; + this.children.forEach(c => c.start()); + this.intros.concat(this.outros).forEach(t => t.start()); + this.check(); + } + + private check(): void { + if (!this.started || this.outros.length || this.outroChildren) return; + + // If all outros are complete, and we haven't already done this, + // we notify the parent if there is one, otherwise + // start detaching nodes + if (!this.outrosComplete) { + this.outrosComplete = true; + + if (this.parent) this.parent.decrementOutros(); + + if (TransitionManager.allOutrosComplete(this)) { + this.detachNodes(); + } + } + + // Once everything is done, we can notify parent transition + // manager and call the callback + if (!this.intros.length && !this.totalChildren) { + if (isFunction(this.callback)) { + this.callback(); + } + + if (this.parent && !this.notifiedTotal) { + this.notifiedTotal = true; + this.parent.decrementTotal(); + } + } + } + + // check through the detach queue to see if a node is up or downstream from a + // transition and if not, go ahead and detach it + private detachImmediate(): void { + const queue = this.detachQueue; + const outros = TransitionManager.collectAllOutros(this); + + if (!outros.length) { + this.detachNodes(); + } else { + let i = queue.length; + let j = 0; + let node, trans; + const nqueue = (this.detachQueue = []); + + start: while (i--) { + node = queue[i].node; + j = outros.length; + while (j--) { + trans = outros[j].element.node; + // check to see if the node is, contains, or is contained by the transitioning node + if (trans === node || trans.contains(node) || node.contains(trans)) { + nqueue.push(queue[i]); + continue start; + } + } + + // no match, we can drop it + queue[i].detach(); + } + } + } + + private static allOutrosComplete(manager: TransitionManager): boolean { + return ( + !manager || (manager.outrosComplete && TransitionManager.allOutrosComplete(manager.parent)) + ); + } + + private static collectAllOutros(manager: TransitionManager, _list?): any[] { + let list = _list; + + // if there's no list, we're starting at the root to build one + if (!list) { + list = []; + let parent = manager; + while (parent.parent) parent = parent.parent; + return TransitionManager.collectAllOutros(parent, list); + } else { + // grab all outros from child managers + let i = manager.children.length; + while (i--) { + list = TransitionManager.collectAllOutros(manager.children[i], list); + } + + // grab any from this manager if there are any + if (manager.outros.length) list = list.concat(manager.outros); + + return list; + } + } +} From 92bbb6f6ed5fa01b973d1682822b4ca4c5e68d73 Mon Sep 17 00:00:00 2001 From: Marco Pasqualetti Date: Fri, 15 May 2020 12:52:29 +0200 Subject: [PATCH 22/47] refactor: convert runloop to ts --- src/global/runloop.js | 148 ------------------------------------ src/global/runloop.ts | 173 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 173 insertions(+), 148 deletions(-) delete mode 100755 src/global/runloop.js create mode 100755 src/global/runloop.ts diff --git a/src/global/runloop.js b/src/global/runloop.js deleted file mode 100755 index aa5d707521..0000000000 --- a/src/global/runloop.js +++ /dev/null @@ -1,148 +0,0 @@ -import { addToArray } from 'utils/array'; -import TransitionManager from './TransitionManager'; - -export let batch; - -const runloop = { - active() { - return !!batch; - }, - - start() { - let fulfilPromise; - const promise = new Promise(f => (fulfilPromise = f)); - - batch = { - previousBatch: batch, - transitionManager: new TransitionManager(fulfilPromise, batch && batch.transitionManager), - fragments: [], - tasks: [], - immediateObservers: [], - deferredObservers: [], - promise - }; - - return promise; - }, - - end() { - flushChanges(); - - if (!batch.previousBatch) batch.transitionManager.start(); - else batch.transitionManager.checkStart(); - - batch = batch.previousBatch; - }, - - addFragment(fragment) { - addToArray(batch.fragments, fragment); - }, - - // TODO: come up with a better way to handle fragments that trigger their own update - addFragmentToRoot(fragment) { - if (!batch) return; - - let b = batch; - while (b.previousBatch) { - b = b.previousBatch; - } - - addToArray(b.fragments, fragment); - }, - - addObserver(observer, defer) { - if (!batch) { - observer.dispatch(); - } else { - addToArray(defer ? batch.deferredObservers : batch.immediateObservers, observer); - } - }, - - registerTransition(transition) { - transition._manager = batch.transitionManager; - batch.transitionManager.add(transition); - }, - - // synchronise node detachments with transition ends - detachWhenReady(thing) { - batch.transitionManager.detachQueue.push(thing); - }, - - scheduleTask(task, postRender) { - let _batch; - - if (!batch) { - task(); - } else { - _batch = batch; - while (postRender && _batch.previousBatch) { - // this can't happen until the DOM has been fully updated - // otherwise in some situations (with components inside elements) - // transitions and decorators will initialise prematurely - _batch = _batch.previousBatch; - } - - _batch.tasks.push(task); - } - }, - - promise() { - if (!batch) return Promise.resolve(); - - let target = batch; - while (target.previousBatch) { - target = target.previousBatch; - } - - return target.promise || Promise.resolve(); - } -}; - -export default runloop; - -function dispatch(observer) { - observer.dispatch(); -} - -function flushChanges() { - let which = batch.immediateObservers; - batch.immediateObservers = []; - which.forEach(dispatch); - - // Now that changes have been fully propagated, we can update the DOM - // and complete other tasks - let i = batch.fragments.length; - let fragment; - - which = batch.fragments; - batch.fragments = []; - - while (i--) { - fragment = which[i]; - fragment.update(); - } - - batch.transitionManager.ready(); - - which = batch.deferredObservers; - batch.deferredObservers = []; - which.forEach(dispatch); - - const tasks = batch.tasks; - batch.tasks = []; - - for (i = 0; i < tasks.length; i += 1) { - tasks[i](); - } - - // If updating the view caused some model blowback - e.g. a triple - // containing