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.
Files changed (44) hide show
  1. package/.turbo/turbo-build.log +20 -0
  2. package/dist/index.d.ts +94 -0
  3. package/dist/index.js +744 -0
  4. package/package.json +29 -0
  5. package/scripts/generate-templates.js +104 -0
  6. package/src/core/index.ts +7 -0
  7. package/src/core/template-processor.ts +127 -0
  8. package/src/core/virtual-fs.ts +189 -0
  9. package/src/generator.ts +429 -0
  10. package/src/index.ts +19 -0
  11. package/src/templates.generated.ts +39 -0
  12. package/templates/base/_gitignore.hbs +45 -0
  13. package/templates/base/biome.json.hbs +34 -0
  14. package/templates/convex/_env.local.hbs +52 -0
  15. package/templates/convex/convex/auth.ts.hbs +7 -0
  16. package/templates/convex/convex/http.ts.hbs +8 -0
  17. package/templates/convex/convex/schema.ts.hbs +15 -0
  18. package/templates/convex/convex/users.ts.hbs +13 -0
  19. package/templates/integrations/posthog/src/components/providers/posthog-provider.tsx.hbs +17 -0
  20. package/templates/monorepo/package.json.hbs +29 -0
  21. package/templates/monorepo/pnpm-workspace.yaml.hbs +3 -0
  22. package/templates/monorepo/turbo.json.hbs +42 -0
  23. package/templates/packages/config-biome/biome.json.hbs +4 -0
  24. package/templates/packages/config-biome/package.json.hbs +6 -0
  25. package/templates/packages/config-typescript/base.json.hbs +17 -0
  26. package/templates/packages/config-typescript/nextjs.json.hbs +7 -0
  27. package/templates/packages/config-typescript/package.json.hbs +10 -0
  28. package/templates/packages/ui/components.json.hbs +20 -0
  29. package/templates/packages/ui/package.json.hbs +34 -0
  30. package/templates/packages/ui/src/index.ts.hbs +3 -0
  31. package/templates/packages/ui/src/lib/utils.ts.hbs +6 -0
  32. package/templates/packages/ui/tsconfig.json.hbs +22 -0
  33. package/templates/web/components.json.hbs +20 -0
  34. package/templates/web/next.config.ts.hbs +9 -0
  35. package/templates/web/package.json.hbs +62 -0
  36. package/templates/web/postcss.config.mjs.hbs +5 -0
  37. package/templates/web/src/app/globals.css.hbs +122 -0
  38. package/templates/web/src/app/layout.tsx.hbs +55 -0
  39. package/templates/web/src/app/page.tsx.hbs +74 -0
  40. package/templates/web/src/components/providers/convex-provider.tsx.hbs +18 -0
  41. package/templates/web/src/lib/auth.ts.hbs +23 -0
  42. package/templates/web/src/lib/utils.ts.hbs +6 -0
  43. package/templates/web/tsconfig.json.hbs +23 -0
  44. 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,6 @@
1
+ import { clsx, type ClassValue } from 'clsx'
2
+ import { twMerge } from 'tailwind-merge'
3
+
4
+ export function cn(...inputs: ClassValue[]) {
5
+ return twMerge(clsx(inputs))
6
+ }
@@ -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
+ }