@rebasepro/cli 0.0.1-canary.eae7889 → 0.0.1-canary.eb08332
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/LICENSE +17 -196
- package/README.md +57 -33
- package/dist/commands/api-keys.d.ts +1 -0
- package/dist/commands/build.d.ts +1 -0
- package/dist/commands/cloud/auth.d.ts +3 -0
- package/dist/commands/cloud/context.d.ts +61 -0
- package/dist/commands/cloud/databases.d.ts +1 -0
- package/dist/commands/cloud/deploy.d.ts +2 -0
- package/dist/commands/cloud/index.d.ts +1 -0
- package/dist/commands/cloud/link.d.ts +5 -0
- package/dist/commands/cloud/orgs.d.ts +1 -0
- package/dist/commands/cloud/projects.d.ts +13 -0
- package/dist/commands/cloud/resources.d.ts +6 -0
- package/dist/commands/generate_sdk.d.ts +1 -1
- package/dist/commands/init.d.ts +39 -0
- package/dist/commands/skills.d.ts +1 -0
- package/dist/commands/start.d.ts +1 -0
- package/dist/index.d.ts +6 -1
- package/dist/index.es.js +3785 -990
- package/dist/index.es.js.map +1 -1
- package/dist/utils/package-manager.d.ts +33 -0
- package/dist/utils/project.d.ts +16 -1
- package/package.json +26 -23
- package/templates/overlays/baas/README.md +37 -0
- package/templates/overlays/baas/backend/package.json +31 -0
- package/templates/overlays/baas/backend/src/index.ts +172 -0
- package/templates/overlays/baas/backend/tsconfig.json +18 -0
- package/templates/overlays/baas/package.json +42 -0
- package/templates/overlays/baas/pnpm-workspace.yaml +9 -0
- package/templates/template/.cursorrules +2 -0
- package/templates/template/.dockerignore +1 -1
- package/templates/template/.env.example +120 -0
- package/templates/template/.github/copilot-instructions.md +2 -0
- package/templates/template/.windsurfrules +2 -0
- package/templates/template/AGENTS.md +2 -0
- package/templates/template/CLAUDE.md +2 -0
- package/templates/template/README.md +20 -10
- package/templates/template/ai-instructions.md +17 -0
- package/templates/template/backend/Dockerfile +5 -4
- package/templates/template/backend/functions/hello.ts +36 -32
- package/templates/template/backend/package.json +11 -11
- package/templates/template/backend/src/env.ts +13 -42
- package/templates/template/backend/src/index.ts +54 -28
- package/templates/template/config/collections/authors.ts +2 -2
- package/templates/template/config/collections/index.ts +25 -4
- package/templates/template/config/collections/posts.ts +15 -35
- package/templates/template/config/collections/presets/blank/index.ts +3 -0
- package/templates/template/config/collections/presets/ecommerce/categories.ts +40 -0
- package/templates/template/config/collections/presets/ecommerce/index.ts +6 -0
- package/templates/template/config/collections/presets/ecommerce/orders.ts +66 -0
- package/templates/template/config/collections/presets/ecommerce/products.ts +64 -0
- package/templates/template/config/collections/tags.ts +3 -5
- package/templates/template/config/collections/users.ts +142 -0
- package/templates/template/config/index.ts +1 -1
- package/templates/template/docker-compose.yml +14 -39
- package/templates/template/frontend/Dockerfile +5 -3
- package/templates/template/frontend/package.json +8 -7
- package/templates/template/frontend/src/App.tsx +26 -105
- package/templates/template/frontend/src/main.tsx +4 -0
- package/templates/template/frontend/src/virtual.d.ts +6 -0
- package/templates/template/frontend/tsconfig.json +3 -2
- package/templates/template/frontend/vite.config.ts +47 -4
- package/templates/template/package.json +22 -8
- package/templates/template/pnpm-workspace.yaml +9 -0
- package/templates/template/scripts/example.ts +5 -2
- package/dist/auth.d.ts +0 -5
- 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/index.cjs +0 -1203
- package/dist/index.cjs.map +0 -1
- package/dist/utils/project.test.d.ts +0 -1
- package/templates/template/.env.template +0 -62
- package/templates/template/backend/drizzle.config.ts +0 -22
|
@@ -1,20 +1,63 @@
|
|
|
1
|
-
// @ts-ignore
|
|
2
1
|
import path from "path";
|
|
3
2
|
import { defineConfig } from "vite";
|
|
4
3
|
import react from "@vitejs/plugin-react";
|
|
5
4
|
import svgr from "vite-plugin-svgr";
|
|
6
5
|
import tailwindcss from "@tailwindcss/vite";
|
|
7
|
-
import { rebaseCollectionsPlugin } from "@rebasepro/
|
|
6
|
+
import { rebaseCollectionsPlugin } from "@rebasepro/app/vitePlugin";
|
|
8
7
|
|
|
9
8
|
export default defineConfig({
|
|
9
|
+
envDir: path.resolve(__dirname, ".."),
|
|
10
|
+
// Force a single copy of React and React Router across the app and all
|
|
11
|
+
// @rebasepro/* packages. Without this, a locally `link:`ed Rebase checkout
|
|
12
|
+
// resolves its own copies of react-router, producing "multiple copies of
|
|
13
|
+
// React" and "useBlocker must be used within a data router" errors in the
|
|
14
|
+
// admin. Safe to keep for npm-installed setups too.
|
|
15
|
+
resolve: {
|
|
16
|
+
dedupe: [
|
|
17
|
+
"react",
|
|
18
|
+
"react-dom",
|
|
19
|
+
"react-router",
|
|
20
|
+
"react-router-dom",
|
|
21
|
+
"@remix-run/router"
|
|
22
|
+
]
|
|
23
|
+
},
|
|
10
24
|
esbuild: {
|
|
11
25
|
logOverride: { "this-is-undefined-in-esm": "silent" }
|
|
12
26
|
},
|
|
13
27
|
build: {
|
|
14
28
|
minify: true,
|
|
15
|
-
outDir: "./
|
|
29
|
+
outDir: "./dist",
|
|
16
30
|
target: "ESNEXT",
|
|
17
|
-
sourcemap: true
|
|
31
|
+
sourcemap: true,
|
|
32
|
+
rollupOptions: {
|
|
33
|
+
output: {
|
|
34
|
+
manualChunks(id) {
|
|
35
|
+
// Heavy vendor libraries — split into individually cached chunks
|
|
36
|
+
if (id.includes("exceljs")) return "vendor-exceljs";
|
|
37
|
+
if (id.includes("prosemirror")) return "vendor-prosemirror";
|
|
38
|
+
if (id.includes("monaco-editor") || id.includes("@monaco-editor")) return "vendor-monaco";
|
|
39
|
+
if (id.includes("@xyflow") || id.includes("dagre")) return "vendor-xyflow";
|
|
40
|
+
if (id.includes("@dnd-kit")) return "vendor-dnd";
|
|
41
|
+
if (id.includes("prism-react-renderer")) return "vendor-prism";
|
|
42
|
+
if (id.includes("markdown-it")) return "vendor-markdown";
|
|
43
|
+
if (id.includes("react-dropzone")) return "vendor-dropzone";
|
|
44
|
+
if (id.includes("date-fns")) return "vendor-datefns";
|
|
45
|
+
if (id.includes("fuse.js")) return "vendor-fuse";
|
|
46
|
+
if (id.includes("node_modules/react-dom/")) return "vendor-react-dom";
|
|
47
|
+
if (id.includes("node_modules/react-router") || id.includes("node_modules/@remix-run")) return "vendor-react-router";
|
|
48
|
+
if (id.includes("node_modules/@radix-ui/")) return "vendor-radix";
|
|
49
|
+
if (id.includes("node_modules/framer-motion/")) return "vendor-framer-motion";
|
|
50
|
+
if (id.includes("node_modules/zod/")) return "vendor-zod";
|
|
51
|
+
if (id.includes("node_modules/i18next") || id.includes("node_modules/react-i18next")) return "vendor-i18next";
|
|
52
|
+
if (id.includes("node_modules/@floating-ui/")) return "vendor-floating-ui";
|
|
53
|
+
if (id.includes("node_modules/tailwind-merge/")) return "vendor-tailwind-merge";
|
|
54
|
+
if (id.includes("node_modules/notistack/")) return "vendor-notistack";
|
|
55
|
+
if (id.includes("node_modules/lucide-react/")) return "vendor-lucide-react";
|
|
56
|
+
|
|
57
|
+
return undefined;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
18
61
|
},
|
|
19
62
|
optimizeDeps: { include: ["react/jsx-runtime"] },
|
|
20
63
|
plugins: [
|
|
@@ -4,24 +4,38 @@
|
|
|
4
4
|
"description": "Rebase application with PostgreSQL backend",
|
|
5
5
|
"private": true,
|
|
6
6
|
"type": "module",
|
|
7
|
+
"workspaces": [
|
|
8
|
+
"frontend",
|
|
9
|
+
"backend",
|
|
10
|
+
"config"
|
|
11
|
+
],
|
|
7
12
|
"scripts": {
|
|
8
13
|
"dev": "rebase dev",
|
|
9
|
-
"build": "
|
|
10
|
-
"start": "
|
|
11
|
-
"db:generate": "rebase db generate",
|
|
14
|
+
"build": "rebase build",
|
|
15
|
+
"start": "rebase start",
|
|
16
|
+
"db:generate": "rebase db generate --collections ../config/collections",
|
|
12
17
|
"db:migrate": "rebase db migrate",
|
|
13
|
-
"
|
|
14
|
-
"db:push": "rebase db push",
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
+
"schema:introspect": "rebase schema introspect",
|
|
19
|
+
"db:push": "rebase db push --collections ../config/collections",
|
|
20
|
+
"schema:generate": "rebase schema generate --collections ../config/collections",
|
|
21
|
+
"generate:sdk": "rebase generate-sdk",
|
|
22
|
+
"skills:install": "rebase skills install",
|
|
23
|
+
"deploy": "rebase build && rebase start"
|
|
18
24
|
},
|
|
19
25
|
"devDependencies": {
|
|
20
26
|
"@rebasepro/cli": "workspace:*",
|
|
27
|
+
"@rebasepro/types": "workspace:*",
|
|
21
28
|
"concurrently": "^8.2.2",
|
|
22
29
|
"typescript": "^5.9.2"
|
|
23
30
|
},
|
|
24
31
|
"engines": {
|
|
25
32
|
"node": ">=18.0.0"
|
|
33
|
+
},
|
|
34
|
+
"pnpm": {
|
|
35
|
+
"onlyBuiltDependencies": [
|
|
36
|
+
"esbuild",
|
|
37
|
+
"sharp",
|
|
38
|
+
"@ariga/atlas"
|
|
39
|
+
]
|
|
26
40
|
}
|
|
27
41
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Scripts run OUTSIDE the server and need explicit authentication.
|
|
5
5
|
* Use a Service Key (set in .env as REBASE_SERVICE_KEY) to get admin
|
|
6
|
-
* access — similar to a
|
|
6
|
+
* access — similar to a Service Account credential.
|
|
7
7
|
*
|
|
8
8
|
* Usage:
|
|
9
9
|
* # With local dev server running (`pnpm dev` in another terminal):
|
|
@@ -75,7 +75,10 @@ async function run() {
|
|
|
75
75
|
|
|
76
76
|
try {
|
|
77
77
|
// Example: Check backend health
|
|
78
|
-
const
|
|
78
|
+
const res = await fetch(`${baseUrl}/health`);
|
|
79
|
+
const health = res.headers.get("content-type")?.includes("application/json")
|
|
80
|
+
? await res.json()
|
|
81
|
+
: { status: res.status, text: await res.text() };
|
|
79
82
|
console.log("✅ Backend health:", health);
|
|
80
83
|
|
|
81
84
|
// Example: Fetch some data (requires auth if backend is secure-by-default)
|
package/dist/auth.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare function getTokens(env: "prod" | "dev", _debug?: boolean): Promise<object | null>;
|
|
2
|
-
export declare function parseJwt(token: string): object;
|
|
3
|
-
export declare function refreshCredentials(env: "dev" | "prod", credentials?: object | null, _onErr?: (e: unknown) => void): Promise<object | null>;
|
|
4
|
-
export declare function login(env: "prod" | "dev", _debug?: boolean): Promise<void>;
|
|
5
|
-
export declare function logout(env: "prod" | "dev", _debug?: boolean): Promise<void>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|