From f2bf6c0620fa376759e4937e2dfd5d085cb9eebb Mon Sep 17 00:00:00 2001 From: Marcelo de Moraes Serpa Date: Wed, 24 Jun 2020 20:08:09 -0500 Subject: [PATCH] Change the category of FSE blocks from legacy to the updated ones Context: https://github.com/Automattic/wp-calypso/issues/43198 - Also add a helper function that can be used to check if old category names are still being used, and fallback to the old name if so. This should ideally be used in a ternary expression while setting the category name for blocks to provide the fallback old category name in order to support WP environments with older versions of Gutenberg. - Legacy categories were explicitly set to the new updated ones, following this example: https://github.com/WordPress/gutenberg/blob/84df4bd6082e7793a2befddb2a652cb42f445d21/packages/blocks/src/api/registration.js#L131-L135 - Some blocks might not have followed the example above and might have been moved to a category that made more sense for them --- apps/full-site-editing/bin/babel-transform.js | 8 + apps/full-site-editing/bin/js-unit-config.js | 1 + .../block-helpers/block-helpers.test.ts | 33 ++ .../block-helpers/block-helpers.ts | 35 +++ .../block-helpers/index.ts | 1 + .../donations/index.js | 3 +- .../blocks/navigation-menu/index.js | 3 +- .../dotcom-fse/blocks/post-content/index.js | 3 +- .../dotcom-fse/blocks/site-credit/index.js | 3 +- .../blocks/site-description/index.js | 3 +- .../dotcom-fse/blocks/site-title/index.js | 3 +- .../dotcom-fse/blocks/template/index.js | 3 +- .../blog-posts-block-editor.js | 3 +- .../newspack-blocks/carousel-block-editor.js | 7 +- apps/full-site-editing/package.json | 5 +- apps/full-site-editing/tsconfig.json | 6 +- yarn.lock | 285 ++++++++++++++++++ 17 files changed, 394 insertions(+), 11 deletions(-) create mode 100644 apps/full-site-editing/bin/babel-transform.js create mode 100644 apps/full-site-editing/full-site-editing-plugin/block-helpers/block-helpers.test.ts create mode 100644 apps/full-site-editing/full-site-editing-plugin/block-helpers/block-helpers.ts create mode 100644 apps/full-site-editing/full-site-editing-plugin/block-helpers/index.ts diff --git a/apps/full-site-editing/bin/babel-transform.js b/apps/full-site-editing/bin/babel-transform.js new file mode 100644 index 0000000000000..31c89f6cacb0c --- /dev/null +++ b/apps/full-site-editing/bin/babel-transform.js @@ -0,0 +1,8 @@ +/** + * External dependencies + */ +const babelJest = require( 'babel-jest' ); + +module.exports = babelJest.createTransformer( { + presets: [ '@wordpress/babel-preset-default', '@babel/preset-typescript' ], +} ); diff --git a/apps/full-site-editing/bin/js-unit-config.js b/apps/full-site-editing/bin/js-unit-config.js index c626c1a97ccf1..d6a8d1edbcbd4 100644 --- a/apps/full-site-editing/bin/js-unit-config.js +++ b/apps/full-site-editing/bin/js-unit-config.js @@ -26,6 +26,7 @@ const config = { ...defaults, rootDir: path.normalize( '../../../' ), // To detect wp-calypso root node_modules testMatch: [ `${ pluginRoot }/**/?(*.)test.[jt]s?(x)` ], + transform: { '^.+\\.[jt]sx?$': path.join( __dirname, 'babel-transform' ) }, setupFilesAfterEnv: [ ...( defaults.setupFilesAfterEnv || [] ), // extend if present '/apps/full-site-editing/bin/js-unit-setup', diff --git a/apps/full-site-editing/full-site-editing-plugin/block-helpers/block-helpers.test.ts b/apps/full-site-editing/full-site-editing-plugin/block-helpers/block-helpers.test.ts new file mode 100644 index 0000000000000..0f5d963985dde --- /dev/null +++ b/apps/full-site-editing/full-site-editing-plugin/block-helpers/block-helpers.test.ts @@ -0,0 +1,33 @@ +/** + * Internal dependencies + */ +import { getCategoryWithFallbacks } from '.'; + +jest.mock( '@wordpress/blocks', () => ( { + getCategories: () => [ { slug: 'foobar' }, { slug: 'barfoo' } ], +} ) ); + +describe( 'getCategoryWithFallbacks', () => { + describe( 'single category passed', () => { + it( 'returns the category if it exists', () => { + expect( getCategoryWithFallbacks( 'foobar' ) ).toBe( 'foobar' ); + } ); + it( 'throws an error if it does not exist', () => { + expect( () => getCategoryWithFallbacks( 'nah' ) ).toThrow( /nah/ ); + } ); + } ); + + describe( 'multiple categories are passed', () => { + it( 'throws an error if none of the categories exist', () => { + expect( () => getCategoryWithFallbacks( 'nah', 'meh', 'wut', 'foo' ) ).toThrow( + /nah,meh,wut,foo/ + ); + } ); + + it( 'ignores all unexisting categories until it finds the *first one* that exists, then returns it', () => { + expect( getCategoryWithFallbacks( 'foobar', 'meh', 'barfoo' ) ).toBe( 'foobar' ); + expect( getCategoryWithFallbacks( 'nah', 'foobar', 'barfoo', 'foo' ) ).toBe( 'foobar' ); + expect( getCategoryWithFallbacks( 'nah', 'meh', 'foobar' ) ).toBe( 'foobar' ); + } ); + } ); +} ); diff --git a/apps/full-site-editing/full-site-editing-plugin/block-helpers/block-helpers.ts b/apps/full-site-editing/full-site-editing-plugin/block-helpers/block-helpers.ts new file mode 100644 index 0000000000000..a9be4d404fe45 --- /dev/null +++ b/apps/full-site-editing/full-site-editing-plugin/block-helpers/block-helpers.ts @@ -0,0 +1,35 @@ +/** + * External dependencies + */ +import { getCategories } from '@wordpress/blocks'; + +/** + * Accepts an array of category names and returns the first one that + * exists in the categories returned by `getCategories`. This allows + * for a "graceful degradation" strategy to category names, where + * we just add the new category name as the first item in the array + * argument, and leave the old ones for environments where they still + * exist and are used. + * + * @example + * // Prefer passing the new category first in the array, followed by + * // older fallback categories. Considering the 'new' category is + * // registered: + * getCategoryWithFallbacks( 'new', 'old', 'older' ); + * // => 'new' + * + * @param {string[]} requestedCategories - an array of categories. + * @returns {string} the first category name found. + * @throws {Error} if the no categories could be found. + */ +export function getCategoryWithFallbacks( ...requestedCategories: string[] ): string { + const knownCategories = getCategories(); + for ( const requestedCategory of requestedCategories ) { + if ( knownCategories.some( ( { slug } ) => slug === requestedCategory ) ) { + return requestedCategory; + } + } + throw new Error( + `Could not find a category from the provided list: ${ requestedCategories.join( ',' ) }` + ); +} diff --git a/apps/full-site-editing/full-site-editing-plugin/block-helpers/index.ts b/apps/full-site-editing/full-site-editing-plugin/block-helpers/index.ts new file mode 100644 index 0000000000000..6f7933dfc22be --- /dev/null +++ b/apps/full-site-editing/full-site-editing-plugin/block-helpers/index.ts @@ -0,0 +1 @@ +export * from './block-helpers'; diff --git a/apps/full-site-editing/full-site-editing-plugin/donations/index.js b/apps/full-site-editing/full-site-editing-plugin/donations/index.js index bad1600fc0627..594e1c5238695 100644 --- a/apps/full-site-editing/full-site-editing-plugin/donations/index.js +++ b/apps/full-site-editing/full-site-editing-plugin/donations/index.js @@ -9,6 +9,7 @@ import { __, _x } from '@wordpress/i18n'; * Internal dependencies */ import edit from './edit'; +import { getCategortyWithFallbacks } from '../block-helpers'; /** * Style dependencies @@ -81,7 +82,7 @@ const settings = { default: __( 'Donate yearly', 'full-site-editing' ), }, }, - category: 'common', + category: getCategortyWithFallbacks( 'widgets', 'common' ), icon: ( ), - category: 'layout', + category: getCategoryWithFallbacks( 'design', 'layout' ), supports: { align: [ 'wide', 'full' ], html: false, diff --git a/apps/full-site-editing/full-site-editing-plugin/dotcom-fse/blocks/site-title/index.js b/apps/full-site-editing/full-site-editing-plugin/dotcom-fse/blocks/site-title/index.js index 21aaec6bd8d45..74b5cb5b0a6c5 100644 --- a/apps/full-site-editing/full-site-editing-plugin/dotcom-fse/blocks/site-title/index.js +++ b/apps/full-site-editing/full-site-editing-plugin/dotcom-fse/blocks/site-title/index.js @@ -9,13 +9,14 @@ import { __ } from '@wordpress/i18n'; * Internal dependencies */ import edit from './edit'; +import { getCategoryWithFallbacks } from '../../../block-helpers'; import './style.scss'; registerBlockType( 'a8c/site-title', { title: __( 'Site Title', 'full-site-editing' ), description: __( 'Your site title.', 'full-site-editing' ), icon: 'layout', - category: 'layout', + category: getCategoryWithFallbacks( 'design', 'layout' ), supports: { align: [ 'wide', 'full' ], html: false, diff --git a/apps/full-site-editing/full-site-editing-plugin/dotcom-fse/blocks/template/index.js b/apps/full-site-editing/full-site-editing-plugin/dotcom-fse/blocks/template/index.js index ee4080b624b7b..f763a4615cc9f 100644 --- a/apps/full-site-editing/full-site-editing-plugin/dotcom-fse/blocks/template/index.js +++ b/apps/full-site-editing/full-site-editing-plugin/dotcom-fse/blocks/template/index.js @@ -11,6 +11,7 @@ import { addFilter } from '@wordpress/hooks'; * Internal dependencies */ import edit from './edit'; +import { getCategoryWithFallbacks } from '../../../block-helpers'; import './style.scss'; import './site-logo'; @@ -20,7 +21,7 @@ if ( 'wp_template_part' !== fullSiteEditing.editorPostType ) { __experimentalDisplayName: 'label', description: __( 'Display a Template Part.', 'full-site-editing' ), icon: 'layout', - category: 'layout', + category: getCategoryWithFallbacks( 'design', 'layout' ), attributes: { templateId: { type: 'number' }, className: { type: 'string' }, diff --git a/apps/full-site-editing/full-site-editing-plugin/newspack-blocks/blog-posts-block-editor.js b/apps/full-site-editing/full-site-editing-plugin/newspack-blocks/blog-posts-block-editor.js index 6a45c591f9043..f2980df1a6394 100644 --- a/apps/full-site-editing/full-site-editing-plugin/newspack-blocks/blog-posts-block-editor.js +++ b/apps/full-site-editing/full-site-editing-plugin/newspack-blocks/blog-posts-block-editor.js @@ -12,6 +12,7 @@ import { addFilter } from '@wordpress/hooks'; */ import { settings } from './synced-newspack-blocks/blocks/homepage-articles/index'; import { registerQueryStore } from './synced-newspack-blocks/blocks/homepage-articles/store'; +import { getCategoryWithFallbacks } from '../block-helpers'; /** * Block name in the A8C\FSE context. @@ -31,7 +32,7 @@ addFilter( registerBlockType( blockName, { ...settings, title: __( 'Blog Posts', 'full-site-editing' ), - category: 'layout', + category: getCategoryWithFallbacks( 'widgets', 'layout' ), } ); registerQueryStore( blockName ); diff --git a/apps/full-site-editing/full-site-editing-plugin/newspack-blocks/carousel-block-editor.js b/apps/full-site-editing/full-site-editing-plugin/newspack-blocks/carousel-block-editor.js index fecb99dfedbf7..c8f3f18ad1017 100644 --- a/apps/full-site-editing/full-site-editing-plugin/newspack-blocks/carousel-block-editor.js +++ b/apps/full-site-editing/full-site-editing-plugin/newspack-blocks/carousel-block-editor.js @@ -11,6 +11,11 @@ import { addFilter } from '@wordpress/hooks'; */ import { settings } from './synced-newspack-blocks/blocks/carousel/index'; +/** + * Internal dependencies + */ +import { getCategoryWithFallbacks } from '../block-helpers'; + /** * Block name in the A8C\FSE context. */ @@ -28,5 +33,5 @@ addFilter( registerBlockType( blockName, { ...settings, - category: 'layout', + category: getCategoryWithFallbacks( 'widgets', 'layout' ), } ); diff --git a/apps/full-site-editing/package.json b/apps/full-site-editing/package.json index 602ceeeb72c7d..29621b935f293 100644 --- a/apps/full-site-editing/package.json +++ b/apps/full-site-editing/package.json @@ -130,6 +130,9 @@ }, "devDependencies": { "@types/wordpress__plugins": "^2.3.6", - "@wordpress/eslint-plugin": "^6.0.0" + "@babel/preset-typescript": "^7.10.1", + "@types/jest": "^26.0.3", + "@wordpress/eslint-plugin": "^6.0.0", + "babel-jest": "^26.1.0" } } diff --git a/apps/full-site-editing/tsconfig.json b/apps/full-site-editing/tsconfig.json index 6c65476aa0d5e..cd13dc51994ed 100644 --- a/apps/full-site-editing/tsconfig.json +++ b/apps/full-site-editing/tsconfig.json @@ -27,12 +27,16 @@ "esModuleInterop": false, // Some type helpers from our webpack/ - "types": [ "fse" ], + "types": [ "fse", "jest" ], "typeRoots": [ "./typings", "./node_modules", "../../node_modules" ], // Preserve JSX, allows compatibility with wp-element jsx babel transforms "jsx": "preserve" }, "exclude": [ "node_modules" ], + // Had to add that in order for vscode to recognize the tests and apply the jest types + "include": [ + "*.test.ts", + ], "references": [ "../../packages/data-stores" ] } diff --git a/yarn.lock b/yarn.lock index e11b6c1f1b431..90a252328c05e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -73,6 +73,13 @@ dependencies: "@babel/highlight" "^7.8.3" +"@babel/code-frame@^7.10.3": + version "7.10.3" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.10.3.tgz#324bcfd8d35cd3d47dae18cde63d752086435e9a" + integrity sha512-fDx9eNW0qz0WkUeqL6tXEXzVlPh6Y5aCDEZesl0xBGA8ndRukX91Uk44ZqnkECp01NAZUdCAl+aiQNGi0k88Eg== + dependencies: + "@babel/highlight" "^7.10.3" + "@babel/compat-data@^7.8.6", "@babel/compat-data@^7.9.0": version "7.9.0" resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.9.0.tgz#04815556fc90b0c174abd2c0c1bb966faa036a6c" @@ -113,6 +120,16 @@ semver "^5.4.1" source-map "^0.5.0" +"@babel/generator@^7.10.3": + version "7.10.3" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.10.3.tgz#32b9a0d963a71d7a54f5f6c15659c3dbc2a523a5" + integrity sha512-drt8MUHbEqRzNR0xnF8nMehbY11b1SDkRw03PSNH/3Rb2Z35oxkddVSi3rcaak0YJQ86PCuE7Qx1jSFhbLNBMA== + dependencies: + "@babel/types" "^7.10.3" + jsesc "^2.5.1" + lodash "^4.17.13" + source-map "^0.5.0" + "@babel/generator@^7.4.0", "@babel/generator@^7.9.0", "@babel/generator@^7.9.5": version "7.9.5" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.9.5.tgz#27f0917741acc41e6eaaced6d68f96c3fa9afaf9" @@ -187,6 +204,18 @@ levenary "^1.1.1" semver "^5.5.0" +"@babel/helper-create-class-features-plugin@^7.10.3": + version "7.10.3" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.10.3.tgz#2783daa6866822e3d5ed119163b50f0fc3ae4b35" + integrity sha512-iRT9VwqtdFmv7UheJWthGc/h2s7MqoweBF9RUj77NFZsg9VfISvBTum3k6coAhJ8RWv2tj3yUjA03HxPd0vfpQ== + dependencies: + "@babel/helper-function-name" "^7.10.3" + "@babel/helper-member-expression-to-functions" "^7.10.3" + "@babel/helper-optimise-call-expression" "^7.10.3" + "@babel/helper-plugin-utils" "^7.10.3" + "@babel/helper-replace-supers" "^7.10.1" + "@babel/helper-split-export-declaration" "^7.10.1" + "@babel/helper-create-class-features-plugin@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.8.3.tgz#5b94be88c255f140fd2c10dd151e7f98f4bff397" @@ -224,6 +253,15 @@ "@babel/traverse" "^7.8.3" "@babel/types" "^7.8.3" +"@babel/helper-function-name@^7.10.3": + version "7.10.3" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.10.3.tgz#79316cd75a9fa25ba9787ff54544307ed444f197" + integrity sha512-FvSj2aiOd8zbeqijjgqdMDSyxsGHaMt5Tr0XjQsGKHD3/1FP3wksjnLAWzxw7lvXiej8W1Jt47SKTZ6upQNiRw== + dependencies: + "@babel/helper-get-function-arity" "^7.10.3" + "@babel/template" "^7.10.3" + "@babel/types" "^7.10.3" + "@babel/helper-function-name@^7.8.3", "@babel/helper-function-name@^7.9.5": version "7.9.5" resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.9.5.tgz#2b53820d35275120e1874a82e5aabe1376920a5c" @@ -233,6 +271,13 @@ "@babel/template" "^7.8.3" "@babel/types" "^7.9.5" +"@babel/helper-get-function-arity@^7.10.3": + version "7.10.3" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.3.tgz#3a28f7b28ccc7719eacd9223b659fdf162e4c45e" + integrity sha512-iUD/gFsR+M6uiy69JA6fzM5seno8oE85IYZdbVVEuQaZlEzMO2MXblh+KSPJgsZAUx0EEbWXU0yJaW7C9CdAVg== + dependencies: + "@babel/types" "^7.10.3" + "@babel/helper-get-function-arity@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.8.3.tgz#b894b947bd004381ce63ea1db9f08547e920abd5" @@ -247,6 +292,13 @@ dependencies: "@babel/types" "^7.8.3" +"@babel/helper-member-expression-to-functions@^7.10.1", "@babel/helper-member-expression-to-functions@^7.10.3": + version "7.10.3" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.10.3.tgz#bc3663ac81ac57c39148fef4c69bf48a77ba8dd6" + integrity sha512-q7+37c4EPLSjNb2NmWOjNwj0+BOyYlssuQ58kHEWk1Z78K5i8vTUsteq78HMieRPQSl/NtpQyJfdjt3qZ5V2vw== + dependencies: + "@babel/types" "^7.10.3" + "@babel/helper-member-expression-to-functions@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.8.3.tgz#659b710498ea6c1d9907e0c73f206eee7dadc24c" @@ -274,6 +326,13 @@ "@babel/types" "^7.9.0" lodash "^4.17.13" +"@babel/helper-optimise-call-expression@^7.10.1", "@babel/helper-optimise-call-expression@^7.10.3": + version "7.10.3" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.10.3.tgz#f53c4b6783093195b0f69330439908841660c530" + integrity sha512-kT2R3VBH/cnSz+yChKpaKRJQJWxdGoc6SjioRId2wkeV3bK0wLLioFpJROrX0U4xr/NmxSSAWT/9Ih5snwIIzg== + dependencies: + "@babel/types" "^7.10.3" + "@babel/helper-optimise-call-expression@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.8.3.tgz#7ed071813d09c75298ef4f208956006b6111ecb9" @@ -286,6 +345,11 @@ resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz#9ea293be19babc0f52ff8ca88b34c3611b208670" integrity sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ== +"@babel/helper-plugin-utils@^7.10.1", "@babel/helper-plugin-utils@^7.10.3": + version "7.10.3" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.3.tgz#aac45cccf8bc1873b99a85f34bceef3beb5d3244" + integrity sha512-j/+j8NAWUTxOtx4LKHybpSClxHoq6I91DQ/mKgAXn5oNUPIUiGppjPIX3TDtJWPrdfP9Kfl7e4fgVMiQR9VE/g== + "@babel/helper-regex@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/helper-regex/-/helper-regex-7.8.3.tgz#139772607d51b93f23effe72105b319d2a4c6965" @@ -304,6 +368,16 @@ "@babel/traverse" "^7.8.3" "@babel/types" "^7.8.3" +"@babel/helper-replace-supers@^7.10.1": + version "7.10.1" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.10.1.tgz#ec6859d20c5d8087f6a2dc4e014db7228975f13d" + integrity sha512-SOwJzEfpuQwInzzQJGjGaiG578UYmyi2Xw668klPWV5n07B73S0a9btjLk/52Mlcxa+5AdIYqws1KyXRfMoB7A== + dependencies: + "@babel/helper-member-expression-to-functions" "^7.10.1" + "@babel/helper-optimise-call-expression" "^7.10.1" + "@babel/traverse" "^7.10.1" + "@babel/types" "^7.10.1" + "@babel/helper-replace-supers@^7.8.3", "@babel/helper-replace-supers@^7.8.6": version "7.8.6" resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.8.6.tgz#5ada744fd5ad73203bf1d67459a27dcba67effc8" @@ -322,6 +396,13 @@ "@babel/template" "^7.8.3" "@babel/types" "^7.8.3" +"@babel/helper-split-export-declaration@^7.10.1": + version "7.10.1" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.10.1.tgz#c6f4be1cbc15e3a868e4c64a17d5d31d754da35f" + integrity sha512-UQ1LVBPrYdbchNhLwj6fetj46BcFwfS4NllJo/1aJsT+1dLTEnXJL0qHqtY7gPzF8S2fXBJamf1biAXV3X077g== + dependencies: + "@babel/types" "^7.10.1" + "@babel/helper-split-export-declaration@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz#31a9f30070f91368a7182cf05f831781065fc7a9" @@ -329,6 +410,11 @@ dependencies: "@babel/types" "^7.8.3" +"@babel/helper-validator-identifier@^7.10.3": + version "7.10.3" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.3.tgz#60d9847f98c4cea1b279e005fdb7c28be5412d15" + integrity sha512-bU8JvtlYpJSBPuj1VUmKpFGaDZuLxASky3LhaKj3bmpSTY6VWooSM8msk+Z0CZoErFye2tlABF6yDkT3FOPAXw== + "@babel/helper-validator-identifier@^7.9.0", "@babel/helper-validator-identifier@^7.9.5": version "7.9.5" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.5.tgz#90977a8e6fbf6b431a7dc31752eee233bf052d80" @@ -362,11 +448,25 @@ chalk "^2.0.0" js-tokens "^4.0.0" +"@babel/highlight@^7.10.3": + version "7.10.3" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.10.3.tgz#c633bb34adf07c5c13156692f5922c81ec53f28d" + integrity sha512-Ih9B/u7AtgEnySE2L2F0Xm0GaM729XqqLfHkalTsbjXGyqmf/6M0Cu0WpvqueUlW+xk88BHw9Nkpj49naU+vWw== + dependencies: + "@babel/helper-validator-identifier" "^7.10.3" + chalk "^2.0.0" + js-tokens "^4.0.0" + "@babel/parser@^7.0.0", "@babel/parser@^7.1.0", "@babel/parser@^7.1.6", "@babel/parser@^7.4.3", "@babel/parser@^7.5.5", "@babel/parser@^7.7.5", "@babel/parser@^7.8.6", "@babel/parser@^7.9.0": version "7.9.4" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.9.4.tgz#68a35e6b0319bbc014465be43828300113f2f2e8" integrity sha512-bC49otXX6N0/VYhgOMh4gnP26E9xnDZK3TmbNpxYzzz9BQLBosQwfyOe9/cXUU3txYhTzLCbcqd5c8y/OmCjHA== +"@babel/parser@^7.10.3": + version "7.10.3" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.10.3.tgz#7e71d892b0d6e7d04a1af4c3c79d72c1f10f5315" + integrity sha512-oJtNJCMFdIMwXGmx+KxuaD7i3b8uS7TTFYW/FNG2BT8m+fmGHoiPYoH0Pe3gya07WuFmM5FCDIr1x0irkD/hyA== + "@babel/parser@^7.7.0", "@babel/parser@^7.9.6": version "7.9.6" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.9.6.tgz#3b1bbb30dabe600cd72db58720998376ff653bc7" @@ -577,6 +677,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.3" +"@babel/plugin-syntax-typescript@^7.10.1": + version "7.10.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.10.1.tgz#5e82bc27bb4202b93b949b029e699db536733810" + integrity sha512-X/d8glkrAtra7CaQGMiGs/OGa6XgUzqPcBXCIGFCpCqnfGlT0Wfbzo/B89xHhnInTaItPK8LALblVXcUOEh95Q== + dependencies: + "@babel/helper-plugin-utils" "^7.10.1" + "@babel/plugin-syntax-typescript@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.8.3.tgz#c1f659dda97711a569cef75275f7e15dcaa6cabc" @@ -944,6 +1051,15 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.3" +"@babel/plugin-transform-typescript@^7.10.1": + version "7.10.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.10.3.tgz#b3b35fb34ef0bd628b4b8329b0e5f985369201d4" + integrity sha512-qU9Lu7oQyh3PGMQncNjQm8RWkzw6LqsWZQlZPQMgrGt6s3YiBIaQ+3CQV/FA/icGS5XlSWZGwo/l8ErTyelS0Q== + dependencies: + "@babel/helper-create-class-features-plugin" "^7.10.3" + "@babel/helper-plugin-utils" "^7.10.3" + "@babel/plugin-syntax-typescript" "^7.10.1" + "@babel/plugin-transform-typescript@^7.9.0": version "7.9.4" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.9.4.tgz#4bb4dde4f10bbf2d787fce9707fb09b483e33359" @@ -1210,6 +1326,14 @@ "@babel/helper-plugin-utils" "^7.8.3" "@babel/plugin-transform-typescript" "^7.9.0" +"@babel/preset-typescript@^7.10.1": + version "7.10.1" + resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.10.1.tgz#a8d8d9035f55b7d99a2461a0bdc506582914d07e" + integrity sha512-m6GV3y1ShiqxnyQj10600ZVOFrSSAa8HQ3qIUk2r+gcGtHTIRw0dJnFLt1WNXpKjtVw7yw1DAPU/6ma2ZvgJuA== + dependencies: + "@babel/helper-plugin-utils" "^7.10.1" + "@babel/plugin-transform-typescript" "^7.10.1" + "@babel/register@^7.0.0", "@babel/register@^7.9.0": version "7.9.0" resolved "https://registry.yarnpkg.com/@babel/register/-/register-7.9.0.tgz#02464ede57548bddbb5e9f705d263b7c3f43d48b" @@ -1258,6 +1382,15 @@ dependencies: regenerator-runtime "^0.13.4" +"@babel/template@^7.10.3": + version "7.10.3" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.10.3.tgz#4d13bc8e30bf95b0ce9d175d30306f42a2c9a7b8" + integrity sha512-5BjI4gdtD+9fHZUsaxPHPNpwa+xRkDO7c7JbhYn2afvrkDu5SfAAbi9AIMXw2xEhO/BR35TqiW97IqNvCo/GqA== + dependencies: + "@babel/code-frame" "^7.10.3" + "@babel/parser" "^7.10.3" + "@babel/types" "^7.10.3" + "@babel/template@^7.3.3", "@babel/template@^7.4.0", "@babel/template@^7.7.4", "@babel/template@^7.8.3", "@babel/template@^7.8.6": version "7.8.6" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.8.6.tgz#86b22af15f828dfb086474f964dcc3e39c43ce2b" @@ -1282,6 +1415,21 @@ globals "^11.1.0" lodash "^4.17.13" +"@babel/traverse@^7.10.1": + version "7.10.3" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.10.3.tgz#0b01731794aa7b77b214bcd96661f18281155d7e" + integrity sha512-qO6623eBFhuPm0TmmrUFMT1FulCmsSeJuVGhiLodk2raUDFhhTECLd9E9jC4LBIWziqt4wgF6KuXE4d+Jz9yug== + dependencies: + "@babel/code-frame" "^7.10.3" + "@babel/generator" "^7.10.3" + "@babel/helper-function-name" "^7.10.3" + "@babel/helper-split-export-declaration" "^7.10.1" + "@babel/parser" "^7.10.3" + "@babel/types" "^7.10.3" + debug "^4.1.0" + globals "^11.1.0" + lodash "^4.17.13" + "@babel/traverse@^7.7.0": version "7.9.6" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.9.6.tgz#5540d7577697bf619cc57b92aa0f1c231a94f442" @@ -1306,6 +1454,15 @@ lodash "^4.17.13" to-fast-properties "^2.0.0" +"@babel/types@^7.10.1", "@babel/types@^7.10.3": + version "7.10.3" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.10.3.tgz#6535e3b79fea86a6b09e012ea8528f935099de8e" + integrity sha512-nZxaJhBXBQ8HVoIcGsf9qWep3Oh3jCENK54V4mRF7qaJabVsAYdbTtmSD8WmAp1R6ytPiu5apMwSXyxB1WlaBA== + dependencies: + "@babel/helper-validator-identifier" "^7.10.3" + lodash "^4.17.13" + to-fast-properties "^2.0.0" + "@babel/types@^7.3.3", "@babel/types@^7.7.0", "@babel/types@^7.9.6": version "7.9.6" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.9.6.tgz#2c5502b427251e9de1bd2dff95add646d95cc9f7" @@ -1962,6 +2119,27 @@ source-map "^0.6.1" write-file-atomic "^3.0.0" +"@jest/transform@^26.1.0": + version "26.1.0" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-26.1.0.tgz#697f48898c2a2787c9b4cb71d09d7e617464e509" + integrity sha512-ICPm6sUXmZJieq45ix28k0s+d/z2E8CHDsq+WwtWI6kW8m7I8kPqarSEcUN86entHQ570ZBRci5OWaKL0wlAWw== + dependencies: + "@babel/core" "^7.1.0" + "@jest/types" "^26.1.0" + babel-plugin-istanbul "^6.0.0" + chalk "^4.0.0" + convert-source-map "^1.4.0" + fast-json-stable-stringify "^2.0.0" + graceful-fs "^4.2.4" + jest-haste-map "^26.1.0" + jest-regex-util "^26.0.0" + jest-util "^26.1.0" + micromatch "^4.0.2" + pirates "^4.0.1" + slash "^3.0.0" + source-map "^0.6.1" + write-file-atomic "^3.0.0" + "@jest/types@^24.9.0": version "24.9.0" resolved "https://registry.yarnpkg.com/@jest/types/-/types-24.9.0.tgz#63cb26cb7500d069e5a389441a7c6ab5e909fc59" @@ -1991,6 +2169,16 @@ "@types/yargs" "^15.0.0" chalk "^4.0.0" +"@jest/types@^26.1.0": + version "26.1.0" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-26.1.0.tgz#f8afaaaeeb23b5cad49dd1f7779689941dcb6057" + integrity sha512-GXigDDsp6ZlNMhXQDeuy/iYCDsRIHJabWtDzvnn36+aqFfG14JmFV0e/iXxY4SP9vbXSiPNOWdehU5MeqrYHBQ== + dependencies: + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^1.1.1" + "@types/yargs" "^15.0.0" + chalk "^4.0.0" + "@lerna/add@3.20.0": version "3.20.0" resolved "https://registry.yarnpkg.com/@lerna/add/-/add-3.20.0.tgz#bea7edf36fc93fb72ec34cb9ba854c48d4abf309" @@ -3581,6 +3769,17 @@ "@testing-library/dom" "^7.8.0" "@types/testing-library__react" "^10.0.1" +"@types/babel__core@^7.0.0": + version "7.1.9" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.9.tgz#77e59d438522a6fb898fa43dc3455c6e72f3963d" + integrity sha512-sY2RsIJ5rpER1u3/aQ8OFSI7qGIy8o1NEEbgb2UaJcvOtXOMpd39ko723NBpjQFg9SIX7TXtjejZVGeIMLhoOw== + dependencies: + "@babel/parser" "^7.1.0" + "@babel/types" "^7.0.0" + "@types/babel__generator" "*" + "@types/babel__template" "*" + "@types/babel__traverse" "*" + "@types/babel__core@^7.1.7": version "7.1.7" resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.7.tgz#1dacad8840364a57c98d0dd4855c6dd3752c6b89" @@ -3739,6 +3938,14 @@ jest-diff "^25.2.1" pretty-format "^25.2.1" +"@types/jest@^26.0.3": + version "26.0.3" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-26.0.3.tgz#79534e0e94857171c0edc596db0ebe7cb7863251" + integrity sha512-v89ga1clpVL/Y1+YI0eIu1VMW+KU7Xl8PhylVtDKVWaSUHBHYPLXMQGBdrpHewaKoTvlXkksbYqPgz8b4cmRZg== + dependencies: + jest-diff "^25.2.1" + pretty-format "^25.2.1" + "@types/json-schema@^7.0.3": version "7.0.4" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.4.tgz#38fd73ddfd9b55abb1e1b2ed578cb55bd7b7d339" @@ -6490,6 +6697,20 @@ babel-jest@^26.0.0, babel-jest@^26.0.1: graceful-fs "^4.2.4" slash "^3.0.0" +babel-jest@^26.1.0: + version "26.1.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-26.1.0.tgz#b20751185fc7569a0f135730584044d1cb934328" + integrity sha512-Nkqgtfe7j6PxLO6TnCQQlkMm8wdTdnIF8xrdpooHCuD5hXRzVEPbPneTJKknH5Dsv3L8ip9unHDAp48YQ54Dkg== + dependencies: + "@jest/transform" "^26.1.0" + "@jest/types" "^26.1.0" + "@types/babel__core" "^7.1.7" + babel-plugin-istanbul "^6.0.0" + babel-preset-jest "^26.1.0" + chalk "^4.0.0" + graceful-fs "^4.2.4" + slash "^3.0.0" + babel-loader@^8.0.6: version "8.0.6" resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.0.6.tgz#e33bdb6f362b03f4bb141a0c21ab87c501b70dfb" @@ -6599,6 +6820,16 @@ babel-plugin-jest-hoist@^26.0.0: "@babel/types" "^7.3.3" "@types/babel__traverse" "^7.0.6" +babel-plugin-jest-hoist@^26.1.0: + version "26.1.0" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-26.1.0.tgz#c6a774da08247a28285620a64dfadbd05dd5233a" + integrity sha512-qhqLVkkSlqmC83bdMhM8WW4Z9tB+JkjqAqlbbohS9sJLT5Ha2vfzuKqg5yenXrAjOPG2YC0WiXdH3a9PvB+YYw== + dependencies: + "@babel/template" "^7.3.3" + "@babel/types" "^7.3.3" + "@types/babel__core" "^7.0.0" + "@types/babel__traverse" "^7.0.6" + babel-plugin-macros@2.8.0, babel-plugin-macros@^2.0.0, babel-plugin-macros@^2.7.0: version "2.8.0" resolved "https://registry.yarnpkg.com/babel-plugin-macros/-/babel-plugin-macros-2.8.0.tgz#0f958a7cc6556b1e65344465d99111a1e5e10138" @@ -6799,6 +7030,14 @@ babel-preset-jest@^26.0.0: babel-plugin-jest-hoist "^26.0.0" babel-preset-current-node-syntax "^0.1.2" +babel-preset-jest@^26.1.0: + version "26.1.0" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-26.1.0.tgz#612f714e5b457394acfd863793c564cbcdb7d1c1" + integrity sha512-na9qCqFksknlEj5iSdw1ehMVR06LCCTkZLGKeEtxDDdhg8xpUF09m29Kvh1pRbZ07h7AQ5ttLYUwpXL4tO6w7w== + dependencies: + babel-plugin-jest-hoist "^26.1.0" + babel-preset-current-node-syntax "^0.1.2" + "babel-preset-minify@^0.5.0 || 0.6.0-alpha.5": version "0.5.1" resolved "https://registry.yarnpkg.com/babel-preset-minify/-/babel-preset-minify-0.5.1.tgz#25f5d0bce36ec818be80338d0e594106e21eaa9f" @@ -15523,6 +15762,26 @@ jest-haste-map@^26.0.1: optionalDependencies: fsevents "^2.1.2" +jest-haste-map@^26.1.0: + version "26.1.0" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-26.1.0.tgz#ef31209be73f09b0d9445e7d213e1b53d0d1476a" + integrity sha512-WeBS54xCIz9twzkEdm6+vJBXgRBQfdbbXD0dk8lJh7gLihopABlJmIQFdWSDDtuDe4PRiObsjZSUjbJ1uhWEpA== + dependencies: + "@jest/types" "^26.1.0" + "@types/graceful-fs" "^4.1.2" + anymatch "^3.0.3" + fb-watchman "^2.0.0" + graceful-fs "^4.2.4" + jest-serializer "^26.1.0" + jest-util "^26.1.0" + jest-worker "^26.1.0" + micromatch "^4.0.2" + sane "^4.0.3" + walker "^1.0.7" + which "^2.0.2" + optionalDependencies: + fsevents "^2.1.2" + jest-jasmine2@^25.5.4: version "25.5.4" resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-25.5.4.tgz#66ca8b328fb1a3c5364816f8958f6970a8526968" @@ -15887,6 +16146,13 @@ jest-serializer@^26.0.0: dependencies: graceful-fs "^4.2.4" +jest-serializer@^26.1.0: + version "26.1.0" + resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-26.1.0.tgz#72a394531fc9b08e173dc7d297440ac610d95022" + integrity sha512-eqZOQG/0+MHmr25b2Z86g7+Kzd5dG9dhCiUoyUNJPgiqi38DqbDEOlHcNijyfZoj74soGBohKBZuJFS18YTJ5w== + dependencies: + graceful-fs "^4.2.4" + jest-snapshot@^25.5.1: version "25.5.1" resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-25.5.1.tgz#1a2a576491f9961eb8d00c2e5fd479bc28e5ff7f" @@ -15969,6 +16235,17 @@ jest-util@^26.0.1: is-ci "^2.0.0" make-dir "^3.0.0" +jest-util@^26.1.0: + version "26.1.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-26.1.0.tgz#80e85d4ba820decacf41a691c2042d5276e5d8d8" + integrity sha512-rNMOwFQevljfNGvbzNQAxdmXQ+NawW/J72dmddsK0E8vgxXCMtwQ/EH0BiWEIxh0hhMcTsxwAxINt7Lh46Uzbg== + dependencies: + "@jest/types" "^26.1.0" + chalk "^4.0.0" + graceful-fs "^4.2.4" + is-ci "^2.0.0" + micromatch "^4.0.2" + jest-validate@^24.9.0: version "24.9.0" resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-24.9.0.tgz#0775c55360d173cd854e40180756d4ff52def8ab" @@ -16053,6 +16330,14 @@ jest-worker@^26.0.0: merge-stream "^2.0.0" supports-color "^7.0.0" +jest-worker@^26.1.0: + version "26.1.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-26.1.0.tgz#65d5641af74e08ccd561c240e7db61284f82f33d" + integrity sha512-Z9P5pZ6UC+kakMbNJn+tA2RdVdNX5WH1x+5UCBZ9MxIK24pjYtFt96fK+UwBTrjLYm232g1xz0L3eTh51OW+yQ== + dependencies: + merge-stream "^2.0.0" + supports-color "^7.0.0" + jest@^25.3.0: version "25.5.4" resolved "https://registry.yarnpkg.com/jest/-/jest-25.5.4.tgz#f21107b6489cfe32b076ce2adcadee3587acb9db"