Skip to content

Commit 43b7b3b

Browse files
authored
Merge branch 'main' into pr/helmet
2 parents d5069e0 + fdeda42 commit 43b7b3b

File tree

9 files changed

+28
-30
lines changed

9 files changed

+28
-30
lines changed

.vscode/remix.code-snippets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,4 @@
7777
"}",
7878
],
7979
},
80-
}
80+
}

app/components/ui/button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import * as React from 'react'
55
import { cn } from '#app/utils/misc.tsx'
66

77
const buttonVariants = cva(
8-
'inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors outline-none focus-visible:ring-2 focus-within:ring-2 ring-ring ring-offset-2 disabled:pointer-events-none disabled:opacity-50',
8+
'inline-flex items-center justify-center rounded-md text-sm font-medium outline-none ring-ring ring-offset-2 ring-offset-background transition-colors focus-within:ring-2 focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50',
99
{
1010
variants: {
1111
variant: {

app/entry.server.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { PassThrough } from 'node:stream'
2+
import { styleText } from 'node:util'
23
import { contentSecurity } from '@nichtsam/helmet/rules/content/index'
34
import { createReadableStreamFromReadable } from '@react-router/node'
45
import * as Sentry from '@sentry/node'
5-
import chalk from 'chalk'
66
import { isbot } from 'isbot'
77
import { renderToPipeableStream } from 'react-dom/server'
88
import {
@@ -136,7 +136,7 @@ export function handleError(
136136
return
137137
}
138138
if (error instanceof Error) {
139-
console.error(chalk.red(error.stack))
139+
console.error(styleText('red', String(error.stack)))
140140
void Sentry.captureException(error)
141141
} else {
142142
console.error(error)

app/routes/settings+/profile.two-factor.verify.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ export async function loader({ request }: Route.LoaderArgs) {
5959
const issuer = new URL(getDomainUrl(request)).host
6060
const otpUri = getTOTPAuthUri({
6161
...verification,
62-
// OTP clients break with the `-` in the algorithm name.
63-
algorithm: verification.algorithm.replaceAll('-', ''),
6462
accountName: user.email,
6563
issuer,
6664
})

app/utils/db.server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
import { styleText } from 'node:util'
12
import { remember } from '@epic-web/remember'
23
// Changed import due to issue: https://github.com/remix-run/react-router/pull/12644
34
import { PrismaClient } from '@prisma/client/index.js'
4-
import chalk from 'chalk'
55

66
export const prisma = remember('prisma', () => {
77
// NOTE: if you change anything in this function you'll need to restart
@@ -29,7 +29,7 @@ export const prisma = remember('prisma', () => {
2929
: e.duration < logThreshold * 1.4
3030
? 'redBright'
3131
: 'red'
32-
const dur = chalk[color](`${e.duration}ms`)
32+
const dur = styleText(color, `${e.duration}ms`)
3333
console.info(`prisma:query - ${dur} - ${e.query}`)
3434
})
3535
void client.$connect()

docs/server-timing.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,10 @@ export async function loader({ params }: Route.LoaderArgs) {
7878
// We have a general headers handler to save you from boilerplating.
7979
export const headers: HeadersFunction = pipeHeaders
8080
// this is basically what it does though
81-
export const headers: Route.HeadersFunction = ({ loaderHeaders, parentHeaders }) => {
81+
export const headers: Route.HeadersFunction = ({
82+
loaderHeaders,
83+
parentHeaders,
84+
}) => {
8285
return {
8386
'Server-Timing': combineServerTimings(parentHeaders, loaderHeaders), // <-- 4. Send headers
8487
}

package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"sideEffects": false,
55
"license": "MIT",
66
"epic-stack": {
7-
"head": "80b114fc0c1f3d6402627bc030d82e205dc3293c",
8-
"date": "2025-02-11T04:40:56Z"
7+
"head": "af3a7f9bba62284c17a03dfaecd077d4e88a0ccc",
8+
"date": "2025-02-14T21:12:08Z"
99
},
1010
"author": "Kent C. Dodds <[email protected]> (https://kentcdodds.com/)",
1111
"type": "module",
@@ -50,7 +50,7 @@
5050
"@epic-web/client-hints": "^1.3.5",
5151
"@epic-web/invariant": "^1.0.0",
5252
"@epic-web/remember": "^1.1.0",
53-
"@epic-web/totp": "^2.1.1",
53+
"@epic-web/totp": "^3.0.0",
5454
"@mjackson/form-data-parser": "^0.7.0",
5555
"@nasa-gcn/remix-seo": "^2.0.1",
5656
"@nichtsam/helmet": "0.2.0",
@@ -77,7 +77,6 @@
7777
"address": "^2.0.3",
7878
"bcryptjs": "^2.4.3",
7979
"better-sqlite3": "^11.8.1",
80-
"chalk": "^5.4.1",
8180
"class-variance-authority": "^0.7.1",
8281
"close-with-grace": "^2.2.0",
8382
"clsx": "^2.1.1",

server/index.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import crypto from 'node:crypto'
2+
import { styleText } from 'node:util'
23
import { helmet } from '@nichtsam/helmet/node-http'
34
import { createRequestHandler } from '@react-router/express'
45
import * as Sentry from '@sentry/node'
56
import { ip as ipAddress } from 'address'
6-
import chalk from 'chalk'
77
import closeWithGrace from 'close-with-grace'
88
import compression from 'compression'
99
import express from 'express'
@@ -230,9 +230,7 @@ if (!portAvailable && !IS_DEV) {
230230
const server = app.listen(portToUse, () => {
231231
if (!portAvailable) {
232232
console.warn(
233-
chalk.yellow(
234-
`⚠️ Port ${desiredPort} is not available, using ${portToUse} instead.`,
235-
),
233+
styleText('yellow', `⚠️ Port ${desiredPort} is not available, using ${portToUse} instead.`),
236234
)
237235
}
238236
console.log(`🚀 We have liftoff!`)
@@ -248,9 +246,9 @@ const server = app.listen(portToUse, () => {
248246

249247
console.log(
250248
`
251-
${chalk.bold('Local:')} ${chalk.cyan(localUrl)}
252-
${lanUrl ? `${chalk.bold('On Your Network:')} ${chalk.cyan(lanUrl)}` : ''}
253-
${chalk.bold('Press Ctrl+C to stop')}
249+
${styleText('bold', 'Local:')} ${styleText('cyan', localUrl)}
250+
${lanUrl ? `${styleText('bold', 'On Your Network:')} ${styleText('cyan', lanUrl)}` : ''}
251+
${styleText('bold', 'Press Ctrl+C to stop')}
254252
`.trim(),
255253
)
256254
})
@@ -260,8 +258,8 @@ closeWithGrace(async ({ err }) => {
260258
server.close((e) => (e ? reject(e) : resolve('ok')))
261259
})
262260
if (err) {
263-
console.error(chalk.red(err))
264-
console.error(chalk.red(err.stack))
261+
console.error(styleText('red', String(err)))
262+
console.error(styleText('red', String(err.stack)))
265263
if (SENTRY_ENABLED) {
266264
Sentry.captureException(err)
267265
await Sentry.flush(500)

0 commit comments

Comments
 (0)