create-vitnode-app 1.2.0-canary.52 → 1.2.0-canary.53
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/README.md +1 -1
- package/copy-of-vitnode-app/.vscode/settings.json +29 -0
- package/copy-of-vitnode-app/api/drizzle.config.ts +4 -4
- package/copy-of-vitnode-app/api/src/index.ts +7 -7
- package/copy-of-vitnode-app/api/src/vitnode.api.config.ts +8 -9
- package/copy-of-vitnode-app/api/tsconfig.json +1 -1
- package/copy-of-vitnode-app/api-bun/src/index.ts +4 -4
- package/copy-of-vitnode-app/api-single-app/drizzle.config.ts +4 -4
- package/copy-of-vitnode-app/api-single-app/src/app/api/[...route]/route.ts +5 -5
- package/copy-of-vitnode-app/api-single-app/src/vitnode.api.config.ts +6 -7
- package/copy-of-vitnode-app/biome/biome.json +5 -0
- package/copy-of-vitnode-app/monorepo/turbo.json +0 -6
- package/copy-of-vitnode-app/root/global.d.ts +2 -2
- package/copy-of-vitnode-app/root/next.config.ts +2 -2
- package/copy-of-vitnode-app/root/postcss.config.mjs +1 -1
- package/copy-of-vitnode-app/root/src/app/[locale]/(main)/[...rest]/page.tsx +1 -1
- package/copy-of-vitnode-app/root/src/app/[locale]/(main)/layout.tsx +3 -3
- package/copy-of-vitnode-app/root/src/app/[locale]/(main)/not-found.tsx +1 -1
- package/copy-of-vitnode-app/root/src/app/[locale]/(main)/page.tsx +11 -10
- package/copy-of-vitnode-app/root/src/app/[locale]/admin/(auth)/layout.tsx +2 -2
- package/copy-of-vitnode-app/root/src/app/[locale]/admin/page.tsx +1 -1
- package/copy-of-vitnode-app/root/src/app/[locale]/layout.tsx +9 -10
- package/copy-of-vitnode-app/root/src/app/global-error.tsx +8 -11
- package/copy-of-vitnode-app/root/src/app/global.css +3 -2
- package/copy-of-vitnode-app/root/src/app/layout.tsx +2 -2
- package/copy-of-vitnode-app/root/src/middleware.ts +5 -5
- package/copy-of-vitnode-app/root/src/vitnode.config.ts +8 -8
- package/copy-of-vitnode-app/root/tsconfig.json +1 -1
- package/dist/src/create/create-package-json.js +192 -201
- package/dist/src/create/create-vitnode.js +73 -73
- package/dist/src/helpers/get-available-package-managers.js +6 -6
- package/dist/src/helpers/get-package-json.js +2 -2
- package/dist/src/helpers/init-vitnode.js +7 -7
- package/dist/src/helpers/install-dependencies.js +35 -32
- package/dist/src/helpers/is-folder-empty.js +25 -26
- package/dist/src/helpers/is-online.js +16 -16
- package/dist/src/helpers/is-writeable.js +2 -2
- package/dist/src/helpers/validate-pkg.js +1 -1
- package/dist/src/index.js +28 -28
- package/dist/src/plugin/index.js +5 -5
- package/dist/src/prepare/prepare.js +5 -5
- package/dist/src/questions.js +29 -30
- package/dist/src/validation.js +15 -15
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -6
- package/copy-of-vitnode-app/eslint/.prettierrc.mjs +0 -11
- package/copy-of-vitnode-app/eslint/eslint.config.mjs +0 -17
package/README.md
CHANGED
|
@@ -40,7 +40,7 @@ bun create vitnode-app@latest
|
|
|
40
40
|
| Option | Description |
|
|
41
41
|
| ------------------- | --------------------------------------------------------------------------------- |
|
|
42
42
|
| `--package-manager` | Specify the package manager to use. Support `npm`, `pnpm`. |
|
|
43
|
-
| `--
|
|
43
|
+
| `--biome` | Initialize with Biome config. |
|
|
44
44
|
| `--skip-install` | Skip installing packages after initializing the project. |
|
|
45
45
|
| `--mode` | Specify the type of app to create. Support `singleApp`, `apiMonorepo`, `onlyApi`. |
|
|
46
46
|
| `--monorepo` | Create project with monorepo structure. |
|
|
@@ -1,6 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"cSpell.words": ["vitnode"],
|
|
3
|
+
"github.copilot.chat.commitMessageGeneration.instructions": [
|
|
4
|
+
{
|
|
5
|
+
"text": "Follow the Conventional Commits format strictly for commit messages. Use the structure below:\n\n```\n<type>[optional scope]: <gitmoji> <description>\n```\n\nGuidelines:\n\n1. **Type and Scope**: Choose an appropriate type (e.g., `feat`, `fix`, `refactor`, `docs`) and optional scope to describe the affected module or feature.\n\n2. **Gitmoji**: Include a relevant `gitmoji` that best represents the nature of the change.\n\n3. **Description**: Write a concise, informative description in the header; use backticks if referencing code or specific terms.\n\nCommit messages should be clear, informative, and professional, aiding readability and project tracking."
|
|
6
|
+
}
|
|
7
|
+
],
|
|
3
8
|
"search.exclude": {
|
|
4
9
|
"**/(plugins)/*": true
|
|
10
|
+
},
|
|
11
|
+
"[javascriptreact]": {
|
|
12
|
+
"editor.defaultFormatter": "biomejs.biome"
|
|
13
|
+
},
|
|
14
|
+
"[typescript]": {
|
|
15
|
+
"editor.defaultFormatter": "biomejs.biome"
|
|
16
|
+
},
|
|
17
|
+
"[css]": {
|
|
18
|
+
"editor.defaultFormatter": "biomejs.biome"
|
|
19
|
+
},
|
|
20
|
+
"[jsonc]": {
|
|
21
|
+
"editor.defaultFormatter": "biomejs.biome"
|
|
22
|
+
},
|
|
23
|
+
"[typescriptreact]": {
|
|
24
|
+
"editor.defaultFormatter": "biomejs.biome"
|
|
25
|
+
},
|
|
26
|
+
"[html]": {
|
|
27
|
+
"editor.defaultFormatter": "biomejs.biome"
|
|
28
|
+
},
|
|
29
|
+
"[json]": {
|
|
30
|
+
"editor.defaultFormatter": "biomejs.biome"
|
|
31
|
+
},
|
|
32
|
+
"[javascript]": {
|
|
33
|
+
"editor.defaultFormatter": "biomejs.biome"
|
|
5
34
|
}
|
|
6
35
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineVitNodeDrizzleConfig } from
|
|
1
|
+
import { defineVitNodeDrizzleConfig } from "@vitnode/core/drizzle.config";
|
|
2
2
|
|
|
3
|
-
import { POSTGRES_URL, vitNodeApiConfig } from
|
|
3
|
+
import { POSTGRES_URL, vitNodeApiConfig } from "./src/vitnode.api.config";
|
|
4
4
|
|
|
5
5
|
export default defineVitNodeDrizzleConfig({
|
|
6
6
|
vitNodeApiConfig,
|
|
7
|
-
out:
|
|
8
|
-
dialect:
|
|
7
|
+
out: "./migrations/",
|
|
8
|
+
dialect: "postgresql",
|
|
9
9
|
dbCredentials: {
|
|
10
10
|
url: POSTGRES_URL,
|
|
11
11
|
},
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
/** biome-ignore-all lint/suspicious/noConsole: <No need> */
|
|
2
|
+
import { serve } from "@hono/node-server";
|
|
3
|
+
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
4
|
+
import { VitNodeAPI } from "@vitnode/core/api/config";
|
|
4
5
|
|
|
5
|
-
import { vitNodeApiConfig } from
|
|
6
|
+
import { vitNodeApiConfig } from "./vitnode.api.config.js";
|
|
6
7
|
|
|
7
|
-
const app = new OpenAPIHono().basePath(
|
|
8
|
+
const app = new OpenAPIHono().basePath("/api");
|
|
8
9
|
|
|
9
10
|
VitNodeAPI({
|
|
10
11
|
app,
|
|
@@ -17,9 +18,8 @@ serve(
|
|
|
17
18
|
port: 8080,
|
|
18
19
|
},
|
|
19
20
|
info => {
|
|
20
|
-
const initMessage =
|
|
21
|
+
const initMessage = "\x1b[34m[VitNode]\x1b[0m";
|
|
21
22
|
|
|
22
|
-
// eslint-disable-next-line no-console
|
|
23
23
|
console.log(
|
|
24
24
|
`${initMessage} API server is running on http://localhost:${info.port}`,
|
|
25
25
|
);
|
|
@@ -1,24 +1,23 @@
|
|
|
1
|
-
import { buildApiConfig } from
|
|
2
|
-
import
|
|
3
|
-
import { drizzle } from
|
|
1
|
+
import { buildApiConfig } from "@vitnode/core/vitnode.config";
|
|
2
|
+
import { config } from "dotenv";
|
|
3
|
+
import { drizzle } from "drizzle-orm/postgres-js";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
config({
|
|
6
6
|
quiet: true,
|
|
7
7
|
});
|
|
8
8
|
|
|
9
9
|
export const POSTGRES_URL =
|
|
10
|
-
|
|
11
|
-
process.env.POSTGRES_URL || 'postgresql://root:root@localhost:5432/vitnode';
|
|
10
|
+
process.env.POSTGRES_URL || "postgresql://root:root@localhost:5432/vitnode";
|
|
12
11
|
|
|
13
12
|
export const vitNodeApiConfig = buildApiConfig({
|
|
14
13
|
plugins: [],
|
|
15
14
|
pathToMessages: async path => await import(`./locales/${path}`),
|
|
16
15
|
dbProvider: drizzle({
|
|
17
16
|
connection: POSTGRES_URL,
|
|
18
|
-
casing:
|
|
17
|
+
casing: "camelCase",
|
|
19
18
|
}),
|
|
20
19
|
metadata: {
|
|
21
|
-
title:
|
|
22
|
-
shortTitle:
|
|
20
|
+
title: "VitNode API",
|
|
21
|
+
shortTitle: "VitNode",
|
|
23
22
|
},
|
|
24
23
|
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { OpenAPIHono } from
|
|
2
|
-
import { VitNodeAPI } from
|
|
1
|
+
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
2
|
+
import { VitNodeAPI } from "@vitnode/core/api/config";
|
|
3
3
|
|
|
4
|
-
import { vitNodeApiConfig } from
|
|
4
|
+
import { vitNodeApiConfig } from "./vitnode.api.config.js";
|
|
5
5
|
|
|
6
|
-
const app = new OpenAPIHono().basePath(
|
|
6
|
+
const app = new OpenAPIHono().basePath("/api");
|
|
7
7
|
|
|
8
8
|
VitNodeAPI({
|
|
9
9
|
app,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineVitNodeDrizzleConfig } from
|
|
1
|
+
import { defineVitNodeDrizzleConfig } from "@vitnode/core/drizzle.config";
|
|
2
2
|
|
|
3
|
-
import { POSTGRES_URL, vitNodeApiConfig } from
|
|
3
|
+
import { POSTGRES_URL, vitNodeApiConfig } from "./src/vitnode.api.config";
|
|
4
4
|
|
|
5
5
|
export default defineVitNodeDrizzleConfig({
|
|
6
6
|
vitNodeApiConfig,
|
|
7
|
-
out:
|
|
8
|
-
dialect:
|
|
7
|
+
out: "./migrations/",
|
|
8
|
+
dialect: "postgresql",
|
|
9
9
|
dbCredentials: {
|
|
10
10
|
url: POSTGRES_URL,
|
|
11
11
|
},
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { OpenAPIHono } from
|
|
2
|
-
import { VitNodeAPI } from
|
|
3
|
-
import { handle } from
|
|
1
|
+
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
2
|
+
import { VitNodeAPI } from "@vitnode/core/api/config";
|
|
3
|
+
import { handle } from "hono/vercel";
|
|
4
4
|
|
|
5
|
-
import { vitNodeApiConfig } from
|
|
5
|
+
import { vitNodeApiConfig } from "@/vitnode.api.config";
|
|
6
6
|
|
|
7
|
-
const app = new OpenAPIHono().basePath(
|
|
7
|
+
const app = new OpenAPIHono().basePath("/api");
|
|
8
8
|
VitNodeAPI({
|
|
9
9
|
app,
|
|
10
10
|
vitNodeApiConfig,
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { buildApiConfig } from
|
|
2
|
-
import { drizzle } from
|
|
1
|
+
import { buildApiConfig } from "@vitnode/core/vitnode.config";
|
|
2
|
+
import { drizzle } from "drizzle-orm/postgres-js";
|
|
3
3
|
|
|
4
4
|
export const POSTGRES_URL =
|
|
5
|
-
|
|
6
|
-
process.env.POSTGRES_URL || 'postgresql://root:root@localhost:5432/vitnode';
|
|
5
|
+
process.env.POSTGRES_URL || "postgresql://root:root@localhost:5432/vitnode";
|
|
7
6
|
|
|
8
7
|
export const vitNodeApiConfig = buildApiConfig({
|
|
9
8
|
pathToMessages: async path => await import(`./locales/${path}`),
|
|
10
9
|
metadata: {
|
|
11
|
-
title:
|
|
12
|
-
shortTitle:
|
|
10
|
+
title: "VitNode",
|
|
11
|
+
shortTitle: "VitNode",
|
|
13
12
|
},
|
|
14
13
|
plugins: [],
|
|
15
14
|
dbProvider: drizzle({
|
|
16
15
|
connection: POSTGRES_URL,
|
|
17
|
-
casing:
|
|
16
|
+
casing: "camelCase",
|
|
18
17
|
}),
|
|
19
18
|
});
|
|
@@ -22,12 +22,6 @@
|
|
|
22
22
|
"outputs": [".next/**", "!.next/cache/**", "dist/**"],
|
|
23
23
|
"env": ["POSTGRES_URL", "NEXT_PUBLIC_API_URL", "NEXT_PUBLIC_WEB_URL"]
|
|
24
24
|
},
|
|
25
|
-
"lint": {
|
|
26
|
-
"dependsOn": ["^lint"]
|
|
27
|
-
},
|
|
28
|
-
"lint:fix": {
|
|
29
|
-
"dependsOn": ["^lint:fix"]
|
|
30
|
-
},
|
|
31
25
|
"dev": {
|
|
32
26
|
"cache": false,
|
|
33
27
|
"persistent": true,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="next-intl" />
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import core from "./src/locales/@vitnode/core/en.json" with { type: "json" };
|
|
4
4
|
|
|
5
|
-
declare module
|
|
5
|
+
declare module "next-intl" {
|
|
6
6
|
interface AppConfig {
|
|
7
7
|
Messages: typeof core;
|
|
8
8
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { vitNodeNextConfig } from "@vitnode/core/config/next.config";
|
|
2
|
+
import type { NextConfig } from "next";
|
|
3
3
|
|
|
4
4
|
const nextConfig: NextConfig = {
|
|
5
5
|
experimental: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { LogoVitNode } from
|
|
2
|
-
import { ThemeLayout } from
|
|
1
|
+
import { LogoVitNode } from "@vitnode/core/components/logo-vitnode";
|
|
2
|
+
import { ThemeLayout } from "@vitnode/core/views/layouts/theme/layout";
|
|
3
3
|
|
|
4
|
-
import { vitNodeConfig } from
|
|
4
|
+
import { vitNodeConfig } from "../../../vitnode.config";
|
|
5
5
|
|
|
6
6
|
export default function Layout({ children }: { children: React.ReactNode }) {
|
|
7
7
|
return (
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { LogoVitNode } from
|
|
2
|
-
import { buttonVariants } from
|
|
3
|
-
import { Link } from
|
|
4
|
-
import { cn } from
|
|
5
|
-
import { ArrowRight, Book, Terminal } from
|
|
1
|
+
import { LogoVitNode } from "@vitnode/core/components/logo-vitnode";
|
|
2
|
+
import { buttonVariants } from "@vitnode/core/components/ui/button";
|
|
3
|
+
import { Link } from "@vitnode/core/lib/navigation";
|
|
4
|
+
import { cn } from "@vitnode/core/lib/utils";
|
|
5
|
+
import { ArrowRight, Book, Terminal } from "lucide-react";
|
|
6
6
|
|
|
7
7
|
export default function Page() {
|
|
8
8
|
return (
|
|
@@ -25,7 +25,7 @@ export default function Page() {
|
|
|
25
25
|
<Link
|
|
26
26
|
className={cn(
|
|
27
27
|
buttonVariants({
|
|
28
|
-
size:
|
|
28
|
+
size: "lg",
|
|
29
29
|
}),
|
|
30
30
|
)}
|
|
31
31
|
href="/admin"
|
|
@@ -39,8 +39,8 @@ export default function Page() {
|
|
|
39
39
|
<Link
|
|
40
40
|
className={cn(
|
|
41
41
|
buttonVariants({
|
|
42
|
-
size:
|
|
43
|
-
variant:
|
|
42
|
+
size: "lg",
|
|
43
|
+
variant: "outline",
|
|
44
44
|
}),
|
|
45
45
|
)}
|
|
46
46
|
href="https://vitnode.com/docs"
|
|
@@ -54,8 +54,8 @@ export default function Page() {
|
|
|
54
54
|
<Link
|
|
55
55
|
className={cn(
|
|
56
56
|
buttonVariants({
|
|
57
|
-
size:
|
|
58
|
-
variant:
|
|
57
|
+
size: "lg",
|
|
58
|
+
variant: "ghost",
|
|
59
59
|
}),
|
|
60
60
|
)}
|
|
61
61
|
href="https://github.com/VitNode/vitnode"
|
|
@@ -68,6 +68,7 @@ export default function Page() {
|
|
|
68
68
|
viewBox="0 0 24 24"
|
|
69
69
|
xmlns="http://www.w3.org/2000/svg"
|
|
70
70
|
>
|
|
71
|
+
<title>GitHub</title>
|
|
71
72
|
<path
|
|
72
73
|
d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"
|
|
73
74
|
fill="currentColor"
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AdminLayout,
|
|
3
3
|
type AdminLayoutProps,
|
|
4
|
-
} from
|
|
4
|
+
} from "@vitnode/core/views/admin/layouts/admin-layout";
|
|
5
5
|
|
|
6
|
-
import { vitNodeConfig } from
|
|
6
|
+
import { vitNodeConfig } from "@/vitnode.config";
|
|
7
7
|
|
|
8
8
|
export default function Layout(props: AdminLayoutProps) {
|
|
9
9
|
return <AdminLayout vitNodeConfig={vitNodeConfig} {...props} />;
|
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
import type { RootLayoutProps } from
|
|
2
|
-
import type { Metadata } from 'next';
|
|
3
|
-
|
|
1
|
+
import type { RootLayoutProps } from "@vitnode/core/views/layouts/root-layout";
|
|
4
2
|
import {
|
|
5
3
|
generateMetadataRootLayout,
|
|
6
4
|
RootLayout,
|
|
7
|
-
} from
|
|
8
|
-
import {
|
|
5
|
+
} from "@vitnode/core/views/layouts/root-layout";
|
|
6
|
+
import type { Metadata } from "next";
|
|
7
|
+
import { Geist, Geist_Mono } from "next/font/google";
|
|
9
8
|
|
|
10
|
-
import { vitNodeConfig } from
|
|
9
|
+
import { vitNodeConfig } from "@/vitnode.config";
|
|
11
10
|
|
|
12
11
|
const geistSans = Geist({
|
|
13
|
-
variable:
|
|
14
|
-
subsets: [
|
|
12
|
+
variable: "--font-geist-sans",
|
|
13
|
+
subsets: ["latin"],
|
|
15
14
|
});
|
|
16
15
|
|
|
17
16
|
const geistMono = Geist_Mono({
|
|
18
|
-
variable:
|
|
19
|
-
subsets: [
|
|
17
|
+
variable: "--font-geist-mono",
|
|
18
|
+
subsets: ["latin"],
|
|
20
19
|
});
|
|
21
20
|
|
|
22
21
|
export const generateMetadata = (): Metadata =>
|
|
@@ -1,27 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
2
|
|
|
3
|
-
import { GlobalErrorView } from
|
|
4
|
-
import { Geist, Geist_Mono } from
|
|
3
|
+
import { GlobalErrorView } from "@vitnode/core/views/error/global-error-view";
|
|
4
|
+
import { Geist, Geist_Mono } from "next/font/google";
|
|
5
5
|
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
import { vitNodeConfig } from '@/vitnode.config';
|
|
6
|
+
import "./global.css";
|
|
9
7
|
|
|
10
8
|
const geistSans = Geist({
|
|
11
|
-
variable:
|
|
12
|
-
subsets: [
|
|
9
|
+
variable: "--font-geist-sans",
|
|
10
|
+
subsets: ["latin"],
|
|
13
11
|
});
|
|
14
12
|
|
|
15
13
|
const geistMono = Geist_Mono({
|
|
16
|
-
variable:
|
|
17
|
-
subsets: [
|
|
14
|
+
variable: "--font-geist-mono",
|
|
15
|
+
subsets: ["latin"],
|
|
18
16
|
});
|
|
19
17
|
|
|
20
18
|
export default function GlobalError() {
|
|
21
19
|
return (
|
|
22
20
|
<GlobalErrorView
|
|
23
21
|
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
|
|
24
|
-
config={vitNodeConfig}
|
|
25
22
|
/>
|
|
26
23
|
);
|
|
27
24
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
/** biome-ignore-all lint/suspicious/noUnknownAtRules: <tailwind> */
|
|
2
|
+
@import "tailwindcss";
|
|
2
3
|
|
|
3
|
-
@import
|
|
4
|
+
@import "tw-animate-css";
|
|
4
5
|
|
|
5
6
|
@source "../../node_modules/@vitnode/core/dist/src/components";
|
|
6
7
|
@source "../../node_modules/@vitnode/core/dist/src/views";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import createMiddleware from
|
|
1
|
+
import createMiddleware from "next-intl/middleware";
|
|
2
2
|
|
|
3
|
-
import { vitNodeConfig } from
|
|
3
|
+
import { vitNodeConfig } from "./vitnode.config";
|
|
4
4
|
|
|
5
5
|
export default createMiddleware({
|
|
6
6
|
locales: vitNodeConfig.i18n.locales.map(locale => locale.code),
|
|
@@ -11,14 +11,14 @@ export default createMiddleware({
|
|
|
11
11
|
export const config = {
|
|
12
12
|
matcher: [
|
|
13
13
|
// Enable a redirect to a matching locale at the root
|
|
14
|
-
|
|
14
|
+
"/",
|
|
15
15
|
|
|
16
16
|
// Set a cookie to remember the previous locale for
|
|
17
17
|
// all requests that have a locale prefix
|
|
18
|
-
|
|
18
|
+
"/(en)/:path*",
|
|
19
19
|
|
|
20
20
|
// Enable redirects that add missing locales
|
|
21
21
|
// (e.g. `/pathnames` -> `/en/pathnames`)
|
|
22
|
-
|
|
22
|
+
"/((?!_next|_vercel|api|.*\\..*).*)",
|
|
23
23
|
],
|
|
24
24
|
};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { buildConfig, handleRequestConfig } from
|
|
2
|
-
import { getRequestConfig } from
|
|
1
|
+
import { buildConfig, handleRequestConfig } from "@vitnode/core/vitnode.config";
|
|
2
|
+
import { getRequestConfig } from "next-intl/server";
|
|
3
3
|
|
|
4
4
|
export const vitNodeConfig = buildConfig({
|
|
5
5
|
metadata: {
|
|
6
|
-
title:
|
|
7
|
-
shortTitle:
|
|
6
|
+
title: "VitNode",
|
|
7
|
+
shortTitle: "VitNode",
|
|
8
8
|
},
|
|
9
9
|
plugins: [],
|
|
10
10
|
i18n: {
|
|
11
11
|
locales: [
|
|
12
12
|
{
|
|
13
|
-
code:
|
|
14
|
-
name:
|
|
13
|
+
code: "en",
|
|
14
|
+
name: "English",
|
|
15
15
|
},
|
|
16
16
|
],
|
|
17
|
-
defaultLocale:
|
|
17
|
+
defaultLocale: "en",
|
|
18
18
|
},
|
|
19
19
|
theme: {
|
|
20
|
-
defaultTheme:
|
|
20
|
+
defaultTheme: "light",
|
|
21
21
|
},
|
|
22
22
|
});
|
|
23
23
|
|