Skip to content
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
88 changes: 44 additions & 44 deletions bun.lock

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions client/editable-text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const inheritTextStyles = {
lineHeight: 'inherit',
color: 'inherit',
} as const
export function EditableText(handle: Handle) {
export function EditableText(handle: Handle<EditableTextProps>) {
let isEditing = false
let draftValue = ''
let isSaving = false
Expand All @@ -36,7 +36,8 @@ export function EditableText(handle: Handle) {
button.focus()
})
}
return (props: EditableTextProps) => {
return () => {
const props = handle.props
const buttonId = `${props.id}-button`
function startEditing() {
if (isSaving) return
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"@modelcontextprotocol/sdk": "1.26.0",
"agents": "^0.7.6",
"get-port": "^7.1.0",
"remix": "3.0.0-beta.0",
"remix": "3.0.0-beta.4",
"workers-ai-provider": "^3.1.2",
"zod": "^4.3.6"
}
Expand Down
7 changes: 2 additions & 5 deletions server/handlers/account.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type BuildAction } from 'remix/fetch-router'
import { type Action } from 'remix/router'
import { readAuthSessionResult } from '#server/auth-session.ts'
import { redirectToLogin } from '#server/auth-redirect.ts'
import { Layout } from '#server/layout.ts'
Expand All @@ -25,7 +25,4 @@ export const account = {

return response
},
} satisfies BuildAction<
typeof routes.account.method,
typeof routes.account.pattern
>
} satisfies Action<typeof routes.account>
2 changes: 1 addition & 1 deletion server/handlers/auth-handler.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference types="bun" />
import { beforeAll, expect, test } from 'vitest'
import { RequestContext } from 'remix/fetch-router'
import { RequestContext } from 'remix/router'
import { setAuthSessionSecret } from '#server/auth-session.ts'
import { createPasswordHash } from '#server/password-hash.ts'
import { createAuthHandler } from './auth.ts'
Expand Down
4 changes: 2 additions & 2 deletions server/handlers/auth.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type BuildAction } from 'remix/fetch-router'
import { type Action } from 'remix/router'
import { enum_, object, parseSafe, string } from 'remix/data-schema'
import { createAuthCookie, isSecureRequest } from '#server/auth-session.ts'
import { getRequestIp, logAuditEvent } from '#server/audit-log.ts'
Expand Down Expand Up @@ -235,5 +235,5 @@ export function createAuthHandler(appEnv: AppEnv) {
},
)
},
} satisfies BuildAction<typeof routes.auth.method, typeof routes.auth.pattern>
} satisfies Action<typeof routes.auth>
}
17 changes: 4 additions & 13 deletions server/handlers/chat-threads.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type BuildAction } from 'remix/fetch-router'
import { type Action } from 'remix/router'
import { readAuthenticatedAppUser } from '#server/authenticated-user.ts'
import { type routes } from '#server/routes.ts'
import { createChatThreadsStore } from '#server/chat-threads.ts'
Expand Down Expand Up @@ -58,10 +58,7 @@ export function createChatThreadsHandler(appEnv: AppEnv) {
const thread = await store.createForUser(user.userId)
return jsonResponse({ ok: true, thread }, { status: 201 })
},
} satisfies BuildAction<
typeof routes.chatThreadsCreate.method | typeof routes.chatThreads.method,
typeof routes.chatThreads.pattern
>
} satisfies Action<typeof routes.chatThreads>
}

export function createDeleteChatThreadHandler(appEnv: AppEnv) {
Expand Down Expand Up @@ -111,10 +108,7 @@ export function createDeleteChatThreadHandler(appEnv: AppEnv) {

return jsonResponse({ ok: true })
},
} satisfies BuildAction<
typeof routes.chatThreadsDelete.method,
typeof routes.chatThreadsDelete.pattern
>
} satisfies Action<typeof routes.chatThreadsDelete>
}

export function createUpdateChatThreadHandler(appEnv: AppEnv) {
Expand Down Expand Up @@ -176,8 +170,5 @@ export function createUpdateChatThreadHandler(appEnv: AppEnv) {

return jsonResponse({ ok: true, thread })
},
} satisfies BuildAction<
typeof routes.chatThreadsUpdate.method,
typeof routes.chatThreadsUpdate.pattern
>
} satisfies Action<typeof routes.chatThreadsUpdate>
}
4 changes: 2 additions & 2 deletions server/handlers/chat.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type BuildAction } from 'remix/fetch-router'
import { type Action } from 'remix/router'
import { readAuthSessionResult } from '#server/auth-session.ts'
import { redirectToLogin } from '#server/auth-redirect.ts'
import { Layout } from '#server/layout.ts'
Expand All @@ -21,4 +21,4 @@ export const chat = {

return response
},
} satisfies BuildAction<typeof routes.chat.method, typeof routes.chat.pattern>
} satisfies Action<typeof routes.chat>
2 changes: 1 addition & 1 deletion server/handlers/health-handler.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference types="bun" />
import { expect, test } from 'vitest'
import { RequestContext } from 'remix/fetch-router'
import { RequestContext } from 'remix/router'
import { createHealthHandler } from './health.ts'

function createHealthRequestContext() {
Expand Down
7 changes: 2 additions & 5 deletions server/handlers/health.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type BuildAction } from 'remix/fetch-router'
import { type Action } from 'remix/router'
import { type routes } from '#server/routes.ts'
import { type AppEnv } from '#types/env-schema.ts'

Expand All @@ -21,8 +21,5 @@ export function createHealthHandler(appEnv: HealthEnv) {
},
)
},
} satisfies BuildAction<
typeof routes.health.method,
typeof routes.health.pattern
>
} satisfies Action<typeof routes.health>
}
4 changes: 2 additions & 2 deletions server/handlers/home.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type BuildAction } from 'remix/fetch-router'
import { type Action } from 'remix/router'
import { Layout } from '#server/layout.ts'
import { render } from '#server/render.ts'
import { type routes } from '#server/routes.ts'
Expand All @@ -8,4 +8,4 @@ export const home = {
async handler() {
return render(Layout({}))
},
} satisfies BuildAction<typeof routes.home.method, typeof routes.home.pattern>
} satisfies Action<typeof routes.home>
7 changes: 3 additions & 4 deletions server/handlers/login.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { type BuildAction } from 'remix/fetch-router'
import { type Action } from 'remix/router'
import { type routes } from '#server/routes.ts'
import { createAuthPageHandler } from './auth-page.ts'

export const login = createAuthPageHandler() satisfies BuildAction<
typeof routes.login.method,
typeof routes.login.pattern
export const login = createAuthPageHandler() satisfies Action<
typeof routes.login
>
7 changes: 2 additions & 5 deletions server/handlers/logout.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type BuildAction } from 'remix/fetch-router'
import { type Action } from 'remix/router'
import { destroyAuthCookie, isSecureRequest } from '#server/auth-session.ts'
import { type routes } from '#server/routes.ts'

Expand All @@ -16,7 +16,4 @@ export const logout = {
},
})
},
} satisfies BuildAction<
typeof routes.logout.method,
typeof routes.logout.pattern
>
} satisfies Action<typeof routes.logout>
12 changes: 3 additions & 9 deletions server/handlers/password-reset.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type BuildAction } from 'remix/fetch-router'
import { type Action } from 'remix/router'
import { object, parseSafe, string } from 'remix/data-schema'
import { type AppEnv } from '#types/env-schema.ts'
import { createDb, passwordResetsTable, usersTable } from '#worker/db.ts'
Expand Down Expand Up @@ -181,10 +181,7 @@ export function createPasswordResetRequestHandler(appEnv: AppEnv) {
message: 'If the account exists, a reset email has been sent.',
})
},
} satisfies BuildAction<
typeof routes.passwordResetRequest.method,
typeof routes.passwordResetRequest.pattern
>
} satisfies Action<typeof routes.passwordResetRequest>
}

export function createPasswordResetConfirmHandler(appEnv: AppEnv) {
Expand Down Expand Up @@ -265,8 +262,5 @@ export function createPasswordResetConfirmHandler(appEnv: AppEnv) {

return Response.json({ ok: true })
},
} satisfies BuildAction<
typeof routes.passwordResetConfirm.method,
typeof routes.passwordResetConfirm.pattern
>
} satisfies Action<typeof routes.passwordResetConfirm>
}
2 changes: 1 addition & 1 deletion server/handlers/session-handler.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference types="bun" />
import { beforeAll, expect, test } from 'vitest'
import { RequestContext } from 'remix/fetch-router'
import { RequestContext } from 'remix/router'
import {
createAuthCookie,
setAuthSessionSecret,
Expand Down
7 changes: 2 additions & 5 deletions server/handlers/session.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type BuildAction } from 'remix/fetch-router'
import { type Action } from 'remix/router'
import { readAuthSessionResult } from '#server/auth-session.ts'
import { type routes } from '#server/routes.ts'

Expand Down Expand Up @@ -32,7 +32,4 @@ export const session = {
: undefined,
)
},
} satisfies BuildAction<
typeof routes.session.method,
typeof routes.session.pattern
>
} satisfies Action<typeof routes.session>
7 changes: 3 additions & 4 deletions server/handlers/signup.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { type BuildAction } from 'remix/fetch-router'
import { type Action } from 'remix/router'
import { type routes } from '#server/routes.ts'
import { createAuthPageHandler } from './auth-page.ts'

export const signup = createAuthPageHandler() satisfies BuildAction<
typeof routes.signup.method,
typeof routes.signup.pattern
export const signup = createAuthPageHandler() satisfies Action<
typeof routes.signup
>
2 changes: 1 addition & 1 deletion server/router.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createRouter } from 'remix/fetch-router'
import { createRouter } from 'remix/router'
import { type AppEnv } from '#types/env-schema.ts'
import { account } from './handlers/account.ts'
import { createAuthHandler } from './handlers/auth.ts'
Expand Down
2 changes: 1 addition & 1 deletion server/routes.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { post, route } from 'remix/fetch-router/routes'
import { post, route } from 'remix/routes'

export const routes = route({
home: '/',
Expand Down
Loading
Loading