From 982ca9a8664bd6974716e7b46d33c3172f4aeb10 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sun, 4 Jul 2021 22:06:35 +0000 Subject: [PATCH 1/5] fix(deps): update typescript --- package.json | 6 +- packages/create-gatsby/package.json | 2 +- packages/gatsby-admin/package.json | 6 +- packages/gatsby-cli/package.json | 2 +- packages/gatsby-core-utils/package.json | 2 +- packages/gatsby-page-utils/package.json | 2 +- packages/gatsby-plugin-image/package.json | 2 +- packages/gatsby-plugin-utils/package.json | 2 +- packages/gatsby-source-shopify/package.json | 2 +- packages/gatsby-telemetry/package.json | 2 +- packages/gatsby-worker/package.json | 2 +- packages/gatsby/package.json | 6 +- yarn.lock | 276 +++++++------------- 13 files changed, 109 insertions(+), 203 deletions(-) diff --git a/package.json b/package.json index 1c3422025fa8e..a1465baf85ce7 100644 --- a/package.json +++ b/package.json @@ -27,8 +27,8 @@ "@types/signal-exit": "^3.0.0", "@types/stack-trace": "^0.0.29", "@types/webpack-merge": "^4.1.5", - "@typescript-eslint/eslint-plugin": "^4.14.2", - "@typescript-eslint/parser": "^4.22.0", + "@typescript-eslint/eslint-plugin": "^4.28.1", + "@typescript-eslint/parser": "^4.28.1", "babel-jest": "^24.9.0", "chalk": "^4.1.1", "chokidar": "^3.5.1", @@ -88,7 +88,7 @@ "rimraf": "^3.0.2", "svgo": "1.3.2", "ts-jest": "^22", - "typescript": "^4.1.5", + "typescript": "^4.3.5", "unified": "^9.2.0", "yargs": "^15.4.1" }, diff --git a/packages/create-gatsby/package.json b/packages/create-gatsby/package.json index 413f6507dde1d..d56f3e0052df3 100644 --- a/packages/create-gatsby/package.json +++ b/packages/create-gatsby/package.json @@ -35,7 +35,7 @@ "string-length": "^4.0.2", "terminal-link": "^2.1.1", "tiny-spin": "^1.0.2", - "typescript": "^4.1.5", + "typescript": "^4.3.5", "uuid": "3.4.0" }, "repository": { diff --git a/packages/gatsby-admin/package.json b/packages/gatsby-admin/package.json index cfd7ddd0a89bc..8afb679cfd2b1 100644 --- a/packages/gatsby-admin/package.json +++ b/packages/gatsby-admin/package.json @@ -16,8 +16,8 @@ "@feedback-fish/react": "^1.2.1", "@types/react-instantsearch-dom": "^5.2.6", "@types/socket.io-client": "^1.4.35", - "@typescript-eslint/eslint-plugin": "^4.14.2", - "@typescript-eslint/parser": "^4.14.2", + "@typescript-eslint/eslint-plugin": "^4.28.1", + "@typescript-eslint/parser": "^4.28.1", "csstype": "^2.6.14", "formik": "^2.2.6", "gatsby": "^3.10.0-next.1", @@ -45,7 +45,7 @@ "strict-ui": "^0.2.0-0", "subscriptions-transport-ws": "^0.9.18", "theme-ui": "^0.4.0-rc.14", - "typescript": "^4.1.5", + "typescript": "^4.3.5", "urql": "^1.11.6", "yup": "^0.32.8" }, diff --git a/packages/gatsby-cli/package.json b/packages/gatsby-cli/package.json index f7bfa5280ab81..a04f0db5d49df 100644 --- a/packages/gatsby-cli/package.json +++ b/packages/gatsby-cli/package.json @@ -69,7 +69,7 @@ "rollup": "^2.34.2", "rollup-plugin-auto-external": "^2.0.0", "rollup-plugin-internal": "^1.0.0", - "typescript": "^4.1.5" + "typescript": "^4.3.5" }, "files": [ "lib/", diff --git a/packages/gatsby-core-utils/package.json b/packages/gatsby-core-utils/package.json index 64080f76ac6fc..cd871614a0347 100644 --- a/packages/gatsby-core-utils/package.json +++ b/packages/gatsby-core-utils/package.json @@ -44,7 +44,7 @@ "@types/ci-info": "2.0.0", "babel-preset-gatsby-package": "^1.10.0-next.0", "cross-env": "^7.0.3", - "typescript": "^4.1.5" + "typescript": "^4.3.5" }, "engines": { "node": ">=12.13.0" diff --git a/packages/gatsby-page-utils/package.json b/packages/gatsby-page-utils/package.json index f93fc5683ca2d..0dd60719892bd 100644 --- a/packages/gatsby-page-utils/package.json +++ b/packages/gatsby-page-utils/package.json @@ -38,7 +38,7 @@ "babel-preset-gatsby-package": "^1.10.0-next.0", "cross-env": "^7.0.3", "rimraf": "^3.0.2", - "typescript": "^4.1.5" + "typescript": "^4.3.5" }, "files": [ "dist/" diff --git a/packages/gatsby-plugin-image/package.json b/packages/gatsby-plugin-image/package.json index 4e9ec98ec8e0f..8d76de18c63b8 100644 --- a/packages/gatsby-plugin-image/package.json +++ b/packages/gatsby-plugin-image/package.json @@ -61,7 +61,7 @@ "npm-run-all": "^4.1.5", "postcss": "^8.2.9", "terser": "^5.3.8", - "typescript": "^4.1.5" + "typescript": "^4.3.5" }, "peerDependencies": { "@babel/core": "^7.12.3", diff --git a/packages/gatsby-plugin-utils/package.json b/packages/gatsby-plugin-utils/package.json index 2b89056a08f86..7e129df89b387 100644 --- a/packages/gatsby-plugin-utils/package.json +++ b/packages/gatsby-plugin-utils/package.json @@ -29,7 +29,7 @@ "babel-preset-gatsby-package": "^1.10.0-next.0", "cross-env": "^7.0.3", "rimraf": "^3.0.2", - "typescript": "^4.1.5" + "typescript": "^4.3.5" }, "peerDependencies": { "gatsby": "^3.0.0-next.0" diff --git a/packages/gatsby-source-shopify/package.json b/packages/gatsby-source-shopify/package.json index 0b64204de43b5..5c6d9a0aa589c 100644 --- a/packages/gatsby-source-shopify/package.json +++ b/packages/gatsby-source-shopify/package.json @@ -36,7 +36,7 @@ "prettier": "^2.2.1", "prettier-check": "^2.0.0", "tsc-watch": "^4.2.9", - "typescript": "^4.2.3" + "typescript": "^4.3.5" }, "peerDependencies": { "gatsby-plugin-image": "^1.1.0" diff --git a/packages/gatsby-telemetry/package.json b/packages/gatsby-telemetry/package.json index eb1ce3599d4a2..e995828fa8bc3 100644 --- a/packages/gatsby-telemetry/package.json +++ b/packages/gatsby-telemetry/package.json @@ -32,7 +32,7 @@ "jest-cli": "^24.9.0", "jest-junit": "^6.4.0", "rimraf": "^3.0.2", - "typescript": "^4.1.5" + "typescript": "^4.3.5" }, "files": [ "lib/", diff --git a/packages/gatsby-worker/package.json b/packages/gatsby-worker/package.json index 94e670cf263ad..2f87138d258af 100644 --- a/packages/gatsby-worker/package.json +++ b/packages/gatsby-worker/package.json @@ -15,7 +15,7 @@ "babel-preset-gatsby-package": "^1.10.0-next.0", "cross-env": "^7.0.3", "rimraf": "^3.0.2", - "typescript": "^4.1.5" + "typescript": "^4.3.5" }, "homepage": "https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-worker#readme", "keywords": [ diff --git a/packages/gatsby/package.json b/packages/gatsby/package.json index 481fc9deb483b..955621f46fe5f 100644 --- a/packages/gatsby/package.json +++ b/packages/gatsby/package.json @@ -22,8 +22,8 @@ "@nodelib/fs.walk": "^1.2.4", "@pmmmwh/react-refresh-webpack-plugin": "^0.4.3", "@types/http-proxy": "^1.17.4", - "@typescript-eslint/eslint-plugin": "^4.15.2", - "@typescript-eslint/parser": "^4.15.2", + "@typescript-eslint/eslint-plugin": "^4.28.1", + "@typescript-eslint/parser": "^4.28.1", "address": "1.1.2", "anser": "^2.0.1", "autoprefixer": "^10.2.4", @@ -184,7 +184,7 @@ "react": "^16.12.0", "react-dom": "^16.12.0", "rimraf": "^3.0.2", - "typescript": "^4.1.5", + "typescript": "^4.3.5", "xhr-mock": "^2.5.1", "zipkin": "^0.22.0", "zipkin-javascript-opentracing": "^3.0.0", diff --git a/yarn.lock b/yarn.lock index 628b3f8302c6b..cdfa045a126dc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4612,10 +4612,10 @@ opentracing "~0.14.3" prom-client "~11.3.0 || ^12.0.0 || ^13.0.0" -"@types/jest@*": - version "26.0.22" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-26.0.22.tgz#8308a1debdf1b807aa47be2838acdcd91e88fbe6" - integrity sha512-eeWwWjlqxvBxc4oQdkueW5OF/gtfSceKk4OnOAGlUSwS/liBRtZppbJuz1YkgbrbfGOoeBHun9fOvXnjNwrSOw== +"@types/jest@*", "@types/jest@^26.0.20": + version "26.0.23" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-26.0.23.tgz#a1b7eab3c503b80451d019efb588ec63522ee4e7" + integrity sha512-ZHLmWMJ9jJ9PTiT58juykZpL7KjwJywFN3Rr2pTSkyQfydf/rk22yS7W8p5DaVUMQ2BQC7oYiU3FjbTM/mYrOA== dependencies: jest-diff "^26.0.0" pretty-format "^26.0.0" @@ -4627,14 +4627,6 @@ dependencies: jest-diff "^24.3.0" -"@types/jest@^26.0.20": - version "26.0.23" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-26.0.23.tgz#a1b7eab3c503b80451d019efb588ec63522ee4e7" - integrity sha512-ZHLmWMJ9jJ9PTiT58juykZpL7KjwJywFN3Rr2pTSkyQfydf/rk22yS7W8p5DaVUMQ2BQC7oYiU3FjbTM/mYrOA== - dependencies: - jest-diff "^26.0.0" - pretty-format "^26.0.0" - "@types/joi@^14.3.4": version "14.3.4" resolved "https://registry.yarnpkg.com/@types/joi/-/joi-14.3.4.tgz#eed1e14cbb07716079c814138831a520a725a1e0" @@ -4645,10 +4637,10 @@ resolved "https://registry.yarnpkg.com/@types/js-levenshtein/-/js-levenshtein-1.1.0.tgz#9541eec4ad6e3ec5633270a3a2b55d981edc44a9" integrity sha512-14t0v1ICYRtRVcHASzes0v/O+TIeASb8aD55cWF1PidtInhFWSXcmhzhHqGjUWf9SUq1w70cvd1cWKUULubAfQ== -"@types/json-schema@*", "@types/json-schema@^7.0.3", "@types/json-schema@^7.0.5", "@types/json-schema@^7.0.6": - version "7.0.6" - resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.6.tgz#f4c7ec43e81b319a9815115031709f26987891f0" - integrity sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw== +"@types/json-schema@*", "@types/json-schema@^7.0.5", "@types/json-schema@^7.0.6", "@types/json-schema@^7.0.7": + version "7.0.7" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.7.tgz#98a993516c859eb0d5c4c8f098317a9ea68db9ad" + integrity sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA== "@types/json5@^0.0.29": version "0.0.29" @@ -4727,12 +4719,7 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.6.tgz#7b73cce37352936e628c5ba40326193443cfba25" integrity sha512-sRVq8d+ApGslmkE9e3i+D3gFGk7aZHAT+G4cIpIEdLJYPsWiSPwcAnJEjddLQQDqV3Ra2jOclX/Sv6YrvGYiWA== -"@types/node@^14.10.2", "@types/node@^14.14.10", "@types/node@^14.17.1": - version "14.17.1" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.17.1.tgz#5e07e0cb2ff793aa7a1b41deae76221e6166049f" - integrity sha512-/tpUyFD7meeooTRwl3sYlihx2BrJE7q9XF71EguPFIySj9B7qgnRtHsHTho+0AUm4m1SvWGm6uSncrR94q6Vtw== - -"@types/node@^14.14.34": +"@types/node@^14.10.2", "@types/node@^14.14.10", "@types/node@^14.14.34", "@types/node@^14.17.1": version "14.17.3" resolved "https://registry.yarnpkg.com/@types/node/-/node-14.17.3.tgz#6d327abaa4be34a74e421ed6409a0ae2f47f4c3d" integrity sha512-e6ZowgGJmTuXa3GyaPbTGxX17tnThl2aSSizrFthQ7m9uLGZBXiGhgE55cjRZTF5kjZvYn9EOPOMljdjwbflxw== @@ -5111,108 +5098,73 @@ resolved "https://registry.yarnpkg.com/@types/zen-observable/-/zen-observable-0.8.0.tgz#8b63ab7f1aa5321248aad5ac890a485656dcea4d" integrity sha512-te5lMAWii1uEJ4FwLjzdlbw3+n0FZNOvFXHxQDKeT0dilh7HOzdMzV2TrJVUzq8ep7J4Na8OUYPRLSQkJHAlrg== -"@typescript-eslint/eslint-plugin@^4.14.2", "@typescript-eslint/eslint-plugin@^4.15.2": - version "4.15.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.15.2.tgz#981b26b4076c62a5a55873fbef3fe98f83360c61" - integrity sha512-uiQQeu9tWl3f1+oK0yoAv9lt/KXO24iafxgQTkIYO/kitruILGx3uH+QtIAHqxFV+yIsdnJH+alel9KuE3J15Q== +"@typescript-eslint/eslint-plugin@^4.28.1": + version "4.28.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.28.1.tgz#c045e440196ae45464e08e20c38aff5c3a825947" + integrity sha512-9yfcNpDaNGQ6/LQOX/KhUFTR1sCKH+PBr234k6hI9XJ0VP5UqGxap0AnNwBnWFk1MNyWBylJH9ZkzBXC+5akZQ== dependencies: - "@typescript-eslint/experimental-utils" "4.15.2" - "@typescript-eslint/scope-manager" "4.15.2" - debug "^4.1.1" + "@typescript-eslint/experimental-utils" "4.28.1" + "@typescript-eslint/scope-manager" "4.28.1" + debug "^4.3.1" functional-red-black-tree "^1.0.1" - lodash "^4.17.15" - regexpp "^3.0.0" - semver "^7.3.2" - tsutils "^3.17.1" - -"@typescript-eslint/experimental-utils@4.15.2": - version "4.15.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.15.2.tgz#5efd12355bd5b535e1831282e6cf465b9a71cf36" - integrity sha512-Fxoshw8+R5X3/Vmqwsjc8nRO/7iTysRtDqx6rlfLZ7HbT8TZhPeQqbPjTyk2RheH3L8afumecTQnUc9EeXxohQ== - dependencies: - "@types/json-schema" "^7.0.3" - "@typescript-eslint/scope-manager" "4.15.2" - "@typescript-eslint/types" "4.15.2" - "@typescript-eslint/typescript-estree" "4.15.2" - eslint-scope "^5.0.0" - eslint-utils "^2.0.0" - -"@typescript-eslint/parser@^4.14.2", "@typescript-eslint/parser@^4.15.2", "@typescript-eslint/parser@^4.22.0": - version "4.22.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.22.0.tgz#e1637327fcf796c641fe55f73530e90b16ac8fe8" - integrity sha512-z/bGdBJJZJN76nvAY9DkJANYgK3nlRstRRi74WHm3jjgf2I8AglrSY+6l7ogxOmn55YJ6oKZCLLy+6PW70z15Q== - dependencies: - "@typescript-eslint/scope-manager" "4.22.0" - "@typescript-eslint/types" "4.22.0" - "@typescript-eslint/typescript-estree" "4.22.0" - debug "^4.1.1" - -"@typescript-eslint/scope-manager@4.15.2": - version "4.15.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.15.2.tgz#5725bda656995960ae1d004bfd1cd70320f37f4f" - integrity sha512-Zm0tf/MSKuX6aeJmuXexgdVyxT9/oJJhaCkijv0DvJVT3ui4zY6XYd6iwIo/8GEZGy43cd7w1rFMiCLHbRzAPQ== - dependencies: - "@typescript-eslint/types" "4.15.2" - "@typescript-eslint/visitor-keys" "4.15.2" - -"@typescript-eslint/scope-manager@4.22.0": - version "4.22.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.22.0.tgz#ed411545e61161a8d702e703a4b7d96ec065b09a" - integrity sha512-OcCO7LTdk6ukawUM40wo61WdeoA7NM/zaoq1/2cs13M7GyiF+T4rxuA4xM+6LeHWjWbss7hkGXjFDRcKD4O04Q== - dependencies: - "@typescript-eslint/types" "4.22.0" - "@typescript-eslint/visitor-keys" "4.22.0" - -"@typescript-eslint/types@4.15.2": - version "4.15.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.15.2.tgz#04acf3a2dc8001a88985291744241e732ef22c60" - integrity sha512-r7lW7HFkAarfUylJ2tKndyO9njwSyoy6cpfDKWPX6/ctZA+QyaYscAHXVAfJqtnY6aaTwDYrOhp+ginlbc7HfQ== - -"@typescript-eslint/types@4.22.0": - version "4.22.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.22.0.tgz#0ca6fde5b68daf6dba133f30959cc0688c8dd0b6" - integrity sha512-sW/BiXmmyMqDPO2kpOhSy2Py5w6KvRRsKZnV0c4+0nr4GIcedJwXAq+RHNK4lLVEZAJYFltnnk1tJSlbeS9lYA== - -"@typescript-eslint/typescript-estree@4.15.2": - version "4.15.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.15.2.tgz#c2f7a1e94f3428d229d5ecff3ead6581ee9b62fa" - integrity sha512-cGR8C2g5SPtHTQvAymEODeqx90pJHadWsgTtx6GbnTWKqsg7yp6Eaya9nFzUd4KrKhxdYTTFBiYeTPQaz/l8bw== - dependencies: - "@typescript-eslint/types" "4.15.2" - "@typescript-eslint/visitor-keys" "4.15.2" - debug "^4.1.1" - globby "^11.0.1" - is-glob "^4.0.1" - semver "^7.3.2" - tsutils "^3.17.1" + regexpp "^3.1.0" + semver "^7.3.5" + tsutils "^3.21.0" -"@typescript-eslint/typescript-estree@4.22.0": - version "4.22.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.22.0.tgz#b5d95d6d366ff3b72f5168c75775a3e46250d05c" - integrity sha512-TkIFeu5JEeSs5ze/4NID+PIcVjgoU3cUQUIZnH3Sb1cEn1lBo7StSV5bwPuJQuoxKXlzAObjYTilOEKRuhR5yg== +"@typescript-eslint/experimental-utils@4.28.1": + version "4.28.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.28.1.tgz#3869489dcca3c18523c46018b8996e15948dbadc" + integrity sha512-n8/ggadrZ+uyrfrSEchx3jgODdmcx7MzVM2sI3cTpI/YlfSm0+9HEUaWw3aQn2urL2KYlWYMDgn45iLfjDYB+Q== dependencies: - "@typescript-eslint/types" "4.22.0" - "@typescript-eslint/visitor-keys" "4.22.0" - debug "^4.1.1" - globby "^11.0.1" + "@types/json-schema" "^7.0.7" + "@typescript-eslint/scope-manager" "4.28.1" + "@typescript-eslint/types" "4.28.1" + "@typescript-eslint/typescript-estree" "4.28.1" + eslint-scope "^5.1.1" + eslint-utils "^3.0.0" + +"@typescript-eslint/parser@^4.28.1": + version "4.28.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.28.1.tgz#5181b81658414f47291452c15bf6cd44a32f85bd" + integrity sha512-UjrMsgnhQIIK82hXGaD+MCN8IfORS1CbMdu7VlZbYa8LCZtbZjJA26De4IPQB7XYZbL8gJ99KWNj0l6WD0guJg== + dependencies: + "@typescript-eslint/scope-manager" "4.28.1" + "@typescript-eslint/types" "4.28.1" + "@typescript-eslint/typescript-estree" "4.28.1" + debug "^4.3.1" + +"@typescript-eslint/scope-manager@4.28.1": + version "4.28.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.28.1.tgz#fd3c20627cdc12933f6d98b386940d8d0ce8a991" + integrity sha512-o95bvGKfss6705x7jFGDyS7trAORTy57lwJ+VsYwil/lOUxKQ9tA7Suuq+ciMhJc/1qPwB3XE2DKh9wubW8YYA== + dependencies: + "@typescript-eslint/types" "4.28.1" + "@typescript-eslint/visitor-keys" "4.28.1" + +"@typescript-eslint/types@4.28.1": + version "4.28.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.28.1.tgz#d0f2ecbef3684634db357b9bbfc97b94b828f83f" + integrity sha512-4z+knEihcyX7blAGi7O3Fm3O6YRCP+r56NJFMNGsmtdw+NCdpG5SgNz427LS9nQkRVTswZLhz484hakQwB8RRg== + +"@typescript-eslint/typescript-estree@4.28.1": + version "4.28.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.28.1.tgz#af882ae41740d1f268e38b4d0fad21e7e8d86a81" + integrity sha512-GhKxmC4sHXxHGJv8e8egAZeTZ6HI4mLU6S7FUzvFOtsk7ZIDN1ksA9r9DyOgNqowA9yAtZXV0Uiap61bIO81FQ== + dependencies: + "@typescript-eslint/types" "4.28.1" + "@typescript-eslint/visitor-keys" "4.28.1" + debug "^4.3.1" + globby "^11.0.3" is-glob "^4.0.1" - semver "^7.3.2" - tsutils "^3.17.1" - -"@typescript-eslint/visitor-keys@4.15.2": - version "4.15.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.15.2.tgz#3d1c7979ce75bf6acf9691109bd0d6b5706192b9" - integrity sha512-TME1VgSb7wTwgENN5KVj4Nqg25hP8DisXxNBojM4Nn31rYaNDIocNm5cmjOFfh42n7NVERxWrDFoETO/76ePyg== - dependencies: - "@typescript-eslint/types" "4.15.2" - eslint-visitor-keys "^2.0.0" + semver "^7.3.5" + tsutils "^3.21.0" -"@typescript-eslint/visitor-keys@4.22.0": - version "4.22.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.22.0.tgz#169dae26d3c122935da7528c839f42a8a42f6e47" - integrity sha512-nnMu4F+s4o0sll6cBSsTeVsT4cwxB7zECK3dFxzEjPBii9xLpq4yqqsy/FU5zMfan6G60DKZSCXAa3sHJZrcYw== +"@typescript-eslint/visitor-keys@4.28.1": + version "4.28.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.28.1.tgz#162a515ee255f18a6068edc26df793cdc1ec9157" + integrity sha512-K4HMrdFqr9PFquPu178SaSb92CaWe2yErXyPumc8cYWxFmhgJsNY9eSePmO05j0JhBvf2Cdhptd6E6Yv9HVHcg== dependencies: - "@typescript-eslint/types" "4.22.0" + "@typescript-eslint/types" "4.28.1" eslint-visitor-keys "^2.0.0" "@urql/core@^1.16.0": @@ -11390,13 +11342,20 @@ eslint-utils@^1.4.3: dependencies: eslint-visitor-keys "^1.1.0" -eslint-utils@^2.0.0, eslint-utils@^2.1.0: +eslint-utils@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-2.1.0.tgz#d2de5e03424e707dc10c74068ddedae708741b27" integrity sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg== dependencies: eslint-visitor-keys "^1.1.0" +eslint-utils@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-3.0.0.tgz#8aebaface7345bb33559db0a1f13a1d2d48c3672" + integrity sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA== + dependencies: + eslint-visitor-keys "^2.0.0" + eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" @@ -12083,14 +12042,7 @@ fastparse@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/fastparse/-/fastparse-1.1.1.tgz#d1e2643b38a94d7583b479060e6c4affc94071f8" -fastq@^1.10.0, fastq@^1.6.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.10.0.tgz#74dbefccade964932cdf500473ef302719c652bb" - integrity sha512-NL2Qc5L3iQEsyYzweq7qfgy5OtXCmGzGvhElGEd/SoFWEMOEczNh5s5ocaF01HDetxz+p8ecjNPA6cZxxIHmzA== - dependencies: - reusify "^1.0.4" - -fastq@^1.11.0: +fastq@^1.10.0, fastq@^1.11.0, fastq@^1.6.0: version "1.11.0" resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.11.0.tgz#bb9fb955a07130a918eb63c1f5161cc32a5d0858" integrity sha512-7Eczs8gIPDrVzT+EksYBcupqMyxSHXXrHOLRRxU2/DicV8789MRBRR8+Hc2uWzUupOs4YS4JzBmBxjjCVBxD/g== @@ -13444,24 +13396,7 @@ got@^10.7.0: to-readable-stream "^2.0.0" type-fest "^0.10.0" -got@^11.7.0: - version "11.8.1" - resolved "https://registry.yarnpkg.com/got/-/got-11.8.1.tgz#df04adfaf2e782babb3daabc79139feec2f7e85d" - integrity sha512-9aYdZL+6nHmvJwHALLwKSUZ0hMwGaJGYv3hoPLPgnT8BoBXm1SjnZeky+91tfwJaDzun2s4RsBRy48IEYv2q2Q== - dependencies: - "@sindresorhus/is" "^4.0.0" - "@szmarczak/http-timer" "^4.0.5" - "@types/cacheable-request" "^6.0.1" - "@types/responselike" "^1.0.0" - cacheable-lookup "^5.0.3" - cacheable-request "^7.0.1" - decompress-response "^6.0.0" - http2-wrapper "^1.0.0-beta.5.2" - lowercase-keys "^2.0.0" - p-cancelable "^2.0.0" - responselike "^2.0.0" - -got@^11.8.2: +got@^11.7.0, got@^11.8.2: version "11.8.2" resolved "https://registry.yarnpkg.com/got/-/got-11.8.2.tgz#7abb3959ea28c31f3576f1576c1effce23f33599" integrity sha512-D0QywKgIe30ODs+fm8wMZiAcZjypcCodPNuMz5H9Mny7RJ+IjJ10BdmGW7OM7fHXP+O7r6ZwapQ/YQmMSvB0UQ== @@ -19419,11 +19354,6 @@ nanoclone@^0.2.1: resolved "https://registry.yarnpkg.com/nanoclone/-/nanoclone-0.2.1.tgz#dd4090f8f1a110d26bb32c49ed2f5b9235209ed4" integrity sha512-wynEP02LmIbLpcYw8uBKpcfF6dmg2vcpKqxeH5UcoKEYdExslsdUA4ugFauuaeYdTB76ez6gJW8XAZ6CgkXYxA== -nanoid@^3.1.22: - version "3.1.22" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.22.tgz#b35f8fb7d151990a8aebd5aa5015c03cf726f844" - 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" @@ -21965,16 +21895,7 @@ postcss@^7.0.0, postcss@^7.0.1, postcss@^7.0.14, postcss@^7.0.27, postcss@^7.0.3 source-map "^0.6.1" supports-color "^6.1.0" -postcss@^8.1.4, postcss@^8.1.6, postcss@^8.2.1, postcss@^8.2.2, postcss@^8.2.9: - version "8.2.9" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.2.9.tgz#fd95ff37b5cee55c409b3fdd237296ab4096fba3" - integrity sha512-b+TmuIL4jGtCHtoLi+G/PisuIl9avxs8IZMSmlABRwNz5RLUUACrC+ws81dcomz1nRezm5YPdXiMEzBEKgYn+Q== - dependencies: - colorette "^1.2.2" - nanoid "^3.1.22" - source-map "^0.6.1" - -postcss@^8.3.5: +postcss@^8.1.4, postcss@^8.1.6, postcss@^8.2.1, postcss@^8.2.2, postcss@^8.2.9, postcss@^8.3.5: version "8.3.5" resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.3.5.tgz#982216b113412bc20a86289e91eb994952a5b709" integrity sha512-NxTuJocUhYGsMiMFHDUkmjSKT3EdH4/WbGF6GCi1NDGk+vbcUTun4fpbOqaPtD8IIsztA2ilZm2DhYCuyN58gA== @@ -22049,12 +21970,7 @@ prettier@2.1.2: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.1.2.tgz#3050700dae2e4c8b67c4c3f666cdb8af405e1ce5" integrity sha512-16c7K+x4qVlJg9rEbXl7HEGmQyZlG4R9AgP+oHKRMsMsuk8s+ATStlf1NpDqyBI1HpVyfjLOeMhH2LvuNvV5Vg== -prettier@^2.0.5, prettier@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.0.tgz#b6a5bf1284026ae640f17f7ff5658a7567fc0d18" - integrity sha512-kXtO4s0Lz/DW/IJ9QdWhAf7/NmPWQXkFr/r/WkR3vyI+0v8amTDxiaQSLzs8NBlytfLWX/7uQUMIW677yLKl4w== - -prettier@^2.2.1: +prettier@^2.0.5, prettier@^2.2.1, prettier@^2.3.0: version "2.3.1" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.1.tgz#76903c3f8c4449bc9ac597acefa24dc5ad4cbea6" integrity sha512-p+vNbgpLjif/+D+DwAZAbndtRrR0md0MwfmOVN9N+2RgyACMT+7tfaRnT+WDPkqnuVwleyuBIG2XBxKDme3hPA== @@ -23187,7 +23103,7 @@ regexpp@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" -regexpp@^3.0.0, regexpp@^3.1.0: +regexpp@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.1.0.tgz#206d0ad0a5648cffbdb8ae46438f3dc51c9f78e2" integrity sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q== @@ -24391,12 +24307,7 @@ reselect@^4.0.0: resolved "https://registry.yarnpkg.com/reselect/-/reselect-4.0.0.tgz#f2529830e5d3d0e021408b246a206ef4ea4437f7" integrity sha512-qUgANli03jjAyGlnbYVAV5vvnOmJnODyABz51RdBN7M4WaVu8mecZWgyQNkG8Yqe3KRGRt0l4K4B3XVEULC4CA== -resolve-alpn@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/resolve-alpn/-/resolve-alpn-1.0.0.tgz#745ad60b3d6aff4b4a48e01b8c0bdc70959e0e8c" - integrity sha512-rTuiIEqFmGxne4IovivKSDzld2lWW9QCjqv80SYjPgf+gS35eaCAjaP54CCwGAwBtnCsvNLYtqxe1Nw+i6JEmA== - -resolve-alpn@^1.1.1: +resolve-alpn@^1.0.0, resolve-alpn@^1.1.1: version "1.1.2" resolved "https://registry.yarnpkg.com/resolve-alpn/-/resolve-alpn-1.1.2.tgz#30b60cfbb0c0b8dc897940fe13fe255afcdd4d28" integrity sha512-8OyfzhAtA32LVUsJSke3auIyINcwdh5l3cvYKdKO0nvsYSKuiLfTM5i78PJswFPT8y6cPW+L1v6/hE95chcpDA== @@ -27400,10 +27311,10 @@ tsscmp@1.0.6: resolved "https://registry.yarnpkg.com/tsscmp/-/tsscmp-1.0.6.tgz#85b99583ac3589ec4bfef825b5000aa911d605eb" integrity sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA== -tsutils@^3.17.1: - version "3.17.1" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.17.1.tgz#ed719917f11ca0dee586272b2ac49e015a2dd759" - integrity sha512-kzeQ5B8H3w60nFY2g8cJIuH7JDpsALXySGtwGJ0p2LSjLgay3NdIpqq5SoOBe46bKDW2iq25irHCr8wjomUS2g== +tsutils@^3.21.0: + version "3.21.0" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" + integrity sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA== dependencies: tslib "^1.8.1" @@ -27526,15 +27437,10 @@ typedarray@^0.0.6, typedarray@~0.0.5: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" -typescript@^4.1.3, typescript@^4.1.5: - version "4.1.5" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.1.5.tgz#123a3b214aaff3be32926f0d8f1f6e704eb89a72" - integrity sha512-6OSu9PTIzmn9TCDiovULTnET6BgXtDYL4Gg4szY+cGsc3JP1dQL8qvE8kShTRx1NIw4Q9IBHlwODjkjWEtMUyA== - -typescript@^4.2.3: - version "4.3.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.2.tgz#399ab18aac45802d6f2498de5054fcbbe716a805" - integrity sha512-zZ4hShnmnoVnAHpVHWpTcxdv7dWP60S2FsydQLV8V5PbS3FifjWFFRiHSWpDJahly88PRyV5teTSLoq4eG7mKw== +typescript@^4.1.3, typescript@^4.3.5: + version "4.3.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.5.tgz#4d1c37cc16e893973c45a06886b7113234f119f4" + integrity sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA== typography-normalize@^0.16.19: version "0.16.19" From 3a063faa5694408d307ff428800632b6627fdd79 Mon Sep 17 00:00:00 2001 From: Ward Peeters Date: Mon, 5 Jul 2021 14:38:12 +0200 Subject: [PATCH 2/5] update typinges --- .../gatsby-cli/src/reporter/redux/index.ts | 9 ++++---- .../bootstrap/__tests__/remove-stale-jobs.ts | 6 ++--- packages/gatsby/src/bootstrap/index.ts | 3 ++- .../src/bootstrap/load-plugins/index.ts | 3 ++- .../gatsby/src/bootstrap/remove-stale-jobs.ts | 22 ++++++++----------- packages/gatsby/src/commands/build-html.ts | 17 ++++++++------ packages/gatsby/src/redux/reducers/jobsv2.ts | 15 ++++++++++--- packages/gatsby/src/redux/reducers/program.ts | 1 + packages/gatsby/src/redux/types.ts | 2 ++ packages/gatsby/src/services/initialize.ts | 8 ++++--- packages/gatsby/src/services/types.ts | 2 +- .../worker/child/load-config-and-plugins.ts | 1 + 12 files changed, 53 insertions(+), 36 deletions(-) diff --git a/packages/gatsby-cli/src/reporter/redux/index.ts b/packages/gatsby-cli/src/reporter/redux/index.ts index 227ec01bd4b4c..811d7f3a0f32c 100644 --- a/packages/gatsby-cli/src/reporter/redux/index.ts +++ b/packages/gatsby-cli/src/reporter/redux/index.ts @@ -1,11 +1,13 @@ -import { createStore, combineReducers } from "redux" +import { createStore, combineReducers, Store } from "redux" import { reducer } from "./reducer" -import { ActionsUnion, ISetLogs } from "./types" +import { ActionsUnion, ISetLogs, IGatsbyCLIState } from "./types" import { isInternalAction } from "./utils" import { createStructuredLoggingDiagnosticsMiddleware } from "./diagnostics" import { Actions } from "../constants" -let store = createStore( +export type GatsbyCLIStore = Store<{ logs: IGatsbyCLIState }> + +let store: GatsbyCLIStore = createStore( combineReducers({ logs: reducer, }), @@ -16,7 +18,6 @@ const diagnosticsMiddleware = createStructuredLoggingDiagnosticsMiddleware( store ) -export type GatsbyCLIStore = typeof store type StoreListener = (store: GatsbyCLIStore) => void type ActionLogListener = (action: ActionsUnion) => any type Thunk = (...args: Array) => ActionsUnion diff --git a/packages/gatsby/src/bootstrap/__tests__/remove-stale-jobs.ts b/packages/gatsby/src/bootstrap/__tests__/remove-stale-jobs.ts index 894e3b8e3ca59..87687bc090f87 100644 --- a/packages/gatsby/src/bootstrap/__tests__/remove-stale-jobs.ts +++ b/packages/gatsby/src/bootstrap/__tests__/remove-stale-jobs.ts @@ -31,7 +31,7 @@ describe(`remove-stale-jobs`, () => { isJobStale.mockReturnValue(true) - expect(removeStaleJobs(state)).toMatchSnapshot() + expect(removeStaleJobs(state.jobsV2)).toMatchSnapshot() expect(internalActions.removeStaleJob).toHaveBeenCalledTimes(1) expect(internalActions.removeStaleJob).toHaveBeenCalledWith(`1234`) expect(internalActions.createJobV2FromInternalJob).not.toHaveBeenCalled() @@ -50,7 +50,7 @@ describe(`remove-stale-jobs`, () => { isJobStale.mockReturnValue(true) - expect(removeStaleJobs(state)).toMatchSnapshot() + expect(removeStaleJobs(state.jobsV2)).toMatchSnapshot() expect(internalActions.removeStaleJob).toHaveBeenCalledTimes(1) expect(internalActions.removeStaleJob).toHaveBeenCalledWith(`1234`) expect(internalActions.createJobV2FromInternalJob).not.toHaveBeenCalled() @@ -72,7 +72,7 @@ describe(`remove-stale-jobs`, () => { // we need it to return a promise so createJobV2FromInternalJob action creator works correctly enqueueJob.mockReturnValue(Promise.resolve({ result: true })) - const toDispatch = removeStaleJobs(state) + const toDispatch = removeStaleJobs(state.jobsV2) const dispatchedActions = [] for (const actionOrThunk of toDispatch) { if (typeof actionOrThunk === `function`) { diff --git a/packages/gatsby/src/bootstrap/index.ts b/packages/gatsby/src/bootstrap/index.ts index df66e6828e5c3..70b2ebd411894 100644 --- a/packages/gatsby/src/bootstrap/index.ts +++ b/packages/gatsby/src/bootstrap/index.ts @@ -17,11 +17,12 @@ import { globalTracer } from "opentracing" import type { GatsbyWorkerPool } from "../utils/worker/pool" import { handleStalePageData } from "../utils/page-data" import { saveStateForWorkers } from "../redux" +import { IProgram } from "../commands/types" const tracer = globalTracer() export async function bootstrap( - initialContext: Partial + initialContext: Partial & { program: IProgram } ): Promise<{ gatsbyNodeGraphQLFunction: Runner workerPool: GatsbyWorkerPool diff --git a/packages/gatsby/src/bootstrap/load-plugins/index.ts b/packages/gatsby/src/bootstrap/load-plugins/index.ts index fbd5fb511a0fc..5b94445721dbf 100644 --- a/packages/gatsby/src/bootstrap/load-plugins/index.ts +++ b/packages/gatsby/src/bootstrap/load-plugins/index.ts @@ -1,6 +1,7 @@ import _ from "lodash" import { store } from "../../redux" +import { IGatsbyState } from "../../redux/types" import * as nodeAPIs from "../../utils/api-node-docs" import * as browserAPIs from "../../utils/api-browser-docs" import ssrAPIs from "../../../cache-dir/api-ssr-docs" @@ -122,7 +123,7 @@ export async function loadPlugins( // If we get this far, everything looks good. Update the store store.dispatch({ type: `SET_SITE_FLATTENED_PLUGINS`, - payload: flattenedPlugins, + payload: flattenedPlugins as IGatsbyState["flattenedPlugins"], }) // And let plugins initialize if they want to diff --git a/packages/gatsby/src/bootstrap/remove-stale-jobs.ts b/packages/gatsby/src/bootstrap/remove-stale-jobs.ts index b326432882ead..e94aa6945db5f 100644 --- a/packages/gatsby/src/bootstrap/remove-stale-jobs.ts +++ b/packages/gatsby/src/bootstrap/remove-stale-jobs.ts @@ -1,33 +1,29 @@ import { IGatsbyState, - IRemoveStaleJobAction, + IRemoveStaleJobV2Action, ICreateJobV2FromInternalAction, - IGatsbyIncompleteJobV2, - IGatsbyCompleteJobV2, } from "../redux/types" import { isJobStale } from "../utils/jobs-manager" import { internalActions } from "../redux/actions" export const removeStaleJobs = ( - state: IGatsbyState -): Array => { + jobs: IGatsbyState["jobsV2"] +): Array => { const actions: Array< - IRemoveStaleJobAction | ICreateJobV2FromInternalAction + IRemoveStaleJobV2Action | ICreateJobV2FromInternalAction > = [] // If any of our finished jobs are stale we remove them to keep our cache small - state.jobsV2.complete.forEach( - (job: IGatsbyCompleteJobV2, contentDigest: string): void => { - if (isJobStale(job)) { - actions.push(internalActions.removeStaleJob(contentDigest)) - } + jobs.complete.forEach((job, contentDigest) => { + if (isJobStale(job)) { + actions.push(internalActions.removeStaleJob(contentDigest)) } - ) + }) // If any of our pending jobs do not have an existing inputPath or the inputPath changed // we remove it from the queue as they would fail anyway - state.jobsV2.incomplete.forEach(({ job }: IGatsbyIncompleteJobV2): void => { + jobs.incomplete.forEach(({ job }): void => { if (isJobStale(job)) { actions.push(internalActions.removeStaleJob(job.contentDigest)) } else { diff --git a/packages/gatsby/src/commands/build-html.ts b/packages/gatsby/src/commands/build-html.ts index d69852f170e99..debc57b47332a 100644 --- a/packages/gatsby/src/commands/build-html.ts +++ b/packages/gatsby/src/commands/build-html.ts @@ -3,7 +3,7 @@ import fs from "fs-extra" import reporter from "gatsby-cli/lib/reporter" import { createErrorFromString } from "gatsby-cli/lib/reporter/errors" import { chunk } from "lodash" -import webpack from "webpack" +import webpack, { Stats } from "webpack" import * as path from "path" import { emitter, store } from "../redux" @@ -59,7 +59,7 @@ const runWebpack = ( directory, parentSpan?: Span ): Bluebird<{ - stats: webpack.Stats | undefined + stats: Stats waitForCompilerClose: Promise }> => new Bluebird((resolve, reject) => { @@ -91,7 +91,7 @@ const runWebpack = ( if (err) { return reject(err) } else { - return resolve({ stats, waitForCompilerClose }) + return resolve({ stats: stats as Stats, waitForCompilerClose }) } }) } else if ( @@ -126,7 +126,10 @@ const runWebpack = ( oldHash = newHash - return resolve({ stats, waitForCompilerClose: Promise.resolve() }) + return resolve({ + stats: stats as Stats, + waitForCompilerClose: Promise.resolve(), + }) } } ) as IWebpackWatchingPauseResume @@ -145,17 +148,17 @@ const doBuildRenderer = async ( directory, parentSpan ) - if (stats?.hasErrors()) { + if (stats.hasErrors()) { reporter.panic(structureWebpackErrors(stage, stats.compilation.errors)) } if ( stage === `build-html` && - store.getState().html.ssrCompilationHash !== stats?.hash + store.getState().html.ssrCompilationHash !== stats.hash ) { store.dispatch({ type: `SET_SSR_WEBPACK_COMPILATION_HASH`, - payload: stats?.hash, + payload: stats.hash as string, }) } diff --git a/packages/gatsby/src/redux/reducers/jobsv2.ts b/packages/gatsby/src/redux/reducers/jobsv2.ts index de67396b08711..28db0827c03de 100644 --- a/packages/gatsby/src/redux/reducers/jobsv2.ts +++ b/packages/gatsby/src/redux/reducers/jobsv2.ts @@ -1,8 +1,11 @@ import { - ActionsUnion, + ICreateJobV2Action, + IRemoveStaleJobV2Action, + IEndJobV2Action, IGatsbyState, IGatsbyIncompleteJobV2, IGatsbyCompleteJobV2, + IDeleteCacheAction, } from "../types" const initialState = (): IGatsbyState["jobsV2"] => { @@ -14,11 +17,17 @@ const initialState = (): IGatsbyState["jobsV2"] => { export const jobsV2Reducer = ( state = initialState(), - action: ActionsUnion + action: + | ICreateJobV2Action + | IRemoveStaleJobV2Action + | IEndJobV2Action + | IDeleteCacheAction ): IGatsbyState["jobsV2"] => { switch (action.type) { case `DELETE_CACHE`: - return action.cacheIsCorrupt ? initialState() : state + return (action as IDeleteCacheAction).cacheIsCorrupt + ? initialState() + : state case `CREATE_JOB_V2`: { const { job } = action.payload diff --git a/packages/gatsby/src/redux/reducers/program.ts b/packages/gatsby/src/redux/reducers/program.ts index a253a0c2dd094..07bcbbd70ffa6 100644 --- a/packages/gatsby/src/redux/reducers/program.ts +++ b/packages/gatsby/src/redux/reducers/program.ts @@ -13,6 +13,7 @@ const initialState: IStateProgram = { host: `localhost`, sitePackageJson: {}, extensions: [], + browserslist: [], report: reporter, } diff --git a/packages/gatsby/src/redux/types.ts b/packages/gatsby/src/redux/types.ts index 3c98119c679b0..0ebb8e6abe0a0 100644 --- a/packages/gatsby/src/redux/types.ts +++ b/packages/gatsby/src/redux/types.ts @@ -179,6 +179,7 @@ type BabelStageKeys = export interface IStateProgram extends IProgram { extensions: Array + browserslist: Array } export interface IQueryState { @@ -401,6 +402,7 @@ export type ActionsUnion = | IGeneratedHtml | IMarkHtmlDirty | ISSRUsedUnsafeBuiltin + | ISetSiteConfig export interface IApiFinishedAction { type: `API_FINISHED` diff --git a/packages/gatsby/src/services/initialize.ts b/packages/gatsby/src/services/initialize.ts index ee3f378900fa7..6162dcfc1650c 100644 --- a/packages/gatsby/src/services/initialize.ts +++ b/packages/gatsby/src/services/initialize.ts @@ -16,7 +16,7 @@ import { store, emitter } from "../redux" import reporter from "gatsby-cli/lib/reporter" import { removeStaleJobs } from "../bootstrap/remove-stale-jobs" import { IPluginInfoOptions } from "../bootstrap/load-plugins/types" -import { IGatsbyState } from "../redux/types" +import { IGatsbyState, IStateProgram } from "../redux/types" import { IBuildContext } from "./types" import { detectLmdbStore } from "../datastore" import { loadConfigAndPlugins } from "../bootstrap/load-config-and-plugins" @@ -100,8 +100,9 @@ export async function initialize({ const directory = slash(args.directory) - const program = { + const program: IStateProgram = { ...args, + extensions: [], browserslist: getBrowsersList(directory), // Fix program directory path for windows env. directory, @@ -179,7 +180,8 @@ export async function initialize({ } // run stale jobs - store.dispatch(removeStaleJobs(store.getState())) + // @ts-ignore we'll need to fix redux typings https://redux.js.org/usage/usage-with-typescript + store.dispatch(removeStaleJobs(store.getState().jobsV2)) // Multiple occurrences of the same name-version-pair can occur, // so we report an array of unique pairs diff --git a/packages/gatsby/src/services/types.ts b/packages/gatsby/src/services/types.ts index beb3f766f5548..4a77b2889ccd7 100644 --- a/packages/gatsby/src/services/types.ts +++ b/packages/gatsby/src/services/types.ts @@ -23,7 +23,7 @@ export interface IMutationAction { } export interface IBuildContext { - program?: IProgram + program: IProgram store?: Store parentSpan?: Span gatsbyNodeGraphQLFunction?: Runner diff --git a/packages/gatsby/src/utils/worker/child/load-config-and-plugins.ts b/packages/gatsby/src/utils/worker/child/load-config-and-plugins.ts index 96ff1dc670129..48c67fc38b463 100644 --- a/packages/gatsby/src/utils/worker/child/load-config-and-plugins.ts +++ b/packages/gatsby/src/utils/worker/child/load-config-and-plugins.ts @@ -9,6 +9,7 @@ export async function loadConfigAndPlugins( store.dispatch({ type: `SET_PROGRAM`, payload: { + ...store.getState().program, directory: siteDirectory, }, }) From a8f51b7b80714d5bda216a3dbaede63a2ead7167 Mon Sep 17 00:00:00 2001 From: Ward Peeters Date: Mon, 5 Jul 2021 14:44:24 +0200 Subject: [PATCH 3/5] reset file --- packages/gatsby-cli/src/reporter/redux/index.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/gatsby-cli/src/reporter/redux/index.ts b/packages/gatsby-cli/src/reporter/redux/index.ts index 811d7f3a0f32c..227ec01bd4b4c 100644 --- a/packages/gatsby-cli/src/reporter/redux/index.ts +++ b/packages/gatsby-cli/src/reporter/redux/index.ts @@ -1,13 +1,11 @@ -import { createStore, combineReducers, Store } from "redux" +import { createStore, combineReducers } from "redux" import { reducer } from "./reducer" -import { ActionsUnion, ISetLogs, IGatsbyCLIState } from "./types" +import { ActionsUnion, ISetLogs } from "./types" import { isInternalAction } from "./utils" import { createStructuredLoggingDiagnosticsMiddleware } from "./diagnostics" import { Actions } from "../constants" -export type GatsbyCLIStore = Store<{ logs: IGatsbyCLIState }> - -let store: GatsbyCLIStore = createStore( +let store = createStore( combineReducers({ logs: reducer, }), @@ -18,6 +16,7 @@ const diagnosticsMiddleware = createStructuredLoggingDiagnosticsMiddleware( store ) +export type GatsbyCLIStore = typeof store type StoreListener = (store: GatsbyCLIStore) => void type ActionLogListener = (action: ActionsUnion) => any type Thunk = (...args: Array) => ActionsUnion From e7929fa7a8d0fb8e6a604f5f3d93a86ae9456e05 Mon Sep 17 00:00:00 2001 From: Ward Peeters Date: Mon, 5 Jul 2021 14:49:26 +0200 Subject: [PATCH 4/5] remove dummy typescript deps --- packages/create-gatsby/package.json | 1 - packages/gatsby-admin/package.json | 1 - yarn.lock | 6 +++--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/create-gatsby/package.json b/packages/create-gatsby/package.json index d56f3e0052df3..dc5f7c8a0bc59 100644 --- a/packages/create-gatsby/package.json +++ b/packages/create-gatsby/package.json @@ -35,7 +35,6 @@ "string-length": "^4.0.2", "terminal-link": "^2.1.1", "tiny-spin": "^1.0.2", - "typescript": "^4.3.5", "uuid": "3.4.0" }, "repository": { diff --git a/packages/gatsby-admin/package.json b/packages/gatsby-admin/package.json index 8afb679cfd2b1..5dbc8675288d5 100644 --- a/packages/gatsby-admin/package.json +++ b/packages/gatsby-admin/package.json @@ -45,7 +45,6 @@ "strict-ui": "^0.2.0-0", "subscriptions-transport-ws": "^0.9.18", "theme-ui": "^0.4.0-rc.14", - "typescript": "^4.3.5", "urql": "^1.11.6", "yup": "^0.32.8" }, diff --git a/yarn.lock b/yarn.lock index cdfa045a126dc..577f12569aab8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -21971,9 +21971,9 @@ prettier@2.1.2: integrity sha512-16c7K+x4qVlJg9rEbXl7HEGmQyZlG4R9AgP+oHKRMsMsuk8s+ATStlf1NpDqyBI1HpVyfjLOeMhH2LvuNvV5Vg== prettier@^2.0.5, prettier@^2.2.1, prettier@^2.3.0: - version "2.3.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.1.tgz#76903c3f8c4449bc9ac597acefa24dc5ad4cbea6" - integrity sha512-p+vNbgpLjif/+D+DwAZAbndtRrR0md0MwfmOVN9N+2RgyACMT+7tfaRnT+WDPkqnuVwleyuBIG2XBxKDme3hPA== + version "2.3.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.2.tgz#ef280a05ec253712e486233db5c6f23441e7342d" + integrity sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ== pretty-bytes@^3.0.0: version "3.0.1" From 7cd8a2f622df53881080416664a5db12da5bd707 Mon Sep 17 00:00:00 2001 From: Ward Peeters Date: Mon, 5 Jul 2021 16:16:27 +0200 Subject: [PATCH 5/5] fix redux stypes --- packages/gatsby-cli/src/reporter/redux/index.ts | 6 +++--- packages/gatsby/src/redux/index.ts | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/gatsby-cli/src/reporter/redux/index.ts b/packages/gatsby-cli/src/reporter/redux/index.ts index 227ec01bd4b4c..6f629d9401d85 100644 --- a/packages/gatsby-cli/src/reporter/redux/index.ts +++ b/packages/gatsby-cli/src/reporter/redux/index.ts @@ -1,11 +1,11 @@ -import { createStore, combineReducers } from "redux" +import { createStore, combineReducers, Store } from "redux" import { reducer } from "./reducer" -import { ActionsUnion, ISetLogs } from "./types" +import { ActionsUnion, ISetLogs, IGatsbyCLIState } from "./types" import { isInternalAction } from "./utils" import { createStructuredLoggingDiagnosticsMiddleware } from "./diagnostics" import { Actions } from "../constants" -let store = createStore( +let store: Store<{ logs: IGatsbyCLIState }> = createStore( combineReducers({ logs: reducer, }), diff --git a/packages/gatsby/src/redux/index.ts b/packages/gatsby/src/redux/index.ts index 2a9d93d4079ab..2b12b21f7b325 100644 --- a/packages/gatsby/src/redux/index.ts +++ b/packages/gatsby/src/redux/index.ts @@ -5,6 +5,7 @@ import { DeepPartial, Middleware, ReducersMapObject, + Store, } from "redux" import _ from "lodash" import telemetry from "gatsby-telemetry" @@ -78,7 +79,9 @@ const multi: Middleware = ({ dispatch }) => next => ( // We're using the inferred type here because manually typing it would be very complicated // and error-prone. Instead we'll make use of the createStore return value, and export that type. // eslint-disable-next-line @typescript-eslint/explicit-function-return-type -export const configureStore = (initialState: IGatsbyState) => +export const configureStore = ( + initialState: IGatsbyState +): Store => createStore( combineReducers({ ...reducers }), initialState,