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
2 changes: 0 additions & 2 deletions template-tanstack-start-clerk/convex/_generated/api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import type {
FunctionReference,
} from "convex/server";
import type * as posts from "../posts.js";
import type * as tasks from "../tasks.js";
import type * as user from "../user.js";

/**
Expand All @@ -27,7 +26,6 @@ import type * as user from "../user.js";
*/
declare const fullApi: ApiFromModules<{
posts: typeof posts;
tasks: typeof tasks;
user: typeof user;
}>;
export declare const api: FilterApi<
Expand Down
17 changes: 0 additions & 17 deletions template-tanstack-start-clerk/convex/posts.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
import { action, internalMutation, query } from './_generated/server'
import { api, internal } from './_generated/api.js'
import { v } from 'convex/values'
import type { Doc } from './_generated/dataModel'
import type { WithoutSystemFields } from 'convex/server'

export const get = query({
args: {
postId: v.string(),
},
handler: async (ctx, { postId }) => {
return await ctx.db
.query('posts')
.withIndex('id', (q) => q.eq('id', postId))
.unique()
},
})

export const list = query(async (ctx) => {
return await ctx.db.query('posts').collect()
})
Expand All @@ -25,10 +12,6 @@ export const insert = internalMutation(
ctx.db.insert('posts', post),
)

export const count = query(
async (ctx) => (await ctx.db.query('posts').collect()).length,
)

export const populate = action(async (ctx) => {
const existing = await ctx.runQuery(api.posts.list)
if (existing.length) {
Expand Down
5 changes: 0 additions & 5 deletions template-tanstack-start-clerk/convex/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,4 @@ export default defineSchema({
title: v.string(),
body: v.string(),
}).index('id', ['id']),

tasks: defineTable({
text: v.string(),
isCompleted: v.boolean(),
}),
})
8 changes: 0 additions & 8 deletions template-tanstack-start-clerk/convex/tasks.ts

This file was deleted.

14 changes: 6 additions & 8 deletions template-tanstack-start-clerk/convex/user.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { query } from './_generated/server'

export const profile = query((ctx) => ctx.auth.getUserIdentity())

export const name = query(
async (ctx) => (await ctx.auth.getUserIdentity())?.name,
)
export const email = query(
async (ctx) => (await ctx.auth.getUserIdentity())?.email,
)
export const profile = query({
args: {},
handler: async (ctx) => {
return ctx.auth.getUserIdentity()
},
})
3 changes: 1 addition & 2 deletions template-tanstack-start-clerk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"dev:convex": "npx convex dev",
"build": "vite build && tsc --noEmit",
"start": "node .output/server/index.mjs",
"format": "prettier --write .",
"seed": "npx convex import --table tasks sampleData.jsonl"
"format": "prettier --write ."
},
"dependencies": {
"@clerk/tanstack-react-start": "0.24.0",
Expand Down
3 changes: 0 additions & 3 deletions template-tanstack-start-clerk/sampleData.jsonl

This file was deleted.

131 changes: 17 additions & 114 deletions template-tanstack-start-clerk/src/routeTree.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,14 @@
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.

import { Route as rootRouteImport } from './routes/__root'
import { Route as TasksRouteImport } from './routes/tasks'
import { Route as ConvexpostsRouteImport } from './routes/convexposts'
import { Route as PostsRouteImport } from './routes/posts'
import { Route as AuthedRouteImport } from './routes/_authed'
import { Route as IndexRouteImport } from './routes/index'
import { Route as AuthedUserRouteImport } from './routes/_authed/user'
import { Route as AuthedPostsRouteImport } from './routes/_authed/posts'
import { Route as AuthedPostsIndexRouteImport } from './routes/_authed/posts.index'
import { Route as AuthedPostsPostIdRouteImport } from './routes/_authed/posts.$postId'

const TasksRoute = TasksRouteImport.update({
id: '/tasks',
path: '/tasks',
getParentRoute: () => rootRouteImport,
} as any)
const ConvexpostsRoute = ConvexpostsRouteImport.update({
id: '/convexposts',
path: '/convexposts',
const PostsRoute = PostsRouteImport.update({
id: '/posts',
path: '/posts',
getParentRoute: () => rootRouteImport,
} as any)
const AuthedRoute = AuthedRouteImport.update({
Expand All @@ -42,95 +33,45 @@ const AuthedUserRoute = AuthedUserRouteImport.update({
path: '/user',
getParentRoute: () => AuthedRoute,
} as any)
const AuthedPostsRoute = AuthedPostsRouteImport.update({
id: '/posts',
path: '/posts',
getParentRoute: () => AuthedRoute,
} as any)
const AuthedPostsIndexRoute = AuthedPostsIndexRouteImport.update({
id: '/',
path: '/',
getParentRoute: () => AuthedPostsRoute,
} as any)
const AuthedPostsPostIdRoute = AuthedPostsPostIdRouteImport.update({
id: '/$postId',
path: '/$postId',
getParentRoute: () => AuthedPostsRoute,
} as any)

export interface FileRoutesByFullPath {
'/': typeof IndexRoute
'/convexposts': typeof ConvexpostsRoute
'/tasks': typeof TasksRoute
'/posts': typeof AuthedPostsRouteWithChildren
'/posts': typeof PostsRoute
'/user': typeof AuthedUserRoute
'/posts/$postId': typeof AuthedPostsPostIdRoute
'/posts/': typeof AuthedPostsIndexRoute
}
export interface FileRoutesByTo {
'/': typeof IndexRoute
'/convexposts': typeof ConvexpostsRoute
'/tasks': typeof TasksRoute
'/posts': typeof PostsRoute
'/user': typeof AuthedUserRoute
'/posts/$postId': typeof AuthedPostsPostIdRoute
'/posts': typeof AuthedPostsIndexRoute
}
export interface FileRoutesById {
__root__: typeof rootRouteImport
'/': typeof IndexRoute
'/_authed': typeof AuthedRouteWithChildren
'/convexposts': typeof ConvexpostsRoute
'/tasks': typeof TasksRoute
'/_authed/posts': typeof AuthedPostsRouteWithChildren
'/posts': typeof PostsRoute
'/_authed/user': typeof AuthedUserRoute
'/_authed/posts/$postId': typeof AuthedPostsPostIdRoute
'/_authed/posts/': typeof AuthedPostsIndexRoute
}
export interface FileRouteTypes {
fileRoutesByFullPath: FileRoutesByFullPath
fullPaths:
| '/'
| '/convexposts'
| '/tasks'
| '/posts'
| '/user'
| '/posts/$postId'
| '/posts/'
fullPaths: '/' | '/posts' | '/user'
fileRoutesByTo: FileRoutesByTo
to: '/' | '/convexposts' | '/tasks' | '/user' | '/posts/$postId' | '/posts'
id:
| '__root__'
| '/'
| '/_authed'
| '/convexposts'
| '/tasks'
| '/_authed/posts'
| '/_authed/user'
| '/_authed/posts/$postId'
| '/_authed/posts/'
to: '/' | '/posts' | '/user'
id: '__root__' | '/' | '/_authed' | '/posts' | '/_authed/user'
fileRoutesById: FileRoutesById
}
export interface RootRouteChildren {
IndexRoute: typeof IndexRoute
AuthedRoute: typeof AuthedRouteWithChildren
ConvexpostsRoute: typeof ConvexpostsRoute
TasksRoute: typeof TasksRoute
PostsRoute: typeof PostsRoute
}

declare module '@tanstack/react-router' {
interface FileRoutesByPath {
'/tasks': {
id: '/tasks'
path: '/tasks'
fullPath: '/tasks'
preLoaderRoute: typeof TasksRouteImport
parentRoute: typeof rootRouteImport
}
'/convexposts': {
id: '/convexposts'
path: '/convexposts'
fullPath: '/convexposts'
preLoaderRoute: typeof ConvexpostsRouteImport
'/posts': {
id: '/posts'
path: '/posts'
fullPath: '/posts'
preLoaderRoute: typeof PostsRouteImport
parentRoute: typeof rootRouteImport
}
'/_authed': {
Expand All @@ -154,51 +95,14 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof AuthedUserRouteImport
parentRoute: typeof AuthedRoute
}
'/_authed/posts': {
id: '/_authed/posts'
path: '/posts'
fullPath: '/posts'
preLoaderRoute: typeof AuthedPostsRouteImport
parentRoute: typeof AuthedRoute
}
'/_authed/posts/': {
id: '/_authed/posts/'
path: '/'
fullPath: '/posts/'
preLoaderRoute: typeof AuthedPostsIndexRouteImport
parentRoute: typeof AuthedPostsRoute
}
'/_authed/posts/$postId': {
id: '/_authed/posts/$postId'
path: '/$postId'
fullPath: '/posts/$postId'
preLoaderRoute: typeof AuthedPostsPostIdRouteImport
parentRoute: typeof AuthedPostsRoute
}
}
}

interface AuthedPostsRouteChildren {
AuthedPostsPostIdRoute: typeof AuthedPostsPostIdRoute
AuthedPostsIndexRoute: typeof AuthedPostsIndexRoute
}

const AuthedPostsRouteChildren: AuthedPostsRouteChildren = {
AuthedPostsPostIdRoute: AuthedPostsPostIdRoute,
AuthedPostsIndexRoute: AuthedPostsIndexRoute,
}

const AuthedPostsRouteWithChildren = AuthedPostsRoute._addFileChildren(
AuthedPostsRouteChildren,
)

interface AuthedRouteChildren {
AuthedPostsRoute: typeof AuthedPostsRouteWithChildren
AuthedUserRoute: typeof AuthedUserRoute
}

const AuthedRouteChildren: AuthedRouteChildren = {
AuthedPostsRoute: AuthedPostsRouteWithChildren,
AuthedUserRoute: AuthedUserRoute,
}

Expand All @@ -208,8 +112,7 @@ const AuthedRouteWithChildren =
const rootRouteChildren: RootRouteChildren = {
IndexRoute: IndexRoute,
AuthedRoute: AuthedRouteWithChildren,
ConvexpostsRoute: ConvexpostsRoute,
TasksRoute: TasksRoute,
PostsRoute: PostsRoute,
}
export const routeTree = rootRouteImport
._addFileChildren(rootRouteChildren)
Expand Down
16 changes: 0 additions & 16 deletions template-tanstack-start-clerk/src/routes/__root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,6 @@ function RootDocument({ children }: { children: React.ReactNode }) {
activeOptions={{ exact: true }}
>
Home
</Link>{' '}
<Link
to="/tasks"
activeProps={{
className: 'font-bold',
}}
>
Tasks
</Link>
<Link
to="/posts"
Expand All @@ -143,14 +135,6 @@ function RootDocument({ children }: { children: React.ReactNode }) {
>
Posts
</Link>
<Link
to="/convexposts"
activeProps={{
className: 'font-bold',
}}
>
Convex Posts
</Link>
<Link
to="/user"
activeProps={{
Expand Down
24 changes: 0 additions & 24 deletions template-tanstack-start-clerk/src/routes/_authed/posts.$postId.tsx

This file was deleted.

This file was deleted.

Loading