@rebasepro/cli 0.4.0 → 0.5.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rebasepro/cli",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "Developer tools for Rebase projects",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.es.js",
@@ -31,10 +31,10 @@
31
31
  "execa": "^9.6.1",
32
32
  "inquirer": "12.11.1",
33
33
  "jiti": "^2.7.0",
34
- "@rebasepro/sdk-generator": "0.4.0",
35
- "@rebasepro/types": "0.4.0",
36
- "@rebasepro/server-core": "0.4.0",
37
- "@rebasepro/server-postgresql": "0.4.0"
34
+ "@rebasepro/sdk-generator": "0.5.0",
35
+ "@rebasepro/types": "0.5.0",
36
+ "@rebasepro/server-postgresql": "0.5.0",
37
+ "@rebasepro/server-core": "0.5.0"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@types/node": "^20.19.41",
@@ -16,15 +16,18 @@ if (!process.env.DATABASE_URL) {
16
16
  throw new Error("DATABASE_URL is not set. Make sure .env file exists in the project root and contains DATABASE_URL");
17
17
  }
18
18
 
19
- // Extract table names from the generated schema.
20
- // This ensures drizzle-kit ONLY manages tables defined in the schema.
21
- // Any tables in the database that are NOT part of the Rebase schema are left untouched.
22
- const tableNames = Object.values(tables).map(table => getTableName(table as PgTable));
19
+ // Extract table names from the generated schema, excluding system tables in the 'rebase' schema.
20
+ // This ensures drizzle-kit ONLY manages tables defined in the schema, and ignores the system tables
21
+ // managed by Rebase's own bootstrapper.
22
+ const tableNames = Object.values(tables)
23
+ .filter(table => getTableConfig(table as PgTable).schema !== "rebase")
24
+ .map(table => getTableName(table as PgTable));
23
25
 
24
- // Dynamically extract all schemas defined in the generated tables to ensure Drizzle Kit manages them.
26
+ // Dynamically extract all schemas defined in the generated tables (excluding 'rebase') to ensure Drizzle Kit manages them.
25
27
  const schemas = Array.from(new Set(
26
28
  Object.values(tables)
27
29
  .map(table => getTableConfig(table as PgTable).schema || "public")
30
+ .filter(schema => schema !== "rebase")
28
31
  ));
29
32
 
30
33
  export default defineConfig({
@@ -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,54 @@
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", label: "Pending", color: "gray" },
26
+ { id: "processing", label: "Processing", color: "blue" },
27
+ { id: "shipped", label: "Shipped", color: "orange" },
28
+ { id: "delivered", label: "Delivered", color: "green" },
29
+ { id: "cancelled", label: "Cancelled", color: "red" }
30
+ ]
31
+ },
32
+ total: {
33
+ name: "Total",
34
+ type: "number",
35
+ validation: { required: true }
36
+ },
37
+ notes: {
38
+ name: "Notes",
39
+ type: "string",
40
+ multiline: true
41
+ },
42
+ createdAt: {
43
+ name: "Created At",
44
+ type: "date",
45
+ columnName: "created_at",
46
+ autoValue: "on_create",
47
+ ui: {
48
+ readOnly: true
49
+ }
50
+ }
51
+ }
52
+ };
53
+
54
+ export default ordersCollection;
@@ -0,0 +1,56 @@
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", label: "Draft", color: "gray" },
41
+ { id: "active", label: "Active", color: "green" },
42
+ { id: "archived", label: "Archived", color: "orange" }
43
+ ]
44
+ },
45
+ category: {
46
+ name: "Category",
47
+ type: "relation",
48
+ relationName: "category",
49
+ target: () => categoriesCollection,
50
+ cardinality: "one",
51
+ direction: "owning"
52
+ }
53
+ }
54
+ };
55
+
56
+ export default productsCollection;
@@ -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
@@ -29,5 +29,11 @@
29
29
  },
30
30
  "engines": {
31
31
  "node": ">=18.0.0"
32
+ },
33
+ "pnpm": {
34
+ "onlyBuiltDependencies": [
35
+ "esbuild",
36
+ "sharp"
37
+ ]
32
38
  }
33
39
  }