From 6bded2d6c6545600cd0371179c16fc627e893dee Mon Sep 17 00:00:00 2001 From: Chris Bobbe Date: Tue, 25 May 2021 15:10:10 -0400 Subject: [PATCH 1/9] deps: Add `yarn-deduplicate` as a dev dependency. Done with this command, using Yarn 1.22.10: yarn add --dev yarn-deduplicate This will help us trim out some dependencies that were installed multiple times, at different versions, when version-range constraints would actually allow having one installation at a particular version: https://www.npmjs.com/package/yarn-deduplicate https://github.com/atlassian/yarn-deduplicate --- package.json | 3 ++- yarn.lock | 21 ++++++++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 94b0578..495b6be 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,8 @@ "flow-bin": "^0.149.0", "husky": "^6.0.0", "parcel": "^2.0.0-beta.2", - "sharp": "^0.28.1" + "sharp": "^0.28.1", + "yarn-deduplicate": "^3.1.0" }, "scripts": { "backend": "parcel build ./frontend/index.html; cd backend; pipenv run python app.py --scrape", diff --git a/yarn.lock b/yarn.lock index 29da6dc..ef0ccaf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1618,6 +1618,11 @@ resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.3.tgz#9c088679876f374eb5983f150d4787aa6fb32d7e" integrity sha512-FvUupuM3rlRsRtCN+fDudtmytGO6iHJuuRKS1Ss0pG5z8oX0diNEw94UEL7hgDbpN94rgaK5R7sWm6RrSkZuAQ== +"@yarnpkg/lockfile@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31" + integrity sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ== + abab@^2.0.0: version "2.0.5" resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.5.tgz" @@ -2421,6 +2426,11 @@ commander@^5.0.0: resolved "https://registry.yarnpkg.com/commander/-/commander-5.1.0.tgz" integrity sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg== +commander@^6.1.0: + version "6.2.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-6.2.1.tgz#0792eb682dfbc325999bb2b84fddddba110ac73c" + integrity sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA== + commander@^7.0.0: version "7.2.0" resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz" @@ -6470,7 +6480,7 @@ semver@^6.1.1, semver@^6.1.2, semver@^6.3.0: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== -semver@^7.2.1, semver@^7.3.4, semver@^7.3.5: +semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5: version "7.3.5" resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz" integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== @@ -7568,3 +7578,12 @@ yallist@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== + +yarn-deduplicate@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/yarn-deduplicate/-/yarn-deduplicate-3.1.0.tgz#3018d93e95f855f236a215b591fe8bc4bcabba3e" + integrity sha512-q2VZ6ThNzQpGfNpkPrkmV7x5HT9MOhCUsTxVTzyyZB0eSXz1NTodHn+r29DlLb+peKk8iXxzdUVhQG9pI7moFw== + dependencies: + "@yarnpkg/lockfile" "^1.1.0" + commander "^6.1.0" + semver "^7.3.2" From a59caff3b451b9ce75521a9bd418b1c3329c0823 Mon Sep 17 00:00:00 2001 From: Chris Bobbe Date: Tue, 25 May 2021 15:31:09 -0400 Subject: [PATCH 2/9] deps: Run `yarn yarn-deduplicate && yarn`. yarn-deduplicate, which we added to `devDependencies` in the previous commit, cleans up `yarn.lock` by removing duplicates: https://www.npmjs.com/package/yarn-deduplicate https://github.com/atlassian/yarn-deduplicate Done using Yarn 1.22.10. Note that the package's docs (linked just above) report that the package is obsolete when using Yarn v2 because Yarn v2 supports package deduplication natively. Since this command found something to do, I assume we haven't been using Yarn v2. We could go to the trouble of upgrading, but it looks like there's some nontrivial work involved, and some packages might not yet work well with v2, and I have no experience with v2: https://yarnpkg.com/getting-started/qa#why-should-you-upgrade-to-yarn-modern --- yarn.lock | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/yarn.lock b/yarn.lock index ef0ccaf..bfa4b48 100644 --- a/yarn.lock +++ b/yarn.lock @@ -890,20 +890,13 @@ core-js-pure "^3.0.0" regenerator-runtime "^0.13.4" -"@babel/runtime@^7.1.2", "@babel/runtime@^7.12.0", "@babel/runtime@^7.12.1", "@babel/runtime@^7.13.6", "@babel/runtime@^7.5.5": +"@babel/runtime@^7.1.2", "@babel/runtime@^7.10.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.0", "@babel/runtime@^7.12.1", "@babel/runtime@^7.13.6", "@babel/runtime@^7.5.5", "@babel/runtime@^7.8.4": version "7.14.0" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.14.0.tgz#46794bc20b612c5f75e62dd071e24dfd95f1cbe6" integrity sha512-JELkvo/DlpNdJ7dlyw/eY7E0suy5i5GQH+Vlxaq1nsNJ+H7f4Vtv3jMeCEgRhZZQFXTjldYfQgv2qmM6M1v5wA== dependencies: regenerator-runtime "^0.13.4" -"@babel/runtime@^7.10.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.8.4": - version "7.13.17" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.13.17.tgz" - integrity sha512-NCdgJEelPTSh+FEFylhnP1ylq848l1z9t9N0j1Lfbcw0+KXGjsTvUmkxy+voLLXB5SOKMbLLx4jxYliGrYQseA== - dependencies: - regenerator-runtime "^0.13.4" - "@babel/template@^7.12.13", "@babel/template@^7.4.0": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.12.13.tgz" @@ -5872,12 +5865,7 @@ posthtml-parser@^0.7.2: dependencies: htmlparser2 "^6.0.0" -posthtml-render@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/posthtml-render/-/posthtml-render-1.3.1.tgz" - integrity sha512-eSToKjNLu0FiF76SSGMHjOFXYzAc/CJqi677Sq6hYvcvFCBtD6de/W5l+0IYPf7ypscqAfjCttxvTdMJt5Gj8Q== - -posthtml-render@^1.4.0: +posthtml-render@^1.3.1, posthtml-render@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/posthtml-render/-/posthtml-render-1.4.0.tgz" integrity sha512-W1779iVHGfq0Fvh2PROhCe2QhB8mEErgqzo1wpIt36tCgChafP+hbXIhLDOM8ePJrZcFs0vkNEtdibEWVqChqw== From e71f090f19662c824ec070736cec97f375c7ca24 Mon Sep 17 00:00:00 2001 From: Chris Bobbe Date: Tue, 25 May 2021 15:16:49 -0400 Subject: [PATCH 3/9] deps: Resolve peer-dependency warnings. Done with the following commands, using Yarn 1.22.10: yarn add @types/react --latest yarn add @babel/core postcss --dev --latest yarn yarn-deduplicate && yarn after seeing the warnings below, on an initial run of `yarn` (i.e., one that starts with `node_modules` not existing). (The `yarn-deduplicate` command is a routine cleanup command we added in a recent commit. It found something to do after running the other two commands.) Each line in the output below represents an assertion from one of our project's dependencies that our project must add a direct dependency on { @types/react, @babel/core, postcss } at a version in a specific range: https://docs.npmjs.com/cli/v7/configuring-npm/package-json#peerdependencies https://nodejs.org/es/blog/npm/peer-dependencies/ Luckily, all the ranges for each of those three packages are wide enough that they intersect at at least one specific version. Even better: for all three packages, the intersection isn't just *one* specific version -- it includes the default range that gets specified when you just `yarn add ... --latest` the package. So, do that, for all three. From the output, it looks like the @types/react warning stems from our top-level dependency react-markdown, and that's under `dependencies`. So, install @types/react under `dependencies`. From the output, it looks like all the @babel/core and postcss warnings stem from parcel, which is under `devDependencies`. So, install @babel/core and postcss under `devDependencies`. warning " > react-markdown@6.0.1" has unmet peer dependency "@types/react@>=16". warning "parcel > @parcel/config-default > @parcel/transformer-babel@2.0.0-beta.2" has unmet peer dependency "@babel/core@^7.12.0". warning "parcel > @parcel/config-default > @parcel/transformer-postcss@2.0.0-beta.2" has unmet peer dependency "postcss@^8.2.1". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/helper-compilation-targets@7.13.16" has unmet peer dependency "@babel/core@^7.0.0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/plugin-transform-flow-strip-types@7.13.0" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/plugin-transform-typescript@7.13.0" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env@7.13.15" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-react@7.13.13" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @parcel/babel-preset-env@2.0.0-beta.2" has unmet peer dependency "@babel/core@^7.12.0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/plugin-transform-flow-strip-types > @babel/plugin-syntax-flow@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/plugin-transform-typescript > @babel/helper-create-class-features-plugin@7.13.11" has unmet peer dependency "@babel/core@^7.0.0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/plugin-transform-typescript > @babel/plugin-syntax-typescript@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.13.12" has unmet peer dependency "@babel/core@^7.13.0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-proposal-async-generator-functions@7.13.15" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-proposal-class-properties@7.13.0" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-proposal-dynamic-import@7.13.8" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-proposal-export-namespace-from@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-proposal-json-strings@7.13.8" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-proposal-logical-assignment-operators@7.13.8" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-proposal-nullish-coalescing-operator@7.13.8" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-proposal-numeric-separator@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-proposal-object-rest-spread@7.13.8" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-proposal-optional-catch-binding@7.13.8" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-proposal-optional-chaining@7.13.12" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-proposal-private-methods@7.13.0" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-proposal-unicode-property-regex@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-syntax-async-generators@7.8.4" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-syntax-class-properties@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-syntax-dynamic-import@7.8.3" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-syntax-export-namespace-from@7.8.3" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-syntax-json-strings@7.8.3" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-syntax-logical-assignment-operators@7.10.4" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-syntax-nullish-coalescing-operator@7.8.3" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-syntax-numeric-separator@7.10.4" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-syntax-object-rest-spread@7.8.3" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-syntax-optional-catch-binding@7.8.3" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-syntax-optional-chaining@7.8.3" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-syntax-top-level-await@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-transform-arrow-functions@7.13.0" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-transform-async-to-generator@7.13.0" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-transform-block-scoped-functions@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-transform-block-scoping@7.13.16" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-transform-classes@7.13.0" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-transform-computed-properties@7.13.0" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-transform-destructuring@7.13.17" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-transform-dotall-regex@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-transform-duplicate-keys@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-transform-exponentiation-operator@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-transform-for-of@7.13.0" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-transform-function-name@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-transform-literals@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-transform-member-expression-literals@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-transform-modules-amd@7.13.0" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-transform-modules-commonjs@7.13.8" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-transform-modules-systemjs@7.13.8" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-transform-modules-umd@7.13.0" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-transform-named-capturing-groups-regex@7.12.13" has unmet peer dependency "@babel/core@^7.0.0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-transform-new-target@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-transform-object-super@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-transform-parameters@7.13.0" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-transform-property-literals@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-transform-regenerator@7.13.15" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-transform-reserved-words@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-transform-shorthand-properties@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-transform-spread@7.13.0" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-transform-sticky-regex@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-transform-template-literals@7.13.0" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-transform-typeof-symbol@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-transform-unicode-escapes@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-transform-unicode-regex@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/preset-modules@0.1.4" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > babel-plugin-polyfill-corejs2@0.2.0" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > babel-plugin-polyfill-corejs3@0.2.0" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > babel-plugin-polyfill-regenerator@0.2.0" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-react > @babel/plugin-transform-react-display-name@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-react > @babel/plugin-transform-react-jsx@7.13.12" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-react > @babel/plugin-transform-react-jsx-development@7.12.17" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-react > @babel/plugin-transform-react-pure-annotations@7.12.1" has unmet peer dependency "@babel/core@^7.0.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > @babel/plugin-proposal-unicode-property-regex > @babel/helper-create-regexp-features-plugin@7.12.17" has unmet peer dependency "@babel/core@^7.0.0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-env > babel-plugin-polyfill-corejs2 > @babel/helper-define-polyfill-provider@0.2.0" has unmet peer dependency "@babel/core@^7.4.0-0". warning "parcel > @parcel/config-default > @parcel/transformer-babel > @babel/preset-react > @babel/plugin-transform-react-jsx > @babel/plugin-syntax-jsx@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0". --- package.json | 3 + yarn.lock | 157 ++++++++++++++++++++++++++++++--------------------- 2 files changed, 96 insertions(+), 64 deletions(-) diff --git a/package.json b/package.json index 495b6be..366025d 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "license": "MIT", "devDependencies": { "@babel/code-frame": "^7.12.13", + "@babel/core": "^7.14.3", "@parcel/transformer-image": "2.0.0-beta.2", "@parcel/transformer-yaml": "2.0.0-beta.2", "babel-eslint": "^10.1.0", @@ -17,6 +18,7 @@ "flow-bin": "^0.149.0", "husky": "^6.0.0", "parcel": "^2.0.0-beta.2", + "postcss": "^8.3.0", "sharp": "^0.28.1", "yarn-deduplicate": "^3.1.0" }, @@ -32,6 +34,7 @@ "prepare": "husky install" }, "dependencies": { + "@types/react": "^17.0.7", "i18next": "^20.2.4", "i18next-browser-languagedetector": "^6.1.1", "react": "^17.0.2", diff --git a/yarn.lock b/yarn.lock index bfa4b48..3e11fe4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -21,20 +21,20 @@ resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.13.15.tgz" integrity sha512-ltnibHKR1VnrU4ymHyQ/CXtNXI6yZC0oJThyW78Hft8XndANwi+9H+UIklBDraIjFEJzw8wmcM427oDd9KS5wA== -"@babel/core@^7.12.0": - version "7.13.16" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.13.16.tgz" - integrity sha512-sXHpixBiWWFti0AV2Zq7avpTasr6sIAu7Y396c608541qAU2ui4a193m0KSQmfPSKFZLnQ3cvlKDOm3XkuXm3Q== +"@babel/core@^7.12.0", "@babel/core@^7.14.3": + version "7.14.3" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.14.3.tgz#5395e30405f0776067fbd9cf0884f15bfb770a38" + integrity sha512-jB5AmTKOCSJIZ72sd78ECEhuPiDMKlQdDI/4QRI6lzYATx5SSogS1oQA2AoPecRCknm30gHi2l+QVvNUu3wZAg== dependencies: "@babel/code-frame" "^7.12.13" - "@babel/generator" "^7.13.16" + "@babel/generator" "^7.14.3" "@babel/helper-compilation-targets" "^7.13.16" - "@babel/helper-module-transforms" "^7.13.14" - "@babel/helpers" "^7.13.16" - "@babel/parser" "^7.13.16" + "@babel/helper-module-transforms" "^7.14.2" + "@babel/helpers" "^7.14.0" + "@babel/parser" "^7.14.3" "@babel/template" "^7.12.13" - "@babel/traverse" "^7.13.15" - "@babel/types" "^7.13.16" + "@babel/traverse" "^7.14.2" + "@babel/types" "^7.14.2" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" @@ -42,12 +42,12 @@ semver "^6.3.0" source-map "^0.5.0" -"@babel/generator@^7.13.16": - version "7.13.16" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.13.16.tgz" - integrity sha512-grBBR75UnKOcUWMp8WoDxNsWCFl//XCK6HWTrBQKTr5SV9f5g0pNOjdyzi/DTBv12S9GnYPInIXQBTky7OXEMg== +"@babel/generator@^7.14.2", "@babel/generator@^7.14.3": + version "7.14.3" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.14.3.tgz#0c2652d91f7bddab7cccc6ba8157e4f40dcedb91" + integrity sha512-bn0S6flG/j0xtQdz3hsjJ624h3W0r3llttBMfyHX3YrZ/KtLYr15bjA0FXkgW7FpvrDuTuElXeVjiKlYRpnOFA== dependencies: - "@babel/types" "^7.13.16" + "@babel/types" "^7.14.2" jsesc "^2.5.1" source-map "^0.5.0" @@ -116,14 +116,14 @@ dependencies: "@babel/types" "^7.13.0" -"@babel/helper-function-name@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz" - integrity sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA== +"@babel/helper-function-name@^7.12.13", "@babel/helper-function-name@^7.14.2": + version "7.14.2" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.14.2.tgz#397688b590760b6ef7725b5f0860c82427ebaac2" + integrity sha512-NYZlkZRydxw+YT56IlhIcS8PAhb+FEUiOzuhFTfqDyPmzAhRge6ua0dQYT/Uh0t/EDHq05/i+e5M2d4XvjgarQ== dependencies: "@babel/helper-get-function-arity" "^7.12.13" "@babel/template" "^7.12.13" - "@babel/types" "^7.12.13" + "@babel/types" "^7.14.2" "@babel/helper-get-function-arity@^7.12.13": version "7.12.13" @@ -154,19 +154,19 @@ dependencies: "@babel/types" "^7.13.12" -"@babel/helper-module-transforms@^7.13.0", "@babel/helper-module-transforms@^7.13.14": - version "7.13.14" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.13.14.tgz" - integrity sha512-QuU/OJ0iAOSIatyVZmfqB0lbkVP0kDRiKj34xy+QNsnVZi/PA6BoSoreeqnxxa9EHFAIL0R9XOaAR/G9WlIy5g== +"@babel/helper-module-transforms@^7.13.0", "@babel/helper-module-transforms@^7.14.2": + version "7.14.2" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.14.2.tgz#ac1cc30ee47b945e3e0c4db12fa0c5389509dfe5" + integrity sha512-OznJUda/soKXv0XhpvzGWDnml4Qnwp16GN+D/kZIdLsWoHj05kyu8Rm5kXmMef+rVJZ0+4pSGLkeixdqNUATDA== dependencies: "@babel/helper-module-imports" "^7.13.12" "@babel/helper-replace-supers" "^7.13.12" "@babel/helper-simple-access" "^7.13.12" "@babel/helper-split-export-declaration" "^7.12.13" - "@babel/helper-validator-identifier" "^7.12.11" + "@babel/helper-validator-identifier" "^7.14.0" "@babel/template" "^7.12.13" - "@babel/traverse" "^7.13.13" - "@babel/types" "^7.13.14" + "@babel/traverse" "^7.14.2" + "@babel/types" "^7.14.2" "@babel/helper-optimise-call-expression@^7.12.13": version "7.12.13" @@ -220,10 +220,10 @@ dependencies: "@babel/types" "^7.12.13" -"@babel/helper-validator-identifier@^7.12.11": - version "7.12.11" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz" - integrity sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw== +"@babel/helper-validator-identifier@^7.12.11", "@babel/helper-validator-identifier@^7.14.0": + version "7.14.0" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz#d26cad8a47c65286b15df1547319a5d0bcf27288" + integrity sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A== "@babel/helper-validator-option@^7.12.17": version "7.12.17" @@ -240,14 +240,14 @@ "@babel/traverse" "^7.13.0" "@babel/types" "^7.13.0" -"@babel/helpers@^7.13.16": - version "7.13.17" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.13.17.tgz" - integrity sha512-Eal4Gce4kGijo1/TGJdqp3WuhllaMLSrW6XcL0ulyUAQOuxHcCafZE8KHg9857gcTehsm/v7RcOx2+jp0Ryjsg== +"@babel/helpers@^7.14.0": + version "7.14.0" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.14.0.tgz#ea9b6be9478a13d6f961dbb5f36bf75e2f3b8f62" + integrity sha512-+ufuXprtQ1D1iZTO/K9+EBRn+qPWMJjZSw/S0KlFrxCw4tkrzv9grgpDHkY9MeQTjTY8i2sp7Jep8DfU6tN9Mg== dependencies: "@babel/template" "^7.12.13" - "@babel/traverse" "^7.13.17" - "@babel/types" "^7.13.17" + "@babel/traverse" "^7.14.0" + "@babel/types" "^7.14.0" "@babel/highlight@^7.10.4", "@babel/highlight@^7.12.13": version "7.13.10" @@ -258,10 +258,10 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.0.0", "@babel/parser@^7.12.13", "@babel/parser@^7.13.16", "@babel/parser@^7.7.0": - version "7.13.16" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.13.16.tgz" - integrity sha512-6bAg36mCwuqLO0hbR+z7PHuqWiCeP7Dzg73OpQwsAB1Eb8HnGEz5xYBzCfbu+YjoaJsJs+qheDxVAuqbt3ILEw== +"@babel/parser@^7.0.0", "@babel/parser@^7.12.13", "@babel/parser@^7.14.2", "@babel/parser@^7.14.3", "@babel/parser@^7.7.0": + version "7.14.3" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.14.3.tgz#9b530eecb071fd0c93519df25c5ff9f14759f298" + integrity sha512-7MpZDIfI7sUC5zWo2+foJ50CSI5lcqDehZ0lVgIhSi4bFEk94fLAKlF3Q0nzSQQ+ca0lm+O6G9ztKVBeu8PMRQ== "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.13.12": version "7.13.12" @@ -906,26 +906,26 @@ "@babel/parser" "^7.12.13" "@babel/types" "^7.12.13" -"@babel/traverse@^7.0.0", "@babel/traverse@^7.13.0", "@babel/traverse@^7.13.13", "@babel/traverse@^7.13.15", "@babel/traverse@^7.13.17", "@babel/traverse@^7.2.3", "@babel/traverse@^7.7.0": - version "7.13.17" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.13.17.tgz" - integrity sha512-BMnZn0R+X6ayqm3C3To7o1j7Q020gWdqdyP50KEoVqaCO2c/Im7sYZSmVgvefp8TTMQ+9CtwuBp0Z1CZ8V3Pvg== +"@babel/traverse@^7.0.0", "@babel/traverse@^7.13.0", "@babel/traverse@^7.13.15", "@babel/traverse@^7.14.0", "@babel/traverse@^7.14.2", "@babel/traverse@^7.2.3", "@babel/traverse@^7.7.0": + version "7.14.2" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.14.2.tgz#9201a8d912723a831c2679c7ebbf2fe1416d765b" + integrity sha512-TsdRgvBFHMyHOOzcP9S6QU0QQtjxlRpEYOy3mcCO5RgmC305ki42aSAmfZEMSSYBla2oZ9BMqYlncBaKmD/7iA== dependencies: "@babel/code-frame" "^7.12.13" - "@babel/generator" "^7.13.16" - "@babel/helper-function-name" "^7.12.13" + "@babel/generator" "^7.14.2" + "@babel/helper-function-name" "^7.14.2" "@babel/helper-split-export-declaration" "^7.12.13" - "@babel/parser" "^7.13.16" - "@babel/types" "^7.13.17" + "@babel/parser" "^7.14.2" + "@babel/types" "^7.14.2" debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.12.1", "@babel/types@^7.12.13", "@babel/types@^7.13.0", "@babel/types@^7.13.12", "@babel/types@^7.13.14", "@babel/types@^7.13.16", "@babel/types@^7.13.17", "@babel/types@^7.4.4", "@babel/types@^7.7.0": - version "7.13.17" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.13.17.tgz" - integrity sha512-RawydLgxbOPDlTLJNtoIypwdmAy//uQIzlKt2+iBiJaRlVuI6QLUxVAyWGNfOzp8Yu4L4lLIacoCyTNtpb4wiA== +"@babel/types@^7.12.1", "@babel/types@^7.12.13", "@babel/types@^7.13.0", "@babel/types@^7.13.12", "@babel/types@^7.13.14", "@babel/types@^7.13.16", "@babel/types@^7.14.0", "@babel/types@^7.14.2", "@babel/types@^7.4.4", "@babel/types@^7.7.0": + version "7.14.2" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.14.2.tgz#4208ae003107ef8a057ea8333e56eb64d2f6a2c3" + integrity sha512-SdjAG/3DikRHpUOjxZgnkbR11xUlyDMUFJdvnIgZEE16mqmY0BINMmc4//JMJglEmn6i7sq6p+mGrFWyZ98EEw== dependencies: - "@babel/helper-validator-identifier" "^7.12.11" + "@babel/helper-validator-identifier" "^7.14.0" to-fast-properties "^2.0.0" "@eslint/eslintrc@^0.4.0": @@ -1601,11 +1601,30 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-15.0.1.tgz" integrity sha512-TMkXt0Ck1y0KKsGr9gJtWGjttxlZnnvDtphxUOSd0bfaR6Q1jle+sPvrzNR1urqYTWMinoKvjKfXUGsumaO1PA== +"@types/prop-types@*": + version "15.7.3" + resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.3.tgz#2ab0d5da2e5815f94b0b9d4b95d1e5f243ab2ca7" + integrity sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw== + "@types/q@^1.5.1": version "1.5.4" resolved "https://registry.yarnpkg.com/@types/q/-/q-1.5.4.tgz" integrity sha512-1HcDas8SEj4z1Wc696tH56G8OlRaH/sqZOynNNB+HF0WOeXPaxTtbYzJY2oEfiUxjSKjhCKr+MvR7dCHcEelug== +"@types/react@^17.0.7": + version "17.0.7" + resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.7.tgz#5f2ca73d8baee8c286e96c95df557799ac0d1996" + integrity sha512-lBc3fY20hRFQ/pXQT2XdtmpJeXZnRH8N+WPnEzEfPTzuKmaJTA7k/xGWHBaPvKceKpbf0ZnMlLWY/0sFZ5rfkw== + dependencies: + "@types/prop-types" "*" + "@types/scheduler" "*" + csstype "^3.0.2" + +"@types/scheduler@*": + version "0.16.1" + resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.1.tgz#18845205e86ff0038517aab7a18a62a6b9f71275" + integrity sha512-EaCxbanVeyxDRTQBkdLb3Bvl/HK7PBK6UJjsSixB0iHKoWxE5uu2Q/DgtpOhPIojN0Zl1whvOd7PoHs2P0s5eA== + "@types/unist@*", "@types/unist@^2.0.0", "@types/unist@^2.0.2", "@types/unist@^2.0.3": version "2.0.3" resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.3.tgz#9c088679876f374eb5983f150d4787aa6fb32d7e" @@ -2753,6 +2772,11 @@ cssstyle@^1.1.1: dependencies: cssom "0.3.x" +csstype@^3.0.2: + version "3.0.8" + resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.0.8.tgz#d2266a792729fb227cd216fb572f43728e1ad340" + integrity sha512-jXKhWqXPmlUeoQnF/EhTtTl4C9SnrxSH/jZUih3jmO6lBKr99rP3/+FmrMj4EFpOXzMtXHAZkd3x0E6h6Fgflw== + damerau-levenshtein@^1.0.6: version "1.0.6" resolved "https://registry.npmjs.org/damerau-levenshtein/-/damerau-levenshtein-1.0.6.tgz" @@ -4950,10 +4974,10 @@ ms@2.1.2: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -nanoid@^3.1.22: - version "3.1.22" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.22.tgz" - integrity sha512-/2ZUaJX2ANuLtTvqTlgqBQNJoQO398KyJgZloL0PZkC0dpysjncRUPsFe3DUPzz/y3h+u7C46np8RMuvF3jsSQ== +nanoid@^3.1.23: + version "3.1.23" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.23.tgz#f744086ce7c2bc47ee0a8472574d5c78e4183a81" + integrity sha512-FiB0kzdP0FFVGDKlRLEQ1BgDzU87dy5NnzjeW9YZNt+/c3+q82EQDUwniSAUxp/F0gFNI1ZhKU1FqYsMuqZVnw== nanomatch@^1.2.9: version "1.2.13" @@ -5842,14 +5866,14 @@ postcss@^7.0.0, postcss@^7.0.1, postcss@^7.0.14, postcss@^7.0.17, postcss@^7.0.2 source-map "^0.6.1" supports-color "^6.1.0" -postcss@^8.0.5, postcss@^8.2.1: - version "8.2.13" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.2.13.tgz" - integrity sha512-FCE5xLH+hjbzRdpbRb1IMCvPv9yZx2QnDarBEYSN0N0HYk+TcXsEhwdFcFb+SRWOKzKGErhIEbBK2ogyLdTtfQ== +postcss@^8.0.5, postcss@^8.2.1, postcss@^8.3.0: + version "8.3.0" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.3.0.tgz#b1a713f6172ca427e3f05ef1303de8b65683325f" + integrity sha512-+ogXpdAjWGa+fdYY5BQ96V/6tAo+TdSSIMP5huJBIygdWwKtVoB5JWZ7yUd4xZ8r+8Kvvx4nyg/PQ071H4UtcQ== dependencies: colorette "^1.2.2" - nanoid "^3.1.22" - source-map "^0.6.1" + nanoid "^3.1.23" + source-map-js "^0.6.2" posthtml-parser@^0.6.0: version "0.6.0" @@ -6654,6 +6678,11 @@ snapdragon@^0.8.1: source-map-resolve "^0.5.0" use "^3.1.0" +source-map-js@^0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-0.6.2.tgz#0bb5de631b41cfbda6cfba8bd05a80efdfd2385e" + integrity sha512-/3GptzWzu0+0MBQFrDKzw/DvvMTUORvgY6k6jd/VS6iCR4RDTKWH6v6WPwQoUO8667uQEf9Oe38DxAYWY5F/Ug== + source-map-resolve@^0.5.0: version "0.5.3" resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.3.tgz" From 4c50a1ef22924ba95fcf575db5cf917c45ed49c5 Mon Sep 17 00:00:00 2001 From: Chris Bobbe Date: Tue, 25 May 2021 16:13:11 -0400 Subject: [PATCH 4/9] types: Use `number` type instead of `Number`. `Number` is for the wrapper object, i.e., the result of calling `new Number(...)`, so it's rarely quite the right thing to use. The lowercase form is for literal values [1] . Unfortunately, code editors will sometimes suggest the capitalized type in autocomplete, which is unhelpful. [1] https://flow.org/en/docs/types/primitives/ --- frontend/Types/Hospital.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/Types/Hospital.js b/frontend/Types/Hospital.js index d872dbd..ef857b9 100644 --- a/frontend/Types/Hospital.js +++ b/frontend/Types/Hospital.js @@ -7,7 +7,7 @@ export type Hospital = {| address: string, department: string, governmentPaidAvailability: Availability, - hospitalId: Number, + hospitalId: number, location: Location, name: string, phone: string, From f69da8cb7d14b3096fb65160dec96549db9b265d Mon Sep 17 00:00:00 2001 From: Chris Bobbe Date: Wed, 26 May 2021 09:19:55 -0400 Subject: [PATCH 5/9] Cards: Stop passing `hospitalId` to `Card`, which doesn't ask for it. This small error would be caught when we make more of our object types exact, in the next commit. Passing the prop wasn't intentional [1], so stop passing it. [1] https://github.com/g0v/vaccinate/pull/83#discussion_r639453274 --- frontend/Components/VaccineInfo/Cards.jsx | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/Components/VaccineInfo/Cards.jsx b/frontend/Components/VaccineInfo/Cards.jsx index eef0dd9..3cd79f7 100644 --- a/frontend/Components/VaccineInfo/Cards.jsx +++ b/frontend/Components/VaccineInfo/Cards.jsx @@ -18,7 +18,6 @@ export default function Cards( availability={getAvailability(hospital, vaccineType)} buttonText={buttonText} department={hospital.department} - hospitalId={hospital.hospitalId} location={hospital.location} name={hospital.name} phone={hospital.phone} From 7efd9f8d277f137b908b35c3dc0ac1c88e6cdff3 Mon Sep 17 00:00:00 2001 From: Chris Bobbe Date: Tue, 25 May 2021 16:17:32 -0400 Subject: [PATCH 6/9] flow: Make implicitly inexact object types explicitly exact. It looks like all these object types would benefit from being exact; so, make them exact. These were using the implicitly inexact syntax (`{foo: number}`), not the explicitly inexact syntax (`{foo: number, ...}`), but they were still inexact. We know we've caught all implicitly inexact object types because the `implicit-inexact-object` [1] lint is set to `error`, and Flow doesn't report any errors at this commit. We're about to turn on `exact_by_default` [2], which will change the meaning of the `{foo: number}` syntax to implicitly *exact*, leaving the option of `{| foo: number |}` for explicitly exact, and `{foo: number, ...}` for explicitly inexact. That'll make it easier to get tighter type checking on object types in general, since most of the time we want them to be exact. [1] https://flow.org/en/docs/linting/rule-reference/#toc-implicit-inexact-object [2] https://flow.org/en/docs/config/options/#toc-exact-by-default-boolean --- .flowconfig | 1 + frontend/Components/VaccineInfo.jsx | 2 +- frontend/Components/VaccineInfo/Accordion.jsx | 2 +- frontend/Components/VaccineInfo/AccordionItem.jsx | 4 ++-- frontend/Components/VaccineInfo/Card.jsx | 4 ++-- frontend/Components/VaccineInfo/Cards.jsx | 2 +- frontend/Components/VaccineInfo/DataGrid.jsx | 4 ++-- 7 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.flowconfig b/.flowconfig index 1fed445..5ba370e 100644 --- a/.flowconfig +++ b/.flowconfig @@ -5,6 +5,7 @@ [libs] [lints] +implicit-inexact-object=error [options] diff --git a/frontend/Components/VaccineInfo.jsx b/frontend/Components/VaccineInfo.jsx index 75d2a85..89b2745 100644 --- a/frontend/Components/VaccineInfo.jsx +++ b/frontend/Components/VaccineInfo.jsx @@ -8,7 +8,7 @@ import type { Hospital } from '../Types/Hospital'; import type { VaccineType } from '../Types/VaccineType'; export default function VaccineDataGrid( - props: { rows: Array, vaccineType: VaccineType }, + props: {| rows: Array, vaccineType: VaccineType |}, ): React.Node { const { rows, vaccineType } = props; const { t } = useTranslation('dataGrid'); diff --git a/frontend/Components/VaccineInfo/Accordion.jsx b/frontend/Components/VaccineInfo/Accordion.jsx index 7ac62e9..8c64a39 100644 --- a/frontend/Components/VaccineInfo/Accordion.jsx +++ b/frontend/Components/VaccineInfo/Accordion.jsx @@ -3,7 +3,7 @@ import * as React from 'react'; import AccordionItem from './AccordionItem'; export default function Accordion( - props: { id: string, children: React.Element[] }, + props: {| id: string, children: React.Element[] |}, ): React.Node { const { children, id } = props; const [expandedIndex, setExpandedIndex] = React.useState(0); diff --git a/frontend/Components/VaccineInfo/AccordionItem.jsx b/frontend/Components/VaccineInfo/AccordionItem.jsx index 0b3515c..8d641fa 100644 --- a/frontend/Components/VaccineInfo/AccordionItem.jsx +++ b/frontend/Components/VaccineInfo/AccordionItem.jsx @@ -2,13 +2,13 @@ import * as React from 'react'; export default function AccordionItem( - props: { + props: {| id: string, title: string, parentID?: string, children: React.Node, collapsedByDefault?: boolean, - setExpandedIndex?: number => void}, + setExpandedIndex?: number => void|}, ): React.Node { const { id, diff --git a/frontend/Components/VaccineInfo/Card.jsx b/frontend/Components/VaccineInfo/Card.jsx index f4571ca..1bf8ef8 100644 --- a/frontend/Components/VaccineInfo/Card.jsx +++ b/frontend/Components/VaccineInfo/Card.jsx @@ -28,7 +28,7 @@ function getBadgeText(availability: Availability, t): string { } } -export default function Card(props: { +export default function Card(props: {| address: string, availability: Availability, buttonText: string, @@ -37,7 +37,7 @@ export default function Card(props: { name: string, phone: string, website: string, -}): React.Node { +|}): React.Node { const { address, availability, diff --git a/frontend/Components/VaccineInfo/Cards.jsx b/frontend/Components/VaccineInfo/Cards.jsx index 3cd79f7..aef7aba 100644 --- a/frontend/Components/VaccineInfo/Cards.jsx +++ b/frontend/Components/VaccineInfo/Cards.jsx @@ -7,7 +7,7 @@ import type { Hospital } from '../../Types/Hospital'; import type { VaccineType } from '../../Types/VaccineType'; export default function Cards( - props: { hospitals: Hospital[], vaccineType: VaccineType, buttonText: string}, + props: {| hospitals: Hospital[], vaccineType: VaccineType, buttonText: string|}, ): React.Node { const { hospitals, buttonText, vaccineType } = props; diff --git a/frontend/Components/VaccineInfo/DataGrid.jsx b/frontend/Components/VaccineInfo/DataGrid.jsx index 1d8dff2..186f823 100644 --- a/frontend/Components/VaccineInfo/DataGrid.jsx +++ b/frontend/Components/VaccineInfo/DataGrid.jsx @@ -8,11 +8,11 @@ import type { Hospital } from '../../Types/Hospital'; import type { Location } from '../../Types/Location'; import type { VaccineType } from '../../Types/VaccineType'; -export default function DataGrid(props: { +export default function DataGrid(props: {| hospitals: Hospital[], buttonText: string, vaccineType: VaccineType, -}): React.Node { +|}): React.Node { const { t } = useTranslation('dataGrid'); const [cityT] = useTranslation('city'); const { From 8ba86cdea97f51d5ce3a77d6a52a7d558b88df83 Mon Sep 17 00:00:00 2001 From: Chris Bobbe Date: Tue, 25 May 2021 16:32:10 -0400 Subject: [PATCH 7/9] flow: Enable `exact_by_default`. This was a much-anticipated feature [1] that's available in recent versions of Flow. We'll still be able to make object types inexact, but we'll have to do it explicitly, with a marked syntax. That seems appropriate: since we don't want to use them as often, it makes sense for them to be marked, and for exact object types to be unmarked. As explained in the docs [2], ```` Set this to `true` to indicate that Flow should interpret object types as exact by default. When this flag is `false`, Flow has the following behavior: ```js {foo: number} // inexact {| foo: number |} // exact {foo: number, ...} // inexact ``` When this flag is `true`, Flow has the following behavior: ```js {foo: number} // exact {| foo: number |} // exact {foo: number, ...} // inexact ``` The default value is `false`. ```` [1] https://medium.com/flow-type/on-the-roadmap-exact-objects-by-default-16b72933c5cf [2] https://flow.org/en/docs/config/options/#toc-exact-by-default-boolean --- .flowconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.flowconfig b/.flowconfig index 5ba370e..a5cb80e 100644 --- a/.flowconfig +++ b/.flowconfig @@ -5,8 +5,8 @@ [libs] [lints] -implicit-inexact-object=error [options] +exact_by_default=true [strict] From e071f5eaa686b772145f6e226ab69f3191138662 Mon Sep 17 00:00:00 2001 From: Chris Bobbe Date: Tue, 25 May 2021 16:35:09 -0400 Subject: [PATCH 8/9] flow: Use implicitly *exact* object types, now that we can! In the previous commit, we enabled the `exact_by_default` option [1]. Now, we can make our exact object types unmarked. Since we expect to use exact object types more often than inexact ones, it makes sense for the exact ones to be unmarked, and to require the inexact ones to be marked (with `, ...` as in `{foo: number, ...}`). To confirm that this works, try adding a `nonsense="123"` prop to the `Card` callsite in frontend/Components/VaccineInfo/Cards.jsx. [1] https://flow.org/en/docs/config/options/#toc-exact-by-default-boolean --- frontend/Components/VaccineInfo.jsx | 2 +- frontend/Components/VaccineInfo/Accordion.jsx | 2 +- frontend/Components/VaccineInfo/AccordionItem.jsx | 4 ++-- frontend/Components/VaccineInfo/Card.jsx | 4 ++-- frontend/Components/VaccineInfo/Cards.jsx | 2 +- frontend/Components/VaccineInfo/DataGrid.jsx | 4 ++-- frontend/Types/Hospital.js | 4 ++-- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/frontend/Components/VaccineInfo.jsx b/frontend/Components/VaccineInfo.jsx index 89b2745..75d2a85 100644 --- a/frontend/Components/VaccineInfo.jsx +++ b/frontend/Components/VaccineInfo.jsx @@ -8,7 +8,7 @@ import type { Hospital } from '../Types/Hospital'; import type { VaccineType } from '../Types/VaccineType'; export default function VaccineDataGrid( - props: {| rows: Array, vaccineType: VaccineType |}, + props: { rows: Array, vaccineType: VaccineType }, ): React.Node { const { rows, vaccineType } = props; const { t } = useTranslation('dataGrid'); diff --git a/frontend/Components/VaccineInfo/Accordion.jsx b/frontend/Components/VaccineInfo/Accordion.jsx index 8c64a39..7ac62e9 100644 --- a/frontend/Components/VaccineInfo/Accordion.jsx +++ b/frontend/Components/VaccineInfo/Accordion.jsx @@ -3,7 +3,7 @@ import * as React from 'react'; import AccordionItem from './AccordionItem'; export default function Accordion( - props: {| id: string, children: React.Element[] |}, + props: { id: string, children: React.Element[] }, ): React.Node { const { children, id } = props; const [expandedIndex, setExpandedIndex] = React.useState(0); diff --git a/frontend/Components/VaccineInfo/AccordionItem.jsx b/frontend/Components/VaccineInfo/AccordionItem.jsx index 8d641fa..0b3515c 100644 --- a/frontend/Components/VaccineInfo/AccordionItem.jsx +++ b/frontend/Components/VaccineInfo/AccordionItem.jsx @@ -2,13 +2,13 @@ import * as React from 'react'; export default function AccordionItem( - props: {| + props: { id: string, title: string, parentID?: string, children: React.Node, collapsedByDefault?: boolean, - setExpandedIndex?: number => void|}, + setExpandedIndex?: number => void}, ): React.Node { const { id, diff --git a/frontend/Components/VaccineInfo/Card.jsx b/frontend/Components/VaccineInfo/Card.jsx index 1bf8ef8..f4571ca 100644 --- a/frontend/Components/VaccineInfo/Card.jsx +++ b/frontend/Components/VaccineInfo/Card.jsx @@ -28,7 +28,7 @@ function getBadgeText(availability: Availability, t): string { } } -export default function Card(props: {| +export default function Card(props: { address: string, availability: Availability, buttonText: string, @@ -37,7 +37,7 @@ export default function Card(props: {| name: string, phone: string, website: string, -|}): React.Node { +}): React.Node { const { address, availability, diff --git a/frontend/Components/VaccineInfo/Cards.jsx b/frontend/Components/VaccineInfo/Cards.jsx index aef7aba..3cd79f7 100644 --- a/frontend/Components/VaccineInfo/Cards.jsx +++ b/frontend/Components/VaccineInfo/Cards.jsx @@ -7,7 +7,7 @@ import type { Hospital } from '../../Types/Hospital'; import type { VaccineType } from '../../Types/VaccineType'; export default function Cards( - props: {| hospitals: Hospital[], vaccineType: VaccineType, buttonText: string|}, + props: { hospitals: Hospital[], vaccineType: VaccineType, buttonText: string}, ): React.Node { const { hospitals, buttonText, vaccineType } = props; diff --git a/frontend/Components/VaccineInfo/DataGrid.jsx b/frontend/Components/VaccineInfo/DataGrid.jsx index 186f823..1d8dff2 100644 --- a/frontend/Components/VaccineInfo/DataGrid.jsx +++ b/frontend/Components/VaccineInfo/DataGrid.jsx @@ -8,11 +8,11 @@ import type { Hospital } from '../../Types/Hospital'; import type { Location } from '../../Types/Location'; import type { VaccineType } from '../../Types/VaccineType'; -export default function DataGrid(props: {| +export default function DataGrid(props: { hospitals: Hospital[], buttonText: string, vaccineType: VaccineType, -|}): React.Node { +}): React.Node { const { t } = useTranslation('dataGrid'); const [cityT] = useTranslation('city'); const { diff --git a/frontend/Types/Hospital.js b/frontend/Types/Hospital.js index ef857b9..c4e2168 100644 --- a/frontend/Types/Hospital.js +++ b/frontend/Types/Hospital.js @@ -3,7 +3,7 @@ import type { Availability } from './Availability'; import type { Location } from './Location'; import type { VaccineType } from './VaccineType'; -export type Hospital = {| +export type Hospital = { address: string, department: string, governmentPaidAvailability: Availability, @@ -13,7 +13,7 @@ export type Hospital = {| phone: string, selfPaidAvailability: Availability, website: string, - |}; + }; export function getAvailability(hospital: Hospital, vaccineType: VaccineType): Availability { return vaccineType === 'SelfPaid' From fa31fbfc786294c456a064d42b6ea1ae71d3340a Mon Sep 17 00:00:00 2001 From: Chris Bobbe Date: Tue, 25 May 2021 16:53:22 -0400 Subject: [PATCH 9/9] VaccineInfo: Rename exported function, from `VaccineDataGrid`. Continuing the refactor in a760f7514. --- frontend/Components/VaccineInfo.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/Components/VaccineInfo.jsx b/frontend/Components/VaccineInfo.jsx index 75d2a85..6f1e927 100644 --- a/frontend/Components/VaccineInfo.jsx +++ b/frontend/Components/VaccineInfo.jsx @@ -7,7 +7,7 @@ import { getAvailability } from '../Types/Hospital'; import type { Hospital } from '../Types/Hospital'; import type { VaccineType } from '../Types/VaccineType'; -export default function VaccineDataGrid( +export default function VaccineInfo( props: { rows: Array, vaccineType: VaccineType }, ): React.Node { const { rows, vaccineType } = props;