@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.
Files changed (74) hide show
  1. package/LICENSE +17 -196
  2. package/README.md +57 -33
  3. package/dist/commands/api-keys.d.ts +1 -0
  4. package/dist/commands/build.d.ts +1 -0
  5. package/dist/commands/cloud/auth.d.ts +3 -0
  6. package/dist/commands/cloud/context.d.ts +61 -0
  7. package/dist/commands/cloud/databases.d.ts +1 -0
  8. package/dist/commands/cloud/deploy.d.ts +2 -0
  9. package/dist/commands/cloud/index.d.ts +1 -0
  10. package/dist/commands/cloud/link.d.ts +5 -0
  11. package/dist/commands/cloud/orgs.d.ts +1 -0
  12. package/dist/commands/cloud/projects.d.ts +13 -0
  13. package/dist/commands/cloud/resources.d.ts +6 -0
  14. package/dist/commands/generate_sdk.d.ts +1 -1
  15. package/dist/commands/init.d.ts +39 -0
  16. package/dist/commands/skills.d.ts +1 -0
  17. package/dist/commands/start.d.ts +1 -0
  18. package/dist/index.d.ts +6 -1
  19. package/dist/index.es.js +3785 -990
  20. package/dist/index.es.js.map +1 -1
  21. package/dist/utils/package-manager.d.ts +33 -0
  22. package/dist/utils/project.d.ts +16 -1
  23. package/package.json +26 -23
  24. package/templates/overlays/baas/README.md +37 -0
  25. package/templates/overlays/baas/backend/package.json +31 -0
  26. package/templates/overlays/baas/backend/src/index.ts +172 -0
  27. package/templates/overlays/baas/backend/tsconfig.json +18 -0
  28. package/templates/overlays/baas/package.json +42 -0
  29. package/templates/overlays/baas/pnpm-workspace.yaml +9 -0
  30. package/templates/template/.cursorrules +2 -0
  31. package/templates/template/.dockerignore +1 -1
  32. package/templates/template/.env.example +120 -0
  33. package/templates/template/.github/copilot-instructions.md +2 -0
  34. package/templates/template/.windsurfrules +2 -0
  35. package/templates/template/AGENTS.md +2 -0
  36. package/templates/template/CLAUDE.md +2 -0
  37. package/templates/template/README.md +20 -10
  38. package/templates/template/ai-instructions.md +17 -0
  39. package/templates/template/backend/Dockerfile +5 -4
  40. package/templates/template/backend/functions/hello.ts +36 -32
  41. package/templates/template/backend/package.json +11 -11
  42. package/templates/template/backend/src/env.ts +13 -42
  43. package/templates/template/backend/src/index.ts +54 -28
  44. package/templates/template/config/collections/authors.ts +2 -2
  45. package/templates/template/config/collections/index.ts +25 -4
  46. package/templates/template/config/collections/posts.ts +15 -35
  47. package/templates/template/config/collections/presets/blank/index.ts +3 -0
  48. package/templates/template/config/collections/presets/ecommerce/categories.ts +40 -0
  49. package/templates/template/config/collections/presets/ecommerce/index.ts +6 -0
  50. package/templates/template/config/collections/presets/ecommerce/orders.ts +66 -0
  51. package/templates/template/config/collections/presets/ecommerce/products.ts +64 -0
  52. package/templates/template/config/collections/tags.ts +3 -5
  53. package/templates/template/config/collections/users.ts +142 -0
  54. package/templates/template/config/index.ts +1 -1
  55. package/templates/template/docker-compose.yml +14 -39
  56. package/templates/template/frontend/Dockerfile +5 -3
  57. package/templates/template/frontend/package.json +8 -7
  58. package/templates/template/frontend/src/App.tsx +26 -105
  59. package/templates/template/frontend/src/main.tsx +4 -0
  60. package/templates/template/frontend/src/virtual.d.ts +6 -0
  61. package/templates/template/frontend/tsconfig.json +3 -2
  62. package/templates/template/frontend/vite.config.ts +47 -4
  63. package/templates/template/package.json +22 -8
  64. package/templates/template/pnpm-workspace.yaml +9 -0
  65. package/templates/template/scripts/example.ts +5 -2
  66. package/dist/auth.d.ts +0 -5
  67. package/dist/commands/cli.test.d.ts +0 -1
  68. package/dist/commands/dev.test.d.ts +0 -1
  69. package/dist/commands/init.test.d.ts +0 -1
  70. package/dist/index.cjs +0 -1203
  71. package/dist/index.cjs.map +0 -1
  72. package/dist/utils/project.test.d.ts +0 -1
  73. package/templates/template/.env.template +0 -62
  74. 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/core/vitePlugin";
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: "./build",
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": "pnpm -r run build",
10
- "start": "pnpm --filter \"*-backend\" 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
- "db:pull": "rebase db pull",
14
- "db:push": "rebase db push",
15
- "db:studio": "rebase db studio",
16
- "schema:generate": "rebase schema generate",
17
- "generate:sdk": "rebase generate-sdk"
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
  }
@@ -2,3 +2,12 @@ packages:
2
2
  - "frontend"
3
3
  - "backend"
4
4
  - "config"
5
+ linkWorkspacePackages: true
6
+ blockExoticSubdeps: false
7
+ minimumReleaseAge: 0
8
+ allowBuilds:
9
+ esbuild: true
10
+ sharp: true
11
+ "@ariga/atlas": true
12
+ "{{PROJECT_NAME}}-config": true
13
+
@@ -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 Firebase Service Account credential.
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 health = await fetch(`${baseUrl}/api/health`).then(res => res.json());
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 {};