@rebasepro/cli 0.0.1-canary.0 → 0.0.1-canary.09e5ec5

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 (49) hide show
  1. package/dist/commands/auth.d.ts +1 -0
  2. package/dist/commands/cli.test.d.ts +1 -0
  3. package/dist/commands/db.d.ts +1 -0
  4. package/dist/commands/dev.d.ts +1 -0
  5. package/dist/commands/dev.test.d.ts +1 -0
  6. package/dist/commands/doctor.d.ts +1 -0
  7. package/dist/commands/generate_sdk.d.ts +18 -0
  8. package/dist/commands/init.d.ts +3 -0
  9. package/dist/commands/init.test.d.ts +1 -0
  10. package/dist/commands/schema.d.ts +1 -0
  11. package/dist/index.cjs +1058 -30
  12. package/dist/index.cjs.map +1 -1
  13. package/dist/index.d.ts +5 -0
  14. package/dist/index.es.js +1060 -29
  15. package/dist/index.es.js.map +1 -1
  16. package/dist/utils/project.d.ts +45 -0
  17. package/dist/utils/project.test.d.ts +1 -0
  18. package/package.json +20 -11
  19. package/templates/template/.dockerignore +28 -0
  20. package/templates/template/.env.template +42 -11
  21. package/templates/template/README.md +74 -17
  22. package/templates/template/backend/Dockerfile +55 -10
  23. package/templates/template/backend/drizzle.config.ts +15 -3
  24. package/templates/template/backend/functions/hello.ts +52 -0
  25. package/templates/template/backend/package.json +30 -34
  26. package/templates/template/backend/src/env.ts +52 -0
  27. package/templates/template/backend/src/index.ts +113 -99
  28. package/templates/template/backend/tsconfig.json +1 -1
  29. package/templates/template/config/collections/authors.ts +45 -0
  30. package/templates/template/config/collections/index.ts +5 -0
  31. package/templates/template/{shared → config}/collections/posts.ts +40 -2
  32. package/templates/template/config/collections/tags.ts +27 -0
  33. package/templates/template/config/package.json +28 -0
  34. package/templates/template/docker-compose.yml +78 -17
  35. package/templates/template/frontend/Dockerfile +36 -14
  36. package/templates/template/frontend/nginx.conf +40 -0
  37. package/templates/template/frontend/package.json +9 -10
  38. package/templates/template/frontend/src/App.tsx +24 -110
  39. package/templates/template/frontend/src/index.css +15 -1
  40. package/templates/template/frontend/src/main.tsx +2 -2
  41. package/templates/template/frontend/vite.config.ts +32 -3
  42. package/templates/template/package.json +12 -16
  43. package/templates/template/pnpm-workspace.yaml +4 -0
  44. package/templates/template/scripts/example.ts +91 -0
  45. package/templates/template/backend/scripts/db-generate.ts +0 -60
  46. package/templates/template/shared/collections/index.ts +0 -3
  47. package/templates/template/shared/package.json +0 -28
  48. /package/templates/template/{shared → config}/index.ts +0 -0
  49. /package/templates/template/{shared → config}/tsconfig.json +0 -0
@@ -0,0 +1,27 @@
1
+ import { EntityCollection } from "@rebasepro/types";
2
+
3
+ const tagsCollection: EntityCollection = {
4
+ name: "Tags",
5
+ singularName: "Tag",
6
+ slug: "tags",
7
+ table: "tags",
8
+ icon: "Tag",
9
+ properties: {
10
+ id: {
11
+ name: "ID",
12
+ type: "number",
13
+ validation: {
14
+ required: true
15
+ }
16
+ },
17
+ name: {
18
+ name: "Tag Name",
19
+ type: "string",
20
+ validation: {
21
+ required: true
22
+ }
23
+ }
24
+ }
25
+ };
26
+
27
+ export default tagsCollection;
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "{{PROJECT_NAME}}-config",
3
+ "version": "1.0.0",
4
+ "description": "Shared collections for frontend and backend",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "type": "module",
8
+ "private": true,
9
+ "scripts": {
10
+ "build": "tsc",
11
+ "dev": "tsc --watch",
12
+ "clean": "rm -rf dist"
13
+ },
14
+ "dependencies": {
15
+ "@rebasepro/types": "workspace:*"
16
+ },
17
+ "devDependencies": {
18
+ "typescript": "^5.9.2"
19
+ },
20
+ "exports": {
21
+ ".": {
22
+ "import": "./dist/index.js",
23
+ "types": "./dist/index.d.ts",
24
+ "default": "./dist/index.js"
25
+ },
26
+ "./package.json": "./package.json"
27
+ }
28
+ }
@@ -1,48 +1,109 @@
1
- version: '3.8'
1
+ # ─── Rebase — Production Docker Compose ──────────────────────────────
2
+ #
3
+ # Quick start:
4
+ # cp .env.template .env # Edit with your secrets
5
+ # docker compose up -d # Start everything
6
+ #
7
+ # This runs:
8
+ # 1. PostgreSQL 18 with persistent data
9
+ # 2. Backend (Node.js / Hono) with health checks
10
+ # 3. Frontend (nginx) serving the Vite build
11
+ #
12
+ # For development, use `pnpm dev` instead.
13
+ # ─────────────────────────────────────────────────────────────────────
2
14
 
3
15
  services:
16
+ # ── PostgreSQL ───────────────────────────────────────────────────────
4
17
  db:
5
- image: postgres:15-alpine
18
+ image: postgres:18-alpine
19
+ restart: unless-stopped
6
20
  environment:
7
- POSTGRES_USER: rebase
8
- POSTGRES_PASSWORD: rebasepassword
9
- POSTGRES_DB: rebase
21
+ POSTGRES_USER: ${POSTGRES_USER:-rebase}
22
+ POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD in .env}
23
+ POSTGRES_DB: ${POSTGRES_DB:-rebase}
10
24
  ports:
11
- - "5432:5432"
25
+ - "${POSTGRES_PORT:-5432}:5432"
12
26
  volumes:
13
27
  - postgres_data:/var/lib/postgresql/data
14
28
  healthcheck:
15
- test: ["CMD-SHELL", "pg_isready -U rebase"]
29
+ test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-rebase} -d ${POSTGRES_DB:-rebase}"]
16
30
  interval: 5s
17
31
  timeout: 5s
18
- retries: 5
32
+ retries: 10
33
+ start_period: 10s
34
+ # Production tuning (adjust for your workload)
35
+ command:
36
+ - "postgres"
37
+ - "-c"
38
+ - "shared_buffers=256MB"
39
+ - "-c"
40
+ - "max_connections=100"
41
+ - "-c"
42
+ - "work_mem=4MB"
43
+ - "-c"
44
+ - "effective_cache_size=768MB"
45
+ - "-c"
46
+ - "log_min_duration_statement=1000"
19
47
 
48
+ # ── Backend ──────────────────────────────────────────────────────────
20
49
  backend:
21
- build:
50
+ build:
22
51
  context: .
23
52
  dockerfile: backend/Dockerfile
53
+ restart: unless-stopped
24
54
  ports:
25
- - "3001:3001"
55
+ - "${PORT:-3001}:3001"
26
56
  environment:
27
- - DATABASE_URL=postgresql://rebase:rebasepassword@db:5432/rebase
28
- - JWT_SECRET=super-secret-jwt-key
29
- - NODE_ENV=development
57
+ DATABASE_URL: postgresql://${POSTGRES_USER:-rebase}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB:-rebase}
58
+ ADMIN_CONNECTION_STRING: postgresql://${POSTGRES_USER:-rebase}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB:-rebase}
59
+ JWT_SECRET: ${JWT_SECRET:?Set JWT_SECRET in .env}
60
+ JWT_ACCESS_EXPIRES_IN: ${JWT_ACCESS_EXPIRES_IN:-1h}
61
+ JWT_REFRESH_EXPIRES_IN: ${JWT_REFRESH_EXPIRES_IN:-30d}
62
+ NODE_ENV: production
63
+ PORT: "3001"
64
+ ALLOW_REGISTRATION: ${ALLOW_REGISTRATION:-false}
65
+ FRONTEND_URL: ${FRONTEND_URL:-http://localhost}
66
+ CORS_ORIGINS: ${CORS_ORIGINS:-}
67
+ # Optional Google OAuth
68
+ GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID:-}
69
+ # Optional SMTP
70
+ SMTP_HOST: ${SMTP_HOST:-}
71
+ SMTP_PORT: ${SMTP_PORT:-}
72
+ SMTP_SECURE: ${SMTP_SECURE:-}
73
+ SMTP_USER: ${SMTP_USER:-}
74
+ SMTP_PASS: ${SMTP_PASS:-}
75
+ SMTP_FROM: ${SMTP_FROM:-}
76
+ APP_NAME: ${APP_NAME:-Rebase}
77
+ # Storage
78
+ STORAGE_TYPE: ${STORAGE_TYPE:-local}
79
+ STORAGE_PATH: ${STORAGE_PATH:-/app/backend/uploads}
80
+ S3_BUCKET: ${S3_BUCKET:-}
81
+ S3_REGION: ${S3_REGION:-}
82
+ S3_ACCESS_KEY_ID: ${S3_ACCESS_KEY_ID:-}
83
+ S3_SECRET_ACCESS_KEY: ${S3_SECRET_ACCESS_KEY:-}
84
+ S3_ENDPOINT: ${S3_ENDPOINT:-}
85
+ S3_FORCE_PATH_STYLE: ${S3_FORCE_PATH_STYLE:-}
86
+ # Service key for scripts & server-to-server admin access
87
+ REBASE_SERVICE_KEY: ${REBASE_SERVICE_KEY:-}
30
88
  depends_on:
31
89
  db:
32
90
  condition: service_healthy
33
91
  volumes:
34
- - ./backend/uploads:/app/backend/uploads
92
+ - uploads:/app/backend/uploads
35
93
 
94
+ # ── Frontend ─────────────────────────────────────────────────────────
36
95
  frontend:
37
96
  build:
38
97
  context: .
39
98
  dockerfile: frontend/Dockerfile
99
+ restart: unless-stopped
40
100
  ports:
41
- - "5173:5173"
42
- environment:
43
- - VITE_API_URL=http://localhost:3001
101
+ - "${FRONTEND_PORT:-80}:80"
44
102
  depends_on:
45
103
  - backend
46
104
 
47
105
  volumes:
48
106
  postgres_data:
107
+ driver: local
108
+ uploads:
109
+ driver: local
@@ -1,28 +1,50 @@
1
- FROM node:24-alpine AS base
1
+ # ─── Multi-stage production Dockerfile for the Rebase frontend ────────
2
+ # Builds the Vite app, then serves via nginx for proper caching/compression.
3
+ #
4
+ # Build context: the project root (where pnpm-workspace.yaml lives)
5
+ # Usage:
6
+ # docker build -t my-app-frontend -f frontend/Dockerfile .
7
+
8
+ # ── Stage 1: Install + Build ─────────────────────────────────────────
9
+ FROM node:24-alpine AS builder
10
+
2
11
  ENV PNPM_HOME="/pnpm"
3
12
  ENV PATH="$PNPM_HOME:$PATH"
4
13
  RUN corepack enable
14
+
5
15
  RUN apk add --no-cache python3 make g++
6
16
 
7
17
  WORKDIR /app
8
18
 
9
- # Copy root configurations
10
- COPY package.json ./
19
+ # Copy workspace root files
20
+ COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
11
21
 
12
- # Copy internal workspaces
22
+ # Copy workspace packages
13
23
  COPY frontend ./frontend
14
- COPY shared ./shared
24
+ COPY config ./config
15
25
 
16
26
  # Install dependencies
17
- RUN pnpm install
27
+ RUN pnpm install --frozen-lockfile
28
+
29
+ # Build config first, then frontend
30
+ RUN pnpm --filter "*-config" run build
31
+ RUN pnpm --filter "*-frontend" run build
32
+
33
+ # ── Stage 2: Serve with nginx ────────────────────────────────────────
34
+ FROM nginx:1.27-alpine AS runtime
35
+
36
+ # Remove default nginx page
37
+ RUN rm -rf /usr/share/nginx/html/*
38
+
39
+ # Copy built assets
40
+ COPY --from=builder /app/frontend/dist /usr/share/nginx/html
41
+
42
+ # Custom nginx config for SPA routing + compression
43
+ COPY frontend/nginx.conf /etc/nginx/conf.d/default.conf
18
44
 
19
- # Build shared and frontend
20
- RUN pnpm run build:shared
21
- RUN pnpm run build:frontend
45
+ EXPOSE 80
22
46
 
23
- # Install a simple static server
24
- RUN npm install -g serve
47
+ HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
48
+ CMD wget --no-verbose --tries=1 --spider http://localhost:80/ || exit 1
25
49
 
26
- WORKDIR /app/frontend
27
- EXPOSE 5173
28
- CMD ["serve", "-s", "dist", "-l", "5173"]
50
+ CMD ["nginx", "-g", "daemon off;"]
@@ -0,0 +1,40 @@
1
+ server {
2
+ listen 80;
3
+ server_name _;
4
+
5
+ root /usr/share/nginx/html;
6
+ index index.html;
7
+
8
+ # Gzip compression
9
+ gzip on;
10
+ gzip_vary on;
11
+ gzip_proxied any;
12
+ gzip_comp_level 6;
13
+ gzip_min_length 256;
14
+ gzip_types
15
+ text/plain
16
+ text/css
17
+ text/javascript
18
+ application/javascript
19
+ application/json
20
+ application/xml
21
+ image/svg+xml
22
+ font/woff2;
23
+
24
+ # Cache static assets aggressively (hashed filenames from Vite)
25
+ location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
26
+ expires 1y;
27
+ add_header Cache-Control "public, immutable";
28
+ try_files $uri =404;
29
+ }
30
+
31
+ # SPA fallback: serve index.html for all non-file routes
32
+ location / {
33
+ try_files $uri $uri/ /index.html;
34
+ }
35
+
36
+ # Security headers
37
+ add_header X-Frame-Options "SAMEORIGIN" always;
38
+ add_header X-Content-Type-Options "nosniff" always;
39
+ add_header Referrer-Policy "strict-origin-when-cross-origin" always;
40
+ }
@@ -4,17 +4,16 @@
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "dependencies": {
7
- "@rebasepro/auth": "^4.0.0",
8
- "@rebasepro/core": "^4.0.0",
9
- "@rebasepro/data_enhancement": "^4.0.0",
10
- "@rebasepro/data_export": "^4.0.0",
11
- "@rebasepro/data_import": "^4.0.0",
12
- "@rebasepro/postgresql": "^4.0.0",
13
- "@rebasepro/studio": "^4.0.0",
14
- "@rebasepro/types": "^4.0.0",
15
- "@rebasepro/ui": "^4.0.0",
7
+ "@rebasepro/auth": "workspace:*",
8
+ "@rebasepro/core": "workspace:*",
9
+ "@rebasepro/plugin-data-enhancement": "workspace:*",
10
+ "@rebasepro/client": "workspace:*",
11
+ "@rebasepro/admin": "workspace:*",
12
+ "@rebasepro/studio": "workspace:*",
13
+ "@rebasepro/types": "workspace:*",
14
+ "@rebasepro/ui": "workspace:*",
16
15
  "@fontsource/jetbrains-mono": "^5.2.5",
17
- "{{PROJECT_NAME}}-shared": "workspace:*",
16
+ "{{PROJECT_NAME}}-config": "workspace:*",
18
17
  "react": "^19.0.0",
19
18
  "react-dom": "^19.0.0",
20
19
  "react-router": "^7.0.0",
@@ -1,132 +1,46 @@
1
- import React, { useCallback } from "react";
1
+ import React from "react";
2
2
 
3
3
  import "@fontsource/jetbrains-mono";
4
4
  import "typeface-rubik";
5
5
 
6
- import {
7
- RebaseLoginView,
8
- useBackendUserManagement,
9
- useRebaseAuthController
10
- } from "@rebasepro/auth";
11
- import {
12
- AppBar,
13
- CircularProgressCenter,
14
- Drawer,
15
- Rebase,
16
- RebaseRoute,
17
- ModeControllerProvider,
18
- NotFoundPage,
19
- Scaffold,
20
- SideDialogs,
21
- RebaseRoutes,
22
- SnackbarProvider,
23
- ContentHomePage,
24
- useBackendStorageSource,
25
- useBuildCMSUrlController,
26
- useBuildCollectionRegistryController,
27
- useBuildLocalConfigurationPersistence,
28
- useBuildModeController,
29
- useBuildNavigationStateController
30
- } from "@rebasepro/core";
31
- import { usePostgresClientDataSource } from "@rebasepro/postgresql";
6
+ import { useRebaseAuthController, useBackendUserManagement, RebaseAuth } from "@rebasepro/auth";
7
+ import { Rebase } from "@rebasepro/core";
8
+ import { RebaseCMS, RebaseShell } from "@rebasepro/admin";
9
+ import { RebaseStudio } from "@rebasepro/studio";
10
+ import { createRebaseClient } from "@rebasepro/client";
32
11
  import { collections } from "virtual:rebase-collections";
33
- import { Route, Outlet } from "react-router-dom";
34
12
 
35
13
  // Configuration from environment
36
- const API_URL = import.meta.env.VITE_API_URL || "http://localhost:3001";
14
+ const API_URL = import.meta.env.VITE_API_URL || (import.meta.env.DEV ? "http://localhost:3001" : undefined);
37
15
  const GOOGLE_CLIENT_ID = import.meta.env.VITE_GOOGLE_CLIENT_ID;
38
16
 
39
17
  export function App() {
40
- const modeController = useBuildModeController();
41
- const userConfigPersistence = useBuildLocalConfigurationPersistence();
18
+ const rebaseClient = React.useMemo(() => createRebaseClient({
19
+ baseUrl: API_URL
20
+ }), []);
42
21
 
43
22
  const authController = useRebaseAuthController({
44
- apiUrl: API_URL,
23
+ client: rebaseClient,
45
24
  googleClientId: GOOGLE_CLIENT_ID
46
25
  });
47
26
 
48
- const storageSource = useBackendStorageSource({
49
- apiUrl: API_URL,
50
- getAuthToken: authController.getAuthToken
51
- });
52
-
53
27
  const userManagement = useBackendUserManagement({
54
- apiUrl: API_URL,
55
- getAuthToken: authController.getAuthToken,
28
+ client: rebaseClient,
56
29
  currentUser: authController.user
57
30
  });
58
31
 
59
- const postgresDelegate = usePostgresClientDataSource({
60
- websocketUrl: API_URL.replace(/^http/, "ws"),
61
- getAuthToken: authController.initialLoading ? undefined : authController.getAuthToken
62
- });
63
-
64
- const collectionsBuilder = useCallback(() => {
65
- return [...collections];
66
- }, []);
67
-
68
- const collectionRegistryController = useBuildCollectionRegistryController({ userConfigPersistence });
69
- const cmsUrlController = useBuildCMSUrlController({
70
- basePath: "/",
71
- baseCollectionPath: "/c",
72
- collectionRegistryController
73
- });
74
-
75
- const navigationStateController = useBuildNavigationStateController({
76
- collections: collectionsBuilder,
77
- authController,
78
- dataSource: postgresDelegate,
79
- collectionRegistryController,
80
- cmsUrlController,
81
- userManagement
82
- });
83
-
84
32
  return (
85
- <SnackbarProvider>
86
- <ModeControllerProvider value={modeController}>
87
- <Rebase
88
- collectionRegistryController={collectionRegistryController}
89
- cmsUrlController={cmsUrlController}
90
- navigationStateController={navigationStateController}
91
- authController={authController}
92
- userConfigPersistence={userConfigPersistence}
93
- dataSource={postgresDelegate}
94
- storageSource={storageSource}
95
- >
96
- {({ loading }) => {
97
- if (loading || authController.initialLoading) {
98
- return <CircularProgressCenter />;
99
- }
100
-
101
- if (!authController.user) {
102
- return (
103
- <RebaseLoginView
104
- authController={authController}
105
- googleEnabled={!!GOOGLE_CLIENT_ID}
106
- googleClientId={GOOGLE_CLIENT_ID}
107
- />
108
- );
109
- }
110
-
111
- return (
112
- <RebaseRoutes>
113
- <Route element={
114
- <Scaffold autoOpenDrawer={false}>
115
- <AppBar />
116
- <Drawer />
117
- <Outlet />
118
- <SideDialogs />
119
- </Scaffold>
120
- }>
121
- <Route path={"/"} element={<ContentHomePage />} />
122
- <Route path={"/c/*"} element={<RebaseRoute />} />
123
- <Route path={"*"} element={<NotFoundPage />} />
124
- </Route>
125
- </RebaseRoutes>
126
- );
127
- }}
128
- </Rebase>
129
- </ModeControllerProvider>
130
- </SnackbarProvider>
33
+ <Rebase
34
+ client={rebaseClient}
35
+ authController={authController}
36
+ userManagement={userManagement}
37
+ >
38
+ <RebaseAuth />
39
+ <RebaseCMS
40
+ collections={collections}
41
+ />
42
+ <RebaseStudio/>
43
+ <RebaseShell title="Rebase"/>
44
+ </Rebase>
131
45
  );
132
46
  }
@@ -1,2 +1,16 @@
1
1
  @import "tailwindcss";
2
- @import "@rebasepro/ui/index.css";
2
+ @import "@rebasepro/ui/index.css" layer(base);
3
+
4
+ @source "../node_modules/@rebasepro";
5
+
6
+ @custom-variant dark (&:where(.dark, .dark *));
7
+
8
+ @layer utilities {
9
+ body {
10
+ @apply w-full min-h-screen bg-surface-50 dark:bg-surface-900 flex flex-col items-center justify-center;
11
+ }
12
+
13
+ a {
14
+ @apply text-primary dark:text-primary;
15
+ }
16
+ }
@@ -7,12 +7,12 @@ import "./index.css";
7
7
  const router = createBrowserRouter([
8
8
  {
9
9
  path: "/*",
10
- element: <App />
10
+ element: <App/>
11
11
  }
12
12
  ]);
13
13
 
14
14
  ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
15
15
  <React.StrictMode>
16
- <RouterProvider router={router} />
16
+ <RouterProvider router={router}/>
17
17
  </React.StrictMode>
18
18
  );
@@ -12,15 +12,44 @@ export default defineConfig({
12
12
  },
13
13
  build: {
14
14
  minify: true,
15
- outDir: "./build",
15
+ outDir: "./dist",
16
16
  target: "ESNEXT",
17
- sourcemap: true
17
+ sourcemap: true,
18
+ rollupOptions: {
19
+ output: {
20
+ manualChunks(id) {
21
+ // Heavy vendor libraries — split into individually cached chunks
22
+ if (id.includes("xlsx")) return "vendor-xlsx";
23
+ if (id.includes("prosemirror")) return "vendor-prosemirror";
24
+ if (id.includes("monaco-editor") || id.includes("@monaco-editor")) return "vendor-monaco";
25
+ if (id.includes("@xyflow") || id.includes("dagre")) return "vendor-xyflow";
26
+ if (id.includes("@dnd-kit")) return "vendor-dnd";
27
+ if (id.includes("prism-react-renderer")) return "vendor-prism";
28
+ if (id.includes("markdown-it")) return "vendor-markdown";
29
+ if (id.includes("react-dropzone")) return "vendor-dropzone";
30
+ if (id.includes("date-fns")) return "vendor-datefns";
31
+ if (id.includes("fuse.js")) return "vendor-fuse";
32
+ if (id.includes("node_modules/react-dom/")) return "vendor-react-dom";
33
+ if (id.includes("node_modules/react-router") || id.includes("node_modules/@remix-run")) return "vendor-react-router";
34
+ if (id.includes("node_modules/@radix-ui/")) return "vendor-radix";
35
+ if (id.includes("node_modules/framer-motion/")) return "vendor-framer-motion";
36
+ if (id.includes("node_modules/zod/")) return "vendor-zod";
37
+ if (id.includes("node_modules/i18next") || id.includes("node_modules/react-i18next")) return "vendor-i18next";
38
+ if (id.includes("node_modules/@floating-ui/")) return "vendor-floating-ui";
39
+ if (id.includes("node_modules/tailwind-merge/")) return "vendor-tailwind-merge";
40
+ if (id.includes("node_modules/notistack/")) return "vendor-notistack";
41
+ if (id.includes("node_modules/lucide-react/")) return "vendor-lucide-react";
42
+
43
+ return undefined;
44
+ }
45
+ }
46
+ }
18
47
  },
19
48
  optimizeDeps: { include: ["react/jsx-runtime"] },
20
49
  plugins: [
21
50
  svgr(),
22
51
  react({}),
23
52
  tailwindcss(),
24
- rebaseCollectionsPlugin({ collectionsDir: "../shared/collections" })
53
+ rebaseCollectionsPlugin({ collectionsDir: "../config/collections" })
25
54
  ]
26
55
  });
@@ -4,25 +4,21 @@
4
4
  "description": "Rebase application with PostgreSQL backend",
5
5
  "private": true,
6
6
  "type": "module",
7
- "workspaces": [
8
- "frontend",
9
- "backend",
10
- "shared"
11
- ],
12
7
  "scripts": {
13
- "dev": "concurrently \"pnpm run dev:backend\" \"pnpm run dev:frontend\"",
14
- "dev:frontend": "cd frontend && pnpm run dev",
15
- "dev:backend": "cd backend && pnpm run dev",
16
- "build": "pnpm run build:shared && pnpm run build:frontend && pnpm run build:backend",
17
- "build:shared": "cd shared && pnpm run build",
18
- "build:frontend": "cd frontend && pnpm run build",
19
- "build:backend": "cd backend && pnpm run build",
20
- "start": "cd backend && pnpm start",
21
- "db:generate": "cd backend && pnpm run db:generate",
22
- "db:migrate": "cd backend && pnpm run db:migrate",
23
- "db:studio": "cd backend && pnpm run db:studio"
8
+ "dev": "rebase dev",
9
+ "build": "pnpm -r run build",
10
+ "start": "pnpm --filter \"*-backend\" start",
11
+ "db:generate": "rebase db generate --collections ../config/collections",
12
+ "db:migrate": "rebase db migrate",
13
+ "db:pull": "rebase db pull",
14
+ "db:push": "rebase db push --collections ../config/collections",
15
+ "db:studio": "rebase db studio",
16
+ "schema:generate": "rebase schema generate --collections ../config/collections",
17
+ "generate:sdk": "rebase generate-sdk",
18
+ "deploy": "pnpm run build && pnpm run start"
24
19
  },
25
20
  "devDependencies": {
21
+ "@rebasepro/cli": "workspace:*",
26
22
  "concurrently": "^8.2.2",
27
23
  "typescript": "^5.9.2"
28
24
  },
@@ -0,0 +1,4 @@
1
+ packages:
2
+ - "frontend"
3
+ - "backend"
4
+ - "config"