From bcbcaaa46f8fe8204093e9dfa4f1fc0d4e8ac442 Mon Sep 17 00:00:00 2001 From: JeffreyLind3 Date: Thu, 18 Sep 2025 10:34:48 -0400 Subject: [PATCH] Fix Typos Around the Repo --- .cursor/rules/convex_rules.mdc | 4 ++-- docs/content/docs/authorization.mdx | 4 ++-- docs/content/docs/basic-usage.mdx | 8 ++++---- docs/content/docs/debugging.mdx | 4 ++-- docs/content/docs/framework-guides/expo.mdx | 6 +++--- docs/content/docs/framework-guides/next.mdx | 6 +++--- docs/content/docs/framework-guides/react.mdx | 10 +++++----- .../docs/framework-guides/tanstack-start.mdx | 8 ++++---- docs/content/docs/index.mdx | 2 +- docs/content/docs/integrations/hono.mdx | 2 +- docs/content/docs/local-install.mdx | 8 ++++---- docs/content/docs/migrate-to-0-8.mdx | 20 +++++++++---------- examples/next/.cursor/rules/convex_rules.mdc | 4 ++-- examples/tanstack/src/utils/posts.ts | 2 +- src/client/adapter.test.ts | 2 +- src/client/adapterUtils.ts | 2 +- src/client/createSchema.ts | 2 +- src/client/index.ts | 2 +- src/plugins/convex/index.ts | 2 +- 19 files changed, 49 insertions(+), 49 deletions(-) diff --git a/.cursor/rules/convex_rules.mdc b/.cursor/rules/convex_rules.mdc index a598d39..8d10c9b 100644 --- a/.cursor/rules/convex_rules.mdc +++ b/.cursor/rules/convex_rules.mdc @@ -170,7 +170,7 @@ globs: **/*.{ts,tsx,js,jsx} - Index fields must be queried in the same order they are defined. If you want to be able to query by "field1" then "field2" and by "field2" then "field1", you must create separate indexes. ## Typescript guidelines -- You can use the helper typescript type `Id` imported from './_generated/dataModel' to get the type of the id for a given table. For example if there is a table called 'users' you can use `Id<'users'>` to get the type of the id for that table. +- You can use the helper typescript type `Id` imported from './_generated/dataModel' to get the type of the ID for a given table. For example if there is a table called 'users' you can use `Id<'users'>` to get the type of the ID for that table. - If you need to define a `Record` make sure that you correctly provide the type of the key and value in the type. For example a validator `v.record(v.id('users'), v.string())` would have the type `Record, string>`. Below is an example of using `Record` with an `Id` type in a query: ```ts import { query } from "./_generated/server"; @@ -192,7 +192,7 @@ globs: **/*.{ts,tsx,js,jsx} }, }); ``` -- Be strict with types, particularly around id's of documents. For example, if a function takes in an id for a document in the 'users' table, take in `Id<'users'>` rather than `string`. +- Be strict with types, particularly around IDs of documents. For example, if a function takes in an ID for a document in the 'users' table, take in `Id<'users'>` rather than `string`. - Always use `as const` for string literals in discriminated union types. - When using the `Array` type, make sure to always define your arrays as `const array: Array = [...];` - When using the `Record` type, make sure to always define your records as `const record: Record = {...};` diff --git a/docs/content/docs/authorization.mdx b/docs/content/docs/authorization.mdx index a39ee31..d27ae36 100644 --- a/docs/content/docs/authorization.mdx +++ b/docs/content/docs/authorization.mdx @@ -6,7 +6,7 @@ description: Authorization with Better Auth ### Showing UI based on authentication state You can control which UI is shown when the user is signed in or signed out using -Convex's ``, `` and `` helper +Convex's ``, ``, and `` helper components. These components are powered by Convex's `useConvexAuth()` hook, which provides `isAuthenticated` and `isLoading` flags. This hook can be used directly if preferred. @@ -71,7 +71,7 @@ export const getCurrentUser = query({ }, }); -// You can also just get the authenticated user id as you +// You can also just get the authenticated user ID as you // normally would from ctx.auth.getUserIdentity export const getForCurrentUser = query({ args: {}, diff --git a/docs/content/docs/basic-usage.mdx b/docs/content/docs/basic-usage.mdx index d90d981..3ba239f 100644 --- a/docs/content/docs/basic-usage.mdx +++ b/docs/content/docs/basic-usage.mdx @@ -15,9 +15,9 @@ project, so their guides are a primary reference. There are a few areas in the Better Auth basic usage guide that work differently in Convex. -- #### Server side authentication +- #### Server-side authentication - Better Auth supports signing users in and out through server side functions. Because + Better Auth supports signing users in and out through server-side functions. Because Convex functions run over websockets and don't return HTTP responses or set cookies, signing up/in/out must be done from the client via `authClient.signIn.*` methods. @@ -29,11 +29,11 @@ in Convex. installs](/local-install), which support generating schemas. For projects not using local install, the default schema provided with the Better Auth component (preconfigured with the [supported - plugins](/supported-plugins)) is used, and cannot be altered. + plugins](/supported-plugins)) is used and cannot be altered. ## Using server methods with `auth.api` -Better Auth's server side `auth.api` methods can be used with your `createAuth` +Better Auth's server-side `auth.api` methods can be used with your `createAuth` function and the component `headers` method. Here's an example implementing the [`changePassword` server method](https://www.better-auth.com/docs/concepts/users-accounts#api-method-change-password). diff --git a/docs/content/docs/debugging.mdx b/docs/content/docs/debugging.mdx index 35bf2bf..9fe19fd 100644 --- a/docs/content/docs/debugging.mdx +++ b/docs/content/docs/debugging.mdx @@ -20,12 +20,12 @@ export const authComponent = createClient( ); ``` -## Client side +## Client-side Verbose logs in the client can be enabled on the Convex client constructor. ```ts title="src/main.ts" -// Replace this with your framework prefixed environment variable +// Replace this with your framework-prefixed environment variable // for your project's Convex cloud URL const convexUrl = import.meta.env.PUBLIC_CONVEX_URL as string; const convex = new ConvexReactClient(convexUrl, { diff --git a/docs/content/docs/framework-guides/expo.mdx b/docs/content/docs/framework-guides/expo.mdx index 0adb483..a06f836 100644 --- a/docs/content/docs/framework-guides/expo.mdx +++ b/docs/content/docs/framework-guides/expo.mdx @@ -72,7 +72,7 @@ description: Install and configure Convex + Better Auth for Expo.
### Set environment variables - Generate a secret for encryption and generating hashes. Use the command below if you have openssl installed, or use the button to generate a random value instead. Or generate your own however you like. + Generate a secret for encryption and generating hashes. Use the command below if you have OpenSSL installed, or use the button to generate a random value instead. Or generate your own however you like. ```shell npx convex env set BETTER_AUTH_SECRET=$(openssl rand -base64 32) @@ -128,8 +128,8 @@ description: Install and configure Convex + Better Auth for Expo. { optionsOnly } = { optionsOnly: false }, ) => { return betterAuth({ - // disable logging when createAuth is called just to generate options. - // this is not required, but there's a lot of noise in logs without it. + // Disable logging when createAuth is called just to generate options. + // This is not required, but there's a lot of noise in logs without it. logger: { disabled: optionsOnly, }, diff --git a/docs/content/docs/framework-guides/next.mdx b/docs/content/docs/framework-guides/next.mdx index 4d7d892..85ce52e 100644 --- a/docs/content/docs/framework-guides/next.mdx +++ b/docs/content/docs/framework-guides/next.mdx @@ -65,7 +65,7 @@ description: Install and configure Convex + Better Auth for Next.js.
### Set environment variables - Generate a secret for encryption and generating hashes. Use the command below if you have openssl installed, or use the button to generate a random value instead. Or generate your own however you like. + Generate a secret for encryption and generating hashes. Use the command below if you have OpenSSL installed, or use the button to generate a random value instead. Or generate your own however you like. ```shell npx convex env set BETTER_AUTH_SECRET=$(openssl rand -base64 32) @@ -134,8 +134,8 @@ description: Install and configure Convex + Better Auth for Next.js. { optionsOnly } = { optionsOnly: false }, ) => { return betterAuth({ - // disable logging when createAuth is called just to generate options. - // this is not required, but there's a lot of noise in logs without it. + // Disable logging when createAuth is called just to generate options. + // This is not required, but there's a lot of noise in logs without it. logger: { disabled: optionsOnly, }, diff --git a/docs/content/docs/framework-guides/react.mdx b/docs/content/docs/framework-guides/react.mdx index 4b656a5..8207c29 100644 --- a/docs/content/docs/framework-guides/react.mdx +++ b/docs/content/docs/framework-guides/react.mdx @@ -65,7 +65,7 @@ description: Install and configure Convex + Better Auth for React.
### Set environment variables - Generate a secret for encryption and generating hashes. Use the command below if you have openssl installed, or use the button to generate a random value instead. Or generate your own however you like. + Generate a secret for encryption and generating hashes. Use the command below if you have OpenSSL installed, or use the button to generate a random value instead. Or generate your own however you like. ```shell npx convex env set BETTER_AUTH_SECRET=$(openssl rand -base64 32) @@ -134,8 +134,8 @@ description: Install and configure Convex + Better Auth for React. { optionsOnly } = { optionsOnly: false }, ) => { return betterAuth({ - // disable logging when createAuth is called just to generate options. - // this is not required, but there's a lot of noise in logs without it. + // Disable logging when createAuth is called just to generate options. + // This is not required, but there's a lot of noise in logs without it. logger: { disabled: optionsOnly, }, @@ -147,7 +147,7 @@ description: Install and configure Convex + Better Auth for React. requireEmailVerification: false, }, plugins: [ - // The cross domain plugin is required for client side frameworks + // The cross-domain plugin is required for client-side frameworks crossDomain({ siteUrl }), // The Convex plugin is required for Convex compatibility convex(), @@ -198,7 +198,7 @@ description: Install and configure Convex + Better Auth for React. const http = httpRouter(); - // CORS handling is required for client side frameworks + // CORS handling is required for client-side frameworks authComponent.registerRoutes(http, createAuth, { cors: true }); export default http; diff --git a/docs/content/docs/framework-guides/tanstack-start.mdx b/docs/content/docs/framework-guides/tanstack-start.mdx index 7d4f203..85dc2a7 100644 --- a/docs/content/docs/framework-guides/tanstack-start.mdx +++ b/docs/content/docs/framework-guides/tanstack-start.mdx @@ -66,7 +66,7 @@ description: Install and configure Convex + Better Auth for TanStack Start.
### Set environment variables - Generate a secret for encryption and generating hashes. Use the command below if you have openssl installed, or use the button to generate a random value instead. Or generate your own however you like. + Generate a secret for encryption and generating hashes. Use the command below if you have OpenSSL installed, or use the button to generate a random value instead. Or generate your own however you like. ```shell npx convex env set BETTER_AUTH_SECRET=$(openssl rand -base64 32) @@ -135,8 +135,8 @@ description: Install and configure Convex + Better Auth for TanStack Start. { optionsOnly } = { optionsOnly: false }, ) => { return betterAuth({ - // disable logging when createAuth is called just to generate options. - // this is not required, but there's a lot of noise in logs without it. + // Disable logging when createAuth is called just to generate options. + // This is not required, but there's a lot of noise in logs without it. logger: { disabled: optionsOnly, }, @@ -278,7 +278,7 @@ description: Install and configure Convex + Better Auth for TanStack Start. }), // [!code ++:14] beforeLoad: async (ctx) => { - // all queries, mutations and action made with TanStack Query will be + // All queries, mutations, and actions made with TanStack Query will be // authenticated by an identity token. const { userId, token } = await fetchAuth() diff --git a/docs/content/docs/index.mdx b/docs/content/docs/index.mdx index 65f58ff..1c8dbe6 100644 --- a/docs/content/docs/index.mdx +++ b/docs/content/docs/index.mdx @@ -25,7 +25,7 @@ docs](https://docs.convex.dev/home) to learn more about Convex.
### Run `convex dev` -Running the cli during setup will initialize your Convex deployment if it +Running the CLI during setup will initialize your Convex deployment if it doesn't already exist, and keeps generated types current through the process. Keep it running. diff --git a/docs/content/docs/integrations/hono.mdx b/docs/content/docs/integrations/hono.mdx index 2e0eb5b..40c00ac 100644 --- a/docs/content/docs/integrations/hono.mdx +++ b/docs/content/docs/integrations/hono.mdx @@ -41,7 +41,7 @@ export default http; ## Add CORS support -Required for client only / SPA installs like React/Vite. +Required for client-only / SPA installs like React/Vite. ```ts title="convex/http.ts" import { Hono } from "hono"; diff --git a/docs/content/docs/local-install.mdx b/docs/content/docs/local-install.mdx index b2d5da2..fb0b482 100644 --- a/docs/content/docs/local-install.mdx +++ b/docs/content/docs/local-install.mdx @@ -7,8 +7,8 @@ Local install gives you full control over your Better Auth schema, allows schema related configuration to work, and makes it possible to use plugins beyond those [supported](/supported-plugins) for Convex + Better Auth. -With this approach, the Better Auth plugin is defined in it's own Convex -subdirectory. Installation is a bit different from the default approach, and +With this approach, the Better Auth plugin is defined in its own Convex +subdirectory. Installation is a bit different from the default approach and includes a schema generation step via Better Auth CLI, similar to the installation experience with other providers. @@ -144,7 +144,7 @@ installed component. ### Updating the schema -Certain options changes may require schema generation. The Better Auth docs will +Certain option changes may require schema generation. The Better Auth docs will often note when this is the case. To regenerate the schema at any time (as it's generally safe to do), move into the component directory and run the Better Auth CLI generate command. @@ -168,7 +168,7 @@ custom indexes aren't overwritten when the schema is regenerated. Schema table names and fields should not be customized directly, as any customizations won't match your Better Auth configuration, and will be - overwritten when the schema is regenerated. Instead, Better Auth schema can be + overwritten when the schema is regenerated. Instead, Better Auth's schema can be [customized through options](https://www.better-auth.com/docs/concepts/database#core-schema). diff --git a/docs/content/docs/migrate-to-0-8.mdx b/docs/content/docs/migrate-to-0-8.mdx index ac9e9df..6680881 100644 --- a/docs/content/docs/migrate-to-0-8.mdx +++ b/docs/content/docs/migrate-to-0-8.mdx @@ -122,9 +122,9 @@ description: Migrate to @convex-dev/better-auth@0.8 ### Move and update Better Auth config The `createAuth` function should be moved to `convex/auth.ts`. This isn't -required, but better represents where the code actually runs, colocates it -with other related server side auth code, and avoids potentially writing -Convex code outside of the Convex directory for some function based config +required, but it better represents where the code actually runs, colocates it +with other related server-side auth code, and avoids potentially writing +Convex code outside of the Convex directory for some function-based config properties. The Convex database adapter is now provided through a method on the auth @@ -177,9 +177,9 @@ This is not required, but helpful for reducing noise in logs. ### Update `ctx.auth.getUserIdentity()` usage -The `subject` property of the id token, as well as the user identity object returned from -`ctx.auth.getUserIdentity()`, was formerly the user id from the application user -table. It is now the user id from the Better Auth user table. Any direct usage +The `subject` property of the ID token, as well as the user identity object returned from +`ctx.auth.getUserIdentity()`, was formerly the user ID from the application user +table. It is now the user ID from the Better Auth user table. Any direct usage of the `subject` property should be replaced with `authComponent.getAuthUser(ctx)`, which returns the entire Better Auth user object (formerly referred to as user metadata). @@ -234,13 +234,13 @@ export const getCurrentUser = query({
- ### Framework specific changes + ### Framework-specific changes If your project uses TanStack Start, follow the [last few steps](/framework-guides/tanstack-start#mount-handlers) of the TanStack Start guide and make sure your code aligns. -This migration should not have framework specific impacts for any other +This migration should not have framework-specific impacts for any other framework.
@@ -265,10 +265,10 @@ channel on Discord. The named `options` parameter to the Convex plugin that accepted Better Auth options has been removed. This was necessary because the Convex plugin previously customized the session, breaking type inference for configuration -that affected the session, so the Better Auth options had to be separated to a +that affected the session, so the Better Auth options had to be separated into a new function and passed in to the Convex plugin. -None of this is necessary anymore, if you were doing this you can go back to +None of this is necessary anymore; if you were doing this you can go back to using a single `createAuth` function. ```ts title="convex/auth.ts" diff --git a/examples/next/.cursor/rules/convex_rules.mdc b/examples/next/.cursor/rules/convex_rules.mdc index 781afc6..a4dc279 100644 --- a/examples/next/.cursor/rules/convex_rules.mdc +++ b/examples/next/.cursor/rules/convex_rules.mdc @@ -186,7 +186,7 @@ Note: `paginationOpts` is an object with the following properties: - Index fields must be queried in the same order they are defined. If you want to be able to query by "field1" then "field2" and by "field2" then "field1", you must create separate indexes. ## Typescript guidelines -- You can use the helper typescript type `Id` imported from './_generated/dataModel' to get the type of the id for a given table. For example if there is a table called 'users' you can use `Id<'users'>` to get the type of the id for that table. +- You can use the helper typescript type `Id` imported from './_generated/dataModel' to get the type of the ID for a given table. For example if there is a table called 'users' you can use `Id<'users'>` to get the type of the ID for that table. - If you need to define a `Record` make sure that you correctly provide the type of the key and value in the type. For example a validator `v.record(v.id('users'), v.string())` would have the type `Record, string>`. Below is an example of using `Record` with an `Id` type in a query: ```ts import { query } from "./_generated/server"; @@ -208,7 +208,7 @@ export const exampleQuery = query({ }, }); ``` -- Be strict with types, particularly around id's of documents. For example, if a function takes in an id for a document in the 'users' table, take in `Id<'users'>` rather than `string`. +- Be strict with types, particularly around IDs of documents. For example, if a function takes in an ID for a document in the 'users' table, take in `Id<'users'>` rather than `string`. - Always use `as const` for string literals in discriminated union types. - When using the `Array` type, make sure to always define your arrays as `const array: Array = [...];` - When using the `Record` type, make sure to always define your records as `const record: Record = {...};` diff --git a/examples/tanstack/src/utils/posts.ts b/examples/tanstack/src/utils/posts.ts index a7e0e99..adf7325 100644 --- a/examples/tanstack/src/utils/posts.ts +++ b/examples/tanstack/src/utils/posts.ts @@ -11,7 +11,7 @@ export type PostType = { export const fetchPost = createServerFn({ method: 'GET' }) .validator((postId: string) => postId) .handler(async ({ data }) => { - console.info(`Fetching post with id ${data}...`) + console.info(`Fetching post with ID ${data}...`) const post = await axios .get(`https://jsonplaceholder.typicode.com/posts/${data}`) .then((r) => r.data) diff --git a/src/client/adapter.test.ts b/src/client/adapter.test.ts index 2c54b96..2ea64fa 100644 --- a/src/client/adapter.test.ts +++ b/src/client/adapter.test.ts @@ -147,7 +147,7 @@ describe("Convex Adapter Tests", async () => { ).toEqual([user]); }); - test("should handle compound indexes that include id field", async () => { + test("should handle compound indexes that include an ID field", async () => { const t = convexTest(schema, import.meta.glob("../component/**/*.*s")); const adapter = await getAdapter(t)(); const user = await adapter.create({ diff --git a/src/client/adapterUtils.ts b/src/client/adapterUtils.ts index b97f8b9..7c10f73 100644 --- a/src/client/adapterUtils.ts +++ b/src/client/adapterUtils.ts @@ -532,7 +532,7 @@ export const paginate = async < if (!Array.isArray(inWhere.value)) { throw new Error("in clause value must be an array"); } - // For ids, just use asyncMap + .get() + // For IDs, just use asyncMap + .get() if (inWhere.field === "id") { const docs = await asyncMap(inWhere.value as any[], async (value) => { return ctx.db.get(value as GenericId); diff --git a/src/client/createSchema.ts b/src/client/createSchema.ts index 1a81b07..3bef861 100644 --- a/src/client/createSchema.ts +++ b/src/client/createSchema.ts @@ -97,7 +97,7 @@ export const tables = { const table = tables[tableKey]!; const modelName = table.modelName; - // No id fields in Convex schema + // No ID fields in Convex schema const fields = Object.fromEntries( Object.entries(table.fields).filter(([key]) => key !== "id") ); diff --git a/src/client/index.ts b/src/client/index.ts index d0f4fd4..ff9486c 100644 --- a/src/client/index.ts +++ b/src/client/index.ts @@ -497,7 +497,7 @@ export const createClient = < return user; }, - // Replaces 0.7 behavior of returning a new user id from + // Replaces 0.7 behavior of returning a new user ID from // onCreateUser setUserId: async ( ctx: GenericMutationCtx, diff --git a/src/plugins/convex/index.ts b/src/plugins/convex/index.ts index 78fc3f1..f3fb601 100644 --- a/src/plugins/convex/index.ts +++ b/src/plugins/convex/index.ts @@ -38,7 +38,7 @@ export const convex = ( }, }); // Bearer plugin converts the session token to a cookie - // for cross domain social login after code verification, + // for cross-domain social login after code verification, // and is required for the headers() helper to work. const bearer = bearerPlugin(); const schema = {