@revealui/cli 0.2.0 → 0.3.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.
Files changed (66) hide show
  1. package/README.md +114 -6
  2. package/bin/create-revealui.js +3 -3
  3. package/bin/revealui.js +6 -0
  4. package/dist/cli.d.ts +3 -1
  5. package/dist/cli.js +1403 -673
  6. package/dist/cli.js.map +1 -1
  7. package/dist/index.d.ts +0 -10
  8. package/dist/index.js +1384 -657
  9. package/dist/index.js.map +1 -1
  10. package/package.json +15 -6
  11. package/templates/{minimal → basic-blog}/package.json +8 -6
  12. package/templates/basic-blog/postcss.config.mjs +5 -0
  13. package/templates/basic-blog/revealui.config.ts +19 -0
  14. package/templates/basic-blog/src/app/globals.css +6 -0
  15. package/templates/{minimal → basic-blog}/src/app/layout.tsx +4 -4
  16. package/templates/basic-blog/src/app/page.tsx +57 -0
  17. package/templates/basic-blog/src/app/posts/[slug]/page.tsx +66 -0
  18. package/templates/basic-blog/src/app/posts/page.tsx +61 -0
  19. package/templates/basic-blog/src/collections/Posts.ts +42 -0
  20. package/templates/basic-blog/src/seed.ts +73 -0
  21. package/templates/{minimal → basic-blog}/tsconfig.json +1 -1
  22. package/templates/e-commerce/.env.example +36 -0
  23. package/templates/e-commerce/_gitignore +26 -0
  24. package/templates/e-commerce/next.config.mjs +10 -0
  25. package/templates/e-commerce/package.json +36 -0
  26. package/templates/e-commerce/postcss.config.mjs +5 -0
  27. package/templates/e-commerce/revealui.config.ts +20 -0
  28. package/templates/e-commerce/src/app/globals.css +6 -0
  29. package/templates/e-commerce/src/app/layout.tsx +15 -0
  30. package/templates/e-commerce/src/app/page.tsx +82 -0
  31. package/templates/e-commerce/src/app/products/[slug]/page.tsx +80 -0
  32. package/templates/e-commerce/src/app/products/page.tsx +72 -0
  33. package/templates/e-commerce/src/collections/Orders.ts +63 -0
  34. package/templates/e-commerce/src/collections/Products.ts +50 -0
  35. package/templates/e-commerce/src/seed.ts +72 -0
  36. package/templates/e-commerce/tsconfig.json +11 -0
  37. package/templates/portfolio/.env.example +36 -0
  38. package/templates/portfolio/_gitignore +26 -0
  39. package/templates/portfolio/next.config.mjs +10 -0
  40. package/templates/portfolio/package.json +36 -0
  41. package/templates/portfolio/postcss.config.mjs +5 -0
  42. package/templates/portfolio/revealui.config.ts +19 -0
  43. package/templates/portfolio/src/app/globals.css +6 -0
  44. package/templates/portfolio/src/app/layout.tsx +15 -0
  45. package/templates/portfolio/src/app/page.tsx +60 -0
  46. package/templates/portfolio/src/app/projects/[slug]/page.tsx +95 -0
  47. package/templates/portfolio/src/app/projects/page.tsx +85 -0
  48. package/templates/portfolio/src/collections/Projects.ts +49 -0
  49. package/templates/portfolio/src/seed.ts +73 -0
  50. package/templates/portfolio/tsconfig.json +11 -0
  51. package/templates/starter/.env.example +36 -0
  52. package/templates/starter/_gitignore +26 -0
  53. package/templates/starter/next.config.mjs +10 -0
  54. package/templates/starter/package.json +36 -0
  55. package/templates/starter/postcss.config.mjs +5 -0
  56. package/templates/{minimal → starter}/revealui.config.ts +4 -4
  57. package/templates/starter/src/app/globals.css +6 -0
  58. package/templates/starter/src/app/layout.tsx +15 -0
  59. package/templates/starter/src/app/page.tsx +18 -0
  60. package/templates/starter/src/seed.ts +40 -0
  61. package/templates/starter/tsconfig.json +11 -0
  62. package/templates/minimal/src/app/globals.css +0 -15
  63. package/templates/minimal/src/app/page.tsx +0 -20
  64. /package/templates/{minimal → basic-blog}/.env.example +0 -0
  65. /package/templates/{minimal → basic-blog}/_gitignore +0 -0
  66. /package/templates/{minimal → basic-blog}/next.config.mjs +0 -0
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Seed script for the portfolio template.
3
+ * Creates 3 sample projects via the RevealUI REST API.
4
+ *
5
+ * Usage: pnpm db:seed (requires the dev server to be running)
6
+ */
7
+
8
+ const API_URL = process.env.NEXT_PUBLIC_SERVER_URL || 'http://localhost:4000';
9
+
10
+ interface SeedProject {
11
+ title: string;
12
+ slug: string;
13
+ description: string;
14
+ tags: Array<{ tag: string }>;
15
+ link: string;
16
+ }
17
+
18
+ const projects: SeedProject[] = [
19
+ {
20
+ title: 'Weather Dashboard',
21
+ slug: 'weather-dashboard',
22
+ description:
23
+ 'A real-time weather dashboard built with React and a public weather API. Displays forecasts, radar maps, and severe weather alerts.',
24
+ tags: [{ tag: 'React' }, { tag: 'TypeScript' }, { tag: 'API' }],
25
+ link: 'https://github.com/example/weather-dashboard',
26
+ },
27
+ {
28
+ title: 'Task Manager CLI',
29
+ slug: 'task-manager-cli',
30
+ description:
31
+ 'A command-line task manager written in TypeScript with SQLite storage, priority sorting, and due date reminders.',
32
+ tags: [{ tag: 'TypeScript' }, { tag: 'Node.js' }, { tag: 'CLI' }],
33
+ link: 'https://github.com/example/task-manager-cli',
34
+ },
35
+ {
36
+ title: 'Design System',
37
+ slug: 'design-system',
38
+ description:
39
+ 'A component library with 30+ accessible UI primitives, built with Tailwind CSS and documented with Storybook.',
40
+ tags: [{ tag: 'React' }, { tag: 'Tailwind CSS' }, { tag: 'Storybook' }],
41
+ link: 'https://github.com/example/design-system',
42
+ },
43
+ ];
44
+
45
+ const log = (...args: unknown[]) => process.stdout.write(`${args.join(' ')}\n`);
46
+ const logErr = (...args: unknown[]) => process.stderr.write(`${args.join(' ')}\n`);
47
+
48
+ async function seed(): Promise<void> {
49
+ log(`Seeding projects to ${API_URL}...`);
50
+
51
+ for (const project of projects) {
52
+ try {
53
+ const res = await fetch(`${API_URL}/api/projects`, {
54
+ method: 'POST',
55
+ headers: { 'Content-Type': 'application/json' },
56
+ body: JSON.stringify(project),
57
+ });
58
+
59
+ if (res.ok) {
60
+ log(` Created: ${project.title}`);
61
+ } else {
62
+ const error = await res.text();
63
+ logErr(` Failed to create "${project.title}": ${error}`);
64
+ }
65
+ } catch (err) {
66
+ logErr(` Error creating "${project.title}":`, err);
67
+ }
68
+ }
69
+
70
+ log('Seeding complete.');
71
+ }
72
+
73
+ seed();
@@ -0,0 +1,11 @@
1
+ {
2
+ "extends": "@revealui/dev/ts/nextjs",
3
+ "compilerOptions": {
4
+ "baseUrl": ".",
5
+ "paths": {
6
+ "@/*": ["./src/*"]
7
+ }
8
+ },
9
+ "include": ["src", "next.config.mjs", "revealui.config.ts"],
10
+ "exclude": ["node_modules"]
11
+ }
@@ -0,0 +1,36 @@
1
+ # RevealUI Environment Variables
2
+ # Copy this file to .env.local and fill in your values before running `pnpm dev`
3
+
4
+ # ─── Core ────────────────────────────────────────────────────────────────────
5
+ # 32+ character secret used for signing sessions and tokens
6
+ REVEALUI_SECRET=change-me-to-a-long-random-secret-at-least-32-chars
7
+
8
+ # Public URL of your CMS server (must match NEXT_PUBLIC_SERVER_URL)
9
+ REVEALUI_PUBLIC_SERVER_URL=http://localhost:4000
10
+ NEXT_PUBLIC_SERVER_URL=http://localhost:4000
11
+
12
+ # ─── Database ────────────────────────────────────────────────────────────────
13
+ # PostgreSQL connection string (NeonDB, Supabase, or local Postgres)
14
+ POSTGRES_URL=postgresql://postgres:postgres@localhost:5432/revealui
15
+
16
+ # ─── Storage ─────────────────────────────────────────────────────────────────
17
+ # Vercel Blob token for file uploads (optional — leave placeholder for local dev)
18
+ BLOB_READ_WRITE_TOKEN=vercel_blob_rw_placeholder
19
+
20
+ # ─── Stripe (optional) ───────────────────────────────────────────────────────
21
+ # Use test keys during development: https://dashboard.stripe.com/test/apikeys
22
+ STRIPE_SECRET_KEY=sk_test_placeholder
23
+ STRIPE_WEBHOOK_SECRET=whsec_placeholder
24
+ NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_placeholder
25
+
26
+ # ─── Admin Bootstrap ─────────────────────────────────────────────────────────
27
+ # Used on first run only to create the initial admin account
28
+ REVEALUI_ADMIN_EMAIL=admin@example.com
29
+ REVEALUI_ADMIN_PASSWORD=changeme-min-12-chars
30
+
31
+ # ─── Branding (Enterprise white-label) ───────────────────────────────────────
32
+ # Customize the admin UI for your brand. Enterprise license required for full white-label.
33
+ # REVEALUI_BRAND_NAME=My CMS
34
+ # REVEALUI_BRAND_LOGO_URL=https://example.com/logo.png
35
+ # REVEALUI_BRAND_PRIMARY_COLOR=#ea580c
36
+ # REVEALUI_SHOW_POWERED_BY=false
@@ -0,0 +1,26 @@
1
+ # Dependencies
2
+ node_modules/
3
+ .pnp
4
+ .pnp.js
5
+
6
+ # Next.js
7
+ .next/
8
+ out/
9
+ build/
10
+
11
+ # Environment variables
12
+ .env
13
+ .env.local
14
+ .env.development.local
15
+ .env.test.local
16
+ .env.production.local
17
+
18
+ # Turbo
19
+ .turbo/
20
+
21
+ # Misc
22
+ .DS_Store
23
+ *.pem
24
+ npm-debug.log*
25
+ yarn-debug.log*
26
+ yarn-error.log*
@@ -0,0 +1,10 @@
1
+ /** @type {import('next').NextConfig} */
2
+ const nextConfig = {
3
+ experimental: {
4
+ reactCompiler: true,
5
+ },
6
+ // Required for RevealUI CMS admin panel
7
+ transpilePackages: ['@revealui/core', '@revealui/presentation'],
8
+ }
9
+
10
+ export default nextConfig
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "{{PROJECT_NAME}}",
3
+ "version": "0.0.1",
4
+ "private": true,
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "next dev --port 4000",
8
+ "build": "next build",
9
+ "start": "next start --port 4000",
10
+ "lint": "biome check .",
11
+ "typecheck": "tsc --noEmit",
12
+ "test": "vitest run",
13
+ "db:init": "revealui cms",
14
+ "db:migrate": "drizzle-kit migrate",
15
+ "db:seed": "tsx src/seed.ts"
16
+ },
17
+ "dependencies": {
18
+ "@revealui/core": "^0.2.0",
19
+ "@revealui/config": "^0.2.0",
20
+ "@revealui/db": "^0.2.0",
21
+ "@revealui/auth": "^0.2.0",
22
+ "@revealui/contracts": "^1.1.0",
23
+ "next": "^16.0.0",
24
+ "react": "^19.0.0",
25
+ "react-dom": "^19.0.0",
26
+ "sharp": "^0.34.0",
27
+ "zod": "^4.0.0"
28
+ },
29
+ "devDependencies": {
30
+ "@revealui/dev": "^0.0.1",
31
+ "@tailwindcss/postcss": "^4.1.0",
32
+ "tailwindcss": "^4.1.0",
33
+ "typescript": "^5.9.0",
34
+ "vitest": "^4.0.0"
35
+ }
36
+ }
@@ -0,0 +1,5 @@
1
+ export default {
2
+ plugins: {
3
+ '@tailwindcss/postcss': {},
4
+ },
5
+ }
@@ -1,6 +1,6 @@
1
- import config from '@revealui/config'
2
- import { buildConfig, universalPostgresAdapter } from '@revealui/core'
3
- import sharp from 'sharp'
1
+ import config from '@revealui/config';
2
+ import { buildConfig, universalPostgresAdapter } from '@revealui/core';
3
+ import sharp from 'sharp';
4
4
 
5
5
  export default buildConfig({
6
6
  serverURL: config.reveal.publicServerURL || 'http://localhost:4000',
@@ -15,4 +15,4 @@ export default buildConfig({
15
15
  globals: [],
16
16
  plugins: [],
17
17
  sharp,
18
- })
18
+ });
@@ -0,0 +1,6 @@
1
+ @import "tailwindcss";
2
+
3
+ @theme {
4
+ --color-accent: #2563eb;
5
+ --color-accent-hover: #1d4ed8;
6
+ }
@@ -0,0 +1,15 @@
1
+ import type { Metadata } from 'next';
2
+ import './globals.css';
3
+
4
+ export const metadata: Metadata = {
5
+ title: 'RevealUI App',
6
+ description: 'Built with RevealUI',
7
+ };
8
+
9
+ export default function RootLayout({ children }: { children: React.ReactNode }) {
10
+ return (
11
+ <html lang="en">
12
+ <body>{children}</body>
13
+ </html>
14
+ );
15
+ }
@@ -0,0 +1,18 @@
1
+ export default function HomePage() {
2
+ return (
3
+ <main className="mx-auto max-w-xl px-4 py-16">
4
+ <h1 className="text-3xl font-bold tracking-tight text-gray-900">RevealUI</h1>
5
+ <p className="mt-3 text-gray-600">
6
+ Your project is running. Visit{' '}
7
+ <a href="/admin" className="font-medium text-accent hover:text-accent-hover">
8
+ /admin
9
+ </a>{' '}
10
+ to manage content.
11
+ </p>
12
+ <p className="mt-6 text-sm text-gray-500">
13
+ Edit <code className="rounded bg-gray-100 px-1.5 py-0.5 text-xs">src/app/page.tsx</code> to
14
+ customize this page.
15
+ </p>
16
+ </main>
17
+ );
18
+ }
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Database seed script
3
+ *
4
+ * Run with: pnpm db:seed
5
+ *
6
+ * Customize this file to populate your database with initial data.
7
+ * The examples below show common patterns — uncomment and adapt as needed.
8
+ */
9
+
10
+ // import { getClient } from '@revealui/db/client';
11
+ // import { users, posts } from '@revealui/db/schema';
12
+
13
+ async function seed(): Promise<void> {
14
+ // const db = getClient();
15
+
16
+ // Example: create an admin user
17
+ // await db.insert(users).values({
18
+ // id: crypto.randomUUID(),
19
+ // email: 'admin@example.com',
20
+ // name: 'Admin',
21
+ // role: 'admin',
22
+ // status: 'active',
23
+ // emailVerified: true,
24
+ // });
25
+
26
+ // Example: create sample content
27
+ // await db.insert(posts).values({
28
+ // id: crypto.randomUUID(),
29
+ // title: 'Welcome to RevealUI',
30
+ // slug: 'welcome',
31
+ // status: 'published',
32
+ // });
33
+
34
+ process.stdout.write('Seed complete.\n');
35
+ }
36
+
37
+ seed().catch((error: unknown) => {
38
+ process.stderr.write(`Seed failed: ${error}\n`);
39
+ process.exit(1);
40
+ });
@@ -0,0 +1,11 @@
1
+ {
2
+ "extends": "@revealui/dev/ts/nextjs",
3
+ "compilerOptions": {
4
+ "baseUrl": ".",
5
+ "paths": {
6
+ "@/*": ["./src/*"]
7
+ }
8
+ },
9
+ "include": ["src", "next.config.mjs", "revealui.config.ts"],
10
+ "exclude": ["node_modules"]
11
+ }
@@ -1,15 +0,0 @@
1
- *, *::before, *::after {
2
- box-sizing: border-box;
3
- }
4
-
5
- body {
6
- margin: 0;
7
- font-family: system-ui, -apple-system, sans-serif;
8
- line-height: 1.6;
9
- color: #111;
10
- background: #fff;
11
- }
12
-
13
- a {
14
- color: #2563eb;
15
- }
@@ -1,20 +0,0 @@
1
- export default function HomePage() {
2
- return (
3
- <main
4
- style={{
5
- fontFamily: 'sans-serif',
6
- maxWidth: '640px',
7
- margin: '4rem auto',
8
- padding: '0 1rem',
9
- }}
10
- >
11
- <h1>Welcome to RevealUI</h1>
12
- <p>
13
- Your CMS is running. Visit <a href="/admin">/admin</a> to access the admin panel.
14
- </p>
15
- <p style={{ color: '#666', fontSize: '0.875rem' }}>
16
- Edit <code>src/app/page.tsx</code> to customise this page.
17
- </p>
18
- </main>
19
- )
20
- }
File without changes
File without changes