create-kofi-stack 1.2.16 → 1.2.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +21 -13
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1061,17 +1061,17 @@ export const {
1061
1061
  } = authClient
1062
1062
  `;
1063
1063
  await writeFile(path3.join(appDir, "src/lib/auth.ts"), authClientContent);
1064
- const isMonorepo = config.structure === "monorepo";
1065
- const convexContent = isMonorepo ? `import { ConvexProvider, ConvexReactClient } from 'convex/react'
1064
+ const convexContent = `import { ConvexProvider, ConvexReactClient } from 'convex/react'
1066
1065
  import { env } from '@/env'
1067
1066
 
1068
- export const convex = new ConvexReactClient(env.NEXT_PUBLIC_CONVEX_URL)
1069
-
1070
- export { ConvexProvider }
1071
- ` : `import { ConvexProvider, ConvexReactClient } from 'convex/react'
1072
- import { env } from '@/env'
1067
+ const convexUrl = env.NEXT_PUBLIC_CONVEX_URL
1068
+ if (!convexUrl) {
1069
+ throw new Error(
1070
+ 'NEXT_PUBLIC_CONVEX_URL is not set. Run "npx convex dev" to set up Convex.'
1071
+ )
1072
+ }
1073
1073
 
1074
- export const convex = new ConvexReactClient(env.NEXT_PUBLIC_CONVEX_URL)
1074
+ export const convex = new ConvexReactClient(convexUrl)
1075
1075
 
1076
1076
  export { ConvexProvider }
1077
1077
  `;
@@ -2024,6 +2024,7 @@ async function generateConvexPackageJson(convexDir) {
2024
2024
  "better-auth": "^1.4.9"
2025
2025
  },
2026
2026
  devDependencies: {
2027
+ "@types/node": "^20.0.0",
2027
2028
  typescript: "^5.0.0"
2028
2029
  }
2029
2030
  };
@@ -2057,12 +2058,19 @@ import { convexAdapter } from '@convex-dev/better-auth/adapter'
2057
2058
  import { ConvexHttpClient } from 'convex/browser'
2058
2059
  import { env } from '@/env'
2059
2060
 
2060
- const convex = new ConvexHttpClient(env.NEXT_PUBLIC_CONVEX_URL)
2061
+ const convexUrl = env.NEXT_PUBLIC_CONVEX_URL
2062
+ if (!convexUrl) {
2063
+ throw new Error(
2064
+ 'NEXT_PUBLIC_CONVEX_URL is not set. Run "npx convex dev" to set up Convex.'
2065
+ )
2066
+ }
2067
+
2068
+ const convex = new ConvexHttpClient(convexUrl)
2061
2069
 
2062
2070
  export const auth = betterAuth({
2063
2071
  database: convexAdapter(convex),
2064
- secret: env.BETTER_AUTH_SECRET,
2065
- baseURL: env.NEXT_PUBLIC_APP_URL,
2072
+ secret: env.BETTER_AUTH_SECRET || '',
2073
+ baseURL: env.NEXT_PUBLIC_APP_URL || 'http://localhost:3000',
2066
2074
  emailAndPassword: {
2067
2075
  enabled: true,
2068
2076
  sendResetPassword: async ({ user, url }) => {
@@ -4345,7 +4353,7 @@ async function generateFumadocsTsConfig(docsDir) {
4345
4353
  plugins: [{ name: "next" }],
4346
4354
  paths: {
4347
4355
  "@/*": ["./src/*"],
4348
- "@/.source": ["./.source"]
4356
+ "fumadocs-mdx:collections/*": ["./.source/*"]
4349
4357
  }
4350
4358
  },
4351
4359
  include: [
@@ -4361,7 +4369,7 @@ async function generateFumadocsTsConfig(docsDir) {
4361
4369
  await writeJSON(path16.join(docsDir, "tsconfig.json"), tsConfig);
4362
4370
  }
4363
4371
  async function generateFumadocsSource(docsDir) {
4364
- const content = `import { docs } from '@/.source'
4372
+ const content = `import { docs } from 'fumadocs-mdx:collections/server'
4365
4373
  import { loader } from 'fumadocs-core/source'
4366
4374
 
4367
4375
  export const source = loader({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-kofi-stack",
3
- "version": "1.2.16",
3
+ "version": "1.2.18",
4
4
  "description": "Scaffold opinionated full-stack projects with Next.js, Convex, Better-Auth, and more",
5
5
  "type": "module",
6
6
  "bin": {