@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.
- package/README.md +20 -28
- package/dist/commands/init.d.ts +3 -0
- package/dist/commands/skills.d.ts +1 -0
- package/dist/index.cjs +1843 -1414
- package/dist/index.cjs.map +1 -1
- package/dist/index.es.js +1620 -1257
- package/dist/index.es.js.map +1 -1
- package/dist/utils/package-manager.d.ts +2 -0
- package/package.json +15 -13
- package/skills/rebase-api/SKILL.md +662 -0
- package/skills/rebase-api/references/.gitkeep +3 -0
- package/skills/rebase-auth/SKILL.md +1143 -0
- package/skills/rebase-auth/references/.gitkeep +3 -0
- package/skills/rebase-backend-postgres/SKILL.md +633 -0
- package/skills/rebase-backend-postgres/references/.gitkeep +3 -0
- package/skills/rebase-basics/SKILL.md +749 -0
- package/skills/rebase-basics/references/.gitkeep +3 -0
- package/skills/rebase-collections/SKILL.md +1328 -0
- package/skills/rebase-collections/references/.gitkeep +3 -0
- package/skills/rebase-cron-jobs/SKILL.md +699 -0
- package/skills/rebase-cron-jobs/references/.gitkeep +1 -0
- package/skills/rebase-custom-functions/SKILL.md +233 -0
- package/skills/rebase-deployment/SKILL.md +583 -0
- package/skills/rebase-deployment/references/.gitkeep +3 -0
- package/skills/rebase-design-language/SKILL.md +664 -0
- package/skills/rebase-email/SKILL.md +701 -0
- package/skills/rebase-email/references/.gitkeep +1 -0
- package/skills/rebase-entity-history/SKILL.md +485 -0
- package/skills/rebase-entity-history/references/.gitkeep +1 -0
- package/skills/rebase-local-env-setup/SKILL.md +189 -0
- package/skills/rebase-local-env-setup/references/.gitkeep +3 -0
- package/skills/rebase-realtime/SKILL.md +755 -0
- package/skills/rebase-realtime/references/.gitkeep +3 -0
- package/skills/rebase-sdk/SKILL.md +594 -0
- package/skills/rebase-sdk/references/.gitkeep +0 -0
- package/skills/rebase-storage/SKILL.md +765 -0
- package/skills/rebase-storage/references/.gitkeep +3 -0
- package/skills/rebase-studio/SKILL.md +746 -0
- package/skills/rebase-studio/references/.gitkeep +3 -0
- package/skills/rebase-ui-components/SKILL.md +1411 -0
- package/skills/rebase-ui-components/references/.gitkeep +3 -0
- package/skills/rebase-webhooks/SKILL.md +623 -0
- package/skills/rebase-webhooks/references/.gitkeep +1 -0
- package/templates/template/AGENTS.md +2 -0
- package/templates/template/CLAUDE.md +2 -0
- package/templates/template/ai-instructions.md +6 -3
- package/templates/template/backend/drizzle.config.ts +8 -5
- package/templates/template/backend/package.json +1 -1
- package/templates/template/backend/src/env.ts +1 -1
- package/templates/template/backend/src/index.ts +9 -6
- package/templates/template/config/collections/posts.ts +1 -1
- package/templates/template/config/collections/presets/blank/index.ts +3 -0
- package/templates/template/config/collections/presets/ecommerce/categories.ts +38 -0
- package/templates/template/config/collections/presets/ecommerce/index.ts +6 -0
- package/templates/template/config/collections/presets/ecommerce/orders.ts +64 -0
- package/templates/template/config/collections/presets/ecommerce/products.ts +62 -0
- package/templates/template/config/collections/users.ts +7 -10
- package/templates/template/docker-compose.yml +1 -1
- package/templates/template/frontend/package.json +2 -2
- package/templates/template/frontend/src/App.tsx +1 -7
- package/templates/template/frontend/vite.config.ts +0 -1
- package/templates/template/package.json +7 -0
- package/dist/commands/cli.test.d.ts +0 -1
- package/dist/commands/dev.test.d.ts +0 -1
- package/dist/commands/init.test.d.ts +0 -1
- package/dist/utils/package-manager.test.d.ts +0 -1
- package/dist/utils/project.test.d.ts +0 -1
|
@@ -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",
|
|
67
|
-
|
|
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,
|
|
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
|
? {
|
|
@@ -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",
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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,
|
|
@@ -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.
|
|
47
|
+
"@vitejs/plugin-react": "^4.4.1",
|
|
48
48
|
"tailwindcss": "^4.1.3",
|
|
49
49
|
"typescript": "^5.9.2",
|
|
50
|
-
"vite": "^
|
|
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
|
|
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
|
|
@@ -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 {};
|