diff --git a/.github/Contributing.md b/.github/Contributing.md index e9b1ab466..ab0ce36d0 100644 --- a/.github/Contributing.md +++ b/.github/Contributing.md @@ -66,24 +66,12 @@ Then run Babel in watch mode: npm run compile:watch ``` -Then open a new terminal and start Styleguidist server: - -```bash -npm run test:cypress:startServer -``` - -And, finally, in another separate terminal run tests: +Then open a new terminal and run Cypress: ```bash npm run test:cypress:run ``` -Or open Cypress UI: - -```bash -npm run test:cypress:open -``` - ## Other notes - If you have commit access to repository and want to make big change or not sure about something, make a new branch and open pull request. diff --git a/.prettierignore b/.prettierignore index 6fe015c10..cde66e9f8 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,2 +1,4 @@ examples/*/styleguide/ lib/ +site/build/ +site/docs/ diff --git a/.travis.yml b/.travis.yml index 0a85f1888..97818f653 100644 --- a/.travis.yml +++ b/.travis.yml @@ -52,9 +52,7 @@ jobs: - npm run test:browser:sections # Run integration tests with Cypress - npm run test:cypress:pre - - npm run test:cypress:startServer & - - npm run test:cypress:startServer:post - - npm run test:cypress:run + - npm run test:cypress:ci - stage: coverage script: diff --git a/docs/Configuration.md b/docs/Configuration.md index 5e010348f..32c823687 100644 --- a/docs/Configuration.md +++ b/docs/Configuration.md @@ -8,28 +8,59 @@ Type: `String` or `Array`, optional Your application static assets folder will be accessible as `/` in the style guide dev server. -## `compilerConfig` +## `compileExample` + +Type: `Function`, default: + +```javascript +;(compiler, code) => + compiler.transform(code, { + // Compile TypeScript, JSX and ECMAScript imports + transforms: ['typescript', 'jsx', 'imports'] + }) +``` + +Where `compiler` is a module defined in the [`compilerModule`](#compilermodule) option. + +## `compilerModule` + +Type: `String`, default: `sucrase` + +The compiler to transpile examples’ code. Styleguidist uses [Sucrase](https://github.com/alangpierce/sucrase/) by default to run modern ECMAScript code on the frontend. + +Styleguidist (via Sucrase) supports these proposed JavaScript features by default: -Type: `Object`, default: +- Optional chaining: `a?.b`. +- Nullish coalescing: `a ?? b`. +- Class fields: `class C { x = 1; }`. This includes static fields but not the `#x` private field syntax. +- Numeric separators: `const n = 1_234`. +- Optional catch binding: `try { doThing(); } catch {}`. + +These JavaScript features will be “pass through”, so they won’t cause a compilation error but your browser must support them: + +- Object rest/spread. +- Async functions, and async iterators. +- Newer regex features. + +Styleguidist also strips TypeScript and Flow type annotations, including TypeScript enums. It doesn’t do actual type checking but you cold use TypeScript or Flow in the examples. + +> **Info:** See [Sucrase docs](https://github.com/alangpierce/sucrase/#transforms) for more details. + +You can change the compiler by passing the name of the compiler npm package to this option: ```javascript -{ - // Don't include an Object.assign ponyfill, we have our own - objectAssign: 'Object.assign', - // Transpile only features needed for IE11 - target: { ie: 11 }, - transforms: { - // Don't throw on ESM imports, we transpile them ourselves - modules: false, - // Enable tagged template literals for styled-components - dangerousTaggedTemplateString: true, - // to make async/await work by default (no transformation) - asyncAwait: false, - }, +module.exports = { + compilerModule: '@babel/standalone' } ``` -Styleguidist uses [Bublé](https://buble.surge.sh/guide/) to run ES6 code on the frontend. This config object will be added as the second argument for `buble.transform`. +> **Warning:** You should change [the `compileExample` option too](#compileexample) to adjust the call, and pass the options for your new compiler. + +> **Info:** See [the cookbook](Cookbook.md) to learn how to configure other compilers, like Babel or TypeScript. + +## `compilerConfig` + +This option has been deprecated, use the [`compilerModule`](#compilermodule) and [`compileExample`](#compileexample) options instead. ## `components` diff --git a/docs/Cookbook.md b/docs/Cookbook.md index 4c695d6d3..ece6a183f 100644 --- a/docs/Cookbook.md +++ b/docs/Cookbook.md @@ -602,22 +602,74 @@ module.exports = { } ``` -## How to re-use the types in Styleguidist? +## How to compile examples with Babel? + +By default, Stylegudist uses [Sucrase](https://github.com/alangpierce/sucrase/) to compiler examples’ code. To use Babel instead, you need to install [`@babel/standalone`](https://www.npmjs.com/package/@babel/standalone) as a dependency, and define [`compilerModule`](Configuration.md#compilermodule) and [`compileExample`](Configuration.md#compileexample) options: + +```js +module.exports = { + compilerModule: '@babel/standalone', + compileExample: (compiler, code) => + compiler.transform(code, { + presets: ['react', 'env'] + }).code +} +``` + +## How to compile examples with TypeScript? + +By default, Stylegudist uses [Sucrase](https://github.com/alangpierce/sucrase/) to compiler examples’ code. To use TypeScript instead, you need to install [`typescript`](https://www.npmjs.com/package/typescript) as a dependency, and define [`compilerModule`](Configuration.md#compilermodule) and [`compileExample`](Configuration.md#compileexample) options: + +```js +module.exports = { + compilerModule: 'typescript', + compileExample: (compiler, code) => { + const compiledCode = compiler.transpileModule(code, { + compilerOptions: { + target: 'ES2015', + module: 'CommonJS', + jsx: 'react', + esModuleInterop: true + } + }).outputText + return `const exports = {}; ${compiledCode}` + } +} +``` + +This works but gives a compilation warning from webpack: “Critical dependency: the request of a dependency is an expression”. We could silence it using the [`webpackConfig`](#webpackconfig) option and [`webpack-filter-warnings-plugin`](https://www.npmjs.com/package/webpack-filter-warnings-plugin): + +```js +const FilterWarningsPlugin = require('webpack-filter-warnings-plugin') +module.exports = { + webpackConfig: { + plugins: [ + new webpack.FilterWarningsPlugin({ + exclude: /Critical dependency: the request of a dependency is an expression/ + }) + ] + } +} +``` + +**Note:** If you know a better way of using TypeScript compiler, please send a pull request. + +## How to reuse TypeScript types in Styleguidist? From version 10, Styleguidist is written using TypeScript language. -It allows the maintainers to catch type mismatch before execution and gives them a better developer experience. +It allows the maintainers to catch type mismatches before code execution, and gives them better developer experience. It also allows you to write customized style guide components using TypeScript TSX instead of JavaScript JSX. -**NOTE:** Since all files in `src/client/rsg-components` are aliased to `rsg-components` using webpack, you will have to add this alias to your `tsconfig.json` file: +**Note:** Since all files in `src/client/rsg-components` are aliased as `rsg-components` using webpack, you will have to add this alias to your `tsconfig.json` file: ```json { "compilerOptions": { "baseUrl": ".", "paths": { - // remap rsg-components/anything to its version in react-styleguidist + // Remap rsg-components/anything to its version in react-styleguidist "rsg-components/*": [ "node_modules/react-styleguidist/lib/client/rsg-components/*" ] diff --git a/docs/Documenting.md b/docs/Documenting.md index d756a39e3..7a50142b2 100644 --- a/docs/Documenting.md +++ b/docs/Documenting.md @@ -222,7 +222,7 @@ Code examples in Markdown use ES6+JSX syntax. You can use the current component ```` -> **Info:** Styleguidist uses [Bublé](https://buble.surge.sh/guide/) to run ES6 code on the frontend, it supports [most of the ES6 features](https://buble.surge.sh/guide/#unsupported-features). +> **Info:** Styleguidist uses [Sucrase](https://github.com/alangpierce/sucrase/) by default to run modern ECMAScript code on the frontend. [These language features are supported](Configuration.md#compiler). To use other components, you need to explicitly `import` them: diff --git a/docs/Migration.md b/docs/Migration.md new file mode 100644 index 000000000..92760885f --- /dev/null +++ b/docs/Migration.md @@ -0,0 +1,23 @@ +# Migration guide + +## 11 to 12 + +### Remove or update `compilerConfig` config option + +Since Styleguidist is using [Sucrase](https://github.com/alangpierce/sucrase/) instead of [Bublé](https://buble.surge.sh/guide/) to compile examples’s code by default and allows you to chanage the compiler, the `compilerConfig` config option has been replaced with [`compilerModule`](Configuration.md#compilermodule) and [`compileExample`](Configuration.md#compileexample) options. + +Likely, you could remove the `compilerConfig` option. + +Otherwise, you could also keep using Bublé by installing `buble` as a dependency, and specifying the `compilerModule` option: + +```javascript +module.exports = { + compilerModule: 'buble', + compileExample: (compiler, code) => + compiler.transform(code, { + /* Bublé options */ + }).code +} +``` + +Check docs for [`compilerModule`](Configuration.md#compilermodule) and [`compileExample`](Configuration.md#compileexample) options for more details. diff --git a/package-lock.json b/package-lock.json index 6533bbb7a..4242d1889 100644 --- a/package-lock.json +++ b/package-lock.json @@ -154,7 +154,6 @@ "version": "7.9.0", "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.9.0.tgz", "integrity": "sha512-kWc7L0fw1xwvI0zi8OKVBuxRVefwGOrKSQMvrQ3dW+bIIavBY3/NpXmpjMy7bQnLgwgzWQZ8TlM57YHpHNHz4w==", - "dev": true, "requires": { "@babel/code-frame": "^7.8.3", "@babel/generator": "^7.9.0", @@ -178,7 +177,6 @@ "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", - "dev": true, "requires": { "@babel/highlight": "^7.8.3" } @@ -187,7 +185,6 @@ "version": "7.9.0", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.9.0.tgz", "integrity": "sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ==", - "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.9.0", "chalk": "^2.0.0", @@ -198,7 +195,6 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, "requires": { "ms": "^2.1.1" } @@ -207,7 +203,6 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.2.tgz", "integrity": "sha512-MoUOQ4WdiN3yxhm7NEVJSJrieAo5hNSLQ5sj05OTRHPL9HOBy8u4Bu88jsC1jvqAdN+E1bJmsUcZH+1HQxliqQ==", - "dev": true, "requires": { "minimist": "^1.2.5" } @@ -215,26 +210,22 @@ "minimist": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "dev": true + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" }, "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" } } }, @@ -242,7 +233,6 @@ "version": "7.9.4", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.9.4.tgz", "integrity": "sha512-rjP8ahaDy/ouhrvCoU1E5mqaitWrxwuNGU+dy1EpaoK48jZay4MdkskKGIMHLZNewg8sAsqpGSREJwP0zH3YQA==", - "dev": true, "requires": { "@babel/types": "^7.9.0", "jsesc": "^2.5.1", @@ -253,14 +243,12 @@ "jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", - "dev": true + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==" }, "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" } } }, @@ -497,7 +485,6 @@ "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.8.3.tgz", "integrity": "sha512-BCxgX1BC2hD/oBlIFUgOCQDOPV8nSINxCwM3o93xP4P9Fq6aV5sgv2cOOITDMtCfQ+3PvHp3l689XZvAM9QyOA==", - "dev": true, "requires": { "@babel/helper-get-function-arity": "^7.8.3", "@babel/template": "^7.8.3", @@ -508,7 +495,6 @@ "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.8.3.tgz", "integrity": "sha512-FVDR+Gd9iLjUMY1fzE2SR0IuaJToR4RkCDARVfsBBPSP53GEqSFjD8gNyxg246VUyc/ALRxFaAK8rVG7UT7xRA==", - "dev": true, "requires": { "@babel/types": "^7.8.3" } @@ -526,7 +512,6 @@ "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.8.3.tgz", "integrity": "sha512-fO4Egq88utkQFjbPrSHGmGLFqmrshs11d46WI+WZDESt7Wu7wN2G2Iu+NMMZJFDOVRHAMIkB5SNh30NtwCA7RA==", - "dev": true, "requires": { "@babel/types": "^7.8.3" } @@ -535,7 +520,6 @@ "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.8.3.tgz", "integrity": "sha512-R0Bx3jippsbAEtzkpZ/6FIiuzOURPcMjHp+Z6xPe6DtApDJx+w7UYyOLanZqO8+wKR9G10s/FmHXvxaMd9s6Kg==", - "dev": true, "requires": { "@babel/types": "^7.8.3" } @@ -544,7 +528,6 @@ "version": "7.9.0", "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.9.0.tgz", "integrity": "sha512-0FvKyu0gpPfIQ8EkxlrAydOWROdHpBmiCiRwLkUiBGhCUPRRbVD2/tm3sFr/c/GWFrQ/ffutGUAnx7V0FzT2wA==", - "dev": true, "requires": { "@babel/helper-module-imports": "^7.8.3", "@babel/helper-replace-supers": "^7.8.6", @@ -559,7 +542,6 @@ "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.8.3.tgz", "integrity": "sha512-Kag20n86cbO2AvHca6EJsvqAd82gc6VMGule4HwebwMlwkpXuVqrNRj6CkCV2sKxgi9MyAUnZVnZ6lJ1/vKhHQ==", - "dev": true, "requires": { "@babel/types": "^7.8.3" } @@ -596,7 +578,6 @@ "version": "7.8.6", "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.8.6.tgz", "integrity": "sha512-PeMArdA4Sv/Wf4zXwBKPqVj7n9UF/xg6slNRtZW84FM7JpE1CbG8B612FyM4cxrf4fMAMGO0kR7voy1ForHHFA==", - "dev": true, "requires": { "@babel/helper-member-expression-to-functions": "^7.8.3", "@babel/helper-optimise-call-expression": "^7.8.3", @@ -608,7 +589,6 @@ "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.8.3.tgz", "integrity": "sha512-VNGUDjx5cCWg4vvCTR8qQ7YJYZ+HBjxOgXEl7ounz+4Sn7+LMD3CFrCTEU6/qXKbA2nKg21CwhhBzO0RpRbdCw==", - "dev": true, "requires": { "@babel/template": "^7.8.3", "@babel/types": "^7.8.3" @@ -618,7 +598,6 @@ "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz", "integrity": "sha512-3x3yOeyBhW851hroze7ElzdkeRXQYQbFIb7gLK1WQYsw2GWDay5gAJNw1sWJ0VFP6z5J1whqeXH/WCdCjZv6dA==", - "dev": true, "requires": { "@babel/types": "^7.8.3" } @@ -626,8 +605,7 @@ "@babel/helper-validator-identifier": { "version": "7.9.0", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.0.tgz", - "integrity": "sha512-6G8bQKjOh+of4PV/ThDm/rRqlU7+IGoJuofpagU5GlEl29Vv0RGqqt86ZGRV8ZuSOY3o+8yXl5y782SMcG7SHw==", - "dev": true + "integrity": "sha512-6G8bQKjOh+of4PV/ThDm/rRqlU7+IGoJuofpagU5GlEl29Vv0RGqqt86ZGRV8ZuSOY3o+8yXl5y782SMcG7SHw==" }, "@babel/helper-wrap-function": { "version": "7.8.3", @@ -645,7 +623,6 @@ "version": "7.9.2", "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.9.2.tgz", "integrity": "sha512-JwLvzlXVPjO8eU9c/wF9/zOIN7X6h8DYf7mG4CiFRZRvZNKEF5dQ3H3V+ASkHoIB3mWhatgl5ONhyqHRI6MppA==", - "dev": true, "requires": { "@babel/template": "^7.8.3", "@babel/traverse": "^7.9.0", @@ -665,8 +642,7 @@ "@babel/parser": { "version": "7.9.4", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.4.tgz", - "integrity": "sha512-bC49otXX6N0/VYhgOMh4gnP26E9xnDZK3TmbNpxYzzz9BQLBosQwfyOe9/cXUU3txYhTzLCbcqd5c8y/OmCjHA==", - "dev": true + "integrity": "sha512-bC49otXX6N0/VYhgOMh4gnP26E9xnDZK3TmbNpxYzzz9BQLBosQwfyOe9/cXUU3txYhTzLCbcqd5c8y/OmCjHA==" }, "@babel/plugin-proposal-async-generator-functions": { "version": "7.8.3", @@ -1551,7 +1527,6 @@ "version": "7.8.6", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.6.tgz", "integrity": "sha512-zbMsPMy/v0PWFZEhQJ66bqjhH+z0JgMoBWuikXybgG3Gkd/3t5oQ1Rw2WQhnSrsOmsKXnZOx15tkC4qON/+JPg==", - "dev": true, "requires": { "@babel/code-frame": "^7.8.3", "@babel/parser": "^7.8.6", @@ -1562,7 +1537,6 @@ "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", - "dev": true, "requires": { "@babel/highlight": "^7.8.3" } @@ -1571,7 +1545,6 @@ "version": "7.9.0", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.9.0.tgz", "integrity": "sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ==", - "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.9.0", "chalk": "^2.0.0", @@ -1584,7 +1557,6 @@ "version": "7.9.0", "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.9.0.tgz", "integrity": "sha512-jAZQj0+kn4WTHO5dUZkZKhbFrqZE7K5LAQ5JysMnmvGij+wOdr+8lWqPeW0BcF4wFwrEXXtdGO7wcV6YPJcf3w==", - "dev": true, "requires": { "@babel/code-frame": "^7.8.3", "@babel/generator": "^7.9.0", @@ -1601,7 +1573,6 @@ "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", - "dev": true, "requires": { "@babel/highlight": "^7.8.3" } @@ -1610,7 +1581,6 @@ "version": "7.9.0", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.9.0.tgz", "integrity": "sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ==", - "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.9.0", "chalk": "^2.0.0", @@ -1621,7 +1591,6 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, "requires": { "ms": "^2.1.1" } @@ -1629,8 +1598,7 @@ "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" } } }, @@ -1638,7 +1606,6 @@ "version": "7.9.0", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.0.tgz", "integrity": "sha512-BS9JKfXkzzJl8RluW4JGknzpiUV7ZrvTayM6yfqLTVBEnFtyowVIOu6rqxRd5cVO6yGoWf4T8u8dgK9oB+GCng==", - "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.9.0", "lodash": "^4.17.13", @@ -3844,15 +3811,6 @@ "@types/node": "*" } }, - "@types/buble": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@types/buble/-/buble-0.19.2.tgz", - "integrity": "sha512-uUD8zIfXMKThmFkahTXDGI3CthFH1kMg2dOm3KLi4GlC5cbARA64bEcUMbbWdWdE73eoc/iBB9PiTMqH0dNS2Q==", - "dev": true, - "requires": { - "magic-string": "^0.25.0" - } - }, "@types/cheerio": { "version": "0.22.13", "resolved": "https://registry.npmjs.org/@types/cheerio/-/cheerio-0.22.13.tgz", @@ -3915,9 +3873,9 @@ "dev": true }, "@types/estree": { - "version": "0.0.39", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", - "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", + "version": "0.0.45", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.45.tgz", + "integrity": "sha512-jnqIUKDUqJbDIUxm0Uj7bnlMnRm1T/eZ9N+AVMqhPgzrba2GhGG5o/jCTwmdPK709nEZsGoMzXEDUjcXHa3W0g==", "dev": true }, "@types/events": { @@ -4660,14 +4618,9 @@ } }, "acorn": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz", - "integrity": "sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==" - }, - "acorn-dynamic-import": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-4.0.0.tgz", - "integrity": "sha512-d3OEjQV4ROpoflsnUA8HozoIR504TFxNivYEUi6uwz0IYhBkTDXGuWlNdMtybRt3nqVx/L6XqMt0FxkXuWKZhw==" + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", + "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==" }, "acorn-globals": { "version": "6.0.0", @@ -4688,9 +4641,9 @@ } }, "acorn-jsx": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.1.0.tgz", - "integrity": "sha512-tMUqwBWfLFbJbizRmEcWSLw6HnFzfdJs2sOJEOwwtVPMoH/0Ay+E703oZz78VSXZiiDcZrQ5XKjPIUQixhmgVw==" + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", + "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==" }, "acorn-walk": { "version": "7.2.0", @@ -4791,6 +4744,11 @@ "color-convert": "^1.9.0" } }, + "any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=" + }, "anymatch": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", @@ -5199,9 +5157,19 @@ "dev": true }, "ast-types": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.13.2.tgz", - "integrity": "sha512-uWMHxJxtfj/1oZClOxDEV1sQ1HCDkA4MG8Gr69KKeBjEVH0R84WlejZ0y2DcwyBlpAEMltmVYkVgqfLFb2oyiA==" + "version": "0.14.2", + "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.14.2.tgz", + "integrity": "sha512-O0yuUDnZeQDL+ncNGlJ78BiO4jnYI3bvMsD5prT0/nsgijG/LpNBIr63gTjVTNsiGkgQhiyCShTgxt8oXOrklA==", + "requires": { + "tslib": "^2.0.1" + }, + "dependencies": { + "tslib": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.3.tgz", + "integrity": "sha512-uZtkfKblCEQtZKBF6EBXVZeQNl82yqtDQdv+eck8u7tdPxjLu2/lp5/uPW+um2tpuxINHWy3GhiccY7QgEaVHQ==" + } + } }, "ast-types-flow": { "version": "0.0.7", @@ -5972,35 +5940,6 @@ "node-int64": "^0.4.0" } }, - "buble": { - "version": "0.20.0", - "resolved": "https://registry.npmjs.org/buble/-/buble-0.20.0.tgz", - "integrity": "sha512-/1gnaMQE8xvd5qsNBl+iTuyjJ9XxeaVxAMF86dQ4EyxFJOZtsgOS8Ra+7WHgZTam5IFDtt4BguN0sH0tVTKrOw==", - "requires": { - "acorn": "^6.4.1", - "acorn-dynamic-import": "^4.0.0", - "acorn-jsx": "^5.2.0", - "chalk": "^2.4.2", - "magic-string": "^0.25.7", - "minimist": "^1.2.5", - "regexpu-core": "4.5.4" - }, - "dependencies": { - "acorn-jsx": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.2.0.tgz", - "integrity": "sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==" - }, - "magic-string": { - "version": "0.25.7", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", - "integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==", - "requires": { - "sourcemap-codec": "^1.4.4" - } - } - } - }, "buffer": { "version": "4.9.2", "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz", @@ -6573,7 +6512,6 @@ "version": "1.7.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", - "dev": true, "requires": { "safe-buffer": "~5.1.1" } @@ -7999,15 +7937,22 @@ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" }, "escodegen": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.12.0.tgz", - "integrity": "sha512-TuA+EhsanGcme5T3R0L80u4t8CpbXQjegRmf7+FPTJrtCTErXFeelblRgHQa1FofEzqYYJmJ/OqjTwREp9qgmg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.0.0.tgz", + "integrity": "sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw==", "requires": { - "esprima": "^3.1.3", - "estraverse": "^4.2.0", + "esprima": "^4.0.1", + "estraverse": "^5.2.0", "esutils": "^2.0.2", "optionator": "^0.8.1", "source-map": "~0.6.1" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==" + } } }, "eslint": { @@ -8889,9 +8834,9 @@ } }, "esprima": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", - "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=" + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" }, "esquery": { "version": "1.3.1", @@ -8930,12 +8875,13 @@ "estraverse": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==" + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true }, "estree-walker": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.9.0.tgz", - "integrity": "sha512-12U47o7XHUX329+x3FzNVjCx3SHEzMF0nkDv7r/HnBzX/xNTKxajBk6gyygaxrAFtLj39219oMfbtxv4KpaOiA==" + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.1.tgz", + "integrity": "sha512-tF0hv+Yi2Ot1cwj9eYHtxC0jB9bmjacjQs6ZBTj82H8JwUywFuc+7E83NWfNMwHXZc11mjfFcVXPe9gEP4B8dg==" }, "esutils": { "version": "2.0.3", @@ -10218,8 +10164,7 @@ "gensync": { "version": "1.0.0-beta.1", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.1.tgz", - "integrity": "sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg==", - "dev": true + "integrity": "sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg==" }, "get-caller-file": { "version": "2.0.5", @@ -15837,7 +15782,8 @@ "jsesc": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", - "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=" + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", + "dev": true }, "json-parse-better-errors": { "version": "1.0.2", @@ -16068,8 +16014,7 @@ "lines-and-columns": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", - "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", - "dev": true + "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=" }, "lint-staged": { "version": "10.5.1", @@ -16655,15 +16600,6 @@ "integrity": "sha1-wNjq82BZ9wV5bh40SBHPTEmNOiY=", "dev": true }, - "magic-string": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.4.tgz", - "integrity": "sha512-oycWO9nEVAP2RVPbIoDoA4Y7LFIJ3xRYov93gAyJhZkET1tNuB0u7uWkZS2LpBWTJUWnmau/To8ECWRC+jKNfw==", - "dev": true, - "requires": { - "sourcemap-codec": "^1.4.4" - } - }, "make-dir": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", @@ -17210,6 +17146,16 @@ "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==" }, + "mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "requires": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } + }, "nan": { "version": "2.14.0", "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", @@ -17275,8 +17221,7 @@ "neo-async": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", - "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", - "dev": true + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==" }, "nice-try": { "version": "1.0.5", @@ -17359,8 +17304,7 @@ "node-modules-regexp": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz", - "integrity": "sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA=", - "dev": true + "integrity": "sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA=" }, "node-notifier": { "version": "8.0.0", @@ -17653,16 +17597,16 @@ } }, "optionator": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", - "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", "requires": { "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.4", + "fast-levenshtein": "~2.0.6", "levn": "~0.3.0", "prelude-ls": "~1.1.2", "type-check": "~0.3.2", - "wordwrap": "~1.0.0" + "word-wrap": "~1.2.3" } }, "ora": { @@ -17994,7 +17938,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.1.tgz", "integrity": "sha512-WuNqLTbMI3tmfef2TKxlQmAiLHKtFhlsCZnPIpuv2Ow0RDVO8lfy1Opf4NUzlMXLjPl+Men7AuVdX6TA+s+uGA==", - "dev": true, "requires": { "node-modules-regexp": "^1.0.0" } @@ -18692,135 +18635,34 @@ } }, "react-docgen": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/react-docgen/-/react-docgen-5.0.0.tgz", - "integrity": "sha512-fToU6m0Cvx+L937lfx453/6RNUuxAq2BMop17c8juUJIwKZey3L5M2ZojawgMVnZYkJDBs0hVfHU9W7CaDUNGg==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/react-docgen/-/react-docgen-5.3.0.tgz", + "integrity": "sha512-hUrv69k6nxazOuOmdGeOpC/ldiKy7Qj/UFpxaQi0eDMrUFUTIPGtY5HJu7BggSmiyAMfREaESbtBL9UzdQ+hyg==", "requires": { "@babel/core": "^7.7.5", "@babel/runtime": "^7.7.6", "ast-types": "^0.13.2", - "async": "^2.1.4", "commander": "^2.19.0", "doctrine": "^3.0.0", + "neo-async": "^2.6.1", "node-dir": "^0.1.10", "strip-indent": "^3.0.0" }, "dependencies": { - "@babel/core": { - "version": "7.7.5", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.7.5.tgz", - "integrity": "sha512-M42+ScN4+1S9iB6f+TL7QBpoQETxbclx+KNoKJABghnKYE+fMzSGqst0BZJc8CpI625bwPwYgUyRvxZ+0mZzpw==", - "requires": { - "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.7.4", - "@babel/helpers": "^7.7.4", - "@babel/parser": "^7.7.5", - "@babel/template": "^7.7.4", - "@babel/traverse": "^7.7.4", - "@babel/types": "^7.7.4", - "convert-source-map": "^1.7.0", - "debug": "^4.1.0", - "json5": "^2.1.0", - "lodash": "^4.17.13", - "resolve": "^1.3.2", - "semver": "^5.4.1", - "source-map": "^0.5.0" - } - }, - "@babel/generator": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.7.4.tgz", - "integrity": "sha512-m5qo2WgdOJeyYngKImbkyQrnUN1mPceaG5BV+G0E3gWsa4l/jCSryWJdM2x8OuGAOyh+3d5pVYfZWCiNFtynxg==", - "requires": { - "@babel/types": "^7.7.4", - "jsesc": "^2.5.1", - "lodash": "^4.17.13", - "source-map": "^0.5.0" - } - }, - "@babel/helper-function-name": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.7.4.tgz", - "integrity": "sha512-AnkGIdiBhEuiwdoMnKm7jfPfqItZhgRaZfMg1XX3bS25INOnLPjPG1Ppnajh8eqgt5kPJnfqrRHqFqmjKDZLzQ==", - "requires": { - "@babel/helper-get-function-arity": "^7.7.4", - "@babel/template": "^7.7.4", - "@babel/types": "^7.7.4" - } - }, - "@babel/helper-get-function-arity": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.4.tgz", - "integrity": "sha512-QTGKEdCkjgzgfJ3bAyRwF4yyT3pg+vDgan8DSivq1eS0gwi+KGKE5x8kRcbeFTb/673mkO5SN1IZfmCfA5o+EA==", - "requires": { - "@babel/types": "^7.7.4" - } - }, - "@babel/helper-split-export-declaration": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.4.tgz", - "integrity": "sha512-guAg1SXFcVr04Guk9eq0S4/rWS++sbmyqosJzVs8+1fH5NI+ZcmkaSkc7dmtAFbHFva6yRJnjW3yAcGxjueDug==", - "requires": { - "@babel/types": "^7.7.4" - } - }, - "@babel/helpers": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.7.4.tgz", - "integrity": "sha512-ak5NGZGJ6LV85Q1Zc9gn2n+ayXOizryhjSUBTdu5ih1tlVCJeuQENzc4ItyCVhINVXvIT/ZQ4mheGIsfBkpskg==", - "requires": { - "@babel/template": "^7.7.4", - "@babel/traverse": "^7.7.4", - "@babel/types": "^7.7.4" - } - }, - "@babel/parser": { - "version": "7.7.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.5.tgz", - "integrity": "sha512-KNlOe9+/nk4i29g0VXgl8PEXIRms5xKLJeuZ6UptN0fHv+jDiriG+y94X6qAgWTR0h3KaoM1wK5G5h7MHFRSig==" - }, "@babel/runtime": { - "version": "7.7.6", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.7.6.tgz", - "integrity": "sha512-BWAJxpNVa0QlE5gZdWjSxXtemZyZ9RmrmVozxt3NUXeZhVIJ5ANyqmMc0JDrivBZyxUuQvFxlvH4OWWOogGfUw==", - "requires": { - "regenerator-runtime": "^0.13.2" - } - }, - "@babel/template": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.7.4.tgz", - "integrity": "sha512-qUzihgVPguAzXCK7WXw8pqs6cEwi54s3E+HrejlkuWO6ivMKx9hZl3Y2fSXp9i5HgyWmj7RKP+ulaYnKM4yYxw==", + "version": "7.11.2", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.11.2.tgz", + "integrity": "sha512-TeWkU52so0mPtDcaCTxNBI/IHiz0pZgr8VEFqXFtZWpYD08ZB6FaSwVAS8MKRQAP3bYKiVjwysOJgMFY28o6Tw==", "requires": { - "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.7.4", - "@babel/types": "^7.7.4" - } - }, - "@babel/traverse": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.7.4.tgz", - "integrity": "sha512-P1L58hQyupn8+ezVA2z5KBm4/Zr4lCC8dwKCMYzsa5jFMDMQAzaBNy9W5VjB+KAmBjb40U7a/H6ao+Xo+9saIw==", - "requires": { - "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.7.4", - "@babel/helper-function-name": "^7.7.4", - "@babel/helper-split-export-declaration": "^7.7.4", - "@babel/parser": "^7.7.4", - "@babel/types": "^7.7.4", - "debug": "^4.1.0", - "globals": "^11.1.0", - "lodash": "^4.17.13" + "regenerator-runtime": "^0.13.4" } }, - "@babel/types": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.4.tgz", - "integrity": "sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA==", + "ast-types": { + "version": "0.13.4", + "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.13.4.tgz", + "integrity": "sha512-x1FCFnFifvYDDzTaLII71vG5uvDwgtmDTEVWAxrgeiR8VjMONcCXJx7E+USjDtHlwFmt9MysbqgF9b9Vjr6w+w==", "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" + "tslib": "^2.0.1" } }, "commander": { @@ -18828,49 +18670,15 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" }, - "convert-source-map": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", - "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", - "requires": { - "safe-buffer": "~5.1.1" - } - }, - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "requires": { - "ms": "^2.1.1" - } - }, - "jsesc": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==" - }, - "json5": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.1.tgz", - "integrity": "sha512-l+3HXD0GEI3huGq1njuqtzYK8OYJyXMkOLtQ53pjWh89tvWS2h6l+1zMkYWqlb57+SiQodKZyvMEFb2X+KrFhQ==", - "requires": { - "minimist": "^1.2.0" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + "regenerator-runtime": { + "version": "0.13.7", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz", + "integrity": "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==" }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" + "tslib": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.2.tgz", + "integrity": "sha512-wAH28hcEKwna96/UacuWaVspVLkg4x1aDM9JlzqaQTOFczCktkVAb5fmXChgandR1EraDPs2w8P+ozM+oafwxg==" } } }, @@ -18880,11 +18688,11 @@ "integrity": "sha512-0rNR0SZAjd4eHTYP3Iq/pi0zTznHtXSLAKOXbK6tGjwd9bTaXUaKQK7hihRvGvqxNjUy0WGTcFgX+lT64vIXBg==" }, "react-docgen-displayname-handler": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/react-docgen-displayname-handler/-/react-docgen-displayname-handler-3.0.0.tgz", - "integrity": "sha512-nS/sgx8Oo7s0SJUfWRx3wQ4xCneIKONbhNvyuVmgWEOhvfm1ODHbaB1qhyQQ/1AcbIeo/wZAEyapne8yVX0NmQ==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/react-docgen-displayname-handler/-/react-docgen-displayname-handler-3.0.2.tgz", + "integrity": "sha512-6SDJ2h6WuW0Kq6Vw34C3WmRfh1eYNDkaes9hxsmQ4fmX5tiI2lpR28J2cxlu4RpYrqBLrrtke6kWBef7pIL24w==", "requires": { - "ast-types": "0.13.2" + "ast-types": "0.14.2" } }, "react-dom": { @@ -19037,25 +18845,29 @@ } }, "recast": { - "version": "0.18.5", - "resolved": "https://registry.npmjs.org/recast/-/recast-0.18.5.tgz", - "integrity": "sha512-sD1WJrpLQAkXGyQZyGzTM75WJvyAd98II5CHdK3IYbt/cZlU0UzCRVU11nUFNXX9fBVEt4E9ajkMjBlUlG+Oog==", + "version": "0.20.3", + "resolved": "https://registry.npmjs.org/recast/-/recast-0.20.3.tgz", + "integrity": "sha512-jrEPzRV5B7wfRiN0UYMtjgIx1Hp8MRHdLcMYqMNd0DoOe1CB5JmPL/04I7WPuuApCs7LCSisYK/FfKnPEaJrzw==", "requires": { - "ast-types": "0.13.2", + "ast-types": "0.14.1", "esprima": "~4.0.0", "private": "^0.1.8", - "source-map": "~0.6.1" + "source-map": "~0.6.1", + "tslib": "^2.0.1" }, "dependencies": { "ast-types": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.13.2.tgz", - "integrity": "sha512-uWMHxJxtfj/1oZClOxDEV1sQ1HCDkA4MG8Gr69KKeBjEVH0R84WlejZ0y2DcwyBlpAEMltmVYkVgqfLFb2oyiA==" + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.14.1.tgz", + "integrity": "sha512-pfSiukbt23P1qMhNnsozLzhMLBs7EEeXqPyvPmnuZM+RMfwfqwDbSVKYflgGuVI7/VehR4oMks0igzdNAg4VeQ==", + "requires": { + "tslib": "^2.0.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==" + "tslib": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.2.tgz", + "integrity": "sha512-wAH28hcEKwna96/UacuWaVspVLkg4x1aDM9JlzqaQTOFczCktkVAb5fmXChgandR1EraDPs2w8P+ozM+oafwxg==" } } }, @@ -19086,15 +18898,8 @@ "regenerate": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", - "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==" - }, - "regenerate-unicode-properties": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.2.0.tgz", - "integrity": "sha512-F9DjY1vKLo/tPePDycuH3dn9H1OTPIkVD9Kz4LODu+F2C75mgjAJ7x/gwy6ZcSNRAAkhNlJSOHRe8k3p+K9WhA==", - "requires": { - "regenerate": "^1.4.0" - } + "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==", + "dev": true }, "regenerator-runtime": { "version": "0.13.3", @@ -19205,31 +19010,11 @@ "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", "dev": true }, - "regexpu-core": { - "version": "4.5.4", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.5.4.tgz", - "integrity": "sha512-BtizvGtFQKGPUcTy56o3nk1bGRp4SZOTYrDtGNlqCQufptV5IkkLN6Emw+yunAJjzf+C9FQFtvq7IoA3+oMYHQ==", - "requires": { - "regenerate": "^1.4.0", - "regenerate-unicode-properties": "^8.0.2", - "regjsgen": "^0.5.0", - "regjsparser": "^0.6.0", - "unicode-match-property-ecmascript": "^1.0.4", - "unicode-match-property-value-ecmascript": "^1.1.0" - } - }, "regjsgen": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.1.tgz", - "integrity": "sha512-5qxzGZjDs9w4tzT3TPhCJqWdCc3RLYwy9J2NB0nm5Lz+S273lvWcpjaTGHsT1dc6Hhfq41uSEOw8wBmxrKOuyg==" - }, - "regjsparser": { - "version": "0.6.4", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.4.tgz", - "integrity": "sha512-64O87/dPDgfk8/RQqC4gkZoGyyWFIEUTTh80CU6CWuK5vkCGyekIx+oKcEIYtP/RAxSQltCZHCNu/mdd7fqlJw==", - "requires": { - "jsesc": "~0.5.0" - } + "integrity": "sha512-5qxzGZjDs9w4tzT3TPhCJqWdCc3RLYwy9J2NB0nm5Lz+S273lvWcpjaTGHsT1dc6Hhfq41uSEOw8wBmxrKOuyg==", + "dev": true }, "remark": { "version": "13.0.0", @@ -20084,11 +19869,6 @@ "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=" }, - "sourcemap-codec": { - "version": "1.4.6", - "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.6.tgz", - "integrity": "sha512-1ZooVLYFxC448piVLBbtOxFcXwnymH9oUF8nRd3CuYDVvkRBxRl6pB4Mtas5a4drtL+E8LDgFkQNcgIw6tc8Hg==" - }, "sparkles": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/sparkles/-/sparkles-1.0.1.tgz", @@ -20764,6 +20544,39 @@ } } }, + "sucrase": { + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.15.0.tgz", + "integrity": "sha512-05TJOUfMgckH7wKqfk/1p4G6q16nIeW/GHQwD44vkT0mQMqqzgfHCwkX3whNmwyOo7nVF0jDLwVu/qOBTtsscw==", + "requires": { + "commander": "^4.0.0", + "glob": "7.1.6", + "lines-and-columns": "^1.1.6", + "mz": "^2.7.0", + "pirates": "^4.0.1", + "ts-interface-checker": "^0.1.9" + }, + "dependencies": { + "commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==" + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "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" + } + } + } + }, "supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -21125,6 +20938,15 @@ "ajv-keywords": "^3.5.2" } }, + "source-map-support": { + "version": "0.5.19", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", + "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, "ssri": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.0.tgz", @@ -21156,6 +20978,22 @@ "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=" }, + "thenify": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "requires": { + "any-promise": "^1.0.0" + } + }, + "thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY=", + "requires": { + "thenify": ">= 3.1.0 < 4" + } + }, "throat": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/throat/-/throat-5.0.0.tgz", @@ -21330,6 +21168,11 @@ "resolved": "https://registry.npmjs.org/trough/-/trough-1.0.5.tgz", "integrity": "sha512-rvuRbTarPXmMb79SmzEp8aqXNKcK+y0XaB298IXueQ8I2PsrATcPBCSPyK/dDNa2iWOhKlfNnOjdAOTBU/nkFA==" }, + "ts-interface-checker": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", + "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==" + }, "tsconfig-paths": { "version": "3.9.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz", @@ -21429,26 +21272,24 @@ "unicode-canonical-property-names-ecmascript": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", - "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==" + "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==", + "dev": true }, "unicode-match-property-ecmascript": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz", "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==", + "dev": true, "requires": { "unicode-canonical-property-names-ecmascript": "^1.0.4", "unicode-property-aliases-ecmascript": "^1.0.4" } }, - "unicode-match-property-value-ecmascript": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.2.0.tgz", - "integrity": "sha512-wjuQHGQVofmSJv1uVISKLE5zO2rNGzM/KCYZch/QQvez7C1hUhBIuZ701fYXExuufJFMPhv2SyL8CyoIfMLbIQ==" - }, "unicode-property-aliases-ecmascript": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.0.5.tgz", - "integrity": "sha512-L5RAqCfXqAwR3RriF8pM0lU0w4Ryf/GgzONwi6KnL1taJQa7x1TCxdJnILX59WIGOwR57IVxn7Nej0fz1Ny6fw==" + "integrity": "sha512-L5RAqCfXqAwR3RriF8pM0lU0w4Ryf/GgzONwi6KnL1taJQa7x1TCxdJnILX59WIGOwR57IVxn7Nej0fz1Ny6fw==", + "dev": true }, "unified": { "version": "9.2.0", @@ -22471,13 +22312,7 @@ "word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", - "dev": true - }, - "wordwrap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=" + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==" }, "worker-farm": { "version": "1.7.0", diff --git a/package.json b/package.json index bc78faf7b..9074196bb 100644 --- a/package.json +++ b/package.json @@ -31,10 +31,9 @@ "@tippyjs/react": "4.1.0", "@vxna/mini-html-webpack-template": "^2.0.0", "assert": "1.5.0", - "acorn": "^6.4.1", - "acorn-jsx": "^5.1.0", - "ast-types": "~0.13.2", - "buble": "0.20.0", + "acorn": "^6.4.2", + "acorn-jsx": "^5.3.1", + "ast-types": "~0.14.2", "clean-webpack-plugin": "^3.0.0", "clipboard-copy": "^3.1.0", "clsx": "^1.0.4", @@ -44,8 +43,8 @@ "doctrine": "^3.0.0", "es6-object-assign": "~1.1.0", "es6-promise": "^4.2.8", - "escodegen": "^1.12.0", - "estree-walker": "~0.9.0", + "escodegen": "^2.0.0", + "estree-walker": "~2.0.1", "fastest-levenshtein": "^1.0.9", "findup": "^0.1.5", "function.name-polyfill": "^1.0.6", @@ -76,16 +75,17 @@ "q-i": "^2.0.1", "qss": "^2.0.3", "react-dev-utils": "^11.0.0", - "react-docgen": "^5.0.0", + "react-docgen": "^5.3.0", "react-docgen-annotation-resolver": "^2.0.0", - "react-docgen-displayname-handler": "^3.0.0", + "react-docgen-displayname-handler": "^3.0.2", "react-group": "^3.0.2", "react-icons": "^3.8.0", "react-simple-code-editor": "^0.10.0", - "recast": "~0.18.5", + "recast": "~0.20.3", "remark": "^13.0.0", "strip-html-comments": "^1.0.0", - "terser-webpack-plugin": "^4.1.0", + "sucrase": "^3.15.0", + "terser-webpack-plugin": "^4.2.3", "to-ast": "^1.0.0", "type-detect": "^4.0.8", "unist-util-visit": "^2.0.0", @@ -106,12 +106,11 @@ "@babel/preset-typescript": "^7.9.0", "@testing-library/jest-dom": "^5.11.4", "@testing-library/react": "^11.1.0", - "@types/buble": "^0.19.2", "@types/copy-webpack-plugin": "^5.0.2", "@types/doctrine": "0.0.3", "@types/enzyme": "^3.10.3", "@types/escodegen": "0.0.6", - "@types/estree": "^0.0.39", + "@types/estree": "^0.0.45", "@types/hash-sum": "^1.0.0", "@types/jest": "^26.0.14", "@types/keymirror": "^0.1.1", @@ -147,6 +146,7 @@ "eslint-plugin-import": "^2.22.1", "eslint-plugin-jsx-a11y": "^6.3.1", "eslint-plugin-react": "^7.21.4", + "express": "^4.17.1", "file-loader": "^4.2.0", "fs-extra": "^9.0.0", "husky": "^4.3.0", @@ -192,12 +192,10 @@ "test:browser:basic": "node test/browser.js examples/basic/styleguide/index.html", "test:browser:customised": "node test/browser.js examples/customised/styleguide/index.html", "test:browser:sections": "node test/browser.js examples/sections/styleguide/index.html", - "format": "prettier --loglevel warn --write \"**/*.{js,md}\"", - "test:cypress:pre": "npm i --no-save cypress@3.0.2 wait-on", - "test:cypress:open": "cypress open", - "test:cypress:run": "cypress run", - "test:cypress:startServer": "node test/run.server.js", - "test:cypress:startServer:post": "wait-on http://localhost:8082" + "format": "prettier --loglevel warn --write \"**/*.{js,md,css}\"", + "test:cypress:pre": "npm i --no-save cypress@5.2 start-server-and-test", + "test:cypress:run": "start-server-and-test 'node test/run.server.js' 8082 'cypress open'", + "test:cypress:ci": "start-server-and-test 'node test/run.server.js' 8082 'cypress run --browser chrome --headless'" }, "jest": { "testURL": "http://localhost/", @@ -211,6 +209,9 @@ "modulePaths": [ "./src/client" ], + "moduleNameMapper": { + "rsg-compiler": "sucrase" + }, "testPathIgnorePatterns": [ "/lib/", "/examples/", diff --git a/src/bin/styleguidist.js b/src/bin/styleguidist.js index d4b83f81d..f94ef2f45 100755 --- a/src/bin/styleguidist.js +++ b/src/bin/styleguidist.js @@ -124,7 +124,8 @@ function commandServer() { if (err) { console.error(err); } else { - const isHttps = compiler.options.devServer && compiler.options.devServer.https; + const { devServer = {} } = compiler.options; + const isHttps = !!devServer.https; const urls = webpackDevServerUtils.prepareUrls( isHttps ? 'https' : 'http', config.serverHost, diff --git a/src/client/rsg-components/Examples/Examples.spec.tsx b/src/client/rsg-components/Examples/Examples.spec.tsx index 52d0a14b3..9a80d3789 100644 --- a/src/client/rsg-components/Examples/Examples.spec.tsx +++ b/src/client/rsg-components/Examples/Examples.spec.tsx @@ -4,9 +4,12 @@ import Examples from '.'; import Context from '../Context'; import slots from '../slots'; import { DisplayModes } from '../../consts'; +import config from '../../../scripts/schemas/config'; import * as Rsg from '../../../typings'; -const evalInContext = (a: string): (() => any) => +const compileExample = config.compileExample.default; + +const evalInContext = (a: string) => // eslint-disable-next-line no-new-func new Function('require', 'const React = require("react");' + a).bind(null, require); @@ -25,6 +28,7 @@ const examples: Rsg.Example[] = [ const context = { config: { previewDelay: 0, + compileExample, }, codeRevision: 1, displayMode: DisplayModes.example, @@ -44,11 +48,12 @@ test('should render examples', () => { }); test('should not render an example with unknown type', () => { + // This code is wrong on purpose so we force the type const faultyExample = [ - { + ({ type: 'unknown', content: 'FooBar', - } as any, + } as unknown) as Rsg.Example, ]; const { getByTestId } = render( diff --git a/src/client/rsg-components/Playground/Playground.spec.tsx b/src/client/rsg-components/Playground/Playground.spec.tsx index d263443c4..13c810b5c 100644 --- a/src/client/rsg-components/Playground/Playground.spec.tsx +++ b/src/client/rsg-components/Playground/Playground.spec.tsx @@ -3,10 +3,14 @@ import { render, fireEvent } from '@testing-library/react'; import Playground from './Playground'; import slots from '../slots'; import Context from '../Context'; +import config from '../../../scripts/schemas/config'; + +const compileExample = config.compileExample.default; const evalInContext = (a: string) => // eslint-disable-next-line no-new-func new Function('require', 'const React = require("react");' + a).bind(null, require); + const code = ''; const newCode = ''; const defaultProps = { @@ -20,6 +24,7 @@ const defaultProps = { const context = { config: { previewDelay: 0, + compileExample, }, codeRevision: 0, slots: slots(), diff --git a/src/client/rsg-components/Preview/Preview.spec.tsx b/src/client/rsg-components/Preview/Preview.spec.tsx index 849d67eae..5e937d2c7 100644 --- a/src/client/rsg-components/Preview/Preview.spec.tsx +++ b/src/client/rsg-components/Preview/Preview.spec.tsx @@ -3,6 +3,9 @@ import { mount } from 'enzyme'; import { render } from '@testing-library/react'; import Preview from '.'; import Context, { StyleGuideContextContents } from '../Context'; +import config from '../../../scripts/schemas/config'; + +const compileExample = config.compileExample.default; /* eslint-disable no-console */ @@ -17,7 +20,7 @@ const newCode = ''; const context = { config: { - compilerConfig: {}, + compileExample, }, codeRevision: 0, } as StyleGuideContextContents; @@ -59,7 +62,7 @@ it('should not fail when Wrapper wasn’t mounted', () => { const node = getByTestId('mountNode'); expect( - consoleError.mock.calls.find(call => + consoleError.mock.calls.find((call) => call[0].toString().includes('ReferenceError: pizza is not defined') ) ).toBeTruthy(); @@ -123,7 +126,7 @@ it('should handle errors', () => { ); expect( - consoleError.mock.calls.find(call => + consoleError.mock.calls.find((call) => call[0].toString().includes('SyntaxError: Unexpected token') ) ).toBeTruthy(); diff --git a/src/client/rsg-components/Preview/Preview.tsx b/src/client/rsg-components/Preview/Preview.tsx index 71555f8be..6c9d0cef8 100644 --- a/src/client/rsg-components/Preview/Preview.tsx +++ b/src/client/rsg-components/Preview/Preview.tsx @@ -5,12 +5,6 @@ import PlaygroundError from 'rsg-components/PlaygroundError'; import ReactExample from 'rsg-components/ReactExample'; import Context from 'rsg-components/Context'; -const improveErrorMessage = (message: string) => - message.replace( - 'Check the render method of `StateHolder`.', - 'Check the code of your example in a Markdown file or in the editor below.' - ); - interface PreviewProps { code: string; evalInContext(code: string): () => any; @@ -79,7 +73,7 @@ export default class Preview extends Component { code={code} evalInContext={this.props.evalInContext} onError={this.handleError} - compilerConfig={this.context.config.compilerConfig} + compileExample={this.context.config.compileExample} /> ); @@ -97,7 +91,7 @@ export default class Preview extends Component { this.unmountPreview(); this.setState({ - error: improveErrorMessage(err.toString()), + error: err.toString(), }); console.error(err); // eslint-disable-line no-console @@ -107,7 +101,7 @@ export default class Preview extends Component { const { error } = this.state; return ( <> -
(this.mountNode = ref)} /> +
(this.mountNode = ref)} /> {error && } ); diff --git a/src/client/rsg-components/ReactComponent/ReactComponent.spec.tsx b/src/client/rsg-components/ReactComponent/ReactComponent.spec.tsx index a188cb36f..6b6be6f70 100644 --- a/src/client/rsg-components/ReactComponent/ReactComponent.spec.tsx +++ b/src/client/rsg-components/ReactComponent/ReactComponent.spec.tsx @@ -5,10 +5,14 @@ import slots from '../slots'; import Context from '../Context'; import { DisplayModes } from '../../consts'; import * as Rsg from '../../../typings'; +import config from '../../../scripts/schemas/config'; + +const compileExample = config.compileExample.default; const context = { config: { pagePerSection: false, + compileExample, }, displayMode: DisplayModes.all, slots: slots(), diff --git a/src/client/rsg-components/ReactExample/ReactExample.spec.tsx b/src/client/rsg-components/ReactExample/ReactExample.spec.tsx index 0de3acc8d..1142afe5f 100644 --- a/src/client/rsg-components/ReactExample/ReactExample.spec.tsx +++ b/src/client/rsg-components/ReactExample/ReactExample.spec.tsx @@ -1,16 +1,24 @@ import React from 'react'; import { shallow, mount } from 'enzyme'; -import noop from 'lodash/noop'; +import config from '../../../scripts/schemas/config'; import ReactExample from '.'; -const evalInContext = (a: string): (() => any) => +const compileExample = config.compileExample.default; + +// TODO: Enzyme → RTL + +const evalInContext = (a: string) => // eslint-disable-next-line no-new-func new Function('require', 'const React = require("react");' + a).bind(null, require); +const defaultProps = { + evalInContext, + onError: () => {}, + compileExample, +}; + it('should render code', () => { - const actual = shallow( - OK'} evalInContext={evalInContext} onError={noop} /> - ); + const actual = shallow(OK'} />); expect(actual).toMatchSnapshot(); }); @@ -18,7 +26,7 @@ it('should render code', () => { it('should wrap code in Fragment when it starts with <', () => { const actual = mount(
- +
); @@ -28,7 +36,7 @@ it('should wrap code in Fragment when it starts with <', () => { it('should handle errors', () => { const onError = jest.fn(); - shallow(); + shallow(); expect(onError).toHaveBeenCalledTimes(1); }); @@ -38,7 +46,7 @@ it('should set initial state with hooks', () => { const [count, setCount] = React.useState(0); `; - const actual = mount(); + const actual = mount(); expect(actual.find('button').text()).toEqual('0'); }); @@ -48,7 +56,7 @@ it('should update state with hooks', () => { const [count, setCount] = React.useState(0); `; - const actual = mount(); + const actual = mount(); actual.find('button').simulate('click'); expect(actual.find('button').text()).toEqual('1'); diff --git a/src/client/rsg-components/ReactExample/ReactExample.tsx b/src/client/rsg-components/ReactExample/ReactExample.tsx index a03f9d970..fb09d9f1e 100644 --- a/src/client/rsg-components/ReactExample/ReactExample.tsx +++ b/src/client/rsg-components/ReactExample/ReactExample.tsx @@ -1,17 +1,14 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { TransformOptions } from 'buble'; import Wrapper from 'rsg-components/Wrapper'; import compileCode from '../../utils/compileCode'; -import splitExampleCode from '../../utils/splitExampleCode'; - -/* eslint-disable react/no-multi-comp */ +import * as Rsg from '../../../typings'; interface ReactExampleProps { code: string; - evalInContext(code: string): () => any; + evalInContext(code: string): React.ComponentType; onError(err: Error): void; - compilerConfig?: TransformOptions; + compileExample: Rsg.SanitizedStyleguidistConfig['compileExample']; } export default class ReactExample extends Component { @@ -19,29 +16,33 @@ export default class ReactExample extends Component { code: PropTypes.string.isRequired, evalInContext: PropTypes.func.isRequired, onError: PropTypes.func.isRequired, - compilerConfig: PropTypes.object, + compileExample: PropTypes.func.isRequired, }; public shouldComponentUpdate(nextProps: ReactExampleProps) { return this.props.code !== nextProps.code; } - // Run example code and return the last top-level expression - private getExampleComponent(compiledCode: string): () => any { - return this.props.evalInContext(` - ${compiledCode} - `); + private compileCode() { + const { code, compileExample, onError } = this.props; + try { + return compileCode(code, compileExample, onError); + } catch (err) { + if (onError) { + onError(err); + } + return ''; + } } public render() { - const { code, compilerConfig = {}, onError } = this.props; - const compiledCode = compileCode(code, compilerConfig, onError); + const compiledCode = this.compileCode(); if (!compiledCode) { return null; } - const { example } = splitExampleCode(compiledCode); - const ExampleComponent = this.getExampleComponent(example); + const { onError, evalInContext } = this.props; + const ExampleComponent = evalInContext(compiledCode); const wrappedComponent = ( diff --git a/src/client/rsg-components/StyleGuide/StyleGuide.spec.tsx b/src/client/rsg-components/StyleGuide/StyleGuide.spec.tsx index 3a129abf4..2a48bbffa 100644 --- a/src/client/rsg-components/StyleGuide/StyleGuide.spec.tsx +++ b/src/client/rsg-components/StyleGuide/StyleGuide.spec.tsx @@ -77,7 +77,7 @@ test('should render a sidebar if showSidebar is not set', () => { 'http://localhost/#foo', 'http://localhost/#bar', ]); - expect(links.map(node => node.textContent)).toEqual(['Foo', 'Bar']); + expect(links.map((node) => node.textContent)).toEqual(['Foo', 'Bar']); }); test('should not render a sidebar if showSidebar is false', () => { diff --git a/src/client/utils/__tests__/compileCode.spec.ts b/src/client/utils/__tests__/compileCode.spec.ts index 84c2f64a2..58f2fcdaf 100644 --- a/src/client/utils/__tests__/compileCode.spec.ts +++ b/src/client/utils/__tests__/compileCode.spec.ts @@ -1,36 +1,40 @@ import compileCode from '../compileCode'; import config from '../../../scripts/schemas/config'; -const compilerConfig = config.compilerConfig.default; +const compileExample = config.compileExample.default; describe('compileCode', () => { - test('compile ES6 to ES5', () => { - const result = compileCode(`const {foo, bar} = baz`, compilerConfig); + test('strips TypeScript type annotations', () => { + const result = compileCode( + `const x = (y: number): number => y; console.log(x(1))`, + compileExample + ); expect(result).toMatchInlineSnapshot(` -"var foo = baz.foo; -var bar = baz.bar;" -`); + "\\"use strict\\";const x = (y) => y; + return (console.log(x(1)));" + `); }); test('transform imports to require()', () => { - const result = compileCode(`import foo from 'bar'`, compilerConfig); + const result = compileCode(`import foo from 'bar'; foo()`, compileExample); expect(result).toMatchInlineSnapshot(` -"const bar$0 = require('bar'); -const foo = bar$0.default || bar$0;" -`); + "\\"use strict\\"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _bar = require('bar'); var _bar2 = _interopRequireDefault(_bar); + return (_bar2.default.call(void 0, ));" + `); }); test('transform async/await is not throw an error', () => { const onError = jest.fn(); const result = compileCode( - `async function asyncFunction() { return await Promise.resolve(); }`, - compilerConfig, + `async function asyncFunction() { return await Promise.resolve(); }; asyncFunction()`, + compileExample, onError ); expect(onError).not.toHaveBeenCalled(); - expect(result).toMatchInlineSnapshot( - `"async function asyncFunction() { return await Promise.resolve(); }"` - ); + expect(result).toMatchInlineSnapshot(` + "\\"use strict\\";async function asyncFunction() { return await Promise.resolve(); }; + return (asyncFunction());" + `); }); test('transform imports to require() in front of JSX', () => { @@ -39,16 +43,14 @@ const foo = bar$0.default || bar$0;" import foo from 'bar'; import Button from 'button';
`, - compilerConfig + compileExample ); expect(result).toMatchInlineSnapshot(` -"React.createElement( React.Fragment, null, React.createElement( 'div', null, - React.createElement( 'button', null, \\"Click\\" ) -) );" -`); + "\\"use strict\\";const _jsxFileName = \\"\\"; + return (React.createElement(React.Fragment, {__self: this, __source: {fileName: _jsxFileName, lineNumber: 1}}, React.createElement('div', {__self: this, __source: {fileName: _jsxFileName, lineNumber: 1}} + , React.createElement('button', {__self: this, __source: {fileName: _jsxFileName, lineNumber: 2}}, \\"Click\\") + )));" + `); }); test('don’t wrap JSX in Fragment if it’s in the middle', () => { @@ -71,15 +74,14 @@ React.createElement( Button, null )"
`, - compilerConfig + compileExample ); expect(result).toMatchInlineSnapshot(` -"var foo = baz.foo; -var bar = baz.bar; -React.createElement( 'div', null, - React.createElement( 'button', null, \\"Click\\" ) -)" -`); + "\\"use strict\\";const _jsxFileName = \\"\\";const {foo, bar} = baz; + return (React.createElement('div', {__self: this, __source: {fileName: _jsxFileName, lineNumber: 2}} + , React.createElement('button', {__self: this, __source: {fileName: _jsxFileName, lineNumber: 3}}, \\"Click\\") + ));" + `); }); test('tagged template literals', () => { @@ -89,22 +91,21 @@ React.createElement( 'div', null, \`;