Browse Source

giving yarn v3 a go...

pull/607/head
Jake Jarvis 1 month ago
parent
commit
7fb02275ad
Signed by: jake GPG Key ID: 2B0C9CF251E69A39
  1. 9
      .gitignore
  2. 363
      .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
  3. 631
      .yarn/releases/yarn-3.0.2.cjs
  4. 9
      .yarnrc.yml
  5. 6
      api/contact.js
  6. 8
      assets/js/src/contact.js
  7. 9
      package.json
  8. 25702
      yarn.lock

9
.gitignore

@ -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/

363
.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

File diff suppressed because one or more lines are too long

631
.yarn/releases/yarn-3.0.2.cjs

File diff suppressed because one or more lines are too long

9
.yarnrc.yml

@ -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

6
api/contact.js

@ -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);

8
assets/js/src/contact.js

@ -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...

9
package.json

@ -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"
}
}

25702
yarn.lock

File diff suppressed because it is too large
Loading…
Cancel
Save