Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update dependencies #199

Merged
merged 1 commit into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/entry.client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ startTransition(() => {
document,
<StrictMode>
<RemixBrowser />
</StrictMode>
</StrictMode>,
);
});
18 changes: 9 additions & 9 deletions app/entry.server.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,28 @@ export default function handleRequest(
request: Request,
responseStatusCode: number,
responseHeaders: Headers,
remixContext: EntryContext
remixContext: EntryContext,
) {
return isbot(request.headers.get("user-agent"))
? handleBotRequest(
request,
responseStatusCode,
responseHeaders,
remixContext
remixContext,
)
: handleBrowserRequest(
request,
responseStatusCode,
responseHeaders,
remixContext
remixContext,
);
}

function handleBotRequest(
request: Request,
responseStatusCode: number,
responseHeaders: Headers,
remixContext: EntryContext
remixContext: EntryContext,
) {
return new Promise((resolve, reject) => {
const { pipe, abort } = renderToPipeableStream(
Expand All @@ -58,7 +58,7 @@ function handleBotRequest(
new Response(body, {
headers: responseHeaders,
status: responseStatusCode,
})
}),
);

pipe(body);
Expand All @@ -70,7 +70,7 @@ function handleBotRequest(
responseStatusCode = 500;
console.error(error);
},
}
},
);

setTimeout(abort, ABORT_DELAY);
Expand All @@ -81,7 +81,7 @@ function handleBrowserRequest(
request: Request,
responseStatusCode: number,
responseHeaders: Headers,
remixContext: EntryContext
remixContext: EntryContext,
) {
return new Promise((resolve, reject) => {
const { pipe, abort } = renderToPipeableStream(
Expand All @@ -100,7 +100,7 @@ function handleBrowserRequest(
new Response(body, {
headers: responseHeaders,
status: responseStatusCode,
})
}),
);

pipe(body);
Expand All @@ -112,7 +112,7 @@ function handleBrowserRequest(
console.error(error);
responseStatusCode = 500;
},
}
},
);

setTimeout(abort, ABORT_DELAY);
Expand Down
4 changes: 2 additions & 2 deletions app/models/user.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export async function deleteUserByEmail(email: User["email"]) {

export async function verifyLogin(
email: User["email"],
password: Password["hash"]
password: Password["hash"],
) {
const userWithPassword = await prisma.user.findUnique({
where: { email },
Expand All @@ -49,7 +49,7 @@ export async function verifyLogin(

const isValid = await bcrypt.compare(
password,
userWithPassword.password.hash
userWithPassword.password.hash,
);

if (!isValid) {
Expand Down
8 changes: 4 additions & 4 deletions app/routes/join.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@ export const action = async ({ request }: ActionArgs) => {
if (!validateEmail(email)) {
return json(
{ errors: { email: "Email is invalid", password: null } },
{ status: 400 }
{ status: 400 },
);
}

if (typeof password !== "string" || password.length === 0) {
return json(
{ errors: { email: null, password: "Password is required" } },
{ status: 400 }
{ status: 400 },
);
}

if (password.length < 8) {
return json(
{ errors: { email: null, password: "Password is too short" } },
{ status: 400 }
{ status: 400 },
);
}

Expand All @@ -49,7 +49,7 @@ export const action = async ({ request }: ActionArgs) => {
password: null,
},
},
{ status: 400 }
{ status: 400 },
);
}

Expand Down
8 changes: 4 additions & 4 deletions app/routes/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,21 @@ export const action = async ({ request }: ActionArgs) => {
if (!validateEmail(email)) {
return json(
{ errors: { email: "Email is invalid", password: null } },
{ status: 400 }
{ status: 400 },
);
}

if (typeof password !== "string" || password.length === 0) {
return json(
{ errors: { email: null, password: "Password is required" } },
{ status: 400 }
{ status: 400 },
);
}

if (password.length < 8) {
return json(
{ errors: { email: null, password: "Password is too short" } },
{ status: 400 }
{ status: 400 },
);
}

Expand All @@ -46,7 +46,7 @@ export const action = async ({ request }: ActionArgs) => {
if (!user) {
return json(
{ errors: { email: "Invalid email or password", password: null } },
{ status: 400 }
{ status: 400 },
);
}

Expand Down
4 changes: 2 additions & 2 deletions app/routes/notes.new.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ export const action = async ({ request }: ActionArgs) => {
if (typeof title !== "string" || title.length === 0) {
return json(
{ errors: { body: null, title: "Title is required" } },
{ status: 400 }
{ status: 400 },
);
}

if (typeof body !== "string" || body.length === 0) {
return json(
{ errors: { body: "Body is required", title: null } },
{ status: 400 }
{ status: 400 },
);
}

Expand Down
4 changes: 2 additions & 2 deletions app/session.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export async function getSession(request: Request) {
}

export async function getUserId(
request: Request
request: Request,
): Promise<User["id"] | undefined> {
const session = await getSession(request);
const userId = session.get(USER_SESSION_KEY);
Expand All @@ -44,7 +44,7 @@ export async function getUser(request: Request) {

export async function requireUserId(
request: Request,
redirectTo: string = new URL(request.url).pathname
redirectTo: string = new URL(request.url).pathname,
) {
const userId = await getUserId(request);
if (!userId) {
Expand Down
8 changes: 4 additions & 4 deletions app/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const DEFAULT_REDIRECT = "/";
*/
export function safeRedirect(
to: FormDataEntryValue | string | null | undefined,
defaultRedirect: string = DEFAULT_REDIRECT
defaultRedirect: string = DEFAULT_REDIRECT,
) {
if (!to || typeof to !== "string") {
return defaultRedirect;
Expand All @@ -34,12 +34,12 @@ export function safeRedirect(
* @returns {JSON|undefined} The router data or undefined if not found
*/
export function useMatchesData(
id: string
id: string,
): Record<string, unknown> | undefined {
const matchingRoutes = useMatches();
const route = useMemo(
() => matchingRoutes.find((route) => route.id === id),
[matchingRoutes, id]
[matchingRoutes, id],
);
return route?.data;
}
Expand All @@ -60,7 +60,7 @@ export function useUser(): User {
const maybeUser = useOptionalUser();
if (!maybeUser) {
throw new Error(
"No user found in root loader, but user is required by useUser. If user is optional, try useOptionalUser instead."
"No user found in root loader, but user is required by useUser. If user is optional, try useOptionalUser instead.",
);
}
return maybeUser;
Expand Down
4 changes: 2 additions & 2 deletions cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function login({
} = {}) {
cy.then(() => ({ email })).as("user");
cy.exec(
`npx ts-node --require tsconfig-paths/register ./cypress/support/create-user.ts "${email}"`
`npx ts-node --require tsconfig-paths/register ./cypress/support/create-user.ts "${email}"`,
).then(({ stdout }) => {
const cookieValue = stdout
.replace(/.*<cookie>(?<cookieValue>.*)<\/cookie>.*/s, "$<cookieValue>")
Expand All @@ -75,7 +75,7 @@ function cleanupUser({ email }: { email?: string } = {}) {

function deleteUserByEmail(email: string) {
cy.exec(
`npx ts-node --require tsconfig-paths/register ./cypress/support/delete-user.ts "${email}"`
`npx ts-node --require tsconfig-paths/register ./cypress/support/delete-user.ts "${email}"`,
);
cy.clearCookie("__session");
}
Expand Down
2 changes: 1 addition & 1 deletion cypress/support/create-user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ async function createAndLogin(email: string) {
<cookie>
${parsedCookie.__session}
</cookie>
`.trim()
`.trim(),
);
}

Expand Down
54 changes: 27 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
],
"dependencies": {
"@isaacs/express-prometheus-middleware": "^1.2.1",
"@prisma/client": "^4.16.1",
"@prisma/client": "^4.16.2",
"@remix-run/css-bundle": "*",
"@remix-run/express": "*",
"@remix-run/node": "*",
Expand All @@ -43,7 +43,7 @@
"compression": "^1.7.4",
"cross-env": "^7.0.3",
"express": "^4.18.2",
"isbot": "^3.6.12",
"isbot": "^3.6.13",
"morgan": "^1.10.0",
"prom-client": "^14.2.0",
"react": "^18.2.0",
Expand All @@ -56,46 +56,46 @@
"@remix-run/dev": "*",
"@remix-run/eslint-config": "*",
"@testing-library/cypress": "^9.0.0",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/jest-dom": "^5.17.0",
"@types/bcryptjs": "^2.4.2",
"@types/compression": "^1.7.2",
"@types/eslint": "^8.40.2",
"@types/eslint": "^8.44.2",
"@types/express": "^4.17.17",
"@types/morgan": "^1.9.4",
"@types/node": "^18.16.18",
"@types/react": "^18.2.14",
"@types/react-dom": "^18.2.6",
"@types/node": "^18.17.6",
"@types/react": "^18.2.20",
"@types/react-dom": "^18.2.7",
"@types/source-map-support": "^0.5.6",
"@vitejs/plugin-react": "^4.0.1",
"@vitest/coverage-v8": "^0.32.2",
"autoprefixer": "^10.4.14",
"@vitejs/plugin-react": "^4.0.4",
"@vitest/coverage-v8": "^0.34.2",
"autoprefixer": "^10.4.15",
"cookie": "^0.5.0",
"cypress": "^12.16.0",
"cypress": "^12.17.4",
"dotenv": "^16.3.1",
"esbuild": "^0.18.10",
"eslint": "^8.43.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-cypress": "^2.13.3",
"eslint-plugin-markdown": "^3.0.0",
"esbuild": "^0.19.2",
"eslint": "^8.47.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-cypress": "^2.14.0",
"eslint-plugin-markdown": "^3.0.1",
"eslint-plugin-prefer-let": "^3.0.1",
"happy-dom": "^9.20.3",
"msw": "^1.2.2",
"happy-dom": "^10.10.4",
"msw": "^1.2.3",
"npm-run-all": "^4.1.5",
"postcss": "^8.4.24",
"prettier": "^2.8.8",
"prettier-plugin-tailwindcss": "^0.3.0",
"prisma": "^4.16.1",
"postcss": "^8.4.28",
"prettier": "3.0.2",
"prettier-plugin-tailwindcss": "^0.5.3",
"prisma": "^4.16.2",
"start-server-and-test": "^2.0.0",
"tailwindcss": "^3.3.2",
"tailwindcss": "^3.3.3",
"ts-node": "^10.9.1",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.1.3",
"vite": "^4.3.9",
"typescript": "^5.1.6",
"vite": "^4.4.9",
"vite-tsconfig-paths": "^3.6.0",
"vitest": "^0.32.2"
"vitest": "^0.34.2"
},
"engines": {
"node": ">=14"
"node": ">=14.0.0"
},
"prisma": {
"seed": "ts-node --require tsconfig-paths/register prisma/seed.ts"
Expand Down
Loading
Loading