@murumets-ee/create 0.1.0 → 0.1.1
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/dist/chunk-CUB6XFPE.js +2 -0
- package/dist/chunk-ZAX4VH4C.js +3 -0
- package/dist/cli.js +93 -89
- package/dist/index.js +75 -71
- package/dist/{utils-5ZPYHNWB.js → utils-42K2ZGUL.js} +1 -1
- package/dist/{utils-4KO55GSJ.js → utils-VX57GKZX.js} +1 -1
- package/package.json +1 -1
- package/dist/chunk-HAE5YHLL.js +0 -3
- package/dist/chunk-YJOFTYN5.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{execSync as r}from"child_process";import{appendFile as c,writeFile as s,mkdir as d,readFile as o,rm as p}from"fs/promises";import{dirname as a,join as f}from"path";async function v(i,e){await d(a(i),{recursive:!0}),await s(i,e,"utf-8")}async function l(i,e){let t=await o(i,"utf-8"),n=JSON.parse(t);e.type&&(n.type=e.type),e.dependencies&&(n.dependencies={...n.dependencies,...e.dependencies}),e.devDependencies&&(n.devDependencies={...n.devDependencies,...e.devDependencies}),e.scripts&&(n.scripts={...n.scripts,...e.scripts}),await s(i,`${JSON.stringify(n,null,2)}
|
|
2
|
+
`,"utf-8")}async function y(i,e){for(let t of e)await p(f(i,t),{force:!0,recursive:!0})}function m(i,e){return r(i,{cwd:e?.cwd,stdio:"pipe",encoding:"utf-8"})}async function F(i,e){await c(i,e,"utf-8")}export{v as a,l as b,y as c,m as d,F as e};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{execSync as r}from"child_process";import{appendFile as c,writeFile as s,mkdir as d,readFile as o,rm as p}from"fs/promises";import{dirname as a,join as f}from"path";async function v(i,e){await d(a(i),{recursive:!0}),await s(i,e,"utf-8")}async function l(i,e){let t=await o(i,"utf-8"),n=JSON.parse(t);e.type&&(n.type=e.type),e.dependencies&&(n.dependencies={...n.dependencies,...e.dependencies}),e.devDependencies&&(n.devDependencies={...n.devDependencies,...e.devDependencies}),e.scripts&&(n.scripts={...n.scripts,...e.scripts}),await s(i,`${JSON.stringify(n,null,2)}
|
|
3
|
+
`,"utf-8")}async function y(i,e){for(let t of e)await p(f(i,t),{force:!0,recursive:!0})}function m(i,e){return r(i,{cwd:e?.cwd,stdio:"pipe",encoding:"utf-8"})}async function F(i,e){await c(i,e,"utf-8")}export{v as a,l as b,y as c,m as d,F as e};
|
package/dist/cli.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as e,b as
|
|
2
|
+
import{a as e,b as p,c as d,d as u,e as A}from"./chunk-ZAX4VH4C.js";import*as c from"@clack/prompts";import b from"picocolors";import*as s from"@clack/prompts";async function T(t){s.intro("@murumets-ee/create");let n=t??await s.text({message:"Project name:",placeholder:"my-project",validate:l=>{if(!l)return"Project name is required";if(!/^[a-z0-9-]+$/.test(l))return"Use lowercase letters, numbers, and hyphens only"}});if(s.isCancel(n))return s.cancel("Cancelled."),null;let r=await s.select({message:"App setup:",options:[{value:"single",label:"Single app",hint:"everything in one Next.js project"},{value:"multi",label:"Admin + Frontend",hint:"two apps in a pnpm workspace"}]});if(s.isCancel(r))return s.cancel("Cancelled."),null;let o=await s.confirm({message:"Install dependencies?",initialValue:!0});return s.isCancel(o)?(s.cancel("Cancelled."),null):{name:n,mode:r,installDeps:o}}import{join as k}from"path";import{join as m}from"path";async function N(t,n){await e(m(t,"lib/auth.ts"),`import { getToolkitApp } from './app'
|
|
3
3
|
import { getAuth } from '@murumets-ee/auth'
|
|
4
4
|
|
|
5
5
|
await getToolkitApp()
|
|
6
6
|
|
|
7
7
|
export const auth = getAuth()
|
|
8
|
-
`),await e(
|
|
8
|
+
`),await e(m(t,"lib/auth-client.ts"),`import { createClient } from '@murumets-ee/auth/client'
|
|
9
9
|
|
|
10
10
|
export const authClient = createClient()
|
|
11
|
-
`),await e(
|
|
11
|
+
`),await e(m(t,"app/api/auth/[...all]/route.ts"),`import { toNextJsHandler } from 'better-auth/next-js'
|
|
12
12
|
import { auth } from '../../../../lib/auth'
|
|
13
13
|
|
|
14
14
|
export const { GET, POST } = toNextJsHandler(auth)
|
|
15
|
-
`),await e(
|
|
15
|
+
`),await e(m(t,"app/[locale]/auth/layout.tsx"),`import { AuthProviders } from './providers'
|
|
16
16
|
import type { ReactNode } from 'react'
|
|
17
17
|
|
|
18
18
|
export default function AuthLayout({ children }: { children: ReactNode }) {
|
|
@@ -24,7 +24,7 @@ export default function AuthLayout({ children }: { children: ReactNode }) {
|
|
|
24
24
|
</AuthProviders>
|
|
25
25
|
)
|
|
26
26
|
}
|
|
27
|
-
`),await e(
|
|
27
|
+
`),await e(m(t,"app/[locale]/auth/providers.tsx"),`'use client'
|
|
28
28
|
|
|
29
29
|
import { AuthUIProvider } from '@murumets-ee/auth-ui'
|
|
30
30
|
import { authClient } from '@/lib/auth-client'
|
|
@@ -50,22 +50,22 @@ export function AuthProviders({ children }: { children: ReactNode }) {
|
|
|
50
50
|
</AuthUIProvider>
|
|
51
51
|
)
|
|
52
52
|
}
|
|
53
|
-
`),await e(
|
|
53
|
+
`),await e(m(t,"app/[locale]/auth/sign-in/page.tsx"),`import { SignInForm } from '@murumets-ee/auth-ui'
|
|
54
54
|
|
|
55
55
|
export default function SignInPage() {
|
|
56
56
|
return <SignInForm />
|
|
57
57
|
}
|
|
58
|
-
`),await e(
|
|
58
|
+
`),await e(m(t,"app/[locale]/auth/sign-up/page.tsx"),`import { SignUpForm } from '@murumets-ee/auth-ui'
|
|
59
59
|
|
|
60
60
|
export default function SignUpPage() {
|
|
61
61
|
return <SignUpForm />
|
|
62
62
|
}
|
|
63
|
-
`),await e(
|
|
63
|
+
`),await e(m(t,"app/[locale]/auth/forgot-password/page.tsx"),`import { ForgotPasswordForm } from '@murumets-ee/auth-ui'
|
|
64
64
|
|
|
65
65
|
export default function ForgotPasswordPage() {
|
|
66
66
|
return <ForgotPasswordForm />
|
|
67
67
|
}
|
|
68
|
-
`),await e(
|
|
68
|
+
`),await e(m(t,"app/[locale]/auth/reset-password/page.tsx"),`import { Suspense } from 'react'
|
|
69
69
|
import { ResetPasswordContent } from './content'
|
|
70
70
|
|
|
71
71
|
export default function ResetPasswordPage() {
|
|
@@ -75,7 +75,7 @@ export default function ResetPasswordPage() {
|
|
|
75
75
|
</Suspense>
|
|
76
76
|
)
|
|
77
77
|
}
|
|
78
|
-
`),await e(
|
|
78
|
+
`),await e(m(t,"app/[locale]/auth/reset-password/content.tsx"),`'use client'
|
|
79
79
|
|
|
80
80
|
import { useSearchParams } from 'next/navigation'
|
|
81
81
|
import { ResetPasswordForm } from '@murumets-ee/auth-ui'
|
|
@@ -99,7 +99,7 @@ export function ResetPasswordContent() {
|
|
|
99
99
|
|
|
100
100
|
return <ResetPasswordForm token={token} />
|
|
101
101
|
}
|
|
102
|
-
`),await e(
|
|
102
|
+
`),await e(m(t,"app/[locale]/setup/page.tsx"),`import { redirect } from 'next/navigation'
|
|
103
103
|
import { sql } from 'drizzle-orm'
|
|
104
104
|
import { getToolkitApp } from '@/lib/app'
|
|
105
105
|
import { SetupForm } from './form'
|
|
@@ -124,7 +124,7 @@ export default async function SetupPage() {
|
|
|
124
124
|
</div>
|
|
125
125
|
)
|
|
126
126
|
}
|
|
127
|
-
`),await e(
|
|
127
|
+
`),await e(m(t,"app/[locale]/setup/form.tsx"),`'use client'
|
|
128
128
|
|
|
129
129
|
import { useState } from 'react'
|
|
130
130
|
import { createFirstAdmin } from './actions'
|
|
@@ -195,7 +195,7 @@ export function SetupForm() {
|
|
|
195
195
|
</form>
|
|
196
196
|
)
|
|
197
197
|
}
|
|
198
|
-
`),await e(
|
|
198
|
+
`),await e(m(t,"app/[locale]/setup/actions.ts"),`'use server'
|
|
199
199
|
|
|
200
200
|
import { sql } from 'drizzle-orm'
|
|
201
201
|
import { getToolkitApp } from '@/lib/app'
|
|
@@ -249,7 +249,7 @@ export async function createFirstAdmin(formData: FormData) {
|
|
|
249
249
|
|
|
250
250
|
return { ok: true, email: adminUser.user.email }
|
|
251
251
|
}
|
|
252
|
-
`)}import{join as
|
|
252
|
+
`)}import{join as v}from"path";async function z(t,n){let{name:r}=n;await e(v(t,".env.example"),`DATABASE_URL=postgresql://${r}:${r}_dev_password@localhost:5432/${r}_dev
|
|
253
253
|
BETTER_AUTH_SECRET=dev-secret-change-me-in-production-min-32-chars
|
|
254
254
|
BETTER_AUTH_URL=http://localhost:3000
|
|
255
255
|
LOG_LEVEL=debug
|
|
@@ -259,16 +259,14 @@ RESEND_API_KEY=
|
|
|
259
259
|
RESEND_WEBHOOK_SECRET=
|
|
260
260
|
MAIL_FROM=noreply@example.com
|
|
261
261
|
CSAT_SECRET=
|
|
262
|
-
`),await
|
|
263
|
-
//npm.pkg.github.com/:_authToken=\${GITHUB_TOKEN}
|
|
264
|
-
`),await A(h(t,".gitignore"),`
|
|
262
|
+
`),await A(v(t,".gitignore"),`
|
|
265
263
|
# Toolkit generated files
|
|
266
264
|
generated/
|
|
267
265
|
|
|
268
266
|
# Environment
|
|
269
267
|
.env*
|
|
270
268
|
!.env.example
|
|
271
|
-
`),await e(
|
|
269
|
+
`),await e(v(t,"docker-compose.yml"),`services:
|
|
272
270
|
postgres:
|
|
273
271
|
image: postgres:17-alpine
|
|
274
272
|
container_name: ${r}-postgres
|
|
@@ -290,9 +288,9 @@ generated/
|
|
|
290
288
|
volumes:
|
|
291
289
|
postgres_data:
|
|
292
290
|
name: ${r}_postgres_data
|
|
293
|
-
`)}import{join as
|
|
291
|
+
`)}import{join as y}from"path";async function S(t,n){await e(y(t,"entities/index.ts"),`export { Article } from './article'
|
|
294
292
|
export { Category } from './category'
|
|
295
|
-
`),await e(
|
|
293
|
+
`),await e(y(t,"entities/article.ts"),`import { behavior, defineEntity, field } from '@murumets-ee/entity'
|
|
296
294
|
|
|
297
295
|
export const Article = defineEntity({
|
|
298
296
|
name: 'article',
|
|
@@ -323,7 +321,7 @@ export const Article = defineEntity({
|
|
|
323
321
|
delete: 'group.admin',
|
|
324
322
|
},
|
|
325
323
|
})
|
|
326
|
-
`),await e(
|
|
324
|
+
`),await e(y(t,"entities/category.ts"),`import { defineEntity, field } from '@murumets-ee/entity'
|
|
327
325
|
|
|
328
326
|
export const Category = defineEntity({
|
|
329
327
|
name: 'category',
|
|
@@ -366,15 +364,15 @@ export default getRequestConfig(async ({ requestLocale }) => {
|
|
|
366
364
|
},
|
|
367
365
|
}
|
|
368
366
|
})
|
|
369
|
-
`)}import{mkdir as
|
|
367
|
+
`)}import{mkdir as C}from"fs/promises";import{join as a}from"path";var i={myorgCore:"0.1.0",myorgDb:"0.1.0",myorgEntity:"0.1.0",myorgLogging:"0.1.0",myorgAuth:"0.1.0",myorgAuthUi:"0.1.0",myorgAdminUi:"0.1.0",myorgContent:"0.1.0",myorgContentApi:"0.1.0",myorgSettings:"0.1.0",myorgStorage:"0.1.0",myorgMedia:"0.1.0",myorgTaxonomy:"0.1.0",myorgQueue:"0.1.0",myorgMail:"0.1.0",myorgTicketing:"0.1.0",myorgTicketingUi:"0.1.0",myorgEditor:"0.1.0",myorgBlocks:"0.1.0",myorgTokens:"0.1.0",myorgUi:"0.1.0",myorgCli:"0.1.0",betterAuth:"1.4.0",drizzleOrm:"0.45.1",nextIntl:"4.8.2",nextThemes:"0.4.6",lucideReact:"0.563.0",postgres:"3.4.5",reactHookForm:"7.71.1",hookformResolvers:"5.2.2",zod:"3.24.1",drizzleKit:"0.27.2",tsx:"4.19.2",babelReactCompiler:"1.0.0"};async function R(t,n,r){await U(t,n),r?.("Workspace root created"),r?.("Creating admin app..."),await D(t,n),r?.("Admin app created"),r?.("Creating web app..."),await F(t,n),r?.("Web app created"),await I(t,n),r?.("Shared config package created")}async function U(t,n){let{name:r}=n;await C(t,{recursive:!0}),await e(a(t,"pnpm-workspace.yaml"),`packages:
|
|
370
368
|
- 'packages/*'
|
|
371
369
|
- 'apps/*'
|
|
372
370
|
|
|
373
371
|
ignoredBuiltDependencies:
|
|
374
372
|
- sharp
|
|
375
373
|
- unrs-resolver
|
|
376
|
-
`),await e(
|
|
377
|
-
`),await e(
|
|
374
|
+
`),await e(a(t,"package.json"),`${JSON.stringify({name:`@${r}/monorepo`,version:"0.0.0",private:!0,type:"module",scripts:{dev:"turbo dev",build:"turbo build","db:generate":"tsx --env-file=.env packages/config/scripts/generate-schema.ts","db:migrate:generate":"drizzle-kit generate --config packages/config/drizzle.config.ts","db:migrate":"tsx --env-file=.env packages/config/scripts/migrate.ts","db:reset":"tsx --env-file=.env packages/config/scripts/reset-db.ts"},devDependencies:{turbo:"^2.3.3",typescript:"^5.7.3",tsx:`^${i.tsx}`,"drizzle-kit":`^${i.drizzleKit}`}},null,2)}
|
|
375
|
+
`),await e(a(t,".gitignore"),`# dependencies
|
|
378
376
|
node_modules/
|
|
379
377
|
|
|
380
378
|
# build
|
|
@@ -405,7 +403,7 @@ migrations/
|
|
|
405
403
|
|
|
406
404
|
# turbo
|
|
407
405
|
.turbo/
|
|
408
|
-
`),await e(
|
|
406
|
+
`),await e(a(t,".env.example"),`DATABASE_URL=postgresql://${r}:${r}_dev_password@localhost:5432/${r}_dev
|
|
409
407
|
BETTER_AUTH_SECRET=dev-secret-change-me-in-production-min-32-chars
|
|
410
408
|
BETTER_AUTH_URL=http://localhost:3000
|
|
411
409
|
LOG_LEVEL=debug
|
|
@@ -415,9 +413,7 @@ RESEND_API_KEY=
|
|
|
415
413
|
RESEND_WEBHOOK_SECRET=
|
|
416
414
|
MAIL_FROM=noreply@example.com
|
|
417
415
|
CSAT_SECRET=
|
|
418
|
-
`),await e(
|
|
419
|
-
//npm.pkg.github.com/:_authToken=\${GITHUB_TOKEN}
|
|
420
|
-
`),await e(o(t,"docker-compose.yml"),`services:
|
|
416
|
+
`),await e(a(t,"docker-compose.yml"),`services:
|
|
421
417
|
postgres:
|
|
422
418
|
image: postgres:17-alpine
|
|
423
419
|
container_name: ${r}-postgres
|
|
@@ -439,9 +435,9 @@ CSAT_SECRET=
|
|
|
439
435
|
volumes:
|
|
440
436
|
postgres_data:
|
|
441
437
|
name: ${r}_postgres_data
|
|
442
|
-
`)}async function I(t,n){let{name:r}=n,a
|
|
443
|
-
`),await e(o
|
|
444
|
-
`),await e(o
|
|
438
|
+
`)}async function I(t,n){let{name:r}=n,o=a(t,"packages/config");await e(a(o,"package.json"),`${JSON.stringify({name:`@${r}/config`,version:"0.1.0",private:!0,type:"module",exports:{".":"./toolkit.config.ts","./entities":"./entities/index.ts","./entities/*":"./entities/*","./app":"./lib/app.ts","./auth":"./lib/auth.ts","./auth-client":"./lib/auth-client.ts"},dependencies:{"@murumets-ee/core":`^${i.myorgCore}`,"@murumets-ee/db":`^${i.myorgDb}`,"@murumets-ee/entity":`^${i.myorgEntity}`,"@murumets-ee/logging":`^${i.myorgLogging}`,"@murumets-ee/auth":`^${i.myorgAuth}`,"better-auth":`^${i.betterAuth}`,"drizzle-orm":`^${i.drizzleOrm}`,postgres:`^${i.postgres}`,zod:`^${i.zod}`}},null,2)}
|
|
439
|
+
`),await e(a(o,"tsconfig.json"),`${JSON.stringify({compilerOptions:{target:"ES2022",module:"ESNext",moduleResolution:"Bundler",strict:!0,esModuleInterop:!0,skipLibCheck:!0,resolveJsonModule:!0},include:["**/*.ts"]},null,2)}
|
|
440
|
+
`),await e(a(o,"toolkit.config.ts"),`import { auth } from '@murumets-ee/auth/plugin'
|
|
445
441
|
import { content } from '@murumets-ee/content/plugin'
|
|
446
442
|
import { defineConfig } from '@murumets-ee/core'
|
|
447
443
|
import { mail, ResendMailProvider } from '@murumets-ee/mail'
|
|
@@ -493,7 +489,7 @@ export default defineConfig({
|
|
|
493
489
|
],
|
|
494
490
|
projectRoot: import.meta.dirname,
|
|
495
491
|
})
|
|
496
|
-
`),await e(o
|
|
492
|
+
`),await e(a(o,"auth.config.ts"),`import { betterAuth } from 'better-auth'
|
|
497
493
|
import { drizzleAdapter } from 'better-auth/adapters/drizzle'
|
|
498
494
|
import { admin } from 'better-auth/plugins'
|
|
499
495
|
import { organization } from 'better-auth/plugins/organization'
|
|
@@ -511,7 +507,7 @@ export const auth = betterAuth({
|
|
|
511
507
|
organization(),
|
|
512
508
|
],
|
|
513
509
|
})
|
|
514
|
-
`),await e(o
|
|
510
|
+
`),await e(a(o,"drizzle.config.ts"),`import type { Config } from 'drizzle-kit'
|
|
515
511
|
|
|
516
512
|
if (!process.env.DATABASE_URL) {
|
|
517
513
|
throw new Error('DATABASE_URL environment variable is required')
|
|
@@ -525,9 +521,9 @@ export default {
|
|
|
525
521
|
url: process.env.DATABASE_URL,
|
|
526
522
|
},
|
|
527
523
|
} satisfies Config
|
|
528
|
-
`),await e(o
|
|
524
|
+
`),await e(a(o,"entities/index.ts"),`export { Article } from './article'
|
|
529
525
|
export { Category } from './category'
|
|
530
|
-
`),await e(o
|
|
526
|
+
`),await e(a(o,"entities/article.ts"),`import { behavior, defineEntity, field } from '@murumets-ee/entity'
|
|
531
527
|
|
|
532
528
|
export const Article = defineEntity({
|
|
533
529
|
name: 'article',
|
|
@@ -558,7 +554,7 @@ export const Article = defineEntity({
|
|
|
558
554
|
delete: 'group.admin',
|
|
559
555
|
},
|
|
560
556
|
})
|
|
561
|
-
`),await e(o
|
|
557
|
+
`),await e(a(o,"entities/category.ts"),`import { defineEntity, field } from '@murumets-ee/entity'
|
|
562
558
|
|
|
563
559
|
export const Category = defineEntity({
|
|
564
560
|
name: 'category',
|
|
@@ -575,7 +571,7 @@ export const Category = defineEntity({
|
|
|
575
571
|
delete: 'group.admin',
|
|
576
572
|
},
|
|
577
573
|
})
|
|
578
|
-
`),await e(o
|
|
574
|
+
`),await e(a(o,"lib/app.ts"),`import { createApp, setApp, type ToolkitApp } from '@murumets-ee/core'
|
|
579
575
|
import config from '../toolkit.config'
|
|
580
576
|
|
|
581
577
|
let appInstance: ToolkitApp | null = null
|
|
@@ -589,19 +585,19 @@ export async function getToolkitApp(): Promise<ToolkitApp> {
|
|
|
589
585
|
}
|
|
590
586
|
return appInstance
|
|
591
587
|
}
|
|
592
|
-
`),await e(o
|
|
588
|
+
`),await e(a(o,"lib/auth.ts"),`import { getToolkitApp } from './app'
|
|
593
589
|
import { getAuth } from '@murumets-ee/auth'
|
|
594
590
|
|
|
595
591
|
await getToolkitApp()
|
|
596
592
|
|
|
597
593
|
export const auth = getAuth()
|
|
598
|
-
`),await e(o
|
|
594
|
+
`),await e(a(o,"lib/auth-client.ts"),`import { createClient } from '@murumets-ee/auth/client'
|
|
599
595
|
|
|
600
596
|
export const authClient = createClient()
|
|
601
|
-
`),await e(o
|
|
597
|
+
`),await e(a(o,"generated/auth-schema.ts"),`// This file is generated by better-auth CLI.
|
|
602
598
|
// Run: npx @better-auth/cli generate --config auth.config.ts -y
|
|
603
599
|
export {}
|
|
604
|
-
`),await e(o
|
|
600
|
+
`),await e(a(o,"scripts/generate-schema.ts"),`/**
|
|
605
601
|
* Generate Drizzle schemas from entity definitions
|
|
606
602
|
*/
|
|
607
603
|
|
|
@@ -648,7 +644,7 @@ async function generateSchemas() {
|
|
|
648
644
|
}
|
|
649
645
|
|
|
650
646
|
generateSchemas().catch(console.error)
|
|
651
|
-
`),await e(o
|
|
647
|
+
`),await e(a(o,"scripts/migrate.ts"),`/**
|
|
652
648
|
* Run pending migrations
|
|
653
649
|
*/
|
|
654
650
|
|
|
@@ -674,7 +670,7 @@ async function migrate() {
|
|
|
674
670
|
}
|
|
675
671
|
|
|
676
672
|
migrate()
|
|
677
|
-
`),await e(o
|
|
673
|
+
`),await e(a(o,"scripts/reset-db.ts"),`/**
|
|
678
674
|
* Reset database (DROP all tables)
|
|
679
675
|
* WARNING: Only for development
|
|
680
676
|
*/
|
|
@@ -707,11 +703,11 @@ async function resetDb() {
|
|
|
707
703
|
}
|
|
708
704
|
|
|
709
705
|
resetDb().catch(console.error)
|
|
710
|
-
`)}async function
|
|
706
|
+
`)}async function D(t,n){let{name:r}=n,o=a(t,"apps/admin");await C(a(t,"apps"),{recursive:!0}),u(`pnpm create next-app@${"16"} ${o} --typescript --tailwind --no-eslint --app --no-src-dir --turbopack --react-compiler --skip-install --import-alias "@/*"`),await d(o,["app/page.tsx","app/page.module.css","app/fonts","README.md","pnpm-workspace.yaml"]),await p(a(o,"package.json"),{dependencies:{[`@${r}/config`]:"workspace:*","@murumets-ee/auth-ui":`^${i.myorgAuthUi}`,"better-auth":`^${i.betterAuth}`,"next-intl":`^${i.nextIntl}`,"next-themes":`^${i.nextThemes}`,"lucide-react":`^${i.lucideReact}`,"react-hook-form":`^${i.reactHookForm}`,"@hookform/resolvers":`^${i.hookformResolvers}`,zod:`^${i.zod}`},devDependencies:{"babel-plugin-react-compiler":i.babelReactCompiler}});let{appendToFile:l}=await import("./utils-VX57GKZX.js");await l(a(o,".gitignore"),`
|
|
711
707
|
# Environment
|
|
712
708
|
.env*
|
|
713
709
|
!.env.example
|
|
714
|
-
`),await e(o
|
|
710
|
+
`),await e(a(o,"next.config.ts"),`import type { NextConfig } from 'next'
|
|
715
711
|
import createNextIntlPlugin from 'next-intl/plugin'
|
|
716
712
|
|
|
717
713
|
const withNextIntl = createNextIntlPlugin('./i18n/request.ts')
|
|
@@ -735,7 +731,7 @@ const nextConfig: NextConfig = {
|
|
|
735
731
|
}
|
|
736
732
|
|
|
737
733
|
export default withNextIntl(nextConfig)
|
|
738
|
-
`),await e(o
|
|
734
|
+
`),await e(a(o,"proxy.ts"),`import { NextRequest, NextResponse } from 'next/server'
|
|
739
735
|
import createMiddleware from 'next-intl/middleware'
|
|
740
736
|
import { routing } from './i18n/routing'
|
|
741
737
|
|
|
@@ -763,13 +759,13 @@ export function proxy(request: NextRequest) {
|
|
|
763
759
|
export const config = {
|
|
764
760
|
matcher: '/((?!api|_next|_vercel|.*\\\\..*).*)',
|
|
765
761
|
}
|
|
766
|
-
`),await e(o
|
|
762
|
+
`),await e(a(o,"i18n/routing.ts"),`import { defineRouting } from 'next-intl/routing'
|
|
767
763
|
|
|
768
764
|
export const routing = defineRouting({
|
|
769
765
|
locales: ['en'],
|
|
770
766
|
defaultLocale: 'en',
|
|
771
767
|
})
|
|
772
|
-
`),await e(o
|
|
768
|
+
`),await e(a(o,"i18n/request.ts"),`import { getRequestConfig } from 'next-intl/server'
|
|
773
769
|
import { hasLocale } from 'next-intl'
|
|
774
770
|
import { routing } from './routing'
|
|
775
771
|
import { getAuthMessages } from '@murumets-ee/auth-ui/i18n'
|
|
@@ -789,7 +785,7 @@ export default getRequestConfig(async ({ requestLocale }) => {
|
|
|
789
785
|
},
|
|
790
786
|
}
|
|
791
787
|
})
|
|
792
|
-
`),await e(o
|
|
788
|
+
`),await e(a(o,"app/globals.css"),`@import "tailwindcss";
|
|
793
789
|
@source "../node_modules/@murumets-ee/auth-ui/dist";
|
|
794
790
|
|
|
795
791
|
@custom-variant dark (&:where(.dark, .dark *));
|
|
@@ -816,7 +812,7 @@ body {
|
|
|
816
812
|
color: var(--foreground);
|
|
817
813
|
font-family: Arial, Helvetica, sans-serif;
|
|
818
814
|
}
|
|
819
|
-
`),await e(o
|
|
815
|
+
`),await e(a(o,"app/theme-provider.tsx"),`'use client'
|
|
820
816
|
|
|
821
817
|
import { ThemeProvider as NextThemesProvider } from 'next-themes'
|
|
822
818
|
import type { ReactNode } from 'react'
|
|
@@ -833,7 +829,7 @@ export function ThemeProvider({ children }: { children: ReactNode }) {
|
|
|
833
829
|
</NextThemesProvider>
|
|
834
830
|
)
|
|
835
831
|
}
|
|
836
|
-
`),await e(o
|
|
832
|
+
`),await e(a(o,"app/theme-toggle.tsx"),`'use client'
|
|
837
833
|
|
|
838
834
|
import { useTheme } from 'next-themes'
|
|
839
835
|
import { useState, useEffect } from 'react'
|
|
@@ -860,7 +856,7 @@ export function ThemeToggle() {
|
|
|
860
856
|
</button>
|
|
861
857
|
)
|
|
862
858
|
}
|
|
863
|
-
`),await e(o
|
|
859
|
+
`),await e(a(o,"app/nav-header.tsx"),`'use client'
|
|
864
860
|
|
|
865
861
|
import Link from 'next/link'
|
|
866
862
|
import { usePathname } from 'next/navigation'
|
|
@@ -904,12 +900,12 @@ export function NavHeader() {
|
|
|
904
900
|
</header>
|
|
905
901
|
)
|
|
906
902
|
}
|
|
907
|
-
`),await e(o
|
|
903
|
+
`),await e(a(o,"app/layout.tsx"),`import './globals.css'
|
|
908
904
|
|
|
909
905
|
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
|
910
906
|
return children
|
|
911
907
|
}
|
|
912
|
-
`),await e(o
|
|
908
|
+
`),await e(a(o,"app/[locale]/layout.tsx"),`import type { Metadata } from 'next'
|
|
913
909
|
import { Geist, Geist_Mono } from 'next/font/google'
|
|
914
910
|
import { NextIntlClientProvider } from 'next-intl'
|
|
915
911
|
import { getMessages } from 'next-intl/server'
|
|
@@ -958,7 +954,7 @@ export default async function LocaleLayout({
|
|
|
958
954
|
</html>
|
|
959
955
|
)
|
|
960
956
|
}
|
|
961
|
-
`),await e(o
|
|
957
|
+
`),await e(a(o,"app/[locale]/page.tsx"),`import { createQueryClient } from '@murumets-ee/core/clients'
|
|
962
958
|
import { Article, Category } from '@${r}/config/entities'
|
|
963
959
|
import { getToolkitApp } from '@${r}/config/app'
|
|
964
960
|
|
|
@@ -1022,11 +1018,11 @@ export default async function HomePage() {
|
|
|
1022
1018
|
</div>
|
|
1023
1019
|
)
|
|
1024
1020
|
}
|
|
1025
|
-
`),await e(o
|
|
1021
|
+
`),await e(a(o,"app/api/auth/[...all]/route.ts"),`import { toNextJsHandler } from 'better-auth/next-js'
|
|
1026
1022
|
import { auth } from '@${r}/config/auth'
|
|
1027
1023
|
|
|
1028
1024
|
export const { GET, POST } = toNextJsHandler(auth)
|
|
1029
|
-
`),await e(o
|
|
1025
|
+
`),await e(a(o,"app/[locale]/auth/layout.tsx"),`import { AuthProviders } from './providers'
|
|
1030
1026
|
import type { ReactNode } from 'react'
|
|
1031
1027
|
|
|
1032
1028
|
export default function AuthLayout({ children }: { children: ReactNode }) {
|
|
@@ -1038,7 +1034,7 @@ export default function AuthLayout({ children }: { children: ReactNode }) {
|
|
|
1038
1034
|
</AuthProviders>
|
|
1039
1035
|
)
|
|
1040
1036
|
}
|
|
1041
|
-
`),await e(o
|
|
1037
|
+
`),await e(a(o,"app/[locale]/auth/providers.tsx"),`'use client'
|
|
1042
1038
|
|
|
1043
1039
|
import { AuthUIProvider } from '@murumets-ee/auth-ui'
|
|
1044
1040
|
import { authClient } from '@${r}/config/auth-client'
|
|
@@ -1064,22 +1060,22 @@ export function AuthProviders({ children }: { children: ReactNode }) {
|
|
|
1064
1060
|
</AuthUIProvider>
|
|
1065
1061
|
)
|
|
1066
1062
|
}
|
|
1067
|
-
`),await e(o
|
|
1063
|
+
`),await e(a(o,"app/[locale]/auth/sign-in/page.tsx"),`import { SignInForm } from '@murumets-ee/auth-ui'
|
|
1068
1064
|
|
|
1069
1065
|
export default function SignInPage() {
|
|
1070
1066
|
return <SignInForm />
|
|
1071
1067
|
}
|
|
1072
|
-
`),await e(o
|
|
1068
|
+
`),await e(a(o,"app/[locale]/auth/sign-up/page.tsx"),`import { SignUpForm } from '@murumets-ee/auth-ui'
|
|
1073
1069
|
|
|
1074
1070
|
export default function SignUpPage() {
|
|
1075
1071
|
return <SignUpForm />
|
|
1076
1072
|
}
|
|
1077
|
-
`),await e(o
|
|
1073
|
+
`),await e(a(o,"app/[locale]/auth/forgot-password/page.tsx"),`import { ForgotPasswordForm } from '@murumets-ee/auth-ui'
|
|
1078
1074
|
|
|
1079
1075
|
export default function ForgotPasswordPage() {
|
|
1080
1076
|
return <ForgotPasswordForm />
|
|
1081
1077
|
}
|
|
1082
|
-
`),await e(o
|
|
1078
|
+
`),await e(a(o,"app/[locale]/auth/reset-password/page.tsx"),`import { Suspense } from 'react'
|
|
1083
1079
|
import { ResetPasswordContent } from './content'
|
|
1084
1080
|
|
|
1085
1081
|
export default function ResetPasswordPage() {
|
|
@@ -1089,7 +1085,7 @@ export default function ResetPasswordPage() {
|
|
|
1089
1085
|
</Suspense>
|
|
1090
1086
|
)
|
|
1091
1087
|
}
|
|
1092
|
-
`),await e(o
|
|
1088
|
+
`),await e(a(o,"app/[locale]/auth/reset-password/content.tsx"),`'use client'
|
|
1093
1089
|
|
|
1094
1090
|
import { useSearchParams } from 'next/navigation'
|
|
1095
1091
|
import { ResetPasswordForm } from '@murumets-ee/auth-ui'
|
|
@@ -1113,7 +1109,7 @@ export function ResetPasswordContent() {
|
|
|
1113
1109
|
|
|
1114
1110
|
return <ResetPasswordForm token={token} />
|
|
1115
1111
|
}
|
|
1116
|
-
`),await e(o
|
|
1112
|
+
`),await e(a(o,"app/[locale]/setup/page.tsx"),`import { redirect } from 'next/navigation'
|
|
1117
1113
|
import { sql } from 'drizzle-orm'
|
|
1118
1114
|
import { getToolkitApp } from '@${r}/config/app'
|
|
1119
1115
|
import { SetupForm } from './form'
|
|
@@ -1138,7 +1134,7 @@ export default async function SetupPage() {
|
|
|
1138
1134
|
</div>
|
|
1139
1135
|
)
|
|
1140
1136
|
}
|
|
1141
|
-
`),await e(o
|
|
1137
|
+
`),await e(a(o,"app/[locale]/setup/form.tsx"),`'use client'
|
|
1142
1138
|
|
|
1143
1139
|
import { useState } from 'react'
|
|
1144
1140
|
import { createFirstAdmin } from './actions'
|
|
@@ -1209,7 +1205,7 @@ export function SetupForm() {
|
|
|
1209
1205
|
</form>
|
|
1210
1206
|
)
|
|
1211
1207
|
}
|
|
1212
|
-
`),await e(o
|
|
1208
|
+
`),await e(a(o,"app/[locale]/setup/actions.ts"),`'use server'
|
|
1213
1209
|
|
|
1214
1210
|
import { sql } from 'drizzle-orm'
|
|
1215
1211
|
import { getToolkitApp } from '@${r}/config/app'
|
|
@@ -1255,11 +1251,11 @@ export async function createFirstAdmin(formData: FormData) {
|
|
|
1255
1251
|
|
|
1256
1252
|
return { ok: true, email: adminUser.user.email }
|
|
1257
1253
|
}
|
|
1258
|
-
`)}async function
|
|
1254
|
+
`)}async function F(t,n){let{name:r}=n,o=a(t,"apps/web");u(`pnpm create next-app@${"16"} ${o} --typescript --tailwind --no-eslint --app --no-src-dir --turbopack --react-compiler --skip-install --import-alias "@/*"`),await d(o,["app/page.tsx","app/page.module.css","app/fonts","README.md","pnpm-workspace.yaml"]),await p(a(o,"package.json"),{dependencies:{[`@${r}/config`]:"workspace:*","@murumets-ee/core":`^${i.myorgCore}`,"@murumets-ee/auth-ui":`^${i.myorgAuthUi}`,"next-intl":`^${i.nextIntl}`,"next-themes":`^${i.nextThemes}`,"lucide-react":`^${i.lucideReact}`},devDependencies:{"babel-plugin-react-compiler":i.babelReactCompiler}});let{appendToFile:l}=await import("./utils-VX57GKZX.js");await l(a(o,".gitignore"),`
|
|
1259
1255
|
# Environment
|
|
1260
1256
|
.env*
|
|
1261
1257
|
!.env.example
|
|
1262
|
-
`),await e(o
|
|
1258
|
+
`),await e(a(o,"next.config.ts"),`import type { NextConfig } from 'next'
|
|
1263
1259
|
import createNextIntlPlugin from 'next-intl/plugin'
|
|
1264
1260
|
|
|
1265
1261
|
const withNextIntl = createNextIntlPlugin('./i18n/request.ts')
|
|
@@ -1278,7 +1274,7 @@ const nextConfig: NextConfig = {
|
|
|
1278
1274
|
}
|
|
1279
1275
|
|
|
1280
1276
|
export default withNextIntl(nextConfig)
|
|
1281
|
-
`),await e(o
|
|
1277
|
+
`),await e(a(o,"proxy.ts"),`import createMiddleware from 'next-intl/middleware'
|
|
1282
1278
|
import { routing } from './i18n/routing'
|
|
1283
1279
|
|
|
1284
1280
|
export default createMiddleware(routing)
|
|
@@ -1286,13 +1282,13 @@ export default createMiddleware(routing)
|
|
|
1286
1282
|
export const config = {
|
|
1287
1283
|
matcher: '/((?!api|_next|_vercel|.*\\\\..*).*)',
|
|
1288
1284
|
}
|
|
1289
|
-
`),await e(o
|
|
1285
|
+
`),await e(a(o,"i18n/routing.ts"),`import { defineRouting } from 'next-intl/routing'
|
|
1290
1286
|
|
|
1291
1287
|
export const routing = defineRouting({
|
|
1292
1288
|
locales: ['en'],
|
|
1293
1289
|
defaultLocale: 'en',
|
|
1294
1290
|
})
|
|
1295
|
-
`),await e(o
|
|
1291
|
+
`),await e(a(o,"i18n/request.ts"),`import { getRequestConfig } from 'next-intl/server'
|
|
1296
1292
|
import { hasLocale } from 'next-intl'
|
|
1297
1293
|
import { routing } from './routing'
|
|
1298
1294
|
import { getAuthMessages } from '@murumets-ee/auth-ui/i18n'
|
|
@@ -1312,7 +1308,7 @@ export default getRequestConfig(async ({ requestLocale }) => {
|
|
|
1312
1308
|
},
|
|
1313
1309
|
}
|
|
1314
1310
|
})
|
|
1315
|
-
`),await e(o
|
|
1311
|
+
`),await e(a(o,"app/globals.css"),`@import "tailwindcss";
|
|
1316
1312
|
@source "../node_modules/@murumets-ee/auth-ui/dist";
|
|
1317
1313
|
|
|
1318
1314
|
@custom-variant dark (&:where(.dark, .dark *));
|
|
@@ -1339,7 +1335,7 @@ body {
|
|
|
1339
1335
|
color: var(--foreground);
|
|
1340
1336
|
font-family: Arial, Helvetica, sans-serif;
|
|
1341
1337
|
}
|
|
1342
|
-
`),await e(o
|
|
1338
|
+
`),await e(a(o,"app/theme-provider.tsx"),`'use client'
|
|
1343
1339
|
|
|
1344
1340
|
import { ThemeProvider as NextThemesProvider } from 'next-themes'
|
|
1345
1341
|
import type { ReactNode } from 'react'
|
|
@@ -1356,7 +1352,7 @@ export function ThemeProvider({ children }: { children: ReactNode }) {
|
|
|
1356
1352
|
</NextThemesProvider>
|
|
1357
1353
|
)
|
|
1358
1354
|
}
|
|
1359
|
-
`),await e(o
|
|
1355
|
+
`),await e(a(o,"app/theme-toggle.tsx"),`'use client'
|
|
1360
1356
|
|
|
1361
1357
|
import { useTheme } from 'next-themes'
|
|
1362
1358
|
import { useState, useEffect } from 'react'
|
|
@@ -1383,7 +1379,7 @@ export function ThemeToggle() {
|
|
|
1383
1379
|
</button>
|
|
1384
1380
|
)
|
|
1385
1381
|
}
|
|
1386
|
-
`),await e(o
|
|
1382
|
+
`),await e(a(o,"app/nav-header.tsx"),`'use client'
|
|
1387
1383
|
|
|
1388
1384
|
import Link from 'next/link'
|
|
1389
1385
|
import { usePathname } from 'next/navigation'
|
|
@@ -1425,12 +1421,12 @@ export function NavHeader() {
|
|
|
1425
1421
|
</header>
|
|
1426
1422
|
)
|
|
1427
1423
|
}
|
|
1428
|
-
`),await e(o
|
|
1424
|
+
`),await e(a(o,"app/layout.tsx"),`import './globals.css'
|
|
1429
1425
|
|
|
1430
1426
|
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
|
1431
1427
|
return children
|
|
1432
1428
|
}
|
|
1433
|
-
`),await e(o
|
|
1429
|
+
`),await e(a(o,"app/[locale]/layout.tsx"),`import type { Metadata } from 'next'
|
|
1434
1430
|
import { Geist, Geist_Mono } from 'next/font/google'
|
|
1435
1431
|
import { NextIntlClientProvider } from 'next-intl'
|
|
1436
1432
|
import { getMessages } from 'next-intl/server'
|
|
@@ -1479,7 +1475,7 @@ export default async function LocaleLayout({
|
|
|
1479
1475
|
</html>
|
|
1480
1476
|
)
|
|
1481
1477
|
}
|
|
1482
|
-
`),await e(o
|
|
1478
|
+
`),await e(a(o,"app/[locale]/page.tsx"),`import { createQueryClient } from '@murumets-ee/core/clients'
|
|
1483
1479
|
import { Article, Category } from '@${r}/config/entities'
|
|
1484
1480
|
import { getToolkitApp } from '@${r}/config/app'
|
|
1485
1481
|
|
|
@@ -1549,9 +1545,17 @@ import createNextIntlPlugin from 'next-intl/plugin'
|
|
|
1549
1545
|
const withNextIntl = createNextIntlPlugin('./i18n/request.ts')
|
|
1550
1546
|
|
|
1551
1547
|
const nextConfig: NextConfig = {
|
|
1548
|
+
output: 'standalone',
|
|
1552
1549
|
reactCompiler: true,
|
|
1553
|
-
transpilePackages: [
|
|
1554
|
-
|
|
1550
|
+
transpilePackages: [
|
|
1551
|
+
'@murumets-ee/core', '@murumets-ee/entity', '@murumets-ee/db',
|
|
1552
|
+
'@murumets-ee/logging', '@murumets-ee/auth', '@murumets-ee/auth-ui',
|
|
1553
|
+
'@murumets-ee/admin-ui', '@murumets-ee/content', '@murumets-ee/settings',
|
|
1554
|
+
'@murumets-ee/storage', '@murumets-ee/media', '@murumets-ee/taxonomy',
|
|
1555
|
+
'@murumets-ee/queue', '@murumets-ee/mail', '@murumets-ee/ticketing',
|
|
1556
|
+
'@murumets-ee/ticketing-ui', '@murumets-ee/tokens', '@murumets-ee/ui',
|
|
1557
|
+
],
|
|
1558
|
+
serverExternalPackages: ['drizzle-orm', 'postgres', 'pino', 'file-type'],
|
|
1555
1559
|
experimental: {
|
|
1556
1560
|
serverActions: {
|
|
1557
1561
|
bodySizeLimit: '2mb',
|
|
@@ -1709,7 +1713,7 @@ export default async function HomePage() {
|
|
|
1709
1713
|
</div>
|
|
1710
1714
|
)
|
|
1711
1715
|
}
|
|
1712
|
-
`)}import{join as
|
|
1716
|
+
`)}import{join as w}from"path";async function _(t,n){await e(w(t,"scripts/generate-schema.ts"),`/**
|
|
1713
1717
|
* Generate Drizzle schemas from entity definitions
|
|
1714
1718
|
* This script reads entity definitions and outputs Drizzle schema files
|
|
1715
1719
|
*/
|
|
@@ -1760,7 +1764,7 @@ async function generateSchemas() {
|
|
|
1760
1764
|
}
|
|
1761
1765
|
|
|
1762
1766
|
generateSchemas().catch(console.error)
|
|
1763
|
-
`),await e(
|
|
1767
|
+
`),await e(w(t,"scripts/migrate.ts"),`/**
|
|
1764
1768
|
* Run pending migrations
|
|
1765
1769
|
* Applies both toolkit migrations (.toolkit/) and project migrations
|
|
1766
1770
|
*/
|
|
@@ -1787,7 +1791,7 @@ async function migrate() {
|
|
|
1787
1791
|
}
|
|
1788
1792
|
|
|
1789
1793
|
migrate()
|
|
1790
|
-
`),await e(
|
|
1794
|
+
`),await e(w(t,"scripts/reset-db.ts"),`/**
|
|
1791
1795
|
* Reset database (DROP all tables)
|
|
1792
1796
|
* WARNING: Only for development
|
|
1793
1797
|
*/
|
|
@@ -1821,7 +1825,7 @@ async function resetDb() {
|
|
|
1821
1825
|
}
|
|
1822
1826
|
|
|
1823
1827
|
resetDb().catch(console.error)
|
|
1824
|
-
`)}import{join as
|
|
1828
|
+
`)}import{join as x}from"path";async function $(t,n){let{name:r}=n;await e(x(t,"app/globals.css"),`@import "tailwindcss";
|
|
1825
1829
|
@source "../node_modules/@murumets-ee/auth-ui/dist";
|
|
1826
1830
|
|
|
1827
1831
|
@custom-variant dark (&:where(.dark, .dark *));
|
|
@@ -1848,7 +1852,7 @@ body {
|
|
|
1848
1852
|
color: var(--foreground);
|
|
1849
1853
|
font-family: Arial, Helvetica, sans-serif;
|
|
1850
1854
|
}
|
|
1851
|
-
`),await e(
|
|
1855
|
+
`),await e(x(t,"app/theme-provider.tsx"),`'use client'
|
|
1852
1856
|
|
|
1853
1857
|
import { ThemeProvider as NextThemesProvider } from 'next-themes'
|
|
1854
1858
|
import type { ReactNode } from 'react'
|
|
@@ -1865,7 +1869,7 @@ export function ThemeProvider({ children }: { children: ReactNode }) {
|
|
|
1865
1869
|
</NextThemesProvider>
|
|
1866
1870
|
)
|
|
1867
1871
|
}
|
|
1868
|
-
`),await e(
|
|
1872
|
+
`),await e(x(t,"app/theme-toggle.tsx"),`'use client'
|
|
1869
1873
|
|
|
1870
1874
|
import { useTheme } from 'next-themes'
|
|
1871
1875
|
import { useState, useEffect } from 'react'
|
|
@@ -1892,7 +1896,7 @@ export function ThemeToggle() {
|
|
|
1892
1896
|
</button>
|
|
1893
1897
|
)
|
|
1894
1898
|
}
|
|
1895
|
-
`),await e(
|
|
1899
|
+
`),await e(x(t,"app/nav-header.tsx"),`'use client'
|
|
1896
1900
|
|
|
1897
1901
|
import Link from 'next/link'
|
|
1898
1902
|
import { usePathname } from 'next/navigation'
|
|
@@ -2037,5 +2041,5 @@ export const auth = betterAuth({
|
|
|
2037
2041
|
`),await e(f(t,"generated/auth-schema.ts"),`// This file is generated by better-auth CLI.
|
|
2038
2042
|
// Run: npx @better-auth/cli generate --config auth.config.ts -y
|
|
2039
2043
|
export {}
|
|
2040
|
-
`)}async function q(t,n){t.mode==="single"?await B(t,n):await H(t,n)}async function B(t,n){let r=k(process.cwd(),t.name);n?.("Creating Next.js app..."),
|
|
2041
|
-
`),"Next steps"),c.outro(`${
|
|
2044
|
+
`)}async function q(t,n){t.mode==="single"?await B(t,n):await H(t,n)}async function B(t,n){let r=k(process.cwd(),t.name);n?.("Creating Next.js app..."),u(`pnpm create next-app@${"16"} ${t.name} --typescript --tailwind --no-eslint --app --no-src-dir --turbopack --react-compiler --skip-install --import-alias "@/*"`),await d(r,["app/page.tsx","app/page.module.css","app/fonts","README.md"]),await p(k(r,"package.json"),{type:"module",dependencies:{"@murumets-ee/core":`^${i.myorgCore}`,"@murumets-ee/db":`^${i.myorgDb}`,"@murumets-ee/entity":`^${i.myorgEntity}`,"@murumets-ee/logging":`^${i.myorgLogging}`,"@murumets-ee/auth":`^${i.myorgAuth}`,"@murumets-ee/auth-ui":`^${i.myorgAuthUi}`,"@murumets-ee/admin-ui":`^${i.myorgAdminUi}`,"@murumets-ee/content":`^${i.myorgContent}`,"@murumets-ee/settings":`^${i.myorgSettings}`,"@murumets-ee/storage":`^${i.myorgStorage}`,"@murumets-ee/media":`^${i.myorgMedia}`,"@murumets-ee/taxonomy":`^${i.myorgTaxonomy}`,"@murumets-ee/queue":`^${i.myorgQueue}`,"@murumets-ee/mail":`^${i.myorgMail}`,"@murumets-ee/ticketing":`^${i.myorgTicketing}`,"@murumets-ee/ticketing-ui":`^${i.myorgTicketingUi}`,"@murumets-ee/tokens":`^${i.myorgTokens}`,"better-auth":`^${i.betterAuth}`,"drizzle-orm":`^${i.drizzleOrm}`,"next-intl":`^${i.nextIntl}`,"next-themes":`^${i.nextThemes}`,"lucide-react":`^${i.lucideReact}`,postgres:`^${i.postgres}`,"react-hook-form":`^${i.reactHookForm}`,"@hookform/resolvers":`^${i.hookformResolvers}`,zod:`^${i.zod}`},devDependencies:{"drizzle-kit":`^${i.drizzleKit}`,tsx:`^${i.tsx}`,"babel-plugin-react-compiler":i.babelReactCompiler},scripts:{"db:generate":"tsx --env-file=.env scripts/generate-schema.ts","db:migrate:generate":"drizzle-kit generate","db:migrate":"tsx --env-file=.env scripts/migrate.ts","db:reset":"tsx --env-file=.env scripts/reset-db.ts"}}),n?.("Adding toolkit files..."),await z(r,t),await S(r,t),await M(r,t),await N(r,t),await P(r,t),await L(r,t),await $(r,t),await _(r,t),t.installDeps&&(n?.("Installing dependencies..."),u("pnpm install",{cwd:r}))}async function H(t,n){let r=k(process.cwd(),t.name);n?.("Creating workspace..."),await R(r,t,n),t.installDeps&&(n?.("Installing dependencies..."),u("pnpm install",{cwd:r}))}async function j(){let t=process.argv[2],n=await T(t);if(!n)return;let r=c.spinner();try{r.start("Creating Next.js app..."),await q(n,O=>{r.stop(`${b.green("\u2713")} Done`),r.start(O)}),r.stop(`${b.green("\u2713")} Done`);let l=n.mode==="multi"?[`cd ${n.name}`,"docker compose up -d","cp .env.example .env","npx @better-auth/cli generate --config packages/config/auth.config.ts -y","pnpm db:generate","pnpm db:migrate:generate","pnpm db:migrate","pnpm dev","# Visit /setup to create your first admin user"]:[`cd ${n.name}`,"docker compose up -d","cp .env.example .env","npx @better-auth/cli generate --config auth.config.ts -y","pnpm db:generate","pnpm db:migrate:generate","pnpm db:migrate","pnpm dev","# Visit /setup to create your first admin user"];c.note(l.join(`
|
|
2045
|
+
`),"Next steps"),c.outro(`${b.green("Success!")} Your project is ready.`)}catch(o){r.stop(b.red("Failed.")),c.log.error(o instanceof Error?o.message:String(o)),process.exit(1)}}j();
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,b as
|
|
1
|
+
import{a as e,b as l,c,d as m,e as y}from"./chunk-CUB6XFPE.js";import{join as v}from"path";import{join as s}from"path";async function w(t,n){await e(s(t,"lib/auth.ts"),`import { getToolkitApp } from './app'
|
|
2
2
|
import { getAuth } from '@murumets-ee/auth'
|
|
3
3
|
|
|
4
4
|
await getToolkitApp()
|
|
@@ -248,7 +248,7 @@ export async function createFirstAdmin(formData: FormData) {
|
|
|
248
248
|
|
|
249
249
|
return { ok: true, email: adminUser.user.email }
|
|
250
250
|
}
|
|
251
|
-
`)}import{join as
|
|
251
|
+
`)}import{join as h}from"path";async function k(t,n){let{name:r}=n;await e(h(t,".env.example"),`DATABASE_URL=postgresql://${r}:${r}_dev_password@localhost:5432/${r}_dev
|
|
252
252
|
BETTER_AUTH_SECRET=dev-secret-change-me-in-production-min-32-chars
|
|
253
253
|
BETTER_AUTH_URL=http://localhost:3000
|
|
254
254
|
LOG_LEVEL=debug
|
|
@@ -258,16 +258,14 @@ RESEND_API_KEY=
|
|
|
258
258
|
RESEND_WEBHOOK_SECRET=
|
|
259
259
|
MAIL_FROM=noreply@example.com
|
|
260
260
|
CSAT_SECRET=
|
|
261
|
-
`),await
|
|
262
|
-
//npm.pkg.github.com/:_authToken=\${GITHUB_TOKEN}
|
|
263
|
-
`),await w(d(t,".gitignore"),`
|
|
261
|
+
`),await y(h(t,".gitignore"),`
|
|
264
262
|
# Toolkit generated files
|
|
265
263
|
generated/
|
|
266
264
|
|
|
267
265
|
# Environment
|
|
268
266
|
.env*
|
|
269
267
|
!.env.example
|
|
270
|
-
`),await e(
|
|
268
|
+
`),await e(h(t,"docker-compose.yml"),`services:
|
|
271
269
|
postgres:
|
|
272
270
|
image: postgres:17-alpine
|
|
273
271
|
container_name: ${r}-postgres
|
|
@@ -365,15 +363,15 @@ export default getRequestConfig(async ({ requestLocale }) => {
|
|
|
365
363
|
},
|
|
366
364
|
}
|
|
367
365
|
})
|
|
368
|
-
`)}import{mkdir as z}from"fs/promises";import{join as
|
|
366
|
+
`)}import{mkdir as z}from"fs/promises";import{join as o}from"path";var i={myorgCore:"0.1.0",myorgDb:"0.1.0",myorgEntity:"0.1.0",myorgLogging:"0.1.0",myorgAuth:"0.1.0",myorgAuthUi:"0.1.0",myorgAdminUi:"0.1.0",myorgContent:"0.1.0",myorgContentApi:"0.1.0",myorgSettings:"0.1.0",myorgStorage:"0.1.0",myorgMedia:"0.1.0",myorgTaxonomy:"0.1.0",myorgQueue:"0.1.0",myorgMail:"0.1.0",myorgTicketing:"0.1.0",myorgTicketingUi:"0.1.0",myorgEditor:"0.1.0",myorgBlocks:"0.1.0",myorgTokens:"0.1.0",myorgUi:"0.1.0",myorgCli:"0.1.0",betterAuth:"1.4.0",drizzleOrm:"0.45.1",nextIntl:"4.8.2",nextThemes:"0.4.6",lucideReact:"0.563.0",postgres:"3.4.5",reactHookForm:"7.71.1",hookformResolvers:"5.2.2",zod:"3.24.1",drizzleKit:"0.27.2",tsx:"4.19.2",babelReactCompiler:"1.0.0"};async function S(t,n,r){await L(t,n),r?.("Workspace root created"),r?.("Creating admin app..."),await $(t,n),r?.("Admin app created"),r?.("Creating web app..."),await M(t,n),r?.("Web app created"),await _(t,n),r?.("Shared config package created")}async function L(t,n){let{name:r}=n;await z(t,{recursive:!0}),await e(o(t,"pnpm-workspace.yaml"),`packages:
|
|
369
367
|
- 'packages/*'
|
|
370
368
|
- 'apps/*'
|
|
371
369
|
|
|
372
370
|
ignoredBuiltDependencies:
|
|
373
371
|
- sharp
|
|
374
372
|
- unrs-resolver
|
|
375
|
-
`),await e(
|
|
376
|
-
`),await e(
|
|
373
|
+
`),await e(o(t,"package.json"),`${JSON.stringify({name:`@${r}/monorepo`,version:"0.0.0",private:!0,type:"module",scripts:{dev:"turbo dev",build:"turbo build","db:generate":"tsx --env-file=.env packages/config/scripts/generate-schema.ts","db:migrate:generate":"drizzle-kit generate --config packages/config/drizzle.config.ts","db:migrate":"tsx --env-file=.env packages/config/scripts/migrate.ts","db:reset":"tsx --env-file=.env packages/config/scripts/reset-db.ts"},devDependencies:{turbo:"^2.3.3",typescript:"^5.7.3",tsx:`^${i.tsx}`,"drizzle-kit":`^${i.drizzleKit}`}},null,2)}
|
|
374
|
+
`),await e(o(t,".gitignore"),`# dependencies
|
|
377
375
|
node_modules/
|
|
378
376
|
|
|
379
377
|
# build
|
|
@@ -404,7 +402,7 @@ migrations/
|
|
|
404
402
|
|
|
405
403
|
# turbo
|
|
406
404
|
.turbo/
|
|
407
|
-
`),await e(
|
|
405
|
+
`),await e(o(t,".env.example"),`DATABASE_URL=postgresql://${r}:${r}_dev_password@localhost:5432/${r}_dev
|
|
408
406
|
BETTER_AUTH_SECRET=dev-secret-change-me-in-production-min-32-chars
|
|
409
407
|
BETTER_AUTH_URL=http://localhost:3000
|
|
410
408
|
LOG_LEVEL=debug
|
|
@@ -414,9 +412,7 @@ RESEND_API_KEY=
|
|
|
414
412
|
RESEND_WEBHOOK_SECRET=
|
|
415
413
|
MAIL_FROM=noreply@example.com
|
|
416
414
|
CSAT_SECRET=
|
|
417
|
-
`),await e(
|
|
418
|
-
//npm.pkg.github.com/:_authToken=\${GITHUB_TOKEN}
|
|
419
|
-
`),await e(a(t,"docker-compose.yml"),`services:
|
|
415
|
+
`),await e(o(t,"docker-compose.yml"),`services:
|
|
420
416
|
postgres:
|
|
421
417
|
image: postgres:17-alpine
|
|
422
418
|
container_name: ${r}-postgres
|
|
@@ -438,9 +434,9 @@ CSAT_SECRET=
|
|
|
438
434
|
volumes:
|
|
439
435
|
postgres_data:
|
|
440
436
|
name: ${r}_postgres_data
|
|
441
|
-
`)}async function _(t,n){let{name:r}=n,o
|
|
442
|
-
`),await e(a
|
|
443
|
-
`),await e(a
|
|
437
|
+
`)}async function _(t,n){let{name:r}=n,a=o(t,"packages/config");await e(o(a,"package.json"),`${JSON.stringify({name:`@${r}/config`,version:"0.1.0",private:!0,type:"module",exports:{".":"./toolkit.config.ts","./entities":"./entities/index.ts","./entities/*":"./entities/*","./app":"./lib/app.ts","./auth":"./lib/auth.ts","./auth-client":"./lib/auth-client.ts"},dependencies:{"@murumets-ee/core":`^${i.myorgCore}`,"@murumets-ee/db":`^${i.myorgDb}`,"@murumets-ee/entity":`^${i.myorgEntity}`,"@murumets-ee/logging":`^${i.myorgLogging}`,"@murumets-ee/auth":`^${i.myorgAuth}`,"better-auth":`^${i.betterAuth}`,"drizzle-orm":`^${i.drizzleOrm}`,postgres:`^${i.postgres}`,zod:`^${i.zod}`}},null,2)}
|
|
438
|
+
`),await e(o(a,"tsconfig.json"),`${JSON.stringify({compilerOptions:{target:"ES2022",module:"ESNext",moduleResolution:"Bundler",strict:!0,esModuleInterop:!0,skipLibCheck:!0,resolveJsonModule:!0},include:["**/*.ts"]},null,2)}
|
|
439
|
+
`),await e(o(a,"toolkit.config.ts"),`import { auth } from '@murumets-ee/auth/plugin'
|
|
444
440
|
import { content } from '@murumets-ee/content/plugin'
|
|
445
441
|
import { defineConfig } from '@murumets-ee/core'
|
|
446
442
|
import { mail, ResendMailProvider } from '@murumets-ee/mail'
|
|
@@ -492,7 +488,7 @@ export default defineConfig({
|
|
|
492
488
|
],
|
|
493
489
|
projectRoot: import.meta.dirname,
|
|
494
490
|
})
|
|
495
|
-
`),await e(a
|
|
491
|
+
`),await e(o(a,"auth.config.ts"),`import { betterAuth } from 'better-auth'
|
|
496
492
|
import { drizzleAdapter } from 'better-auth/adapters/drizzle'
|
|
497
493
|
import { admin } from 'better-auth/plugins'
|
|
498
494
|
import { organization } from 'better-auth/plugins/organization'
|
|
@@ -510,7 +506,7 @@ export const auth = betterAuth({
|
|
|
510
506
|
organization(),
|
|
511
507
|
],
|
|
512
508
|
})
|
|
513
|
-
`),await e(a
|
|
509
|
+
`),await e(o(a,"drizzle.config.ts"),`import type { Config } from 'drizzle-kit'
|
|
514
510
|
|
|
515
511
|
if (!process.env.DATABASE_URL) {
|
|
516
512
|
throw new Error('DATABASE_URL environment variable is required')
|
|
@@ -524,9 +520,9 @@ export default {
|
|
|
524
520
|
url: process.env.DATABASE_URL,
|
|
525
521
|
},
|
|
526
522
|
} satisfies Config
|
|
527
|
-
`),await e(a
|
|
523
|
+
`),await e(o(a,"entities/index.ts"),`export { Article } from './article'
|
|
528
524
|
export { Category } from './category'
|
|
529
|
-
`),await e(a
|
|
525
|
+
`),await e(o(a,"entities/article.ts"),`import { behavior, defineEntity, field } from '@murumets-ee/entity'
|
|
530
526
|
|
|
531
527
|
export const Article = defineEntity({
|
|
532
528
|
name: 'article',
|
|
@@ -557,7 +553,7 @@ export const Article = defineEntity({
|
|
|
557
553
|
delete: 'group.admin',
|
|
558
554
|
},
|
|
559
555
|
})
|
|
560
|
-
`),await e(a
|
|
556
|
+
`),await e(o(a,"entities/category.ts"),`import { defineEntity, field } from '@murumets-ee/entity'
|
|
561
557
|
|
|
562
558
|
export const Category = defineEntity({
|
|
563
559
|
name: 'category',
|
|
@@ -574,7 +570,7 @@ export const Category = defineEntity({
|
|
|
574
570
|
delete: 'group.admin',
|
|
575
571
|
},
|
|
576
572
|
})
|
|
577
|
-
`),await e(a
|
|
573
|
+
`),await e(o(a,"lib/app.ts"),`import { createApp, setApp, type ToolkitApp } from '@murumets-ee/core'
|
|
578
574
|
import config from '../toolkit.config'
|
|
579
575
|
|
|
580
576
|
let appInstance: ToolkitApp | null = null
|
|
@@ -588,19 +584,19 @@ export async function getToolkitApp(): Promise<ToolkitApp> {
|
|
|
588
584
|
}
|
|
589
585
|
return appInstance
|
|
590
586
|
}
|
|
591
|
-
`),await e(a
|
|
587
|
+
`),await e(o(a,"lib/auth.ts"),`import { getToolkitApp } from './app'
|
|
592
588
|
import { getAuth } from '@murumets-ee/auth'
|
|
593
589
|
|
|
594
590
|
await getToolkitApp()
|
|
595
591
|
|
|
596
592
|
export const auth = getAuth()
|
|
597
|
-
`),await e(a
|
|
593
|
+
`),await e(o(a,"lib/auth-client.ts"),`import { createClient } from '@murumets-ee/auth/client'
|
|
598
594
|
|
|
599
595
|
export const authClient = createClient()
|
|
600
|
-
`),await e(a
|
|
596
|
+
`),await e(o(a,"generated/auth-schema.ts"),`// This file is generated by better-auth CLI.
|
|
601
597
|
// Run: npx @better-auth/cli generate --config auth.config.ts -y
|
|
602
598
|
export {}
|
|
603
|
-
`),await e(a
|
|
599
|
+
`),await e(o(a,"scripts/generate-schema.ts"),`/**
|
|
604
600
|
* Generate Drizzle schemas from entity definitions
|
|
605
601
|
*/
|
|
606
602
|
|
|
@@ -647,7 +643,7 @@ async function generateSchemas() {
|
|
|
647
643
|
}
|
|
648
644
|
|
|
649
645
|
generateSchemas().catch(console.error)
|
|
650
|
-
`),await e(a
|
|
646
|
+
`),await e(o(a,"scripts/migrate.ts"),`/**
|
|
651
647
|
* Run pending migrations
|
|
652
648
|
*/
|
|
653
649
|
|
|
@@ -673,7 +669,7 @@ async function migrate() {
|
|
|
673
669
|
}
|
|
674
670
|
|
|
675
671
|
migrate()
|
|
676
|
-
`),await e(a
|
|
672
|
+
`),await e(o(a,"scripts/reset-db.ts"),`/**
|
|
677
673
|
* Reset database (DROP all tables)
|
|
678
674
|
* WARNING: Only for development
|
|
679
675
|
*/
|
|
@@ -706,11 +702,11 @@ async function resetDb() {
|
|
|
706
702
|
}
|
|
707
703
|
|
|
708
704
|
resetDb().catch(console.error)
|
|
709
|
-
`)}async function $(t,n){let{name:r}=n,o
|
|
705
|
+
`)}async function $(t,n){let{name:r}=n,a=o(t,"apps/admin");await z(o(t,"apps"),{recursive:!0}),m(`pnpm create next-app@${"16"} ${a} --typescript --tailwind --no-eslint --app --no-src-dir --turbopack --react-compiler --skip-install --import-alias "@/*"`),await c(a,["app/page.tsx","app/page.module.css","app/fonts","README.md","pnpm-workspace.yaml"]),await l(o(a,"package.json"),{dependencies:{[`@${r}/config`]:"workspace:*","@murumets-ee/auth-ui":`^${i.myorgAuthUi}`,"better-auth":`^${i.betterAuth}`,"next-intl":`^${i.nextIntl}`,"next-themes":`^${i.nextThemes}`,"lucide-react":`^${i.lucideReact}`,"react-hook-form":`^${i.reactHookForm}`,"@hookform/resolvers":`^${i.hookformResolvers}`,zod:`^${i.zod}`},devDependencies:{"babel-plugin-react-compiler":i.babelReactCompiler}});let{appendToFile:f}=await import("./utils-42K2ZGUL.js");await f(o(a,".gitignore"),`
|
|
710
706
|
# Environment
|
|
711
707
|
.env*
|
|
712
708
|
!.env.example
|
|
713
|
-
`),await e(a
|
|
709
|
+
`),await e(o(a,"next.config.ts"),`import type { NextConfig } from 'next'
|
|
714
710
|
import createNextIntlPlugin from 'next-intl/plugin'
|
|
715
711
|
|
|
716
712
|
const withNextIntl = createNextIntlPlugin('./i18n/request.ts')
|
|
@@ -734,7 +730,7 @@ const nextConfig: NextConfig = {
|
|
|
734
730
|
}
|
|
735
731
|
|
|
736
732
|
export default withNextIntl(nextConfig)
|
|
737
|
-
`),await e(a
|
|
733
|
+
`),await e(o(a,"proxy.ts"),`import { NextRequest, NextResponse } from 'next/server'
|
|
738
734
|
import createMiddleware from 'next-intl/middleware'
|
|
739
735
|
import { routing } from './i18n/routing'
|
|
740
736
|
|
|
@@ -762,13 +758,13 @@ export function proxy(request: NextRequest) {
|
|
|
762
758
|
export const config = {
|
|
763
759
|
matcher: '/((?!api|_next|_vercel|.*\\\\..*).*)',
|
|
764
760
|
}
|
|
765
|
-
`),await e(a
|
|
761
|
+
`),await e(o(a,"i18n/routing.ts"),`import { defineRouting } from 'next-intl/routing'
|
|
766
762
|
|
|
767
763
|
export const routing = defineRouting({
|
|
768
764
|
locales: ['en'],
|
|
769
765
|
defaultLocale: 'en',
|
|
770
766
|
})
|
|
771
|
-
`),await e(a
|
|
767
|
+
`),await e(o(a,"i18n/request.ts"),`import { getRequestConfig } from 'next-intl/server'
|
|
772
768
|
import { hasLocale } from 'next-intl'
|
|
773
769
|
import { routing } from './routing'
|
|
774
770
|
import { getAuthMessages } from '@murumets-ee/auth-ui/i18n'
|
|
@@ -788,7 +784,7 @@ export default getRequestConfig(async ({ requestLocale }) => {
|
|
|
788
784
|
},
|
|
789
785
|
}
|
|
790
786
|
})
|
|
791
|
-
`),await e(a
|
|
787
|
+
`),await e(o(a,"app/globals.css"),`@import "tailwindcss";
|
|
792
788
|
@source "../node_modules/@murumets-ee/auth-ui/dist";
|
|
793
789
|
|
|
794
790
|
@custom-variant dark (&:where(.dark, .dark *));
|
|
@@ -815,7 +811,7 @@ body {
|
|
|
815
811
|
color: var(--foreground);
|
|
816
812
|
font-family: Arial, Helvetica, sans-serif;
|
|
817
813
|
}
|
|
818
|
-
`),await e(a
|
|
814
|
+
`),await e(o(a,"app/theme-provider.tsx"),`'use client'
|
|
819
815
|
|
|
820
816
|
import { ThemeProvider as NextThemesProvider } from 'next-themes'
|
|
821
817
|
import type { ReactNode } from 'react'
|
|
@@ -832,7 +828,7 @@ export function ThemeProvider({ children }: { children: ReactNode }) {
|
|
|
832
828
|
</NextThemesProvider>
|
|
833
829
|
)
|
|
834
830
|
}
|
|
835
|
-
`),await e(a
|
|
831
|
+
`),await e(o(a,"app/theme-toggle.tsx"),`'use client'
|
|
836
832
|
|
|
837
833
|
import { useTheme } from 'next-themes'
|
|
838
834
|
import { useState, useEffect } from 'react'
|
|
@@ -859,7 +855,7 @@ export function ThemeToggle() {
|
|
|
859
855
|
</button>
|
|
860
856
|
)
|
|
861
857
|
}
|
|
862
|
-
`),await e(a
|
|
858
|
+
`),await e(o(a,"app/nav-header.tsx"),`'use client'
|
|
863
859
|
|
|
864
860
|
import Link from 'next/link'
|
|
865
861
|
import { usePathname } from 'next/navigation'
|
|
@@ -903,12 +899,12 @@ export function NavHeader() {
|
|
|
903
899
|
</header>
|
|
904
900
|
)
|
|
905
901
|
}
|
|
906
|
-
`),await e(a
|
|
902
|
+
`),await e(o(a,"app/layout.tsx"),`import './globals.css'
|
|
907
903
|
|
|
908
904
|
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
|
909
905
|
return children
|
|
910
906
|
}
|
|
911
|
-
`),await e(a
|
|
907
|
+
`),await e(o(a,"app/[locale]/layout.tsx"),`import type { Metadata } from 'next'
|
|
912
908
|
import { Geist, Geist_Mono } from 'next/font/google'
|
|
913
909
|
import { NextIntlClientProvider } from 'next-intl'
|
|
914
910
|
import { getMessages } from 'next-intl/server'
|
|
@@ -957,7 +953,7 @@ export default async function LocaleLayout({
|
|
|
957
953
|
</html>
|
|
958
954
|
)
|
|
959
955
|
}
|
|
960
|
-
`),await e(a
|
|
956
|
+
`),await e(o(a,"app/[locale]/page.tsx"),`import { createQueryClient } from '@murumets-ee/core/clients'
|
|
961
957
|
import { Article, Category } from '@${r}/config/entities'
|
|
962
958
|
import { getToolkitApp } from '@${r}/config/app'
|
|
963
959
|
|
|
@@ -1021,11 +1017,11 @@ export default async function HomePage() {
|
|
|
1021
1017
|
</div>
|
|
1022
1018
|
)
|
|
1023
1019
|
}
|
|
1024
|
-
`),await e(a
|
|
1020
|
+
`),await e(o(a,"app/api/auth/[...all]/route.ts"),`import { toNextJsHandler } from 'better-auth/next-js'
|
|
1025
1021
|
import { auth } from '@${r}/config/auth'
|
|
1026
1022
|
|
|
1027
1023
|
export const { GET, POST } = toNextJsHandler(auth)
|
|
1028
|
-
`),await e(a
|
|
1024
|
+
`),await e(o(a,"app/[locale]/auth/layout.tsx"),`import { AuthProviders } from './providers'
|
|
1029
1025
|
import type { ReactNode } from 'react'
|
|
1030
1026
|
|
|
1031
1027
|
export default function AuthLayout({ children }: { children: ReactNode }) {
|
|
@@ -1037,7 +1033,7 @@ export default function AuthLayout({ children }: { children: ReactNode }) {
|
|
|
1037
1033
|
</AuthProviders>
|
|
1038
1034
|
)
|
|
1039
1035
|
}
|
|
1040
|
-
`),await e(a
|
|
1036
|
+
`),await e(o(a,"app/[locale]/auth/providers.tsx"),`'use client'
|
|
1041
1037
|
|
|
1042
1038
|
import { AuthUIProvider } from '@murumets-ee/auth-ui'
|
|
1043
1039
|
import { authClient } from '@${r}/config/auth-client'
|
|
@@ -1063,22 +1059,22 @@ export function AuthProviders({ children }: { children: ReactNode }) {
|
|
|
1063
1059
|
</AuthUIProvider>
|
|
1064
1060
|
)
|
|
1065
1061
|
}
|
|
1066
|
-
`),await e(a
|
|
1062
|
+
`),await e(o(a,"app/[locale]/auth/sign-in/page.tsx"),`import { SignInForm } from '@murumets-ee/auth-ui'
|
|
1067
1063
|
|
|
1068
1064
|
export default function SignInPage() {
|
|
1069
1065
|
return <SignInForm />
|
|
1070
1066
|
}
|
|
1071
|
-
`),await e(a
|
|
1067
|
+
`),await e(o(a,"app/[locale]/auth/sign-up/page.tsx"),`import { SignUpForm } from '@murumets-ee/auth-ui'
|
|
1072
1068
|
|
|
1073
1069
|
export default function SignUpPage() {
|
|
1074
1070
|
return <SignUpForm />
|
|
1075
1071
|
}
|
|
1076
|
-
`),await e(a
|
|
1072
|
+
`),await e(o(a,"app/[locale]/auth/forgot-password/page.tsx"),`import { ForgotPasswordForm } from '@murumets-ee/auth-ui'
|
|
1077
1073
|
|
|
1078
1074
|
export default function ForgotPasswordPage() {
|
|
1079
1075
|
return <ForgotPasswordForm />
|
|
1080
1076
|
}
|
|
1081
|
-
`),await e(a
|
|
1077
|
+
`),await e(o(a,"app/[locale]/auth/reset-password/page.tsx"),`import { Suspense } from 'react'
|
|
1082
1078
|
import { ResetPasswordContent } from './content'
|
|
1083
1079
|
|
|
1084
1080
|
export default function ResetPasswordPage() {
|
|
@@ -1088,7 +1084,7 @@ export default function ResetPasswordPage() {
|
|
|
1088
1084
|
</Suspense>
|
|
1089
1085
|
)
|
|
1090
1086
|
}
|
|
1091
|
-
`),await e(a
|
|
1087
|
+
`),await e(o(a,"app/[locale]/auth/reset-password/content.tsx"),`'use client'
|
|
1092
1088
|
|
|
1093
1089
|
import { useSearchParams } from 'next/navigation'
|
|
1094
1090
|
import { ResetPasswordForm } from '@murumets-ee/auth-ui'
|
|
@@ -1112,7 +1108,7 @@ export function ResetPasswordContent() {
|
|
|
1112
1108
|
|
|
1113
1109
|
return <ResetPasswordForm token={token} />
|
|
1114
1110
|
}
|
|
1115
|
-
`),await e(a
|
|
1111
|
+
`),await e(o(a,"app/[locale]/setup/page.tsx"),`import { redirect } from 'next/navigation'
|
|
1116
1112
|
import { sql } from 'drizzle-orm'
|
|
1117
1113
|
import { getToolkitApp } from '@${r}/config/app'
|
|
1118
1114
|
import { SetupForm } from './form'
|
|
@@ -1137,7 +1133,7 @@ export default async function SetupPage() {
|
|
|
1137
1133
|
</div>
|
|
1138
1134
|
)
|
|
1139
1135
|
}
|
|
1140
|
-
`),await e(a
|
|
1136
|
+
`),await e(o(a,"app/[locale]/setup/form.tsx"),`'use client'
|
|
1141
1137
|
|
|
1142
1138
|
import { useState } from 'react'
|
|
1143
1139
|
import { createFirstAdmin } from './actions'
|
|
@@ -1208,7 +1204,7 @@ export function SetupForm() {
|
|
|
1208
1204
|
</form>
|
|
1209
1205
|
)
|
|
1210
1206
|
}
|
|
1211
|
-
`),await e(a
|
|
1207
|
+
`),await e(o(a,"app/[locale]/setup/actions.ts"),`'use server'
|
|
1212
1208
|
|
|
1213
1209
|
import { sql } from 'drizzle-orm'
|
|
1214
1210
|
import { getToolkitApp } from '@${r}/config/app'
|
|
@@ -1254,11 +1250,11 @@ export async function createFirstAdmin(formData: FormData) {
|
|
|
1254
1250
|
|
|
1255
1251
|
return { ok: true, email: adminUser.user.email }
|
|
1256
1252
|
}
|
|
1257
|
-
`)}async function M(t,n){let{name:r}=n,o
|
|
1253
|
+
`)}async function M(t,n){let{name:r}=n,a=o(t,"apps/web");m(`pnpm create next-app@${"16"} ${a} --typescript --tailwind --no-eslint --app --no-src-dir --turbopack --react-compiler --skip-install --import-alias "@/*"`),await c(a,["app/page.tsx","app/page.module.css","app/fonts","README.md","pnpm-workspace.yaml"]),await l(o(a,"package.json"),{dependencies:{[`@${r}/config`]:"workspace:*","@murumets-ee/core":`^${i.myorgCore}`,"@murumets-ee/auth-ui":`^${i.myorgAuthUi}`,"next-intl":`^${i.nextIntl}`,"next-themes":`^${i.nextThemes}`,"lucide-react":`^${i.lucideReact}`},devDependencies:{"babel-plugin-react-compiler":i.babelReactCompiler}});let{appendToFile:f}=await import("./utils-42K2ZGUL.js");await f(o(a,".gitignore"),`
|
|
1258
1254
|
# Environment
|
|
1259
1255
|
.env*
|
|
1260
1256
|
!.env.example
|
|
1261
|
-
`),await e(a
|
|
1257
|
+
`),await e(o(a,"next.config.ts"),`import type { NextConfig } from 'next'
|
|
1262
1258
|
import createNextIntlPlugin from 'next-intl/plugin'
|
|
1263
1259
|
|
|
1264
1260
|
const withNextIntl = createNextIntlPlugin('./i18n/request.ts')
|
|
@@ -1277,7 +1273,7 @@ const nextConfig: NextConfig = {
|
|
|
1277
1273
|
}
|
|
1278
1274
|
|
|
1279
1275
|
export default withNextIntl(nextConfig)
|
|
1280
|
-
`),await e(a
|
|
1276
|
+
`),await e(o(a,"proxy.ts"),`import createMiddleware from 'next-intl/middleware'
|
|
1281
1277
|
import { routing } from './i18n/routing'
|
|
1282
1278
|
|
|
1283
1279
|
export default createMiddleware(routing)
|
|
@@ -1285,13 +1281,13 @@ export default createMiddleware(routing)
|
|
|
1285
1281
|
export const config = {
|
|
1286
1282
|
matcher: '/((?!api|_next|_vercel|.*\\\\..*).*)',
|
|
1287
1283
|
}
|
|
1288
|
-
`),await e(a
|
|
1284
|
+
`),await e(o(a,"i18n/routing.ts"),`import { defineRouting } from 'next-intl/routing'
|
|
1289
1285
|
|
|
1290
1286
|
export const routing = defineRouting({
|
|
1291
1287
|
locales: ['en'],
|
|
1292
1288
|
defaultLocale: 'en',
|
|
1293
1289
|
})
|
|
1294
|
-
`),await e(a
|
|
1290
|
+
`),await e(o(a,"i18n/request.ts"),`import { getRequestConfig } from 'next-intl/server'
|
|
1295
1291
|
import { hasLocale } from 'next-intl'
|
|
1296
1292
|
import { routing } from './routing'
|
|
1297
1293
|
import { getAuthMessages } from '@murumets-ee/auth-ui/i18n'
|
|
@@ -1311,7 +1307,7 @@ export default getRequestConfig(async ({ requestLocale }) => {
|
|
|
1311
1307
|
},
|
|
1312
1308
|
}
|
|
1313
1309
|
})
|
|
1314
|
-
`),await e(a
|
|
1310
|
+
`),await e(o(a,"app/globals.css"),`@import "tailwindcss";
|
|
1315
1311
|
@source "../node_modules/@murumets-ee/auth-ui/dist";
|
|
1316
1312
|
|
|
1317
1313
|
@custom-variant dark (&:where(.dark, .dark *));
|
|
@@ -1338,7 +1334,7 @@ body {
|
|
|
1338
1334
|
color: var(--foreground);
|
|
1339
1335
|
font-family: Arial, Helvetica, sans-serif;
|
|
1340
1336
|
}
|
|
1341
|
-
`),await e(a
|
|
1337
|
+
`),await e(o(a,"app/theme-provider.tsx"),`'use client'
|
|
1342
1338
|
|
|
1343
1339
|
import { ThemeProvider as NextThemesProvider } from 'next-themes'
|
|
1344
1340
|
import type { ReactNode } from 'react'
|
|
@@ -1355,7 +1351,7 @@ export function ThemeProvider({ children }: { children: ReactNode }) {
|
|
|
1355
1351
|
</NextThemesProvider>
|
|
1356
1352
|
)
|
|
1357
1353
|
}
|
|
1358
|
-
`),await e(a
|
|
1354
|
+
`),await e(o(a,"app/theme-toggle.tsx"),`'use client'
|
|
1359
1355
|
|
|
1360
1356
|
import { useTheme } from 'next-themes'
|
|
1361
1357
|
import { useState, useEffect } from 'react'
|
|
@@ -1382,7 +1378,7 @@ export function ThemeToggle() {
|
|
|
1382
1378
|
</button>
|
|
1383
1379
|
)
|
|
1384
1380
|
}
|
|
1385
|
-
`),await e(a
|
|
1381
|
+
`),await e(o(a,"app/nav-header.tsx"),`'use client'
|
|
1386
1382
|
|
|
1387
1383
|
import Link from 'next/link'
|
|
1388
1384
|
import { usePathname } from 'next/navigation'
|
|
@@ -1424,12 +1420,12 @@ export function NavHeader() {
|
|
|
1424
1420
|
</header>
|
|
1425
1421
|
)
|
|
1426
1422
|
}
|
|
1427
|
-
`),await e(a
|
|
1423
|
+
`),await e(o(a,"app/layout.tsx"),`import './globals.css'
|
|
1428
1424
|
|
|
1429
1425
|
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
|
1430
1426
|
return children
|
|
1431
1427
|
}
|
|
1432
|
-
`),await e(a
|
|
1428
|
+
`),await e(o(a,"app/[locale]/layout.tsx"),`import type { Metadata } from 'next'
|
|
1433
1429
|
import { Geist, Geist_Mono } from 'next/font/google'
|
|
1434
1430
|
import { NextIntlClientProvider } from 'next-intl'
|
|
1435
1431
|
import { getMessages } from 'next-intl/server'
|
|
@@ -1478,7 +1474,7 @@ export default async function LocaleLayout({
|
|
|
1478
1474
|
</html>
|
|
1479
1475
|
)
|
|
1480
1476
|
}
|
|
1481
|
-
`),await e(a
|
|
1477
|
+
`),await e(o(a,"app/[locale]/page.tsx"),`import { createQueryClient } from '@murumets-ee/core/clients'
|
|
1482
1478
|
import { Article, Category } from '@${r}/config/entities'
|
|
1483
1479
|
import { getToolkitApp } from '@${r}/config/app'
|
|
1484
1480
|
|
|
@@ -1542,15 +1538,23 @@ export default async function HomePage() {
|
|
|
1542
1538
|
</div>
|
|
1543
1539
|
)
|
|
1544
1540
|
}
|
|
1545
|
-
`)}import{join as u}from"path";async function
|
|
1541
|
+
`)}import{join as u}from"path";async function E(t,n){let{name:r}=n;await e(u(t,"next.config.ts"),`import type { NextConfig } from 'next'
|
|
1546
1542
|
import createNextIntlPlugin from 'next-intl/plugin'
|
|
1547
1543
|
|
|
1548
1544
|
const withNextIntl = createNextIntlPlugin('./i18n/request.ts')
|
|
1549
1545
|
|
|
1550
1546
|
const nextConfig: NextConfig = {
|
|
1547
|
+
output: 'standalone',
|
|
1551
1548
|
reactCompiler: true,
|
|
1552
|
-
transpilePackages: [
|
|
1553
|
-
|
|
1549
|
+
transpilePackages: [
|
|
1550
|
+
'@murumets-ee/core', '@murumets-ee/entity', '@murumets-ee/db',
|
|
1551
|
+
'@murumets-ee/logging', '@murumets-ee/auth', '@murumets-ee/auth-ui',
|
|
1552
|
+
'@murumets-ee/admin-ui', '@murumets-ee/content', '@murumets-ee/settings',
|
|
1553
|
+
'@murumets-ee/storage', '@murumets-ee/media', '@murumets-ee/taxonomy',
|
|
1554
|
+
'@murumets-ee/queue', '@murumets-ee/mail', '@murumets-ee/ticketing',
|
|
1555
|
+
'@murumets-ee/ticketing-ui', '@murumets-ee/tokens', '@murumets-ee/ui',
|
|
1556
|
+
],
|
|
1557
|
+
serverExternalPackages: ['drizzle-orm', 'postgres', 'pino', 'file-type'],
|
|
1554
1558
|
experimental: {
|
|
1555
1559
|
serverActions: {
|
|
1556
1560
|
bodySizeLimit: '2mb',
|
|
@@ -1820,7 +1824,7 @@ async function resetDb() {
|
|
|
1820
1824
|
}
|
|
1821
1825
|
|
|
1822
1826
|
resetDb().catch(console.error)
|
|
1823
|
-
`)}import{join as
|
|
1827
|
+
`)}import{join as g}from"path";async function R(t,n){let{name:r}=n;await e(g(t,"app/globals.css"),`@import "tailwindcss";
|
|
1824
1828
|
@source "../node_modules/@murumets-ee/auth-ui/dist";
|
|
1825
1829
|
|
|
1826
1830
|
@custom-variant dark (&:where(.dark, .dark *));
|
|
@@ -1847,7 +1851,7 @@ body {
|
|
|
1847
1851
|
color: var(--foreground);
|
|
1848
1852
|
font-family: Arial, Helvetica, sans-serif;
|
|
1849
1853
|
}
|
|
1850
|
-
`),await e(
|
|
1854
|
+
`),await e(g(t,"app/theme-provider.tsx"),`'use client'
|
|
1851
1855
|
|
|
1852
1856
|
import { ThemeProvider as NextThemesProvider } from 'next-themes'
|
|
1853
1857
|
import type { ReactNode } from 'react'
|
|
@@ -1864,7 +1868,7 @@ export function ThemeProvider({ children }: { children: ReactNode }) {
|
|
|
1864
1868
|
</NextThemesProvider>
|
|
1865
1869
|
)
|
|
1866
1870
|
}
|
|
1867
|
-
`),await e(
|
|
1871
|
+
`),await e(g(t,"app/theme-toggle.tsx"),`'use client'
|
|
1868
1872
|
|
|
1869
1873
|
import { useTheme } from 'next-themes'
|
|
1870
1874
|
import { useState, useEffect } from 'react'
|
|
@@ -1891,7 +1895,7 @@ export function ThemeToggle() {
|
|
|
1891
1895
|
</button>
|
|
1892
1896
|
)
|
|
1893
1897
|
}
|
|
1894
|
-
`),await e(
|
|
1898
|
+
`),await e(g(t,"app/nav-header.tsx"),`'use client'
|
|
1895
1899
|
|
|
1896
1900
|
import Link from 'next/link'
|
|
1897
1901
|
import { usePathname } from 'next/navigation'
|
|
@@ -2036,4 +2040,4 @@ export const auth = betterAuth({
|
|
|
2036
2040
|
`),await e(p(t,"generated/auth-schema.ts"),`// This file is generated by better-auth CLI.
|
|
2037
2041
|
// Run: npx @better-auth/cli generate --config auth.config.ts -y
|
|
2038
2042
|
export {}
|
|
2039
|
-
`)}async function q(t,n){t.mode==="single"?await O(t,n):await U(t,n)}async function O(t,n){let r=v(process.cwd(),t.name);n?.("Creating Next.js app..."),
|
|
2043
|
+
`)}async function q(t,n){t.mode==="single"?await O(t,n):await U(t,n)}async function O(t,n){let r=v(process.cwd(),t.name);n?.("Creating Next.js app..."),m(`pnpm create next-app@${"16"} ${t.name} --typescript --tailwind --no-eslint --app --no-src-dir --turbopack --react-compiler --skip-install --import-alias "@/*"`),await c(r,["app/page.tsx","app/page.module.css","app/fonts","README.md"]),await l(v(r,"package.json"),{type:"module",dependencies:{"@murumets-ee/core":`^${i.myorgCore}`,"@murumets-ee/db":`^${i.myorgDb}`,"@murumets-ee/entity":`^${i.myorgEntity}`,"@murumets-ee/logging":`^${i.myorgLogging}`,"@murumets-ee/auth":`^${i.myorgAuth}`,"@murumets-ee/auth-ui":`^${i.myorgAuthUi}`,"@murumets-ee/admin-ui":`^${i.myorgAdminUi}`,"@murumets-ee/content":`^${i.myorgContent}`,"@murumets-ee/settings":`^${i.myorgSettings}`,"@murumets-ee/storage":`^${i.myorgStorage}`,"@murumets-ee/media":`^${i.myorgMedia}`,"@murumets-ee/taxonomy":`^${i.myorgTaxonomy}`,"@murumets-ee/queue":`^${i.myorgQueue}`,"@murumets-ee/mail":`^${i.myorgMail}`,"@murumets-ee/ticketing":`^${i.myorgTicketing}`,"@murumets-ee/ticketing-ui":`^${i.myorgTicketingUi}`,"@murumets-ee/tokens":`^${i.myorgTokens}`,"better-auth":`^${i.betterAuth}`,"drizzle-orm":`^${i.drizzleOrm}`,"next-intl":`^${i.nextIntl}`,"next-themes":`^${i.nextThemes}`,"lucide-react":`^${i.lucideReact}`,postgres:`^${i.postgres}`,"react-hook-form":`^${i.reactHookForm}`,"@hookform/resolvers":`^${i.hookformResolvers}`,zod:`^${i.zod}`},devDependencies:{"drizzle-kit":`^${i.drizzleKit}`,tsx:`^${i.tsx}`,"babel-plugin-react-compiler":i.babelReactCompiler},scripts:{"db:generate":"tsx --env-file=.env scripts/generate-schema.ts","db:migrate:generate":"drizzle-kit generate","db:migrate":"tsx --env-file=.env scripts/migrate.ts","db:reset":"tsx --env-file=.env scripts/reset-db.ts"}}),n?.("Adding toolkit files..."),await k(r,t),await A(r,t),await C(r,t),await w(r,t),await N(r,t),await E(r,t),await R(r,t),await P(r,t),t.installDeps&&(n?.("Installing dependencies..."),m("pnpm install",{cwd:r}))}async function U(t,n){let r=v(process.cwd(),t.name);n?.("Creating workspace..."),await S(r,t,n),t.installDeps&&(n?.("Installing dependencies..."),m("pnpm install",{cwd:r}))}export{q as scaffold};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e}from"./chunk-
|
|
1
|
+
import{a,b,c,d,e}from"./chunk-CUB6XFPE.js";export{e as appendToFile,c as deleteFiles,b as mergePackageJson,d as runCommand,a as writeFile};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a,b,c,d,e}from"./chunk-
|
|
2
|
+
import{a,b,c,d,e}from"./chunk-ZAX4VH4C.js";export{e as appendToFile,c as deleteFiles,b as mergePackageJson,d as runCommand,a as writeFile};
|
package/package.json
CHANGED
package/dist/chunk-HAE5YHLL.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{execSync as t}from"child_process";import{appendFile as c,writeFile as s,mkdir as d,readFile as o,rm as p}from"fs/promises";import{dirname as a,join as f}from"path";async function m(i,e){await d(a(i),{recursive:!0}),await s(i,e,"utf-8")}async function v(i,e){let r=await o(i,"utf-8"),n=JSON.parse(r);e.dependencies&&(n.dependencies={...n.dependencies,...e.dependencies}),e.devDependencies&&(n.devDependencies={...n.devDependencies,...e.devDependencies}),e.scripts&&(n.scripts={...n.scripts,...e.scripts}),await s(i,`${JSON.stringify(n,null,2)}
|
|
3
|
-
`,"utf-8")}async function l(i,e){for(let r of e)await p(f(i,r),{force:!0,recursive:!0})}function F(i,e){return t(i,{cwd:e?.cwd,stdio:"pipe",encoding:"utf-8"})}async function x(i,e){await c(i,e,"utf-8")}export{m as a,v as b,l as c,F as d,x as e};
|
package/dist/chunk-YJOFTYN5.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{execSync as t}from"child_process";import{appendFile as c,writeFile as s,mkdir as d,readFile as o,rm as p}from"fs/promises";import{dirname as a,join as f}from"path";async function m(i,e){await d(a(i),{recursive:!0}),await s(i,e,"utf-8")}async function v(i,e){let r=await o(i,"utf-8"),n=JSON.parse(r);e.dependencies&&(n.dependencies={...n.dependencies,...e.dependencies}),e.devDependencies&&(n.devDependencies={...n.devDependencies,...e.devDependencies}),e.scripts&&(n.scripts={...n.scripts,...e.scripts}),await s(i,`${JSON.stringify(n,null,2)}
|
|
2
|
-
`,"utf-8")}async function l(i,e){for(let r of e)await p(f(i,r),{force:!0,recursive:!0})}function F(i,e){return t(i,{cwd:e?.cwd,stdio:"pipe",encoding:"utf-8"})}async function x(i,e){await c(i,e,"utf-8")}export{m as a,v as b,l as c,F as d,x as e};
|