Skip to content

Commit

Permalink
Run prettier write on all files
Browse files Browse the repository at this point in the history
  • Loading branch information
ollieri3 committed Nov 18, 2023
1 parent f5b11cf commit a2463bc
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 37 deletions.
5 changes: 4 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
src/views/signup.handlebars

## Email templates are a mess, don't even attempt to format them
src/views/email/*
12 changes: 8 additions & 4 deletions src/controllers/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}
2 changes: 1 addition & 1 deletion src/controllers/privacy-policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ import type { Request, Response } from "express";

export function privacyPolicy(_: Request, res: Response) {
return res.render("privacy-policy");
}
}
6 changes: 3 additions & 3 deletions src/lib/mail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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" <[email protected]>',
to,
Expand All @@ -41,5 +41,5 @@ async function sendPlain({to, subject, text} : SendPlainOptions) {

export const mail = {
send,
sendPlain
sendPlain,
};
4 changes: 2 additions & 2 deletions src/middleware/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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", {
Expand Down
4 changes: 2 additions & 2 deletions src/public/calendar.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
outline: 0;
}

.day:focus-visible {
.day:focus-visible {
box-shadow: inset 0px 1px 20px 10px #0068ff;
}

Expand Down Expand Up @@ -80,4 +80,4 @@
#calendar {
grid-template-columns: repeat(1, [col-start] 1fr);
}
}
}
4 changes: 2 additions & 2 deletions src/public/home.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}

.arrow-icon {
transform: scaleX(-1)
transform: scaleX(-1);
}

.day {
Expand Down Expand Up @@ -64,7 +64,7 @@
}
.day.animate::before {
animation-duration: 0ms;
animation-delay:0ms
animation-delay: 0ms;
}
}

Expand Down
41 changes: 25 additions & 16 deletions src/public/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
10 changes: 7 additions & 3 deletions src/views/error.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,20 @@
<section class="m-auto flex max-w-7xl justify-center pt-20">
<div class="rounded-md bg-white p-4 text-center">
<h1 class="text-5xl text-red-500">An Unexpected Error Occurred</h1>
<p class="mt-5"><code class="bg-black text-orange-300 p-1 rounded-md">{{errorId}}</code></p>
<p class="mt-5"><code
class="rounded-md bg-black p-1 text-orange-300"
>{{errorId}}</code></p>
{{#if error}}
<pre class="m-auto mt-10 max-w-prose bg-slate-100 p-4">{{error}}</pre>
{{/if}}

{{#if stack}}
<pre class="overflow-x-auto m-auto mt-10 max-w-prose bg-slate-100 p-4">{{stack}}</pre>
<pre
class="m-auto mt-10 max-w-prose overflow-x-auto bg-slate-100 p-4"
>{{stack}}</pre>
{{/if}}

</div>
</section>

</div>
4 changes: 1 addition & 3 deletions tsconfig.frontend.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"include": [
"src/public/**/*"
],
"include": ["src/public/**/*"],
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
Expand Down

0 comments on commit a2463bc

Please sign in to comment.