kofi-stack-template-generator 2.0.0
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 +20 -0
- package/dist/index.d.ts +94 -0
- package/dist/index.js +744 -0
- package/package.json +29 -0
- package/scripts/generate-templates.js +104 -0
- package/src/core/index.ts +7 -0
- package/src/core/template-processor.ts +127 -0
- package/src/core/virtual-fs.ts +189 -0
- package/src/generator.ts +429 -0
- package/src/index.ts +19 -0
- package/src/templates.generated.ts +39 -0
- package/templates/base/_gitignore.hbs +45 -0
- package/templates/base/biome.json.hbs +34 -0
- package/templates/convex/_env.local.hbs +52 -0
- package/templates/convex/convex/auth.ts.hbs +7 -0
- package/templates/convex/convex/http.ts.hbs +8 -0
- package/templates/convex/convex/schema.ts.hbs +15 -0
- package/templates/convex/convex/users.ts.hbs +13 -0
- package/templates/integrations/posthog/src/components/providers/posthog-provider.tsx.hbs +17 -0
- package/templates/monorepo/package.json.hbs +29 -0
- package/templates/monorepo/pnpm-workspace.yaml.hbs +3 -0
- package/templates/monorepo/turbo.json.hbs +42 -0
- package/templates/packages/config-biome/biome.json.hbs +4 -0
- package/templates/packages/config-biome/package.json.hbs +6 -0
- package/templates/packages/config-typescript/base.json.hbs +17 -0
- package/templates/packages/config-typescript/nextjs.json.hbs +7 -0
- package/templates/packages/config-typescript/package.json.hbs +10 -0
- package/templates/packages/ui/components.json.hbs +20 -0
- package/templates/packages/ui/package.json.hbs +34 -0
- package/templates/packages/ui/src/index.ts.hbs +3 -0
- package/templates/packages/ui/src/lib/utils.ts.hbs +6 -0
- package/templates/packages/ui/tsconfig.json.hbs +22 -0
- package/templates/web/components.json.hbs +20 -0
- package/templates/web/next.config.ts.hbs +9 -0
- package/templates/web/package.json.hbs +62 -0
- package/templates/web/postcss.config.mjs.hbs +5 -0
- package/templates/web/src/app/globals.css.hbs +122 -0
- package/templates/web/src/app/layout.tsx.hbs +55 -0
- package/templates/web/src/app/page.tsx.hbs +74 -0
- package/templates/web/src/components/providers/convex-provider.tsx.hbs +18 -0
- package/templates/web/src/lib/auth.ts.hbs +23 -0
- package/templates/web/src/lib/utils.ts.hbs +6 -0
- package/templates/web/tsconfig.json.hbs +23 -0
- package/tsconfig.json +15 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { useConvexAuth, useMutation, useQuery } from 'convex/react'
|
|
4
|
+
import { useAuthActions } from '@convex-dev/auth/react'
|
|
5
|
+
import { api } from '{{#if (eq structure 'monorepo')}}@repo/backend{{else}}../../convex/_generated/api{{/if}}'
|
|
6
|
+
|
|
7
|
+
export function useAuth() {
|
|
8
|
+
const { isAuthenticated, isLoading } = useConvexAuth()
|
|
9
|
+
const { signIn, signOut } = useAuthActions()
|
|
10
|
+
const user = useQuery(api.users.current)
|
|
11
|
+
|
|
12
|
+
return {
|
|
13
|
+
isAuthenticated,
|
|
14
|
+
isLoading,
|
|
15
|
+
user,
|
|
16
|
+
signIn: (provider: 'github' | 'google') => {
|
|
17
|
+
void signIn(provider)
|
|
18
|
+
},
|
|
19
|
+
signOut: () => {
|
|
20
|
+
void signOut()
|
|
21
|
+
},
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2017",
|
|
4
|
+
"lib": ["dom", "dom.iterable", "esnext"],
|
|
5
|
+
"allowJs": true,
|
|
6
|
+
"skipLibCheck": true,
|
|
7
|
+
"strict": true,
|
|
8
|
+
"noEmit": true,
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"module": "esnext",
|
|
11
|
+
"moduleResolution": "bundler",
|
|
12
|
+
"resolveJsonModule": true,
|
|
13
|
+
"isolatedModules": true,
|
|
14
|
+
"jsx": "react-jsx",
|
|
15
|
+
"incremental": true,
|
|
16
|
+
"plugins": [{ "name": "next" }],
|
|
17
|
+
"paths": {
|
|
18
|
+
"@/*": ["./src/*"]
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", ".next/dev/types/**/*.ts"],
|
|
22
|
+
"exclude": ["node_modules"]
|
|
23
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "bundler",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"declaration": true,
|
|
10
|
+
"outDir": "./dist",
|
|
11
|
+
"rootDir": "./src"
|
|
12
|
+
},
|
|
13
|
+
"include": ["src/**/*"],
|
|
14
|
+
"exclude": ["node_modules", "dist", "templates"]
|
|
15
|
+
}
|