create-cfast 0.1.0 → 0.2.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/dist/index.js
CHANGED
|
@@ -62,6 +62,7 @@ function resolveFeatureDeps(features) {
|
|
|
62
62
|
}
|
|
63
63
|
if (resolved.auth) {
|
|
64
64
|
resolved.db = true;
|
|
65
|
+
resolved.ui = true;
|
|
65
66
|
}
|
|
66
67
|
return resolved;
|
|
67
68
|
}
|
|
@@ -413,7 +414,7 @@ ${appLine}
|
|
|
413
414
|
function generateViteConfig(config) {
|
|
414
415
|
const optimizeDeps = [];
|
|
415
416
|
if (config.features.ui && config.uiLibrary === "joy") {
|
|
416
|
-
optimizeDeps.push(`"@cfast/
|
|
417
|
+
optimizeDeps.push(`"@cfast/joy"`);
|
|
417
418
|
}
|
|
418
419
|
if (config.features.ui) {
|
|
419
420
|
optimizeDeps.push(`"@cfast/actions/client"`);
|
|
@@ -469,7 +470,7 @@ function generateRootTsx(config) {
|
|
|
469
470
|
imports.push(
|
|
470
471
|
`import { createUIPlugin, UIPluginProvider, ConfirmProvider } from "@cfast/ui";`
|
|
471
472
|
);
|
|
472
|
-
imports.push(`import { ConfirmDialog } from "@cfast/
|
|
473
|
+
imports.push(`import { ConfirmDialog } from "@cfast/joy";`);
|
|
473
474
|
pluginSetup = `
|
|
474
475
|
const plugin = createUIPlugin({
|
|
475
476
|
components: { confirmDialog: ConfirmDialog },
|
package/package.json
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { LoaderFunctionArgs, ActionFunctionArgs } from "react-router";
|
|
2
|
-
import {
|
|
3
|
-
import { AdminPanel } from "@cfast/admin/client";
|
|
4
|
-
import { joyAdminComponents } from "@cfast/ui/joy";
|
|
2
|
+
import { createAdminComponent, introspectSchema } from "@cfast/admin";
|
|
5
3
|
import { adminLoader, adminAction } from "~/admin.server";
|
|
4
|
+
import * as schema from "~/db/schema";
|
|
5
|
+
|
|
6
|
+
const tableMetas = introspectSchema(schema);
|
|
7
|
+
const AdminComponent = createAdminComponent(tableMetas);
|
|
6
8
|
|
|
7
9
|
export async function loader(args: LoaderFunctionArgs) {
|
|
8
10
|
return adminLoader(args.request);
|
|
@@ -12,7 +14,4 @@ export async function action(args: ActionFunctionArgs) {
|
|
|
12
14
|
return adminAction(args.request);
|
|
13
15
|
}
|
|
14
16
|
|
|
15
|
-
export default
|
|
16
|
-
const data = useLoaderData<typeof loader>();
|
|
17
|
-
return <AdminPanel data={data} components={joyAdminComponents} />;
|
|
18
|
-
}
|
|
17
|
+
export default AdminComponent;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { LoaderFunctionArgs } from "react-router";
|
|
2
2
|
import { redirect, useLoaderData } from "react-router";
|
|
3
3
|
import { LoginPage } from "@cfast/auth/client";
|
|
4
|
-
import { joyLoginComponents } from "@cfast/
|
|
4
|
+
import { joyLoginComponents } from "@cfast/joy";
|
|
5
5
|
import { getUser } from "~/auth.helpers.server";
|
|
6
6
|
import { authClient } from "~/auth.client";
|
|
7
7
|
|