Skip to content

Commit

Permalink
chore: fix broken recipes test (#33013)
Browse files Browse the repository at this point in the history
* chore: fix tests

* fix polyfills

* Update polyfills.js

* fix renovate

* rever core-js

* fix core-js
  • Loading branch information
wardpeet committed Sep 1, 2021
1 parent 58e628a commit 476a00f
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 53 deletions.
2 changes: 1 addition & 1 deletion packages/gatsby-legacy-polyfills/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"devDependencies": {
"chokidar-cli": "^3.0.0",
"codegen.macro": "^4.1.0",
"core-js": "3.16.0",
"core-js": "3.9.0",
"cpy-cli": "^3.1.1",
"cross-env": "^7.0.3",
"execa": "^5.1.1",
Expand Down
22 changes: 14 additions & 8 deletions packages/gatsby-legacy-polyfills/src/__tests__/polyfills.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,34 @@ describe(`polyfills`, () => {

afterAll(() => fs.remove(path.join(packageRoot, tmpDir)))

it(`has the correct polyfills`, () => {
it(`has the correct polyfills`, done => {
const polyfills = require(`../exclude`).LEGACY_POLYFILLS
const polyfillMap = path.join(packageRoot, tmpDir, `polyfills.js.map`)
expect(fs.existsSync(polyfillMap)).toBe(true)

const fileMap = polyfills.map(
polyfill =>
`core-js/modules/${polyfill
.replace(/^(features|modules)\//, `es.`)
.replace(`/`, `.`)}`
)
const fileMap = polyfills.map(polyfill => {
if (polyfill === `features/dom-collections`) {
return `core-js/modules/web.dom-collections`
}

return `core-js/modules/${polyfill
.replace(/^(features|modules)\//, `es.`)
.replace(`/`, `.`)}`
})

const polyfillMapSource = fs.readFileSync(polyfillMap, `utf8`)
SourceMapConsumer.with(polyfillMapSource, null, consumer => {
const sources = consumer.sources
const sources = consumer.sources.map(source =>
source.replace(/.*\/node_modules\//, ``)
)

// check if all polyfills are in the bundle
expect(sources).toEqual(
expect.arrayContaining(
fileMap.map(file => expect.stringContaining(file))
)
)
done()
})
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ Object {

exports[`npm package resource installs 2 resources, one prod & one dev 1`] = `
Object {
"_message": "Installed NPM package div@2.0.0",
"_message": "Installed NPM package div@2.0.1",
"description": "<Div row> Use flexbox with ease in React! </Div>",
"id": "div",
"name": "div",
"version": "2.0.0",
"version": "2.0.1",
}
`;

Expand Down
4 changes: 1 addition & 3 deletions renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@
"groupName": "core-js",
"matchPaths": [
"+(package.json)",
"packages/**/package.json"
"packages/!(gatsby-legacy-polyfills)/**/package.json"
],
"matchPackageNames": [
"core-js",
Expand Down Expand Up @@ -27339,7 +27339,6 @@
"express-graphql",
"json-loader",
"memoizee",
"mkdirp",
"opentracing",
"react-refresh",
"source-map",
Expand Down Expand Up @@ -27395,7 +27394,6 @@
"express-graphql",
"json-loader",
"memoizee",
"mkdirp",
"opentracing",
"react-refresh",
"source-map",
Expand Down
5 changes: 4 additions & 1 deletion scripts/renovate-config-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,10 @@ const globalPackageRules = [
},
{
groupName: `core-js`,
matchPaths: [`+(package.json)`, `packages/**/package.json`],
matchPaths: [
`+(package.json)`,
`packages/!(gatsby-legacy-polyfills)/**/package.json`,
],
matchPackageNames: [`core-js`, `core-js-compat`],
matchUpdateTypes: [`major`, `minor`, `patch`],
matchDepTypes: [`dependencies`, `devDependencies`],
Expand Down
51 changes: 13 additions & 38 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3551,19 +3551,7 @@
"@types/set-cookie-parser" "^2.4.0"
set-cookie-parser "^2.4.6"

"@mswjs/interceptors@^0.12.3":
version "0.12.4"
resolved "https://registry.yarnpkg.com/@mswjs/interceptors/-/interceptors-0.12.4.tgz#e5d1a993e1f753fdb74fc601455ab77104993f2f"
integrity sha512-uHvJ7uZNTAg5e2+jLsBiGRaTz/wpGTmH0gfwTO2/p2Vd9BXlKMZoG7d6reYammHlIog4jtNU+A91zsf/MekvmQ==
dependencies:
"@open-draft/until" "^1.0.3"
debug "^4.3.0"
headers-utils "^3.0.2"
outvariant "^1.1.0"
strict-event-emitter "^0.2.0"
xmldom "^0.6.0"

"@mswjs/interceptors@^0.12.6":
"@mswjs/interceptors@^0.12.3", "@mswjs/interceptors@^0.12.6":
version "0.12.6"
resolved "https://registry.yarnpkg.com/@mswjs/interceptors/-/interceptors-0.12.6.tgz#0afb7c91e14875a1127ae5181d0eae31d50a9276"
integrity sha512-+1jaUpKEWXP4Yed4Lj9RftroZStw0NsEvEFjwJgc941xcaiTDYyBON4kpBY32RWd7UsW/xGE1piy8qt0Gfiqyw==
Expand Down Expand Up @@ -4548,11 +4536,6 @@
"@types/express-serve-static-core" "*"
"@types/serve-static" "*"

"@types/format-util@^1.0.1":
version "1.0.1"
resolved "https://registry.yarnpkg.com/@types/format-util/-/format-util-1.0.1.tgz#6fd9a41194776e2f33e2846ae955da8dbc8af4d1"
integrity sha512-uqU+S8ZeHlEslQgMzD6fpYhZlCqMfWR8MqoIMHy4uEy6VIkFqtZC25GKhl9n7fGmL0BZ51xrB5Ak8Wkb9oKw3A==

"@types/fs-extra@^9.0.12":
version "9.0.12"
resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-9.0.12.tgz#9b8f27973df8a7a3920e8461517ebf8a7d4fdfaf"
Expand Down Expand Up @@ -8686,16 +8669,21 @@ core-js-pure@^3.0.0:
resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.6.4.tgz#4bf1ba866e25814f149d4e9aaa08c36173506e3a"
integrity sha512-epIhRLkXdgv32xIUFaaAry2wdxZYBi6bgM7cB136dzzXXa+dFyRLTZeLUJxnd8ShrmyVXBub63n2NHo2JAt8Cw==

core-js@3.16.0, core-js@^3.0.0, core-js@^3.10.0, core-js@^3.14.0, core-js@^3.6.5, core-js@^3.8.1, core-js@^3.9.0:
version "3.16.0"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.16.0.tgz#1d46fb33720bc1fa7f90d20431f36a5540858986"
integrity sha512-5+5VxRFmSf97nM8Jr2wzOwLqRo6zphH2aX+7KsAUONObyzakDNq2G/bgbhinxB4PoV9L3aXQYhiDKyIKWd2c8g==
core-js@3.9.0:
version "3.9.0"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.9.0.tgz#790b1bb11553a2272b36e2625c7179db345492f8"
integrity sha512-PyFBJaLq93FlyYdsndE5VaueA9K5cNB7CGzeCj191YYLhkQM0gdZR2SKihM70oF0wdqKSKClv/tEBOpoRmdOVQ==

core-js@^2.4.0, core-js@^2.4.1, core-js@^2.5.0, core-js@^2.6.5:
version "2.6.11"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.11.tgz#38831469f9922bded8ee21c9dc46985e0399308c"
integrity sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg==

core-js@^3.0.0, core-js@^3.10.0, core-js@^3.14.0, core-js@^3.6.5, core-js@^3.8.1, core-js@^3.9.0:
version "3.16.0"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.16.0.tgz#1d46fb33720bc1fa7f90d20431f36a5540858986"
integrity sha512-5+5VxRFmSf97nM8Jr2wzOwLqRo6zphH2aX+7KsAUONObyzakDNq2G/bgbhinxB4PoV9L3aXQYhiDKyIKWd2c8g==

core-util-is@1.0.2, core-util-is@~1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
Expand Down Expand Up @@ -9444,7 +9432,7 @@ debug@3.1.0, debug@~3.1.0:
dependencies:
ms "2.0.0"

debug@4, debug@^4.0.0, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.2.0, debug@^4.3.0, debug@^4.3.1, debug@^4.3.2, debug@~4.3.1:
debug@4, debug@^4.0.0, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.2.0, debug@^4.3.1, debug@^4.3.2, debug@~4.3.1:
version "4.3.2"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b"
integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==
Expand Down Expand Up @@ -10680,7 +10668,7 @@ eslint-plugin-graphql@^4.0.0:
lodash.flatten "^4.4.0"
lodash.without "^4.4.0"

eslint-plugin-import@^2.23.4, eslint-plugin-import@^2.24.2:
eslint-plugin-import@^2.24.2:
version "2.24.2"
resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.24.2.tgz#2c8cd2e341f3885918ee27d18479910ade7bb4da"
integrity sha512-hNVtyhiEtZmpsabL4neEj+6M5DCLgpYyG9nzJY8lZQeQXEn5UPW1DpUdsMHMXsq98dbNm7nt1w9ZMSVpfJdi8Q==
Expand Down Expand Up @@ -10730,7 +10718,7 @@ eslint-plugin-react-hooks@^4.2.0:
resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.2.0.tgz#8c229c268d468956334c943bb45fc860280f5556"
integrity sha512-623WEiZJqxR7VdxFCKLI6d6LLpwJkGPYKODnkH3D7WpOG5KM8yWueBd8TLsNAetEJNF5iJmolaAKO3F8yzyVBQ==

eslint-plugin-react@^7.24.0, eslint-plugin-react@^7.25.1:
eslint-plugin-react@^7.25.1:
version "7.25.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.25.1.tgz#9286b7cd9bf917d40309760f403e53016eda8331"
integrity sha512-P4j9K1dHoFXxDNP05AtixcJEvIT6ht8FhYKsrkY0MPCPaUMYijhpWwNiRDZVtA8KFuZOkGSeft6QwH8KuVpJug==
Expand Down Expand Up @@ -11914,11 +11902,6 @@ form-data@~2.3.2:
combined-stream "^1.0.6"
mime-types "^2.1.12"

format-util@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/format-util/-/format-util-1.0.5.tgz#1ffb450c8a03e7bccffe40643180918cc297d271"
integrity sha512-varLbTj0e0yVyRpqQhuWV+8hlePAgaoFRhNFj50BNjEIrw1/DphHSObtqwskVCPWNgzwPoQrZAbfa/SBiicNeg==

format@^0.2.0, format@^0.2.2:
version "0.2.2"
resolved "https://registry.yarnpkg.com/format/-/format-0.2.2.tgz#d6170107e9efdc4ed30c9dc39016df942b5cb58b"
Expand Down Expand Up @@ -19200,14 +19183,6 @@ osenv@^0.1.4, osenv@^0.1.5:
os-homedir "^1.0.0"
os-tmpdir "^1.0.0"

outvariant@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/outvariant/-/outvariant-1.1.0.tgz#3a28489cbbd4b55ba21cfec5c51c6703b57daea6"
integrity sha512-XrsNwjFHruwqOLnUYxUCXtqvAMKQ4Yq2rg3GLm4H28GgjWXosGX/exuJf5ZGsNUqOl+p6ddsC3csjDR2A5sSjA==
dependencies:
"@types/format-util" "^1.0.1"
format-util "^1.0.5"

outvariant@^1.2.0:
version "1.2.1"
resolved "https://registry.yarnpkg.com/outvariant/-/outvariant-1.2.1.tgz#e630f6cdc1dbf398ed857e36f219de4a005ccd35"
Expand Down

0 comments on commit 476a00f

Please sign in to comment.