kofi-stack-template-generator 2.0.18 → 2.0.19
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.
- package/.turbo/turbo-build.log +5 -5
- package/dist/index.js +28 -1
- package/package.json +1 -1
- package/src/templates.generated.ts +2 -2
- package/templates/web/src/proxy.ts.hbs +11 -5
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
> kofi-stack-template-generator@2.0.
|
|
2
|
+
> kofi-stack-template-generator@2.0.19 build /Users/theodenanyoh/Documents/Krumalabs/create-kofi-stack-v2/packages/template-generator
|
|
3
3
|
> pnpm run prebuild && tsup src/index.ts --format esm --dts
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> kofi-stack-template-generator@2.0.
|
|
6
|
+
> kofi-stack-template-generator@2.0.19 prebuild /Users/theodenanyoh/Documents/Krumalabs/create-kofi-stack-v2/packages/template-generator
|
|
7
7
|
> node scripts/generate-templates.js
|
|
8
8
|
|
|
9
9
|
Generating templates.generated.ts...
|
|
@@ -13,8 +13,8 @@ CLI Using tsconfig: tsconfig.json
|
|
|
13
13
|
CLI tsup v8.5.1
|
|
14
14
|
CLI Target: es2022
|
|
15
15
|
ESM Build start
|
|
16
|
-
ESM dist/index.js 99.
|
|
17
|
-
ESM ⚡️ Build success in
|
|
16
|
+
ESM dist/index.js 99.49 KB
|
|
17
|
+
ESM ⚡️ Build success in 16ms
|
|
18
18
|
DTS Build start
|
|
19
|
-
DTS ⚡️ Build success in
|
|
19
|
+
DTS ⚡️ Build success in 425ms
|
|
20
20
|
DTS dist/index.d.ts 2.96 KB
|
package/dist/index.js
CHANGED
|
@@ -1255,7 +1255,34 @@ export function DashboardLayout({ children, title = 'Dashboard' }: DashboardLayo
|
|
|
1255
1255
|
"web/src/components/providers/convex-provider.tsx.hbs": "'use client'\n\nimport { ConvexAuthNextjsProvider } from '@convex-dev/auth/nextjs'\nimport { ConvexReactClient } from 'convex/react'\n\nconst convex = new ConvexReactClient(process.env.NEXT_PUBLIC_CONVEX_URL!)\n\nexport function ConvexClientProvider({\n children,\n}: {\n children: React.ReactNode\n}) {\n return (\n <ConvexAuthNextjsProvider client={convex}>\n {children}\n </ConvexAuthNextjsProvider>\n )\n}\n",
|
|
1256
1256
|
"web/src/lib/auth.ts.hbs": "'use client'\n\nimport { useConvexAuth, useQuery } from 'convex/react'\nimport { useAuthActions } from '@convex-dev/auth/react'\nimport { api } from '{{#if (eq structure 'monorepo')}}@repo/backend/convex/_generated/api{{else}}../../convex/_generated/api{{/if}}'\n\nexport function useAuth() {\n const { isAuthenticated, isLoading } = useConvexAuth()\n const { signIn, signOut } = useAuthActions()\n const user = useQuery(api.users.viewer)\n\n return {\n isAuthenticated,\n isLoading,\n user,\n signIn: (provider: 'github' | 'google') => {\n void signIn(provider)\n },\n signInWithPassword: async (email: string, password: string, flow: 'signIn' | 'signUp' = 'signIn', name?: string) => {\n const formData = new FormData()\n formData.append('email', email)\n formData.append('password', password)\n formData.append('flow', flow)\n if (name) {\n formData.append('name', name)\n }\n await signIn('password', formData)\n },\n signOut: () => {\n void signOut()\n },\n }\n}\n",
|
|
1257
1257
|
"web/src/lib/utils.ts.hbs": "import { clsx, type ClassValue } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n",
|
|
1258
|
-
"web/src/proxy.ts.hbs":
|
|
1258
|
+
"web/src/proxy.ts.hbs": `import {
|
|
1259
|
+
convexAuthNextjsMiddleware,
|
|
1260
|
+
createRouteMatcher,
|
|
1261
|
+
nextjsMiddlewareRedirect,
|
|
1262
|
+
} from '@convex-dev/auth/nextjs/server'
|
|
1263
|
+
|
|
1264
|
+
const isPublicRoute = createRouteMatcher(['/sign-in', '/sign-up'])
|
|
1265
|
+
|
|
1266
|
+
// Next.js 16 uses proxy.ts (renamed from middleware.ts)
|
|
1267
|
+
// @convex-dev/auth still uses "middleware" naming in exports
|
|
1268
|
+
export default convexAuthNextjsMiddleware(async (request, { convexAuth }) => {
|
|
1269
|
+
const isAuthenticated = await convexAuth.isAuthenticated()
|
|
1270
|
+
|
|
1271
|
+
// Redirect unauthenticated users to /sign-up
|
|
1272
|
+
if (!isPublicRoute(request) && !isAuthenticated) {
|
|
1273
|
+
return nextjsMiddlewareRedirect(request, '/sign-up')
|
|
1274
|
+
}
|
|
1275
|
+
|
|
1276
|
+
// Redirect authenticated users from auth pages to / (dashboard)
|
|
1277
|
+
if (isPublicRoute(request) && isAuthenticated) {
|
|
1278
|
+
return nextjsMiddlewareRedirect(request, '/')
|
|
1279
|
+
}
|
|
1280
|
+
})
|
|
1281
|
+
|
|
1282
|
+
export const config = {
|
|
1283
|
+
matcher: ['/((?!.*\\\\..*|_next).*)', '/', '/(api|trpc)(.*)'],
|
|
1284
|
+
}
|
|
1285
|
+
`,
|
|
1259
1286
|
"web/tsconfig.json.hbs": '{\n "compilerOptions": {\n "target": "ES2017",\n "lib": ["dom", "dom.iterable", "esnext"],\n "allowJs": true,\n "skipLibCheck": true,\n "strict": true,\n "noEmit": true,\n "esModuleInterop": true,\n "module": "esnext",\n "moduleResolution": "bundler",\n "resolveJsonModule": true,\n "isolatedModules": true,\n "jsx": "react-jsx",\n "incremental": true,\n "plugins": [{ "name": "next" }],\n "paths": {\n "@/*": ["./src/*"]\n }\n },\n "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", ".next/dev/types/**/*.ts"],\n "exclude": ["node_modules"]\n}\n'
|
|
1260
1287
|
};
|
|
1261
1288
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Auto-generated file. Do not edit manually.
|
|
2
2
|
// Run 'pnpm prebuild' to regenerate.
|
|
3
|
-
// Generated: 2026-01-
|
|
3
|
+
// Generated: 2026-01-14T02:00:59.812Z
|
|
4
4
|
// Template count: 86
|
|
5
5
|
|
|
6
6
|
export const EMBEDDED_TEMPLATES: Record<string, string> = {
|
|
@@ -88,6 +88,6 @@ export const EMBEDDED_TEMPLATES: Record<string, string> = {
|
|
|
88
88
|
"web/src/components/providers/convex-provider.tsx.hbs": "'use client'\n\nimport { ConvexAuthNextjsProvider } from '@convex-dev/auth/nextjs'\nimport { ConvexReactClient } from 'convex/react'\n\nconst convex = new ConvexReactClient(process.env.NEXT_PUBLIC_CONVEX_URL!)\n\nexport function ConvexClientProvider({\n children,\n}: {\n children: React.ReactNode\n}) {\n return (\n <ConvexAuthNextjsProvider client={convex}>\n {children}\n </ConvexAuthNextjsProvider>\n )\n}\n",
|
|
89
89
|
"web/src/lib/auth.ts.hbs": "'use client'\n\nimport { useConvexAuth, useQuery } from 'convex/react'\nimport { useAuthActions } from '@convex-dev/auth/react'\nimport { api } from '{{#if (eq structure 'monorepo')}}@repo/backend/convex/_generated/api{{else}}../../convex/_generated/api{{/if}}'\n\nexport function useAuth() {\n const { isAuthenticated, isLoading } = useConvexAuth()\n const { signIn, signOut } = useAuthActions()\n const user = useQuery(api.users.viewer)\n\n return {\n isAuthenticated,\n isLoading,\n user,\n signIn: (provider: 'github' | 'google') => {\n void signIn(provider)\n },\n signInWithPassword: async (email: string, password: string, flow: 'signIn' | 'signUp' = 'signIn', name?: string) => {\n const formData = new FormData()\n formData.append('email', email)\n formData.append('password', password)\n formData.append('flow', flow)\n if (name) {\n formData.append('name', name)\n }\n await signIn('password', formData)\n },\n signOut: () => {\n void signOut()\n },\n }\n}\n",
|
|
90
90
|
"web/src/lib/utils.ts.hbs": "import { clsx, type ClassValue } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n",
|
|
91
|
-
"web/src/proxy.ts.hbs": "import {\n
|
|
91
|
+
"web/src/proxy.ts.hbs": "import {\n convexAuthNextjsMiddleware,\n createRouteMatcher,\n nextjsMiddlewareRedirect,\n} from '@convex-dev/auth/nextjs/server'\n\nconst isPublicRoute = createRouteMatcher(['/sign-in', '/sign-up'])\n\n// Next.js 16 uses proxy.ts (renamed from middleware.ts)\n// @convex-dev/auth still uses \"middleware\" naming in exports\nexport default convexAuthNextjsMiddleware(async (request, { convexAuth }) => {\n const isAuthenticated = await convexAuth.isAuthenticated()\n\n // Redirect unauthenticated users to /sign-up\n if (!isPublicRoute(request) && !isAuthenticated) {\n return nextjsMiddlewareRedirect(request, '/sign-up')\n }\n\n // Redirect authenticated users from auth pages to / (dashboard)\n if (isPublicRoute(request) && isAuthenticated) {\n return nextjsMiddlewareRedirect(request, '/')\n }\n})\n\nexport const config = {\n matcher: ['/((?!.*\\\\..*|_next).*)', '/', '/(api|trpc)(.*)'],\n}\n",
|
|
92
92
|
"web/tsconfig.json.hbs": "{\n \"compilerOptions\": {\n \"target\": \"ES2017\",\n \"lib\": [\"dom\", \"dom.iterable\", \"esnext\"],\n \"allowJs\": true,\n \"skipLibCheck\": true,\n \"strict\": true,\n \"noEmit\": true,\n \"esModuleInterop\": true,\n \"module\": \"esnext\",\n \"moduleResolution\": \"bundler\",\n \"resolveJsonModule\": true,\n \"isolatedModules\": true,\n \"jsx\": \"react-jsx\",\n \"incremental\": true,\n \"plugins\": [{ \"name\": \"next\" }],\n \"paths\": {\n \"@/*\": [\"./src/*\"]\n }\n },\n \"include\": [\"next-env.d.ts\", \"**/*.ts\", \"**/*.tsx\", \".next/types/**/*.ts\", \".next/dev/types/**/*.ts\"],\n \"exclude\": [\"node_modules\"]\n}\n"
|
|
93
93
|
}
|
|
@@ -1,21 +1,27 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
convexAuthNextjsMiddleware,
|
|
3
3
|
createRouteMatcher,
|
|
4
|
-
|
|
4
|
+
nextjsMiddlewareRedirect,
|
|
5
5
|
} from '@convex-dev/auth/nextjs/server'
|
|
6
6
|
|
|
7
7
|
const isPublicRoute = createRouteMatcher(['/sign-in', '/sign-up'])
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
// Next.js 16 uses proxy.ts (renamed from middleware.ts)
|
|
10
|
+
// @convex-dev/auth still uses "middleware" naming in exports
|
|
11
|
+
export default convexAuthNextjsMiddleware(async (request, { convexAuth }) => {
|
|
10
12
|
const isAuthenticated = await convexAuth.isAuthenticated()
|
|
11
13
|
|
|
12
14
|
// Redirect unauthenticated users to /sign-up
|
|
13
15
|
if (!isPublicRoute(request) && !isAuthenticated) {
|
|
14
|
-
return
|
|
16
|
+
return nextjsMiddlewareRedirect(request, '/sign-up')
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
// Redirect authenticated users from auth pages to / (dashboard)
|
|
18
20
|
if (isPublicRoute(request) && isAuthenticated) {
|
|
19
|
-
return
|
|
21
|
+
return nextjsMiddlewareRedirect(request, '/')
|
|
20
22
|
}
|
|
21
23
|
})
|
|
24
|
+
|
|
25
|
+
export const config = {
|
|
26
|
+
matcher: ['/((?!.*\\..*|_next).*)', '/', '/(api|trpc)(.*)'],
|
|
27
|
+
}
|