From 5ec00a6acdfbc5933b680bf1b47fbd875960c768 Mon Sep 17 00:00:00 2001 From: Tom Ballinger Date: Thu, 1 Sep 2022 14:35:51 -0400 Subject: [PATCH] Update Convex example to convex 0.1.9 --- examples/convex/README.md | 16 ++++++++-------- examples/convex/convex/_generated/dataModel.ts | 2 +- examples/convex/convex/_generated/react.ts | 2 +- examples/convex/convex/_generated/server.ts | 2 +- examples/convex/pages/_app.tsx | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/examples/convex/README.md b/examples/convex/README.md index 38c329b0e3e0..1ac9439233b7 100644 --- a/examples/convex/README.md +++ b/examples/convex/README.md @@ -13,11 +13,11 @@ Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_mediu Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init), [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/), or [pnpm](https://pnpm.io) to bootstrap the example: ```bash -npx create-next-app --example with-convex with-convex-app +npx create-next-app --example convex convex-app # or -yarn create next-app --example with-convex with-convex-app +yarn create next-app --example convex convex-app # or -pnpm create next-app --example with-convex with-convex-app +pnpm create next-app --example convex convex-app ``` Log in to Convex, @@ -32,16 +32,16 @@ initialize a new Convex project, npx convex init ``` -and push the Convex functions for this project. +and then run the following two commands in two different terminals: ```bash -npx convex push +npx convex dev ``` -Now you can run your code locally with a Convex backend with - ```bash npm run dev ``` -Deploy it to the cloud with [Vercel](https://vercel.com/new?utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). +Once everything is working, commit your code and deploy it to the cloud with [Vercel](https://vercel.com/new?utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). + +Use `npx convex deploy && npm run build` as the build command and set the `CONVEX_DEPLOY_KEY` environmental variable in Vercel ([Documentation](https://docs.convex.dev/getting-started/deployment/hosting/vercel)). diff --git a/examples/convex/convex/_generated/dataModel.ts b/examples/convex/convex/_generated/dataModel.ts index 87c7cb3c1fbe..80646144ba8a 100644 --- a/examples/convex/convex/_generated/dataModel.ts +++ b/examples/convex/convex/_generated/dataModel.ts @@ -4,7 +4,7 @@ * * THIS CODE IS AUTOMATICALLY GENERATED. * - * Generated by convex@0.1.8. + * Generated by convex@0.1.9. * To regenerate, run `npx convex codegen`. * @module */ diff --git a/examples/convex/convex/_generated/react.ts b/examples/convex/convex/_generated/react.ts index 0ed0e5634a0c..66c8d8ca0364 100644 --- a/examples/convex/convex/_generated/react.ts +++ b/examples/convex/convex/_generated/react.ts @@ -4,7 +4,7 @@ * * THIS CODE IS AUTOMATICALLY GENERATED. * - * Generated by convex@0.1.8. + * Generated by convex@0.1.9. * To regenerate, run `npx convex codegen`. * @module */ diff --git a/examples/convex/convex/_generated/server.ts b/examples/convex/convex/_generated/server.ts index 0e8d913bbd0a..c752845659e6 100644 --- a/examples/convex/convex/_generated/server.ts +++ b/examples/convex/convex/_generated/server.ts @@ -4,7 +4,7 @@ * * THIS CODE IS AUTOMATICALLY GENERATED. * - * Generated by convex@0.1.8. + * Generated by convex@0.1.9. * To regenerate, run `npx convex codegen`. * @module */ diff --git a/examples/convex/pages/_app.tsx b/examples/convex/pages/_app.tsx index cc85cc2142cb..4f9a5543e527 100644 --- a/examples/convex/pages/_app.tsx +++ b/examples/convex/pages/_app.tsx @@ -2,8 +2,8 @@ import '../styles/globals.css' import type { AppProps } from 'next/app' import { ConvexProvider, ConvexReactClient } from 'convex/react' -import convexConfig from '../convex.json' -const convex = new ConvexReactClient(convexConfig.origin) +import clientConfig from '../convex/_generated/clientConfig' +const convex = new ConvexReactClient(clientConfig) function MyApp({ Component, pageProps }: AppProps) { return (