@rebasepro/cli 0.0.1-canary.ca2cb6e → 0.0.1-canary.dbf160a
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/dist/commands/init.d.ts +2 -0
- package/dist/index.cjs +108 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.es.js +108 -12
- package/dist/index.es.js.map +1 -1
- package/package.json +4 -4
- package/templates/template/backend/drizzle.config.ts +15 -3
- package/templates/template/backend/package.json +2 -2
- package/templates/template/config/collections/posts.ts +3 -3
- package/templates/template/frontend/src/App.tsx +19 -98
- package/templates/template/frontend/vite.config.ts +31 -2
- package/templates/template/package.json +5 -4
|
@@ -1,47 +1,23 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from "react";
|
|
2
2
|
|
|
3
3
|
import "@fontsource/jetbrains-mono";
|
|
4
4
|
import "typeface-rubik";
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
} from "@rebasepro/auth";
|
|
11
|
-
import {
|
|
12
|
-
AppBar,
|
|
13
|
-
Drawer,
|
|
14
|
-
Rebase,
|
|
15
|
-
ModeControllerProvider,
|
|
16
|
-
NotFoundPage,
|
|
17
|
-
Scaffold,
|
|
18
|
-
SideDialogs,
|
|
19
|
-
RebaseRoutes,
|
|
20
|
-
SnackbarProvider,
|
|
21
|
-
ContentHomePage,
|
|
22
|
-
useBuildUrlController,
|
|
23
|
-
useBuildCollectionRegistryController,
|
|
24
|
-
useBuildLocalConfigurationPersistence,
|
|
25
|
-
useBuildModeController,
|
|
26
|
-
useBuildNavigationStateController
|
|
27
|
-
} from "@rebasepro/core";
|
|
28
|
-
import { RebaseRoute } from "@rebasepro/admin";
|
|
29
|
-
import { CircularProgressCenter } from "@rebasepro/ui";
|
|
30
|
-
import { collections } from "virtual:rebase-collections";
|
|
31
|
-
import { Route, Outlet } from "react-router-dom";
|
|
6
|
+
import { useRebaseAuthController, useBackendUserManagement, RebaseAuth } from "@rebasepro/auth";
|
|
7
|
+
import { Rebase } from "@rebasepro/core";
|
|
8
|
+
import { RebaseCMS, RebaseShell } from "@rebasepro/admin";
|
|
9
|
+
import { RebaseStudio } from "@rebasepro/studio";
|
|
32
10
|
import { createRebaseClient } from "@rebasepro/client";
|
|
11
|
+
import { collections } from "virtual:rebase-collections";
|
|
33
12
|
|
|
34
13
|
// Configuration from environment
|
|
35
14
|
const API_URL = import.meta.env.VITE_API_URL || (import.meta.env.DEV ? "http://localhost:3001" : undefined);
|
|
36
15
|
const GOOGLE_CLIENT_ID = import.meta.env.VITE_GOOGLE_CLIENT_ID;
|
|
37
16
|
|
|
38
17
|
export function App() {
|
|
39
|
-
const modeController = useBuildModeController();
|
|
40
|
-
const userConfigPersistence = useBuildLocalConfigurationPersistence();
|
|
41
|
-
|
|
42
18
|
const rebaseClient = React.useMemo(() => createRebaseClient({
|
|
43
19
|
baseUrl: API_URL
|
|
44
|
-
}), [
|
|
20
|
+
}), []);
|
|
45
21
|
|
|
46
22
|
const authController = useRebaseAuthController({
|
|
47
23
|
client: rebaseClient,
|
|
@@ -53,73 +29,18 @@ export function App() {
|
|
|
53
29
|
currentUser: authController.user
|
|
54
30
|
});
|
|
55
31
|
|
|
56
|
-
const collectionsBuilder = useCallback(() => {
|
|
57
|
-
return [...collections];
|
|
58
|
-
}, []);
|
|
59
|
-
|
|
60
|
-
const collectionRegistryController = useBuildCollectionRegistryController({ userConfigPersistence });
|
|
61
|
-
const urlController = useBuildUrlController({
|
|
62
|
-
basePath: "/",
|
|
63
|
-
baseCollectionPath: "/c",
|
|
64
|
-
collectionRegistryController
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
const navigationStateController = useBuildNavigationStateController({
|
|
68
|
-
collections: collectionsBuilder,
|
|
69
|
-
authController,
|
|
70
|
-
data: rebaseClient.data,
|
|
71
|
-
collectionRegistryController,
|
|
72
|
-
urlController,
|
|
73
|
-
userManagement
|
|
74
|
-
});
|
|
75
|
-
|
|
76
32
|
return (
|
|
77
|
-
<
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
{({ loading }) => {
|
|
90
|
-
if (loading || authController.initialLoading) {
|
|
91
|
-
return <CircularProgressCenter/>;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
if (!authController.user) {
|
|
95
|
-
return (
|
|
96
|
-
<RebaseLoginView
|
|
97
|
-
authController={authController}
|
|
98
|
-
googleEnabled={!!GOOGLE_CLIENT_ID}
|
|
99
|
-
googleClientId={GOOGLE_CLIENT_ID}
|
|
100
|
-
/>
|
|
101
|
-
);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
return (
|
|
105
|
-
<RebaseRoutes>
|
|
106
|
-
<Route element={
|
|
107
|
-
<Scaffold autoOpenDrawer={false}>
|
|
108
|
-
<AppBar/>
|
|
109
|
-
<Drawer/>
|
|
110
|
-
<Outlet/>
|
|
111
|
-
<SideDialogs/>
|
|
112
|
-
</Scaffold>
|
|
113
|
-
}>
|
|
114
|
-
<Route path={"/"} element={<ContentHomePage/>}/>
|
|
115
|
-
<Route path={"/c/*"} element={<RebaseRoute/>}/>
|
|
116
|
-
<Route path={"*"} element={<NotFoundPage/>}/>
|
|
117
|
-
</Route>
|
|
118
|
-
</RebaseRoutes>
|
|
119
|
-
);
|
|
120
|
-
}}
|
|
121
|
-
</Rebase>
|
|
122
|
-
</ModeControllerProvider>
|
|
123
|
-
</SnackbarProvider>
|
|
33
|
+
<Rebase
|
|
34
|
+
client={rebaseClient}
|
|
35
|
+
authController={authController}
|
|
36
|
+
userManagement={userManagement}
|
|
37
|
+
>
|
|
38
|
+
<RebaseAuth />
|
|
39
|
+
<RebaseCMS
|
|
40
|
+
collections={collections}
|
|
41
|
+
/>
|
|
42
|
+
<RebaseStudio/>
|
|
43
|
+
<RebaseShell title="Rebase"/>
|
|
44
|
+
</Rebase>
|
|
124
45
|
);
|
|
125
46
|
}
|
|
@@ -12,9 +12,38 @@ export default defineConfig({
|
|
|
12
12
|
},
|
|
13
13
|
build: {
|
|
14
14
|
minify: true,
|
|
15
|
-
outDir: "./
|
|
15
|
+
outDir: "./dist",
|
|
16
16
|
target: "ESNEXT",
|
|
17
|
-
sourcemap: true
|
|
17
|
+
sourcemap: true,
|
|
18
|
+
rollupOptions: {
|
|
19
|
+
output: {
|
|
20
|
+
manualChunks(id) {
|
|
21
|
+
// Heavy vendor libraries — split into individually cached chunks
|
|
22
|
+
if (id.includes("xlsx")) return "vendor-xlsx";
|
|
23
|
+
if (id.includes("prosemirror")) return "vendor-prosemirror";
|
|
24
|
+
if (id.includes("monaco-editor") || id.includes("@monaco-editor")) return "vendor-monaco";
|
|
25
|
+
if (id.includes("@xyflow") || id.includes("dagre")) return "vendor-xyflow";
|
|
26
|
+
if (id.includes("@dnd-kit")) return "vendor-dnd";
|
|
27
|
+
if (id.includes("prism-react-renderer")) return "vendor-prism";
|
|
28
|
+
if (id.includes("markdown-it")) return "vendor-markdown";
|
|
29
|
+
if (id.includes("react-dropzone")) return "vendor-dropzone";
|
|
30
|
+
if (id.includes("date-fns")) return "vendor-datefns";
|
|
31
|
+
if (id.includes("fuse.js")) return "vendor-fuse";
|
|
32
|
+
if (id.includes("node_modules/react-dom/")) return "vendor-react-dom";
|
|
33
|
+
if (id.includes("node_modules/react-router") || id.includes("node_modules/@remix-run")) return "vendor-react-router";
|
|
34
|
+
if (id.includes("node_modules/@radix-ui/")) return "vendor-radix";
|
|
35
|
+
if (id.includes("node_modules/framer-motion/")) return "vendor-framer-motion";
|
|
36
|
+
if (id.includes("node_modules/zod/")) return "vendor-zod";
|
|
37
|
+
if (id.includes("node_modules/i18next") || id.includes("node_modules/react-i18next")) return "vendor-i18next";
|
|
38
|
+
if (id.includes("node_modules/@floating-ui/")) return "vendor-floating-ui";
|
|
39
|
+
if (id.includes("node_modules/tailwind-merge/")) return "vendor-tailwind-merge";
|
|
40
|
+
if (id.includes("node_modules/notistack/")) return "vendor-notistack";
|
|
41
|
+
if (id.includes("node_modules/lucide-react/")) return "vendor-lucide-react";
|
|
42
|
+
|
|
43
|
+
return undefined;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
18
47
|
},
|
|
19
48
|
optimizeDeps: { include: ["react/jsx-runtime"] },
|
|
20
49
|
plugins: [
|
|
@@ -8,13 +8,14 @@
|
|
|
8
8
|
"dev": "rebase dev",
|
|
9
9
|
"build": "pnpm -r run build",
|
|
10
10
|
"start": "pnpm --filter \"*-backend\" start",
|
|
11
|
-
"db:generate": "rebase db generate",
|
|
11
|
+
"db:generate": "rebase db generate --collections ../config/collections",
|
|
12
12
|
"db:migrate": "rebase db migrate",
|
|
13
13
|
"db:pull": "rebase db pull",
|
|
14
|
-
"db:push": "rebase db push",
|
|
14
|
+
"db:push": "rebase db push --collections ../config/collections",
|
|
15
15
|
"db:studio": "rebase db studio",
|
|
16
|
-
"schema:generate": "rebase schema generate",
|
|
17
|
-
"generate:sdk": "rebase generate-sdk"
|
|
16
|
+
"schema:generate": "rebase schema generate --collections ../config/collections",
|
|
17
|
+
"generate:sdk": "rebase generate-sdk",
|
|
18
|
+
"deploy": "pnpm run build && pnpm run start"
|
|
18
19
|
},
|
|
19
20
|
"devDependencies": {
|
|
20
21
|
"@rebasepro/cli": "workspace:*",
|