@murumets-ee/create 0.1.4 → 0.1.6

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 (2) hide show
  1. package/dist/cli.js +35 -35
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{a as e,b as d,c as g,d as u,e as A}from"./chunk-ZAX4VH4C.js";import*as c from"@clack/prompts";import v from"picocolors";import*as s from"@clack/prompts";async function N(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 T(t,n){await e(m(t,"lib/auth.ts"),`import { getToolkitApp } from './app'
2
+ import{a as e,b as g,c as f,d as u,e as T}from"./chunk-ZAX4VH4C.js";import*as c from"@clack/prompts";import y from"picocolors";import*as s from"@clack/prompts";function I(t){let n={},r=t.slice(2);for(let o=0;o<r.length;o++){let l=r[o];if(l==="--mode"&&r[o+1]){let p=r[++o];(p==="single"||p==="multi")&&(n.mode=p)}else l==="--install"?n.install=!0:l==="--no-install"?n.install=!1:!l.startsWith("-")&&!n.name&&(n.name=l)}return n}async function S(t){let n=I(process.argv),r=n.name??t;if(r&&n.mode&&n.install!==void 0)return{name:r,mode:n.mode,installDeps:n.install};s.intro("@murumets-ee/create");let o=r??await s.text({message:"Project name:",placeholder:"my-project",validate:N=>{if(!N)return"Project name is required";if(!/^[a-z0-9-]+$/.test(N))return"Use lowercase letters, numbers, and hyphens only"}});if(s.isCancel(o))return s.cancel("Cancelled."),null;let l=n.mode??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(l))return s.cancel("Cancelled."),null;let p=n.install??await s.confirm({message:"Install dependencies?",initialValue:!0});return s.isCancel(p)?(s.cancel("Cancelled."),null):{name:o,mode:l,installDeps:p}}import{join as A}from"path";import{join as m}from"path";async function E(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()
@@ -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 p}from"path";async function S(t,n){let{name:r}=n;await e(p(t,".env.example"),`DATABASE_URL=postgresql://${r}:${r}_dev_password@localhost:5432/${r}_dev
252
+ `)}import{join as d}from"path";async function P(t,n){let{name:r}=n;await e(d(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,7 +259,7 @@ RESEND_API_KEY=
259
259
  RESEND_WEBHOOK_SECRET=
260
260
  MAIL_FROM=noreply@example.com
261
261
  CSAT_SECRET=
262
- `),await e(p(t,".dockerignore"),`# Dependencies (installed inside Docker)
262
+ `),await e(d(t,".dockerignore"),`# Dependencies (installed inside Docker)
263
263
  node_modules/
264
264
  .pnpm-store/
265
265
 
@@ -303,7 +303,7 @@ docs/
303
303
  # OS files
304
304
  .DS_Store
305
305
  Thumbs.db
306
- `),await e(p(t,"Dockerfile"),`# --- Base image ---
306
+ `),await e(d(t,"Dockerfile"),`# --- Base image ---
307
307
  # Node 22 LTS (Debian slim \u2014 glibc required for sharp image optimization)
308
308
  FROM node:22-slim AS base
309
309
 
@@ -346,7 +346,7 @@ COPY --from=builder --chown=node:node /app/migrations ./migrations
346
346
  USER node
347
347
  EXPOSE 3000
348
348
  CMD ["node", "server.js"]
349
- `),await e(p(t,"docker-compose.yml"),`services:
349
+ `),await e(d(t,"docker-compose.yml"),`services:
350
350
  postgres:
351
351
  image: postgres:17-alpine
352
352
  container_name: ${r}-postgres
@@ -368,7 +368,7 @@ CMD ["node", "server.js"]
368
368
  volumes:
369
369
  postgres_data:
370
370
  name: ${r}_postgres_data
371
- `),await e(p(t,"docker-compose.prod.yml"),`services:
371
+ `),await e(d(t,"docker-compose.prod.yml"),`services:
372
372
  app:
373
373
  build: .
374
374
  restart: unless-stopped
@@ -403,16 +403,16 @@ volumes:
403
403
 
404
404
  networks:
405
405
  internal:
406
- `),await A(p(t,".gitignore"),`
406
+ `),await T(d(t,".gitignore"),`
407
407
  # Toolkit generated files
408
408
  generated/
409
409
 
410
410
  # Environment
411
411
  .env*
412
412
  !.env.example
413
- `)}import{join as y}from"path";async function E(t,n){await e(y(t,"entities/index.ts"),`export { Article } from './article'
413
+ `)}import{join as w}from"path";async function z(t,n){await e(w(t,"entities/index.ts"),`export { Article } from './article'
414
414
  export { Category } from './category'
415
- `),await e(y(t,"entities/article.ts"),`import { behavior, defineEntity, field } from '@murumets-ee/entity'
415
+ `),await e(w(t,"entities/article.ts"),`import { behavior, defineEntity, field } from '@murumets-ee/entity'
416
416
 
417
417
  export const Article = defineEntity({
418
418
  name: 'article',
@@ -443,7 +443,7 @@ export const Article = defineEntity({
443
443
  delete: 'group.admin',
444
444
  },
445
445
  })
446
- `),await e(y(t,"entities/category.ts"),`import { defineEntity, field } from '@murumets-ee/entity'
446
+ `),await e(w(t,"entities/category.ts"),`import { defineEntity, field } from '@murumets-ee/entity'
447
447
 
448
448
  export const Category = defineEntity({
449
449
  name: 'category',
@@ -460,13 +460,13 @@ export const Category = defineEntity({
460
460
  delete: 'group.admin',
461
461
  },
462
462
  })
463
- `)}import{join as P}from"path";async function z(t,n){await e(P(t,"i18n/routing.ts"),`import { defineRouting } from 'next-intl/routing'
463
+ `)}import{join as R}from"path";async function C(t,n){await e(R(t,"i18n/routing.ts"),`import { defineRouting } from 'next-intl/routing'
464
464
 
465
465
  export const routing = defineRouting({
466
466
  locales: ['en'],
467
467
  defaultLocale: 'en',
468
468
  })
469
- `),await e(P(t,"i18n/request.ts"),`import { getRequestConfig } from 'next-intl/server'
469
+ `),await e(R(t,"i18n/request.ts"),`import { getRequestConfig } from 'next-intl/server'
470
470
  import { hasLocale } from 'next-intl'
471
471
  import { routing } from './routing'
472
472
  import { getAuthMessages } from '@murumets-ee/auth-ui/i18n'
@@ -486,7 +486,7 @@ export default getRequestConfig(async ({ requestLocale }) => {
486
486
  },
487
487
  }
488
488
  })
489
- `)}import{mkdir as R}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 C(t,n,r){await U(t,n),r?.("Workspace root created"),r?.("Creating admin app..."),await F(t,n),r?.("Admin app created"),r?.("Creating web app..."),await D(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 R(t,{recursive:!0}),await e(a(t,"pnpm-workspace.yaml"),`packages:
489
+ `)}import{mkdir as L}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 _(t,n,r){await F(t,n),r?.("Workspace root created"),r?.("Creating admin app..."),await B(t,n),r?.("Admin app created"),r?.("Creating web app..."),await H(t,n),r?.("Web app created"),await D(t,n),r?.("Shared config package created")}async function F(t,n){let{name:r}=n;await L(t,{recursive:!0}),await e(a(t,"pnpm-workspace.yaml"),`packages:
490
490
  - 'packages/*'
491
491
  - 'apps/*'
492
492
 
@@ -557,7 +557,7 @@ CSAT_SECRET=
557
557
  volumes:
558
558
  postgres_data:
559
559
  name: ${r}_postgres_data
560
- `)}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)}
560
+ `)}async function D(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)}
561
561
  `),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)}
562
562
  `),await e(a(o,"toolkit.config.ts"),`import { auth } from '@murumets-ee/auth/plugin'
563
563
  import { content } from '@murumets-ee/content/plugin'
@@ -825,7 +825,7 @@ async function resetDb() {
825
825
  }
826
826
 
827
827
  resetDb().catch(console.error)
828
- `)}async function F(t,n){let{name:r}=n,o=a(t,"apps/admin");await R(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 g(o,["app/page.tsx","app/page.module.css","app/fonts","README.md","pnpm-workspace.yaml"]),await d(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"),`
828
+ `)}async function B(t,n){let{name:r}=n,o=a(t,"apps/admin");await L(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 f(o,["app/page.tsx","app/page.module.css","app/fonts","README.md","pnpm-workspace.yaml"]),await g(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"),`
829
829
  # Environment
830
830
  .env*
831
831
  !.env.example
@@ -1373,7 +1373,7 @@ export async function createFirstAdmin(formData: FormData) {
1373
1373
 
1374
1374
  return { ok: true, email: adminUser.user.email }
1375
1375
  }
1376
- `)}async function D(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 g(o,["app/page.tsx","app/page.module.css","app/fonts","README.md","pnpm-workspace.yaml"]),await d(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"),`
1376
+ `)}async function H(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 f(o,["app/page.tsx","app/page.module.css","app/fonts","README.md","pnpm-workspace.yaml"]),await g(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"),`
1377
1377
  # Environment
1378
1378
  .env*
1379
1379
  !.env.example
@@ -1661,7 +1661,7 @@ export default async function HomePage() {
1661
1661
  </div>
1662
1662
  )
1663
1663
  }
1664
- `)}import{join as f}from"path";async function L(t,n){let{name:r}=n;await e(f(t,"next.config.ts"),`import type { NextConfig } from 'next'
1664
+ `)}import{join as h}from"path";async function $(t,n){let{name:r}=n;await e(h(t,"next.config.ts"),`import type { NextConfig } from 'next'
1665
1665
  import createNextIntlPlugin from 'next-intl/plugin'
1666
1666
 
1667
1667
  const withNextIntl = createNextIntlPlugin('./i18n/request.ts')
@@ -1686,7 +1686,7 @@ const nextConfig: NextConfig = {
1686
1686
  }
1687
1687
 
1688
1688
  export default withNextIntl(nextConfig)
1689
- `),await e(f(t,"proxy.ts"),`import { NextRequest, NextResponse } from 'next/server'
1689
+ `),await e(h(t,"proxy.ts"),`import { NextRequest, NextResponse } from 'next/server'
1690
1690
  import createMiddleware from 'next-intl/middleware'
1691
1691
  import { routing } from './i18n/routing'
1692
1692
 
@@ -1717,12 +1717,12 @@ export function proxy(request: NextRequest) {
1717
1717
  export const config = {
1718
1718
  matcher: '/((?!api|_next|_vercel|.*\\\\..*).*)',
1719
1719
  }
1720
- `),await e(f(t,"app/layout.tsx"),`import './globals.css'
1720
+ `),await e(h(t,"app/layout.tsx"),`import './globals.css'
1721
1721
 
1722
1722
  export default function RootLayout({ children }: { children: React.ReactNode }) {
1723
1723
  return children
1724
1724
  }
1725
- `),await e(f(t,"app/[locale]/layout.tsx"),`import type { Metadata } from 'next'
1725
+ `),await e(h(t,"app/[locale]/layout.tsx"),`import type { Metadata } from 'next'
1726
1726
  import { Geist, Geist_Mono } from 'next/font/google'
1727
1727
  import { NextIntlClientProvider } from 'next-intl'
1728
1728
  import { getMessages } from 'next-intl/server'
@@ -1771,7 +1771,7 @@ export default async function LocaleLayout({
1771
1771
  </html>
1772
1772
  )
1773
1773
  }
1774
- `),await e(f(t,"app/[locale]/page.tsx"),`import { createQueryClient } from '@murumets-ee/core/clients'
1774
+ `),await e(h(t,"app/[locale]/page.tsx"),`import { createQueryClient } from '@murumets-ee/core/clients'
1775
1775
  import { Article, Category } from '@/entities'
1776
1776
  import { getToolkitApp } from '@/lib/app'
1777
1777
 
@@ -1835,13 +1835,13 @@ export default async function HomePage() {
1835
1835
  </div>
1836
1836
  )
1837
1837
  }
1838
- `)}import{join as w}from"path";async function _(t,n){await e(w(t,"scripts/generate-schema.ts"),`import { execSync } from 'node:child_process'
1838
+ `)}import{join as k}from"path";async function M(t,n){await e(k(t,"scripts/generate-schema.ts"),`import { execSync } from 'node:child_process'
1839
1839
  execSync('npx @murumets-ee/cli generate', { stdio: 'inherit', cwd: import.meta.dirname + '/..' })
1840
- `),await e(w(t,"scripts/migrate.ts"),`import { execSync } from 'node:child_process'
1840
+ `),await e(k(t,"scripts/migrate.ts"),`import { execSync } from 'node:child_process'
1841
1841
  execSync('npx @murumets-ee/cli migrate', { stdio: 'inherit', cwd: import.meta.dirname + '/..' })
1842
- `),await e(w(t,"scripts/reset-db.ts"),`import { execSync } from 'node:child_process'
1842
+ `),await e(k(t,"scripts/reset-db.ts"),`import { execSync } from 'node:child_process'
1843
1843
  execSync('npx @murumets-ee/cli reset --force', { stdio: 'inherit', cwd: import.meta.dirname + '/..' })
1844
- `)}import{join as b}from"path";async function $(t,n){let{name:r}=n;await e(b(t,"app/globals.css"),`@import "tailwindcss";
1844
+ `)}import{join as v}from"path";async function O(t,n){let{name:r}=n;await e(v(t,"app/globals.css"),`@import "tailwindcss";
1845
1845
  @source "../node_modules/@murumets-ee/auth-ui/dist";
1846
1846
 
1847
1847
  @custom-variant dark (&:where(.dark, .dark *));
@@ -1868,7 +1868,7 @@ body {
1868
1868
  color: var(--foreground);
1869
1869
  font-family: Arial, Helvetica, sans-serif;
1870
1870
  }
1871
- `),await e(b(t,"app/theme-provider.tsx"),`'use client'
1871
+ `),await e(v(t,"app/theme-provider.tsx"),`'use client'
1872
1872
 
1873
1873
  import { ThemeProvider as NextThemesProvider } from 'next-themes'
1874
1874
  import type { ReactNode } from 'react'
@@ -1885,7 +1885,7 @@ export function ThemeProvider({ children }: { children: ReactNode }) {
1885
1885
  </NextThemesProvider>
1886
1886
  )
1887
1887
  }
1888
- `),await e(b(t,"app/theme-toggle.tsx"),`'use client'
1888
+ `),await e(v(t,"app/theme-toggle.tsx"),`'use client'
1889
1889
 
1890
1890
  import { useTheme } from 'next-themes'
1891
1891
  import { useState, useEffect } from 'react'
@@ -1912,7 +1912,7 @@ export function ThemeToggle() {
1912
1912
  </button>
1913
1913
  )
1914
1914
  }
1915
- `),await e(b(t,"app/nav-header.tsx"),`'use client'
1915
+ `),await e(v(t,"app/nav-header.tsx"),`'use client'
1916
1916
 
1917
1917
  import Link from 'next/link'
1918
1918
  import { usePathname } from 'next/navigation'
@@ -1956,7 +1956,7 @@ export function NavHeader() {
1956
1956
  </header>
1957
1957
  )
1958
1958
  }
1959
- `)}import{join as h}from"path";async function M(t,n){let{name:r}=n;await e(h(t,"toolkit.config.ts"),`import { auth } from '@murumets-ee/auth/plugin'
1959
+ `)}import{join as x}from"path";async function q(t,n){let{name:r}=n;await e(x(t,"toolkit.config.ts"),`import { auth } from '@murumets-ee/auth/plugin'
1960
1960
  import { content } from '@murumets-ee/content/plugin'
1961
1961
  import { defineConfig } from '@murumets-ee/core'
1962
1962
  import { mail, ResendMailProvider } from '@murumets-ee/mail'
@@ -2008,7 +2008,7 @@ export default defineConfig({
2008
2008
  ],
2009
2009
  projectRoot: import.meta.dirname,
2010
2010
  })
2011
- `),await e(h(t,"lib/app.ts"),`import { createApp, setApp, type ToolkitApp } from '@murumets-ee/core'
2011
+ `),await e(x(t,"lib/app.ts"),`import { createApp, setApp, type ToolkitApp } from '@murumets-ee/core'
2012
2012
  import config from '../toolkit.config'
2013
2013
 
2014
2014
  let appInstance: ToolkitApp | null = null
@@ -2022,7 +2022,7 @@ export async function getToolkitApp(): Promise<ToolkitApp> {
2022
2022
  }
2023
2023
  return appInstance
2024
2024
  }
2025
- `),await e(h(t,"drizzle.config.ts"),`import type { Config } from 'drizzle-kit'
2025
+ `),await e(x(t,"drizzle.config.ts"),`import type { Config } from 'drizzle-kit'
2026
2026
 
2027
2027
  if (!process.env.DATABASE_URL) {
2028
2028
  throw new Error('DATABASE_URL environment variable is required')
@@ -2036,7 +2036,7 @@ export default {
2036
2036
  url: process.env.DATABASE_URL,
2037
2037
  },
2038
2038
  } satisfies Config
2039
- `),await e(h(t,"auth.config.ts"),`import { betterAuth } from 'better-auth'
2039
+ `),await e(x(t,"auth.config.ts"),`import { betterAuth } from 'better-auth'
2040
2040
  import { drizzleAdapter } from 'better-auth/adapters/drizzle'
2041
2041
  import { admin } from 'better-auth/plugins'
2042
2042
  import { organization } from 'better-auth/plugins/organization'
@@ -2054,8 +2054,8 @@ export const auth = betterAuth({
2054
2054
  organization(),
2055
2055
  ],
2056
2056
  })
2057
- `),await e(h(t,"generated/auth-schema.ts"),`// This file is generated by better-auth CLI.
2057
+ `),await e(x(t,"generated/auth-schema.ts"),`// This file is generated by better-auth CLI.
2058
2058
  // Run: npx @better-auth/cli generate --config auth.config.ts -y
2059
2059
  export {}
2060
- `)}async function O(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 g(r,["app/page.tsx","app/page.module.css","app/fonts","README.md"]),await d(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 S(r,t),await E(r,t),await M(r,t),await T(r,t),await z(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 C(r,t,n),t.installDeps&&(n?.("Installing dependencies..."),u("pnpm install",{cwd:r}))}async function W(){let t=process.argv[2],n=await N(t);if(!n)return;let r=c.spinner();try{r.start("Creating Next.js app..."),await O(n,q=>{r.stop(`${v.green("\u2713")} Done`),r.start(q)}),r.stop(`${v.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(`
2061
- `),"Next steps"),c.outro(`${v.green("Success!")} Your project is ready.`)}catch(o){r.stop(v.red("Failed.")),c.log.error(o instanceof Error?o.message:String(o)),process.exit(1)}}W();
2060
+ `)}async function U(t,n){t.mode==="single"?await W(t,n):await j(t,n)}async function W(t,n){let r=A(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 f(r,["app/page.tsx","app/page.module.css","app/fonts","README.md"]),await g(A(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 P(r,t),await z(r,t),await q(r,t),await E(r,t),await C(r,t),await $(r,t),await O(r,t),await M(r,t),t.installDeps&&(n?.("Installing dependencies..."),u("pnpm install",{cwd:r}))}async function j(t,n){let r=A(process.cwd(),t.name);n?.("Creating workspace..."),await _(r,t,n),t.installDeps&&(n?.("Installing dependencies..."),u("pnpm install",{cwd:r}))}async function G(){let t=process.argv[2],n=await S(t);if(!n)return;let r=c.spinner();try{r.start("Creating Next.js app..."),await U(n,l=>{r.stop(`${y.green("\u2713")} Done`),r.start(l)}),r.stop(`${y.green("\u2713")} Done`);let o=[`cd ${n.name}`,"cp .env.example .env","docker compose up -d","npx @murumets-ee/cli setup","pnpm db:migrate","pnpm dev","# Visit /setup to create your first admin user"];c.note(o.join(`
2061
+ `),"Next steps"),c.outro(`${y.green("Success!")} Your project is ready.`)}catch(o){r.stop(y.red("Failed.")),c.log.error(o instanceof Error?o.message:String(o)),process.exit(1)}}G();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@murumets-ee/create",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "license": "Elastic-2.0",
5
5
  "type": "module",
6
6
  "bin": {