@proofkit/cli 1.1.6 → 1.2.0-beta.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.
Files changed (148) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/external-DCpQkgKf.js +1 -0
  3. package/dist/index.js +121 -16383
  4. package/package.json +27 -22
  5. package/template/extras/config/query-provider-vite.tsx +0 -2
  6. package/template/extras/emailProviders/none/email.tsx +4 -4
  7. package/template/extras/emailProviders/plunk/email.tsx +5 -4
  8. package/template/extras/emailProviders/plunk/service.ts +1 -1
  9. package/template/extras/emailProviders/resend/email.tsx +1 -0
  10. package/template/extras/emailProviders/resend/service.ts +1 -1
  11. package/template/extras/emailTemplates/auth-code.tsx +156 -0
  12. package/template/extras/emailTemplates/generic.tsx +136 -0
  13. package/template/extras/fmaddon-auth/app/(main)/auth/profile/actions.ts +13 -9
  14. package/template/extras/fmaddon-auth/app/(main)/auth/profile/page.tsx +2 -0
  15. package/template/extras/fmaddon-auth/app/(main)/auth/profile/profile-form.tsx +7 -5
  16. package/template/extras/fmaddon-auth/app/(main)/auth/profile/reset-password-form.tsx +8 -6
  17. package/template/extras/fmaddon-auth/app/auth/forgot-password/actions.ts +7 -5
  18. package/template/extras/fmaddon-auth/app/auth/forgot-password/forgot-form.tsx +3 -2
  19. package/template/extras/fmaddon-auth/app/auth/forgot-password/page.tsx +1 -0
  20. package/template/extras/fmaddon-auth/app/auth/login/actions.ts +5 -4
  21. package/template/extras/fmaddon-auth/app/auth/login/login-form.tsx +7 -5
  22. package/template/extras/fmaddon-auth/app/auth/login/page.tsx +1 -0
  23. package/template/extras/fmaddon-auth/app/auth/reset-password/actions.ts +11 -8
  24. package/template/extras/fmaddon-auth/app/auth/reset-password/page.tsx +3 -2
  25. package/template/extras/fmaddon-auth/app/auth/reset-password/reset-password-form.tsx +5 -4
  26. package/template/extras/fmaddon-auth/app/auth/reset-password/verify-email/actions.ts +3 -2
  27. package/template/extras/fmaddon-auth/app/auth/reset-password/verify-email/page.tsx +3 -2
  28. package/template/extras/fmaddon-auth/app/auth/reset-password/verify-email/verify-email-form.tsx +3 -2
  29. package/template/extras/fmaddon-auth/app/auth/signup/actions.ts +10 -9
  30. package/template/extras/fmaddon-auth/app/auth/signup/page.tsx +1 -0
  31. package/template/extras/fmaddon-auth/app/auth/signup/signup-form.tsx +7 -6
  32. package/template/extras/fmaddon-auth/app/auth/verify-email/actions.ts +7 -8
  33. package/template/extras/fmaddon-auth/app/auth/verify-email/email-verification-form.tsx +5 -4
  34. package/template/extras/fmaddon-auth/app/auth/verify-email/page.tsx +5 -3
  35. package/template/extras/fmaddon-auth/app/auth/verify-email/resend-button.tsx +4 -2
  36. package/template/extras/fmaddon-auth/components/auth/actions.ts +4 -1
  37. package/template/extras/fmaddon-auth/components/auth/protect.tsx +2 -1
  38. package/template/extras/fmaddon-auth/components/auth/redirect.tsx +2 -2
  39. package/template/extras/fmaddon-auth/components/auth/use-user.ts +3 -2
  40. package/template/extras/fmaddon-auth/components/auth/user-menu.tsx +3 -2
  41. package/template/extras/fmaddon-auth/middleware.ts +0 -1
  42. package/template/extras/fmaddon-auth/server/auth/utils/email-verification.ts +8 -7
  43. package/template/extras/fmaddon-auth/server/auth/utils/encryption.ts +2 -2
  44. package/template/extras/fmaddon-auth/server/auth/utils/password-reset.ts +5 -4
  45. package/template/extras/fmaddon-auth/server/auth/utils/redirect.ts +1 -1
  46. package/template/extras/fmaddon-auth/server/auth/utils/session.ts +6 -7
  47. package/template/extras/fmaddon-auth/server/auth/utils/user.ts +1 -2
  48. package/template/extras/src/app/next-auth/signin/page.tsx +2 -1
  49. package/template/fm-addon/ProofKitAuth/info.json +6 -9
  50. package/template/fm-addon/ProofKitAuth/info_de.json +5 -12
  51. package/template/fm-addon/ProofKitAuth/info_es.json +5 -12
  52. package/template/fm-addon/ProofKitAuth/info_fr.json +5 -12
  53. package/template/fm-addon/ProofKitAuth/info_it.json +5 -12
  54. package/template/fm-addon/ProofKitAuth/info_ja.json +5 -12
  55. package/template/fm-addon/ProofKitAuth/info_ko.json +5 -12
  56. package/template/fm-addon/ProofKitAuth/info_nl.json +5 -12
  57. package/template/fm-addon/ProofKitAuth/info_pt.json +5 -12
  58. package/template/fm-addon/ProofKitAuth/info_sv.json +5 -12
  59. package/template/fm-addon/ProofKitAuth/info_zh.json +5 -12
  60. package/template/fm-addon/ProofKitWV/info.json +6 -9
  61. package/template/fm-addon/ProofKitWV/info_de.json +5 -12
  62. package/template/fm-addon/ProofKitWV/info_en.json +1 -5
  63. package/template/fm-addon/ProofKitWV/info_es.json +5 -12
  64. package/template/fm-addon/ProofKitWV/info_fr.json +5 -12
  65. package/template/fm-addon/ProofKitWV/info_it.json +5 -12
  66. package/template/fm-addon/ProofKitWV/info_ja.json +5 -12
  67. package/template/fm-addon/ProofKitWV/info_ko.json +5 -12
  68. package/template/fm-addon/ProofKitWV/info_nl.json +5 -12
  69. package/template/fm-addon/ProofKitWV/info_pt.json +5 -12
  70. package/template/fm-addon/ProofKitWV/info_sv.json +5 -12
  71. package/template/fm-addon/ProofKitWV/info_zh.json +5 -12
  72. package/template/{nextjs → nextjs-mantine}/proofkit.json +2 -1
  73. package/template/{nextjs → nextjs-mantine}/src/components/AppShell/internal/HeaderNavLink.tsx +5 -1
  74. package/template/{nextjs → nextjs-mantine}/src/utils/notification-helpers.ts +1 -1
  75. package/template/nextjs-mantine/tsconfig.json +27 -0
  76. package/template/nextjs-shadcn/.claude/CLAUDE.md +327 -0
  77. package/template/nextjs-shadcn/.cursor/rules/ultracite.mdc +333 -0
  78. package/template/nextjs-shadcn/.prettierrc +3 -0
  79. package/template/nextjs-shadcn/.vscode/settings.json +35 -0
  80. package/template/nextjs-shadcn/README.md +27 -0
  81. package/template/nextjs-shadcn/_gitignore +37 -0
  82. package/template/nextjs-shadcn/biome.json +43 -0
  83. package/template/nextjs-shadcn/components.json +21 -0
  84. package/template/nextjs-shadcn/next.config.ts +8 -0
  85. package/template/nextjs-shadcn/package.json +35 -0
  86. package/template/nextjs-shadcn/postcss.config.mjs +5 -0
  87. package/template/nextjs-shadcn/proofkit.json +6 -0
  88. package/template/nextjs-shadcn/public/favicon.ico +0 -0
  89. package/template/nextjs-shadcn/public/proofkit.png +0 -0
  90. package/template/nextjs-shadcn/src/app/(main)/layout.tsx +6 -0
  91. package/template/nextjs-shadcn/src/app/(main)/page.tsx +124 -0
  92. package/template/nextjs-shadcn/src/app/globals.css +122 -0
  93. package/template/nextjs-shadcn/src/app/layout.tsx +35 -0
  94. package/template/nextjs-shadcn/src/app/navigation.tsx +12 -0
  95. package/template/nextjs-shadcn/src/components/AppLogo.tsx +6 -0
  96. package/template/nextjs-shadcn/src/components/AppShell/internal/AppShell.tsx +23 -0
  97. package/template/nextjs-shadcn/src/components/AppShell/internal/Header.module.css +33 -0
  98. package/template/nextjs-shadcn/src/components/AppShell/internal/Header.tsx +30 -0
  99. package/template/nextjs-shadcn/src/components/AppShell/internal/HeaderMobileMenu.tsx +25 -0
  100. package/template/nextjs-shadcn/src/components/AppShell/internal/HeaderNavLink.tsx +35 -0
  101. package/template/nextjs-shadcn/src/components/AppShell/internal/config.ts +1 -0
  102. package/template/nextjs-shadcn/src/components/AppShell/slot-header-center.tsx +13 -0
  103. package/template/nextjs-shadcn/src/components/AppShell/slot-header-left.tsx +23 -0
  104. package/template/nextjs-shadcn/src/components/AppShell/slot-header-mobile-content.tsx +43 -0
  105. package/template/nextjs-shadcn/src/components/AppShell/slot-header-right.tsx +25 -0
  106. package/template/nextjs-shadcn/src/components/providers.tsx +13 -0
  107. package/template/nextjs-shadcn/src/components/theme-provider.tsx +11 -0
  108. package/template/nextjs-shadcn/src/lib/env.ts +12 -0
  109. package/template/nextjs-shadcn/src/lib/utils.ts +6 -0
  110. package/template/{nextjs → nextjs-shadcn}/tsconfig.json +3 -2
  111. package/template/pages/nextjs/table-edit/page.tsx +5 -5
  112. package/template/pages/nextjs/table-edit/table.tsx +5 -3
  113. package/template/pages/nextjs/table-infinite/query.ts +4 -3
  114. package/template/pages/nextjs/table-infinite/table.tsx +3 -2
  115. package/template/pages/nextjs/table-infinite-edit/page.tsx +6 -6
  116. package/template/pages/nextjs/table-infinite-edit/query.ts +8 -2
  117. package/template/pages/vite-wv/table/index.tsx +5 -4
  118. package/template/pages/vite-wv/table-edit/index.tsx +6 -6
  119. package/template/vite-wv/src/main.tsx +1 -1
  120. package/template/vite-wv/src/routeTree.gen.ts +41 -41
  121. /package/template/{nextjs → nextjs-mantine}/.prettierrc +0 -0
  122. /package/template/{nextjs → nextjs-mantine}/README.md +0 -0
  123. /package/template/{nextjs → nextjs-mantine}/_gitignore +0 -0
  124. /package/template/{nextjs → nextjs-mantine}/components.json +0 -0
  125. /package/template/{nextjs → nextjs-mantine}/next.config.ts +0 -0
  126. /package/template/{nextjs → nextjs-mantine}/package.json +0 -0
  127. /package/template/{nextjs → nextjs-mantine}/postcss.config.cjs +0 -0
  128. /package/template/{nextjs → nextjs-mantine}/public/favicon.ico +0 -0
  129. /package/template/{nextjs → nextjs-mantine}/public/proofkit.png +0 -0
  130. /package/template/{nextjs → nextjs-mantine}/src/app/(main)/layout.tsx +0 -0
  131. /package/template/{nextjs → nextjs-mantine}/src/app/(main)/page.tsx +0 -0
  132. /package/template/{nextjs → nextjs-mantine}/src/app/layout.tsx +0 -0
  133. /package/template/{nextjs → nextjs-mantine}/src/app/navigation.tsx +0 -0
  134. /package/template/{nextjs → nextjs-mantine}/src/components/AppLogo.tsx +0 -0
  135. /package/template/{nextjs → nextjs-mantine}/src/components/AppShell/internal/AppShell.tsx +0 -0
  136. /package/template/{nextjs → nextjs-mantine}/src/components/AppShell/internal/Header.module.css +0 -0
  137. /package/template/{nextjs → nextjs-mantine}/src/components/AppShell/internal/Header.tsx +0 -0
  138. /package/template/{nextjs → nextjs-mantine}/src/components/AppShell/internal/HeaderMobileMenu.tsx +0 -0
  139. /package/template/{nextjs → nextjs-mantine}/src/components/AppShell/internal/config.ts +0 -0
  140. /package/template/{nextjs → nextjs-mantine}/src/components/AppShell/slot-header-center.tsx +0 -0
  141. /package/template/{nextjs → nextjs-mantine}/src/components/AppShell/slot-header-left.tsx +0 -0
  142. /package/template/{nextjs → nextjs-mantine}/src/components/AppShell/slot-header-mobile-content.tsx +0 -0
  143. /package/template/{nextjs → nextjs-mantine}/src/components/AppShell/slot-header-right.tsx +0 -0
  144. /package/template/{nextjs → nextjs-mantine}/src/config/env.ts +0 -0
  145. /package/template/{nextjs → nextjs-mantine}/src/config/theme/globals.css +0 -0
  146. /package/template/{nextjs → nextjs-mantine}/src/config/theme/mantine-theme.ts +0 -0
  147. /package/template/{nextjs → nextjs-mantine}/src/server/safe-action.ts +0 -0
  148. /package/template/{nextjs → nextjs-mantine}/src/utils/styles.ts +0 -0
@@ -0,0 +1,35 @@
1
+ "use client";
2
+
3
+ import { type ProofKitRoute } from "@proofkit/cli";
4
+ import { usePathname } from "next/navigation";
5
+ import React from "react";
6
+
7
+ import classes from "./Header.module.css";
8
+
9
+ export default function HeaderNavLink(route: ProofKitRoute) {
10
+ const pathname = usePathname();
11
+
12
+ if (route.type === "function") {
13
+ return (
14
+ <button className={classes.link} onClick={route.onClick}>
15
+ {route.label}
16
+ </button>
17
+ );
18
+ }
19
+
20
+ const isActive = route.exactMatch
21
+ ? pathname === route.href
22
+ : pathname.startsWith(route.href);
23
+
24
+ if (route.type === "link") {
25
+ return (
26
+ <a
27
+ href={route.href}
28
+ className={classes.link}
29
+ data-active={isActive || undefined}
30
+ >
31
+ {route.label}
32
+ </a>
33
+ );
34
+ }
35
+ }
@@ -0,0 +1 @@
1
+ export const headerHeight = 56;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * DO NOT REMOVE / RENAME THIS FILE
3
+ *
4
+ * You may CUSTOMIZE the content of this file, but the ProofKit CLI expects
5
+ * this file to exist and may use it to inject content for other components.
6
+ *
7
+ * If you don't want it to be used, you may return null or an empty fragment
8
+ */
9
+ export function SlotHeaderCenter() {
10
+ return null;
11
+ }
12
+
13
+ export default SlotHeaderCenter;
@@ -0,0 +1,23 @@
1
+ import Link from "next/link";
2
+
3
+ import AppLogo from "../AppLogo";
4
+
5
+ /**
6
+ * DO NOT REMOVE / RENAME THIS FILE
7
+ *
8
+ * You may CUSTOMIZE the content of this file, but the ProofKit CLI expects this file to exist and
9
+ * may use it to inject content for other components.
10
+ *
11
+ * If you don't want it to be used, you may return null or an empty fragment
12
+ */
13
+ export function SlotHeaderLeft() {
14
+ return (
15
+ <>
16
+ <Link href="/" style={{ display: "inline-flex", alignItems: "center" }}>
17
+ <AppLogo />
18
+ </Link>
19
+ </>
20
+ );
21
+ }
22
+
23
+ export default SlotHeaderLeft;
@@ -0,0 +1,43 @@
1
+ "use client";
2
+
3
+ import { primaryRoutes } from "@/app/navigation";
4
+ import { useRouter } from "next/navigation";
5
+
6
+ /**
7
+ * DO NOT REMOVE / RENAME THIS FILE
8
+ *
9
+ * You may CUSTOMIZE the content of this file, but the ProofKit CLI expects
10
+ * this file to exist and may use it to inject content for other components.
11
+ *
12
+ * If you don't want it to be used, you may return null or an empty fragment
13
+ */
14
+ export function SlotHeaderMobileMenuContent({
15
+ closeMenu,
16
+ }: {
17
+ closeMenu: () => void;
18
+ }) {
19
+ const router = useRouter();
20
+ return (
21
+ <div className="flex flex-col">
22
+ {primaryRoutes.map((route) => (
23
+ <button
24
+ key={route.label}
25
+ className="flex items-center gap-2 rounded px-3 py-2 text-left hover:bg-zinc-100 dark:hover:bg-zinc-800"
26
+ onClick={() => {
27
+ closeMenu();
28
+ if (route.type === "function") {
29
+ route.onClick();
30
+ } else if (route.type === "link") {
31
+ router.push(route.href);
32
+ }
33
+ }}
34
+ >
35
+ {route.icon}
36
+ <span>{route.label}</span>
37
+ </button>
38
+ ))}
39
+ </div>
40
+ );
41
+ }
42
+
43
+ export default SlotHeaderMobileMenuContent;
@@ -0,0 +1,25 @@
1
+ import { primaryRoutes } from "@/app/navigation";
2
+
3
+ import HeaderNavLink from "./internal/HeaderNavLink";
4
+ import { ModeToggle } from "../mode-toggle";
5
+
6
+ /**
7
+ * DO NOT REMOVE / RENAME THIS FILE
8
+ *
9
+ * You may CUSTOMIZE the content of this file, but the ProofKit CLI expects
10
+ * this file to exist and may use it to inject content for other components.
11
+ *
12
+ * If you don't want it to be used, you may return null or an empty fragment
13
+ */
14
+ export function SlotHeaderRight() {
15
+ return (
16
+ <div className="flex items-center space-x-1">
17
+ {primaryRoutes.map((route) => (
18
+ <HeaderNavLink key={route.label} {...route} />
19
+ ))}
20
+ <ModeToggle />
21
+ </div>
22
+ );
23
+ }
24
+
25
+ export default SlotHeaderRight;
@@ -0,0 +1,13 @@
1
+ "use client";
2
+
3
+ import { ThemeProvider } from "./theme-provider";
4
+ import { Toaster } from "./ui/sonner";
5
+
6
+ export default function Providers({ children }: { children: React.ReactNode }) {
7
+ return (
8
+ <ThemeProvider attribute="class" disableTransitionOnChange>
9
+ {children}
10
+ <Toaster richColors />
11
+ </ThemeProvider>
12
+ );
13
+ }
@@ -0,0 +1,11 @@
1
+ "use client";
2
+
3
+ import { ThemeProvider as NextThemesProvider } from "next-themes";
4
+ import type * as React from "react";
5
+
6
+ export function ThemeProvider({
7
+ children,
8
+ ...props
9
+ }: React.ComponentProps<typeof NextThemesProvider>) {
10
+ return <NextThemesProvider {...props}>{children}</NextThemesProvider>;
11
+ }
@@ -0,0 +1,12 @@
1
+ import { createEnv } from "@t3-oss/env-nextjs";
2
+ import { z } from "zod/v4";
3
+
4
+ export const env = createEnv({
5
+ server: {
6
+ NODE_ENV: z
7
+ .enum(["development", "test", "production"])
8
+ .default("development"),
9
+ },
10
+ client: {},
11
+ experimental__runtimeEnv: {},
12
+ });
@@ -0,0 +1,6 @@
1
+ import { clsx, type ClassValue } from "clsx"
2
+ import { twMerge } from "tailwind-merge"
3
+
4
+ export function cn(...inputs: ClassValue[]) {
5
+ return twMerge(clsx(inputs))
6
+ }
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "compilerOptions": {
3
+ "target": "ES2017",
3
4
  "lib": [
4
5
  "dom",
5
6
  "dom.iterable",
@@ -26,7 +27,7 @@
26
27
  "./src/*"
27
28
  ]
28
29
  },
29
- "target": "ES2017"
30
+ "strictNullChecks": true
30
31
  },
31
32
  "include": [
32
33
  "next-env.d.ts",
@@ -37,4 +38,4 @@
37
38
  "exclude": [
38
39
  "node_modules"
39
40
  ]
40
- }
41
+ }
@@ -1,9 +1,9 @@
1
1
  import { __CLIENT_NAME__ } from "@/config/schemas/__SOURCE_NAME__/client";
2
- import { Stack, Text, Code } from "@mantine/core";
2
+ import { Code, Stack, Text } from "@mantine/core";
3
3
  import React from "react";
4
4
 
5
- import TableContent from "./table";
6
5
  import { idFieldName } from "./schema";
6
+ import TableContent from "./table";
7
7
 
8
8
  export default async function TablePage() {
9
9
  // this function is limited to 100 records by default. To load more, see the other table templates from the docs
@@ -17,12 +17,12 @@ export default async function TablePage() {
17
17
  This table allows editing. Double-click on a cell to edit the value.
18
18
  </Text>
19
19
  <Text size="sm" c="dimmed">
20
- NOTE: This feature requires a primary key field on your API layout. If your
21
- primary key field is not <Code>{idFieldName}</Code>, update the
20
+ NOTE: This feature requires a primary key field on your API layout. If
21
+ your primary key field is not <Code>{idFieldName}</Code>, update the
22
22
  <Code>idFieldName</Code> variable in the <Code>schema.ts</Code> file.
23
23
  </Text>
24
24
  </div>
25
25
  <TableContent data={data.map((d) => d.fieldData)} />
26
26
  </Stack>
27
27
  );
28
- }
28
+ }
@@ -1,15 +1,16 @@
1
1
  "use client";
2
2
 
3
3
  import { type __TYPE_NAME__ } from "@/config/schemas/__SOURCE_NAME__/__SCHEMA_NAME__";
4
+ import { showErrorNotification } from "@/utils/notification-helpers";
4
5
  import {
5
6
  MantineReactTable,
7
+ useMantineReactTable,
6
8
  type MRT_Cell,
7
9
  type MRT_ColumnDef,
8
- useMantineReactTable,
9
10
  } from "mantine-react-table";
10
11
  import React from "react";
12
+
11
13
  import { updateRecord } from "./actions";
12
- import { showErrorNotification } from "@/utils/notification-helpers";
13
14
  import { idFieldName } from "./schema";
14
15
 
15
16
  type TData = __TYPE_NAME__;
@@ -39,5 +40,6 @@ export default function MyTable({ data }: { data: TData[] }) {
39
40
  handleSaveCell(cell, event.target.value);
40
41
  },
41
42
  }),
42
- }); return <MantineReactTable table={table} />;
43
+ });
44
+ return <MantineReactTable table={table} />;
43
45
  }
@@ -1,12 +1,13 @@
1
1
  "use client";
2
2
 
3
3
  import { useInfiniteQuery } from "@tanstack/react-query";
4
- import { fetchData } from "./actions";
5
- import { useMemo } from "react";
6
4
  import type {
7
- MRT_SortingState,
8
5
  MRT_ColumnFiltersState,
6
+ MRT_SortingState,
9
7
  } from "mantine-react-table";
8
+ import { useMemo } from "react";
9
+
10
+ import { fetchData } from "./actions";
10
11
 
11
12
  export function useAllData({
12
13
  sorting,
@@ -1,6 +1,7 @@
1
1
  "use client";
2
2
 
3
3
  import { __TYPE_NAME__ } from "@/config/schemas/__SOURCE_NAME__/__SCHEMA_NAME__";
4
+ import { Text } from "@mantine/core";
4
5
  import {
5
6
  createMRTColumnHelper,
6
7
  MantineReactTable,
@@ -11,14 +12,14 @@ import {
11
12
  useMantineReactTable,
12
13
  } from "mantine-react-table";
13
14
  import React, {
14
- type UIEvent,
15
15
  useCallback,
16
16
  useEffect,
17
17
  useRef,
18
18
  useState,
19
+ type UIEvent,
19
20
  } from "react";
21
+
20
22
  import { useAllData } from "./query";
21
- import { Text } from "@mantine/core";
22
23
 
23
24
  type TData = __TYPE_NAME__;
24
25
 
@@ -1,8 +1,8 @@
1
- import { Stack, Text, Code } from "@mantine/core";
1
+ import { Code, Stack, Text } from "@mantine/core";
2
2
  import React from "react";
3
3
 
4
- import TableContent from "./table";
5
4
  import { idFieldName } from "./schema";
5
+ import TableContent from "./table";
6
6
 
7
7
  export default async function TablePage() {
8
8
  return (
@@ -12,12 +12,12 @@ export default async function TablePage() {
12
12
  This table allows editing. Double-click on a cell to edit the value.
13
13
  </Text>
14
14
  <Text size="sm" c="dimmed">
15
- NOTE: This feature requires a primary key field on your API layout. If your
16
- primary key field is not <Code>{idFieldName}</Code>, update the
15
+ NOTE: This feature requires a primary key field on your API layout. If
16
+ your primary key field is not <Code>{idFieldName}</Code>, update the
17
17
  <Code>idFieldName</Code> variable in the <Code>schema.ts</Code> file.
18
18
  </Text>
19
19
  </div>
20
- <TableContent />
20
+ <TableContent />
21
21
  </Stack>
22
22
  );
23
- }
23
+ }
@@ -66,7 +66,7 @@ export function useAllData({
66
66
  data: page.data.map((row) =>
67
67
  row.fieldData[idFieldName] === newRecord[idFieldName]
68
68
  ? { ...row, fieldData: { ...row.fieldData, ...newRecord } }
69
- : row,
69
+ : row
70
70
  ),
71
71
  })),
72
72
  };
@@ -77,5 +77,11 @@ export function useAllData({
77
77
  },
78
78
  });
79
79
 
80
- return { ...qr, data: flatData, totalDBRowCount, totalFetched, updateRecord: updateRecordMutation.mutate };
80
+ return {
81
+ ...qr,
82
+ data: flatData,
83
+ totalDBRowCount,
84
+ totalFetched,
85
+ updateRecord: updateRecordMutation.mutate,
86
+ };
81
87
  }
@@ -1,13 +1,14 @@
1
+ import FullScreenLoader from "@/components/full-screen-loader";
2
+ import { __TYPE_NAME__ } from "@/config/schemas/__SOURCE_NAME__/__SCHEMA_NAME__";
3
+ import { __CLIENT_NAME__ } from "@/config/schemas/__SOURCE_NAME__/client";
4
+ import { Stack, Text } from "@mantine/core";
1
5
  import { createFileRoute } from "@tanstack/react-router";
2
6
  import {
3
7
  MantineReactTable,
4
8
  MRT_ColumnDef,
5
9
  useMantineReactTable,
6
10
  } from "mantine-react-table";
7
- import { __CLIENT_NAME__ } from "@/config/schemas/__SOURCE_NAME__/client";
8
- import { __TYPE_NAME__ } from "@/config/schemas/__SOURCE_NAME__/__SCHEMA_NAME__";
9
- import { Stack, Text } from "@mantine/core";
10
- import FullScreenLoader from "@/components/full-screen-loader";
11
+
11
12
  export const Route = createFileRoute("/")({
12
13
  component: RouteComponent,
13
14
  pendingComponent: () => <FullScreenLoader />,
@@ -1,3 +1,7 @@
1
+ import FullScreenLoader from "@/components/full-screen-loader";
2
+ import { __TYPE_NAME__ } from "@/config/schemas/__SOURCE_NAME__/__SCHEMA_NAME__";
3
+ import { __CLIENT_NAME__ } from "@/config/schemas/__SOURCE_NAME__/client";
4
+ import { Code, Stack, Text } from "@mantine/core";
1
5
  import { createFileRoute } from "@tanstack/react-router";
2
6
  import {
3
7
  MantineReactTable,
@@ -5,10 +9,6 @@ import {
5
9
  MRT_ColumnDef,
6
10
  useMantineReactTable,
7
11
  } from "mantine-react-table";
8
- import { __CLIENT_NAME__ } from "@/config/schemas/__SOURCE_NAME__/client";
9
- import { __TYPE_NAME__ } from "@/config/schemas/__SOURCE_NAME__/__SCHEMA_NAME__";
10
- import { Code, Stack, Text } from "@mantine/core";
11
- import FullScreenLoader from "@/components/full-screen-loader";
12
12
 
13
13
  export const Route = createFileRoute("/")({
14
14
  component: RouteComponent,
@@ -61,8 +61,8 @@ function RouteComponent() {
61
61
  This table allows editing. Double-click on a cell to edit the value.
62
62
  </Text>
63
63
  <Text size="sm" c="dimmed">
64
- NOTE: This feature requires a primary key field on your API layout. If your
65
- primary key field is not <Code>{idFieldName}</Code>, update the
64
+ NOTE: This feature requires a primary key field on your API layout. If
65
+ your primary key field is not <Code>{idFieldName}</Code>, update the
66
66
  <Code>idFieldName</Code> variable in the code.
67
67
  </Text>
68
68
  </div>
@@ -37,6 +37,6 @@ if (!rootElement.innerHTML) {
37
37
  root.render(
38
38
  <MantineProvider theme={theme} forceColorScheme="light">
39
39
  <RouterProvider router={router} />
40
- </MantineProvider>
40
+ </MantineProvider>,
41
41
  );
42
42
  }
@@ -10,85 +10,85 @@
10
10
 
11
11
  // Import Routes
12
12
 
13
- import { Route as rootRoute } from './routes/__root'
14
- import { Route as SecondaryImport } from './routes/secondary'
15
- import { Route as IndexImport } from './routes/index'
13
+ import { Route as rootRoute } from "./routes/__root";
14
+ import { Route as SecondaryImport } from "./routes/secondary";
15
+ import { Route as IndexImport } from "./routes/index";
16
16
 
17
17
  // Create/Update Routes
18
18
 
19
19
  const SecondaryRoute = SecondaryImport.update({
20
- id: '/secondary',
21
- path: '/secondary',
20
+ id: "/secondary",
21
+ path: "/secondary",
22
22
  getParentRoute: () => rootRoute,
23
- } as any)
23
+ } as any);
24
24
 
25
25
  const IndexRoute = IndexImport.update({
26
- id: '/',
27
- path: '/',
26
+ id: "/",
27
+ path: "/",
28
28
  getParentRoute: () => rootRoute,
29
- } as any)
29
+ } as any);
30
30
 
31
31
  // Populate the FileRoutesByPath interface
32
32
 
33
- declare module '@tanstack/react-router' {
33
+ declare module "@tanstack/react-router" {
34
34
  interface FileRoutesByPath {
35
- '/': {
36
- id: '/'
37
- path: '/'
38
- fullPath: '/'
39
- preLoaderRoute: typeof IndexImport
40
- parentRoute: typeof rootRoute
41
- }
42
- '/secondary': {
43
- id: '/secondary'
44
- path: '/secondary'
45
- fullPath: '/secondary'
46
- preLoaderRoute: typeof SecondaryImport
47
- parentRoute: typeof rootRoute
48
- }
35
+ "/": {
36
+ id: "/";
37
+ path: "/";
38
+ fullPath: "/";
39
+ preLoaderRoute: typeof IndexImport;
40
+ parentRoute: typeof rootRoute;
41
+ };
42
+ "/secondary": {
43
+ id: "/secondary";
44
+ path: "/secondary";
45
+ fullPath: "/secondary";
46
+ preLoaderRoute: typeof SecondaryImport;
47
+ parentRoute: typeof rootRoute;
48
+ };
49
49
  }
50
50
  }
51
51
 
52
52
  // Create and export the route tree
53
53
 
54
54
  export interface FileRoutesByFullPath {
55
- '/': typeof IndexRoute
56
- '/secondary': typeof SecondaryRoute
55
+ "/": typeof IndexRoute;
56
+ "/secondary": typeof SecondaryRoute;
57
57
  }
58
58
 
59
59
  export interface FileRoutesByTo {
60
- '/': typeof IndexRoute
61
- '/secondary': typeof SecondaryRoute
60
+ "/": typeof IndexRoute;
61
+ "/secondary": typeof SecondaryRoute;
62
62
  }
63
63
 
64
64
  export interface FileRoutesById {
65
- __root__: typeof rootRoute
66
- '/': typeof IndexRoute
67
- '/secondary': typeof SecondaryRoute
65
+ __root__: typeof rootRoute;
66
+ "/": typeof IndexRoute;
67
+ "/secondary": typeof SecondaryRoute;
68
68
  }
69
69
 
70
70
  export interface FileRouteTypes {
71
- fileRoutesByFullPath: FileRoutesByFullPath
72
- fullPaths: '/' | '/secondary'
73
- fileRoutesByTo: FileRoutesByTo
74
- to: '/' | '/secondary'
75
- id: '__root__' | '/' | '/secondary'
76
- fileRoutesById: FileRoutesById
71
+ fileRoutesByFullPath: FileRoutesByFullPath;
72
+ fullPaths: "/" | "/secondary";
73
+ fileRoutesByTo: FileRoutesByTo;
74
+ to: "/" | "/secondary";
75
+ id: "__root__" | "/" | "/secondary";
76
+ fileRoutesById: FileRoutesById;
77
77
  }
78
78
 
79
79
  export interface RootRouteChildren {
80
- IndexRoute: typeof IndexRoute
81
- SecondaryRoute: typeof SecondaryRoute
80
+ IndexRoute: typeof IndexRoute;
81
+ SecondaryRoute: typeof SecondaryRoute;
82
82
  }
83
83
 
84
84
  const rootRouteChildren: RootRouteChildren = {
85
85
  IndexRoute: IndexRoute,
86
86
  SecondaryRoute: SecondaryRoute,
87
- }
87
+ };
88
88
 
89
89
  export const routeTree = rootRoute
90
90
  ._addFileChildren(rootRouteChildren)
91
- ._addFileTypes<FileRouteTypes>()
91
+ ._addFileTypes<FileRouteTypes>();
92
92
 
93
93
  /* ROUTE_MANIFEST_START
94
94
  {
File without changes
File without changes
File without changes