Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/apps/web/src/app/[locale]/(main)/(plugins)
/apps/web/src/app/[locale]/admin/(auth)/(plugins)
2 changes: 1 addition & 1 deletion apps/docs/content/docs/dev/debugging.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Want to know exactly what's happening with your API calls? Next.js has your back

```ts title="next.config.ts"
import type { NextConfig } from 'next';
import { vitNodeNextConfig } from 'vitnode/config/next.config';
import { vitNodeNextConfig } from '@vitnode/core/config/next.config';

const nextConfig: NextConfig = {
// [!code ++]
Expand Down
4 changes: 2 additions & 2 deletions apps/docs/content/docs/dev/fetcher.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ The VitNode fetcher provides a type-safe RPC (Remote Procedure Call) style inter
First, import the required dependencies:

```ts
import { fetcher } from 'vitnode/lib/fetcher';
import { usersModule } from 'vitnode/api/modules/users/users.module';
import { fetcher } from '@vitnode/core/lib/fetcher';
import { usersModule } from '@vitnode/core/api/modules/users/users.module';
```

Make your first API call:
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/docs/dev/i18n/namespaces.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ To translate your content, select the plugin in `frontend` folder, go to `langs`
To get access to the translation strings in other namespaces you need to use the `TranslationsProvider` component.

```tsx title="apps/frontend/src/app/[locale]/(main)/{your_plugin}/layout.tsx"
import { I18nProvider } from 'vitnode/components/i18n-provider';
import { I18nProvider } from '@vitnode/core/components/i18n-provider';

export default function Layout({ children }: { children: React.ReactNode }) {
return <I18nProvider namespaces={['welcome.home']}>{children}</I18nProvider>;
Expand Down
4 changes: 2 additions & 2 deletions apps/docs/content/docs/dev/pagination.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ import { middlewareModule } from '@/api/modules/middleware/middleware.module';
import {
DataTable,
SearchParamsDataTable,
} from 'vitnode/components/table/data-table';
import { fetcher } from 'vitnode/lib/fetcher';
} from '@vitnode/core/components/table/data-table';
import { fetcher } from '@vitnode/core/lib/fetcher';

export const UsersAdminView = async ({
searchParams,
Expand Down
10 changes: 5 additions & 5 deletions apps/docs/content/docs/dev/sso.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { Callout } from 'fumadocs-ui/components/callout';
Let's start with the basics. Create a new file for your SSO provider:

```ts title="src/utils/sso/discord_api.ts"
import { SSOApiPlugin, getRedirectUri } from 'vitnode/api/models/sso';
import { SSOApiPlugin, getRedirectUri } from '@vitnode/core/api/models/sso';

export const DiscordSSOApiPlugin = ({
clientId,
Expand All @@ -43,7 +43,7 @@ This is like creating a blueprint for your SSO provider. The `id` will be used i
Now let's add the magic that sends users to Discord for login:

```ts title="src/utils/sso/discord_api.ts"
import { SSOApiPlugin, getRedirectUri } from 'vitnode/api/models/sso';
import { SSOApiPlugin, getRedirectUri } from '@vitnode/core/api/models/sso';

export const DiscordSSOApiPlugin = ({
clientId,
Expand Down Expand Up @@ -94,7 +94,7 @@ export const DiscordSSOApiPlugin = ({
After the user approves access, Discord sends us a code. Let's exchange it for an access token:

```ts title="src/utils/sso/discord_api.ts"
import { SSOApiPlugin, getRedirectUri } from 'vitnode/api/models/sso';
import { SSOApiPlugin, getRedirectUri } from '@vitnode/core/api/models/sso';
import { HTTPException } from 'hono/http-exception';
import { ContentfulStatusCode } from 'hono/utils/http-status';
import { z } from 'zod';
Expand Down Expand Up @@ -205,7 +205,7 @@ export const DiscordSSOApiPlugin = ({
Finally, let's get the user's profile data using our shiny new access token:

```ts title="src/utils/sso/discord_api.ts"
import { SSOApiPlugin, getRedirectUri } from 'vitnode/api/models/sso';
import { SSOApiPlugin, getRedirectUri } from '@vitnode/core/api/models/sso';
import { HTTPException } from 'hono/http-exception';
import { ContentfulStatusCode } from 'hono/utils/http-status';
import { z } from 'zod';
Expand Down Expand Up @@ -324,7 +324,7 @@ Last step! Let's plug your new SSO provider into your app:
```ts title="src/app/api/[...route]/route.ts"
import { OpenAPIHono } from '@hono/zod-openapi';
import { handle } from 'hono/vercel';
import { VitNodeAPI } from 'vitnode/api/config';
import { VitNodeAPI } from '@vitnode/core/api/config';
import { DiscordSSOApiPlugin } from '@/utils/sso/discord_api';

const app = new OpenAPIHono().basePath('/api');
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/docs/guides/sso/discord.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Add the Discord SSO plugin to your API routes.

```ts title="src/app/api/[...route]/route.ts"
// [!code ++]
import { DiscordSSOApiPlugin } from 'vitnode/api/plugins/sso/discord';
import { DiscordSSOApiPlugin } from '@vitnode/core/api/plugins/sso/discord';

VitNodeAPI({
app,
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/docs/guides/sso/facebook.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Add the Facebook SSO plugin to your API routes.

```ts title="src/app/api/[...route]/route.ts"
// [!code ++]
import { FacebookSSOApiPlugin } from 'vitnode/api/plugins/sso/facebook';
import { FacebookSSOApiPlugin } from '@vitnode/core/api/plugins/sso/facebook';

VitNodeAPI({
app,
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/docs/guides/sso/google.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Add the Discord SSO plugin to your API routes.

```ts title="src/app/api/[...route]/route.ts"
// [!code ++]
import { GoogleSSOApiPlugin } from 'vitnode/api/plugins/sso/google';
import { GoogleSSOApiPlugin } from '@vitnode/core/api/plugins/sso/google';

VitNodeAPI({
app,
Expand Down
4 changes: 2 additions & 2 deletions apps/docs/content/docs/ui/auto-form.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ description: Component creates form based on Zod schemas & react-hook-form with

```tsx
import { z } from 'zod';
import { AutoForm } from 'vitnode/components/form/auto-form';
import { AutoFormInput } from 'vitnode/components/form/fields/input';
import { AutoForm } from '@vitnode/core/components/form/auto-form';
import { AutoFormInput } from '@vitnode/core/components/form/fields/input';
```

```ts
Expand Down
6 changes: 3 additions & 3 deletions apps/docs/content/docs/ui/checkbox.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import { Tab, Tabs } from 'fumadocs-ui/components/tabs';

```ts
import { z } from 'zod';
import { AutoForm } from 'vitnode/components/form/auto-form';
import { AutoFormCheckbox } from 'vitnode/components/form/fields/checkbox';
import { AutoForm } from '@vitnode/core/components/form/auto-form';
import { AutoFormCheckbox } from '@vitnode/core/components/form/fields/checkbox';
```

```ts
Expand Down Expand Up @@ -50,7 +50,7 @@ const formSchema = z.object({

<Tab value="Manual">
```ts
import { Checkbox } from 'vitnode-frontend/components/ui/checkbox';
import { Checkbox } from '@vitnode/core-frontend/components/ui/checkbox';
```

```tsx
Expand Down
6 changes: 3 additions & 3 deletions apps/docs/content/docs/ui/data-table.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: A table component with sorting, filtering, and pagination compatibl
## Usage

```ts
import { DataTable } from 'vitnode/components/table/data-table';
import { DataTable } from '@vitnode/core/components/table/data-table';
```

```tsx
Expand Down Expand Up @@ -131,9 +131,9 @@ Here's a complete example showing how to use the `DataTable` component in a page
import {
DataTable,
SearchParamsDataTable,
} from 'vitnode/components/table/data-table';
} from '@vitnode/core/components/table/data-table';
import { userModule } from '@/api/modules/user/user.module';
import { fetcher } from 'vitnode/lib/fetcher';
import { fetcher } from '@vitnode/core/lib/fetcher';

export const UsersView = async ({
searchParams,
Expand Down
6 changes: 3 additions & 3 deletions apps/docs/content/docs/ui/input.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import { Tab, Tabs } from 'fumadocs-ui/components/tabs';
<Tab value="Auto Form">
```ts
import { z } from 'zod';
import { AutoForm } from 'vitnode/components/form/auto-form';
import { AutoFormInput } from 'vitnode/components/form/fields/input';
import { AutoForm } from '@vitnode/core/components/form/auto-form';
import { AutoFormInput } from '@vitnode/core/components/form/fields/input';
```

```ts
Expand Down Expand Up @@ -60,7 +60,7 @@ const formSchema = z.object({

<Tab value="Manual">
```ts
import { Input } from 'vitnode-frontend/components/ui/input';
import { Input } from '@vitnode/core-frontend/components/ui/input';
```

```tsx
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/docs/ui/not-found.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: xxx
VitNode has implemented own 404 page. You can create your own page by modifying the `app/[locale]/(main)/not-found.tsx` file.

```tsx
import { ErrorView } from 'vitnode/views/error/error-view';
import { ErrorView } from '@vitnode/core/views/error/error-view';

export default function NotFoundPage() {
return <ErrorView code={404} />;
Expand Down
8 changes: 4 additions & 4 deletions apps/docs/content/docs/ui/radio-group.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import { Tab, Tabs } from 'fumadocs-ui/components/tabs';
<Tab value="Auto Form">
```ts
import { z } from 'zod';
import { AutoForm } from 'vitnode/components/form/auto-form';
import { AutoFormRadioGroup } from 'vitnode/components/form/fields/radio-group';
import { AutoForm } from '@vitnode/core/components/form/auto-form';
import { AutoFormRadioGroup } from '@vitnode/core/components/form/fields/radio-group';
```

```ts
Expand Down Expand Up @@ -62,11 +62,11 @@ const formSchema = z.object({

<Tab value="Manual">
```ts
import { Label } from 'vitnode-frontend/components/ui/label';
import { Label } from '@vitnode/core-frontend/components/ui/label';
import {
RadioGroup,
RadioGroupItem,
} from 'vitnode-frontend/components/ui/radio-group';
} from '@vitnode/core-frontend/components/ui/radio-group';
```

```tsx
Expand Down
6 changes: 3 additions & 3 deletions apps/docs/content/docs/ui/select.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import { Tab, Tabs } from 'fumadocs-ui/components/tabs';

```ts
import { z } from 'zod';
import { AutoForm } from 'vitnode/components/form/auto-form';
import { AutoFormSelect } from 'vitnode/components/form/fields/select';
import { AutoForm } from '@vitnode/core/components/form/auto-form';
import { AutoFormSelect } from '@vitnode/core/components/form/fields/select';
```

```ts
Expand Down Expand Up @@ -69,7 +69,7 @@ import {
SelectItem,
SelectTrigger,
SelectValue,
} from 'vitnode-frontend/components/ui/select';
} from '@vitnode/core-frontend/components/ui/select';
```

```tsx
Expand Down
6 changes: 3 additions & 3 deletions apps/docs/content/docs/ui/switch.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import { Tab, Tabs } from 'fumadocs-ui/components/tabs';

```ts
import { z } from 'zod';
import { AutoForm } from 'vitnode/components/form/auto-form';
import { AutoFormCheckbox } from 'vitnode/components/form/fields/checkbox';
import { AutoForm } from '@vitnode/core/components/form/auto-form';
import { AutoFormCheckbox } from '@vitnode/core/components/form/fields/checkbox';
```

```ts
Expand Down Expand Up @@ -50,7 +50,7 @@ const formSchema = z.object({

<Tab value="Manual">
```ts
import { Switch } from 'vitnode-frontend/components/ui/switch';
import { Switch } from '@vitnode/core-frontend/components/ui/switch';
```

```tsx
Expand Down
6 changes: 3 additions & 3 deletions apps/docs/content/docs/ui/textarea.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import { Tab, Tabs } from 'fumadocs-ui/components/tabs';

```ts
import { z } from 'zod';
import { AutoForm } from 'vitnode/components/form/auto-form';
import { AutoFormTextarea } from 'vitnode/components/form/fields/textarea';
import { AutoForm } from '@vitnode/core/components/form/auto-form';
import { AutoFormTextarea } from '@vitnode/core/components/form/fields/textarea';
```

```ts
Expand Down Expand Up @@ -50,7 +50,7 @@ const formSchema = z.object({

<Tab value="Manual">
```ts
import { Textarea } from 'vitnode-frontend/components/ui/textarea';
import { Textarea } from '@vitnode/core-frontend/components/ui/textarea';
```

```tsx
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"next": "^15.3.1",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"vitnode": "workspace:*"
"@vitnode/core": "workspace:*"
},
"devDependencies": {
"@tailwindcss/postcss": "^4.1.4",
Expand Down
4 changes: 2 additions & 2 deletions apps/docs/src/app/(home)/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Link from 'fumadocs-core/link';
import { PlusIcon } from 'lucide-react';
import { Metadata } from 'next';
import { buttonVariants } from 'vitnode/components/ui/button';
import { cn } from 'vitnode/lib/utils';
import { buttonVariants } from '@vitnode/core/components/ui/button';
import { cn } from '@vitnode/core/lib/utils';

export const metadata: Metadata = {
title: 'VitNode: Extendable Framework for Building Apps',
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/components/logo-vitnode.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { cn } from 'vitnode/lib/utils';
import { cn } from '@vitnode/core/lib/utils';

export const LogoVitNode = ({
className,
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/content/docs/guides/sso/discord.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Add the Discord SSO plugin to your API routes.

```ts title="src/app/api/[...route]/route.ts"
// [!code ++]
import { DiscordSSOApiPlugin } from 'vitnode/api/plugins/sso/discord';
import { DiscordSSOApiPlugin } from '@vitnode/core/api/plugins/sso/discord';

VitNodeAPI({
app,
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/content/docs/guides/sso/facebook.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Add the Facebook SSO plugin to your API routes.

```ts title="src/app/api/[...route]/route.ts"
// [!code ++]
import { FacebookSSOApiPlugin } from 'vitnode/api/plugins/sso/facebook';
import { FacebookSSOApiPlugin } from '@vitnode/core/api/plugins/sso/facebook';

VitNodeAPI({
app,
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/content/docs/guides/sso/google.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Add the Discord SSO plugin to your API routes.

```ts title="src/app/api/[...route]/route.ts"
// [!code ++]
import { GoogleSSOApiPlugin } from 'vitnode/api/plugins/sso/google';
import { GoogleSSOApiPlugin } from '@vitnode/core/api/plugins/sso/google';

VitNodeAPI({
app,
Expand Down
2 changes: 1 addition & 1 deletion apps/web/next.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { NextConfig } from 'next';
import { vitNodeNextConfig } from 'vitnode/config/next.config';
import { vitNodeNextConfig } from '@vitnode/core/config/next.config';

const nextConfig: NextConfig = {
/* config options here */
Expand Down
4 changes: 2 additions & 2 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
"react-dom": "^19.1.0",
"react-hook-form": "^7.56.1",
"sonner": "^2.0.3",
"vitnode": "workspace:*",
"vitnode-blog": "workspace:*",
"@vitnode/core": "workspace:*",
"@vitnode/blog": "workspace:*",
"zod": "^3.24.3"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TestLayout } from 'vitnode-blog/views/test/layout';
import { TestLayout } from '@vitnode/blog/views/test/layout';

export default function Layout({ children }: { children: React.ReactNode }) {
return <TestLayout>{children}</TestLayout>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Test } from 'vitnode-blog/views/test';
import { TestClient } from 'vitnode-blog/views/test/client';
import { Link } from 'vitnode/lib/navigation';
import { Test } from '@vitnode/blog/views/test';
import { TestClient } from '@vitnode/blog/views/test/client';
import { Link } from '@vitnode/core/lib/navigation';

export default function Page() {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Link } from 'vitnode/lib/navigation';
import { Link } from '@vitnode/core/lib/navigation';

export default function Page() {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Metadata } from 'next/dist/types';

import { SignInView } from '@vitnode/core/views/auth/sign-in/sign-in-view';
import { getTranslations } from 'next-intl/server';
import { SignInView } from 'vitnode/views/auth/sign-in/sign-in-view';

export const generateMetadata = async ({
locale,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CallbackSSOView } from 'vitnode/views/auth/sso/callback/callback-sso-view';
import { CallbackSSOView } from '@vitnode/core/views/auth/sso/callback/callback-sso-view';

export default async function Page({
params,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Metadata } from 'next/dist/types';

import { SignUpView } from '@vitnode/core/views/auth/sign-up/sign-up-view';
import { getTranslations } from 'next-intl/server';
import { SignUpView } from 'vitnode/views/auth/sign-up/sign-up-view';

export const generateMetadata = async ({
locale,
Expand Down
Loading
Loading