1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-10-29 02:35:48 -04:00

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
.gitignore vendored
View File

@@ -15,6 +15,15 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
# yarn berry
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
# Lighthouse CI
.lighthouseci/

File diff suppressed because one or more lines are too long

631
.yarn/releases/yarn-3.0.2.cjs vendored Executable file

File diff suppressed because one or more lines are too long

9
.yarnrc.yml Normal file
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

View File

@@ -42,11 +42,11 @@ export default async (req, res) => {
// in the same fashion.
if (!body.name || !body.email || !body.message) {
// 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"]))) {
// either the captcha is wrong or completely missing
throw new Error("INVALID_CAPTCHA");
throw new Error("USER_INVALID_CAPTCHA");
}
// sent directly to airtable
@@ -69,7 +69,7 @@ export default async (req, res) => {
const message = error instanceof Error ? error.message : "UNKNOWN_EXCEPTION";
// 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
Sentry.captureException(error);
await Sentry.flush(2000);

View File

@@ -34,10 +34,10 @@ if (contactForm) {
// we throw identical error messages to the server's so they're caught in
// the same way below.
if (!formData.name || !formData.email || !formData.message) {
throw new Error("MISSING_DATA");
throw new Error("USER_MISSING_DATA");
}
if (!formData["h-captcha-response"]) {
throw new Error("INVALID_CAPTCHA");
throw new Error("USER_INVALID_CAPTCHA");
}
// post JSONified form input to /api/contact/
@@ -71,9 +71,9 @@ if (contactForm) {
const message = error instanceof Error ? error.message : "UNKNOWN_EXCEPTION";
// 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...)";
} else if (message === "MISSING_DATA") {
} else if (message === "USER_MISSING_DATA") {
errorSpan.innerText = "Please make sure that all fields are filled in.";
} else {
// something else went wrong, and it's probably my fault...

View File

@@ -40,7 +40,7 @@
"faunadb": "^4.4.1",
"get-canonical-url": "^1.0.1",
"graphql": "^15.6.1",
"graphql-request": "^3.6.0",
"graphql-request": "^3.6.1",
"graphql-tag": "^2.12.5",
"html-entities": "^2.3.2",
"lit-html": "^2.0.1",
@@ -114,7 +114,7 @@
"terser-webpack-plugin": "^5.2.4",
"webpack": "^5.58.2",
"webpack-assets-manifest": "^5.0.6",
"webpack-cli": "^4.9.0",
"webpack-cli": "^4.9.1",
"webpack-dev-server": "^4.3.1"
},
"optionalDependencies": {
@@ -124,7 +124,7 @@
"imagemin-svgo": "^10.0.0"
},
"resolutions": {
"mozjpeg": "7.1.0"
"imagemin-mozjpeg/mozjpeg": "7.1.0"
},
"simple-git-hooks": {
"pre-commit": "npx lint-staged"
@@ -143,8 +143,9 @@
"prettier --check"
]
},
"packageManager": "yarn@3.0.2",
"volta": {
"node": "14.18.1",
"yarn": "1.22.15"
"yarn": "1.22.17"
}
}

25700
yarn.lock

File diff suppressed because it is too large Load Diff