@rebasepro/cli 0.4.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/README.md +20 -28
  2. package/dist/commands/init.d.ts +3 -0
  3. package/dist/commands/skills.d.ts +1 -0
  4. package/dist/index.cjs +1843 -1414
  5. package/dist/index.cjs.map +1 -1
  6. package/dist/index.es.js +1620 -1257
  7. package/dist/index.es.js.map +1 -1
  8. package/dist/utils/package-manager.d.ts +2 -0
  9. package/package.json +15 -13
  10. package/skills/rebase-api/SKILL.md +662 -0
  11. package/skills/rebase-api/references/.gitkeep +3 -0
  12. package/skills/rebase-auth/SKILL.md +1143 -0
  13. package/skills/rebase-auth/references/.gitkeep +3 -0
  14. package/skills/rebase-backend-postgres/SKILL.md +633 -0
  15. package/skills/rebase-backend-postgres/references/.gitkeep +3 -0
  16. package/skills/rebase-basics/SKILL.md +749 -0
  17. package/skills/rebase-basics/references/.gitkeep +3 -0
  18. package/skills/rebase-collections/SKILL.md +1328 -0
  19. package/skills/rebase-collections/references/.gitkeep +3 -0
  20. package/skills/rebase-cron-jobs/SKILL.md +699 -0
  21. package/skills/rebase-cron-jobs/references/.gitkeep +1 -0
  22. package/skills/rebase-custom-functions/SKILL.md +233 -0
  23. package/skills/rebase-deployment/SKILL.md +583 -0
  24. package/skills/rebase-deployment/references/.gitkeep +3 -0
  25. package/skills/rebase-design-language/SKILL.md +664 -0
  26. package/skills/rebase-email/SKILL.md +701 -0
  27. package/skills/rebase-email/references/.gitkeep +1 -0
  28. package/skills/rebase-entity-history/SKILL.md +485 -0
  29. package/skills/rebase-entity-history/references/.gitkeep +1 -0
  30. package/skills/rebase-local-env-setup/SKILL.md +189 -0
  31. package/skills/rebase-local-env-setup/references/.gitkeep +3 -0
  32. package/skills/rebase-realtime/SKILL.md +755 -0
  33. package/skills/rebase-realtime/references/.gitkeep +3 -0
  34. package/skills/rebase-sdk/SKILL.md +594 -0
  35. package/skills/rebase-sdk/references/.gitkeep +0 -0
  36. package/skills/rebase-storage/SKILL.md +765 -0
  37. package/skills/rebase-storage/references/.gitkeep +3 -0
  38. package/skills/rebase-studio/SKILL.md +746 -0
  39. package/skills/rebase-studio/references/.gitkeep +3 -0
  40. package/skills/rebase-ui-components/SKILL.md +1411 -0
  41. package/skills/rebase-ui-components/references/.gitkeep +3 -0
  42. package/skills/rebase-webhooks/SKILL.md +623 -0
  43. package/skills/rebase-webhooks/references/.gitkeep +1 -0
  44. package/templates/template/AGENTS.md +2 -0
  45. package/templates/template/CLAUDE.md +2 -0
  46. package/templates/template/ai-instructions.md +6 -3
  47. package/templates/template/backend/drizzle.config.ts +8 -5
  48. package/templates/template/backend/package.json +1 -1
  49. package/templates/template/backend/src/env.ts +1 -1
  50. package/templates/template/backend/src/index.ts +9 -6
  51. package/templates/template/config/collections/posts.ts +1 -1
  52. package/templates/template/config/collections/presets/blank/index.ts +3 -0
  53. package/templates/template/config/collections/presets/ecommerce/categories.ts +38 -0
  54. package/templates/template/config/collections/presets/ecommerce/index.ts +6 -0
  55. package/templates/template/config/collections/presets/ecommerce/orders.ts +64 -0
  56. package/templates/template/config/collections/presets/ecommerce/products.ts +62 -0
  57. package/templates/template/config/collections/users.ts +7 -10
  58. package/templates/template/docker-compose.yml +1 -1
  59. package/templates/template/frontend/package.json +2 -2
  60. package/templates/template/frontend/src/App.tsx +1 -7
  61. package/templates/template/frontend/vite.config.ts +0 -1
  62. package/templates/template/package.json +7 -0
  63. package/dist/commands/cli.test.d.ts +0 -1
  64. package/dist/commands/dev.test.d.ts +0 -1
  65. package/dist/commands/init.test.d.ts +0 -1
  66. package/dist/utils/package-manager.test.d.ts +0 -1
  67. package/dist/utils/project.test.d.ts +0 -1
@@ -17,6 +17,6 @@ export const env = loadEnv({
17
17
  SMTP_PASS: z.string().optional(),
18
18
  SMTP_FROM: z.string().optional(),
19
19
  SMTP_NAME: z.string().optional(),
20
- APP_NAME: z.string().default("Rebase"),
20
+ APP_NAME: z.string().default("Rebase")
21
21
  })
22
22
  });
@@ -63,8 +63,10 @@ async function startServer() {
63
63
  // Default security rules for collections that don't define their own.
64
64
  // Authenticated users can read all rows; only admins can write.
65
65
  const defaultSecurityRules: SecurityRule[] = [
66
- { operation: "select", access: "public" },
67
- { operations: ["insert", "update", "delete"], roles: ["admin"] }
66
+ { operation: "select",
67
+ access: "public" },
68
+ { operations: ["insert", "update", "delete"],
69
+ roles: ["admin"] }
68
70
  ];
69
71
 
70
72
  const backend = await initializeRebaseBackend({
@@ -99,14 +101,15 @@ relations },
99
101
  port: env.SMTP_PORT,
100
102
  secure: env.SMTP_SECURE,
101
103
  auth: env.SMTP_USER
102
- ? { user: env.SMTP_USER, pass: env.SMTP_PASS! }
104
+ ? { user: env.SMTP_USER,
105
+ pass: env.SMTP_PASS! }
103
106
  : undefined,
104
- name: env.SMTP_NAME,
107
+ name: env.SMTP_NAME
105
108
  },
106
109
  appName: env.APP_NAME,
107
- resetPasswordUrl: env.FRONTEND_URL,
110
+ resetPasswordUrl: env.FRONTEND_URL
108
111
  }
109
- : undefined,
112
+ : undefined
110
113
  },
111
114
  storage: env.STORAGE_TYPE === "s3"
112
115
  ? {
@@ -26,7 +26,7 @@ const postsCollection: EntityCollection = {
26
26
  content: {
27
27
  name: "Content",
28
28
  type: "string",
29
- multiline: true
29
+ markdown: true
30
30
  },
31
31
  status: {
32
32
  name: "Status",
@@ -0,0 +1,3 @@
1
+ import usersCollection from "../../users.js";
2
+
3
+ export const collections = [usersCollection];
@@ -0,0 +1,38 @@
1
+ import { EntityCollection } from "@rebasepro/types";
2
+
3
+ const categoriesCollection: EntityCollection = {
4
+ name: "Categories",
5
+ singularName: "Category",
6
+ slug: "categories",
7
+ table: "categories",
8
+ icon: "Category",
9
+ properties: {
10
+ id: {
11
+ name: "ID",
12
+ type: "number",
13
+ isId: "increment"
14
+ },
15
+ name: {
16
+ name: "Name",
17
+ type: "string",
18
+ validation: { required: true }
19
+ },
20
+ slug: {
21
+ name: "Slug",
22
+ type: "string",
23
+ validation: { required: true }
24
+ },
25
+ description: {
26
+ name: "Description",
27
+ type: "string",
28
+ multiline: true
29
+ },
30
+ icon: {
31
+ name: "Icon",
32
+ type: "string"
33
+ }
34
+ },
35
+ propertiesOrder: ["id", "name", "slug", "description", "icon"]
36
+ };
37
+
38
+ export default categoriesCollection;
@@ -0,0 +1,6 @@
1
+ import productsCollection from "./products.js";
2
+ import categoriesCollection from "./categories.js";
3
+ import ordersCollection from "./orders.js";
4
+ import usersCollection from "../../users.js";
5
+
6
+ export const collections = [productsCollection, categoriesCollection, ordersCollection, usersCollection];
@@ -0,0 +1,64 @@
1
+ import { EntityCollection } from "@rebasepro/types";
2
+
3
+ const ordersCollection: EntityCollection = {
4
+ name: "Orders",
5
+ singularName: "Order",
6
+ slug: "orders",
7
+ table: "orders",
8
+ icon: "Receipt",
9
+ properties: {
10
+ id: {
11
+ name: "ID",
12
+ type: "number",
13
+ isId: "increment"
14
+ },
15
+ customerEmail: {
16
+ name: "Customer Email",
17
+ type: "string",
18
+ columnName: "customer_email",
19
+ validation: { required: true }
20
+ },
21
+ status: {
22
+ name: "Status",
23
+ type: "string",
24
+ enum: [
25
+ { id: "pending",
26
+ label: "Pending",
27
+ color: "gray" },
28
+ { id: "processing",
29
+ label: "Processing",
30
+ color: "blue" },
31
+ { id: "shipped",
32
+ label: "Shipped",
33
+ color: "orange" },
34
+ { id: "delivered",
35
+ label: "Delivered",
36
+ color: "green" },
37
+ { id: "cancelled",
38
+ label: "Cancelled",
39
+ color: "red" }
40
+ ]
41
+ },
42
+ total: {
43
+ name: "Total",
44
+ type: "number",
45
+ validation: { required: true }
46
+ },
47
+ notes: {
48
+ name: "Notes",
49
+ type: "string",
50
+ multiline: true
51
+ },
52
+ createdAt: {
53
+ name: "Created At",
54
+ type: "date",
55
+ columnName: "created_at",
56
+ autoValue: "on_create",
57
+ ui: {
58
+ readOnly: true
59
+ }
60
+ }
61
+ }
62
+ };
63
+
64
+ export default ordersCollection;
@@ -0,0 +1,62 @@
1
+ import { EntityCollection } from "@rebasepro/types";
2
+ import categoriesCollection from "./categories.js";
3
+
4
+ const productsCollection: EntityCollection = {
5
+ name: "Products",
6
+ singularName: "Product",
7
+ slug: "products",
8
+ table: "products",
9
+ icon: "ShoppingCart",
10
+ properties: {
11
+ id: {
12
+ name: "ID",
13
+ type: "number",
14
+ isId: "increment"
15
+ },
16
+ name: {
17
+ name: "Name",
18
+ type: "string",
19
+ validation: { required: true }
20
+ },
21
+ description: {
22
+ name: "Description",
23
+ type: "string",
24
+ markdown: true
25
+ },
26
+ price: {
27
+ name: "Price",
28
+ type: "number",
29
+ validation: { required: true }
30
+ },
31
+ image: {
32
+ name: "Image",
33
+ type: "string",
34
+ storage: { storagePath: "product_images/" }
35
+ },
36
+ status: {
37
+ name: "Status",
38
+ type: "string",
39
+ enum: [
40
+ { id: "draft",
41
+ label: "Draft",
42
+ color: "gray" },
43
+ { id: "active",
44
+ label: "Active",
45
+ color: "green" },
46
+ { id: "archived",
47
+ label: "Archived",
48
+ color: "orange" }
49
+ ]
50
+ },
51
+ category: {
52
+ name: "Category",
53
+ type: "relation",
54
+ relationName: "category",
55
+ target: () => categoriesCollection,
56
+ cardinality: "one",
57
+ direction: "owning"
58
+ }
59
+ }
60
+ };
61
+
62
+ export default productsCollection;
@@ -1,10 +1,10 @@
1
1
  import type { EntityCollection } from "@rebasepro/types";
2
- import { resetPasswordAction, deleteEntityAction } from "@rebasepro/admin";
3
2
 
4
3
  const usersCollection: EntityCollection = {
5
4
  name: "Users",
6
5
  singularName: "User",
7
6
  slug: "users",
7
+ auth: { enabled: true },
8
8
  table: "users",
9
9
  schema: "rebase",
10
10
  icon: "Users",
@@ -12,15 +12,10 @@ const usersCollection: EntityCollection = {
12
12
  openEntityMode: "dialog",
13
13
  disableDefaultActions: ["copy"],
14
14
  securityRules: [
15
- { operation: "select", roles: ["admin"] },
16
- { operations: ["insert", "update", "delete"], roles: ["admin"] }
17
- ],
18
- entityActions: [
19
- resetPasswordAction,
20
- {
21
- ...deleteEntityAction,
22
- collapsed: false
23
- }
15
+ { operation: "select",
16
+ roles: ["admin"] },
17
+ { operations: ["insert", "update", "delete"],
18
+ roles: ["admin"] }
24
19
  ],
25
20
  sort: ["createdAt", "desc"],
26
21
  properties: {
@@ -108,6 +103,8 @@ const usersCollection: EntityCollection = {
108
103
  metadata: {
109
104
  name: "Metadata",
110
105
  type: "map",
106
+ keyValue: true,
107
+ properties: {},
111
108
  defaultValue: {},
112
109
  ui: {
113
110
  hideFromCollection: true,
@@ -24,7 +24,7 @@ services:
24
24
  ports:
25
25
  - "5432:5432"
26
26
  volumes:
27
- - postgres_data:/var/lib/postgresql/data
27
+ - postgres_data:/var/lib/postgresql
28
28
  healthcheck:
29
29
  test: ["CMD-SHELL", "pg_isready -U rebase -d rebase"]
30
30
  interval: 5s
@@ -44,10 +44,10 @@
44
44
  "@types/node": "^20.19.41",
45
45
  "@types/react": "^19.0.8",
46
46
  "@types/react-dom": "^19.0.3",
47
- "@vitejs/plugin-react": "^4.3.4",
47
+ "@vitejs/plugin-react": "^4.4.1",
48
48
  "tailwindcss": "^4.1.3",
49
49
  "typescript": "^5.9.2",
50
- "vite": "^5.4.17",
50
+ "vite": "^6.4.3",
51
51
  "vite-plugin-svgr": "^4.3.0"
52
52
  }
53
53
  }
@@ -3,7 +3,7 @@ import React from "react";
3
3
  import "@fontsource/jetbrains-mono";
4
4
  import "@fontsource/rubik";
5
5
 
6
- import { useRebaseAuthController, useBackendUserManagement } from "@rebasepro/auth";
6
+ import { useRebaseAuthController } from "@rebasepro/auth";
7
7
  import { Rebase, RebaseAuth } from "@rebasepro/core";
8
8
  import { RebaseCMS, RebaseShell } from "@rebasepro/admin";
9
9
  import { ErrorBoundary } from "@rebasepro/ui";
@@ -25,17 +25,11 @@ export function App() {
25
25
  googleClientId: GOOGLE_CLIENT_ID
26
26
  });
27
27
 
28
- const userManagement = useBackendUserManagement({
29
- client: rebaseClient,
30
- currentUser: authController.user
31
- });
32
-
33
28
  return (
34
29
  <ErrorBoundary fullPage>
35
30
  <Rebase
36
31
  client={rebaseClient}
37
32
  authController={authController}
38
- userManagement={userManagement}
39
33
  >
40
34
  <RebaseAuth />
41
35
  <RebaseCMS
@@ -1,4 +1,3 @@
1
- // @ts-ignore
2
1
  import path from "path";
3
2
  import { defineConfig } from "vite";
4
3
  import react from "@vitejs/plugin-react";
@@ -20,6 +20,7 @@
20
20
  "db:studio": "rebase db studio",
21
21
  "schema:generate": "rebase schema generate --collections ../config/collections",
22
22
  "generate:sdk": "rebase generate-sdk",
23
+ "skills:install": "rebase skills install",
23
24
  "deploy": "rebase build && rebase start"
24
25
  },
25
26
  "devDependencies": {
@@ -29,5 +30,11 @@
29
30
  },
30
31
  "engines": {
31
32
  "node": ">=18.0.0"
33
+ },
34
+ "pnpm": {
35
+ "onlyBuiltDependencies": [
36
+ "esbuild",
37
+ "sharp"
38
+ ]
32
39
  }
33
40
  }
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};