giving yarn v3 a go...

This commit is contained in:
2021-10-19 09:48:03 -04:00
parent 031825fbdc
commit 7fb02275ad
8 changed files with 15925 additions and 10810 deletions
+9
View File
@@ -15,6 +15,15 @@ npm-debug.log*
yarn-debug.log* yarn-debug.log*
yarn-error.log* yarn-error.log*
# yarn berry
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
# Lighthouse CI # Lighthouse CI
.lighthouseci/ .lighthouseci/
File diff suppressed because one or more lines are too long
+631
View File
File diff suppressed because one or more lines are too long
+9
View File
@@ -0,0 +1,9 @@
enableGlobalCache: true
nodeLinker: node-modules
plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"
yarnPath: .yarn/releases/yarn-3.0.2.cjs
+3 -3
View File
@@ -42,11 +42,11 @@ export default async (req, res) => {
// in the same fashion. // in the same fashion.
if (!body.name || !body.email || !body.message) { if (!body.name || !body.email || !body.message) {
// all fields are required // all fields are required
throw new Error("MISSING_DATA"); throw new Error("USER_MISSING_DATA");
} }
if (!body["h-captcha-response"] || !(await validateCaptcha(body["h-captcha-response"]))) { if (!body["h-captcha-response"] || !(await validateCaptcha(body["h-captcha-response"]))) {
// either the captcha is wrong or completely missing // either the captcha is wrong or completely missing
throw new Error("INVALID_CAPTCHA"); throw new Error("USER_INVALID_CAPTCHA");
} }
// sent directly to airtable // sent directly to airtable
@@ -69,7 +69,7 @@ export default async (req, res) => {
const message = error instanceof Error ? error.message : "UNKNOWN_EXCEPTION"; const message = error instanceof Error ? error.message : "UNKNOWN_EXCEPTION";
// don't log PEBCAK errors to sentry // don't log PEBCAK errors to sentry
if (message !== "MISSING_DATA" && message !== "INVALID_CAPTCHA") { if (!message.startsWith("USER_")) {
// log error to sentry, give it 2 seconds to finish sending // log error to sentry, give it 2 seconds to finish sending
Sentry.captureException(error); Sentry.captureException(error);
await Sentry.flush(2000); await Sentry.flush(2000);
+4 -4
View File
@@ -34,10 +34,10 @@ if (contactForm) {
// we throw identical error messages to the server's so they're caught in // we throw identical error messages to the server's so they're caught in
// the same way below. // the same way below.
if (!formData.name || !formData.email || !formData.message) { if (!formData.name || !formData.email || !formData.message) {
throw new Error("MISSING_DATA"); throw new Error("USER_MISSING_DATA");
} }
if (!formData["h-captcha-response"]) { if (!formData["h-captcha-response"]) {
throw new Error("INVALID_CAPTCHA"); throw new Error("USER_INVALID_CAPTCHA");
} }
// post JSONified form input to /api/contact/ // post JSONified form input to /api/contact/
@@ -71,9 +71,9 @@ if (contactForm) {
const message = error instanceof Error ? error.message : "UNKNOWN_EXCEPTION"; const message = error instanceof Error ? error.message : "UNKNOWN_EXCEPTION";
// give user feedback based on the error message returned // give user feedback based on the error message returned
if (message === "INVALID_CAPTCHA") { if (message === "USER_INVALID_CAPTCHA") {
errorSpan.innerText = "Did you complete the CAPTCHA? (If you're human, that is...)"; errorSpan.innerText = "Did you complete the CAPTCHA? (If you're human, that is...)";
} else if (message === "MISSING_DATA") { } else if (message === "USER_MISSING_DATA") {
errorSpan.innerText = "Please make sure that all fields are filled in."; errorSpan.innerText = "Please make sure that all fields are filled in.";
} else { } else {
// something else went wrong, and it's probably my fault... // something else went wrong, and it's probably my fault...
+5 -4
View File
@@ -40,7 +40,7 @@
"faunadb": "^4.4.1", "faunadb": "^4.4.1",
"get-canonical-url": "^1.0.1", "get-canonical-url": "^1.0.1",
"graphql": "^15.6.1", "graphql": "^15.6.1",
"graphql-request": "^3.6.0", "graphql-request": "^3.6.1",
"graphql-tag": "^2.12.5", "graphql-tag": "^2.12.5",
"html-entities": "^2.3.2", "html-entities": "^2.3.2",
"lit-html": "^2.0.1", "lit-html": "^2.0.1",
@@ -114,7 +114,7 @@
"terser-webpack-plugin": "^5.2.4", "terser-webpack-plugin": "^5.2.4",
"webpack": "^5.58.2", "webpack": "^5.58.2",
"webpack-assets-manifest": "^5.0.6", "webpack-assets-manifest": "^5.0.6",
"webpack-cli": "^4.9.0", "webpack-cli": "^4.9.1",
"webpack-dev-server": "^4.3.1" "webpack-dev-server": "^4.3.1"
}, },
"optionalDependencies": { "optionalDependencies": {
@@ -124,7 +124,7 @@
"imagemin-svgo": "^10.0.0" "imagemin-svgo": "^10.0.0"
}, },
"resolutions": { "resolutions": {
"mozjpeg": "7.1.0" "imagemin-mozjpeg/mozjpeg": "7.1.0"
}, },
"simple-git-hooks": { "simple-git-hooks": {
"pre-commit": "npx lint-staged" "pre-commit": "npx lint-staged"
@@ -143,8 +143,9 @@
"prettier --check" "prettier --check"
] ]
}, },
"packageManager": "yarn@3.0.2",
"volta": { "volta": {
"node": "14.18.1", "node": "14.18.1",
"yarn": "1.22.15" "yarn": "1.22.17"
} }
} }
+14901 -10799
View File
File diff suppressed because it is too large Load Diff