diff --git a/.editorconfig b/.editorconfig index 854167bbed..ed2a319d58 100644 --- a/.editorconfig +++ b/.editorconfig @@ -8,6 +8,9 @@ indent_size = 2 charset = utf-8 trim_trailing_whitespace = true +[test/**/expected.css] +insert_final_newline = false + [{package.json,.travis.yml,.eslintrc.json}] indent_style = space indent_size = 2 diff --git a/.gitignore b/.gitignore index ed21efb721..472328464c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,16 +1,19 @@ .DS_Store .nyc_output node_modules +/cli/ /compiler/ /ssr/ /shared.js /scratch/ /coverage/ /coverage.lcov/ +/test/cli/samples/*/actual /test/sourcemaps/samples/*/output.js /test/sourcemaps/samples/*/output.js.map +/test/sourcemaps/samples/*/output.css +/test/sourcemaps/samples/*/output.css.map /src/compile/shared.ts -/package-lock.json /store.umd.js /yarn-error.log _actual*.* \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 5aba7e8a73..de91162ece 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ node_js: env: global: - - BUILD_TIMEOUT=10000 + - BUILD_TIMEOUT=20000 addons: apt: @@ -15,6 +15,6 @@ addons: install: - export DISPLAY=':99.0' - Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & - - npm install + - npm ci || npm install after_success: npm run codecov diff --git a/CHANGELOG.md b/CHANGELOG.md index bd71fd4a95..e325b45793 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,272 @@ # Svelte changelog +## 2.14.3 + +* Account for directive dependencies ([#1793](https://github.com/sveltejs/svelte/issues/1793)) +* Detach each block iterations in each blocks with no update method ([#1795](https://github.com/sveltejs/svelte/issues/1795)) + +## 2.14.2 + +* Fix issue with nested `{#if}` blocks ([#1780](https://github.com/sveltejs/svelte/issues/1780)) + +## 2.14.1 + +* Fix block insertion order regression ([#1778](https://github.com/sveltejs/svelte/issues/1778)) +* Fix blocks inside `` ([#1774](https://github.com/sveltejs/svelte/issues/1774)) +* Better attribute parsing ([#1772](https://github.com/sveltejs/svelte/issues/1772)) +* Fix parse errors inside directives ([#1788](https://github.com/sveltejs/svelte/issues/1788)) + + +## 2.14.0 + +* Refactor internals ([#1678](https://github.com/sveltejs/svelte/issues/1678)) +* Deprecate `onerror` option ([#1745](https://github.com/sveltejs/svelte/issues/1745)) +* Handle edge cases where `destroy` is called before `mount` ([#1653](https://github.com/sveltejs/svelte/pull/1653)) +* Make `scroll` binding more efficient ([#1579](https://github.com/sveltejs/svelte/pull/1770)) +* Make 'readonly property' store error more informative ([#1761](https://github.com/sveltejs/svelte/pull/1761)) + +## 2.13.5 + +* Fix missing dependencies in shorthand class directives ([#1739](https://github.com/sveltejs/svelte/issues/1739)) + +## 2.13.4 + +* Support dynamic `import()` in template expressions + +## 2.13.3 + +* Fix bug with keyed each blocks and nested components ([#1706](https://github.com/sveltejs/svelte/issues/1706)) + +## 2.13.2 + +* Coalesce simultaneous store/component updates ([#1520](https://github.com/sveltejs/svelte/issues/1520)) +* Fix nested transitions preventing each block item removal ([#1617](https://github.com/sveltejs/svelte/issues/1617)) +* Add `class` directive shorthand and encapsulate styles ([#1695](https://github.com/sveltejs/svelte/pull/1695)) +* Prevent erroneous updates of bound inputs ([#1699](https://github.com/sveltejs/svelte/issues/1699)) + +## 2.13.1 + +* Coerce second argument to `toggleClass` ([#1685](https://github.com/sveltejs/svelte/issues/1685)) + +## 2.13.0 + +* Add `class` directive ([#890](https://github.com/sveltejs/svelte/issues/890)) +* Remove sourcemaps from npm package ([#1690](https://github.com/sveltejs/svelte/pull/1690)) + +## 2.12.1 + +* Allow actions to take any expression ([#1676](https://github.com/sveltejs/svelte/issues/1676)) +* Run transitions in component context ([#1675](https://github.com/sveltejs/svelte/issues/1675)) +* Correctly set select value on mount ([#1666](https://github.com/sveltejs/svelte/issues/1666)) +* Support `{@debug}` in SSR ([#1659](https://github.com/sveltejs/svelte/issues/1659)) +* Don't treat ` ` as empty whitespace ([#1658](https://github.com/sveltejs/svelte/issues/1658)) +* Fix outros for if blocks with no else ([#1688](https://github.com/sveltejs/svelte/pull/1688)) +* Set `style.cssText` in spread attributes ([#1684](https://github.com/sveltejs/svelte/pull/1684)) + + +## 2.12.0 + +* Initialise actions on mount rather than hydrate ([#1653](https://github.com/sveltejs/svelte/pull/1653)) +* Allow non-existent components to be destroyed ([#1677](https://github.com/sveltejs/svelte/pull/1677)) +* Pass AMD ID from CLI correctly ([#1672](https://github.com/sveltejs/svelte/pull/1672)) +* Minor AST tweaks ([#1673](https://github.com/sveltejs/svelte/pull/1673), [#1674](https://github.com/sveltejs/svelte/pull/1674)) +* Reduce code duplication in component initialisation ([#1670](https://github.com/sveltejs/svelte/pull/1670)) + + +## 2.11.0 + +* Add `--shared` CLI option ([#1649](https://github.com/sveltejs/svelte/pull/1649)) +* Run first `onstate` *before* fragment is rendered ([#1522](https://github.com/sveltejs/svelte/issues/1522)) +* Exclude current computed prop from state object ([#1544](https://github.com/sveltejs/svelte/issues/1544)) + + +## 2.10.1 + +* Add sourcemaps to `{@debug}` tags ([#1647](https://github.com/sveltejs/svelte/pull/1647)) + +## 2.10.0 + +* Add a `{@debug}` tag, for inspecting values in templates in dev mode ([#1635](https://github.com/sveltejs/svelte/issues/1635)) +* Fix dimension bindings in iOS ([#1642](https://github.com/sveltejs/svelte/pull/1642)) + +## 2.9.11 + +* Pass props to custom elements rather than setting attributes, where appropriate ([#875](https://github.com/sveltejs/svelte/issues/875)) +* Handle whitespace in lists consistently between SSR and DOM renderers ([#1637](https://github.com/sveltejs/svelte/pull/1637)) +* Improve error for invalid `ref` names ([#1613](https://github.com/sveltejs/svelte/issues/1613)) + +## 2.9.10 + +* Handle `null` consistently in tags ([#1598](https://github.com/sveltejs/svelte/issues/1598)) +* Support object rest in computed properties ([#1540](https://github.com/sveltejs/svelte/issues/1540)) +* Always update dynamic components when expression changes ([#1621](https://github.com/sveltejs/svelte/issues/1621)) +* Encapsulate local styles inside global styles ([#1618](https://github.com/sveltejs/svelte/issues/1618)) + +## 2.9.9 + +* Fix attribute name regex ([#1623](https://github.com/sveltejs/svelte/pull/1623)) + +## 2.9.8 + +* Sanitize spread attributes in SSR — fixes vulnerability CVE-2018-6341 ([#1623](https://github.com/sveltejs/svelte/pull/1623)) + +## 2.9.7 + +* Allow `` ([#1608](https://github.com/sveltejs/svelte/issues/1608)) +* Ensure child window exists before removing listener in `addResizeHandler` ([#1600](https://github.com/sveltejs/svelte/issues/1600)) +* Handle transitions in `else` block ([#1589](https://github.com/sveltejs/svelte/issues/1589)) + +## 2.9.6 + +* Provide more useful error if SSR component attempts to render non-SSR component ([#1605](https://github.com/sveltejs/svelte/issues/1605)) + +## 2.9.5 + +* Null out refs to dynamic components ([#1596](https://github.com/sveltejs/svelte/issues/1596)) + +## 2.9.4 + +* Make identifier optional for `then` and `catch` blocks ([#1507](https://github.com/sveltejs/svelte/issues/1507)) +* Group outros correctly ([#1575](https://github.com/sveltejs/svelte/issues/1575)) + +## 2.9.3 + +* Fix bug when an each block contains transitions but its else branch does not ([#1559](https://github.com/sveltejs/svelte/issues/1559)) +* If an event handler throws an exception, don't block all future calls to that handler ([#1573](https://github.com/sveltejs/svelte/issues/1573)) + +## 2.9.2 + +* Fix conflict when using multiple if-else blocks, some of which use outros and some of which do not ([#1580](https://github.com/sveltejs/svelte/issues/1580)) +* Fix some cases where `.innerHTML` was being used to create child elements when it shouldn't ([#1581](https://github.com/sveltejs/svelte/issues/1581)) + +## 2.9.1 + +* Use `template.content` instead of `template` where appropriate ([#1571](https://github.com/sveltejs/svelte/issues/1571)) + +## 2.9.0 + +* Play outro transitions on `` if `nestedTransitions` is true ([#1568](https://github.com/sveltejs/svelte/issues/1568)) +* Allow illegal identifiers to be component prop names, for e.g. spreading `data-foo` props ([#887](https://github.com/sveltejs/svelte/issues/887)) +* Abort transition when node is detached ([#1561](https://github.com/sveltejs/svelte/issues/1561)) +* Only include `transitionManager` when necessary ([#1514](https://github.com/sveltejs/svelte/issues/1514)) + +## 2.8.1 + +* Fix prefixed animation name replacement ([#1556](https://github.com/sveltejs/svelte/pull/1556)) + +## 2.8.0 + +* Correctly set store on nested components (to parent store, not root store) ([#1538](https://github.com/sveltejs/svelte/issues/1538)) + +## 2.7.2 + +* Prevent unnecessary remounts ([#1527](https://github.com/sveltejs/svelte/issues/1527)) +* Allow `refs.*` as callee ([#1526](https://github.com/sveltejs/svelte/pull/1526)) +* Handle empty lists when outroing ([#1532](https://github.com/sveltejs/svelte/issues/1532)) + +## 2.7.1 + +* Fix spread props with multiple dependencies ([#1515](https://github.com/sveltejs/svelte/issues/1515)) + +## 2.7.0 + +* Add `__svelte_meta` object to elements in dev mode, containing source info ([#1499](https://github.com/sveltejs/svelte/issues/1499)) +* Fix `bind:online` in dev mode ([#1502](https://github.com/sveltejs/svelte/issues/1502)) +* Update v1 warnings/errors ([#1508](https://github.com/sveltejs/svelte/pull/1508)) +* Transform prefixed keyframes ([#1504](https://github.com/sveltejs/svelte/issues/1504)) + +## 2.6.6 + +* Fix nested transition bug ([#1497](https://github.com/sveltejs/svelte/issues/1497)) + +## 2.6.5 + +* Handle cases where only some `if` block branches have outros ([#1492](https://github.com/sveltejs/svelte/issues/1492)) + +## 2.6.4 + +* Web worker support ([#1487](https://github.com/sveltejs/svelte/issues/1487)) +* Update dynamic component bindings when component changes ([#1489](https://github.com/sveltejs/svelte/issues/1489)) + +## 2.6.3 + +* Nested transitions respect `skipIntroByDefault` ([#1460](https://github.com/sveltejs/svelte/issues/1460)) +* Always create outro for top-level block ([#1470](https://github.com/sveltejs/svelte/issues/1470)) + +## 2.6.2 + +* Fix spread+bindings on dynamic components ([#1433](https://github.com/sveltejs/svelte/issues/1433)) +* Abort in-progress animations, if a new one starts ([#1458](https://github.com/sveltejs/svelte/issues/1458)) +* Allow animations to be parameterised ([#1462](https://github.com/sveltejs/svelte/issues/1462)) + +## 2.6.1 + +* Absolutely position outroing animated nodes ([#1457](https://github.com/sveltejs/svelte/pull/1457)) + +## 2.6.0 + +* Add `animate` directive ([#1454](https://github.com/sveltejs/svelte/pull/1454)) +* Add `skipIntroByDefault` compiler option and `intro: true` init option ([#1448](https://github.com/sveltejs/svelte/pull/1448)) +* Add `nestedTransitions` compiler option ([#1451](https://github.com/sveltejs/svelte/pull/1451)) +* Component outros, if `nestedTransitions` is true ([#1211](https://github.com/sveltejs/svelte/issues/1211)) +* Allow transition functions to return a function, for inter-transition coordination ([#1453](https://github.com/sveltejs/svelte/pull/1453)) +* Pass `1 - t` as second argument to transition functions ([#1452](https://github.com/sveltejs/svelte/pull/1452)) + +## 2.5.1 + +* Add new ARIA attributes ([#1436](https://github.com/sveltejs/svelte/pull/1436)) +* Add `Promise` to whitelisted globals ([#1441](https://github.com/sveltejs/svelte/issues/1441)) +* Allow spaces around reserved keyword attributes ([#1445](https://github.com/sveltejs/svelte/issues/1445)) + +## 2.5.0 + +* Support transitions in `await` blocks ([#956](https://github.com/sveltejs/svelte/issues/956)) +* Abort outros if block is recreated ([#1425](https://github.com/sveltejs/svelte/issues/1425)) +* Wait until transitions have completed before removing styles ([#648](https://github.com/sveltejs/svelte/issues/648)) +* Support event shorthand on dynamic components ([#1427](https://github.com/sveltejs/svelte/pull/1427)) +* Various codegen improvements ([#1419](https://github.com/sveltejs/svelte/pull/1419), [#1421](https://github.com/sveltejs/svelte/pull/1421), [#1422](https://github.com/sveltejs/svelte/pull/1422), [#1424](https://github.com/sveltejs/svelte/pull/1424)) +* Correctly handle `await` blocks with no dynamic content ([#1417](https://github.com/sveltejs/svelte/issues/1417)) +* Allow spread props on elements with static attribute tests ([#1429](https://github.com/sveltejs/svelte/pull/1429)) + + +## 2.4.4 + +* Declare missing variable in Store ([#1415](https://github.com/sveltejs/svelte/issues/1415)) +* ALways declare spread levels ([#1413](https://github.com/sveltejs/svelte/issues/1413)) + +## 2.4.3 + +* `ref` directives prevent HTMLified content ([#1407](https://github.com/sveltejs/svelte/issues/1407)) +* Store computed properties update components immediately upon declaration ([#1327](https://github.com/sveltejs/svelte/issues/1327)) + +## 2.4.2 + +* Evaluate `each` key in child scope ([#1397](https://github.com/sveltejs/svelte/issues/1397)) +* Prevent false negatives and positives when detecting cyclical computed store properties ([#1399](https://github.com/sveltejs/svelte/issues/1399)) +* Only update dynamic component props ([#1394](https://github.com/sveltejs/svelte/issues/1394)) + +## 2.4.1 + +* Fix DOM event context ([#1390](https://github.com/sveltejs/svelte/issues/1390)) + +## 2.4.0 + +* Integrate CLI ([#1360](https://github.com/sveltejs/svelte/issues/1360)) +* Allow arbitrary destructuring for each block items, with binding ([#1385](https://github.com/sveltejs/svelte/pull/1385)) +* Each block keys can use arbitrary expressions ([#703](https://github.com/sveltejs/svelte/issues/703)) +* `bind:offsetWidth`, `bind:offsetHeight`, `bind:clientWidth` and `bind:clientHeight` ([#984](https://github.com/sveltejs/svelte/issues/984)) +* Leaner generated code for `each` blocks ([#1287](https://github.com/sveltejs/svelte/issues/1287)) + + +## 2.3.0 + +* Allow computed properties to have entire state object as dependency ([#1303](https://github.com/sveltejs/svelte/issues/1303)) +* Fix `stats` when `options.generate` is `false` ([#1368](https://github.com/sveltejs/svelte/issues/1368)) +* Assign custom methods to custom elements ([#1369](https://github.com/sveltejs/svelte/issues/1369)) +* Fix `this` value in custom event handlers ([#1297](https://github.com/sveltejs/svelte/issues/1297)) +* Re-evaluate `each` values lazily ([#1286](https://github.com/sveltejs/svelte/issues/1286)) +* Preserve outer context in `await` blocks ([#1251](https://github.com/sveltejs/svelte/issues/1251)) + ## 2.2.0 * Internal refactoring ([#1367](https://github.com/sveltejs/svelte/pull/1367)) diff --git a/README.md b/README.md index 1bc64caa9a..2335d2dd18 100644 --- a/README.md +++ b/README.md @@ -5,31 +5,44 @@ The magical disappearing UI framework. * [Read the introductory blog post](https://svelte.technology/blog/frameworks-without-the-framework) * [Read the guide](https://svelte.technology/guide) * [Try it out](https://svelte.technology/repl) -* [Chat on Gitter](https://gitter.im/sveltejs/svelte) +* [Chat on Discord](https://discord.gg/yy75DKs) --- +## Tooling + This is the Svelte compiler, which is primarily intended for authors of tooling that integrates Svelte with different build systems. If you just want to write Svelte components and use them in your app, you probably want one of those tools: -* [svelte-cli](https://github.com/sveltejs/svelte-cli) – Command line interface for compiling components -* [rollup-plugin-svelte](https://github.com/rollup/rollup-plugin-svelte) – Rollup plugin -* [sveltify](https://github.com/tehshrike/sveltify) - Browserify transform +### Build Systems + * [gulp-svelte](https://github.com/shinnn/gulp-svelte) - gulp plugin * [metalsmith-svelte](https://github.com/shinnn/metalsmith-svelte) - Metalsmith plugin * [system-svelte](https://github.com/CanopyTax/system-svelte) – System.js loader * [svelte-loader](https://github.com/sveltejs/svelte-loader) – Webpack loader * [meteor-svelte](https://github.com/klaussner/meteor-svelte) – Meteor build plugin * [sveltejs-brunch](https://github.com/StarpTech/sveltejs-brunch) – Brunch build plugin +* [rollup-plugin-svelte](https://github.com/rollup/rollup-plugin-svelte) – Rollup plugin +* [parcel-plugin-svelte](https://github.com/DeMoorJasper/parcel-plugin-svelte) - Parcel build plugin +* [sveltify](https://github.com/tehshrike/sveltify) - Browserify transform + +### CSS Preprocessors + +* [Less](https://github.com/ls-age/svelte-preprocess-less) +* [modular-css](https://github.com/tivac/modular-css/tree/master/packages/svelte) +* [PostCSS](https://github.com/TehShrike/svelte-preprocess-postcss) +* [Sass](https://github.com/ls-age/svelte-preprocess-sass) + +### Additional tools + * [svelte-dev-store](https://github.com/GarethOates/svelte-dev-store) - Use Redux tools to visualise Svelte store * More to come! - ## Example usage ```js import * as svelte from 'svelte'; -const { code, map } = svelte.compile(source, { +const { js, css, ast } = svelte.compile(source, { // the target module format – defaults to 'es' (ES2015 modules), can // also be 'amd', 'cjs', 'umd', 'iife' or 'eval' format: 'umd', @@ -126,14 +139,60 @@ The `style` and `script` preprocessors will run *after* the `markup` preprocesso ## Example/starter repos +* [sveltejs/template](https://github.com/sveltejs/template) — the 'official' starter template +* [sveltejs/template-webpack](https://github.com/sveltejs/template-webpack) — using webpack for bundling * [charpeni/svelte-example](https://github.com/charpeni/svelte-example) - Some Svelte examples with configured Rollup, Babel, ESLint, directives, Two-Way binding, and nested components * [EmilTholin/svelte-test](https://github.com/EmilTholin/svelte-test) * [lukechinworth/codenames](https://github.com/lukechinworth/codenames/tree/svelte) – example integration with Redux * [khtdr/svelte-redux-shopping-cart](https://github.com/khtdr/svelte-redux-shopping-cart) – Redux Shopping Cart example (with devtools and hot-reloading) -## BrowserStack - -

To keep Svelte's performance in check, we use BrowserStack to quickly run benchmarks for each PR that immediately give feedback to the contributor. You can see how we use BrowserStack in the svelte-bench project and check out BrowserStack's services on their website.

+## Development + +Pull requests are encouraged and always welcome. [Pick an issue](https://github.com/sveltejs/svelte/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc) and help us out! + +To install and work on Svelte locally: + +```bash +git clone git@github.com:sveltejs/svelte.git +cd svelte +npm install +npm run dev +``` + +The compiler is written in [TypeScript](https://www.typescriptlang.org/), but don't let that put you off — it's basically just JavaScript with type annotations. You'll pick it up in no time. If you're using an editor other than [VSCode](https://code.visualstudio.com/) you may need to install a plugin in order to get syntax highlighting and code hints etc. + +### Linking to a Live Project + +You can make changes locally to Svelte and test it against any Svelte project. You can also use a [default template](https://github.com/sveltejs/template) for development. Instruction on setup are found in that project repository. + +From your project: + +```bash +cd ~/path/to/your-svelte-project +npm install ~/path/to/svelte +``` + +And you should be good to test changes locally. + +To undo this and link to the official latest Svelte release, just run: + +```bash +npm install svelte@latest +``` + +### Running Tests + +```bash +npm run test +``` + +For running single tests, you can use pattern matching: + +```bash +npm run test -- -g "includes AST in svelte.compile output" +``` + +Alternately, you can add `solo: true` to any given `test/../_config.js` file, but **remember never to commit that setting.** ## License diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000000..2bb4b96513 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,6830 @@ +{ + "name": "svelte", + "version": "2.14.2", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@babel/code-frame": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-beta.51.tgz", + "integrity": "sha1-vXHZsZKvl435FYKdOdQJRFZDmgw=", + "dev": true, + "requires": { + "@babel/highlight": "7.0.0-beta.51" + } + }, + "@babel/generator": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.0.0-beta.51.tgz", + "integrity": "sha1-bHV1/952HQdIXgS67cA5LG2eMPY=", + "dev": true, + "requires": { + "@babel/types": "7.0.0-beta.51", + "jsesc": "^2.5.1", + "lodash": "^4.17.5", + "source-map": "^0.5.0", + "trim-right": "^1.0.1" + }, + "dependencies": { + "jsesc": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.1.tgz", + "integrity": "sha1-5CGiqOINawgZ3yiQj3glJrlt0f4=", + "dev": true + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + } + } + }, + "@babel/helper-function-name": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.51.tgz", + "integrity": "sha1-IbSHSiJ8+Z7K/MMKkDAtpaJkBWE=", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "7.0.0-beta.51", + "@babel/template": "7.0.0-beta.51", + "@babel/types": "7.0.0-beta.51" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.51.tgz", + "integrity": "sha1-MoGy0EWvlcFyzpGyCCXYXqRnZBE=", + "dev": true, + "requires": { + "@babel/types": "7.0.0-beta.51" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0-beta.51.tgz", + "integrity": "sha1-imw/ZsTSZTUvwHdIT59ugKUauXg=", + "dev": true, + "requires": { + "@babel/types": "7.0.0-beta.51" + } + }, + "@babel/highlight": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0-beta.51.tgz", + "integrity": "sha1-6IRK4loVlcz9QriWI7Q3bKBtIl0=", + "dev": true, + "requires": { + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^3.0.0" + } + }, + "@babel/parser": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.0.0-beta.51.tgz", + "integrity": "sha1-J87C30Cd9gr1gnDtj2qlVAnqhvY=", + "dev": true + }, + "@babel/template": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.0.0-beta.51.tgz", + "integrity": "sha1-lgKkCuvPNXrpZ34lMu9fyBD1+/8=", + "dev": true, + "requires": { + "@babel/code-frame": "7.0.0-beta.51", + "@babel/parser": "7.0.0-beta.51", + "@babel/types": "7.0.0-beta.51", + "lodash": "^4.17.5" + } + }, + "@babel/traverse": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.0.0-beta.51.tgz", + "integrity": "sha1-mB2vLOw0emIx06odnhgDsDqqpKg=", + "dev": true, + "requires": { + "@babel/code-frame": "7.0.0-beta.51", + "@babel/generator": "7.0.0-beta.51", + "@babel/helper-function-name": "7.0.0-beta.51", + "@babel/helper-split-export-declaration": "7.0.0-beta.51", + "@babel/parser": "7.0.0-beta.51", + "@babel/types": "7.0.0-beta.51", + "debug": "^3.1.0", + "globals": "^11.1.0", + "invariant": "^2.2.0", + "lodash": "^4.17.5" + } + }, + "@babel/types": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.0.0-beta.51.tgz", + "integrity": "sha1-2AK3tUO1g2x3iqaReXq/APPZfqk=", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.5", + "to-fast-properties": "^2.0.0" + } + }, + "@types/estree": { + "version": "0.0.38", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.38.tgz", + "integrity": "sha512-F/v7t1LwS4vnXuPooJQGBRKRGIoxWUTmA4VHfqjOccFsNDThD5bfUNpITive6s352O7o384wcpEaDV8rHCehDA==", + "dev": true + }, + "@types/mocha": { + "version": "5.2.5", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.5.tgz", + "integrity": "sha512-lAVp+Kj54ui/vLUFxsJTMtWvZraZxum3w3Nwkble2dNuV5VnPA+Mi2oGX9XYJAaIvZi3tn3cbjS/qcJXRb6Bww==", + "dev": true + }, + "@types/node": { + "version": "10.5.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.5.6.tgz", + "integrity": "sha512-c5Z1j1ysgo4878ptz6gxLcgMfJ6Wf908R3l5KAGabr0XJ72ZFmOCgsaodPpNYTfp4iOrSwgTDvR/BxbFfB4zPQ==", + "dev": true + }, + "abab": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.0.tgz", + "integrity": "sha512-sY5AXXVZv4Y1VACTtR11UJCPHHudgY5i26Qj5TypE6DKlIApbwb5uqhXcJ5UUGbvZNRh7EeIoW+LrJumBsKp7w==", + "dev": true + }, + "acorn": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.1.tgz", + "integrity": "sha512-d+nbxBUGKg7Arpsvbnlq61mc12ek3EY8EQldM3GPAhWJ1UVxC6TDGbIvUMNU6obBX3i1+ptCIzV4vq0gFPEGVQ==", + "dev": true + }, + "acorn-dynamic-import": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-3.0.0.tgz", + "integrity": "sha512-zVWV8Z8lislJoOKKqdNMOB+s6+XV5WERty8MnKBeFgwA+19XJjJHs2RP5dzM57FftIs+jQnRToLiWazKr6sSWg==", + "dev": true, + "requires": { + "acorn": "^5.0.0" + } + }, + "acorn-globals": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.1.0.tgz", + "integrity": "sha512-KjZwU26uG3u6eZcfGbTULzFcsoz6pegNKtHPksZPOUsiKo5bUmiBPa38FuHZ/Eun+XYh/JCCkS9AS3Lu4McQOQ==", + "dev": true, + "requires": { + "acorn": "^5.0.0" + } + }, + "acorn-jsx": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-4.1.1.tgz", + "integrity": "sha512-JY+iV6r+cO21KtntVvFkD+iqjtdpRUpGqKWgfkCdZq1R+kbreEl8EcdcJR4SmiIgsIQT33s6QzheQ9a275Q8xw==", + "dev": true, + "requires": { + "acorn": "^5.0.3" + } + }, + "agadoo": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/agadoo/-/agadoo-1.0.1.tgz", + "integrity": "sha512-rEOSqXQ3ABoxmgvxqEvUfS7mcMJBqRhcMbmJq4j+EpCXN0P1cFHYQT66V7rYSu0C+3jialSk58yHTBqzY0m+Sw==", + "dev": true, + "requires": { + "rollup": "^0.64.1", + "rollup-plugin-virtual": "^1.0.1" + }, + "dependencies": { + "@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 + }, + "rollup": { + "version": "0.64.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-0.64.1.tgz", + "integrity": "sha512-+ThdVXrvonJdOTzyybMBipP0uz605Z8AnzWVY3rf+cSGnLO7uNkJBlN+9jXqWOomkvumXfm/esmBpA5d53qm7g==", + "dev": true, + "requires": { + "@types/estree": "0.0.39", + "@types/node": "*" + } + } + } + }, + "ajv": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "dev": true, + "requires": { + "co": "^4.6.0", + "fast-deep-equal": "^1.0.0", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.3.0" + } + }, + "ajv-keywords": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.2.0.tgz", + "integrity": "sha1-6GuBnGAs+IIa1jdBNpjx3sAhhHo=", + "dev": true + }, + "ansi-escapes": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", + "integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==", + "dev": true + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "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" + } + }, + "anymatch": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", + "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", + "dev": true, + "requires": { + "micromatch": "^2.1.5", + "normalize-path": "^2.0.0" + } + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "argv": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/argv/-/argv-0.0.2.tgz", + "integrity": "sha1-7L0W+JSbFXGDcRsb2jNPN4QBhas=", + "dev": true + }, + "arr-diff": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", + "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "dev": true, + "requires": { + "arr-flatten": "^1.0.1" + } + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true + }, + "array-equal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", + "integrity": "sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM=", + "dev": true + }, + "array-find-index": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", + "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", + "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", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "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.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "dev": true, + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + }, + "async-each": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", + "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=", + "dev": true + }, + "async-limiter": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", + "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==", + "dev": true + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "dev": true + }, + "aws4": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.7.0.tgz", + "integrity": "sha512-32NDda82rhwD9/JBCCkB+MRYDp0oSvlo2IL6rQWA10PQi7tDUM3eqMSltXmY+Oyl/7N3P3qNtAlv7X0d9bI28w==", + "dev": true + }, + "babel-code-frame": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "dev": true, + "requires": { + "chalk": "^1.1.3", + "esutils": "^2.0.2", + "js-tokens": "^3.0.2" + }, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + } + } + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "dev": true, + "optional": true, + "requires": { + "tweetnacl": "^0.14.3" + } + }, + "binary-extensions": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.11.0.tgz", + "integrity": "sha1-RqoXUftqL5PuXmibsQh9SxTGwgU=", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", + "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "dev": true, + "requires": { + "expand-range": "^1.8.1", + "preserve": "^0.2.0", + "repeat-element": "^1.1.2" + } + }, + "browser-process-hrtime": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-0.1.2.tgz", + "integrity": "sha1-Ql1opY00R/AqBKqJQYf86K+Le44=", + "dev": true + }, + "browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true + }, + "buble": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/buble/-/buble-0.19.3.tgz", + "integrity": "sha512-3B0Lcy2u6x6km0BqTz/FS3UnrOJlnIlBWsyjvtqzdtmWkqiS0+Sg4hc6L9Mmm63hZKTACpYS9vUeIoKSi1vcrQ==", + "dev": true, + "requires": { + "acorn": "^5.4.1", + "acorn-dynamic-import": "^3.0.0", + "acorn-jsx": "^4.1.1", + "chalk": "^2.3.1", + "magic-string": "^0.22.4", + "minimist": "^1.2.0", + "os-homedir": "^1.0.1", + "vlq": "^1.0.0" + }, + "dependencies": { + "magic-string": { + "version": "0.22.5", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.22.5.tgz", + "integrity": "sha512-oreip9rJZkzvA8Qzk9HFs8fZGF/u7H/gtrE8EN6RjKJ9kh2HlC+yQ2QezifqTZfGyiuAV0dRv5a+y/8gBb1m9w==", + "dev": true, + "requires": { + "vlq": "^0.2.2" + }, + "dependencies": { + "vlq": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/vlq/-/vlq-0.2.3.tgz", + "integrity": "sha512-DRibZL6DsNhIgYQ+wNdWDL2SL3bKPlVrRiBqV5yuMm++op8W4kGFtaQfCs4KEJn0wBZcHVHJ3eoywX8983k1ow==", + "dev": true + } + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + } + } + }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "dev": true + }, + "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" + } + }, + "callsites": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", + "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", + "dev": true + }, + "camelcase": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", + "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=", + "dev": true + }, + "camelcase-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", + "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", + "dev": true, + "requires": { + "camelcase": "^2.0.0", + "map-obj": "^1.0.0" + } + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "chardet": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", + "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=", + "dev": true + }, + "chokidar": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", + "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", + "dev": true, + "requires": { + "anymatch": "^1.3.0", + "async-each": "^1.0.0", + "fsevents": "^1.0.0", + "glob-parent": "^2.0.0", + "inherits": "^2.0.1", + "is-binary-path": "^1.0.0", + "is-glob": "^2.0.0", + "path-is-absolute": "^1.0.0", + "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 + }, + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "dev": true, + "requires": { + "restore-cursor": "^2.0.0" + } + }, + "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 + }, + "clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", + "dev": true + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "dev": true + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true + }, + "codecov": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/codecov/-/codecov-3.0.4.tgz", + "integrity": "sha512-KJyzHdg9B8U9LxXa7hS6jnEW5b1cNckLYc2YpnJ1nEFiOW+/iSzDHp+5MYEIQd9fN3/tC6WmGZmYiwxzkuGp/A==", + "dev": true, + "requires": { + "argv": "^0.0.2", + "ignore-walk": "^3.0.1", + "request": "^2.87.0", + "urlgrey": "^0.4.4" + } + }, + "color-convert": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.2.tgz", + "integrity": "sha512-3NUJZdhMhcdPn8vJ9v2UQJoH0qqoGUkYTgFEPZaPjEtwmmKUfNV46zZmgB2M5M4DCEQHMaCfWHCxiBflLm04Tg==", + "dev": true, + "requires": { + "color-name": "1.1.1" + } + }, + "color-name": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.1.tgz", + "integrity": "sha1-SxQVMEz1ACjqgWQ2Q72C6gWANok=", + "dev": true + }, + "combined-stream": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", + "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", + "dev": true, + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "commander": { + "version": "2.15.1", + "resolved": "http://registry.npmjs.org/commander/-/commander-2.15.1.tgz", + "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", + "dev": true + }, + "compare-versions": { + "version": "2.0.1", + "resolved": "http://registry.npmjs.org/compare-versions/-/compare-versions-2.0.1.tgz", + "integrity": "sha1-Htwfk2h/2XoyXFn1XkWgfbEGrKY=", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "console-group": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/console-group/-/console-group-0.3.3.tgz", + "integrity": "sha1-bY62uda3V6KJUoT2LQnHrUPyu84=", + "dev": true + }, + "contains-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", + "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "css-tree": { + "version": "1.0.0-alpha22", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.0.0-alpha22.tgz", + "integrity": "sha1-M4oAbjMce0+dq3tq9Tns5W/3ivI=", + "dev": true, + "requires": { + "mdn-data": "^1.0.0", + "source-map": "^0.5.3" + }, + "dependencies": { + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + } + } + }, + "cssom": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.4.tgz", + "integrity": "sha512-+7prCSORpXNeR4/fUP3rL+TzqtiFfhMvTd7uEqMdgPvLPt4+uzFUeufx5RHjGTACCargg/DiEt/moMQmvnfkog==", + "dev": true + }, + "cssstyle": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-1.0.0.tgz", + "integrity": "sha512-Bpuh47j2mRMY60X90mXaJAEtJwxvA2roZzbgwAXYhMbmwmakdRr4Cq9L5SkleKJNLOKqHIa2YWyOXDX3VgggSQ==", + "dev": true, + "requires": { + "cssom": "0.3.x" + } + }, + "currently-unhandled": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", + "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", + "dev": true, + "requires": { + "array-find-index": "^1.0.1" + } + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, + "data-urls": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-1.0.0.tgz", + "integrity": "sha512-ai40PPQR0Fn1lD2PPie79CibnlMN2AYiDhwFX/rZHVsxbs5kNJSjegqXIprhouGXlRdEnfybva7kqRGnB6mypA==", + "dev": true, + "requires": { + "abab": "^1.0.4", + "whatwg-mimetype": "^2.0.0", + "whatwg-url": "^6.4.0" + }, + "dependencies": { + "abab": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/abab/-/abab-1.0.4.tgz", + "integrity": "sha1-X6rZwsB/YN12dw9xzwJbYqY8/U4=", + "dev": true + } + } + }, + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "deep-defaults": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/deep-defaults/-/deep-defaults-1.0.4.tgz", + "integrity": "sha1-Gpdi4rbI1qTpkxuO5/+M3O4dF1A=", + "dev": true, + "requires": { + "lodash": "3.0.x" + }, + "dependencies": { + "lodash": { + "version": "3.0.1", + "resolved": "http://registry.npmjs.org/lodash/-/lodash-3.0.1.tgz", + "integrity": "sha1-FNSQKKOLx0AkHRHi7NV+wG1zwZo=", + "dev": true + } + } + }, + "deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "defaults": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", + "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", + "dev": true, + "requires": { + "clone": "^1.0.2" + } + }, + "define-properties": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.2.tgz", + "integrity": "sha1-g6c/L+pWmJj7c3GTyPhzyvbUXJQ=", + "dev": true, + "requires": { + "foreach": "^2.0.5", + "object-keys": "^1.0.8" + } + }, + "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", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true + }, + "diff": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "dev": true + }, + "doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "dom-serializer": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.0.tgz", + "integrity": "sha1-BzxpdUbOB4DOI75KKOKT5AvDDII=", + "dev": true, + "requires": { + "domelementtype": "~1.1.1", + "entities": "~1.1.1" + }, + "dependencies": { + "domelementtype": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz", + "integrity": "sha1-vSh3PiZCiBrsUVRJJCmcXNgiGFs=", + "dev": true + } + } + }, + "domelementtype": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.0.tgz", + "integrity": "sha1-sXrtguirWeUt2cGbF1bg/BhyBMI=", + "dev": true + }, + "domexception": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz", + "integrity": "sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug==", + "dev": true, + "requires": { + "webidl-conversions": "^4.0.2" + } + }, + "domhandler": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.2.tgz", + "integrity": "sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==", + "dev": true, + "requires": { + "domelementtype": "1" + } + }, + "domutils": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.7.0.tgz", + "integrity": "sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==", + "dev": true, + "requires": { + "dom-serializer": "0", + "domelementtype": "1" + } + }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "dev": true, + "optional": true, + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "electron": { + "version": "1.8.7", + "resolved": "https://registry.npmjs.org/electron/-/electron-1.8.7.tgz", + "integrity": "sha512-q6dn8bspX8u8z6tNU4bEas6ZrdNavnrjJ6d/oz49Nb4zFIPrdh8p29AFjFlSAavypGwAVR/PhYOAGwzZSQSSVQ==", + "dev": true, + "requires": { + "@types/node": "^8.0.24", + "electron-download": "^3.0.1", + "extract-zip": "^1.0.3" + }, + "dependencies": { + "@types/node": { + "version": "8.10.23", + "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.23.tgz", + "integrity": "sha512-aEp5ZTLr4mYhR9S85cJ+sEYkcsgFY10N1Si5m49iTAVzanZXOwp/pgw6ibFLKXxpflqm71aSWZCRtnTXXO56gA==", + "dev": true + } + } + }, + "electron-download": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/electron-download/-/electron-download-3.3.0.tgz", + "integrity": "sha1-LP1U1pZsAZxNSa1l++Zcyc3vaMg=", + "dev": true, + "requires": { + "debug": "^2.2.0", + "fs-extra": "^0.30.0", + "home-path": "^1.0.1", + "minimist": "^1.2.0", + "nugget": "^2.0.0", + "path-exists": "^2.1.0", + "rc": "^1.1.2", + "semver": "^5.3.0", + "sumchecker": "^1.2.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + } + } + }, + "enqueue": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/enqueue/-/enqueue-1.0.2.tgz", + "integrity": "sha1-kBTpvOVw7pPKlubI5jrVTBkra8g=", + "dev": true, + "requires": { + "sliced": "0.0.5" + }, + "dependencies": { + "sliced": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/sliced/-/sliced-0.0.5.tgz", + "integrity": "sha1-XtwETKTrb3gW1Qui/GPiXY/kcH8=", + "dev": true + } + } + }, + "entities": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz", + "integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA=", + "dev": true + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "es-abstract": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.12.0.tgz", + "integrity": "sha512-C8Fx/0jFmV5IPoMOFPA9P9G5NtqW+4cOPit3MIuvR2t7Ag2K15EJTpxnHAYTzL+aYQJIESYeXZmDBfOBE1HcpA==", + "dev": true, + "requires": { + "es-to-primitive": "^1.1.1", + "function-bind": "^1.1.1", + "has": "^1.0.1", + "is-callable": "^1.1.3", + "is-regex": "^1.0.4" + } + }, + "es-to-primitive": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.1.1.tgz", + "integrity": "sha1-RTVSSKiJeQNLZ5Lhm7gfK3l13Q0=", + "dev": true, + "requires": { + "is-callable": "^1.1.1", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.1" + } + }, + "es6-promise": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.4.tgz", + "integrity": "sha512-/NdNZVJg+uZgtm9eS3O6lrOLYmQag2DjdEXuPaHlZ6RuVqgqaVZfgYCepEIKsLqwdQArOPtC3XzRLqGGfT8KQQ==", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "escodegen": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.11.0.tgz", + "integrity": "sha512-IeMV45ReixHS53K/OmfKAIztN/igDHzTJUhZM3k1jMhIZWjk45SMwAtBsEXiJp3vSPmTcu6CXn7mDvFHRN66fw==", + "dev": true, + "requires": { + "esprima": "^3.1.3", + "estraverse": "^4.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.6.1" + }, + "dependencies": { + "esprima": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", + "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=", + "dev": true + } + } + }, + "eslint": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.3.0.tgz", + "integrity": "sha512-N/tCqlMKkyNvAvLu+zI9AqDasnSLt00K+Hu8kdsERliC9jYEc8ck12XtjvOXrBKu8fK6RrBcN9bat6Xk++9jAg==", + "dev": true, + "requires": { + "ajv": "^6.5.0", + "babel-code-frame": "^6.26.0", + "chalk": "^2.1.0", + "cross-spawn": "^6.0.5", + "debug": "^3.1.0", + "doctrine": "^2.1.0", + "eslint-scope": "^4.0.0", + "eslint-utils": "^1.3.1", + "eslint-visitor-keys": "^1.0.0", + "espree": "^4.0.0", + "esquery": "^1.0.1", + "esutils": "^2.0.2", + "file-entry-cache": "^2.0.0", + "functional-red-black-tree": "^1.0.1", + "glob": "^7.1.2", + "globals": "^11.7.0", + "ignore": "^4.0.2", + "imurmurhash": "^0.1.4", + "inquirer": "^5.2.0", + "is-resolvable": "^1.1.0", + "js-yaml": "^3.11.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.3.0", + "lodash": "^4.17.5", + "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": "^2.0.0", + "require-uncached": "^1.0.3", + "semver": "^5.5.0", + "string.prototype.matchall": "^2.0.0", + "strip-ansi": "^4.0.0", + "strip-json-comments": "^2.0.1", + "table": "^4.0.3", + "text-table": "^0.2.0" + }, + "dependencies": { + "ajv": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.2.tgz", + "integrity": "sha512-hOs7GfvI6tUI1LfZddH82ky6mOMyTuY0mk7kE2pWpmhhUSkumzaTO5vbVwij39MdwPQWCV4Zv57Eo06NtL/GVA==", + "dev": true, + "requires": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.1" + } + }, + "fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "dev": true + }, + "json-schema-traverse": { + "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 + } + } + }, + "eslint-import-resolver-node": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz", + "integrity": "sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q==", + "dev": true, + "requires": { + "debug": "^2.6.9", + "resolve": "^1.5.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } + } + }, + "eslint-module-utils": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.2.0.tgz", + "integrity": "sha1-snA2LNiLGkitMIl2zn+lTphBF0Y=", + "dev": true, + "requires": { + "debug": "^2.6.8", + "pkg-dir": "^1.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } + } + }, + "eslint-plugin-html": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/eslint-plugin-html/-/eslint-plugin-html-4.0.5.tgz", + "integrity": "sha512-yULqYldzhYXTwZEaJXM30HhfgJdtTzuVH3LeoANybESHZ5+2ztLD72BsB2wR124/kk/PvQqZofDFSdNIk+kykw==", + "dev": true, + "requires": { + "htmlparser2": "^3.8.2" + } + }, + "eslint-plugin-import": { + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.13.0.tgz", + "integrity": "sha512-t6hGKQDMIt9N8R7vLepsYXgDfeuhp6ZJSgtrLEDxonpSubyxUZHjhm6LsAaZX8q6GYVxkbT3kTsV9G5mBCFR6A==", + "dev": true, + "requires": { + "contains-path": "^0.1.0", + "debug": "^2.6.8", + "doctrine": "1.5.0", + "eslint-import-resolver-node": "^0.3.1", + "eslint-module-utils": "^2.2.0", + "has": "^1.0.1", + "lodash": "^4.17.4", + "minimatch": "^3.0.3", + "read-pkg-up": "^2.0.0", + "resolve": "^1.6.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "doctrine": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", + "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "isarray": "^1.0.0" + } + } + } + }, + "eslint-scope": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.0.tgz", + "integrity": "sha512-1G6UTDi7Jc1ELFwnR58HV4fK9OQK4S6N985f166xqXxpjU6plxFISJa2Ba9KCQuFa8RCnj/lSFJbHo7UFDBnUA==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.3.1.tgz", + "integrity": "sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q==", + "dev": true + }, + "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==", + "dev": true + }, + "espree": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-4.0.0.tgz", + "integrity": "sha512-kapdTCt1bjmspxStVKX6huolXVV5ZfyZguY1lcfhVVZstce3bqxH9mcLzNn3/mlgW6wQ732+0fuG9v7h0ZQoKg==", + "dev": true, + "requires": { + "acorn": "^5.6.0", + "acorn-jsx": "^4.1.1" + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "esquery": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", + "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", + "dev": true, + "requires": { + "estraverse": "^4.0.0" + } + }, + "esrecurse": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "dev": true, + "requires": { + "estraverse": "^4.1.0" + } + }, + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "dev": true + }, + "estree-walker": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.5.2.tgz", + "integrity": "sha512-XpCnW/AE10ws/kDAs37cngSkvgIR8aN3G0MS85m7dUpuK2EREo9VJ00uvw6Dg/hXEpfsE1I1TvJOJr+Z+TL+ig==", + "dev": true + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "expand-brackets": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "dev": true, + "requires": { + "is-posix-bracket": "^0.1.0" + } + }, + "expand-range": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", + "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", + "dev": true, + "requires": { + "fill-range": "^2.1.0" + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true + }, + "external-editor": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", + "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==", + "dev": true, + "requires": { + "chardet": "^0.4.0", + "iconv-lite": "^0.4.17", + "tmp": "^0.0.33" + } + }, + "extglob": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + }, + "extract-zip": { + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.6.7.tgz", + "integrity": "sha1-qEC0uK9kAyZMjbV/Txp0Mz74H+k=", + "dev": true, + "requires": { + "concat-stream": "1.6.2", + "debug": "2.6.9", + "mkdirp": "0.5.1", + "yauzl": "2.4.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } + } + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "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=", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "fd-slicer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.0.1.tgz", + "integrity": "sha1-i1vL2ewyfFBBv5qwI/1nUPEXfmU=", + "dev": true, + "requires": { + "pend": "~1.2.0" + } + }, + "figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "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=", + "dev": true, + "requires": { + "flat-cache": "^1.2.1", + "object-assign": "^4.0.1" + } + }, + "filename-regex": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", + "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", + "dev": true + }, + "fill-range": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz", + "integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==", + "dev": true, + "requires": { + "is-number": "^2.1.0", + "isobject": "^2.0.0", + "randomatic": "^3.0.0", + "repeat-element": "^1.1.2", + "repeat-string": "^1.5.2" + } + }, + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "dev": true, + "requires": { + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "flat-cache": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.0.tgz", + "integrity": "sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE=", + "dev": true, + "requires": { + "circular-json": "^0.3.1", + "del": "^2.0.2", + "graceful-fs": "^4.1.2", + "write": "^0.2.1" + } + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true + }, + "for-own": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", + "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", + "dev": true, + "requires": { + "for-in": "^1.0.1" + } + }, + "foreach": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", + "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=", + "dev": true + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true + }, + "form-data": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", + "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "1.0.6", + "mime-types": "^2.1.12" + } + }, + "fs-extra": { + "version": "0.30.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", + "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^2.1.0", + "klaw": "^1.0.0", + "path-is-absolute": "^1.0.0", + "rimraf": "^2.2.8" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fsevents": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.4.tgz", + "integrity": "sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg==", + "dev": true, + "optional": true, + "requires": { + "nan": "^2.9.2", + "node-pre-gyp": "^0.10.0" + }, + "dependencies": { + "abbrev": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true, + "dev": true + }, + "aproba": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "optional": true + }, + "are-we-there-yet": { + "version": "1.1.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, + "balanced-match": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "bundled": true, + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "chownr": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "bundled": true, + "dev": true + }, + "console-control-strings": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "debug": { + "version": "2.6.9", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ms": "2.0.0" + } + }, + "deep-extend": { + "version": "0.5.1", + "bundled": true, + "dev": true, + "optional": true + }, + "delegates": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "detect-libc": { + "version": "1.0.3", + "bundled": true, + "dev": true, + "optional": true + }, + "fs-minipass": { + "version": "1.2.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "gauge": { + "version": "2.7.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, + "glob": { + "version": "7.1.2", + "bundled": true, + "dev": true, + "optional": 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" + } + }, + "has-unicode": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "iconv-lite": { + "version": "0.4.21", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safer-buffer": "^2.1.0" + } + }, + "ignore-walk": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minimatch": "^3.0.4" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true, + "dev": true + }, + "ini": { + "version": "1.3.5", + "bundled": true, + "dev": true, + "optional": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "isarray": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "bundled": true, + "dev": true + }, + "minipass": { + "version": "2.2.4", + "bundled": true, + "dev": true, + "requires": { + "safe-buffer": "^5.1.1", + "yallist": "^3.0.0" + } + }, + "minizlib": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "needle": { + "version": "2.2.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "debug": "^2.1.2", + "iconv-lite": "^0.4.4", + "sax": "^1.2.4" + } + }, + "node-pre-gyp": { + "version": "0.10.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "detect-libc": "^1.0.2", + "mkdirp": "^0.5.1", + "needle": "^2.2.0", + "nopt": "^4.0.1", + "npm-packlist": "^1.1.6", + "npmlog": "^4.0.2", + "rc": "^1.1.7", + "rimraf": "^2.6.1", + "semver": "^5.3.0", + "tar": "^4" + } + }, + "nopt": { + "version": "4.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "abbrev": "1", + "osenv": "^0.1.4" + } + }, + "npm-bundled": { + "version": "1.0.3", + "bundled": true, + "dev": true, + "optional": true + }, + "npm-packlist": { + "version": "1.1.10", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ignore-walk": "^3.0.1", + "npm-bundled": "^1.0.1" + } + }, + "npmlog": { + "version": "4.1.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "osenv": { + "version": "0.1.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "process-nextick-args": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "rc": { + "version": "1.2.7", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "deep-extend": "^0.5.1", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "readable-stream": { + "version": "2.3.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "rimraf": { + "version": "2.6.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "glob": "^7.0.5" + } + }, + "safe-buffer": { + "version": "5.1.1", + "bundled": true, + "dev": true + }, + "safer-buffer": { + "version": "2.1.2", + "bundled": true, + "dev": true, + "optional": true + }, + "sax": { + "version": "1.2.4", + "bundled": true, + "dev": true, + "optional": true + }, + "semver": { + "version": "5.5.0", + "bundled": true, + "dev": true, + "optional": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "tar": { + "version": "4.4.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "chownr": "^1.0.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.2.4", + "minizlib": "^1.1.0", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.1", + "yallist": "^3.0.2" + } + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "wide-align": { + "version": "1.1.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "string-width": "^1.0.2" + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "yallist": { + "version": "3.0.2", + "bundled": true, + "dev": true + } + } + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "function-source": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/function-source/-/function-source-0.1.0.tgz", + "integrity": "sha1-2RBL8+RniLVUaMAr8bL6vPj8Ga8=", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "get-stdin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", + "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", + "dev": true + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-base": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", + "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", + "dev": true, + "requires": { + "glob-parent": "^2.0.0", + "is-glob": "^2.0.0" + } + }, + "glob-parent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "dev": true, + "requires": { + "is-glob": "^2.0.0" + } + }, + "globals": { + "version": "11.7.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.7.0.tgz", + "integrity": "sha512-K8BNSPySfeShBQXsahYB/AbbWruVOTyVpgoIDnl8odPpeSfP2J5QO2oLFFdl2j7GfDCtZj2bMKar2T49itTPCg==", + "dev": true + }, + "globalyzer": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/globalyzer/-/globalyzer-0.1.0.tgz", + "integrity": "sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==", + "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" + } + }, + "globrex": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.1.tgz", + "integrity": "sha512-bqKcPhb+ZtrISivpu6oLmwIyINlPlzueO/BDCdfnzUeu7SYxnHTXmWP7uQI5PnQXc5yGXOscGBEGagloA2hcSw==", + "dev": true + }, + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "dev": true + }, + "growl": { + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", + "dev": true + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true + }, + "har-validator": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz", + "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=", + "dev": true, + "requires": { + "ajv": "^5.1.0", + "har-schema": "^2.0.0" + } + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "has-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", + "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", + "dev": true + }, + "he": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", + "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", + "dev": true + }, + "home-path": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/home-path/-/home-path-1.0.6.tgz", + "integrity": "sha512-wo+yjrdAtoXt43Vy92a+0IPCYViiyLAHyp0QVS4xL/tfvVz5sXIW1ubLZk3nhVkD92fQpUMKX+fzMjr5F489vw==", + "dev": true + }, + "hosted-git-info": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", + "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==", + "dev": true + }, + "html-encoding-sniffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz", + "integrity": "sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw==", + "dev": true, + "requires": { + "whatwg-encoding": "^1.0.1" + } + }, + "htmlparser2": { + "version": "3.9.2", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.9.2.tgz", + "integrity": "sha1-G9+HrMoPP55T+k/M6w9LTLsAszg=", + "dev": true, + "requires": { + "domelementtype": "^1.3.0", + "domhandler": "^2.3.0", + "domutils": "^1.5.1", + "entities": "^1.1.1", + "inherits": "^2.0.1", + "readable-stream": "^2.0.2" + } + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "iconv-lite": { + "version": "0.4.23", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz", + "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ignore": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.3.tgz", + "integrity": "sha512-Z/vAH2GGIEATQnBVXMclE2IGV6i0GyVngKThcGZ5kHgHMxLo9Ow2+XHRq1aEKEej5vOF1TPJNbvX6J/anT0M7A==", + "dev": true + }, + "ignore-walk": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.1.tgz", + "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", + "dev": true, + "requires": { + "minimatch": "^3.0.4" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "indent-string": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", + "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", + "dev": true, + "requires": { + "repeating": "^2.0.0" + } + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "ini": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "dev": true + }, + "inquirer": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-5.2.0.tgz", + "integrity": "sha512-E9BmnJbAKLPGonz0HeWHtbKf+EeSP93paWO3ZYoUpq/aowXvYGjjCSuashhXPpzbArIjBbji39THkxTz9ZeEUQ==", + "dev": true, + "requires": { + "ansi-escapes": "^3.0.0", + "chalk": "^2.0.0", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^2.1.0", + "figures": "^2.0.0", + "lodash": "^4.3.0", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rxjs": "^5.5.2", + "string-width": "^2.1.0", + "strip-ansi": "^4.0.0", + "through": "^2.3.6" + } + }, + "interpret": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.1.0.tgz", + "integrity": "sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ=", + "dev": true + }, + "invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "dev": true, + "requires": { + "loose-envify": "^1.0.0" + } + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "dev": true, + "requires": { + "binary-extensions": "^1.0.0" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-builtin-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", + "dev": true, + "requires": { + "builtin-modules": "^1.0.0" + } + }, + "is-callable": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", + "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", + "dev": true + }, + "is-date-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", + "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", + "dev": true + }, + "is-dotfile": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", + "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", + "dev": true + }, + "is-equal-shallow": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", + "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", + "dev": true, + "requires": { + "is-primitive": "^2.0.0" + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-finite": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", + "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + }, + "is-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", + "integrity": "sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=", + "dev": true + }, + "is-number": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", + "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "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-posix-bracket": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", + "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", + "dev": true + }, + "is-primitive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", + "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-reference": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.1.0.tgz", + "integrity": "sha512-h37O/IX4efe56o9k41II1ECMqKwtqHa7/12dLDEzJIFux2x15an4WCDb0/eKdmUgRpLJ3bR0DrzDc7vOrVgRDw==", + "dev": true, + "requires": { + "@types/estree": "0.0.38" + } + }, + "is-regex": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", + "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "dev": true, + "requires": { + "has": "^1.0.1" + } + }, + "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-symbol": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.1.tgz", + "integrity": "sha1-PMWfAAJRlLarLjjbrmaJJWtmBXI=", + "dev": true + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true + }, + "istanbul-lib-coverage": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz", + "integrity": "sha512-nPvSZsVlbG9aLhZYaC3Oi1gT/tpyo3Yt5fNyf6NmcKIayz4VV/txxJFFKAK/gU4dcNn8ehsanBbVHVl0+amOLA==", + "dev": true + }, + "istanbul-lib-instrument": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-2.3.2.tgz", + "integrity": "sha512-l7TD/VnBsIB2OJvSyxaLW/ab1+92dxZNH9wLH7uHPPioy3JZ8tnx2UXUdKmdkgmP2EFPzg64CToUP6dAS3U32Q==", + "dev": true, + "requires": { + "@babel/generator": "7.0.0-beta.51", + "@babel/parser": "7.0.0-beta.51", + "@babel/template": "7.0.0-beta.51", + "@babel/traverse": "7.0.0-beta.51", + "@babel/types": "7.0.0-beta.51", + "istanbul-lib-coverage": "^2.0.1", + "semver": "^5.5.0" + } + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "dev": true + }, + "js-yaml": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", + "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true, + "optional": true + }, + "jsdom": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-11.12.0.tgz", + "integrity": "sha512-y8Px43oyiBM13Zc1z780FrfNLJCXTL40EWlty/LXUtcjykRBNgLlCjWXpfSPBl2iv+N7koQN+dvqszHZgT/Fjw==", + "dev": true, + "requires": { + "abab": "^2.0.0", + "acorn": "^5.5.3", + "acorn-globals": "^4.1.0", + "array-equal": "^1.0.0", + "cssom": ">= 0.3.2 < 0.4.0", + "cssstyle": "^1.0.0", + "data-urls": "^1.0.0", + "domexception": "^1.0.1", + "escodegen": "^1.9.1", + "html-encoding-sniffer": "^1.0.2", + "left-pad": "^1.3.0", + "nwsapi": "^2.0.7", + "parse5": "4.0.0", + "pn": "^1.1.0", + "request": "^2.87.0", + "request-promise-native": "^1.0.5", + "sax": "^1.2.4", + "symbol-tree": "^3.2.2", + "tough-cookie": "^2.3.4", + "w3c-hr-time": "^1.0.1", + "webidl-conversions": "^4.0.2", + "whatwg-encoding": "^1.0.3", + "whatwg-mimetype": "^2.1.0", + "whatwg-url": "^6.4.1", + "ws": "^5.2.0", + "xml-name-validator": "^3.0.0" + } + }, + "jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", + "dev": true + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "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=", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true + }, + "jsonfile": { + "version": "2.4.0", + "resolved": "http://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", + "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "dev": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "keypress": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/keypress/-/keypress-0.1.0.tgz", + "integrity": "sha1-SjGI1CkbZrT2XtuZ+AaqmuKTWSo=", + "dev": true + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + }, + "klaw": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", + "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.9" + } + }, + "kleur": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-2.0.1.tgz", + "integrity": "sha512-Zq/jyANIJ2uX8UZjWlqLwbyhcxSXJtT/Y89lClyeZd3l++3ztL1I5SSCYrbcbwSunTjC88N3WuMk0kRDQD6gzA==", + "dev": true + }, + "left-pad": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/left-pad/-/left-pad-1.3.0.tgz", + "integrity": "sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA==", + "dev": true + }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + } + }, + "load-json-file": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "strip-bom": "^3.0.0" + } + }, + "locate-character": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/locate-character/-/locate-character-2.0.5.tgz", + "integrity": "sha512-n2GmejDXtOPBAZdIiEFy5dJ5N38xBCXLNOtw2WpB9kGh6pnrEuKlwYI+Tkpofc4wDtVXHtoAOJaMRlYG/oYaxg==", + "dev": true + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + }, + "dependencies": { + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + } + } + }, + "lodash": { + "version": "4.17.10", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", + "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", + "dev": true + }, + "lodash.sortby": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", + "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=", + "dev": true + }, + "loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, + "requires": { + "js-tokens": "^3.0.0 || ^4.0.0" + } + }, + "loud-rejection": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", + "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", + "dev": true, + "requires": { + "currently-unhandled": "^0.4.1", + "signal-exit": "^3.0.0" + } + }, + "magic-string": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.0.tgz", + "integrity": "sha512-Msbwa9oNYNPjwVh9ury5X2BHbTFWoirTlzuf4X+pIoSOQVKNRJHXTx1WmKYuXzRM4QZFv8dGXyZvhDMmWhGLPw==", + "dev": true, + "requires": { + "sourcemap-codec": "^1.4.1" + } + }, + "make-error": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.4.tgz", + "integrity": "sha512-0Dab5btKVPhibSalc9QGXb559ED7G7iLjFXBaj9Wq8O3vorueR5K5jaE3hkG6ZQINyhA/JgG6Qk4qdFQjsYV6g==", + "dev": true + }, + "map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", + "dev": true + }, + "math-random": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.1.tgz", + "integrity": "sha1-izqsWIuKZuSXXjzepn97sylgH6w=", + "dev": true + }, + "mdn-data": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-1.1.4.tgz", + "integrity": "sha512-FSYbp3lyKjyj3E7fMl6rYvUdX0FBXaluGqlFoYESWQlyUTq8R+wp0rkFxoYFqZlHCvsUXGjyJmLQSnXToYhOSA==", + "dev": true + }, + "meow": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", + "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", + "dev": true, + "requires": { + "camelcase-keys": "^2.0.0", + "decamelize": "^1.1.2", + "loud-rejection": "^1.0.0", + "map-obj": "^1.0.1", + "minimist": "^1.1.3", + "normalize-package-data": "^2.3.4", + "object-assign": "^4.0.1", + "read-pkg-up": "^1.0.1", + "redent": "^1.0.0", + "trim-newlines": "^1.0.0" + }, + "dependencies": { + "load-json-file": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, + "path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "read-pkg": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "dev": true, + "requires": { + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" + } + }, + "read-pkg-up": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "dev": true, + "requires": { + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" + } + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dev": true, + "requires": { + "is-utf8": "^0.2.0" + } + } + } + }, + "micromatch": { + "version": "2.3.11", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "dev": true, + "requires": { + "arr-diff": "^2.0.0", + "array-unique": "^0.2.1", + "braces": "^1.8.2", + "expand-brackets": "^0.1.4", + "extglob": "^0.3.1", + "filename-regex": "^2.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.1", + "kind-of": "^3.0.2", + "normalize-path": "^2.0.1", + "object.omit": "^2.0.0", + "parse-glob": "^3.0.4", + "regex-cache": "^0.4.2" + } + }, + "mime-db": { + "version": "1.35.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.35.0.tgz", + "integrity": "sha512-JWT/IcCTsB0Io3AhWUMjRqucrHSPsSf2xKLaRldJVULioggvkJvggZ3VXNNSRkCddE6D+BUI4HEIZIA2OjwIvg==", + "dev": true + }, + "mime-types": { + "version": "2.1.19", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.19.tgz", + "integrity": "sha512-P1tKYHVSZ6uFo26mtnve4HQFE3koh1UWVkp8YUC+ESBHe945xWSoXuHHiGarDqcEZ+whpCDnlNw5LON0kLo+sw==", + "dev": true, + "requires": { + "mime-db": "~1.35.0" + } + }, + "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==", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + }, + "minstache": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minstache/-/minstache-1.2.0.tgz", + "integrity": "sha1-/xzEA6woRPaNvxjGYhKb5+sO/EE=", + "dev": true, + "requires": { + "commander": "1.0.4" + }, + "dependencies": { + "commander": { + "version": "1.0.4", + "resolved": "http://registry.npmjs.org/commander/-/commander-1.0.4.tgz", + "integrity": "sha1-Xt6xruI8T7VBprcNaSq+8ZZpotM=", + "dev": true, + "requires": { + "keypress": "0.1.x" + } + } + } + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "mocha": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", + "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", + "dev": true, + "requires": { + "browser-stdout": "1.3.1", + "commander": "2.15.1", + "debug": "3.1.0", + "diff": "3.5.0", + "escape-string-regexp": "1.0.5", + "glob": "7.1.2", + "growl": "1.10.5", + "he": "1.1.1", + "minimatch": "3.0.4", + "mkdirp": "0.5.1", + "supports-color": "5.4.0" + } + }, + "mri": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/mri/-/mri-1.1.1.tgz", + "integrity": "sha1-haom09ru7t+A3FmEr5XMXKXK2fE=", + "dev": true + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "multiline": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/multiline/-/multiline-1.0.2.tgz", + "integrity": "sha1-abHyX/B00oKJBPJE3dBrfZbvbJM=", + "dev": true, + "requires": { + "strip-indent": "^1.0.0" + } + }, + "mute-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", + "dev": true + }, + "nan": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz", + "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==", + "dev": true, + "optional": true + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "nice-try": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.4.tgz", + "integrity": "sha512-2NpiFHqC87y/zFke0fC0spBXL3bBsoh/p5H1EFhshxjCR5+0g2d6BiXbUFz9v1sAcxsk2htp2eQnNIci2dIYcA==", + "dev": true + }, + "nightmare": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/nightmare/-/nightmare-3.0.1.tgz", + "integrity": "sha512-WptvyPfp5mHRRYHzt6+4xazaR9cc437BuLJI6cLFnqwwgxgdtsFImfBVDeTUCPAeLrkp5VryX5jlw7Wwg+UnFQ==", + "dev": true, + "requires": { + "debug": "^2.2.0", + "deep-defaults": "^1.0.3", + "defaults": "^1.0.2", + "electron": "^1.8.4", + "enqueue": "^1.0.2", + "function-source": "^0.1.0", + "jsesc": "^0.5.0", + "minstache": "^1.2.0", + "mkdirp": "^0.5.1", + "multiline": "^1.0.2", + "once": "^1.3.3", + "rimraf": "^2.4.3", + "sliced": "1.0.1", + "split2": "^2.0.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } + } + }, + "node-resolve": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/node-resolve/-/node-resolve-1.3.3.tgz", + "integrity": "sha1-dMf10zc+S7L2AYLjqW3eD4qssM4=", + "dev": true, + "requires": { + "is-builtin-module": "^1.0.0", + "lodash": "^4.13.1" + } + }, + "normalize-package-data": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "is-builtin-module": "^1.0.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + }, + "nugget": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/nugget/-/nugget-2.0.1.tgz", + "integrity": "sha1-IBCVpIfhrTYIGzQy+jytpPjQcbA=", + "dev": true, + "requires": { + "debug": "^2.1.3", + "minimist": "^1.1.0", + "pretty-bytes": "^1.0.2", + "progress-stream": "^1.1.0", + "request": "^2.45.0", + "single-line-log": "^1.1.2", + "throttleit": "0.0.2" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + } + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true + }, + "nwsapi": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.0.8.tgz", + "integrity": "sha512-7RZ+qbFGiVc6v14Y8DSZjPN1wZPOaMbiiP4tzf5eNuyOITAeOIA3cMhjuKUypVIqBgCSg1KaSyAv8Ocq/0ZJ1A==", + "dev": true + }, + "nyc": { + "version": "12.0.2", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-12.0.2.tgz", + "integrity": "sha1-ikpO1pCWbBHsWH/4fuoMEsl0upk=", + "dev": true, + "requires": { + "archy": "^1.0.0", + "arrify": "^1.0.1", + "caching-transform": "^1.0.0", + "convert-source-map": "^1.5.1", + "debug-log": "^1.0.1", + "default-require-extensions": "^1.0.0", + "find-cache-dir": "^0.1.1", + "find-up": "^2.1.0", + "foreground-child": "^1.5.3", + "glob": "^7.0.6", + "istanbul-lib-coverage": "^1.2.0", + "istanbul-lib-hook": "^1.1.0", + "istanbul-lib-instrument": "^2.1.0", + "istanbul-lib-report": "^1.1.3", + "istanbul-lib-source-maps": "^1.2.5", + "istanbul-reports": "^1.4.1", + "md5-hex": "^1.2.0", + "merge-source-map": "^1.1.0", + "micromatch": "^3.1.10", + "mkdirp": "^0.5.0", + "resolve-from": "^2.0.0", + "rimraf": "^2.6.2", + "signal-exit": "^3.0.1", + "spawn-wrap": "^1.4.2", + "test-exclude": "^4.2.0", + "yargs": "11.1.0", + "yargs-parser": "^8.0.0" + }, + "dependencies": { + "align-text": { + "version": "0.1.4", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "^3.0.2", + "longest": "^1.0.1", + "repeat-string": "^1.5.2" + } + }, + "amdefine": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "ansi-regex": { + "version": "3.0.0", + "bundled": true, + "dev": true + }, + "append-transform": { + "version": "0.4.0", + "bundled": true, + "dev": true, + "requires": { + "default-require-extensions": "^1.0.0" + } + }, + "archy": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "arr-diff": { + "version": "4.0.0", + "bundled": true, + "dev": true + }, + "arr-flatten": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "arr-union": { + "version": "3.1.0", + "bundled": true, + "dev": true + }, + "array-unique": { + "version": "0.3.2", + "bundled": true, + "dev": true + }, + "arrify": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "assign-symbols": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "async": { + "version": "1.5.2", + "bundled": true, + "dev": true + }, + "atob": { + "version": "2.1.1", + "bundled": true, + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "base": { + "version": "0.11.2", + "bundled": true, + "dev": true, + "requires": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "kind-of": { + "version": "6.0.2", + "bundled": true, + "dev": true + } + } + }, + "brace-expansion": { + "version": "1.1.11", + "bundled": true, + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "2.3.2", + "bundled": true, + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "builtin-modules": { + "version": "1.1.1", + "bundled": true, + "dev": true + }, + "cache-base": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "requires": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + } + }, + "caching-transform": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "requires": { + "md5-hex": "^1.2.0", + "mkdirp": "^0.5.1", + "write-file-atomic": "^1.1.4" + } + }, + "camelcase": { + "version": "1.2.1", + "bundled": true, + "dev": true, + "optional": true + }, + "center-align": { + "version": "0.1.3", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "align-text": "^0.1.3", + "lazy-cache": "^1.0.3" + } + }, + "class-utils": { + "version": "0.3.6", + "bundled": true, + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "bundled": true, + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "cliui": { + "version": "2.1.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "center-align": "^0.1.1", + "right-align": "^0.1.1", + "wordwrap": "0.0.2" + }, + "dependencies": { + "wordwrap": { + "version": "0.0.2", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "collection-visit": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + } + }, + "commondir": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "component-emitter": { + "version": "1.2.1", + "bundled": true, + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "bundled": true, + "dev": true + }, + "convert-source-map": { + "version": "1.5.1", + "bundled": true, + "dev": true + }, + "copy-descriptor": { + "version": "0.1.1", + "bundled": true, + "dev": true + }, + "cross-spawn": { + "version": "4.0.2", + "bundled": true, + "dev": true, + "requires": { + "lru-cache": "^4.0.1", + "which": "^1.2.9" + } + }, + "debug": { + "version": "3.1.0", + "bundled": true, + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "debug-log": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "decamelize": { + "version": "1.2.0", + "bundled": true, + "dev": true + }, + "decode-uri-component": { + "version": "0.2.0", + "bundled": true, + "dev": true + }, + "default-require-extensions": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "strip-bom": "^2.0.0" + } + }, + "define-property": { + "version": "2.0.2", + "bundled": true, + "dev": true, + "requires": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "dependencies": { + "is-accessor-descriptor": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "kind-of": { + "version": "6.0.2", + "bundled": true, + "dev": true + } + } + }, + "error-ex": { + "version": "1.3.1", + "bundled": true, + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "execa": { + "version": "0.7.0", + "bundled": true, + "dev": true, + "requires": { + "cross-spawn": "^5.0.1", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + }, + "dependencies": { + "cross-spawn": { + "version": "5.1.0", + "bundled": true, + "dev": true, + "requires": { + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + } + } + }, + "expand-brackets": { + "version": "2.1.4", + "bundled": true, + "dev": true, + "requires": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "bundled": true, + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "bundled": true, + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "extend-shallow": { + "version": "3.0.2", + "bundled": true, + "dev": true, + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "extglob": { + "version": "2.0.4", + "bundled": true, + "dev": true, + "requires": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "kind-of": { + "version": "6.0.2", + "bundled": true, + "dev": true + } + } + }, + "fill-range": { + "version": "4.0.0", + "bundled": true, + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "find-cache-dir": { + "version": "0.1.1", + "bundled": true, + "dev": true, + "requires": { + "commondir": "^1.0.1", + "mkdirp": "^0.5.1", + "pkg-dir": "^1.0.0" + } + }, + "find-up": { + "version": "2.1.0", + "bundled": true, + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "for-in": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "foreground-child": { + "version": "1.5.6", + "bundled": true, + "dev": true, + "requires": { + "cross-spawn": "^4", + "signal-exit": "^3.0.0" + } + }, + "fragment-cache": { + "version": "0.2.1", + "bundled": true, + "dev": true, + "requires": { + "map-cache": "^0.2.2" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "get-caller-file": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "get-stream": { + "version": "3.0.0", + "bundled": true, + "dev": true + }, + "get-value": { + "version": "2.0.6", + "bundled": true, + "dev": true + }, + "glob": { + "version": "7.1.2", + "bundled": true, + "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" + } + }, + "graceful-fs": { + "version": "4.1.11", + "bundled": true, + "dev": true + }, + "handlebars": { + "version": "4.0.11", + "bundled": true, + "dev": true, + "requires": { + "async": "^1.4.0", + "optimist": "^0.6.1", + "source-map": "^0.4.4", + "uglify-js": "^2.6" + }, + "dependencies": { + "source-map": { + "version": "0.4.4", + "bundled": true, + "dev": true, + "requires": { + "amdefine": ">=0.0.4" + } + } + } + }, + "has-value": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + } + }, + "has-values": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "dependencies": { + "kind-of": { + "version": "4.0.0", + "bundled": true, + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "hosted-git-info": { + "version": "2.6.0", + "bundled": true, + "dev": true + }, + "imurmurhash": { + "version": "0.1.4", + "bundled": true, + "dev": true + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true, + "dev": true + }, + "invert-kv": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-arrayish": { + "version": "0.2.1", + "bundled": true, + "dev": true + }, + "is-buffer": { + "version": "1.1.6", + "bundled": true, + "dev": true + }, + "is-builtin-module": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "builtin-modules": "^1.0.0" + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-descriptor": { + "version": "0.1.6", + "bundled": true, + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "bundled": true, + "dev": true + } + } + }, + "is-extendable": { + "version": "0.1.1", + "bundled": true, + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "is-number": { + "version": "3.0.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-odd": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "is-number": "^4.0.0" + }, + "dependencies": { + "is-number": { + "version": "4.0.0", + "bundled": true, + "dev": true + } + } + }, + "is-plain-object": { + "version": "2.0.4", + "bundled": true, + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "is-stream": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "is-utf8": { + "version": "0.2.1", + "bundled": true, + "dev": true + }, + "is-windows": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "isarray": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "isexe": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "isobject": { + "version": "3.0.1", + "bundled": true, + "dev": true + }, + "istanbul-lib-coverage": { + "version": "1.2.0", + "bundled": true, + "dev": true + }, + "istanbul-lib-hook": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "requires": { + "append-transform": "^0.4.0" + } + }, + "istanbul-lib-report": { + "version": "1.1.3", + "bundled": true, + "dev": true, + "requires": { + "istanbul-lib-coverage": "^1.1.2", + "mkdirp": "^0.5.1", + "path-parse": "^1.0.5", + "supports-color": "^3.1.2" + }, + "dependencies": { + "has-flag": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "supports-color": { + "version": "3.2.3", + "bundled": true, + "dev": true, + "requires": { + "has-flag": "^1.0.0" + } + } + } + }, + "istanbul-lib-source-maps": { + "version": "1.2.5", + "bundled": true, + "dev": true, + "requires": { + "debug": "^3.1.0", + "istanbul-lib-coverage": "^1.2.0", + "mkdirp": "^0.5.1", + "rimraf": "^2.6.1", + "source-map": "^0.5.3" + } + }, + "istanbul-reports": { + "version": "1.4.1", + "bundled": true, + "dev": true, + "requires": { + "handlebars": "^4.0.3" + } + }, + "kind-of": { + "version": "3.2.2", + "bundled": true, + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + }, + "lazy-cache": { + "version": "1.0.4", + "bundled": true, + "dev": true, + "optional": true + }, + "lcid": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "invert-kv": "^1.0.0" + } + }, + "load-json-file": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + }, + "dependencies": { + "path-exists": { + "version": "3.0.0", + "bundled": true, + "dev": true + } + } + }, + "longest": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "lru-cache": { + "version": "4.1.3", + "bundled": true, + "dev": true, + "requires": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "map-cache": { + "version": "0.2.2", + "bundled": true, + "dev": true + }, + "map-visit": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "object-visit": "^1.0.0" + } + }, + "md5-hex": { + "version": "1.3.0", + "bundled": true, + "dev": true, + "requires": { + "md5-o-matic": "^0.1.1" + } + }, + "md5-o-matic": { + "version": "0.1.1", + "bundled": true, + "dev": true + }, + "mem": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "requires": { + "mimic-fn": "^1.0.0" + } + }, + "merge-source-map": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "requires": { + "source-map": "^0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "bundled": true, + "dev": true + } + } + }, + "micromatch": { + "version": "3.1.10", + "bundled": true, + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "6.0.2", + "bundled": true, + "dev": true + } + } + }, + "mimic-fn": { + "version": "1.2.0", + "bundled": true, + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "bundled": true, + "dev": true + }, + "mixin-deep": { + "version": "1.3.1", + "bundled": true, + "dev": true, + "requires": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "nanomatch": { + "version": "1.2.9", + "bundled": true, + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-odd": "^2.0.0", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "kind-of": { + "version": "6.0.2", + "bundled": true, + "dev": true + } + } + }, + "normalize-package-data": { + "version": "2.4.0", + "bundled": true, + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "is-builtin-module": "^1.0.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "npm-run-path": { + "version": "2.0.2", + "bundled": true, + "dev": true, + "requires": { + "path-key": "^2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true, + "dev": true + }, + "object-copy": { + "version": "0.1.0", + "bundled": true, + "dev": true, + "requires": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "bundled": true, + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "object-visit": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "requires": { + "isobject": "^3.0.0" + } + }, + "object.pick": { + "version": "1.3.0", + "bundled": true, + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "once": { + "version": "1.4.0", + "bundled": true, + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "optimist": { + "version": "0.6.1", + "bundled": true, + "dev": true, + "requires": { + "minimist": "~0.0.1", + "wordwrap": "~0.0.2" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "os-locale": { + "version": "2.1.0", + "bundled": true, + "dev": true, + "requires": { + "execa": "^0.7.0", + "lcid": "^1.0.0", + "mem": "^1.1.0" + } + }, + "p-finally": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "p-limit": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "parse-json": { + "version": "2.2.0", + "bundled": true, + "dev": true, + "requires": { + "error-ex": "^1.2.0" + } + }, + "pascalcase": { + "version": "0.1.1", + "bundled": true, + "dev": true + }, + "path-exists": { + "version": "2.1.0", + "bundled": true, + "dev": true, + "requires": { + "pinkie-promise": "^2.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "path-key": { + "version": "2.0.1", + "bundled": true, + "dev": true + }, + "path-parse": { + "version": "1.0.5", + "bundled": true, + "dev": true + }, + "path-type": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "pify": { + "version": "2.3.0", + "bundled": true, + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "bundled": true, + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "pinkie": "^2.0.0" + } + }, + "pkg-dir": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "find-up": "^1.0.0" + }, + "dependencies": { + "find-up": { + "version": "1.1.2", + "bundled": true, + "dev": true, + "requires": { + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + } + } + }, + "posix-character-classes": { + "version": "0.1.1", + "bundled": true, + "dev": true + }, + "pseudomap": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "read-pkg": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "requires": { + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" + } + }, + "read-pkg-up": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "requires": { + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" + }, + "dependencies": { + "find-up": { + "version": "1.1.2", + "bundled": true, + "dev": true, + "requires": { + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + } + } + }, + "regex-not": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + } + }, + "repeat-element": { + "version": "1.1.2", + "bundled": true, + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "bundled": true, + "dev": true + }, + "require-directory": { + "version": "2.1.1", + "bundled": true, + "dev": true + }, + "require-main-filename": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "resolve-from": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "resolve-url": { + "version": "0.2.1", + "bundled": true, + "dev": true + }, + "ret": { + "version": "0.1.15", + "bundled": true, + "dev": true + }, + "right-align": { + "version": "0.1.3", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "align-text": "^0.1.1" + } + }, + "rimraf": { + "version": "2.6.2", + "bundled": true, + "dev": true, + "requires": { + "glob": "^7.0.5" + } + }, + "safe-regex": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "requires": { + "ret": "~0.1.10" + } + }, + "semver": { + "version": "5.5.0", + "bundled": true, + "dev": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "set-value": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "shebang-command": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true, + "dev": true + }, + "slide": { + "version": "1.1.6", + "bundled": true, + "dev": true + }, + "snapdragon": { + "version": "0.8.2", + "bundled": true, + "dev": true, + "requires": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "bundled": true, + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "bundled": true, + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "bundled": true, + "dev": true, + "requires": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "kind-of": { + "version": "6.0.2", + "bundled": true, + "dev": true + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "^3.2.0" + } + }, + "source-map": { + "version": "0.5.7", + "bundled": true, + "dev": true + }, + "source-map-resolve": { + "version": "0.5.2", + "bundled": true, + "dev": true, + "requires": { + "atob": "^2.1.1", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "source-map-url": { + "version": "0.4.0", + "bundled": true, + "dev": true + }, + "spawn-wrap": { + "version": "1.4.2", + "bundled": true, + "dev": true, + "requires": { + "foreground-child": "^1.5.6", + "mkdirp": "^0.5.0", + "os-homedir": "^1.0.1", + "rimraf": "^2.6.2", + "signal-exit": "^3.0.2", + "which": "^1.3.0" + } + }, + "spdx-correct": { + "version": "3.0.0", + "bundled": true, + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.1.0", + "bundled": true, + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.0", + "bundled": true, + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.0", + "bundled": true, + "dev": true + }, + "split-string": { + "version": "3.1.0", + "bundled": true, + "dev": true, + "requires": { + "extend-shallow": "^3.0.0" + } + }, + "static-extend": { + "version": "0.1.2", + "bundled": true, + "dev": true, + "requires": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "bundled": true, + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "string-width": { + "version": "2.1.1", + "bundled": true, + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "strip-bom": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "is-utf8": "^0.2.0" + } + }, + "strip-eof": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "test-exclude": { + "version": "4.2.1", + "bundled": true, + "dev": true, + "requires": { + "arrify": "^1.0.1", + "micromatch": "^3.1.8", + "object-assign": "^4.1.0", + "read-pkg-up": "^1.0.1", + "require-main-filename": "^1.0.1" + } + }, + "to-object-path": { + "version": "0.3.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "to-regex": { + "version": "3.0.2", + "bundled": true, + "dev": true, + "requires": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "bundled": true, + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + }, + "uglify-js": { + "version": "2.8.29", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "source-map": "~0.5.1", + "uglify-to-browserify": "~1.0.0", + "yargs": "~3.10.0" + }, + "dependencies": { + "yargs": { + "version": "3.10.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "camelcase": "^1.0.2", + "cliui": "^2.1.0", + "decamelize": "^1.0.0", + "window-size": "0.1.0" + } + } + } + }, + "uglify-to-browserify": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "union-value": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^0.4.3" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "set-value": { + "version": "0.4.3", + "bundled": true, + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.1", + "to-object-path": "^0.3.0" + } + } + } + }, + "unset-value": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "bundled": true, + "dev": true, + "requires": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "bundled": true, + "dev": true, + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "bundled": true, + "dev": true + } + } + }, + "urix": { + "version": "0.1.0", + "bundled": true, + "dev": true + }, + "use": { + "version": "3.1.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "^6.0.2" + }, + "dependencies": { + "kind-of": { + "version": "6.0.2", + "bundled": true, + "dev": true + } + } + }, + "validate-npm-package-license": { + "version": "3.0.3", + "bundled": true, + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "which": { + "version": "1.3.1", + "bundled": true, + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "window-size": { + "version": "0.1.0", + "bundled": true, + "dev": true, + "optional": true + }, + "wordwrap": { + "version": "0.0.3", + "bundled": true, + "dev": true + }, + "wrap-ansi": { + "version": "2.1.0", + "bundled": true, + "dev": true, + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "bundled": true, + "dev": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + } + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "write-file-atomic": { + "version": "1.3.4", + "bundled": true, + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "slide": "^1.1.5" + } + }, + "y18n": { + "version": "3.2.1", + "bundled": true, + "dev": true + }, + "yallist": { + "version": "2.1.2", + "bundled": true, + "dev": true + }, + "yargs": { + "version": "11.1.0", + "bundled": true, + "dev": true, + "requires": { + "cliui": "^4.0.0", + "decamelize": "^1.1.1", + "find-up": "^2.1.0", + "get-caller-file": "^1.0.1", + "os-locale": "^2.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1", + "yargs-parser": "^9.0.2" + }, + "dependencies": { + "camelcase": { + "version": "4.1.0", + "bundled": true, + "dev": true + }, + "cliui": { + "version": "4.1.0", + "bundled": true, + "dev": true, + "requires": { + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", + "wrap-ansi": "^2.0.0" + } + }, + "yargs-parser": { + "version": "9.0.2", + "bundled": true, + "dev": true, + "requires": { + "camelcase": "^4.1.0" + } + } + } + }, + "yargs-parser": { + "version": "8.1.0", + "bundled": true, + "dev": true, + "requires": { + "camelcase": "^4.1.0" + }, + "dependencies": { + "camelcase": { + "version": "4.1.0", + "bundled": true, + "dev": true + } + } + } + } + }, + "oauth-sign": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", + "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=", + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "object-keys": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz", + "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==", + "dev": true + }, + "object.omit": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", + "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", + "dev": true, + "requires": { + "for-own": "^0.1.4", + "is-extendable": "^0.1.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "dev": true, + "requires": { + "mimic-fn": "^1.0.0" + } + }, + "optionator": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", + "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "dev": true, + "requires": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.4", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "wordwrap": "~1.0.0" + } + }, + "os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "dev": true + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "pad-right": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/pad-right/-/pad-right-0.2.2.tgz", + "integrity": "sha1-b7ySQEXSRPKiokRQMGDTv8YAl3Q=", + "dev": true, + "requires": { + "repeat-string": "^1.5.2" + } + }, + "parse-glob": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", + "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", + "dev": true, + "requires": { + "glob-base": "^0.3.0", + "is-dotfile": "^1.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.0" + } + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "^1.2.0" + } + }, + "parse5": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-4.0.0.tgz", + "integrity": "sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA==", + "dev": true + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "dev": true, + "requires": { + "pinkie-promise": "^2.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "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", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "path-parse": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", + "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", + "dev": true + }, + "path-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", + "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "dev": true, + "requires": { + "pify": "^2.0.0" + } + }, + "pend": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", + "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=", + "dev": true + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": true + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "^2.0.0" + } + }, + "pkg-dir": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-1.0.0.tgz", + "integrity": "sha1-ektQio1bstYp1EcFb/TpyTFM89Q=", + "dev": true, + "requires": { + "find-up": "^1.0.0" + } + }, + "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 + }, + "pn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz", + "integrity": "sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA==", + "dev": true + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, + "preserve": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", + "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", + "dev": true + }, + "prettier": { + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.14.0.tgz", + "integrity": "sha512-KtQ2EGaUwf2EyDfp1fxyEb0PqGKakVm0WyXwDt6u+cAoxbO2Z2CwKvOe3+b4+F2IlO9lYHi1kqFuRM70ddBnow==", + "dev": true + }, + "pretty-bytes": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-1.0.4.tgz", + "integrity": "sha1-CiLoIQYJrTVUL4yNXSFZr/B1HIQ=", + "dev": true, + "requires": { + "get-stdin": "^4.0.1", + "meow": "^3.1.0" + } + }, + "process-nextick-args": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "dev": true + }, + "progress": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.0.tgz", + "integrity": "sha1-ihvjZr+Pwj2yvSPxDG/pILQ4nR8=", + "dev": true + }, + "progress-stream": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/progress-stream/-/progress-stream-1.2.0.tgz", + "integrity": "sha1-LNPP6jO6OonJwSHsM0er6asSX3c=", + "dev": true, + "requires": { + "speedometer": "~0.1.2", + "through2": "~0.2.3" + } + }, + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "dev": true + }, + "randomatic": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.0.0.tgz", + "integrity": "sha512-VdxFOIEY3mNO5PtSRkkle/hPJDHvQhK21oa73K4yAc9qmp6N429gAyF1gZMOTMeS0/AYzaV/2Trcef+NaIonSA==", + "dev": true, + "requires": { + "is-number": "^4.0.0", + "kind-of": "^6.0.0", + "math-random": "^1.0.1" + }, + "dependencies": { + "is-number": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "dev": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + } + } + }, + "rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "dev": true, + "requires": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + } + } + }, + "read-pkg": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", + "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", + "dev": true, + "requires": { + "load-json-file": "^2.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^2.0.0" + } + }, + "read-pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", + "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "dev": true, + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^2.0.0" + }, + "dependencies": { + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + } + } + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "readdirp": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz", + "integrity": "sha1-TtCtBg3zBzMAxIRANz9y0cxkLXg=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "minimatch": "^3.0.2", + "readable-stream": "^2.0.2", + "set-immediate-shim": "^1.0.1" + } + }, + "rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", + "dev": true, + "requires": { + "resolve": "^1.1.6" + } + }, + "redent": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", + "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", + "dev": true, + "requires": { + "indent-string": "^2.1.0", + "strip-indent": "^1.0.1" + } + }, + "regex-cache": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", + "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", + "dev": true, + "requires": { + "is-equal-shallow": "^0.1.3" + } + }, + "regexp.prototype.flags": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.2.0.tgz", + "integrity": "sha512-ztaw4M1VqgMwl9HlPpOuiYgItcHlunW0He2fE6eNfT6E/CF2FtYi9ofOYe4mKntstYk0Fyh/rDRBdS3AnxjlrA==", + "dev": true, + "requires": { + "define-properties": "^1.1.2" + } + }, + "regexpp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.0.tgz", + "integrity": "sha512-g2FAVtR8Uh8GO1Nv5wpxW7VFVwHcCEr4wyA8/MHiRkO8uHoR5ntAA8Uq3P1vvMTX/BeQiRVSpDGLd+Wn5HNOTA==", + "dev": true + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "repeat-element": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", + "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=", + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "repeating": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "dev": true, + "requires": { + "is-finite": "^1.0.0" + } + }, + "request": { + "version": "2.87.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.87.0.tgz", + "integrity": "sha512-fcogkm7Az5bsS6Sl0sibkbhcKsnyon/jV1kF3ajGmF0c8HrttdKTPRT9hieOaQHA5HEq6r8OyWOo/o781C1tNw==", + "dev": true, + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.6.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.5", + "extend": "~3.0.1", + "forever-agent": "~0.6.1", + "form-data": "~2.3.1", + "har-validator": "~5.0.3", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.17", + "oauth-sign": "~0.8.2", + "performance-now": "^2.1.0", + "qs": "~6.5.1", + "safe-buffer": "^5.1.1", + "tough-cookie": "~2.3.3", + "tunnel-agent": "^0.6.0", + "uuid": "^3.1.0" + } + }, + "request-promise-core": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.1.tgz", + "integrity": "sha1-Pu4AssWqgyOc+wTFcA2jb4HNCLY=", + "dev": true, + "requires": { + "lodash": "^4.13.1" + } + }, + "request-promise-native": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.5.tgz", + "integrity": "sha1-UoF3D2jgyXGeUWP9P6tIIhX0/aU=", + "dev": true, + "requires": { + "request-promise-core": "1.1.1", + "stealthy-require": "^1.1.0", + "tough-cookie": ">=2.3.3" + } + }, + "require-relative": { + "version": "0.8.7", + "resolved": "https://registry.npmjs.org/require-relative/-/require-relative-0.8.7.tgz", + "integrity": "sha1-eZlTn8ngR6N5KPoZb44VY9q9Nt4=", + "dev": true + }, + "require-uncached": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", + "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", + "dev": true, + "requires": { + "caller-path": "^0.1.0", + "resolve-from": "^1.0.0" + } + }, + "resolve": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz", + "integrity": "sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==", + "dev": true, + "requires": { + "path-parse": "^1.0.5" + } + }, + "resolve-from": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", + "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", + "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=", + "dev": true, + "requires": { + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" + } + }, + "rimraf": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "dev": true, + "requires": { + "glob": "^7.0.5" + } + }, + "rollup": { + "version": "0.63.5", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-0.63.5.tgz", + "integrity": "sha512-dFf8LpUNzIj3oE0vCvobX6rqOzHzLBoblyFp+3znPbjiSmSvOoK2kMKx+Fv9jYduG1rvcCfCveSgEaQHjWRF6g==", + "dev": true, + "requires": { + "@types/estree": "0.0.39", + "@types/node": "*" + }, + "dependencies": { + "@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 + } + } + }, + "rollup-plugin-buble": { + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/rollup-plugin-buble/-/rollup-plugin-buble-0.19.2.tgz", + "integrity": "sha512-dxK0prR8j/7qhI2EZDz/evKCRuhuZMpRlUGPrRWmpg5/2V8tP1XFW+Uk0WfxyNgFfJHvy0GmxnJSTb5dIaNljQ==", + "dev": true, + "requires": { + "buble": "^0.19.2", + "rollup-pluginutils": "^2.0.1" + } + }, + "rollup-plugin-commonjs": { + "version": "9.1.4", + "resolved": "https://registry.npmjs.org/rollup-plugin-commonjs/-/rollup-plugin-commonjs-9.1.4.tgz", + "integrity": "sha512-dpPb6QxvEMG35Eat1yFbpVcuYWE33D2LZK8q2BlSWIBpjXiX2uaqCEMf9czqFChFsfewsA2c2eEoROTepEmyng==", + "dev": true, + "requires": { + "estree-walker": "^0.5.1", + "magic-string": "^0.22.4", + "resolve": "^1.5.0", + "rollup-pluginutils": "^2.0.1" + }, + "dependencies": { + "magic-string": { + "version": "0.22.5", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.22.5.tgz", + "integrity": "sha512-oreip9rJZkzvA8Qzk9HFs8fZGF/u7H/gtrE8EN6RjKJ9kh2HlC+yQ2QezifqTZfGyiuAV0dRv5a+y/8gBb1m9w==", + "dev": true, + "requires": { + "vlq": "^0.2.2" + } + }, + "vlq": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/vlq/-/vlq-0.2.3.tgz", + "integrity": "sha512-DRibZL6DsNhIgYQ+wNdWDL2SL3bKPlVrRiBqV5yuMm++op8W4kGFtaQfCs4KEJn0wBZcHVHJ3eoywX8983k1ow==", + "dev": true + } + } + }, + "rollup-plugin-json": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-json/-/rollup-plugin-json-3.0.0.tgz", + "integrity": "sha512-WUAV9/I/uFWvHhyRTqFb+3SIapjISFJS7R1xN/cXxWESrfYo9I8ncHI7AxJHflKRXhBVSv7revBVJh2wvhWh5w==", + "dev": true, + "requires": { + "rollup-pluginutils": "^2.2.0" + } + }, + "rollup-plugin-node-resolve": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-3.3.0.tgz", + "integrity": "sha512-9zHGr3oUJq6G+X0oRMYlzid9fXicBdiydhwGChdyeNRGPcN/majtegApRKHLR5drboUvEWU+QeUmGTyEZQs3WA==", + "dev": true, + "requires": { + "builtin-modules": "^2.0.0", + "is-module": "^1.0.0", + "resolve": "^1.1.6" + }, + "dependencies": { + "builtin-modules": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-2.0.0.tgz", + "integrity": "sha512-3U5kUA5VPsRUA3nofm/BXX7GVHKfxz0hOBAPxXrIvHzlDRkQVqEn6yi8QJegxl4LzOHLdvb7XF5dVawa/VVYBg==", + "dev": true + } + } + }, + "rollup-plugin-replace": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-replace/-/rollup-plugin-replace-2.0.0.tgz", + "integrity": "sha512-pK9mTd/FNrhtBxcTBXoh0YOwRIShV0gGhv9qvUtNcXHxIMRZMXqfiZKVBmCRGp8/2DJRy62z2JUE7/5tP6WxOQ==", + "dev": true, + "requires": { + "magic-string": "^0.22.4", + "minimatch": "^3.0.2", + "rollup-pluginutils": "^2.0.1" + }, + "dependencies": { + "magic-string": { + "version": "0.22.5", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.22.5.tgz", + "integrity": "sha512-oreip9rJZkzvA8Qzk9HFs8fZGF/u7H/gtrE8EN6RjKJ9kh2HlC+yQ2QezifqTZfGyiuAV0dRv5a+y/8gBb1m9w==", + "dev": true, + "requires": { + "vlq": "^0.2.2" + } + }, + "vlq": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/vlq/-/vlq-0.2.3.tgz", + "integrity": "sha512-DRibZL6DsNhIgYQ+wNdWDL2SL3bKPlVrRiBqV5yuMm++op8W4kGFtaQfCs4KEJn0wBZcHVHJ3eoywX8983k1ow==", + "dev": true + } + } + }, + "rollup-plugin-typescript": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/rollup-plugin-typescript/-/rollup-plugin-typescript-0.8.1.tgz", + "integrity": "sha1-L/fuzCHPa7K0P8J+W2iJUs5xkko=", + "dev": true, + "requires": { + "compare-versions": "2.0.1", + "object-assign": "^4.0.1", + "rollup-pluginutils": "^1.3.1", + "tippex": "^2.1.1", + "typescript": "^1.8.9" + }, + "dependencies": { + "estree-walker": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.2.1.tgz", + "integrity": "sha1-va/oCVOD2EFNXcLs9MkXO225QS4=", + "dev": true + }, + "rollup-pluginutils": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-1.5.2.tgz", + "integrity": "sha1-HhVud4+UtyVb+hs9AXi+j1xVJAg=", + "dev": true, + "requires": { + "estree-walker": "^0.2.1", + "minimatch": "^3.0.2" + } + }, + "typescript": { + "version": "1.8.10", + "resolved": "http://registry.npmjs.org/typescript/-/typescript-1.8.10.tgz", + "integrity": "sha1-tHXW4N/wv1DyluXKbvn7tccyDx4=", + "dev": true + } + } + }, + "rollup-plugin-virtual": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/rollup-plugin-virtual/-/rollup-plugin-virtual-1.0.1.tgz", + "integrity": "sha512-HCTBpV8MwP5lNzZrHD2moVxHIToHU1EkzkKGVj6Z0DcgUfxrxrZmeQirQeLz2yhnkJqRjwiVywK9CS8jDYakrw==", + "dev": true + }, + "rollup-pluginutils": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.3.0.tgz", + "integrity": "sha512-xB6hsRsjdJdIYWEyYUJy/3ki5g69wrf0luHPGNK3ZSocV6HLNfio59l3dZ3TL4xUwEKgROhFi9jOCt6c5gfUWw==", + "dev": true, + "requires": { + "estree-walker": "^0.5.2", + "micromatch": "^2.3.11" + } + }, + "rollup-watch": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/rollup-watch/-/rollup-watch-4.3.1.tgz", + "integrity": "sha512-6yjnIwfjpSrqA8IafyIu7fsEyeImNR4aDjA1bQ7KWeVuiA+Clfsx8+PGQkyABWIQzmauQ//tIJ5wAxLXsXs8qQ==", + "dev": true, + "requires": { + "chokidar": "^1.7.0", + "require-relative": "0.8.7", + "rollup-pluginutils": "^2.0.1" + } + }, + "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" + } + }, + "rxjs": { + "version": "5.5.11", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-5.5.11.tgz", + "integrity": "sha512-3bjO7UwWfA2CV7lmwYMBzj4fQ6Cq+ftHc2MvUe+WMS7wcdJ1LosDWmdjPQanYp2dBRj572p7PeU81JUxHKOcBA==", + "dev": true, + "requires": { + "symbol-observable": "1.0.1" + } + }, + "sade": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/sade/-/sade-1.4.1.tgz", + "integrity": "sha512-r2S6GwNeYFYx02w2SYUfhYI9PzxdfNWxsX1QpI3Z4rK9bu9K3FtNVg2awp54Y9iivcYqR2iWqI3nT5jEihNyBg==", + "dev": true, + "requires": { + "mri": "^1.1.0", + "pad-right": "^0.2.2" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "sander": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/sander/-/sander-0.6.0.tgz", + "integrity": "sha1-rxYkzX+2362Y6+9WUxn5IAeNqSU=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.3", + "mkdirp": "^0.5.1", + "rimraf": "^2.5.2" + } + }, + "sax": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "dev": true + }, + "semver": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", + "dev": true + }, + "set-immediate-shim": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", + "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=", + "dev": true + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "shelljs": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.2.tgz", + "integrity": "sha512-pRXeNrCA2Wd9itwhvLp5LZQvPJ0wU6bcjaTMywHHGX5XWhVN2nzSu7WV0q+oUY7mGK3mgSkDDzP3MgjqdyIgbQ==", + "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", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, + "single-line-log": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/single-line-log/-/single-line-log-1.1.2.tgz", + "integrity": "sha1-wvg/Jzo+GhbtsJlWYdoO1e8DM2Q=", + "dev": true, + "requires": { + "string-width": "^1.0.1" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + } + } + }, + "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==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0" + } + }, + "sliced": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sliced/-/sliced-1.0.1.tgz", + "integrity": "sha1-CzpmK10Ewxd7GSa+qCsD+Dei70E=", + "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 + }, + "source-map-support": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.6.tgz", + "integrity": "sha512-N4KXEz7jcKqPf2b2vZF11lQIz9W5ZMuUcIOGj243lduidkf2fjkVKJS9vNxVWn3u/uxX38AcE8U9nnH9FPcq+g==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "sourcemap-codec": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.1.tgz", + "integrity": "sha512-hX1eNBNuilj8yfFnECh0DzLgwKpBLMIvmhgEhixXNui8lMLBInTI8Kyxt++RwJnMNu7cAUo635L2+N1TxMJCzA==", + "dev": true + }, + "spdx-correct": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz", + "integrity": "sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz", + "integrity": "sha512-4K1NsmrlCU1JJgUrtgEeTVyfx8VaYea9J9LvARxhbHtVtohPs/gFGG5yy49beySjlIMhhXZ4QqujIZEfS4l6Cg==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz", + "integrity": "sha512-2+EPwgbnmOIl8HjGBXXMd9NAu02vLjOO1nWw4kmeRDFyHn+M/ETfHxQUK0oXg8ctgVnl9t3rosNVsZ1jG61nDA==", + "dev": true + }, + "speedometer": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/speedometer/-/speedometer-0.1.4.tgz", + "integrity": "sha1-mHbb0qFp0xFUAtSObqYynIgWpQ0=", + "dev": true + }, + "split2": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-2.2.0.tgz", + "integrity": "sha512-RAb22TG39LhI31MbreBgIuKiIKhVsawfTgEGqKHTK87aG+ul/PB8Sqoi3I7kVdRWiCfrKxK3uo4/YUkpNvhPbw==", + "dev": true, + "requires": { + "through2": "^2.0.2" + }, + "dependencies": { + "through2": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", + "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", + "dev": true, + "requires": { + "readable-stream": "^2.1.5", + "xtend": "~4.0.1" + } + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true + } + } + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "sshpk": { + "version": "1.14.2", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.2.tgz", + "integrity": "sha1-xvxhZIo9nE52T9P8306hBeSSupg=", + "dev": true, + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + } + }, + "stealthy-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", + "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "string.prototype.matchall": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-2.0.0.tgz", + "integrity": "sha512-WoZ+B2ypng1dp4iFLF2kmZlwwlE19gmjgKuhL1FJfDgCREWb3ye3SDVHSzLH6bxfnvYmkCxbzkmWcQZHA4P//Q==", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "es-abstract": "^1.10.0", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "regexp.prototype.flags": "^1.2.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~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" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + } + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + }, + "strip-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", + "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", + "dev": true, + "requires": { + "get-stdin": "^4.0.1" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true + }, + "sumchecker": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/sumchecker/-/sumchecker-1.3.1.tgz", + "integrity": "sha1-ebs7RFbdBPGOvbwNcDodHa7FEF0=", + "dev": true, + "requires": { + "debug": "^2.2.0", + "es6-promise": "^4.0.5" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } + } + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "symbol-observable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.0.1.tgz", + "integrity": "sha1-g0D8RwLDEi310iKI+IKD9RPT/dQ=", + "dev": true + }, + "symbol-tree": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.2.tgz", + "integrity": "sha1-rifbOPZgp64uHDt9G8KQgZuFGeY=", + "dev": true + }, + "table": { + "version": "4.0.3", + "resolved": "http://registry.npmjs.org/table/-/table-4.0.3.tgz", + "integrity": "sha512-S7rnFITmBH1EnyKcvxBh1LjYeQMmnZtCXSEbHcH6S0NoKit24ZuFO/T1vDcLdYsLQkM188PVVhQmzKIuThNkKg==", + "dev": true, + "requires": { + "ajv": "^6.0.1", + "ajv-keywords": "^3.0.0", + "chalk": "^2.1.0", + "lodash": "^4.17.4", + "slice-ansi": "1.0.0", + "string-width": "^2.1.1" + }, + "dependencies": { + "ajv": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.2.tgz", + "integrity": "sha512-hOs7GfvI6tUI1LfZddH82ky6mOMyTuY0mk7kE2pWpmhhUSkumzaTO5vbVwij39MdwPQWCV4Zv57Eo06NtL/GVA==", + "dev": true, + "requires": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.1" + } + }, + "fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "dev": true + }, + "json-schema-traverse": { + "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 + } + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "throttleit": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/throttleit/-/throttleit-0.0.2.tgz", + "integrity": "sha1-z+34jmDADdlpe2H90qg0OptoDq8=", + "dev": true + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "through2": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/through2/-/through2-0.2.3.tgz", + "integrity": "sha1-6zKE2k6jEbbMis42U3SKUqvyWj8=", + "dev": true, + "requires": { + "readable-stream": "~1.1.9", + "xtend": "~2.1.1" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + } + } + }, + "tiny-glob": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/tiny-glob/-/tiny-glob-0.2.2.tgz", + "integrity": "sha512-o8rak1FRmr55Nd1Bdcfd+yetPGclFCVHXiKmoBHYULc+FQXBbqb9S3zKAWyqk+RdWvutlGUOw0kCHC0JLF/T4Q==", + "dev": true, + "requires": { + "globalyzer": "^0.1.0", + "globrex": "^0.1.1" + } + }, + "tippex": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/tippex/-/tippex-2.3.1.tgz", + "integrity": "sha1-ov1bcIfXy/sgyYBqbBYQjCwPr9o=", + "dev": true + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.2" + } + }, + "to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true + }, + "tough-cookie": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz", + "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==", + "dev": true, + "requires": { + "punycode": "^1.4.1" + } + }, + "tr46": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", + "integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=", + "dev": true, + "requires": { + "punycode": "^2.1.0" + }, + "dependencies": { + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + } + } + }, + "trim-newlines": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", + "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=", + "dev": true + }, + "trim-right": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", + "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", + "dev": true + }, + "ts-node": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-7.0.0.tgz", + "integrity": "sha512-klJsfswHP0FuOLsvBZ/zzCfUvakOSSxds78mVeK7I+qP76YWtxf16hEZsp3U+b0kIo82R5UatGFeblYMqabb2Q==", + "dev": true, + "requires": { + "arrify": "^1.0.0", + "buffer-from": "^1.1.0", + "diff": "^3.1.0", + "make-error": "^1.1.1", + "minimist": "^1.2.0", + "mkdirp": "^0.5.1", + "source-map-support": "^0.5.6", + "yn": "^2.0.0" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + } + } + }, + "tslib": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", + "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", + "dev": true + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true, + "optional": true + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2" + } + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, + "typescript": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.0.1.tgz", + "integrity": "sha512-zQIMOmC+372pC/CCVLqnQ0zSBiY7HHodU7mpQdjiZddek4GMj31I3dUJ7gAs9o65X7mnRma6OokOkc6f9jjfBg==", + "dev": true + }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + }, + "dependencies": { + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + } + } + }, + "urlgrey": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/urlgrey/-/urlgrey-0.4.4.tgz", + "integrity": "sha1-iS/pWWCAXoVRnxzUOJ8stMu3ZS8=", + "dev": true + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "uuid": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", + "dev": true + }, + "validate-npm-package-license": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz", + "integrity": "sha512-63ZOUnL4SIXj4L0NixR3L1lcjO38crAbgrTpl28t8jjrfuiOBL5Iygm+60qPs/KsZGzPNg6Smnc/oY16QTjF0g==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "vlq": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/vlq/-/vlq-1.0.0.tgz", + "integrity": "sha512-o3WmXySo+oI5thgqr7Qy8uBkT/v9Zr+sRyrh1lr8aWPUkgDWdWt4Nae2WKBrLsocgE8BuWWD0jLc+VW8LeU+2g==", + "dev": true + }, + "w3c-hr-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz", + "integrity": "sha1-gqwr/2PZUOqeMYmlimViX+3xkEU=", + "dev": true, + "requires": { + "browser-process-hrtime": "^0.1.2" + } + }, + "webidl-conversions": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", + "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", + "dev": true + }, + "whatwg-encoding": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.3.tgz", + "integrity": "sha512-jLBwwKUhi8WtBfsMQlL4bUUcT8sMkAtQinscJAe/M4KHCkHuUJAF6vuB0tueNIw4c8ziO6AkRmgY+jL3a0iiPw==", + "dev": true, + "requires": { + "iconv-lite": "0.4.19" + }, + "dependencies": { + "iconv-lite": { + "version": "0.4.19", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", + "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==", + "dev": true + } + } + }, + "whatwg-mimetype": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.1.0.tgz", + "integrity": "sha512-FKxhYLytBQiUKjkYteN71fAUA3g6KpNXoho1isLiLSB3N1G4F35Q5vUxWfKFhBwi5IWF27VE6WxhrnnC+m0Mew==", + "dev": true + }, + "whatwg-url": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-6.5.0.tgz", + "integrity": "sha512-rhRZRqx/TLJQWUpQ6bmrt2UV4f0HCQ463yQuONJqC6fO2VoEb1pTYddbe59SkYq87aoM5A3bdhMZiUiVws+fzQ==", + "dev": true, + "requires": { + "lodash.sortby": "^4.7.0", + "tr46": "^1.0.1", + "webidl-conversions": "^4.0.2" + } + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "write": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", + "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", + "dev": true, + "requires": { + "mkdirp": "^0.5.1" + } + }, + "ws": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-5.2.2.tgz", + "integrity": "sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA==", + "dev": true, + "requires": { + "async-limiter": "~1.0.0" + } + }, + "xml-name-validator": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", + "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", + "dev": true + }, + "xtend": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", + "integrity": "sha1-bv7MKk2tjmlixJAbM3znuoe10os=", + "dev": true, + "requires": { + "object-keys": "~0.4.0" + }, + "dependencies": { + "object-keys": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz", + "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=", + "dev": true + } + } + }, + "yauzl": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.4.1.tgz", + "integrity": "sha1-lSj0QtqxsihOWLQ3m7GU4i4MQAU=", + "dev": true, + "requires": { + "fd-slicer": "~1.0.1" + } + }, + "yn": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yn/-/yn-2.0.0.tgz", + "integrity": "sha1-5a2ryKz0CPY4X8dklWhMiOavaJo=", + "dev": true + } + } +} diff --git a/package.json b/package.json index 539e1933cd..5dbc83ad9e 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,19 @@ { "name": "svelte", - "version": "2.2.0", + "version": "2.14.3", "description": "The magical disappearing UI framework", "main": "compiler/svelte.js", + "bin": { + "svelte": "svelte" + }, "files": [ - "compiler", - "ssr", + "cli", + "compiler/*.js", + "ssr/*.js", "shared.js", "store.js", "store.umd.js", + "svelte", "README.md" ], "scripts": { @@ -23,6 +28,7 @@ "prepare": "npm run build", "dev": "node src/shared/_build.js && rollup -c -w", "pretest": "npm run build", + "posttest": "agadoo shared.js", "prepublishOnly": "npm run lint && npm test", "prettier": "prettier --write \"src/**/*.ts\"" }, @@ -44,42 +50,46 @@ "homepage": "https://github.com/sveltejs/svelte#README", "devDependencies": { "@types/mocha": "^5.2.0", - "@types/node": "^9.6.6", + "@types/node": "^10.5.5", "acorn": "^5.4.1", "acorn-dynamic-import": "^3.0.0", + "agadoo": "^1.0.1", "chalk": "^2.4.0", "codecov": "^3.0.0", "console-group": "^0.3.2", "css-tree": "1.0.0-alpha22", - "eslint": "^4.19.1", + "eslint": "^5.3.0", "eslint-plugin-html": "^4.0.3", "eslint-plugin-import": "^2.11.0", "estree-walker": "^0.5.1", - "glob": "^7.1.1", "is-reference": "^1.1.0", "jsdom": "^11.8.0", + "kleur": "^2.0.1", "locate-character": "^2.0.5", - "magic-string": "^0.24.0", - "mocha": "3", + "magic-string": "^0.25.0", + "mocha": "^5.2.0", "nightmare": "^3.0.1", "node-resolve": "^1.3.3", - "nyc": "^11.7.1", + "nyc": "^12.0.2", "prettier": "^1.12.1", - "reify": "^0.15.1", - "rollup": "^0.58.1", + "rollup": "^0.63.5", "rollup-plugin-buble": "^0.19.2", "rollup-plugin-commonjs": "^9.1.0", - "rollup-plugin-json": "^2.1.0", + "rollup-plugin-json": "^3.0.0", "rollup-plugin-node-resolve": "^3.3.0", "rollup-plugin-replace": "^2.0.0", "rollup-plugin-typescript": "^0.8.1", "rollup-plugin-virtual": "^1.0.1", "rollup-watch": "^4.3.1", + "sade": "^1.4.0", + "sander": "^0.6.0", + "shelljs": "^0.8.2", "source-map": "0.6", "source-map-support": "^0.5.4", - "ts-node": "^6.0.0", + "tiny-glob": "^0.2.1", + "ts-node": "^7.0.0", "tslib": "^1.8.0", - "typescript": "^2.8.3" + "typescript": "^3.0.1" }, "nyc": { "include": [ diff --git a/rollup.config.js b/rollup.config.js index 5ad189694b..b83f70ed94 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -57,6 +57,28 @@ export default [ } }, + /* cli/*.js */ + { + input: ['src/cli/index.ts'], + output: { + dir: 'cli', + format: 'cjs', + paths: { + svelte: '../compiler/svelte.js' + } + }, + external: ['fs', 'path', 'os', 'svelte'], + plugins: [ + json(), + commonjs(), + resolve(), + typescript({ + typescript: require('typescript') + }) + ], + experimentalCodeSplitting: true + }, + /* shared.js */ { input: 'src/shared/index.js', diff --git a/src/Stats.ts b/src/Stats.ts index c9e62aef21..b2e16a805c 100644 --- a/src/Stats.ts +++ b/src/Stats.ts @@ -1,12 +1,12 @@ import { Node, Warning } from './interfaces'; -import Compiler from './compile/Compiler'; +import Component from './compile/Component'; const now = (typeof process !== 'undefined' && process.hrtime) ? () => { const t = process.hrtime(); return t[0] * 1e3 + t[1] / 1e6; } - : () => window.performance.now(); + : () => self.performance.now(); type Timing = { label: string; @@ -64,7 +64,7 @@ export default class Stats { stop(label) { if (label !== this.currentTiming.label) { - throw new Error(`Mismatched timing labels`); + throw new Error(`Mismatched timing labels (expected ${this.currentTiming.label}, got ${label})`); } this.currentTiming.end = now(); @@ -73,12 +73,14 @@ export default class Stats { this.currentChildren = this.currentTiming ? this.currentTiming.children : this.timings; } - render(compiler: Compiler) { + render(component: Component) { const timings = Object.assign({ total: now() - this.startTime }, collapseTimings(this.timings)); - const imports = compiler.imports.map(node => { + // TODO would be good to have this info even + // if options.generate is false + const imports = component && component.imports.map(node => { return { source: node.source.value, specifiers: node.specifiers.map(specifier => { @@ -94,9 +96,12 @@ export default class Stats { } }); - const hooks: Record = {}; - if (compiler.templateProperties.oncreate) hooks.oncreate = true; - if (compiler.templateProperties.ondestroy) hooks.ondestroy = true; + const hooks: Record = component && { + oncreate: !!component.templateProperties.oncreate, + ondestroy: !!component.templateProperties.ondestroy, + onstate: !!component.templateProperties.onstate, + onupdate: !!component.templateProperties.onupdate + }; return { timings, diff --git a/src/cli/compile.ts b/src/cli/compile.ts new file mode 100644 index 0000000000..47141f2346 --- /dev/null +++ b/src/cli/compile.ts @@ -0,0 +1,145 @@ +import * as path from 'path'; +import * as fs from 'fs'; +import * as svelte from 'svelte'; +import error from './error.js'; + +function mkdirp(dir) { + const parent = path.dirname(dir); + if (dir === parent) return; + + mkdirp(parent); + if (!fs.existsSync(dir)) fs.mkdirSync(dir); +} + +export function compile(input, opts) { + if (opts._.length > 0) { + error(`Can only compile a single file or directory`); + } + + const output = opts.output; + + const stats = fs.statSync(input); + const isDir = stats.isDirectory(); + + if (isDir) { + if (!output) { + error(`You must specify an --output (-o) option when compiling a directory of files`); + } + + if (opts.name || opts.amdId) { + error(`Cannot specify --${opts.name ? 'name' : 'amdId'} when compiling a directory`); + } + } + + const globals = {}; + if (opts.globals) { + opts.globals.split(',').forEach(pair => { + const [key, value] = pair.split(':'); + globals[key] = value; + }); + } + + const options = { + name: opts.name, + format: opts.format, + sourceMap: opts.sourcemap, + globals, + amd: opts.amdId + ? { + id: opts.amdId, + } + : undefined, + css: opts.css !== false, + dev: opts.dev, + immutable: opts.immutable, + generate: opts.generate || 'dom', + customElement: opts.customElement, + store: opts.store, + shared: opts.shared + }; + + if (isDir) { + mkdirp(output); + compileDirectory(input, output, options); + } else { + compileFile(input, output, options); + } +} + +function compileDirectory(input, output, options) { + fs.readdirSync(input).forEach(file => { + const src = path.resolve(input, file); + const dest = path.resolve(output, file); + + if (path.extname(file) === '.html') { + compileFile( + src, + dest.substring(0, dest.lastIndexOf('.html')) + '.js', + options + ); + } else { + const stats = fs.statSync(src); + if (stats.isDirectory()) { + compileDirectory(src, dest, options); + } + } + }); +} + +let SOURCEMAPPING_URL = 'sourceMa'; +SOURCEMAPPING_URL += 'ppingURL'; + +function compileFile(input, output, options) { + console.error(`compiling ${path.relative(process.cwd(), input)}...`); // eslint-disable-line no-console + + options = Object.assign({}, options); + if (!options.name) options.name = getName(input); + + options.filename = input; + options.outputFilename = output; + + const { sourceMap } = options; + const inline = sourceMap === 'inline'; + + let source = fs.readFileSync(input, 'utf-8'); + if (source[0] === 0xfeff) source = source.slice(1); + + let compiled; + + try { + compiled = svelte.compile(source, options); + } catch (err) { + error(err); + } + + const { js } = compiled; + + if (sourceMap) { + js.code += `\n//# ${SOURCEMAPPING_URL}=${inline || !output + ? js.map.toUrl() + : `${path.basename(output)}.map`}\n`; + } + + if (output) { + const outputDir = path.dirname(output); + mkdirp(outputDir); + fs.writeFileSync(output, js.code); + console.error(`wrote ${path.relative(process.cwd(), output)}`); // eslint-disable-line no-console + if (sourceMap && !inline) { + fs.writeFileSync(`${output}.map`, js.map); + console.error(`wrote ${path.relative(process.cwd(), `${output}.map`)}`); // eslint-disable-line no-console + } + } else { + process.stdout.write(js.code); + } +} + +function getName(input) { + return path + .basename(input) + .replace(path.extname(input), '') + .replace(/[^a-zA-Z_$0-9]+/g, '_') + .replace(/^_/, '') + .replace(/_$/, '') + .replace(/^(\d)/, '_$1'); +} diff --git a/src/cli/error.ts b/src/cli/error.ts new file mode 100644 index 0000000000..2413ab9ee5 --- /dev/null +++ b/src/cli/error.ts @@ -0,0 +1,17 @@ +import c from 'kleur'; + +function stderr(msg) { + console.error(msg); // eslint-disable-line no-console +} + +export default function error(err) { + stderr(c.red(err.message || err)); + + if (err.frame) { + stderr(err.frame); + } else if (err.stack) { + stderr(c.gray(err.stack)); + } + + process.exit(1); +} diff --git a/src/cli/index.ts b/src/cli/index.ts new file mode 100644 index 0000000000..82d19c18f0 --- /dev/null +++ b/src/cli/index.ts @@ -0,0 +1,31 @@ +import sade from 'sade'; +import * as pkg from '../../package.json'; + +const prog = sade('svelte').version(pkg.version); + +prog + .command('compile ') + + .option('-o, --output', 'Output (if absent, prints to stdout)') + .option('-f, --format', 'Type of output (amd, cjs, es, iife, umd)') + .option('-g, --globals', 'Comma-separate list of `module ID:Global` pairs') + .option('-n, --name', 'Name for IIFE/UMD export (inferred from filename by default)') + .option('-m, --sourcemap', 'Generate sourcemap (`-m inline` for inline map)') + .option('-d, --dev', 'Add dev mode warnings and errors') + .option('--amdId', 'ID for AMD module (default is anonymous)') + .option('--generate', 'Change generate format between `dom` and `ssr`') + .option('--no-css', `Don't include CSS (useful with SSR)`) + .option('--immutable', 'Support immutable data structures') + .option('--shared', 'Don\'t include shared helpers') + + .example('compile App.html > App.js') + .example('compile src -o dest') + .example('compile -f umd MyComponent.html > MyComponent.js') + + .action((input, opts) => { + import('./compile').then(({ compile }) => { + compile(input, opts); + }); + }) + + .parse(process.argv); \ No newline at end of file diff --git a/src/compile/Compiler.ts b/src/compile/Compiler.ts deleted file mode 100644 index da5207de39..0000000000 --- a/src/compile/Compiler.ts +++ /dev/null @@ -1,708 +0,0 @@ -import { parseExpressionAt } from 'acorn'; -import MagicString, { Bundle } from 'magic-string'; -import isReference from 'is-reference'; -import { walk, childKeys } from 'estree-walker'; -import { getLocator } from 'locate-character'; -import Stats from '../Stats'; -import deindent from '../utils/deindent'; -import CodeBuilder from '../utils/CodeBuilder'; -import flattenReference from '../utils/flattenReference'; -import reservedNames from '../utils/reservedNames'; -import namespaces from '../utils/namespaces'; -import { removeNode, removeObjectKey } from '../utils/removeNode'; -import nodeToString from '../utils/nodeToString'; -import wrapModule from './wrapModule'; -import annotateWithScopes, { Scope } from '../utils/annotateWithScopes'; -import getName from '../utils/getName'; -import Stylesheet from '../css/Stylesheet'; -import { test } from '../config'; -import Fragment from './nodes/Fragment'; -import shared from './shared'; -import { DomTarget } from './dom/index'; -import { SsrTarget } from './ssr/index'; -import { Node, GenerateOptions, ShorthandImport, Ast, CompileOptions, CustomElementOptions } from '../interfaces'; - -interface Computation { - key: string; - deps: string[] -} - -function detectIndentation(str: string) { - const pattern = /^[\t\s]{1,4}/gm; - let match; - - while (match = pattern.exec(str)) { - if (match[0][0] === '\t') return '\t'; - if (match[0].length === 2) return ' '; - } - - return ' '; -} - -function getIndentationLevel(str: string, b: number) { - let a = b; - while (a > 0 && str[a - 1] !== '\n') a -= 1; - return /^\s*/.exec(str.slice(a, b))[0]; -} - -function getIndentExclusionRanges(node: Node) { - const ranges: Node[] = []; - walk(node, { - enter(node: Node) { - if (node.type === 'TemplateElement') ranges.push(node); - } - }); - return ranges; -} - -function removeIndentation( - code: MagicString, - start: number, - end: number, - indentationLevel: string, - ranges: Node[] -) { - const str = code.original.slice(start, end); - const pattern = new RegExp(`^${indentationLevel}`, 'gm'); - let match; - - while (match = pattern.exec(str)) { - // TODO bail if we're inside an exclusion range - code.remove(start + match.index, start + match.index + indentationLevel.length); - } -} - -// We need to tell estree-walker that it should always -// look for an `else` block, otherwise it might get -// the wrong idea about the shape of each/if blocks -childKeys.EachBlock = childKeys.IfBlock = ['children', 'else']; -childKeys.Attribute = ['value']; - -export default class Compiler { - stats: Stats; - - ast: Ast; - source: string; - name: string; - options: CompileOptions; - fragment: Fragment; - target: DomTarget | SsrTarget; - - customElement: CustomElementOptions; - tag: string; - props: string[]; - - defaultExport: Node[]; - imports: Node[]; - shorthandImports: ShorthandImport[]; - helpers: Set; - components: Set; - events: Set; - methods: Set; - transitions: Set; - actions: Set; - importedComponents: Map; - namespace: string; - hasComponents: boolean; - computations: Computation[]; - templateProperties: Record; - slots: Set; - javascript: string; - - code: MagicString; - - bindingGroups: string[]; - indirectDependencies: Map>; - expectedProperties: Set; - usesRefs: boolean; - - locate: (c: number) => { line: number, column: number }; - - stylesheet: Stylesheet; - - userVars: Set; - templateVars: Map; - aliases: Map; - usedNames: Set; - - constructor( - ast: Ast, - source: string, - name: string, - stylesheet: Stylesheet, - options: CompileOptions, - stats: Stats, - dom: boolean, - target: DomTarget | SsrTarget - ) { - stats.start('compile'); - this.stats = stats; - - this.ast = ast; - this.source = source; - this.options = options; - this.target = target; - - this.imports = []; - this.shorthandImports = []; - this.helpers = new Set(); - this.components = new Set(); - this.events = new Set(); - this.methods = new Set(); - this.transitions = new Set(); - this.actions = new Set(); - this.importedComponents = new Map(); - this.slots = new Set(); - - this.bindingGroups = []; - this.indirectDependencies = new Map(); - - this.locate = getLocator(this.source); - - // track which properties are needed, so we can provide useful info - // in dev mode - this.expectedProperties = new Set(); - - this.code = new MagicString(source); - this.usesRefs = false; - - // styles - this.stylesheet = stylesheet; - - // allow compiler to deconflict user's `import { get } from 'whatever'` and - // Svelte's builtin `import { get, ... } from 'svelte/shared.ts'`; - this.userVars = new Set(); - this.templateVars = new Map(); - this.aliases = new Map(); - this.usedNames = new Set(); - - this.computations = []; - this.templateProperties = {}; - - this.walkJs(dom); - this.name = this.alias(name); - - if (options.customElement === true) { - this.customElement = { - tag: this.tag, - props: this.props - } - } else { - this.customElement = options.customElement; - } - - if (this.customElement && !this.customElement.tag) { - throw new Error(`No tag name specified`); // TODO better error - } - - this.fragment = new Fragment(this, ast.html); - // this.walkTemplate(); - if (!this.customElement) this.stylesheet.reify(); - - stylesheet.warnOnUnusedSelectors(options.onwarn); - } - - addSourcemapLocations(node: Node) { - walk(node, { - enter: (node: Node) => { - this.code.addSourcemapLocation(node.start); - this.code.addSourcemapLocation(node.end); - }, - }); - } - - alias(name: string) { - if (!this.aliases.has(name)) { - this.aliases.set(name, this.getUniqueName(name)); - } - - return this.aliases.get(name); - } - - generate(result: string, options: CompileOptions, { banner = '', name, format }: GenerateOptions ) { - const pattern = /\[✂(\d+)-(\d+)$/; - - const helpers = new Set(); - - // TODO use same regex for both - result = result.replace(options.generate === 'ssr' ? /(@+|#+|%+)(\w*(?:-\w*)?)/g : /(%+|@+)(\w*(?:-\w*)?)/g, (match: string, sigil: string, name: string) => { - if (sigil === '@') { - if (name in shared) { - if (options.dev && `${name}Dev` in shared) name = `${name}Dev`; - helpers.add(name); - } - - return this.alias(name); - } - - if (sigil === '%') { - return this.templateVars.get(name); - } - - return sigil.slice(1) + name; - }); - - let importedHelpers; - - if (options.shared) { - if (format !== 'es' && format !== 'cjs') { - throw new Error(`Components with shared helpers must be compiled with \`format: 'es'\` or \`format: 'cjs'\``); - } - - importedHelpers = Array.from(helpers).sort().map(name => { - const alias = this.alias(name); - return { name, alias }; - }); - } else { - let inlineHelpers = ''; - - const compiler = this; - - importedHelpers = []; - - helpers.forEach(name => { - const str = shared[name]; - const code = new MagicString(str); - const expression = parseExpressionAt(str, 0); - - let { scope } = annotateWithScopes(expression); - - walk(expression, { - enter(node: Node, parent: Node) { - if (node._scope) scope = node._scope; - - if ( - node.type === 'Identifier' && - isReference(node, parent) && - !scope.has(node.name) - ) { - if (node.name in shared) { - // this helper function depends on another one - const dependency = node.name; - helpers.add(dependency); - - const alias = compiler.alias(dependency); - if (alias !== node.name) { - code.overwrite(node.start, node.end, alias); - } - } - } - }, - - leave(node: Node) { - if (node._scope) scope = scope.parent; - }, - }); - - if (name === 'transitionManager') { - // special case - const global = `_svelteTransitionManager`; - - inlineHelpers += `\n\nvar ${this.alias('transitionManager')} = window.${global} || (window.${global} = ${code});\n\n`; - } else if (name === 'escaped' || name === 'missingComponent') { - // vars are an awkward special case... would be nice to avoid this - const alias = this.alias(name); - inlineHelpers += `\n\nconst ${alias} = ${code};` - } else { - const alias = this.alias(expression.id.name); - if (alias !== expression.id.name) { - code.overwrite(expression.id.start, expression.id.end, alias); - } - - inlineHelpers += `\n\n${code}`; - } - }); - - result += inlineHelpers; - } - - const sharedPath = options.shared === true - ? 'svelte/shared.js' - : options.shared || ''; - - const module = wrapModule(result, format, name, options, banner, sharedPath, importedHelpers, this.imports, this.shorthandImports, this.source); - - const parts = module.split('✂]'); - const finalChunk = parts.pop(); - - const compiled = new Bundle({ separator: '' }); - - function addString(str: string) { - compiled.addSource({ - content: new MagicString(str), - }); - } - - const { filename } = options; - - // special case — the source file doesn't actually get used anywhere. we need - // to add an empty file to populate map.sources and map.sourcesContent - if (!parts.length) { - compiled.addSource({ - filename, - content: new MagicString(this.source).remove(0, this.source.length), - }); - } - - parts.forEach((str: string) => { - const chunk = str.replace(pattern, ''); - if (chunk) addString(chunk); - - const match = pattern.exec(str); - - const snippet = this.code.snip(+match[1], +match[2]); - - compiled.addSource({ - filename, - content: snippet, - }); - }); - - addString(finalChunk); - - const css = this.customElement ? - { code: null, map: null } : - this.stylesheet.render(options.cssOutputFilename, true); - - const js = { - code: compiled.toString(), - map: compiled.generateMap({ - includeContent: true, - file: options.outputFilename, - }) - }; - - this.stats.stop('compile'); - - return { - ast: this.ast, - js, - css, - stats: this.stats.render(this) - }; - } - - getUniqueName(name: string) { - if (test) name = `${name}$`; - let alias = name; - for ( - let i = 1; - reservedNames.has(alias) || - this.userVars.has(alias) || - this.usedNames.has(alias); - alias = `${name}_${i++}` - ); - this.usedNames.add(alias); - return alias; - } - - getUniqueNameMaker() { - const localUsedNames = new Set(); - - function add(name: string) { - localUsedNames.add(name); - } - - reservedNames.forEach(add); - this.userVars.forEach(add); - - return (name: string) => { - if (test) name = `${name}$`; - let alias = name; - for ( - let i = 1; - this.usedNames.has(alias) || - localUsedNames.has(alias); - alias = `${name}_${i++}` - ); - localUsedNames.add(alias); - return alias; - }; - } - - walkJs(dom: boolean) { - const { - code, - source, - computations, - methods, - templateProperties, - imports - } = this; - - const { js } = this.ast; - - const componentDefinition = new CodeBuilder(); - - if (js) { - this.addSourcemapLocations(js.content); - - const indentation = detectIndentation(source.slice(js.start, js.end)); - const indentationLevel = getIndentationLevel(source, js.content.body[0].start); - const indentExclusionRanges = getIndentExclusionRanges(js.content); - - const { scope, globals } = annotateWithScopes(js.content); - - scope.declarations.forEach(name => { - this.userVars.add(name); - }); - - globals.forEach(name => { - this.userVars.add(name); - }); - - const body = js.content.body.slice(); // slice, because we're going to be mutating the original - - // imports need to be hoisted out of the IIFE - for (let i = 0; i < body.length; i += 1) { - const node = body[i]; - if (node.type === 'ImportDeclaration') { - removeNode(code, js.content, node); - imports.push(node); - - node.specifiers.forEach((specifier: Node) => { - this.userVars.add(specifier.local.name); - }); - } - } - - const defaultExport = this.defaultExport = body.find( - (node: Node) => node.type === 'ExportDefaultDeclaration' - ); - - if (defaultExport) { - defaultExport.declaration.properties.forEach((prop: Node) => { - templateProperties[getName(prop.key)] = prop; - }); - - ['helpers', 'events', 'components', 'transitions', 'actions'].forEach(key => { - if (templateProperties[key]) { - templateProperties[key].value.properties.forEach((prop: Node) => { - this[key].add(getName(prop.key)); - }); - } - }); - - const addArrowFunctionExpression = (name: string, node: Node) => { - const { body, params, async } = node; - const fnKeyword = async ? 'async function' : 'function'; - - const paramString = params.length ? - `[✂${params[0].start}-${params[params.length - 1].end}✂]` : - ``; - - if (body.type === 'BlockStatement') { - componentDefinition.addBlock(deindent` - ${fnKeyword} ${name}(${paramString}) [✂${body.start}-${body.end}✂] - `); - } else { - componentDefinition.addBlock(deindent` - ${fnKeyword} ${name}(${paramString}) { - return [✂${body.start}-${body.end}✂]; - } - `); - } - }; - - const addFunctionExpression = (name: string, node: Node) => { - const { async } = node; - const fnKeyword = async ? 'async function' : 'function'; - - let c = node.start; - while (this.source[c] !== '(') c += 1; - componentDefinition.addBlock(deindent` - ${fnKeyword} ${name}[✂${c}-${node.end}✂]; - `); - }; - - const addValue = (name: string, node: Node) => { - componentDefinition.addBlock(deindent` - var ${name} = [✂${node.start}-${node.end}✂]; - `); - }; - - const addDeclaration = (key: string, node: Node, allowShorthandImport?: boolean, disambiguator?: string, conflicts?: Record) => { - const qualified = disambiguator ? `${disambiguator}-${key}` : key; - - if (node.type === 'Identifier' && node.name === key) { - this.templateVars.set(qualified, key); - return; - } - - let deconflicted = key; - if (conflicts) while (deconflicted in conflicts) deconflicted += '_' - - let name = this.getUniqueName(deconflicted); - this.templateVars.set(qualified, name); - - if (allowShorthandImport && node.type === 'Literal' && typeof node.value === 'string') { - this.shorthandImports.push({ name, source: node.value }); - return; - } - - // deindent - const indentationLevel = getIndentationLevel(source, node.start); - if (indentationLevel) { - removeIndentation(code, node.start, node.end, indentationLevel, indentExclusionRanges); - } - - if (node.type === 'ArrowFunctionExpression') { - addArrowFunctionExpression(name, node); - } else if (node.type === 'FunctionExpression') { - addFunctionExpression(name, node); - } else { - addValue(name, node); - } - }; - - if (templateProperties.components) { - templateProperties.components.value.properties.forEach((property: Node) => { - addDeclaration(getName(property.key), property.value, true, 'components'); - }); - } - - if (templateProperties.computed) { - const dependencies = new Map(); - - templateProperties.computed.value.properties.forEach((prop: Node) => { - const key = getName(prop.key); - const value = prop.value; - - const deps = value.params[0].properties.map(prop => prop.key.name); - - deps.forEach(dep => { - this.expectedProperties.add(dep); - }); - dependencies.set(key, deps); - }); - - const visited = new Set(); - - const visit = (key: string) => { - if (!dependencies.has(key)) return; // not a computation - - if (visited.has(key)) return; - visited.add(key); - - const deps = dependencies.get(key); - deps.forEach(visit); - - computations.push({ key, deps }); - - const prop = templateProperties.computed.value.properties.find((prop: Node) => getName(prop.key) === key); - - addDeclaration(key, prop.value, false, 'computed', { - state: true, - changed: true - }); - }; - - templateProperties.computed.value.properties.forEach((prop: Node) => - visit(getName(prop.key)) - ); - } - - if (templateProperties.data) { - addDeclaration('data', templateProperties.data.value); - } - - if (templateProperties.events && dom) { - templateProperties.events.value.properties.forEach((property: Node) => { - addDeclaration(getName(property.key), property.value, false, 'events'); - }); - } - - if (templateProperties.helpers) { - templateProperties.helpers.value.properties.forEach((property: Node) => { - addDeclaration(getName(property.key), property.value, false, 'helpers'); - }); - } - - if (templateProperties.methods && dom) { - addDeclaration('methods', templateProperties.methods.value); - - templateProperties.methods.value.properties.forEach(prop => { - this.methods.add(prop.key.name); - }); - } - - if (templateProperties.namespace) { - const ns = nodeToString(templateProperties.namespace.value); - this.namespace = namespaces[ns] || ns; - } - - if (templateProperties.oncreate && dom) { - addDeclaration('oncreate', templateProperties.oncreate.value); - } - - if (templateProperties.ondestroy && dom) { - addDeclaration('ondestroy', templateProperties.ondestroy.value); - } - - if (templateProperties.onstate && dom) { - addDeclaration('onstate', templateProperties.onstate.value); - } - - if (templateProperties.onupdate && dom) { - addDeclaration('onupdate', templateProperties.onupdate.value); - } - - if (templateProperties.preload) { - addDeclaration('preload', templateProperties.preload.value); - } - - if (templateProperties.props) { - this.props = templateProperties.props.value.elements.map((element: Node) => nodeToString(element)); - } - - if (templateProperties.setup) { - addDeclaration('setup', templateProperties.setup.value); - } - - if (templateProperties.store) { - addDeclaration('store', templateProperties.store.value); - } - - if (templateProperties.tag) { - this.tag = nodeToString(templateProperties.tag.value); - } - - if (templateProperties.transitions) { - templateProperties.transitions.value.properties.forEach((property: Node) => { - addDeclaration(getName(property.key), property.value, false, 'transitions'); - }); - } - - if (templateProperties.actions) { - templateProperties.actions.value.properties.forEach((property: Node) => { - addDeclaration(getName(property.key), property.value, false, 'actions'); - }); - } - } - - if (indentationLevel) { - if (defaultExport) { - removeIndentation(code, js.content.start, defaultExport.start, indentationLevel, indentExclusionRanges); - removeIndentation(code, defaultExport.end, js.content.end, indentationLevel, indentExclusionRanges); - } else { - removeIndentation(code, js.content.start, js.content.end, indentationLevel, indentExclusionRanges); - } - } - - let a = js.content.start; - while (/\s/.test(source[a])) a += 1; - - let b = js.content.end; - while (/\s/.test(source[b - 1])) b -= 1; - - if (defaultExport) { - this.javascript = ''; - if (a !== defaultExport.start) this.javascript += `[✂${a}-${defaultExport.start}✂]`; - if (!componentDefinition.isEmpty()) this.javascript += componentDefinition; - if (defaultExport.end !== b) this.javascript += `[✂${defaultExport.end}-${b}✂]`; - } else { - this.javascript = a === b ? null : `[✂${a}-${b}✂]`; - } - } - } -} diff --git a/src/compile/Component.ts b/src/compile/Component.ts new file mode 100644 index 0000000000..4a249d2287 --- /dev/null +++ b/src/compile/Component.ts @@ -0,0 +1,937 @@ +import { parseExpressionAt } from 'acorn'; +import MagicString, { Bundle } from 'magic-string'; +import isReference from 'is-reference'; +import { walk, childKeys } from 'estree-walker'; +import { getLocator } from 'locate-character'; +import Stats from '../Stats'; +import deindent from '../utils/deindent'; +import reservedNames from '../utils/reservedNames'; +import namespaces from '../utils/namespaces'; +import { removeNode } from '../utils/removeNode'; +import nodeToString from '../utils/nodeToString'; +import wrapModule from './wrapModule'; +import annotateWithScopes from '../utils/annotateWithScopes'; +import getName from '../utils/getName'; +import Stylesheet from './css/Stylesheet'; +import { test } from '../config'; +import Fragment from './nodes/Fragment'; +import shared from './shared'; +import { Node, ShorthandImport, Ast, CompileOptions, CustomElementOptions } from '../interfaces'; +import error from '../utils/error'; +import getCodeFrame from '../utils/getCodeFrame'; +import checkForComputedKeys from './validate/js/utils/checkForComputedKeys'; +import checkForDupes from './validate/js/utils/checkForDupes'; +import propValidators from './validate/js/propValidators'; +import fuzzymatch from './validate/utils/fuzzymatch'; +import flattenReference from '../utils/flattenReference'; + +interface Computation { + key: string; + deps: string[]; + hasRestParam: boolean; +} + +interface Declaration { + type: string; + name: string; + node: Node; + block: string; +} + +function detectIndentation(str: string) { + const pattern = /^[\t\s]{1,4}/gm; + let match; + + while (match = pattern.exec(str)) { + if (match[0][0] === '\t') return '\t'; + if (match[0].length === 2) return ' '; + } + + return ' '; +} + +function getIndentationLevel(str: string, b: number) { + let a = b; + while (a > 0 && str[a - 1] !== '\n') a -= 1; + return /^\s*/.exec(str.slice(a, b))[0]; +} + +function getIndentExclusionRanges(node: Node) { + // TODO can we fold this into a different pass? + const ranges: Node[] = []; + walk(node, { + enter(node: Node) { + if (node.type === 'TemplateElement') ranges.push(node); + } + }); + return ranges; +} + +function removeIndentation( + code: MagicString, + start: number, + end: number, + indentationLevel: string, + ranges: Node[] +) { + const str = code.original.slice(start, end); + const pattern = new RegExp(`^${indentationLevel}`, 'gm'); + let match; + + while (match = pattern.exec(str)) { + // TODO bail if we're inside an exclusion range + code.remove(start + match.index, start + match.index + indentationLevel.length); + } +} + +// We need to tell estree-walker that it should always +// look for an `else` block, otherwise it might get +// the wrong idea about the shape of each/if blocks +childKeys.EachBlock = childKeys.IfBlock = ['children', 'else']; +childKeys.Attribute = ['value']; + +export default class Component { + stats: Stats; + + ast: Ast; + source: string; + name: string; + options: CompileOptions; + fragment: Fragment; + + customElement: CustomElementOptions; + tag: string; + props: string[]; + + properties: Map; + + defaultExport: Node; + imports: Node[]; + shorthandImports: ShorthandImport[]; + helpers: Set; + components: Set; + events: Set; + methods: Set; + animations: Set; + transitions: Set; + actions: Set; + importedComponents: Map; + namespace: string; + hasComponents: boolean; + computations: Computation[]; + templateProperties: Record; + javascript: [string, string]; + + used: { + components: Set; + helpers: Set; + events: Set; + animations: Set; + transitions: Set; + actions: Set; + }; + + declarations: Declaration[]; + + refCallees: Node[]; + + code: MagicString; + + indirectDependencies: Map>; + expectedProperties: Set; + refs: Set; + + file: string; + locate: (c: number) => { line: number, column: number }; + + stylesheet: Stylesheet; + + userVars: Set; + templateVars: Map; + aliases: Map; + usedNames: Set; + + locator: (search: number, startIndex?: number) => { + line: number, + column: number + }; + + constructor( + ast: Ast, + source: string, + name: string, + options: CompileOptions, + stats: Stats + ) { + this.stats = stats; + + this.ast = ast; + this.source = source; + this.options = options; + + this.imports = []; + this.shorthandImports = []; + this.helpers = new Set(); + this.components = new Set(); + this.events = new Set(); + this.methods = new Set(); + this.animations = new Set(); + this.transitions = new Set(); + this.actions = new Set(); + this.importedComponents = new Map(); + + this.used = { + components: new Set(), + helpers: new Set(), + events: new Set(), + animations: new Set(), + transitions: new Set(), + actions: new Set(), + }; + + this.declarations = []; + + this.refs = new Set(); + this.refCallees = []; + + this.indirectDependencies = new Map(); + + this.file = options.filename && ( + typeof process !== 'undefined' ? options.filename.replace(process.cwd(), '').replace(/^[\/\\]/, '') : options.filename + ); + this.locate = getLocator(this.source); + + // track which properties are needed, so we can provide useful info + // in dev mode + this.expectedProperties = new Set(); + + this.code = new MagicString(source); + + // styles + this.stylesheet = new Stylesheet(source, ast, options.filename, options.dev); + this.stylesheet.validate(this); + + // allow compiler to deconflict user's `import { get } from 'whatever'` and + // Svelte's builtin `import { get, ... } from 'svelte/shared.ts'`; + this.userVars = new Set(); + this.templateVars = new Map(); + this.aliases = new Map(); + this.usedNames = new Set(); + + this.computations = []; + this.templateProperties = {}; + this.properties = new Map(); + + this.walkJs(); + this.name = this.alias(name); + + if (options.customElement === true) { + this.customElement = { + tag: this.tag, + props: this.props + } + } else { + this.customElement = options.customElement; + } + + if (this.customElement && !this.customElement.tag) { + throw new Error(`No tag name specified`); // TODO better error + } + + this.fragment = new Fragment(this, ast.html); + // this.walkTemplate(); + if (!this.customElement) this.stylesheet.reify(); + + this.stylesheet.warnOnUnusedSelectors(options.onwarn); + + if (this.defaultExport) { + const categories = { + components: 'component', + helpers: 'helper', + events: 'event definition', + transitions: 'transition', + actions: 'actions', + }; + + Object.keys(categories).forEach(category => { + const definitions = this.defaultExport.declaration.properties.find(prop => prop.key.name === category); + if (definitions) { + definitions.value.properties.forEach(prop => { + const { name } = prop.key; + if (!this.used[category].has(name)) { + this.warn(prop, { + code: `unused-${category.slice(0, -1)}`, + message: `The '${name}' ${categories[category]} is unused` + }); + } + }); + } + }); + } + + this.refCallees.forEach(callee => { + const { parts } = flattenReference(callee); + const ref = parts[1]; + + if (this.refs.has(ref)) { + // TODO check method is valid, e.g. `audio.stop()` should be `audio.pause()` + } else { + const match = fuzzymatch(ref, Array.from(this.refs.keys())); + + let message = `'refs.${ref}' does not exist`; + if (match) message += ` (did you mean 'refs.${match}'?)`; + + this.error(callee, { + code: `missing-ref`, + message + }); + } + }); + } + + addSourcemapLocations(node: Node) { + walk(node, { + enter: (node: Node) => { + this.code.addSourcemapLocation(node.start); + this.code.addSourcemapLocation(node.end); + }, + }); + } + + alias(name: string) { + if (!this.aliases.has(name)) { + this.aliases.set(name, this.getUniqueName(name)); + } + + return this.aliases.get(name); + } + + generate(result: string, options: CompileOptions, { + banner = '', + name, + format + }) { + const pattern = /\[✂(\d+)-(\d+)$/; + + const helpers = new Set(); + + // TODO use same regex for both + result = result.replace(options.generate === 'ssr' ? /(@+|#+|%+)(\w*(?:-\w*)?)/g : /(%+|@+)(\w*(?:-\w*)?)/g, (match: string, sigil: string, name: string) => { + if (sigil === '@') { + if (name in shared) { + if (options.dev && `${name}Dev` in shared) name = `${name}Dev`; + helpers.add(name); + } + + return this.alias(name); + } + + if (sigil === '%') { + return this.templateVars.get(name); + } + + return sigil.slice(1) + name; + }); + + let importedHelpers; + + if (options.shared) { + if (format !== 'es' && format !== 'cjs') { + throw new Error(`Components with shared helpers must be compiled with \`format: 'es'\` or \`format: 'cjs'\``); + } + + importedHelpers = Array.from(helpers).sort().map(name => { + const alias = this.alias(name); + return { name, alias }; + }); + } else { + let inlineHelpers = ''; + + const component = this; + + importedHelpers = []; + + helpers.forEach(name => { + const str = shared[name]; + const code = new MagicString(str); + const expression = parseExpressionAt(str, 0); + + let { scope } = annotateWithScopes(expression); + + walk(expression, { + enter(node: Node, parent: Node) { + if (node._scope) scope = node._scope; + + if ( + node.type === 'Identifier' && + isReference(node, parent) && + !scope.has(node.name) + ) { + if (node.name in shared) { + // this helper function depends on another one + const dependency = node.name; + helpers.add(dependency); + + const alias = component.alias(dependency); + if (alias !== node.name) { + code.overwrite(node.start, node.end, alias); + } + } + } + }, + + leave(node: Node) { + if (node._scope) scope = scope.parent; + }, + }); + + if (name === 'transitionManager' || name === 'outros') { + // special case + const global = name === 'outros' + ? `_svelteOutros` + : `_svelteTransitionManager`; + + inlineHelpers += `\n\nvar ${this.alias(name)} = window.${global} || (window.${global} = ${code});\n\n`; + } else if (name === 'escaped' || name === 'missingComponent' || name === 'invalidAttributeNameCharacter') { + // vars are an awkward special case... would be nice to avoid this + const alias = this.alias(name); + inlineHelpers += `\n\nconst ${alias} = ${code};` + } else { + const alias = this.alias(expression.id.name); + if (alias !== expression.id.name) { + code.overwrite(expression.id.start, expression.id.end, alias); + } + + inlineHelpers += `\n\n${code}`; + } + }); + + result += inlineHelpers; + } + + const sharedPath = options.shared === true + ? 'svelte/shared.js' + : options.shared || ''; + + const module = wrapModule(result, format, name, options, banner, sharedPath, importedHelpers, this.imports, this.shorthandImports, this.source); + + const parts = module.split('✂]'); + const finalChunk = parts.pop(); + + const compiled = new Bundle({ separator: '' }); + + function addString(str: string) { + compiled.addSource({ + content: new MagicString(str), + }); + } + + const { filename } = options; + + // special case — the source file doesn't actually get used anywhere. we need + // to add an empty file to populate map.sources and map.sourcesContent + if (!parts.length) { + compiled.addSource({ + filename, + content: new MagicString(this.source).remove(0, this.source.length), + }); + } + + parts.forEach((str: string) => { + const chunk = str.replace(pattern, ''); + if (chunk) addString(chunk); + + const match = pattern.exec(str); + + const snippet = this.code.snip(+match[1], +match[2]); + + compiled.addSource({ + filename, + content: snippet, + }); + }); + + addString(finalChunk); + + const css = this.customElement ? + { code: null, map: null } : + this.stylesheet.render(options.cssOutputFilename, true); + + const js = { + code: compiled.toString(), + map: compiled.generateMap({ + includeContent: true, + file: options.outputFilename, + }) + }; + + return { + ast: this.ast, + js, + css, + stats: this.stats.render(this) + }; + } + + getUniqueName(name: string) { + if (test) name = `${name}$`; + let alias = name; + for ( + let i = 1; + reservedNames.has(alias) || + this.userVars.has(alias) || + this.usedNames.has(alias); + alias = `${name}_${i++}` + ); + this.usedNames.add(alias); + return alias; + } + + getUniqueNameMaker() { + const localUsedNames = new Set(); + + function add(name: string) { + localUsedNames.add(name); + } + + reservedNames.forEach(add); + this.userVars.forEach(add); + + return (name: string) => { + if (test) name = `${name}$`; + let alias = name; + for ( + let i = 1; + this.usedNames.has(alias) || + localUsedNames.has(alias); + alias = `${name}_${i++}` + ); + localUsedNames.add(alias); + return alias; + }; + } + + error( + pos: { + start: number, + end: number + }, + e : { + code: string, + message: string + } + ) { + error(e.message, { + name: 'ValidationError', + code: e.code, + source: this.source, + start: pos.start, + end: pos.end, + filename: this.options.filename + }); + } + + warn( + pos: { + start: number, + end: number + }, + warning: { + code: string, + message: string + } + ) { + if (!this.locator) { + this.locator = getLocator(this.source, { offsetLine: 1 }); + } + + const start = this.locator(pos.start); + const end = this.locator(pos.end); + + const frame = getCodeFrame(this.source, start.line - 1, start.column); + + this.stats.warn({ + code: warning.code, + message: warning.message, + frame, + start, + end, + pos: pos.start, + filename: this.options.filename, + toString: () => `${warning.message} (${start.line + 1}:${start.column})\n${frame}`, + }); + } + + processDefaultExport(node, indentExclusionRanges) { + const { templateProperties, source, code } = this; + + if (node.declaration.type !== 'ObjectExpression') { + this.error(node.declaration, { + code: `invalid-default-export`, + message: `Default export must be an object literal` + }); + } + + checkForComputedKeys(this, node.declaration.properties); + checkForDupes(this, node.declaration.properties); + + const props = this.properties; + + node.declaration.properties.forEach((prop: Node) => { + props.set(getName(prop.key), prop); + }); + + const validPropList = Object.keys(propValidators); + + // ensure all exported props are valid + node.declaration.properties.forEach((prop: Node) => { + const name = getName(prop.key); + const propValidator = propValidators[name]; + + if (propValidator) { + propValidator(this, prop); + } else { + const match = fuzzymatch(name, validPropList); + if (match) { + this.error(prop, { + code: `unexpected-property`, + message: `Unexpected property '${name}' (did you mean '${match}'?)` + }); + } else if (/FunctionExpression/.test(prop.value.type)) { + this.error(prop, { + code: `unexpected-property`, + message: `Unexpected property '${name}' (did you mean to include it in 'methods'?)` + }); + } else { + this.error(prop, { + code: `unexpected-property`, + message: `Unexpected property '${name}'` + }); + } + } + }); + + if (props.has('namespace')) { + const ns = nodeToString(props.get('namespace').value); + this.namespace = namespaces[ns] || ns; + } + + node.declaration.properties.forEach((prop: Node) => { + templateProperties[getName(prop.key)] = prop; + }); + + ['helpers', 'events', 'components', 'transitions', 'actions', 'animations'].forEach(key => { + if (templateProperties[key]) { + templateProperties[key].value.properties.forEach((prop: Node) => { + this[key].add(getName(prop.key)); + }); + } + }); + + const addArrowFunctionExpression = (type: string, name: string, node: Node) => { + const { body, params, async } = node; + const fnKeyword = async ? 'async function' : 'function'; + + const paramString = params.length ? + `[✂${params[0].start}-${params[params.length - 1].end}✂]` : + ``; + + const block = body.type === 'BlockStatement' + ? deindent` + ${fnKeyword} ${name}(${paramString}) [✂${body.start}-${body.end}✂] + ` + : deindent` + ${fnKeyword} ${name}(${paramString}) { + return [✂${body.start}-${body.end}✂]; + } + `; + + this.declarations.push({ type, name, block, node }); + }; + + const addFunctionExpression = (type: string, name: string, node: Node) => { + const { async } = node; + const fnKeyword = async ? 'async function' : 'function'; + + let c = node.start; + while (this.source[c] !== '(') c += 1; + + const block = deindent` + ${fnKeyword} ${name}[✂${c}-${node.end}✂]; + `; + + this.declarations.push({ type, name, block, node }); + }; + + const addValue = (type: string, name: string, node: Node) => { + const block = deindent` + var ${name} = [✂${node.start}-${node.end}✂]; + `; + + this.declarations.push({ type, name, block, node }); + }; + + const addDeclaration = ( + type: string, + key: string, + node: Node, + allowShorthandImport?: boolean, + disambiguator?: string, + conflicts?: Record + ) => { + const qualified = disambiguator ? `${disambiguator}-${key}` : key; + + if (node.type === 'Identifier' && node.name === key) { + this.templateVars.set(qualified, key); + return; + } + + let deconflicted = key; + if (conflicts) while (deconflicted in conflicts) deconflicted += '_' + + let name = this.getUniqueName(deconflicted); + this.templateVars.set(qualified, name); + + if (allowShorthandImport && node.type === 'Literal' && typeof node.value === 'string') { + this.shorthandImports.push({ name, source: node.value }); + return; + } + + // deindent + const indentationLevel = getIndentationLevel(source, node.start); + if (indentationLevel) { + removeIndentation(code, node.start, node.end, indentationLevel, indentExclusionRanges); + } + + if (node.type === 'ArrowFunctionExpression') { + addArrowFunctionExpression(type, name, node); + } else if (node.type === 'FunctionExpression') { + addFunctionExpression(type, name, node); + } else { + addValue(type, name, node); + } + }; + + if (templateProperties.components) { + templateProperties.components.value.properties.forEach((property: Node) => { + addDeclaration('components', getName(property.key), property.value, true, 'components'); + }); + } + + if (templateProperties.computed) { + const dependencies = new Map(); + + const fullStateComputations = []; + + templateProperties.computed.value.properties.forEach((prop: Node) => { + const key = getName(prop.key); + const value = prop.value; + + addDeclaration('computed', key, value, false, 'computed', { + state: true, + changed: true + }); + + const param = value.params[0]; + + const hasRestParam = ( + param.properties && + param.properties.some(prop => prop.type === 'RestElement') + ); + + if (param.type !== 'ObjectPattern' || hasRestParam) { + fullStateComputations.push({ key, deps: null, hasRestParam }); + } else { + const deps = param.properties.map(prop => prop.key.name); + + deps.forEach(dep => { + this.expectedProperties.add(dep); + }); + dependencies.set(key, deps); + } + }); + + const visited = new Set(); + + const visit = (key: string) => { + if (!dependencies.has(key)) return; // not a computation + + if (visited.has(key)) return; + visited.add(key); + + const deps = dependencies.get(key); + deps.forEach(visit); + + this.computations.push({ key, deps, hasRestParam: false }); + + const prop = templateProperties.computed.value.properties.find((prop: Node) => getName(prop.key) === key); + }; + + templateProperties.computed.value.properties.forEach((prop: Node) => + visit(getName(prop.key)) + ); + + if (fullStateComputations.length > 0) { + this.computations.push(...fullStateComputations); + } + } + + if (templateProperties.data) { + addDeclaration('data', 'data', templateProperties.data.value); + } + + if (templateProperties.events) { + templateProperties.events.value.properties.forEach((property: Node) => { + addDeclaration('events', getName(property.key), property.value, false, 'events'); + }); + } + + if (templateProperties.helpers) { + templateProperties.helpers.value.properties.forEach((property: Node) => { + addDeclaration('helpers', getName(property.key), property.value, false, 'helpers'); + }); + } + + if (templateProperties.methods) { + addDeclaration('methods', 'methods', templateProperties.methods.value); + + templateProperties.methods.value.properties.forEach(property => { + this.methods.add(getName(property.key)); + }); + } + + if (templateProperties.namespace) { + const ns = nodeToString(templateProperties.namespace.value); + this.namespace = namespaces[ns] || ns; + } + + if (templateProperties.oncreate) { + addDeclaration('oncreate', 'oncreate', templateProperties.oncreate.value); + } + + if (templateProperties.ondestroy) { + addDeclaration('ondestroy', 'ondestroy', templateProperties.ondestroy.value); + } + + if (templateProperties.onstate) { + addDeclaration('onstate', 'onstate', templateProperties.onstate.value); + } + + if (templateProperties.onupdate) { + addDeclaration('onupdate', 'onupdate', templateProperties.onupdate.value); + } + + if (templateProperties.preload) { + addDeclaration('preload', 'preload', templateProperties.preload.value); + } + + if (templateProperties.props) { + this.props = templateProperties.props.value.elements.map((element: Node) => nodeToString(element)); + } + + if (templateProperties.setup) { + addDeclaration('setup', 'setup', templateProperties.setup.value); + } + + if (templateProperties.store) { + addDeclaration('store', 'store', templateProperties.store.value); + } + + if (templateProperties.tag) { + this.tag = nodeToString(templateProperties.tag.value); + } + + if (templateProperties.transitions) { + templateProperties.transitions.value.properties.forEach((property: Node) => { + addDeclaration('transitions', getName(property.key), property.value, false, 'transitions'); + }); + } + + if (templateProperties.animations) { + templateProperties.animations.value.properties.forEach((property: Node) => { + addDeclaration('animations', getName(property.key), property.value, false, 'animations'); + }); + } + + if (templateProperties.actions) { + templateProperties.actions.value.properties.forEach((property: Node) => { + addDeclaration('actions', getName(property.key), property.value, false, 'actions'); + }); + } + + this.defaultExport = node; + } + + walkJs() { + const { js } = this.ast; + if (!js) return; + + this.addSourcemapLocations(js.content); + + const { code, source, imports } = this; + + const indentationLevel = getIndentationLevel(source, js.content.body[0].start); + const indentExclusionRanges = getIndentExclusionRanges(js.content); + + const { scope, globals } = annotateWithScopes(js.content); + + scope.declarations.forEach(name => { + this.userVars.add(name); + }); + + globals.forEach(name => { + this.userVars.add(name); + }); + + const body = js.content.body.slice(); // slice, because we're going to be mutating the original + + body.forEach(node => { + // check there are no named exports + if (node.type === 'ExportNamedDeclaration') { + this.error(node, { + code: `named-export`, + message: `A component can only have a default export` + }); + } + + if (node.type === 'ExportDefaultDeclaration') { + this.processDefaultExport(node, indentExclusionRanges); + } + + // imports need to be hoisted out of the IIFE + else if (node.type === 'ImportDeclaration') { + removeNode(code, js.content, node); + imports.push(node); + + node.specifiers.forEach((specifier: Node) => { + this.userVars.add(specifier.local.name); + }); + } + }); + + if (indentationLevel) { + if (this.defaultExport) { + removeIndentation(code, js.content.start, this.defaultExport.start, indentationLevel, indentExclusionRanges); + removeIndentation(code, this.defaultExport.end, js.content.end, indentationLevel, indentExclusionRanges); + } else { + removeIndentation(code, js.content.start, js.content.end, indentationLevel, indentExclusionRanges); + } + } + + let a = js.content.start; + while (/\s/.test(source[a])) a += 1; + + let b = js.content.end; + while (/\s/.test(source[b - 1])) b -= 1; + + this.javascript = this.defaultExport + ? [ + a !== this.defaultExport.start ? `[✂${a}-${this.defaultExport.start}✂]` : '', + b !== this.defaultExport.end ?`[✂${this.defaultExport.end}-${b}✂]` : '' + ] + : [ + a !== b ? `[✂${a}-${b}✂]` : '', + '' + ]; + } +} diff --git a/src/css/Selector.ts b/src/compile/css/Selector.ts similarity index 88% rename from src/css/Selector.ts rename to src/compile/css/Selector.ts index 71e127edb3..d6323c6efe 100644 --- a/src/css/Selector.ts +++ b/src/compile/css/Selector.ts @@ -1,8 +1,8 @@ import MagicString from 'magic-string'; import Stylesheet from './Stylesheet'; import { gatherPossibleValues, UNKNOWN } from './gatherPossibleValues'; -import { Validator } from '../validate/index'; import { Node } from '../interfaces'; +import Component from '../compile/Component'; export default class Selector { node: Node; @@ -30,7 +30,8 @@ export default class Selector { apply(node: Node, stack: Node[]) { const toEncapsulate: Node[] = []; - applySelector(this.localBlocks.slice(), node, stack.slice(), toEncapsulate); + + applySelector(this.stylesheet, this.localBlocks.slice(), node, stack.slice(), toEncapsulate); if (toEncapsulate.length > 0) { toEncapsulate.filter((_, i) => i === 0 || i === toEncapsulate.length - 1).forEach(({ node, block }) => { @@ -76,7 +77,7 @@ export default class Selector { const selector = block.selectors[i]; if (selector.type === 'RefSelector') { - code.overwrite(selector.start, selector.end, `[svelte-ref-${selector.name}]`, { + code.overwrite(selector.start, selector.end, `.svelte-ref-${selector.name}`, { contentOnly: true, storeName: false }); @@ -96,13 +97,13 @@ export default class Selector { }); } - validate(validator: Validator) { + validate(component: Component) { this.blocks.forEach((block) => { let i = block.selectors.length; while (i-- > 1) { const selector = block.selectors[i]; if (selector.type === 'PseudoClassSelector' && selector.name === 'global') { - validator.error(selector, { + component.error(selector, { code: `css-invalid-global`, message: `:global(...) must be the first element in a compound selector` }); @@ -123,7 +124,7 @@ export default class Selector { for (let i = start; i < end; i += 1) { if (this.blocks[i].global) { - validator.error(this.blocks[i].selectors[0], { + component.error(this.blocks[i].selectors[0], { code: `css-invalid-global`, message: `:global(...) can be at the start or end of a selector sequence, but not in the middle` }); @@ -132,11 +133,7 @@ export default class Selector { } } -function isDescendantSelector(selector: Node) { - return selector.type === 'WhiteSpace' || selector.type === 'Combinator'; -} - -function applySelector(blocks: Block[], node: Node, stack: Node[], toEncapsulate: any[]): boolean { +function applySelector(stylesheet: Stylesheet, blocks: Block[], node: Node, stack: Node[], toEncapsulate: any[]): boolean { const block = blocks.pop(); if (!block) return false; @@ -145,7 +142,6 @@ function applySelector(blocks: Block[], node: Node, stack: Node[], toEncapsulate } let i = block.selectors.length; - let j = stack.length; while (i--) { const selector = block.selectors[i]; @@ -161,7 +157,7 @@ function applySelector(blocks: Block[], node: Node, stack: Node[], toEncapsulate } if (selector.type === 'ClassSelector') { - if (!attributeMatches(node, 'class', selector.name, '~=', false)) return false; + if (!attributeMatches(node, 'class', selector.name, '~=', false) && !classMatches(node, selector.name)) return false; } else if (selector.type === 'IdSelector') { @@ -178,8 +174,8 @@ function applySelector(blocks: Block[], node: Node, stack: Node[], toEncapsulate } else if (selector.type === 'RefSelector') { - if (node.ref === selector.name) { - node._cssRefAttribute = selector.name; + if (node.ref && node.ref.name === selector.name) { + stylesheet.nodesWithRefCssClass.set(selector.name, node); toEncapsulate.push({ node, block }); return true; } @@ -196,18 +192,24 @@ function applySelector(blocks: Block[], node: Node, stack: Node[], toEncapsulate if (block.combinator) { if (block.combinator.type === 'WhiteSpace') { while (stack.length) { - if (applySelector(blocks.slice(), stack.pop(), stack, toEncapsulate)) { + if (applySelector(stylesheet, blocks.slice(), stack.pop(), stack, toEncapsulate)) { toEncapsulate.push({ node, block }); return true; } } + if (blocks.every(block => block.global)) { + toEncapsulate.push({ node, block }); + return true; + } + return false; } else if (block.combinator.name === '>') { - if (applySelector(blocks, stack.pop(), stack, toEncapsulate)) { + if (applySelector(stylesheet, blocks, stack.pop(), stack, toEncapsulate)) { toEncapsulate.push({ node, block }); return true; } + return false; } @@ -256,6 +258,12 @@ function attributeMatches(node: Node, name: string, expectedValue: string, opera return false; } +function classMatches(node, name: string) { + return node.classes.some(function(classDir) { + return classDir.name === name; + }); +} + function isDynamic(value: Node) { return value.length > 1 || value[0].type !== 'Text'; } diff --git a/src/css/Stylesheet.ts b/src/compile/css/Stylesheet.ts similarity index 88% rename from src/css/Stylesheet.ts rename to src/compile/css/Stylesheet.ts index 586599021b..cf7fcf061e 100644 --- a/src/css/Stylesheet.ts +++ b/src/compile/css/Stylesheet.ts @@ -2,11 +2,14 @@ import MagicString from 'magic-string'; import { walk } from 'estree-walker'; import { getLocator } from 'locate-character'; import Selector from './Selector'; -import getCodeFrame from '../utils/getCodeFrame'; -import hash from '../utils/hash'; -import Element from '../compile/nodes/Element'; -import { Validator } from '../validate/index'; -import { Node, Ast, Warning } from '../interfaces'; +import getCodeFrame from '../../utils/getCodeFrame'; +import hash from '../../utils/hash'; +import removeCSSPrefix from '../../utils/removeCSSPrefix'; +import Element from '../nodes/Element'; +import { Node, Ast, Warning } from '../../interfaces'; +import Component from '../Component'; + +const isKeyframesNode = (node: Node) => removeCSSPrefix(node.name) === 'keyframes' class Rule { selectors: Selector[]; @@ -26,7 +29,7 @@ class Rule { } isUsed(dev: boolean) { - if (this.parent && this.parent.node.type === 'Atrule' && this.parent.node.name === 'keyframes') return true; + if (this.parent && this.parent.node.type === 'Atrule' && isKeyframesNode(this.parent.node)) return true; if (this.declarations.length === 0) return dev; return this.selectors.some(s => s.used); } @@ -67,7 +70,7 @@ class Rule { } transform(code: MagicString, id: string, keyframes: Map) { - if (this.parent && this.parent.node.type === 'Atrule' && this.parent.node.name === 'keyframes') return true; + if (this.parent && this.parent.node.type === 'Atrule' && isKeyframesNode(this.parent.node)) return true; const attr = `.${id}`; @@ -75,9 +78,9 @@ class Rule { this.declarations.forEach(declaration => declaration.transform(code, keyframes)); } - validate(validator: Validator) { + validate(component: Component) { this.selectors.forEach(selector => { - selector.validate(validator); + selector.validate(component); }); } @@ -96,7 +99,7 @@ class Declaration { } transform(code: MagicString, keyframes: Map) { - const property = this.node.property && this.node.property.toLowerCase(); + const property = this.node.property && removeCSSPrefix(this.node.property.toLowerCase()); if (property === 'animation' || property === 'animation-name') { this.node.value.children.forEach((block: Node) => { if (block.type === 'Identifier') { @@ -142,7 +145,7 @@ class Atrule { }); } - else if (this.node.name === 'keyframes') { + else if (isKeyframesNode(this.node)) { this.children.forEach((rule: Rule) => { rule.selectors.forEach(selector => { selector.used = true; @@ -167,8 +170,8 @@ class Atrule { }); code.remove(c, this.node.block.start); - } else if (this.node.name === 'keyframes') { - let c = this.node.start + 10; + } else if (isKeyframesNode(this.node)) { + let c = this.node.start + this.node.name.length + 1; if (this.node.expression.start - c > 1) code.overwrite(c, this.node.expression.start, ' '); c = this.node.expression.end; if (this.node.block.start - c > 0) code.remove(c, this.node.block.start); @@ -200,7 +203,7 @@ class Atrule { } transform(code: MagicString, id: string, keyframes: Map) { - if (this.node.name === 'keyframes') { + if (isKeyframesNode(this.node)) { this.node.expression.children.forEach(({ type, name, start, end }: Node) => { if (type === 'Identifier') { if (name.startsWith('-global-')) { @@ -217,9 +220,9 @@ class Atrule { }) } - validate(validator: Validator) { + validate(component: Component) { this.children.forEach(child => { - child.validate(validator); + child.validate(component); }); } @@ -247,6 +250,7 @@ export default class Stylesheet { keyframes: Map; nodesWithCssClass: Set; + nodesWithRefCssClass: Map; constructor(source: string, ast: Ast, filename: string, dev: boolean) { this.source = source; @@ -258,6 +262,7 @@ export default class Stylesheet { this.keyframes = new Map(); this.nodesWithCssClass = new Set(); + this.nodesWithRefCssClass = new Map(); if (ast.css && ast.css.children.length) { this.id = `svelte-${hash(ast.css.content.styles)}`; @@ -285,7 +290,7 @@ export default class Stylesheet { this.children.push(atrule); } - if (node.name === 'keyframes') { + if (isKeyframesNode(node)) { node.expression.children.forEach((expression: Node) => { if (expression.type === 'Identifier' && !expression.name.startsWith('-global-')) { this.keyframes.set(expression.name, `${this.id}-${expression.name}`); @@ -337,6 +342,9 @@ export default class Stylesheet { this.nodesWithCssClass.forEach((node: Node) => { node.addCssClass(); }); + this.nodesWithRefCssClass.forEach((node: Node, name: String) => { + node.addCssClass(`svelte-ref-${name}`); + }) } render(cssOutputFilename: string, shouldTransformSelectors: boolean) { @@ -380,9 +388,9 @@ export default class Stylesheet { }; } - validate(validator: Validator) { + validate(component: Component) { this.children.forEach(child => { - child.validate(validator); + child.validate(component); }); } diff --git a/src/css/gatherPossibleValues.ts b/src/compile/css/gatherPossibleValues.ts similarity index 100% rename from src/css/gatherPossibleValues.ts rename to src/compile/css/gatherPossibleValues.ts diff --git a/src/compile/dom/index.ts b/src/compile/dom/index.ts deleted file mode 100644 index 3db1158449..0000000000 --- a/src/compile/dom/index.ts +++ /dev/null @@ -1,356 +0,0 @@ -import MagicString from 'magic-string'; -import isReference from 'is-reference'; -import { parseExpressionAt } from 'acorn'; -import annotateWithScopes from '../../utils/annotateWithScopes'; -import { walk } from 'estree-walker'; -import deindent from '../../utils/deindent'; -import { stringify, escape } from '../../utils/stringify'; -import CodeBuilder from '../../utils/CodeBuilder'; -import globalWhitelist from '../../utils/globalWhitelist'; -import reservedNames from '../../utils/reservedNames'; -import Compiler from '../Compiler'; -import Stylesheet from '../../css/Stylesheet'; -import Stats from '../../Stats'; -import Block from './Block'; -import { test } from '../../config'; -import { Ast, CompileOptions, Node } from '../../interfaces'; - -export class DomTarget { - blocks: (Block|string)[]; - readonly: Set; - metaBindings: string[]; - - hasIntroTransitions: boolean; - hasOutroTransitions: boolean; - hasComplexBindings: boolean; - - constructor() { - this.blocks = []; - this.readonly = new Set(); - - // initial values for e.g. window.innerWidth, if there's a meta tag - this.metaBindings = []; - } -} - -export default function dom( - ast: Ast, - source: string, - stylesheet: Stylesheet, - options: CompileOptions, - stats: Stats -) { - const format = options.format || 'es'; - - const target = new DomTarget(); - const compiler = new Compiler(ast, source, options.name || 'SvelteComponent', stylesheet, options, stats, true, target); - - const { - computations, - name, - templateProperties, - namespace, - } = compiler; - - compiler.fragment.build(); - const { block } = compiler.fragment; - - // prevent fragment being created twice (#1063) - if (options.customElement) block.builders.create.addLine(`this.c = @noop;`); - - const builder = new CodeBuilder(); - const computationBuilder = new CodeBuilder(); - const computationDeps = new Set(); - - if (computations.length) { - computations.forEach(({ key, deps }) => { - deps.forEach(dep => { - computationDeps.add(dep); - }); - - if (target.readonly.has(key)) { - // bindings - throw new Error( - `Cannot have a computed value '${key}' that clashes with a read-only property` - ); - } - - target.readonly.add(key); - - const condition = `${deps.map(dep => `changed.${dep}`).join(' || ')}`; - - const statement = `if (this._differs(state.${key}, (state.${key} = %computed-${key}(state)))) changed.${key} = true;`; - - computationBuilder.addConditional(condition, statement); - }); - } - - if (compiler.javascript) { - builder.addBlock(compiler.javascript); - } - - const css = compiler.stylesheet.render(options.filename, !compiler.customElement); - const styles = compiler.stylesheet.hasStyles && stringify(options.dev ? - `${css.code}\n/*# sourceMappingURL=${css.map.toUrl()} */` : - css.code, { onlyEscapeAtSymbol: true }); - - if (styles && compiler.options.css !== false && !compiler.customElement) { - builder.addBlock(deindent` - function @add_css() { - var style = @createElement("style"); - style.id = '${compiler.stylesheet.id}-style'; - style.textContent = ${styles}; - @appendNode(style, document.head); - } - `); - } - - target.blocks.forEach(block => { - builder.addBlock(block.toString()); - }); - - const sharedPath: string = options.shared === true - ? 'svelte/shared.js' - : options.shared || ''; - - let prototypeBase = `${name}.prototype`; - - const proto = sharedPath - ? `@proto` - : deindent` - { - ${['destroy', 'get', 'fire', 'on', 'set', '_set', '_mount', '_unmount', '_differs'] - .map(n => `${n}: @${n}`) - .join(',\n')} - }`; - - const debugName = `<${compiler.customElement ? compiler.tag : name}>`; - - // generate initial state object - const expectedProperties = Array.from(compiler.expectedProperties); - const globals = expectedProperties.filter(prop => globalWhitelist.has(prop)); - const storeProps = expectedProperties.filter(prop => prop[0] === '$'); - const initialState = []; - - if (globals.length > 0) { - initialState.push(`{ ${globals.map(prop => `${prop} : ${prop}`).join(', ')} }`); - } - - if (storeProps.length > 0) { - initialState.push(`this.store._init([${storeProps.map(prop => `"${prop.slice(1)}"`)}])`); - } - - if (templateProperties.data) { - initialState.push(`%data()`); - } else if (globals.length === 0 && storeProps.length === 0) { - initialState.push('{}'); - } - - initialState.push(`options.data`); - - const hasInitHooks = !!(templateProperties.oncreate || templateProperties.onstate || templateProperties.onupdate); - - const constructorBody = deindent` - ${options.dev && `this._debugName = '${debugName}';`} - ${options.dev && !compiler.customElement && - `if (!options || (!options.target && !options.root)) throw new Error("'target' is a required option");`} - @init(this, options); - ${templateProperties.store && `this.store = %store();`} - ${compiler.usesRefs && `this.refs = {};`} - this._state = ${initialState.reduce((state, piece) => `@assign(${state}, ${piece})`)}; - ${storeProps.length > 0 && `this.store._add(this, [${storeProps.map(prop => `"${prop.slice(1)}"`)}]);`} - ${target.metaBindings} - ${computations.length && `this._recompute({ ${Array.from(computationDeps).map(dep => `${dep}: 1`).join(', ')} }, this._state);`} - ${options.dev && - Array.from(compiler.expectedProperties).map(prop => { - if (globalWhitelist.has(prop)) return; - if (computations.find(c => c.key === prop)) return; - - const message = compiler.components.has(prop) ? - `${debugName} expected to find '${prop}' in \`data\`, but found it in \`components\` instead` : - `${debugName} was created without expected data property '${prop}'`; - - const conditions = [`!('${prop}' in this._state)`]; - if (compiler.customElement) conditions.push(`!('${prop}' in this.attributes)`); - - return `if (${conditions.join(' && ')}) console.warn("${message}");` - })} - ${compiler.bindingGroups.length && - `this._bindingGroups = [${Array(compiler.bindingGroups.length).fill('[]').join(', ')}];`} - - ${templateProperties.onstate && `this._handlers.state = [%onstate];`} - ${templateProperties.onupdate && `this._handlers.update = [%onupdate];`} - - ${(templateProperties.ondestroy || storeProps.length) && ( - `this._handlers.destroy = [${ - [templateProperties.ondestroy && `%ondestroy`, storeProps.length && `@removeFromStore`].filter(Boolean).join(', ') - }];` - )} - - ${compiler.slots.size && `this._slotted = options.slots || {};`} - - ${compiler.customElement ? - deindent` - this.attachShadow({ mode: 'open' }); - ${css.code && `this.shadowRoot.innerHTML = \`\`;`} - ` : - (compiler.stylesheet.hasStyles && options.css !== false && - `if (!document.getElementById("${compiler.stylesheet.id}-style")) @add_css();`) - } - - ${(hasInitHooks || compiler.hasComponents || target.hasComplexBindings || target.hasIntroTransitions) && deindent` - if (!options.root) { - this._oncreate = []; - ${(compiler.hasComponents || target.hasComplexBindings) && `this._beforecreate = [];`} - ${(compiler.hasComponents || target.hasIntroTransitions) && `this._aftercreate = [];`} - } - `} - - ${compiler.slots.size && `this.slots = {};`} - - this._fragment = @create_main_fragment(this, this._state); - - ${hasInitHooks && deindent` - this.root._oncreate.push(() => { - ${templateProperties.onstate && `%onstate.call(this, { changed: @assignTrue({}, this._state), current: this._state });`} - ${templateProperties.oncreate && `%oncreate.call(this);`} - this.fire("update", { changed: @assignTrue({}, this._state), current: this._state }); - }); - `} - - ${compiler.customElement ? deindent` - this._fragment.c(); - this._fragment.${block.hasIntroMethod ? 'i' : 'm'}(this.shadowRoot, null); - - if (options.target) this._mount(options.target, options.anchor); - ` : deindent` - if (options.target) { - ${compiler.options.hydratable - ? deindent` - var nodes = @children(options.target); - options.hydrate ? this._fragment.l(nodes) : this._fragment.c(); - nodes.forEach(@detachNode); - ` : - deindent` - ${options.dev && `if (options.hydrate) throw new Error("options.hydrate only works if the component was compiled with the \`hydratable: true\` option");`} - this._fragment.c(); - `} - this._mount(options.target, options.anchor); - - ${(compiler.hasComponents || target.hasComplexBindings || hasInitHooks || target.hasIntroTransitions) && deindent` - ${compiler.hasComponents && `this._lock = true;`} - ${(compiler.hasComponents || target.hasComplexBindings) && `@callAll(this._beforecreate);`} - ${(compiler.hasComponents || hasInitHooks) && `@callAll(this._oncreate);`} - ${(compiler.hasComponents || target.hasIntroTransitions) && `@callAll(this._aftercreate);`} - ${compiler.hasComponents && `this._lock = false;`} - `} - } - `} - `; - - if (compiler.customElement) { - const props = compiler.props || Array.from(compiler.expectedProperties); - - builder.addBlock(deindent` - class ${name} extends HTMLElement { - constructor(options = {}) { - super(); - ${constructorBody} - } - - static get observedAttributes() { - return ${JSON.stringify(props)}; - } - - ${props.map(prop => deindent` - get ${prop}() { - return this.get().${prop}; - } - - set ${prop}(value) { - this.set({ ${prop}: value }); - } - `).join('\n\n')} - - ${compiler.slots.size && deindent` - connectedCallback() { - Object.keys(this._slotted).forEach(key => { - this.appendChild(this._slotted[key]); - }); - }`} - - attributeChangedCallback(attr, oldValue, newValue) { - this.set({ [attr]: newValue }); - } - - ${(compiler.hasComponents || target.hasComplexBindings || templateProperties.oncreate || target.hasIntroTransitions) && deindent` - connectedCallback() { - ${compiler.hasComponents && `this._lock = true;`} - ${(compiler.hasComponents || target.hasComplexBindings) && `@callAll(this._beforecreate);`} - ${(compiler.hasComponents || templateProperties.oncreate) && `@callAll(this._oncreate);`} - ${(compiler.hasComponents || target.hasIntroTransitions) && `@callAll(this._aftercreate);`} - ${compiler.hasComponents && `this._lock = false;`} - } - `} - } - - customElements.define("${compiler.tag}", ${name}); - @assign(@assign(${prototypeBase}, ${proto}), { - _mount(target, anchor) { - target.insertBefore(this, anchor); - }, - - _unmount() { - this.parentNode.removeChild(this); - } - }); - `); - } else { - builder.addBlock(deindent` - function ${name}(options) { - ${constructorBody} - } - - @assign(${prototypeBase}, ${proto}); - ${templateProperties.methods && `@assign(${prototypeBase}, %methods);`} - `); - } - - const immutable = templateProperties.immutable ? templateProperties.immutable.value.value : options.immutable; - - builder.addBlock(deindent` - ${options.dev && deindent` - ${name}.prototype._checkReadOnly = function _checkReadOnly(newState) { - ${Array.from(target.readonly).map( - prop => - `if ('${prop}' in newState && !this._updatingReadonlyProperty) throw new Error("${debugName}: Cannot set read-only property '${prop}'");` - )} - }; - `} - - ${computations.length ? deindent` - ${name}.prototype._recompute = function _recompute(changed, state) { - ${computationBuilder} - } - ` : (!sharedPath && `${name}.prototype._recompute = @noop;`)} - - ${templateProperties.setup && `%setup(${name});`} - - ${templateProperties.preload && `${name}.preload = %preload;`} - - ${immutable && `${name}.prototype._differs = @_differsImmutable;`} - `); - - let result = builder.toString(); - - const filename = options.filename && ( - typeof process !== 'undefined' ? options.filename.replace(process.cwd(), '').replace(/^[\/\\]/, '') : options.filename - ); - - return compiler.generate(result, options, { - banner: `/* ${filename ? `${filename} ` : ``}generated by Svelte v${"__VERSION__"} */`, - sharedPath, - name, - format, - }); -} diff --git a/src/compile/index.ts b/src/compile/index.ts new file mode 100644 index 0000000000..e5a78379ea --- /dev/null +++ b/src/compile/index.ts @@ -0,0 +1,96 @@ +import { assign } from '../shared'; +import Stats from '../Stats'; +import parse from '../parse/index'; +import renderDOM from './render-dom/index'; +import renderSSR from './render-ssr/index'; +import { CompileOptions, Warning, Ast } from '../interfaces'; +import Component from './Component'; +import deprecate from '../utils/deprecate'; + +function normalize_options(options: CompileOptions): CompileOptions { + let normalized = assign({ generate: 'dom', dev: false }, options); + const { onwarn } = normalized; + + normalized.onwarn = onwarn + ? (warning: Warning) => onwarn(warning, default_onwarn) + : default_onwarn; + + return normalized; +} + +function default_onwarn({ start, message }: Warning) { + if (start) { + console.warn(`(${start.line}:${start.column}) – ${message}`); + } else { + console.warn(message); + } +} + +function validate_options(options: CompileOptions, stats: Stats) { + const { name, filename } = options; + + if (name && !/^[a-zA-Z_$][a-zA-Z_$0-9]*$/.test(name)) { + const error = new Error(`options.name must be a valid identifier (got '${name}')`); + throw error; + } + + if (name && /^[a-z]/.test(name)) { + const message = `options.name should be capitalised`; + stats.warn({ + code: `options-lowercase-name`, + message, + filename, + toString: () => message, + }); + } +} + +export default function compile(source: string, options: CompileOptions = {}) { + const onerror = options.onerror || (err => { + throw err; + }); + + if (options.onerror) { + // TODO remove in v3 + deprecate(`Instead of using options.onerror, wrap svelte.compile in a try-catch block`); + delete options.onerror; + } + + options = normalize_options(options); + + const stats = new Stats({ + onwarn: options.onwarn + }); + + let ast: Ast; + + try { + validate_options(options, stats); + + stats.start('parse'); + ast = parse(source, options); + stats.stop('parse'); + + stats.start('create component'); + const component = new Component( + ast, + source, + options.name || 'SvelteComponent', + options, + stats + ); + stats.stop('create component'); + + if (options.generate === false) { + return { ast, stats: stats.render(null), js: null, css: null }; + } + + if (options.generate === 'ssr') { + return renderSSR(component, options); + } + + return renderDOM(component, options); + } catch (err) { + onerror(err); + } +} \ No newline at end of file diff --git a/src/compile/nodes/Action.ts b/src/compile/nodes/Action.ts index 1e8f4311e7..f9460d6c8b 100644 --- a/src/compile/nodes/Action.ts +++ b/src/compile/nodes/Action.ts @@ -6,13 +6,22 @@ export default class Action extends Node { name: string; expression: Expression; - constructor(compiler, parent, scope, info) { - super(compiler, parent, scope, info); + constructor(component, parent, scope, info) { + super(component, parent, scope, info); this.name = info.name; + component.used.actions.add(this.name); + + if (!component.actions.has(this.name)) { + component.error(this, { + code: `missing-action`, + message: `Missing action '${this.name}'` + }); + } + this.expression = info.expression - ? new Expression(compiler, this, scope, info.expression) + ? new Expression(component, this, scope, info.expression) : null; } } \ No newline at end of file diff --git a/src/compile/nodes/Animation.ts b/src/compile/nodes/Animation.ts new file mode 100644 index 0000000000..4df3fec66f --- /dev/null +++ b/src/compile/nodes/Animation.ts @@ -0,0 +1,45 @@ +import Node from './shared/Node'; +import Expression from './shared/Expression'; + +export default class Animation extends Node { + type: 'Animation'; + name: string; + expression: Expression; + + constructor(component, parent, scope, info) { + super(component, parent, scope, info); + + this.name = info.name; + + component.used.animations.add(this.name); + + if (parent.animation) { + component.error(this, { + code: `duplicate-animation`, + message: `An element can only have one 'animate' directive` + }); + } + + if (!component.animations.has(this.name)) { + component.error(this, { + code: `missing-animation`, + message: `Missing animation '${this.name}'` + }); + } + + const block = parent.parent; + if (!block || block.type !== 'EachBlock' || !block.key) { + // TODO can we relax the 'immediate child' rule? + component.error(this, { + code: `invalid-animation`, + message: `An element that use the animate directive must be the immediate child of a keyed each block` + }); + } + + block.hasAnimation = true; + + this.expression = info.expression + ? new Expression(component, this, scope, info.expression) + : null; + } +} \ No newline at end of file diff --git a/src/compile/nodes/Attribute.ts b/src/compile/nodes/Attribute.ts index 37de5068a9..83c845176d 100644 --- a/src/compile/nodes/Attribute.ts +++ b/src/compile/nodes/Attribute.ts @@ -1,25 +1,17 @@ -import deindent from '../../utils/deindent'; import { escape, escapeTemplate, stringify } from '../../utils/stringify'; -import fixAttributeCasing from '../../utils/fixAttributeCasing'; import addToSet from '../../utils/addToSet'; -import Compiler from '../Compiler'; +import Component from '../Component'; import Node from './shared/Node'; import Element from './Element'; import Text from './Text'; -import Block from '../dom/Block'; import Expression from './shared/Expression'; -export interface StyleProp { - key: string; - value: Node[]; -} - export default class Attribute extends Node { type: 'Attribute'; start: number; end: number; - compiler: Compiler; + component: Component; parent: Element; name: string; isSpread: boolean; @@ -31,8 +23,8 @@ export default class Attribute extends Node { chunks: (Text | Expression)[]; dependencies: Set; - constructor(compiler, parent, scope, info) { - super(compiler, parent, scope, info); + constructor(component, parent, scope, info) { + super(component, parent, scope, info); if (info.type === 'Spread') { this.name = null; @@ -40,7 +32,7 @@ export default class Attribute extends Node { this.isTrue = false; this.isSynthetic = false; - this.expression = new Expression(compiler, this, scope, info.expression); + this.expression = new Expression(component, this, scope, info.expression); this.dependencies = this.expression.dependencies; this.chunks = null; @@ -60,17 +52,13 @@ export default class Attribute extends Node { : info.value.map(node => { if (node.type === 'Text') return node; - const expression = new Expression(compiler, this, scope, node.expression); + const expression = new Expression(component, this, scope, node.expression); addToSet(this.dependencies, expression.dependencies); return expression; }); - // TODO this would be better, but it breaks some stuff - // this.isDynamic = this.dependencies.size > 0; - this.isDynamic = this.chunks.length === 1 - ? this.chunks[0].type !== 'Text' - : this.chunks.length > 1; + this.isDynamic = this.dependencies.size > 0; this.shouldCache = this.isDynamic ? this.chunks.length === 1 @@ -82,7 +70,7 @@ export default class Attribute extends Node { getValue() { if (this.isTrue) return true; - if (this.chunks.length === 0) return `''`; + if (this.chunks.length === 0) return `""`; if (this.chunks.length === 1) { return this.chunks[0].type === 'Text' @@ -102,235 +90,14 @@ export default class Attribute extends Node { .join(' + '); } - render(block: Block) { - const node = this.parent; - const name = fixAttributeCasing(this.name); - - if (name === 'style') { - const styleProps = optimizeStyle(this.chunks); - if (styleProps) { - this.renderStyle(block, styleProps); - return; - } - } - - let metadata = node.namespace ? null : attributeLookup[name]; - if (metadata && metadata.appliesTo && !~metadata.appliesTo.indexOf(node.name)) - metadata = null; - - const isIndirectlyBoundValue = - name === 'value' && - (node.name === 'option' || // TODO check it's actually bound - (node.name === 'input' && - node.bindings.find( - (binding: Binding) => - /checked|group/.test(binding.name) - ))); - - const propertyName = isIndirectlyBoundValue - ? '__value' - : metadata && metadata.propertyName; - - // xlink is a special case... we could maybe extend this to generic - // namespaced attributes but I'm not sure that's applicable in - // HTML5? - const method = name.slice(0, 6) === 'xlink:' - ? '@setXlinkAttribute' - : '@setAttribute'; - - const isLegacyInputType = this.compiler.options.legacy && name === 'type' && this.parent.name === 'input'; - - const isDataSet = /^data-/.test(name) && !this.compiler.options.legacy && !node.namespace; - const camelCaseName = isDataSet ? name.replace('data-', '').replace(/(-\w)/g, function (m) { - return m[1].toUpperCase(); - }) : name; - - if (this.isDynamic) { - let value; + getStaticValue() { + if (this.isSpread || this.isDynamic) return null; - // TODO some of this code is repeated in Tag.ts — would be good to - // DRY it out if that's possible without introducing crazy indirection - if (this.chunks.length === 1) { - // single {tag} — may be a non-string - value = this.chunks[0].snippet; - } else { - // '{foo} {bar}' — treat as string concatenation - value = - (this.chunks[0].type === 'Text' ? '' : `"" + `) + - this.chunks - .map((chunk: Node) => { - if (chunk.type === 'Text') { - return stringify(chunk.data); - } else { - return chunk.getPrecedence() <= 13 - ? `(${chunk.snippet})` - : chunk.snippet; - } - }) - .join(' + '); - } - - const isSelectValueAttribute = - name === 'value' && node.name === 'select'; - - const shouldCache = this.shouldCache || isSelectValueAttribute; - - const last = shouldCache && block.getUniqueName( - `${node.var}_${name.replace(/[^a-zA-Z_$]/g, '_')}_value` - ); - - if (shouldCache) block.addVariable(last); - - let updater; - const init = shouldCache ? `${last} = ${value}` : value; - - if (isLegacyInputType) { - block.builders.hydrate.addLine( - `@setInputType(${node.var}, ${init});` - ); - updater = `@setInputType(${node.var}, ${shouldCache ? last : value});`; - } else if (isSelectValueAttribute) { - // annoying special case - const isMultipleSelect = node.getStaticAttributeValue('multiple'); - const i = block.getUniqueName('i'); - const option = block.getUniqueName('option'); - - const ifStatement = isMultipleSelect - ? deindent` - ${option}.selected = ~${last}.indexOf(${option}.__value);` - : deindent` - if (${option}.__value === ${last}) { - ${option}.selected = true; - break; - }`; - - updater = deindent` - for (var ${i} = 0; ${i} < ${node.var}.options.length; ${i} += 1) { - var ${option} = ${node.var}.options[${i}]; - - ${ifStatement} - } - `; - - block.builders.hydrate.addBlock(deindent` - ${last} = ${value}; - ${updater} - `); - } else if (propertyName) { - block.builders.hydrate.addLine( - `${node.var}.${propertyName} = ${init};` - ); - updater = `${node.var}.${propertyName} = ${shouldCache ? last : value};`; - } else if (isDataSet) { - block.builders.hydrate.addLine( - `${node.var}.dataset.${camelCaseName} = ${init};` - ); - updater = `${node.var}.dataset.${camelCaseName} = ${shouldCache ? last : value};`; - } else { - block.builders.hydrate.addLine( - `${method}(${node.var}, "${name}", ${init});` - ); - updater = `${method}(${node.var}, "${name}", ${shouldCache ? last : value});`; - } - - if (this.dependencies.size || isSelectValueAttribute) { - const dependencies = Array.from(this.dependencies); - const changedCheck = ( - ( block.hasOutroMethod ? `#outroing || ` : '' ) + - dependencies.map(dependency => `changed.${dependency}`).join(' || ') - ); - - const updateCachedValue = `${last} !== (${last} = ${value})`; - - const condition = shouldCache ? - ( dependencies.length ? `(${changedCheck}) && ${updateCachedValue}` : updateCachedValue ) : - changedCheck; - - block.builders.update.addConditional( - condition, - updater - ); - } - } else { - const value = this.isTrue - ? 'true' - : this.chunks.length === 0 ? `""` : stringify(this.chunks[0].data); - - const statement = ( - isLegacyInputType - ? `@setInputType(${node.var}, ${value});` - : propertyName - ? `${node.var}.${propertyName} = ${value};` - : isDataSet - ? `${node.var}.dataset.${camelCaseName} = ${value};` - : `${method}(${node.var}, "${name}", ${value});` - ); - - block.builders.hydrate.addLine(statement); - - // special case – autofocus. has to be handled in a bit of a weird way - if (this.isTrue && name === 'autofocus') { - block.autofocus = node.var; - } - } - - if (isIndirectlyBoundValue) { - const updateValue = `${node.var}.value = ${node.var}.__value;`; - - block.builders.hydrate.addLine(updateValue); - if (this.isDynamic) block.builders.update.addLine(updateValue); - } - } - - renderStyle( - block: Block, - styleProps: StyleProp[] - ) { - styleProps.forEach((prop: StyleProp) => { - let value; - - if (isDynamic(prop.value)) { - const propDependencies = new Set(); - let shouldCache; - - value = - ((prop.value.length === 1 || prop.value[0].type === 'Text') ? '' : `"" + `) + - prop.value - .map((chunk: Node) => { - if (chunk.type === 'Text') { - return stringify(chunk.data); - } else { - const { dependencies, snippet } = chunk; - - dependencies.forEach(d => { - propDependencies.add(d); - }); - - return chunk.getPrecedence() <= 13 ? `(${snippet})` : snippet; - } - }) - .join(' + '); - - if (propDependencies.size) { - const dependencies = Array.from(propDependencies); - const condition = ( - (block.hasOutroMethod ? `#outroing || ` : '') + - dependencies.map(dependency => `changed.${dependency}`).join(' || ') - ); - - block.builders.update.addConditional( - condition, - `@setStyle(${this.parent.var}, "${prop.key}", ${value});` - ); - } - } else { - value = stringify(prop.value[0].data); - } - - block.builders.hydrate.addLine( - `@setStyle(${this.parent.var}, "${prop.key}", ${value});` - ); - }); + return this.isTrue + ? true + : this.chunks[0] + ? this.chunks[0].data + : ''; } stringifyForSsr() { @@ -344,353 +111,4 @@ export default class Attribute extends Node { }) .join(''); } -} - -// source: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes -const attributeLookup = { - accept: { appliesTo: ['form', 'input'] }, - 'accept-charset': { propertyName: 'acceptCharset', appliesTo: ['form'] }, - accesskey: { propertyName: 'accessKey' }, - action: { appliesTo: ['form'] }, - align: { - appliesTo: [ - 'applet', - 'caption', - 'col', - 'colgroup', - 'hr', - 'iframe', - 'img', - 'table', - 'tbody', - 'td', - 'tfoot', - 'th', - 'thead', - 'tr', - ], - }, - allowfullscreen: { propertyName: 'allowFullscreen', appliesTo: ['iframe'] }, - alt: { appliesTo: ['applet', 'area', 'img', 'input'] }, - async: { appliesTo: ['script'] }, - autocomplete: { appliesTo: ['form', 'input'] }, - autofocus: { appliesTo: ['button', 'input', 'keygen', 'select', 'textarea'] }, - autoplay: { appliesTo: ['audio', 'video'] }, - autosave: { appliesTo: ['input'] }, - bgcolor: { - propertyName: 'bgColor', - appliesTo: [ - 'body', - 'col', - 'colgroup', - 'marquee', - 'table', - 'tbody', - 'tfoot', - 'td', - 'th', - 'tr', - ], - }, - border: { appliesTo: ['img', 'object', 'table'] }, - buffered: { appliesTo: ['audio', 'video'] }, - challenge: { appliesTo: ['keygen'] }, - charset: { appliesTo: ['meta', 'script'] }, - checked: { appliesTo: ['command', 'input'] }, - cite: { appliesTo: ['blockquote', 'del', 'ins', 'q'] }, - class: { propertyName: 'className' }, - code: { appliesTo: ['applet'] }, - codebase: { propertyName: 'codeBase', appliesTo: ['applet'] }, - color: { appliesTo: ['basefont', 'font', 'hr'] }, - cols: { appliesTo: ['textarea'] }, - colspan: { propertyName: 'colSpan', appliesTo: ['td', 'th'] }, - content: { appliesTo: ['meta'] }, - contenteditable: { propertyName: 'contentEditable' }, - contextmenu: {}, - controls: { appliesTo: ['audio', 'video'] }, - coords: { appliesTo: ['area'] }, - data: { appliesTo: ['object'] }, - datetime: { propertyName: 'dateTime', appliesTo: ['del', 'ins', 'time'] }, - default: { appliesTo: ['track'] }, - defer: { appliesTo: ['script'] }, - dir: {}, - dirname: { propertyName: 'dirName', appliesTo: ['input', 'textarea'] }, - disabled: { - appliesTo: [ - 'button', - 'command', - 'fieldset', - 'input', - 'keygen', - 'optgroup', - 'option', - 'select', - 'textarea', - ], - }, - download: { appliesTo: ['a', 'area'] }, - draggable: {}, - dropzone: {}, - enctype: { appliesTo: ['form'] }, - for: { propertyName: 'htmlFor', appliesTo: ['label', 'output'] }, - form: { - appliesTo: [ - 'button', - 'fieldset', - 'input', - 'keygen', - 'label', - 'meter', - 'object', - 'output', - 'progress', - 'select', - 'textarea', - ], - }, - formaction: { appliesTo: ['input', 'button'] }, - headers: { appliesTo: ['td', 'th'] }, - height: { - appliesTo: ['canvas', 'embed', 'iframe', 'img', 'input', 'object', 'video'], - }, - hidden: {}, - high: { appliesTo: ['meter'] }, - href: { appliesTo: ['a', 'area', 'base', 'link'] }, - hreflang: { appliesTo: ['a', 'area', 'link'] }, - 'http-equiv': { propertyName: 'httpEquiv', appliesTo: ['meta'] }, - icon: { appliesTo: ['command'] }, - id: {}, - indeterminate: { appliesTo: ['input'] }, - ismap: { propertyName: 'isMap', appliesTo: ['img'] }, - itemprop: {}, - keytype: { appliesTo: ['keygen'] }, - kind: { appliesTo: ['track'] }, - label: { appliesTo: ['track'] }, - lang: {}, - language: { appliesTo: ['script'] }, - loop: { appliesTo: ['audio', 'bgsound', 'marquee', 'video'] }, - low: { appliesTo: ['meter'] }, - manifest: { appliesTo: ['html'] }, - max: { appliesTo: ['input', 'meter', 'progress'] }, - maxlength: { propertyName: 'maxLength', appliesTo: ['input', 'textarea'] }, - media: { appliesTo: ['a', 'area', 'link', 'source', 'style'] }, - method: { appliesTo: ['form'] }, - min: { appliesTo: ['input', 'meter'] }, - multiple: { appliesTo: ['input', 'select'] }, - muted: { appliesTo: ['audio', 'video'] }, - name: { - appliesTo: [ - 'button', - 'form', - 'fieldset', - 'iframe', - 'input', - 'keygen', - 'object', - 'output', - 'select', - 'textarea', - 'map', - 'meta', - 'param', - ], - }, - novalidate: { propertyName: 'noValidate', appliesTo: ['form'] }, - open: { appliesTo: ['details'] }, - optimum: { appliesTo: ['meter'] }, - pattern: { appliesTo: ['input'] }, - ping: { appliesTo: ['a', 'area'] }, - placeholder: { appliesTo: ['input', 'textarea'] }, - poster: { appliesTo: ['video'] }, - preload: { appliesTo: ['audio', 'video'] }, - radiogroup: { appliesTo: ['command'] }, - readonly: { propertyName: 'readOnly', appliesTo: ['input', 'textarea'] }, - rel: { appliesTo: ['a', 'area', 'link'] }, - required: { appliesTo: ['input', 'select', 'textarea'] }, - reversed: { appliesTo: ['ol'] }, - rows: { appliesTo: ['textarea'] }, - rowspan: { propertyName: 'rowSpan', appliesTo: ['td', 'th'] }, - sandbox: { appliesTo: ['iframe'] }, - scope: { appliesTo: ['th'] }, - scoped: { appliesTo: ['style'] }, - seamless: { appliesTo: ['iframe'] }, - selected: { appliesTo: ['option'] }, - shape: { appliesTo: ['a', 'area'] }, - size: { appliesTo: ['input', 'select'] }, - sizes: { appliesTo: ['link', 'img', 'source'] }, - span: { appliesTo: ['col', 'colgroup'] }, - spellcheck: {}, - src: { - appliesTo: [ - 'audio', - 'embed', - 'iframe', - 'img', - 'input', - 'script', - 'source', - 'track', - 'video', - ], - }, - srcdoc: { appliesTo: ['iframe'] }, - srclang: { appliesTo: ['track'] }, - srcset: { appliesTo: ['img'] }, - start: { appliesTo: ['ol'] }, - step: { appliesTo: ['input'] }, - style: { propertyName: 'style.cssText' }, - summary: { appliesTo: ['table'] }, - tabindex: { propertyName: 'tabIndex' }, - target: { appliesTo: ['a', 'area', 'base', 'form'] }, - title: {}, - type: { - appliesTo: [ - 'button', - 'command', - 'embed', - 'object', - 'script', - 'source', - 'style', - 'menu', - ], - }, - usemap: { propertyName: 'useMap', appliesTo: ['img', 'input', 'object'] }, - value: { - appliesTo: [ - 'button', - 'option', - 'input', - 'li', - 'meter', - 'progress', - 'param', - 'select', - 'textarea', - ], - }, - volume: { appliesTo: ['audio', 'video'] }, - width: { - appliesTo: ['canvas', 'embed', 'iframe', 'img', 'input', 'object', 'video'], - }, - wrap: { appliesTo: ['textarea'] }, -}; - -Object.keys(attributeLookup).forEach(name => { - const metadata = attributeLookup[name]; - if (!metadata.propertyName) metadata.propertyName = name; -}); - -function optimizeStyle(value: Node[]) { - let expectingKey = true; - let i = 0; - - const props: { key: string, value: Node[] }[] = []; - let chunks = value.slice(); - - while (chunks.length) { - const chunk = chunks[0]; - - if (chunk.type !== 'Text') return null; - - const keyMatch = /^\s*([\w-]+):\s*/.exec(chunk.data); - if (!keyMatch) return null; - - const key = keyMatch[1]; - - const offset = keyMatch.index + keyMatch[0].length; - const remainingData = chunk.data.slice(offset); - - if (remainingData) { - chunks[0] = { - start: chunk.start + offset, - end: chunk.end, - type: 'Text', - data: remainingData - }; - } else { - chunks.shift(); - } - - const result = getStyleValue(chunks); - if (!result) return null; - - props.push({ key, value: result.value }); - chunks = result.chunks; - } - - return props; -} - -function getStyleValue(chunks: Node[]) { - const value: Node[] = []; - - let inUrl = false; - let quoteMark = null; - let escaped = false; - - while (chunks.length) { - const chunk = chunks.shift(); - - if (chunk.type === 'Text') { - let c = 0; - while (c < chunk.data.length) { - const char = chunk.data[c]; - - if (escaped) { - escaped = false; - } else if (char === '\\') { - escaped = true; - } else if (char === quoteMark) { - quoteMark === null; - } else if (char === '"' || char === "'") { - quoteMark = char; - } else if (char === ')' && inUrl) { - inUrl = false; - } else if (char === 'u' && chunk.data.slice(c, c + 4) === 'url(') { - inUrl = true; - } else if (char === ';' && !inUrl && !quoteMark) { - break; - } - - c += 1; - } - - if (c > 0) { - value.push({ - type: 'Text', - start: chunk.start, - end: chunk.start + c, - data: chunk.data.slice(0, c) - }); - } - - while (/[;\s]/.test(chunk.data[c])) c += 1; - const remainingData = chunk.data.slice(c); - - if (remainingData) { - chunks.unshift({ - start: chunk.start + c, - end: chunk.end, - type: 'Text', - data: remainingData - }); - - break; - } - } - - else { - value.push(chunk); - } - } - - return { - chunks, - value - }; -} - -function isDynamic(value: Node[]) { - return value.length > 1 || value[0].type !== 'Text'; -} +} \ No newline at end of file diff --git a/src/compile/nodes/AwaitBlock.ts b/src/compile/nodes/AwaitBlock.ts index 87e1f7a850..4d0559711f 100644 --- a/src/compile/nodes/AwaitBlock.ts +++ b/src/compile/nodes/AwaitBlock.ts @@ -1,12 +1,8 @@ -import deindent from '../../utils/deindent'; import Node from './shared/Node'; -import Block from '../dom/Block'; import PendingBlock from './PendingBlock'; import ThenBlock from './ThenBlock'; import CatchBlock from './CatchBlock'; -import createDebuggingComment from '../../utils/createDebuggingComment'; import Expression from './shared/Expression'; -import { SsrTarget } from '../ssr'; export default class AwaitBlock extends Node { expression: Expression; @@ -17,225 +13,17 @@ export default class AwaitBlock extends Node { then: ThenBlock; catch: CatchBlock; - constructor(compiler, parent, scope, info) { - super(compiler, parent, scope, info); + constructor(component, parent, scope, info) { + super(component, parent, scope, info); - this.expression = new Expression(compiler, this, scope, info.expression); + this.expression = new Expression(component, this, scope, info.expression); const deps = this.expression.dependencies; this.value = info.value; this.error = info.error; - this.pending = new PendingBlock(compiler, this, scope, info.pending); - this.then = new ThenBlock(compiler, this, scope.add(this.value, deps), info.then); - this.catch = new CatchBlock(compiler, this, scope.add(this.error, deps), info.catch); - } - - init( - block: Block, - stripWhitespace: boolean, - nextSibling: Node - ) { - this.cannotUseInnerHTML(); - - this.var = block.getUniqueName('await_block'); - block.addDependencies(this.expression.dependencies); - - let isDynamic = false; - - ['pending', 'then', 'catch'].forEach(status => { - const child = this[status]; - - child.block = block.child({ - comment: createDebuggingComment(child, this.compiler), - name: this.compiler.getUniqueName(`create_${status}_block`) - }); - - child.initChildren(child.block, stripWhitespace, nextSibling); - this.compiler.target.blocks.push(child.block); - - if (child.block.dependencies.size > 0) { - isDynamic = true; - block.addDependencies(child.block.dependencies); - } - }); - - this.pending.block.hasUpdateMethod = isDynamic; - this.then.block.hasUpdateMethod = isDynamic; - this.catch.block.hasUpdateMethod = isDynamic; - } - - build( - block: Block, - parentNode: string, - parentNodes: string - ) { - const name = this.var; - - const anchor = this.getOrCreateAnchor(block, parentNode, parentNodes); - const updateMountNode = this.getUpdateMountNode(anchor); - - const { snippet } = this.expression; - - const promise = block.getUniqueName(`promise`); - const resolved = block.getUniqueName(`resolved`); - const await_block = block.getUniqueName(`await_block`); - const await_block_type = block.getUniqueName(`await_block_type`); - const token = block.getUniqueName(`token`); - const await_token = block.getUniqueName(`await_token`); - const handle_promise = block.getUniqueName(`handle_promise`); - const replace_await_block = block.getUniqueName(`replace_await_block`); - const old_block = block.getUniqueName(`old_block`); - const value = block.getUniqueName(`value`); - const error = block.getUniqueName(`error`); - const create_pending_block = this.pending.block.name; - const create_then_block = this.then.block.name; - const create_catch_block = this.catch.block.name; - - block.addVariable(await_block); - block.addVariable(await_block_type); - block.addVariable(await_token); - block.addVariable(promise); - block.addVariable(resolved); - - // the `#component.root.set({})` below is just a cheap way to flush - // any oncreate handlers. We could have a dedicated `flush()` method - // but it's probably not worth it - - block.builders.init.addBlock(deindent` - function ${replace_await_block}(${token}, type, ctx) { - if (${token} !== ${await_token}) return; - - var ${old_block} = ${await_block}; - ${await_block} = type && (${await_block_type} = type)(#component, ctx); - - if (${old_block}) { - ${old_block}.u(); - ${old_block}.d(); - ${await_block}.c(); - ${await_block}.m(${updateMountNode}, ${anchor}); - - #component.root.set({}); - } - } - - function ${handle_promise}(${promise}, ctx) { - var ${token} = ${await_token} = {}; - - if (@isPromise(${promise})) { - ${promise}.then(function(${value}) { - ${this.value ? deindent` - var ctx = #component.get(); - ${resolved} = { ${this.value}: ${value} }; - ${replace_await_block}(${token}, ${create_then_block}, @assign(@assign({}, ctx), ${resolved})); - ` : deindent` - ${replace_await_block}(${token}, null, null); - `} - }, function (${error}) { - ${this.error ? deindent` - var ctx = #component.get(); - ${resolved} = { ${this.error}: ${error} }; - ${replace_await_block}(${token}, ${create_catch_block}, @assign(@assign({}, ctx), ${resolved})); - ` : deindent` - ${replace_await_block}(${token}, null, null); - `} - }); - - // if we previously had a then/catch block, destroy it - if (${await_block_type} !== ${create_pending_block}) { - ${replace_await_block}(${token}, ${create_pending_block}, ctx); - return true; - } - } else { - ${resolved} = { ${this.value}: ${promise} }; - if (${await_block_type} !== ${create_then_block}) { - ${replace_await_block}(${token}, ${create_then_block}, @assign(@assign({}, ctx), ${resolved})); - return true; - } - } - } - - ${handle_promise}(${promise} = ${snippet}, ctx); - `); - - block.builders.create.addBlock(deindent` - ${await_block}.c(); - `); - - if (parentNodes) { - block.builders.claim.addBlock(deindent` - ${await_block}.l(${parentNodes}); - `); - } - - const initialMountNode = parentNode || '#target'; - const anchorNode = parentNode ? 'null' : 'anchor'; - - block.builders.mount.addBlock(deindent` - ${await_block}.m(${initialMountNode}, ${anchorNode}); - `); - - const conditions = []; - if (this.expression.dependencies.size > 0) { - conditions.push( - `(${[...this.expression.dependencies].map(dep => `'${dep}' in changed`).join(' || ')})` - ); - } - - conditions.push( - `${promise} !== (${promise} = ${snippet})`, - `${handle_promise}(${promise}, ctx)` - ); - - if (this.pending.block.hasUpdateMethod) { - block.builders.update.addBlock(deindent` - if (${conditions.join(' && ')}) { - // nothing - } else { - ${await_block}.p(changed, @assign(@assign({}, ctx), ${resolved})); - } - `); - } else { - block.builders.update.addBlock(deindent` - if (${conditions.join(' && ')}) { - ${await_block}.c(); - ${await_block}.m(${anchor}.parentNode, ${anchor}); - } - `); - } - - block.builders.unmount.addBlock(deindent` - ${await_block}.u(); - `); - - block.builders.destroy.addBlock(deindent` - ${await_token} = null; - ${await_block}.d(); - `); - - [this.pending, this.then, this.catch].forEach(status => { - status.children.forEach(child => { - child.build(status.block, null,'nodes'); - }); - }); - } - - ssr() { - const target: SsrTarget = this.compiler.target; - const { snippet } = this.expression; - - target.append('${(function(__value) { if(@isPromise(__value)) return `'); - - this.pending.children.forEach((child: Node) => { - child.ssr(); - }); - - target.append('`; return function(ctx) { return `'); - - this.then.children.forEach((child: Node) => { - child.ssr(); - }); - - target.append(`\`;}(Object.assign({}, ctx, { ${this.value}: __value }));}(${snippet})) }`); + this.pending = new PendingBlock(component, this, scope, info.pending); + this.then = new ThenBlock(component, this, scope.add(this.value, deps), info.then); + this.catch = new CatchBlock(component, this, scope.add(this.error, deps), info.catch); } } diff --git a/src/compile/nodes/Binding.ts b/src/compile/nodes/Binding.ts index 3c56da0f43..1d8aa911e1 100644 --- a/src/compile/nodes/Binding.ts +++ b/src/compile/nodes/Binding.ts @@ -1,19 +1,7 @@ import Node from './shared/Node'; -import Element from './Element'; import getObject from '../../utils/getObject'; -import getTailSnippet from '../../utils/getTailSnippet'; -import flattenReference from '../../utils/flattenReference'; -import Compiler from '../Compiler'; -import Block from '../dom/Block'; import Expression from './shared/Expression'; -const readOnlyMediaAttributes = new Set([ - 'duration', - 'buffered', - 'seekable', - 'played' -]); - export default class Binding extends Node { name: string; value: Expression; @@ -22,11 +10,11 @@ export default class Binding extends Node { obj: string; prop: string; - constructor(compiler, parent, scope, info) { - super(compiler, parent, scope, info); + constructor(component, parent, scope, info) { + super(component, parent, scope, info); this.name = info.name; - this.value = new Expression(compiler, this, scope, info.value); + this.value = new Expression(component, this, scope, info.value); let obj; let prop; @@ -50,247 +38,4 @@ export default class Binding extends Node { this.obj = obj; this.prop = prop; } - - munge( - block: Block - ) { - const node: Element = this.parent; - - const needsLock = node.name !== 'input' || !/radio|checkbox|range|color/.test(node.getStaticAttributeValue('type')); - const isReadOnly = node.isMediaNode() && readOnlyMediaAttributes.has(this.name); - - let updateCondition: string; - - const { name } = getObject(this.value.node); - const { snippet } = this.value; - - // special case: if you have e.g. `` - // and `selected` is an object chosen with a - if (binding.name === 'group') { - const bindingGroup = getBindingGroup(compiler, binding.value.node); - if (type === 'checkbox') { - return `@getBindingGroupValue(#component._bindingGroups[${bindingGroup}])`; - } - - return `${node.var}.__value`; - } - - // - if (type === 'range' || type === 'number') { - return `@toNumber(${node.var}.${binding.name})`; - } - - if ((binding.name === 'buffered' || binding.name === 'seekable' || binding.name === 'played')) { - return `@timeRangesToArray(${node.var}.${binding.name})` - } - - // everything else - return `${node.var}.${binding.name}`; -} - -function isComputed(node: Node) { - while (node.type === 'MemberExpression') { - if (node.computed) return true; - node = node.object; - } - - return false; } diff --git a/src/compile/nodes/CatchBlock.ts b/src/compile/nodes/CatchBlock.ts index db15f7ceb1..a8c55860f5 100644 --- a/src/compile/nodes/CatchBlock.ts +++ b/src/compile/nodes/CatchBlock.ts @@ -1,13 +1,15 @@ import Node from './shared/Node'; -import Block from '../dom/Block'; +import Block from '../render-dom/Block'; import mapChildren from './shared/mapChildren'; export default class CatchBlock extends Node { block: Block; children: Node[]; - constructor(compiler, parent, scope, info) { - super(compiler, parent, scope, info); - this.children = mapChildren(compiler, parent, scope, info.children); + constructor(component, parent, scope, info) { + super(component, parent, scope, info); + this.children = mapChildren(component, parent, scope, info.children); + + this.warnIfEmptyBlock(); } } \ No newline at end of file diff --git a/src/compile/nodes/Class.ts b/src/compile/nodes/Class.ts new file mode 100644 index 0000000000..75000371d9 --- /dev/null +++ b/src/compile/nodes/Class.ts @@ -0,0 +1,18 @@ +import Node from './shared/Node'; +import Expression from './shared/Expression'; + +export default class Class extends Node { + type: 'Class'; + name: string; + expression: Expression; + + constructor(component, parent, scope, info) { + super(component, parent, scope, info); + + this.name = info.name; + + this.expression = info.expression + ? new Expression(component, this, scope, info.expression) + : null; + } +} \ No newline at end of file diff --git a/src/compile/nodes/Comment.ts b/src/compile/nodes/Comment.ts index ba20f5750a..97a28f25a1 100644 --- a/src/compile/nodes/Comment.ts +++ b/src/compile/nodes/Comment.ts @@ -4,15 +4,8 @@ export default class Comment extends Node { type: 'Comment'; data: string; - constructor(compiler, parent, scope, info) { - super(compiler, parent, scope, info); + constructor(component, parent, scope, info) { + super(component, parent, scope, info); this.data = info.data; } - - ssr() { - // Allow option to preserve comments, otherwise ignore - if (this.compiler.options.preserveComments) { - this.compiler.target.append(``); - } - } } \ No newline at end of file diff --git a/src/compile/nodes/Component.ts b/src/compile/nodes/Component.ts deleted file mode 100644 index d40466a052..0000000000 --- a/src/compile/nodes/Component.ts +++ /dev/null @@ -1,616 +0,0 @@ -import deindent from '../../utils/deindent'; -import flattenReference from '../../utils/flattenReference'; -import validCalleeObjects from '../../utils/validCalleeObjects'; -import stringifyProps from '../../utils/stringifyProps'; -import CodeBuilder from '../../utils/CodeBuilder'; -import getTailSnippet from '../../utils/getTailSnippet'; -import getObject from '../../utils/getObject'; -import quoteIfNecessary from '../../utils/quoteIfNecessary'; -import { escape, escapeTemplate, stringify } from '../../utils/stringify'; -import Node from './shared/Node'; -import Block from '../dom/Block'; -import Attribute from './Attribute'; -import usesThisOrArguments from '../../validate/js/utils/usesThisOrArguments'; -import mapChildren from './shared/mapChildren'; -import Binding from './Binding'; -import EventHandler from './EventHandler'; -import Expression from './shared/Expression'; -import { AppendTarget } from '../../interfaces'; - -export default class Component extends Node { - type: 'Component'; - name: string; - expression: Expression; - attributes: Attribute[]; - bindings: Binding[]; - handlers: EventHandler[]; - children: Node[]; - ref: string; - - constructor(compiler, parent, scope, info) { - super(compiler, parent, scope, info); - - compiler.hasComponents = true; - - this.name = info.name; - - this.expression = this.name === 'svelte:component' - ? new Expression(compiler, this, scope, info.expression) - : null; - - this.attributes = []; - this.bindings = []; - this.handlers = []; - - info.attributes.forEach(node => { - switch (node.type) { - case 'Attribute': - case 'Spread': - this.attributes.push(new Attribute(compiler, this, scope, node)); - break; - - case 'Binding': - this.bindings.push(new Binding(compiler, this, scope, node)); - break; - - case 'EventHandler': - this.handlers.push(new EventHandler(compiler, this, scope, node)); - break; - - case 'Ref': - // TODO catch this in validation - if (this.ref) throw new Error(`Duplicate refs`); - - compiler.usesRefs = true - this.ref = node.name; - break; - - default: - throw new Error(`Not implemented: ${node.type}`); - } - }); - - this.children = mapChildren(compiler, this, scope, info.children); - } - - init( - block: Block, - stripWhitespace: boolean, - nextSibling: Node - ) { - this.cannotUseInnerHTML(); - - this.attributes.forEach(attr => { - block.addDependencies(attr.dependencies); - }); - - this.bindings.forEach(binding => { - block.addDependencies(binding.value.dependencies); - }); - - this.handlers.forEach(handler => { - block.addDependencies(handler.dependencies); - }); - - this.var = block.getUniqueName( - ( - this.name === 'svelte:self' ? this.compiler.name : - this.name === 'svelte:component' ? 'switch_instance' : - this.name - ).toLowerCase() - ); - - if (this.children.length) { - this._slots = new Set(['default']); - - this.children.forEach(child => { - child.init(block, stripWhitespace, nextSibling); - }); - } - } - - build( - block: Block, - parentNode: string, - parentNodes: string - ) { - const { compiler } = this; - - const name = this.var; - - const componentInitProperties = [`root: #component.root`]; - - if (this.children.length > 0) { - const slots = Array.from(this._slots).map(name => `${quoteIfNecessary(name)}: @createFragment()`); - componentInitProperties.push(`slots: { ${slots.join(', ')} }`); - - this.children.forEach((child: Node) => { - child.build(block, `${this.var}._slotted.default`, 'nodes'); - }); - } - - const statements: string[] = []; - - const name_initial_data = block.getUniqueName(`${name}_initial_data`); - const name_changes = block.getUniqueName(`${name}_changes`); - let name_updating: string; - let beforecreate: string = null; - - const updates: string[] = []; - - const usesSpread = !!this.attributes.find(a => a.isSpread); - - const attributeObject = usesSpread - ? '{}' - : stringifyProps( - this.attributes.map(attr => `${attr.name}: ${attr.getValue()}`) - ); - - if (this.attributes.length || this.bindings.length) { - componentInitProperties.push(`data: ${name_initial_data}`); - } - - if ((!usesSpread && this.attributes.filter(a => a.isDynamic).length) || this.bindings.length) { - updates.push(`var ${name_changes} = {};`); - } - - if (this.attributes.length) { - if (usesSpread) { - const levels = block.getUniqueName(`${this.var}_spread_levels`); - - const initialProps = []; - const changes = []; - - this.attributes.forEach(attr => { - const { name, dependencies } = attr; - - const condition = dependencies.size > 0 - ? [...dependencies].map(d => `changed.${d}`).join(' || ') - : null; - - if (attr.isSpread) { - const value = attr.expression.snippet; - initialProps.push(value); - - changes.push(condition ? `${condition} && ${value}` : value); - } else { - const obj = `{ ${quoteIfNecessary(name)}: ${attr.getValue()} }`; - initialProps.push(obj); - - changes.push(condition ? `${condition} && ${obj}` : obj); - } - }); - - block.addVariable(levels); - - statements.push(deindent` - ${levels} = [ - ${initialProps.join(',\n')} - ]; - - for (var #i = 0; #i < ${levels}.length; #i += 1) { - ${name_initial_data} = @assign(${name_initial_data}, ${levels}[#i]); - } - `); - - updates.push(deindent` - var ${name_changes} = @getSpreadUpdate(${levels}, [ - ${changes.join(',\n')} - ]); - `); - } else { - this.attributes - .filter((attribute: Attribute) => attribute.isDynamic) - .forEach((attribute: Attribute) => { - if (attribute.dependencies.size > 0) { - updates.push(deindent` - if (${[...attribute.dependencies] - .map(dependency => `changed.${dependency}`) - .join(' || ')}) ${name_changes}.${attribute.name} = ${attribute.getValue()}; - `); - } - - else { - // TODO this is an odd situation to encounter – I *think* it should only happen with - // each block indices, in which case it may be possible to optimise this - updates.push(`${name_changes}.${attribute.name} = ${attribute.getValue()};`); - } - }); - } - } - - if (this.bindings.length) { - compiler.target.hasComplexBindings = true; - - name_updating = block.alias(`${name}_updating`); - block.addVariable(name_updating, '{}'); - - let hasLocalBindings = false; - let hasStoreBindings = false; - - const builder = new CodeBuilder(); - - this.bindings.forEach((binding: Binding) => { - let { name: key } = getObject(binding.value.node); - - let setFromChild; - - if (binding.isContextual) { - const computed = isComputed(binding.value.node); - const tail = binding.value.node.type === 'MemberExpression' ? getTailSnippet(binding.value.node) : ''; - - const list = block.listNames.get(key); - const index = block.indexNames.get(key); - - const lhs = binding.value.node.type === 'MemberExpression' - ? binding.value.snippet - : `ctx.${list}[ctx.${index}]${tail} = childState.${binding.name}`; - - setFromChild = deindent` - ${lhs} = childState.${binding.name}; - - ${[...binding.value.dependencies] - .map((name: string) => { - const isStoreProp = name[0] === '$'; - const prop = isStoreProp ? name.slice(1) : name; - const newState = isStoreProp ? 'newStoreState' : 'newState'; - - if (isStoreProp) hasStoreBindings = true; - else hasLocalBindings = true; - - return `${newState}.${prop} = ctx.${name};`; - })} - `; - } - - else { - const isStoreProp = key[0] === '$'; - const prop = isStoreProp ? key.slice(1) : key; - const newState = isStoreProp ? 'newStoreState' : 'newState'; - - if (isStoreProp) hasStoreBindings = true; - else hasLocalBindings = true; - - if (binding.value.node.type === 'MemberExpression') { - setFromChild = deindent` - ${binding.value.snippet} = childState.${binding.name}; - ${newState}.${prop} = ctx.${key}; - `; - } - - else { - setFromChild = `${newState}.${prop} = childState.${binding.name};`; - } - } - - statements.push(deindent` - if (${binding.prop} in ${binding.obj}) { - ${name_initial_data}.${binding.name} = ${binding.value.snippet}; - ${name_updating}.${binding.name} = true; - }` - ); - - builder.addConditional( - `!${name_updating}.${binding.name} && changed.${binding.name}`, - setFromChild - ); - - updates.push(deindent` - if (!${name_updating}.${binding.name} && ${[...binding.value.dependencies].map((dependency: string) => `changed.${dependency}`).join(' || ')}) { - ${name_changes}.${binding.name} = ${binding.value.snippet}; - ${name_updating}.${binding.name} = true; - } - `); - }); - - block.maintainContext = true; // TODO put this somewhere more logical - - const initialisers = [ - hasLocalBindings && 'newState = {}', - hasStoreBindings && 'newStoreState = {}', - ].filter(Boolean).join(', '); - - // TODO use component.on('state', ...) instead of _bind - componentInitProperties.push(deindent` - _bind: function(changed, childState) { - var ${initialisers}; - ${builder} - ${hasStoreBindings && `#component.store.set(newStoreState);`} - ${hasLocalBindings && `#component._set(newState);`} - ${name_updating} = {}; - } - `); - - beforecreate = deindent` - #component.root._beforecreate.push(function() { - ${name}._bind({ ${this.bindings.map(b => `${b.name}: 1`).join(', ')} }, ${name}.get()); - }); - `; - } - - this.handlers.forEach(handler => { - handler.var = block.getUniqueName(`${this.var}_${handler.name}`); // TODO this is hacky - handler.render(compiler, block, false); // TODO hoist when possible - if (handler.usesContext) block.maintainContext = true; // TODO is there a better place to put this? - }); - - if (this.name === 'svelte:component') { - const switch_value = block.getUniqueName('switch_value'); - const switch_props = block.getUniqueName('switch_props'); - - const { dependencies, snippet } = this.expression; - - const anchor = this.getOrCreateAnchor(block, parentNode, parentNodes); - - block.builders.init.addBlock(deindent` - var ${switch_value} = ${snippet}; - - function ${switch_props}(ctx) { - ${(this.attributes.length || this.bindings.length) && deindent` - var ${name_initial_data} = ${attributeObject};`} - ${statements} - return { - ${componentInitProperties.join(',\n')} - }; - } - - if (${switch_value}) { - var ${name} = new ${switch_value}(${switch_props}(ctx)); - - ${beforecreate} - } - - ${this.handlers.map(handler => deindent` - function ${handler.var}(event) { - ${handler.snippet} - } - - if (${name}) ${name}.on("${handler.name}", ${handler.var}); - `)} - `); - - block.builders.create.addLine( - `if (${name}) ${name}._fragment.c();` - ); - - if (parentNodes) { - block.builders.claim.addLine( - `if (${name}) ${name}._fragment.l(${parentNodes});` - ); - } - - block.builders.mount.addBlock(deindent` - if (${name}) { - ${name}._mount(${parentNode || '#target'}, ${parentNode ? 'null' : 'anchor'}); - ${this.ref && `#component.refs.${this.ref} = ${name};`} - } - `); - - const updateMountNode = this.getUpdateMountNode(anchor); - - block.builders.update.addBlock(deindent` - if (${switch_value} !== (${switch_value} = ${snippet})) { - if (${name}) ${name}.destroy(); - - if (${switch_value}) { - ${name} = new ${switch_value}(${switch_props}(ctx)); - ${name}._fragment.c(); - - ${this.children.map(child => child.remount(name))} - ${name}._mount(${updateMountNode}, ${anchor}); - - ${this.handlers.map(handler => deindent` - ${name}.on("${handler.name}", ${handler.var}); - `)} - - ${this.ref && `#component.refs.${this.ref} = ${name};`} - } - - ${this.ref && deindent` - else if (#component.refs.${this.ref} === ${name}) { - #component.refs.${this.ref} = null; - }`} - } - `); - - if (updates.length) { - block.builders.update.addBlock(deindent` - else { - ${updates} - ${name}._set(${name_changes}); - ${this.bindings.length && `${name_updating} = {};`} - } - `); - } - - if (!parentNode) block.builders.unmount.addLine(`if (${name}) ${name}._unmount();`); - - block.builders.destroy.addLine(`if (${name}) ${name}.destroy(false);`); - } else { - const expression = this.name === 'svelte:self' - ? compiler.name - : `%components-${this.name}`; - - block.builders.init.addBlock(deindent` - ${(this.attributes.length || this.bindings.length) && deindent` - var ${name_initial_data} = ${attributeObject};`} - ${statements} - var ${name} = new ${expression}({ - ${componentInitProperties.join(',\n')} - }); - - ${beforecreate} - - ${this.handlers.map(handler => deindent` - ${name}.on("${handler.name}", function(event) { - ${handler.snippet || `#component.fire("${handler.name}", event);`} - }); - `)} - - ${this.ref && `#component.refs.${this.ref} = ${name};`} - `); - - block.builders.create.addLine(`${name}._fragment.c();`); - - if (parentNodes) { - block.builders.claim.addLine( - `${name}._fragment.l(${parentNodes});` - ); - } - - block.builders.mount.addLine( - `${name}._mount(${parentNode || '#target'}, ${parentNode ? 'null' : 'anchor'});` - ); - - if (updates.length) { - block.builders.update.addBlock(deindent` - ${updates} - ${name}._set(${name_changes}); - ${this.bindings.length && `${name_updating} = {};`} - `); - } - - if (!parentNode) block.builders.unmount.addLine(`${name}._unmount();`); - - block.builders.destroy.addLine(deindent` - ${name}.destroy(false); - ${this.ref && `if (#component.refs.${this.ref} === ${name}) #component.refs.${this.ref} = null;`} - `); - } - } - - remount(name: string) { - return `${this.var}._mount(${name}._slotted.default, null);`; - } - - ssr() { - function stringifyAttribute(chunk: Node) { - if (chunk.type === 'Text') { - return escapeTemplate(escape(chunk.data)); - } - - return '${@escape( ' + chunk.snippet + ')}'; - } - - const bindingProps = this.bindings.map(binding => { - const { name } = getObject(binding.value.node); - const tail = binding.value.node.type === 'MemberExpression' - ? getTailSnippet(binding.value.node) - : ''; - - return `${binding.name}: ctx.${name}${tail}`; - }); - - function getAttributeValue(attribute) { - if (attribute.isTrue) return `true`; - if (attribute.chunks.length === 0) return `''`; - - if (attribute.chunks.length === 1) { - const chunk = attribute.chunks[0]; - if (chunk.type === 'Text') { - return stringify(chunk.data); - } - - return chunk.snippet; - } - - return '`' + attribute.chunks.map(stringifyAttribute).join('') + '`'; - } - - const usesSpread = this.attributes.find(attr => attr.isSpread); - - const props = usesSpread - ? `Object.assign(${ - this.attributes - .map(attribute => { - if (attribute.isSpread) { - return attribute.expression.snippet; - } else { - return `{ ${attribute.name}: ${getAttributeValue(attribute)} }`; - } - }) - .concat(bindingProps.map(p => `{ ${p} }`)) - .join(', ') - })` - : `{ ${this.attributes - .map(attribute => `${attribute.name}: ${getAttributeValue(attribute)}`) - .concat(bindingProps) - .join(', ')} }`; - - const isDynamicComponent = this.name === 'svelte:component'; - - const expression = ( - this.name === 'svelte:self' ? this.compiler.name : - isDynamicComponent ? `((${this.expression.snippet}) || @missingComponent)` : - `%components-${this.name}` - ); - - this.bindings.forEach(binding => { - const conditions = []; - - let node = this; - while (node = node.parent) { - if (node.type === 'IfBlock') { - // TODO handle contextual bindings... - conditions.push(`(${node.expression.snippet})`); - } - } - - conditions.push(`!('${binding.name}' in ctx)`); - - const { name } = getObject(binding.value.node); - - this.compiler.target.bindings.push(deindent` - if (${conditions.reverse().join('&&')}) { - tmp = ${expression}.data(); - if ('${name}' in tmp) { - ctx.${binding.name} = tmp.${name}; - settled = false; - } - } - `); - }); - - let open = `\${${expression}._render(__result, ${props}`; - - const options = []; - options.push(`store: options.store`); - - if (this.children.length) { - const appendTarget: AppendTarget = { - slots: { default: '' }, - slotStack: ['default'] - }; - - this.compiler.target.appendTargets.push(appendTarget); - - this.children.forEach((child: Node) => { - child.ssr(); - }); - - const slotted = Object.keys(appendTarget.slots) - .map(name => `${name}: () => \`${appendTarget.slots[name]}\``) - .join(', '); - - options.push(`slotted: { ${slotted} }`); - - this.compiler.target.appendTargets.pop(); - } - - if (options.length) { - open += `, { ${options.join(', ')} }`; - } - - this.compiler.target.append(open); - this.compiler.target.append(')}'); - } -} - -function isComputed(node: Node) { - while (node.type === 'MemberExpression') { - if (node.computed) return true; - node = node.object; - } - - return false; -} diff --git a/src/compile/nodes/DebugTag.ts b/src/compile/nodes/DebugTag.ts new file mode 100644 index 0000000000..4d2c3f6ae4 --- /dev/null +++ b/src/compile/nodes/DebugTag.ts @@ -0,0 +1,14 @@ +import Node from './shared/Node'; +import Expression from './shared/Expression'; + +export default class DebugTag extends Node { + expressions: Expression[]; + + constructor(component, parent, scope, info) { + super(component, parent, scope, info); + + this.expressions = info.identifiers.map(node => { + return new Expression(component, parent, scope, node); + }); + } +} \ No newline at end of file diff --git a/src/compile/nodes/EachBlock.ts b/src/compile/nodes/EachBlock.ts index cb58b31411..afc4f8655a 100644 --- a/src/compile/nodes/EachBlock.ts +++ b/src/compile/nodes/EachBlock.ts @@ -1,11 +1,10 @@ -import deindent from '../../utils/deindent'; import Node from './shared/Node'; import ElseBlock from './ElseBlock'; -import Block from '../dom/Block'; -import createDebuggingComment from '../../utils/createDebuggingComment'; +import Block from '../render-dom/Block'; import Expression from './shared/Expression'; import mapChildren from './shared/mapChildren'; import TemplateScope from './shared/TemplateScope'; +import unpackDestructuring from '../../utils/unpackDestructuring'; export default class EachBlock extends Node { type: 'EachBlock'; @@ -16,492 +15,65 @@ export default class EachBlock extends Node { iterations: string; index: string; context: string; - key: string; + key: Expression; scope: TemplateScope; - destructuredContexts: string[]; + contexts: Array<{ name: string, tail: string }>; + hasAnimation: boolean; children: Node[]; else?: ElseBlock; - constructor(compiler, parent, scope, info) { - super(compiler, parent, scope, info); + constructor(component, parent, scope, info) { + super(component, parent, scope, info); - this.expression = new Expression(compiler, this, scope, info.expression); - this.context = info.context; + this.expression = new Expression(component, this, scope, info.expression); + this.context = info.context.name || 'each'; // TODO this is used to facilitate binding; currently fails with destructuring this.index = info.index; - this.key = info.key; this.scope = scope.child(); - this.scope.add(this.context, this.expression.dependencies); + this.contexts = []; + unpackDestructuring(this.contexts, info.context, ''); - if (this.index) { - // index can only change if this is a keyed each block - const dependencies = this.key ? this.expression.dependencies : []; - this.scope.add(this.index, dependencies); - } + this.contexts.forEach(context => { + if (component.helpers.has(context.key.name)) { + component.warn(context.key, { + code: `each-context-clash`, + message: `Context clashes with a helper. Rename one or the other to eliminate any ambiguity` + }); + } - // TODO more general approach to destructuring - this.destructuredContexts = info.destructuredContexts || []; - this.destructuredContexts.forEach(name => { - this.scope.add(name, this.expression.dependencies); + this.scope.add(context.key.name, this.expression.dependencies); }); - this.children = mapChildren(compiler, this, this.scope, info.children); - - this.else = info.else - ? new ElseBlock(compiler, this, this.scope, info.else) + this.key = info.key + ? new Expression(component, this, this.scope, info.key) : null; - } - - init( - block: Block, - stripWhitespace: boolean, - nextSibling: Node - ) { - this.cannotUseInnerHTML(); - - this.var = block.getUniqueName(`each`); - this.iterations = block.getUniqueName(`${this.var}_blocks`); - this.each_context = block.getUniqueName(`${this.var}_context`); - - const { dependencies } = this.expression; - block.addDependencies(dependencies); - - this.block = block.child({ - comment: createDebuggingComment(this, this.compiler), - name: this.compiler.getUniqueName('create_each_block'), - key: this.key, - - indexNames: new Map(block.indexNames), - listNames: new Map(block.listNames) - }); - - const listName = this.compiler.getUniqueName('each_value'); - const indexName = this.index || this.compiler.getUniqueName(`${this.context}_index`); - - this.block.indexNames.set(this.context, indexName); - this.block.listNames.set(this.context, listName); if (this.index) { - this.block.getUniqueName(this.index); // this prevents name collisions (#1254) - } - - this.contextProps = [ - `${listName}: ${listName}`, - `${this.context}: ${listName}[#i]`, - `${indexName}: #i` - ]; - - if (this.destructuredContexts) { - for (let i = 0; i < this.destructuredContexts.length; i += 1) { - this.contextProps.push(`${this.destructuredContexts[i]}: ${listName}[#i][${i}]`); - } - } - - this.compiler.target.blocks.push(this.block); - this.initChildren(this.block, stripWhitespace, nextSibling); - block.addDependencies(this.block.dependencies); - this.block.hasUpdateMethod = this.block.dependencies.size > 0; - - if (this.else) { - this.else.block = block.child({ - comment: createDebuggingComment(this.else, this.compiler), - name: this.compiler.getUniqueName(`${this.block.name}_else`), - }); - - this.compiler.target.blocks.push(this.else.block); - this.else.initChildren( - this.else.block, - stripWhitespace, - nextSibling - ); - this.else.block.hasUpdateMethod = this.else.block.dependencies.size > 0; - } - } - - build( - block: Block, - parentNode: string, - parentNodes: string - ) { - if (this.children.length === 0) return; - - const { compiler } = this; - - const each = this.var; - - const create_each_block = this.block.name; - const each_block_value = this.block.listNames.get(this.context); - const iterations = this.iterations; - - const needsAnchor = this.next ? !this.next.isDomNode() : !parentNode || !this.parent.isDomNode(); - const anchor = needsAnchor - ? block.getUniqueName(`${each}_anchor`) - : (this.next && this.next.var) || 'null'; - - // hack the sourcemap, so that if data is missing the bug - // is easy to find - let c = this.start + 2; - while (compiler.source[c] !== 'e') c += 1; - compiler.code.overwrite(c, c + 4, 'length'); - const length = `[✂${c}-${c+4}✂]`; - - const mountOrIntro = this.block.hasIntroMethod ? 'i' : 'm'; - const vars = { - each, - create_each_block, - each_block_value, - length, - iterations, - anchor, - mountOrIntro, - }; - - const { snippet } = this.expression; - - block.builders.init.addLine(`var ${each_block_value} = ${snippet};`); - - if (this.key) { - this.buildKeyed(block, parentNode, parentNodes, snippet, vars); - } else { - this.buildUnkeyed(block, parentNode, parentNodes, snippet, vars); - } - - if (needsAnchor) { - block.addElement( - anchor, - `@createComment()`, - parentNodes && `@createComment()`, - parentNode - ); - } - - if (this.else) { - const each_block_else = compiler.getUniqueName(`${each}_else`); - - block.builders.init.addLine(`var ${each_block_else} = null;`); - - // TODO neaten this up... will end up with an empty line in the block - block.builders.init.addBlock(deindent` - if (!${each_block_value}.${length}) { - ${each_block_else} = ${this.else.block.name}(#component, ctx); - ${each_block_else}.c(); - } - `); - - block.builders.mount.addBlock(deindent` - if (${each_block_else}) { - ${each_block_else}.${mountOrIntro}(${parentNode || '#target'}, null); - } - `); - - const initialMountNode = parentNode || `${anchor}.parentNode`; - - if (this.else.block.hasUpdateMethod) { - block.builders.update.addBlock(deindent` - if (!${each_block_value}.${length} && ${each_block_else}) { - ${each_block_else}.p(changed, ctx); - } else if (!${each_block_value}.${length}) { - ${each_block_else} = ${this.else.block.name}(#component, ctx); - ${each_block_else}.c(); - ${each_block_else}.${mountOrIntro}(${initialMountNode}, ${anchor}); - } else if (${each_block_else}) { - ${each_block_else}.u(); - ${each_block_else}.d(); - ${each_block_else} = null; - } - `); - } else { - block.builders.update.addBlock(deindent` - if (${each_block_value}.${length}) { - if (${each_block_else}) { - ${each_block_else}.u(); - ${each_block_else}.d(); - ${each_block_else} = null; - } - } else if (!${each_block_else}) { - ${each_block_else} = ${this.else.block.name}(#component, ctx); - ${each_block_else}.c(); - ${each_block_else}.${mountOrIntro}(${initialMountNode}, ${anchor}); - } - `); - } - - block.builders.unmount.addLine( - `if (${each_block_else}) ${each_block_else}.u()` - ); - - block.builders.destroy.addBlock(deindent` - if (${each_block_else}) ${each_block_else}.d(); - `); - } - - this.children.forEach((child: Node) => { - child.build(this.block, null, 'nodes'); - }); - - if (this.else) { - this.else.children.forEach((child: Node) => { - child.build(this.else.block, null, 'nodes'); - }); - } - } - - buildKeyed( - block: Block, - parentNode: string, - parentNodes: string, - snippet: string, - { - each, - create_each_block, - each_block_value, - length, - anchor, - mountOrIntro, - } - ) { - const key = block.getUniqueName('key'); - const blocks = block.getUniqueName(`${each}_blocks`); - const lookup = block.getUniqueName(`${each}_lookup`); - - block.addVariable(blocks, '[]'); - block.addVariable(lookup, `@blankObject()`); - - if (this.children[0].isDomNode()) { - this.block.first = this.children[0].var; - } else { - this.block.first = this.block.getUniqueName('first'); - this.block.addElement( - this.block.first, - `@createComment()`, - parentNodes && `@createComment()`, - null - ); - } - - block.builders.init.addBlock(deindent` - for (var #i = 0; #i < ${each_block_value}.${length}; #i += 1) { - var ${key} = ${each_block_value}[#i].${this.key}; - ${blocks}[#i] = ${lookup}[${key}] = ${create_each_block}(#component, ${key}, @assign(@assign({}, ctx), { - ${this.contextProps.join(',\n')} - })); - } - `); - - const initialMountNode = parentNode || '#target'; - const updateMountNode = this.getUpdateMountNode(anchor); - const anchorNode = parentNode ? 'null' : 'anchor'; - - block.builders.create.addBlock(deindent` - for (#i = 0; #i < ${blocks}.length; #i += 1) ${blocks}[#i].c(); - `); - - if (parentNodes) { - block.builders.claim.addBlock(deindent` - for (#i = 0; #i < ${blocks}.length; #i += 1) ${blocks}[#i].l(${parentNodes}); - `); + // index can only change if this is a keyed each block + const dependencies = this.key ? this.expression.dependencies : []; + this.scope.add(this.index, dependencies); } - block.builders.mount.addBlock(deindent` - for (#i = 0; #i < ${blocks}.length; #i += 1) ${blocks}[#i].${mountOrIntro}(${initialMountNode}, ${anchorNode}); - `); - - const dynamic = this.block.hasUpdateMethod; + this.hasAnimation = false; - block.builders.update.addBlock(deindent` - var ${each_block_value} = ${snippet}; + this.children = mapChildren(component, this, this.scope, info.children); - ${blocks} = @updateKeyedEach(${blocks}, #component, changed, "${this.key}", ${dynamic ? '1' : '0'}, ${each_block_value}, ${lookup}, ${updateMountNode}, ${String(this.block.hasOutroMethod)}, ${create_each_block}, "${mountOrIntro}", ${anchor}, function(#i) { - return @assign(@assign({}, ctx), { - ${this.contextProps.join(',\n')} + if (this.hasAnimation) { + if (this.children.length !== 1) { + const child = this.children.find(child => !!child.animation); + component.error(child.animation, { + code: `invalid-animation`, + message: `An element that use the animate directive must be the sole child of a keyed each block` }); - }); - `); - - if (!parentNode) { - block.builders.unmount.addBlock(deindent` - for (#i = 0; #i < ${blocks}.length; #i += 1) ${blocks}[#i].u(); - `); - } - - block.builders.destroy.addBlock(deindent` - for (#i = 0; #i < ${blocks}.length; #i += 1) ${blocks}[#i].d(); - `); - } - - buildUnkeyed( - block: Block, - parentNode: string, - parentNodes: string, - snippet: string, - { - create_each_block, - each_block_value, - length, - iterations, - anchor, - mountOrIntro, - } - ) { - block.builders.init.addBlock(deindent` - var ${iterations} = []; - - for (var #i = 0; #i < ${each_block_value}.${length}; #i += 1) { - ${iterations}[#i] = ${create_each_block}(#component, @assign(@assign({}, ctx), { - ${this.contextProps.join(',\n')} - })); } - `); - - const initialMountNode = parentNode || '#target'; - const updateMountNode = this.getUpdateMountNode(anchor); - const anchorNode = parentNode ? 'null' : 'anchor'; - - block.builders.create.addBlock(deindent` - for (var #i = 0; #i < ${iterations}.length; #i += 1) { - ${iterations}[#i].c(); - } - `); - - if (parentNodes) { - block.builders.claim.addBlock(deindent` - for (var #i = 0; #i < ${iterations}.length; #i += 1) { - ${iterations}[#i].l(${parentNodes}); - } - `); } - block.builders.mount.addBlock(deindent` - for (var #i = 0; #i < ${iterations}.length; #i += 1) { - ${iterations}[#i].${mountOrIntro}(${initialMountNode}, ${anchorNode}); - } - `); - - const allDependencies = new Set(this.block.dependencies); - const { dependencies } = this.expression; - dependencies.forEach((dependency: string) => { - allDependencies.add(dependency); - }); + this.warnIfEmptyBlock(); // TODO would be better if EachBlock, IfBlock etc extended an abstract Block class - // TODO do this for keyed blocks as well - const condition = Array.from(allDependencies) - .map(dependency => `changed.${dependency}`) - .join(' || '); - - if (condition !== '') { - const forLoopBody = this.block.hasUpdateMethod - ? this.block.hasIntroMethod - ? deindent` - if (${iterations}[#i]) { - ${iterations}[#i].p(changed, ${this.each_context}); - } else { - ${iterations}[#i] = ${create_each_block}(#component, ${this.each_context}); - ${iterations}[#i].c(); - } - ${iterations}[#i].i(${updateMountNode}, ${anchor}); - ` - : deindent` - if (${iterations}[#i]) { - ${iterations}[#i].p(changed, ${this.each_context}); - } else { - ${iterations}[#i] = ${create_each_block}(#component, ${this.each_context}); - ${iterations}[#i].c(); - ${iterations}[#i].m(${updateMountNode}, ${anchor}); - } - ` - : deindent` - ${iterations}[#i] = ${create_each_block}(#component, ${this.each_context}); - ${iterations}[#i].c(); - ${iterations}[#i].${mountOrIntro}(${updateMountNode}, ${anchor}); - `; - - const start = this.block.hasUpdateMethod ? '0' : `${iterations}.length`; - - const outro = block.getUniqueName('outro'); - const destroy = this.block.hasOutroMethod - ? deindent` - function ${outro}(i) { - if (${iterations}[i]) { - ${iterations}[i].o(function() { - ${iterations}[i].u(); - ${iterations}[i].d(); - ${iterations}[i] = null; - }); - } - } - - for (; #i < ${iterations}.length; #i += 1) ${outro}(#i); - ` - : deindent` - for (; #i < ${iterations}.length; #i += 1) { - ${iterations}[#i].u(); - ${iterations}[#i].d(); - } - ${iterations}.length = ${each_block_value}.${length}; - `; - - block.builders.update.addBlock(deindent` - var ${each_block_value} = ${snippet}; - - if (${condition}) { - for (var #i = ${start}; #i < ${each_block_value}.${length}; #i += 1) { - var ${this.each_context} = @assign(@assign({}, ctx), { - ${this.contextProps.join(',\n')} - }); - - ${forLoopBody} - } - - ${destroy} - } - `); - } - - block.builders.unmount.addBlock(deindent` - for (var #i = 0; #i < ${iterations}.length; #i += 1) { - ${iterations}[#i].u(); - } - `); - - block.builders.destroy.addBlock(`@destroyEach(${iterations});`); - } - - remount(name: string) { - // TODO consider keyed blocks - return `for (var #i = 0; #i < ${this.iterations}.length; #i += 1) ${this.iterations}[#i].m(${name}._slotted.default, null);`; - } - - ssr() { - const { compiler } = this; - const { snippet } = this.expression; - - const props = [`${this.context}: item`] - .concat(this.destructuredContexts.map((name, i) => `${name}: item[${i}]`)); - - const getContext = this.index - ? `(item, i) => Object.assign({}, ctx, { ${props.join(', ')}, ${this.index}: i })` - : `item => Object.assign({}, ctx, { ${props.join(', ')} })`; - - const open = `\${ ${this.else ? `${snippet}.length ? ` : ''}@each(${snippet}, ${getContext}, ctx => \``; - compiler.target.append(open); - - this.children.forEach((child: Node) => { - child.ssr(); - }); - - const close = `\`)`; - compiler.target.append(close); - - if (this.else) { - compiler.target.append(` : \``); - this.else.children.forEach((child: Node) => { - child.ssr(); - }); - compiler.target.append(`\``); - } - - compiler.target.append('}'); + this.else = info.else + ? new ElseBlock(component, this, this.scope, info.else) + : null; } } diff --git a/src/compile/nodes/Element.ts b/src/compile/nodes/Element.ts index a025eb7b05..c060edc1f8 100644 --- a/src/compile/nodes/Element.ts +++ b/src/compile/nodes/Element.ts @@ -1,25 +1,60 @@ -import deindent from '../../utils/deindent'; -import { stringify, escapeHTML } from '../../utils/stringify'; -import flattenReference from '../../utils/flattenReference'; import isVoidElementName from '../../utils/isVoidElementName'; -import validCalleeObjects from '../../utils/validCalleeObjects'; -import reservedNames from '../../utils/reservedNames'; -import fixAttributeCasing from '../../utils/fixAttributeCasing'; -import quoteIfNecessary from '../../utils/quoteIfNecessary'; -import Compiler from '../Compiler'; +import { quotePropIfNecessary } from '../../utils/quoteIfNecessary'; import Node from './shared/Node'; -import Block from '../dom/Block'; import Attribute from './Attribute'; import Binding from './Binding'; import EventHandler from './EventHandler'; import Transition from './Transition'; +import Animation from './Animation'; import Action from './Action'; +import Class from './Class'; import Text from './Text'; import * as namespaces from '../../utils/namespaces'; import mapChildren from './shared/mapChildren'; +import { dimensions } from '../../utils/patterns'; +import fuzzymatch from '../validate/utils/fuzzymatch'; +import Ref from './Ref'; -// source: https://gist.github.com/ArjanSchouten/0b8574a6ad7f5065a5e7 -const booleanAttributes = new Set('async autocomplete autofocus autoplay border challenge checked compact contenteditable controls default defer disabled formnovalidate frameborder hidden indeterminate ismap loop multiple muted nohref noresize noshade novalidate nowrap open readonly required reversed scoped scrolling seamless selected sortable spellcheck translate'.split(' ')); +const svg = /^(?:altGlyph|altGlyphDef|altGlyphItem|animate|animateColor|animateMotion|animateTransform|circle|clipPath|color-profile|cursor|defs|desc|discard|ellipse|feBlend|feColorMatrix|feComponentTransfer|feComposite|feConvolveMatrix|feDiffuseLighting|feDisplacementMap|feDistantLight|feDropShadow|feFlood|feFuncA|feFuncB|feFuncG|feFuncR|feGaussianBlur|feImage|feMerge|feMergeNode|feMorphology|feOffset|fePointLight|feSpecularLighting|feSpotLight|feTile|feTurbulence|filter|font|font-face|font-face-format|font-face-name|font-face-src|font-face-uri|foreignObject|g|glyph|glyphRef|hatch|hatchpath|hkern|image|line|linearGradient|marker|mask|mesh|meshgradient|meshpatch|meshrow|metadata|missing-glyph|mpath|path|pattern|polygon|polyline|radialGradient|rect|set|solidcolor|stop|switch|symbol|text|textPath|tref|tspan|unknown|use|view|vkern)$/; + +const ariaAttributes = 'activedescendant atomic autocomplete busy checked controls current describedby details disabled dropeffect errormessage expanded flowto grabbed haspopup hidden invalid keyshortcuts label labelledby level live modal multiline multiselectable orientation owns placeholder posinset pressed readonly relevant required roledescription selected setsize sort valuemax valuemin valuenow valuetext'.split(' '); +const ariaAttributeSet = new Set(ariaAttributes); + +const ariaRoles = 'alert alertdialog application article banner button cell checkbox columnheader combobox command complementary composite contentinfo definition dialog directory document feed figure form grid gridcell group heading img input landmark link list listbox listitem log main marquee math menu menubar menuitem menuitemcheckbox menuitemradio navigation none note option presentation progressbar radio radiogroup range region roletype row rowgroup rowheader scrollbar search searchbox section sectionhead select separator slider spinbutton status structure switch tab table tablist tabpanel term textbox timer toolbar tooltip tree treegrid treeitem widget window'.split(' '); +const ariaRoleSet = new Set(ariaRoles); + +const a11yRequiredAttributes = { + a: ['href'], + area: ['alt', 'aria-label', 'aria-labelledby'], + + // html-has-lang + html: ['lang'], + + // iframe-has-title + iframe: ['title'], + img: ['alt'], + object: ['title', 'aria-label', 'aria-labelledby'] +}; + +const a11yDistractingElements = new Set([ + 'blink', + 'marquee' +]); + +const a11yRequiredContent = new Set([ + // anchor-has-content + 'a', + + // heading-has-content + 'h1', + 'h2', + 'h3', + 'h4', + 'h5', + 'h6' +]) + +const invisibleElements = new Set(['meta', 'html', 'script', 'style']); export default class Element extends Node { type: 'Element'; @@ -28,36 +63,55 @@ export default class Element extends Node { attributes: Attribute[]; actions: Action[]; bindings: Binding[]; + classes: Class[]; handlers: EventHandler[]; - intro: Transition; - outro: Transition; + intro?: Transition; + outro?: Transition; + animation?: Animation; children: Node[]; - ref: string; + ref: Ref; namespace: string; - constructor(compiler, parent, scope, info: any) { - super(compiler, parent, scope, info); + constructor(component, parent, scope, info: any) { + super(component, parent, scope, info); this.name = info.name; this.scope = scope; const parentElement = parent.findNearest(/^Element/); this.namespace = this.name === 'svg' ? namespaces.svg : - parentElement ? parentElement.namespace : this.compiler.namespace; + parentElement ? parentElement.namespace : this.component.namespace; + + if (!this.namespace && svg.test(this.name)) { + this.component.warn(this, { + code: `missing-namespace`, + message: `<${this.name}> is an SVG element – did you forget to add { namespace: 'svg' } ?` + }); + } this.attributes = []; this.actions = []; this.bindings = []; + this.classes = []; this.handlers = []; this.intro = null; this.outro = null; + this.animation = null; if (this.name === 'textarea') { - // this is an egregious hack, but it's the easiest way to get