create-ej-app 16.0.0 → 18.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 (104) hide show
  1. package/README.md +108 -13
  2. package/cli.js +32 -19
  3. package/cli.ts +45 -27
  4. package/package.json +2 -2
  5. package/template/api/.env.example +3 -0
  6. package/template/api/.github/copilot-instructions.md +129 -0
  7. package/template/api/.vscode/extensions.json +9 -0
  8. package/template/api/.vscode/settings.json +3 -0
  9. package/template/api/Dockerfile +23 -0
  10. package/template/api/package.json +31 -0
  11. package/template/api/prettier.config.mjs +11 -0
  12. package/template/api/src/data-access/todo.ts +142 -0
  13. package/template/api/src/db/fields.ts +46 -0
  14. package/template/api/src/db/index.ts +21 -0
  15. package/template/api/src/db/schema.ts +19 -0
  16. package/template/api/src/env.ts +24 -0
  17. package/template/api/src/index.ts +39 -0
  18. package/template/api/src/lib/util.ts +55 -0
  19. package/template/api/src/routes/index.ts +18 -0
  20. package/template/api/src/routes/todo/index.ts +241 -0
  21. package/template/api/src/scripts/seed.ts +25 -0
  22. package/template/api/tsconfig.json +33 -0
  23. package/template/nextjs/drizzle.config.ts +10 -0
  24. package/template/{base → nextjs}/package.json +7 -4
  25. package/template/{base → nextjs}/src/app/not-found.tsx +8 -2
  26. package/template/nextjs/src/instrumentation.ts +26 -0
  27. package/template/nextjs/src/lib/otel.ts +27 -0
  28. package/template/{base → nextjs}/src/lib/safe-action.ts +8 -0
  29. /package/template/{base → api}/drizzle.config.ts +0 -0
  30. /package/template/{base → nextjs}/.dockerignore +0 -0
  31. /package/template/{base → nextjs}/.env.example +0 -0
  32. /package/template/{base → nextjs}/Dockerfile +0 -0
  33. /package/template/{base → nextjs}/components.json +0 -0
  34. /package/template/{base → nextjs}/eslint.config.mjs +0 -0
  35. /package/template/{base → nextjs}/next.config.ts +0 -0
  36. /package/template/{base → nextjs}/postcss.config.mjs +0 -0
  37. /package/template/{base → nextjs}/prettier.config.mjs +0 -0
  38. /package/template/{base → nextjs}/public/placeholder.svg +0 -0
  39. /package/template/{base → nextjs}/src/app/(admin)/admin/page.tsx +0 -0
  40. /package/template/{base → nextjs}/src/app/(admin)/layout.tsx +0 -0
  41. /package/template/{base → nextjs}/src/app/(app)/layout.tsx +0 -0
  42. /package/template/{base → nextjs}/src/app/(auth)/login/email-login-form.tsx +0 -0
  43. /package/template/{base → nextjs}/src/app/(auth)/login/page.tsx +0 -0
  44. /package/template/{base → nextjs}/src/app/(auth)/login/social-login-buttons.tsx +0 -0
  45. /package/template/{base → nextjs}/src/app/(marketing)/layout.tsx +0 -0
  46. /package/template/{base → nextjs}/src/app/(marketing)/page.tsx +0 -0
  47. /package/template/{base → nextjs}/src/app/(marketing)/privacy/page.tsx +0 -0
  48. /package/template/{base → nextjs}/src/app/(marketing)/terms/page.tsx +0 -0
  49. /package/template/{base → nextjs}/src/app/api/[[...slugs]]/route.ts +0 -0
  50. /package/template/{base → nextjs}/src/app/api/auth/[...all]/route.ts +0 -0
  51. /package/template/{base → nextjs}/src/app/favicon.ico +0 -0
  52. /package/template/{base → nextjs}/src/app/globals.css +0 -0
  53. /package/template/{base → nextjs}/src/app/layout.tsx +0 -0
  54. /package/template/{base → nextjs}/src/components/loader.tsx +0 -0
  55. /package/template/{base → nextjs}/src/components/react-query-provider.tsx +0 -0
  56. /package/template/{base → nextjs}/src/components/screen-size.tsx +0 -0
  57. /package/template/{base → nextjs}/src/components/site-footer.tsx +0 -0
  58. /package/template/{base → nextjs}/src/components/theme-toggle.tsx +0 -0
  59. /package/template/{base → nextjs}/src/components/ui/button.tsx +0 -0
  60. /package/template/{base → nextjs}/src/components/ui/card.tsx +0 -0
  61. /package/template/{base → nextjs}/src/components/ui/form.tsx +0 -0
  62. /package/template/{base → nextjs}/src/components/ui/input.tsx +0 -0
  63. /package/template/{base → nextjs}/src/components/ui/label.tsx +0 -0
  64. /package/template/{base → nextjs}/src/components/ui/separator.tsx +0 -0
  65. /package/template/{base → nextjs}/src/components/ui/sonner.tsx +0 -0
  66. /package/template/{base → nextjs}/src/db/index.ts +0 -0
  67. /package/template/{base → nextjs}/src/db/schema.ts +0 -0
  68. /package/template/{base → nextjs}/src/emails/components/email-layout.tsx +0 -0
  69. /package/template/{base → nextjs}/src/emails/magic-link.tsx +0 -0
  70. /package/template/{base → nextjs}/src/emails/test.tsx +0 -0
  71. /package/template/{base → nextjs}/src/emails/welcome.tsx +0 -0
  72. /package/template/{base → nextjs}/src/env.ts +0 -0
  73. /package/template/{base → nextjs}/src/lib/auth-client.ts +0 -0
  74. /package/template/{base → nextjs}/src/lib/auth.ts +0 -0
  75. /package/template/{base → nextjs}/src/lib/cn.ts +0 -0
  76. /package/template/{base → nextjs}/src/lib/delay.ts +0 -0
  77. /package/template/{base → nextjs}/src/lib/eden.ts +0 -0
  78. /package/template/{base → nextjs}/src/lib/email-service.ts +0 -0
  79. /package/template/{base → nextjs}/src/lib/nodemailer.ts +0 -0
  80. /package/template/{base → nextjs}/src/lib/safe-action-client.ts +0 -0
  81. /package/template/{base → nextjs}/src/lib/siteConfig.ts +0 -0
  82. /package/template/{base → nextjs}/src/lib/toast-message.ts +0 -0
  83. /package/template/{base → nextjs}/src/scripts/test-mail.ts +0 -0
  84. /package/template/{base → nextjs}/terraform/artifact-registry.tf +0 -0
  85. /package/template/{base → nextjs}/terraform/backend-service.tf +0 -0
  86. /package/template/{base → nextjs}/terraform/cleanup.sh +0 -0
  87. /package/template/{base → nextjs}/terraform/cloudbuild.tf +0 -0
  88. /package/template/{base → nextjs}/terraform/cloudrun.tf +0 -0
  89. /package/template/{base → nextjs}/terraform/database.tf +0 -0
  90. /package/template/{base → nextjs}/terraform/forwarding-rule.tf +0 -0
  91. /package/template/{base → nextjs}/terraform/ip-address.tf +0 -0
  92. /package/template/{base → nextjs}/terraform/network-endpoint-group.tf +0 -0
  93. /package/template/{base → nextjs}/terraform/network.tf +0 -0
  94. /package/template/{base → nextjs}/terraform/pre.sh +0 -0
  95. /package/template/{base → nextjs}/terraform/providers.tf +0 -0
  96. /package/template/{base → nextjs}/terraform/secret.txt +0 -0
  97. /package/template/{base → nextjs}/terraform/setup.sh +0 -0
  98. /package/template/{base → nextjs}/terraform/ssl-certs.tf +0 -0
  99. /package/template/{base → nextjs}/terraform/target-https-proxy copy.tf +0 -0
  100. /package/template/{base → nextjs}/terraform/target-https-proxy.tf +0 -0
  101. /package/template/{base → nextjs}/terraform/terraform.tfvars +0 -0
  102. /package/template/{base → nextjs}/terraform/url-map.tf +0 -0
  103. /package/template/{base → nextjs}/terraform/variables.tf +0 -0
  104. /package/template/{base → nextjs}/tsconfig.json +0 -0
@@ -24,6 +24,8 @@
24
24
  "@elysiajs/eden": "1.4.8",
25
25
  "@hookform/resolvers": "5.2.2",
26
26
  "@next/third-parties": "16.1.6",
27
+ "@opentelemetry/api": "1.9.0",
28
+ "@opentelemetry/sdk-trace-base": "2.5.1",
27
29
  "@paralleldrive/cuid2": "3.3.0",
28
30
  "@radix-ui/react-label": "2.1.8",
29
31
  "@radix-ui/react-separator": "1.1.8",
@@ -32,12 +34,13 @@
32
34
  "@react-email/render": "2.0.4",
33
35
  "@t3-oss/env-nextjs": "0.13.10",
34
36
  "@tanstack/react-query": "5.90.21",
37
+ "@vercel/otel": "2.1.1",
35
38
  "better-auth": "1.4.18",
36
39
  "class-variance-authority": "0.7.1",
37
40
  "clsx": "2.1.1",
38
41
  "drizzle-orm": "0.45.1",
39
42
  "elysia": "1.4.25",
40
- "lucide-react": "0.563.0",
43
+ "lucide-react": "0.564.0",
41
44
  "next": "16.1.6",
42
45
  "next-safe-action": "8.0.11",
43
46
  "next-themes": "0.4.6",
@@ -48,9 +51,9 @@
48
51
  "react-dom": "19.2.4",
49
52
  "react-hook-form": "7.71.1",
50
53
  "sonner": "2.0.7",
51
- "tailwind-merge": "3.4.0",
54
+ "tailwind-merge": "3.4.1",
52
55
  "tw-animate-css": "1.4.0",
53
- "workflow": "4.1.0-beta.56",
56
+ "workflow": "4.1.0-beta.57",
54
57
  "zod": "4.3.6"
55
58
  },
56
59
  "devDependencies": {
@@ -58,7 +61,7 @@
58
61
  "@react-email/preview-server": "5.2.8",
59
62
  "@tailwindcss/postcss": "4.1.18",
60
63
  "@types/bun": "1.3.9",
61
- "@types/nodemailer": "7.0.9",
64
+ "@types/nodemailer": "7.0.10",
62
65
  "@types/react": "19.2.14",
63
66
  "@types/react-dom": "19.2.3",
64
67
  "babel-plugin-react-compiler": "1.0.0",
@@ -1,7 +1,13 @@
1
+ 'use client'
2
+
3
+ import { Button } from '@/components/ui/button'
1
4
  import Link from 'next/link'
2
- import { Button } from '~/components/ui/button'
5
+ import { usePathname } from 'next/navigation'
3
6
 
4
7
  export default function NotFound() {
8
+ const pathname = usePathname()
9
+ const homeRoute = pathname?.startsWith('/admin') ? '/admin' : '/'
10
+
5
11
  return (
6
12
  <main className="bg-background text-foreground flex min-h-screen flex-col">
7
13
  <section className="flex min-h-[60vh] flex-col items-center justify-center px-4">
@@ -12,7 +18,7 @@ export default function NotFound() {
12
18
  The page you're looking for doesn't exist.
13
19
  </p>
14
20
  <Button asChild>
15
- <Link href="/">Return to Home</Link>
21
+ <Link href={homeRoute}>Return to Home</Link>
16
22
  </Button>
17
23
  </div>
18
24
  </section>
@@ -0,0 +1,26 @@
1
+ import { SpanStatusCode } from '@opentelemetry/api'
2
+ import {
3
+ ConsoleSpanExporter,
4
+ ReadableSpan,
5
+ SimpleSpanProcessor
6
+ } from '@opentelemetry/sdk-trace-base'
7
+ import { registerOTel } from '@vercel/otel'
8
+
9
+ class SmartSamplingSpanProcessor extends SimpleSpanProcessor {
10
+ onEnd(span: ReadableSpan): void {
11
+ const isError = span.status.code === SpanStatusCode.ERROR
12
+ const isSlow = span.duration[0] * 1000 + span.duration[1] / 1e6 > 5000
13
+ const isLucky = Math.random() < 0 // Adjust this value to adjust the sampling rate for non-error and non-slow spans
14
+
15
+ if (isError || isSlow || isLucky) {
16
+ super.onEnd(span)
17
+ }
18
+ }
19
+ }
20
+
21
+ export function register() {
22
+ registerOTel({
23
+ serviceName: 'tdc-ai',
24
+ spanProcessors: [new SmartSamplingSpanProcessor(new ConsoleSpanExporter())]
25
+ })
26
+ }
@@ -0,0 +1,27 @@
1
+ import { SpanStatusCode, trace } from '@opentelemetry/api'
2
+
3
+ function getSpan() {
4
+ const span = trace.getActiveSpan()
5
+ return span
6
+ }
7
+
8
+ export function recordWideEvent(attributes: Record<string, any>) {
9
+ const span = getSpan()
10
+ if (!span) return
11
+
12
+ span.setAttributes(attributes)
13
+ }
14
+
15
+ export function recordError(err: unknown) {
16
+ const span = getSpan()
17
+ if (!span) return
18
+
19
+ span.setStatus({
20
+ code: SpanStatusCode.ERROR,
21
+ message: err instanceof Error ? err.message : String(err)
22
+ })
23
+
24
+ span.recordException(err instanceof Error ? err : String(err))
25
+
26
+ return span.spanContext().traceId
27
+ }
@@ -1,10 +1,18 @@
1
1
  import { createSafeActionClient } from 'next-safe-action'
2
2
  import { getAuthSession } from './auth'
3
+ import { recordWideEvent } from './otel'
3
4
 
4
5
  export const actionClient = createSafeActionClient().use(
5
6
  async ({ next, ctx }) => {
6
7
  const authSession = await getAuthSession()
7
8
 
9
+ if (authSession)
10
+ recordWideEvent({
11
+ 'user.id': authSession.user.id,
12
+ 'user.admin': authSession.isAdmin,
13
+ 'session.id': authSession.session.id
14
+ })
15
+
8
16
  return next({
9
17
  ctx: {
10
18
  ...ctx,
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes