diff --git a/.prettierignore b/.prettierignore index 99b0e56..d03fc66 100644 --- a/.prettierignore +++ b/.prettierignore @@ -9,4 +9,7 @@ src/views/layouts/main.handlebars src/views/activation_success.handlebars src/views/partials/formpage.handlebars src/views/signin.handlebars -src/views/signup.handlebars \ No newline at end of file +src/views/signup.handlebars + +## Email templates are a mess, don't even attempt to format them +src/views/email/* \ No newline at end of file diff --git a/src/controllers/error.ts b/src/controllers/error.ts index cd7b6da..d79b11e 100644 --- a/src/controllers/error.ts +++ b/src/controllers/error.ts @@ -3,11 +3,15 @@ import type { Request, Response, NextFunction } from "express"; /** * This handler exists purely to force an error to test error handling. */ -export function errorTest(req: Request<{}, {}, {}, {async?: "true" | "false"}>, res: Response, next: NextFunction) { - if(req.query.async === "true") { +export function errorTest( + req: Request<{}, {}, {}, { async?: "true" | "false" }>, + res: Response, + next: NextFunction, +) { + if (req.query.async === "true") { return process.nextTick(() => { next(new Error("This is a test async error")); - }) + }); } throw new Error("This is a test error"); -} \ No newline at end of file +} diff --git a/src/controllers/privacy-policy.ts b/src/controllers/privacy-policy.ts index eea4203..b8afa6f 100644 --- a/src/controllers/privacy-policy.ts +++ b/src/controllers/privacy-policy.ts @@ -2,4 +2,4 @@ import type { Request, Response } from "express"; export function privacyPolicy(_: Request, res: Response) { return res.render("privacy-policy"); -} \ No newline at end of file +} diff --git a/src/lib/mail.ts b/src/lib/mail.ts index e99eb0e..28f1572 100644 --- a/src/lib/mail.ts +++ b/src/lib/mail.ts @@ -29,8 +29,8 @@ type SendPlainOptions = { to: string; subject: string; text: string; -} -async function sendPlain({to, subject, text} : SendPlainOptions) { +}; +async function sendPlain({ to, subject, text }: SendPlainOptions) { await transporter.sendMail({ from: '"Daily Do It" ', to, @@ -41,5 +41,5 @@ async function sendPlain({to, subject, text} : SendPlainOptions) { export const mail = { send, - sendPlain + sendPlain, }; diff --git a/src/middleware/error.ts b/src/middleware/error.ts index e1569f4..fe88c8d 100644 --- a/src/middleware/error.ts +++ b/src/middleware/error.ts @@ -8,14 +8,14 @@ export function notFound(req: Request, res: Response) { } export const serverError: ErrorRequestHandler = (error, req, res, next) => { - console.error(error); + console.error(error); res.status(500); if (ENV.DEPLOYMENT === "dev") { return res.render("error", { // Only show stack trace in dev errorId: "sentry" in res ? res.sentry : undefined, - stack: error instanceof Error ? error.stack : undefined + stack: error instanceof Error ? error.stack : undefined, }); } else { return res.render("error", { diff --git a/src/public/calendar.css b/src/public/calendar.css index 64bc949..142cc2c 100644 --- a/src/public/calendar.css +++ b/src/public/calendar.css @@ -32,7 +32,7 @@ outline: 0; } -.day:focus-visible { +.day:focus-visible { box-shadow: inset 0px 1px 20px 10px #0068ff; } @@ -80,4 +80,4 @@ #calendar { grid-template-columns: repeat(1, [col-start] 1fr); } -} \ No newline at end of file +} diff --git a/src/public/home.css b/src/public/home.css index 0261c35..a76c1a0 100644 --- a/src/public/home.css +++ b/src/public/home.css @@ -12,7 +12,7 @@ } .arrow-icon { - transform: scaleX(-1) + transform: scaleX(-1); } .day { @@ -64,7 +64,7 @@ } .day.animate::before { animation-duration: 0ms; - animation-delay:0ms + animation-delay: 0ms; } } diff --git a/src/public/main.css b/src/public/main.css index 5afc537..2c150a2 100644 --- a/src/public/main.css +++ b/src/public/main.css @@ -11,57 +11,66 @@ html { */ .visually-hidden { position: absolute !important; - height: 1px; width: 1px; + height: 1px; + width: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; } - /* Sign in with Google CSS Credit: Mirko Akov: https://codepen.io/mupkoo/pen/YgddgB */ .login-with-google-btn { - transition: background-color .3s, box-shadow .3s; - + transition: + background-color 0.3s, + box-shadow 0.3s; + padding: 12px 16px 12px 42px; border: none; border-radius: 3px; - box-shadow: 0 -1px 0 rgba(0, 0, 0, .04), 0 1px 1px rgba(0, 0, 0, .25); - + box-shadow: + 0 -1px 0 rgba(0, 0, 0, 0.04), + 0 1px 1px rgba(0, 0, 0, 0.25); + color: #757575; font-size: 14px; font-weight: 500; - font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Fira Sans","Droid Sans","Helvetica Neue",sans-serif; - + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, + Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBkPSJNMTcuNiA5LjJsLS4xLTEuOEg5djMuNGg0LjhDMTMuNiAxMiAxMyAxMyAxMiAxMy42djIuMmgzYTguOCA4LjggMCAwIDAgMi42LTYuNnoiIGZpbGw9IiM0Mjg1RjQiIGZpbGwtcnVsZT0ibm9uemVybyIvPjxwYXRoIGQ9Ik05IDE4YzIuNCAwIDQuNS0uOCA2LTIuMmwtMy0yLjJhNS40IDUuNCAwIDAgMS04LTIuOUgxVjEzYTkgOSAwIDAgMCA4IDV6IiBmaWxsPSIjMzRBODUzIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48cGF0aCBkPSJNNCAxMC43YTUuNCA1LjQgMCAwIDEgMC0zLjRWNUgxYTkgOSAwIDAgMCAwIDhsMy0yLjN6IiBmaWxsPSIjRkJCQzA1IiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48cGF0aCBkPSJNOSAzLjZjMS4zIDAgMi41LjQgMy40IDEuM0wxNSAyLjNBOSA5IDAgMCAwIDEgNWwzIDIuNGE1LjQgNS40IDAgMCAxIDUtMy43eiIgZmlsbD0iI0VBNDMzNSIgZmlsbC1ydWxlPSJub256ZXJvIi8+PHBhdGggZD0iTTAgMGgxOHYxOEgweiIvPjwvZz48L3N2Zz4=); background-color: white; background-repeat: no-repeat; background-position: 12px 13px; - + &:hover { - box-shadow: 0 -1px 0 rgba(0, 0, 0, .04), 0 2px 4px rgba(0, 0, 0, .25); + box-shadow: + 0 -1px 0 rgba(0, 0, 0, 0.04), + 0 2px 4px rgba(0, 0, 0, 0.25); } &:active { background-color: #eeeeee; } &:focus { outline: none; - box-shadow: - 0 -1px 0 rgba(0, 0, 0, .04), - 0 2px 4px rgba(0, 0, 0, .25), + box-shadow: + 0 -1px 0 rgba(0, 0, 0, 0.04), + 0 2px 4px rgba(0, 0, 0, 0.25), 0 0 0 3px #c8dafc; } &:disabled { filter: grayscale(100%); background-color: #ebebeb; - box-shadow: 0 -1px 0 rgba(0, 0, 0, .04), 0 1px 1px rgba(0, 0, 0, .25); + box-shadow: + 0 -1px 0 rgba(0, 0, 0, 0.04), + 0 1px 1px rgba(0, 0, 0, 0.25); cursor: not-allowed; } } .habits-background { - background-image: url('img/habits-grid.svg'); + background-image: url("img/habits-grid.svg"); background-repeat: repeat; background-position-x: 100px; background-position-y: 100px; -} \ No newline at end of file +} diff --git a/src/views/error.handlebars b/src/views/error.handlebars index 829b220..86142b5 100644 --- a/src/views/error.handlebars +++ b/src/views/error.handlebars @@ -7,16 +7,20 @@

An Unexpected Error Occurred

-

{{errorId}}

+

{{errorId}}

{{#if error}}
{{error}}
{{/if}} {{#if stack}} -
{{stack}}
+
{{stack}}
{{/if}}
- + \ No newline at end of file diff --git a/tsconfig.frontend.json b/tsconfig.frontend.json index 8bc95e8..f69d17f 100644 --- a/tsconfig.frontend.json +++ b/tsconfig.frontend.json @@ -1,7 +1,5 @@ { - "include": [ - "src/public/**/*" - ], + "include": ["src/public/**/*"], "compilerOptions": { "target": "ESNext", "module": "ESNext",