Skip to content

Commit

Permalink
upgrade nextra, fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
foyarash committed Dec 11, 2024
1 parent 3cd3d20 commit 78e6128
Show file tree
Hide file tree
Showing 20 changed files with 1,827 additions and 1,141 deletions.
8 changes: 0 additions & 8 deletions apps/docs/next.config.js

This file was deleted.

10 changes: 10 additions & 0 deletions apps/docs/next.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import nextra from "nextra";

const config = nextra({
theme: "nextra-theme-docs",
themeConfig: "./theme.config.jsx",
});

export default config({
reactStrictMode: true,
});
4 changes: 2 additions & 2 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"framer-motion": "^11.13.5",
"mini-svg-data-uri": "^1.4.4",
"next": "^15.0.3",
"nextra": "^2.13.2",
"nextra-theme-docs": "^2.13.2",
"nextra": "3.2.5",
"nextra-theme-docs": "3.2.5",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"tailwind-merge": "^2.2.1"
Expand Down
30 changes: 0 additions & 30 deletions apps/docs/pages/_meta.json

This file was deleted.

29 changes: 29 additions & 0 deletions apps/docs/pages/_meta.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
export default {
index: {
type: "page",
title: "Next Admin",
display: "hidden",
theme: {
layout: "raw",
},
},
docs: {
title: " ",
type: "page",
},
v4: {
title: "v4",
type: "page",
display: "hidden",
},
changelog: {
title: "Changelog",
type: "page",
},
demo: {
title: "Demo",
type: "page",
href: "https://next-admin-po.vercel.app",
newWindow: true,
},
};
3 changes: 3 additions & 0 deletions apps/docs/pages/changelog/_meta.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
index: "Versions",
};
4 changes: 0 additions & 4 deletions apps/docs/pages/changelog/_meta.json

This file was deleted.

21 changes: 0 additions & 21 deletions apps/docs/pages/docs/_meta.json

This file was deleted.

20 changes: 20 additions & 0 deletions apps/docs/pages/docs/_meta.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
export default {
index: "Introduction",
"getting-started": "Getting Started",
api: {
title: "API",
theme: {
breadcrumb: true,
footer: true,
sidebar: true,
toc: true,
pagination: true,
},
},
i18n: "I18n",
theming: "Theming",
glossary: "Glossary",
route: "Route name",
"edge-cases": "Edge cases",
"code-snippets": "Code snippets",
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
export default {
"next-admin-component": {
"title": "<NextAdmin/>"
},
Expand Down
26 changes: 18 additions & 8 deletions apps/docs/pages/docs/index.mdx
Original file line number Diff line number Diff line change
@@ -1,28 +1,38 @@


import {
BoltIcon,
CodeBracketIcon,
PlayCircleIcon,
} from '@heroicons/react/24/outline'
import { Callout, Card, Cards } from 'nextra/components'
} from "@heroicons/react/24/outline";
import { Callout, Card, Cards } from "nextra/components";

# 🧞 Next Admin

<Callout type="info">
This is the documentation for the latest version of Next Admin. If you are using an older version (`<5.0.0`), please refer to the [documentation](/v4/docs)
</Callout>

<Cards>
<Card icon={<BoltIcon/>} title="Installation" href="/docs/getting-started" />
<Card icon={<PlayCircleIcon/>} title="Live demo" href="https://next-admin-po.vercel.app/admin" />
<Card icon={<CodeBracketIcon />} title="Source code" href="https://github.com/premieroctet/next-admin" />
<Cards.Card
icon={<BoltIcon />}
title="Installation"
href="/docs/getting-started"
/>
<Cards.Card
icon={<PlayCircleIcon />}
title="Live demo"
href="https://next-admin-po.vercel.app/admin"
/>
<Cards.Card
icon={<CodeBracketIcon />}
title="Source code"
href="https://github.com/premieroctet/next-admin"
/>
</Cards>

###### `next-admin` is a library built on top of [Prisma](https://www.prisma.io/) and [Next.js](https://nextjs.org/) that allows you to easily manage and visualize your Prisma database in a nice graphical user interface (GUI).

Get started by following the [installation guide](/docs/getting-started), or check out the [live demo](https://next-admin-po.vercel.app/admin).


![Hello](/screenshot.png)

This library is still under development. The following features are available:
Expand Down
7 changes: 7 additions & 0 deletions apps/docs/pages/v4/_meta.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default {
docs: {
title: "Documentation",
type: "page",
display: "hidden",
},
};
7 changes: 0 additions & 7 deletions apps/docs/pages/v4/_meta.json

This file was deleted.

22 changes: 22 additions & 0 deletions apps/docs/pages/v4/docs/_meta.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
export default {
index: "Introduction",
"getting-started": "Getting Started",
api: {
title: "API",
theme: {
breadcrumb: true,
footer: true,
sidebar: true,
toc: true,
pagination: true,
},
},
authentication: "Authentication",
i18n: "I18n",

theming: "Theming",
glossary: "Glossary",
route: "Route name",
"edge-cases": "Edge cases",
"code-snippets": "Code snippets",
};
23 changes: 0 additions & 23 deletions apps/docs/pages/v4/docs/_meta.json

This file was deleted.

17 changes: 17 additions & 0 deletions apps/docs/pages/v4/docs/api/_meta.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
export default {
"next-admin-component": {
title: "<NextAdmin/>",
},
"get-props-from-params": {
title: "getPropsFromParams()",
},
"next-admin-router": {
title: "nextAdminRouter()",
},
options: {
title: "Options parameter",
},
"model-configuration": {
title: "Model configuration",
},
};
17 changes: 0 additions & 17 deletions apps/docs/pages/v4/docs/api/_meta.json

This file was deleted.

24 changes: 18 additions & 6 deletions apps/docs/pages/v4/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,39 @@ import {
BoltIcon,
CodeBracketIcon,
PlayCircleIcon,
} from '@heroicons/react/24/outline'
import { Callout, Card, Cards } from 'nextra/components'
} from "@heroicons/react/24/outline";
import { Callout, Card, Cards } from "nextra/components";

# 🧞 Next Admin

<Callout type="default">
This documentation covers an older version of Next Admin. If you are using the
latest version (`>=5.0.0` and above), please refer to the [current
documentation](/docs).
</Callout>

<Cards>
<Card icon={<BoltIcon/>} title="Installation" href="/v4/docs/getting-started" />
<Card icon={<PlayCircleIcon/>} title="Live demo" href="https://next-admin-po.vercel.app/admin" />
<Card icon={<CodeBracketIcon />} title="Source code" href="https://github.com/premieroctet/next-admin" />
<Cards.Card
icon={<BoltIcon />}
title="Installation"
href="/v4/docs/getting-started"
/>
<Cards.Card
icon={<PlayCircleIcon />}
title="Live demo"
href="https://next-admin-po.vercel.app/admin"
/>
<Cards.Card
icon={<CodeBracketIcon />}
title="Source code"
href="https://github.com/premieroctet/next-admin"
/>
</Cards>

###### `next-admin` is a library built on top of [Prisma](https://www.prisma.io/) and [Next.js](https://nextjs.org/) that allows you to easily manage and visualize your Prisma database in a nice graphical user interface (GUI).

Get started by following the [installation guide](/v4/docs/getting-started) or check out the [live demo](https://next-admin-po.vercel.app/admin).


![Hello](/screenshot.png)

This library is still under development. The following features are available:
Expand Down
6 changes: 4 additions & 2 deletions packages/next-admin/src/tests/tools.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,17 @@ describe("extractSerializable", () => {
});
it("should return the object without function properties", () => {
const obj = { f: () => {} };
expect(extractSerializable(obj)).toEqual({});
expect(extractSerializable(obj)).toEqual({
f: null,
});
});
it("should return the object with empty arrays and objects", () => {
const obj = { a: [], b: {} };
expect(extractSerializable(obj)).toEqual({ a: [], b: {} });
});
it("should return the objet with null and undefined values", () => {
const obj = { a: null, b: undefined };
expect(extractSerializable(obj)).toEqual({ a: null, b: undefined });
expect(extractSerializable(obj)).toEqual({ a: null, b: null });
});
});

Expand Down
Loading

0 comments on commit 78e6128

Please sign in to comment.