create-vitnode-app 1.2.0-canary.7 → 1.2.0-canary.71

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 (79) hide show
  1. package/LICENSE.md +1 -1
  2. package/README.md +25 -5
  3. package/copy-of-vitnode-app/.vscode/settings.json +11 -0
  4. package/copy-of-vitnode-app/README.md +40 -0
  5. package/copy-of-vitnode-app/api/.gitignore_template +29 -0
  6. package/copy-of-vitnode-app/api/drizzle.config.ts +12 -0
  7. package/copy-of-vitnode-app/api/src/index.ts +27 -0
  8. package/copy-of-vitnode-app/api/src/vitnode.api.config.ts +23 -0
  9. package/copy-of-vitnode-app/api/tsconfig.json +16 -0
  10. package/copy-of-vitnode-app/api-bun/src/index.ts +16 -0
  11. package/copy-of-vitnode-app/api-single-app/.env.example +8 -0
  12. package/copy-of-vitnode-app/api-single-app/.gitignore_template +37 -0
  13. package/copy-of-vitnode-app/api-single-app/drizzle.config.ts +12 -0
  14. package/copy-of-vitnode-app/api-single-app/src/app/api/[...route]/route.ts +16 -0
  15. package/copy-of-vitnode-app/api-single-app/src/vitnode.api.config.ts +18 -0
  16. package/copy-of-vitnode-app/docker/docker-compose.yml +20 -0
  17. package/copy-of-vitnode-app/eslint/.prettierrc.mjs +1 -1
  18. package/copy-of-vitnode-app/eslint/eslint.config.mjs +18 -2
  19. package/copy-of-vitnode-app/eslint-react/eslint.config.mjs +19 -0
  20. package/copy-of-vitnode-app/monorepo/.gitignore_template +41 -0
  21. package/copy-of-vitnode-app/monorepo/apps/api/.env.example +8 -0
  22. package/copy-of-vitnode-app/monorepo/apps/web/.env.example +1 -0
  23. package/copy-of-vitnode-app/monorepo/turbo.json +40 -0
  24. package/copy-of-vitnode-app/root/.env.example +2 -4
  25. package/copy-of-vitnode-app/root/.gitignore_template +37 -0
  26. package/copy-of-vitnode-app/root/global.d.ts +9 -0
  27. package/copy-of-vitnode-app/root/next.config.ts +3 -6
  28. package/copy-of-vitnode-app/root/postcss.config.mjs +1 -1
  29. package/copy-of-vitnode-app/root/src/app/[locale]/(main)/[...rest]/page.tsx +1 -1
  30. package/copy-of-vitnode-app/root/src/app/[locale]/(main)/layout.tsx +8 -3
  31. package/copy-of-vitnode-app/root/src/app/[locale]/(main)/not-found.tsx +1 -1
  32. package/copy-of-vitnode-app/root/src/app/[locale]/(main)/page.tsx +20 -27
  33. package/copy-of-vitnode-app/root/src/app/[locale]/admin/(auth)/layout.tsx +2 -2
  34. package/copy-of-vitnode-app/root/src/app/[locale]/admin/page.tsx +1 -1
  35. package/copy-of-vitnode-app/root/src/app/[locale]/layout.tsx +20 -17
  36. package/copy-of-vitnode-app/root/src/app/global-error.tsx +8 -11
  37. package/copy-of-vitnode-app/root/src/app/global.css +63 -64
  38. package/copy-of-vitnode-app/root/src/app/layout.tsx +1 -1
  39. package/copy-of-vitnode-app/root/src/proxy.ts +24 -0
  40. package/copy-of-vitnode-app/root/src/vitnode.config.ts +32 -0
  41. package/copy-of-vitnode-app/root/tsconfig.json +1 -1
  42. package/copy-of-vitnode-plugin/root/.swcrc +25 -0
  43. package/copy-of-vitnode-plugin/root/global.d.ts +10 -0
  44. package/copy-of-vitnode-plugin/root/npmignore.template +19 -0
  45. package/copy-of-vitnode-plugin/root/tsconfig.json +25 -0
  46. package/dist/src/create/create-package-json.js +251 -56
  47. package/dist/src/create/create-vitnode.js +197 -28
  48. package/dist/src/create/package-versions.js +40 -0
  49. package/dist/src/helpers/get-available-package-managers.js +6 -6
  50. package/dist/src/helpers/get-package-json.js +2 -2
  51. package/dist/src/helpers/get-package-manager-from-root.js +15 -0
  52. package/dist/src/helpers/get-vitnode-package-version.js +9 -0
  53. package/dist/src/helpers/init-vitnode.js +21 -0
  54. package/dist/src/helpers/install-dependencies.js +55 -14
  55. package/dist/src/helpers/is-folder-empty.js +25 -26
  56. package/dist/src/helpers/is-online.js +16 -16
  57. package/dist/src/helpers/is-writeable.js +3 -3
  58. package/dist/src/helpers/validate-pkg.js +1 -1
  59. package/dist/src/helpers/with-If.js +1 -0
  60. package/dist/src/index.js +29 -26
  61. package/dist/src/plugin/create/add-plugin-to-workspace.js +74 -0
  62. package/dist/src/plugin/create/create-package-json.js +62 -0
  63. package/dist/src/plugin/create/create-plugin-vitnode.js +72 -0
  64. package/dist/src/plugin/index.js +17 -6
  65. package/dist/src/plugin/questions.js +14 -0
  66. package/dist/src/plugin/validation.js +76 -0
  67. package/dist/src/prepare/prepare.js +11 -8
  68. package/dist/src/questions.js +52 -15
  69. package/dist/src/validation.js +15 -15
  70. package/dist/tsconfig.tsbuildinfo +1 -1
  71. package/package.json +16 -9
  72. package/copy-of-vitnode-app/root/.prettierrc.mjs +0 -11
  73. package/copy-of-vitnode-app/root/README.md +0 -1
  74. package/copy-of-vitnode-app/root/drizzle.config.ts +0 -12
  75. package/copy-of-vitnode-app/root/gitignore_template +0 -43
  76. package/copy-of-vitnode-app/root/src/app/[locale]/admin/not-found.tsx +0 -5
  77. package/copy-of-vitnode-app/root/src/app/api/[...route]/route.ts +0 -18
  78. package/copy-of-vitnode-app/root/src/app/not-found.tsx +0 -13
  79. package/copy-of-vitnode-app/root/src/vitnode.api.config.ts +0 -5
@@ -1,18 +1,10 @@
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
- import { getTranslations } from 'next-intl/server';
7
-
8
- export default async function Home({
9
- params,
10
- }: {
11
- params: Promise<{ locale: string }>;
12
- }) {
13
- const { locale } = await params;
14
- const t = await getTranslations({ locale, namespace: 'welcome.home' });
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";
15
6
 
7
+ export default function Page() {
16
8
  return (
17
9
  <main className="container mx-auto flex min-h-[calc(100vh-4rem)] flex-col items-center justify-center gap-16 px-4 py-16">
18
10
  {/* Hero Section */}
@@ -21,10 +13,10 @@ export default async function Home({
21
13
 
22
14
  <div className="space-y-4">
23
15
  <h1 className="from-foreground to-foreground/70 bg-gradient-to-br bg-clip-text text-4xl font-bold tracking-tight text-balance text-transparent md:text-5xl lg:text-6xl">
24
- {t('title')}
16
+ Start Your Journey!
25
17
  </h1>
26
18
  <p className="text-muted-foreground mx-auto max-w-2xl text-lg text-pretty">
27
- {t('desc')}
19
+ Dive in. Create or install your first plugin!
28
20
  </p>
29
21
  </div>
30
22
 
@@ -33,37 +25,37 @@ export default async function Home({
33
25
  <Link
34
26
  className={cn(
35
27
  buttonVariants({
36
- size: 'lg',
28
+ size: "lg",
37
29
  }),
38
30
  )}
39
31
  href="/admin"
40
32
  target="_blank"
41
33
  >
42
- <Terminal className="mr-2 h-4 w-4" />
43
- {t('go_to_admin_cp')}
44
- <ArrowRight className="ml-2 h-4 w-4" />
34
+ <Terminal className="mr-2 size-4" />
35
+ Go to AdminCP
36
+ <ArrowRight className="ml-2 size-4" />
45
37
  </Link>
46
38
 
47
39
  <Link
48
40
  className={cn(
49
41
  buttonVariants({
50
- size: 'lg',
51
- variant: 'outline',
42
+ size: "lg",
43
+ variant: "outline",
52
44
  }),
53
45
  )}
54
46
  href="https://vitnode.com/docs"
55
47
  rel="noopener noreferrer"
56
48
  target="_blank"
57
49
  >
58
- <Book className="mr-2 h-4 w-4" />
59
- {t('read_our_docs')}
50
+ <Book className="mr-2 size-4" />
51
+ Read our Docs
60
52
  </Link>
61
53
 
62
54
  <Link
63
55
  className={cn(
64
56
  buttonVariants({
65
- size: 'lg',
66
- variant: 'ghost',
57
+ size: "lg",
58
+ variant: "ghost",
67
59
  }),
68
60
  )}
69
61
  href="https://github.com/VitNode/vitnode"
@@ -71,11 +63,12 @@ export default async function Home({
71
63
  target="_blank"
72
64
  >
73
65
  <svg
74
- className="mr-2 h-4 w-4"
66
+ className="mr-2 size-4"
75
67
  role="img"
76
68
  viewBox="0 0 24 24"
77
69
  xmlns="http://www.w3.org/2000/svg"
78
70
  >
71
+ <title>GitHub</title>
79
72
  <path
80
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"
81
74
  fill="currentColor"
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  AdminLayout,
3
3
  type AdminLayoutProps,
4
- } from '@vitnode/core/views/admin/layouts/admin-layout';
4
+ } from "@vitnode/core/views/admin/layouts/admin-layout";
5
5
 
6
- import { vitNodeConfig } from '@/vitnode.config';
6
+ import { vitNodeConfig } from "@/vitnode.config";
7
7
 
8
8
  export default function Layout(props: AdminLayoutProps) {
9
9
  return <AdminLayout vitNodeConfig={vitNodeConfig} {...props} />;
@@ -1,4 +1,4 @@
1
- import { SignInAdminView } from '@vitnode/core/views/admin/sign-in/sign-in-admin-view';
1
+ import { SignInAdminView } from "@vitnode/core/views/admin/sign-in/sign-in-admin-view";
2
2
 
3
3
  export default function Page() {
4
4
  return <SignInAdminView />;
@@ -1,36 +1,39 @@
1
- import type { RootLayoutProps } from '@vitnode/core/views/layouts/root-layout';
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 '@vitnode/core/views/layouts/root-layout';
8
- import { Geist, Geist_Mono } from 'next/font/google';
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 '@/vitnode.config';
9
+ import { vitNodeConfig } from "@/vitnode.config";
11
10
 
12
11
  const geistSans = Geist({
13
- variable: '--font-geist-sans',
14
- subsets: ['latin'],
12
+ variable: "--font-geist-sans",
13
+ subsets: ["latin"],
15
14
  });
16
15
 
17
16
  const geistMono = Geist_Mono({
18
- variable: '--font-geist-mono',
19
- subsets: ['latin'],
17
+ variable: "--font-geist-mono",
18
+ subsets: ["latin"],
20
19
  });
21
20
 
22
21
  export const generateMetadata = (): Metadata =>
23
22
  generateMetadataRootLayout(vitNodeConfig);
24
23
 
25
24
  export const generateStaticParams = () =>
26
- vitNodeConfig.i18n.locales.map(locale => ({ locale }));
25
+ vitNodeConfig.i18n.locales.map(locale => ({ locale: locale.code }));
26
+
27
+ export default async function LocaleLayout(props: RootLayoutProps) {
28
+ const { locale } = await props.params;
27
29
 
28
- export default function LocaleLayout(props: RootLayoutProps) {
29
30
  return (
30
- <RootLayout
31
- className={`${geistSans.variable} ${geistMono.variable} antialiased`}
32
- config={vitNodeConfig}
33
- {...props}
34
- />
31
+ <html lang={locale} suppressHydrationWarning>
32
+ <body
33
+ className={`${geistSans.variable} ${geistMono.variable} antialiased`}
34
+ >
35
+ <RootLayout config={vitNodeConfig} {...props} />
36
+ </body>
37
+ </html>
35
38
  );
36
39
  }
@@ -1,27 +1,24 @@
1
- 'use client';
1
+ "use client";
2
2
 
3
- import { GlobalErrorView } from '@vitnode/core/views/error/global-error-view';
4
- import { Geist, Geist_Mono } from 'next/font/google';
3
+ import { GlobalErrorView } from "@vitnode/core/views/error/global-error-view";
4
+ import { Geist, Geist_Mono } from "next/font/google";
5
5
 
6
- import './global.css';
7
-
8
- import { vitNodeConfig } from '@/vitnode.config';
6
+ import "./global.css";
9
7
 
10
8
  const geistSans = Geist({
11
- variable: '--font-geist-sans',
12
- subsets: ['latin'],
9
+ variable: "--font-geist-sans",
10
+ subsets: ["latin"],
13
11
  });
14
12
 
15
13
  const geistMono = Geist_Mono({
16
- variable: '--font-geist-mono',
17
- subsets: ['latin'],
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,78 +1,77 @@
1
- @import 'tailwindcss' source('../../src');
2
-
3
- @import 'tw-animate-css';
1
+ @import "tailwindcss";
2
+ @import "@vitnode/core/styles/tiptap.css";
3
+ @import "tw-animate-css";
4
4
 
5
5
  @source "../../node_modules/@vitnode/core/dist/src/components";
6
6
  @source "../../node_modules/@vitnode/core/dist/src/views";
7
7
 
8
- @custom-variant dark (&:is(.dark *));
9
-
10
8
  :root:not(.dark) {
11
- --background: oklch(0.985 0 0);
12
- --foreground: oklch(0.145 0 0);
9
+ --background: oklch(0.96 0.01 250);
10
+ --foreground: oklch(0.18 0.01 250);
13
11
  --card: oklch(1 0 0);
14
- --card-foreground: oklch(0.145 0 0);
12
+ --card-foreground: oklch(0.22 0.01 250);
15
13
  --popover: oklch(1 0 0);
16
- --popover-foreground: oklch(0.145 0 0);
14
+ --popover-foreground: oklch(0.22 0.01 250);
17
15
  --primary: oklch(0.51 0.16 262.61);
18
16
  --primary-foreground: oklch(0.985 0 0);
19
- --secondary: oklch(0.96 0 0);
20
- --secondary-foreground: oklch(0.205 0 0);
21
- --muted: oklch(0.92 0 0);
22
- --muted-foreground: oklch(0.556 0 0);
23
- --accent: oklch(0.95 0 0);
24
- --accent-foreground: oklch(0.205 0 0);
25
- --destructive: oklch(0.577 0.245 27.325);
26
- --destructive-foreground: oklch(0.577 0.245 27.325);
27
- --border: oklch(0.922 0 0);
28
- --input: oklch(0.922 0 0);
29
- --ring: oklch(0.7 0.16 262.61);
30
- --chart-1: oklch(0.646 0.222 41.116);
31
- --chart-2: oklch(0.6 0.118 184.704);
32
- --chart-3: oklch(0.398 0.07 227.392);
33
- --chart-4: oklch(0.828 0.189 84.429);
34
- --chart-5: oklch(0.769 0.188 70.08);
35
- --sidebar: oklch(0.955 0 0);
36
- --sidebar-foreground: oklch(0.145 0 0);
37
- --sidebar-primary: oklch(0.205 0 0);
38
- --sidebar-primary-foreground: oklch(0.985 0 0);
39
- --sidebar-accent: oklch(0.92 0 0);
40
- --sidebar-accent-foreground: oklch(0.205 0 0);
41
- --sidebar-border: oklch(0.902 0 0);
42
- --sidebar-ring: oklch(0.708 0 0);
17
+ --secondary: oklch(0.94 0.02 254.94);
18
+ --secondary-foreground: oklch(0.25 0.01 250);
19
+ --muted: oklch(0.95 0.01 250);
20
+ --muted-foreground: oklch(0.53 0.01 250);
21
+ --accent: oklch(0.92 0.01 250);
22
+ --accent-foreground: oklch(0.25 0.01 250);
23
+ --destructive: oklch(0.6 0.2 24.45);
24
+ --warn: oklch(0.54 0.12 82.58);
25
+ --border: oklch(0.9 0.01 250);
26
+ --input: oklch(0.9 0.01 250);
27
+ --ring: oklch(0.7 0.13 250);
28
+ --chart-1: oklch(0.65 0.13 250);
29
+ --chart-2: oklch(0.6 0.11 260);
30
+ --chart-3: oklch(0.45 0.09 250);
31
+ --chart-4: oklch(0.8 0.13 250);
32
+ --chart-5: oklch(0.75 0.13 250);
33
+ --sidebar: var(--card);
34
+ --sidebar-foreground: oklch(0.22 0.01 250);
35
+ --sidebar-primary: var(--primary);
36
+ --sidebar-primary-foreground: var(--primary-foreground);
37
+ --sidebar-accent: oklch(0.97 0.01 250);
38
+ --sidebar-accent-foreground: oklch(0.25 0.01 250);
39
+ --sidebar-border: oklch(0.91 0.01 250);
40
+ --sidebar-ring: oklch(0.7 0.13 250);
43
41
  }
44
42
 
45
43
  .dark {
46
- --background: oklch(0.12 0 0);
47
- --foreground: oklch(0.98 0.005 240);
48
- --card: oklch(0.18 0.005 240);
49
- --card-foreground: oklch(0.98 0.005 240);
50
- --popover: oklch(0.18 0.005 240);
51
- --popover-foreground: oklch(0.98 0.005 240);
52
- --primary: oklch(0.51 0.16 262.61);
53
- --primary-foreground: oklch(0.99 0.005 240);
54
- --secondary: oklch(0.24 0.01 240);
55
- --secondary-foreground: oklch(0.98 0.005 240);
56
- --muted: oklch(0.22 0.01 240);
57
- --muted-foreground: oklch(0.75 0.005 240);
58
- --accent: oklch(0.28 0.015 240);
59
- --destructive: oklch(0.704 0.191 22.216);
60
- --border: oklch(0.269 0.005 240);
61
- --input: oklch(0.269 0.005 240);
62
- --ring: oklch(0.51 0.16 262.61);
63
- --chart-1: oklch(0.488 0.243 264.376);
64
- --chart-2: oklch(0.696 0.17 162.48);
65
- --chart-3: oklch(0.769 0.188 70.08);
66
- --chart-4: oklch(0.627 0.265 303.9);
67
- --chart-5: oklch(0.645 0.246 16.439);
68
- --sidebar: oklch(0.18 0.005 240);
69
- --sidebar-foreground: oklch(0.98 0.005 240);
70
- --sidebar-primary: oklch(0.51 0.16 262.61);
71
- --sidebar-primary-foreground: oklch(0.99 0.005 240);
72
- --sidebar-accent: oklch(0.28 0.015 240);
73
- --sidebar-accent-foreground: oklch(0.98 0.005 240);
74
- --sidebar-border: oklch(0.269 0.005 240);
75
- --sidebar-ring: oklch(0.51 0.16 262.61);
44
+ --background: oklch(0.16 0.01 250);
45
+ --foreground: oklch(0.96 0.01 250);
46
+ --card: oklch(0.2 0.01 250);
47
+ --card-foreground: oklch(0.96 0.01 250);
48
+ --popover: oklch(0.22 0.01 250);
49
+ --popover-foreground: oklch(0.96 0.01 250);
50
+ --primary: oklch(0.6 0.18 262.65);
51
+ --primary-foreground: oklch(0.98 0 0);
52
+ --secondary: oklch(0.2 0.01 250);
53
+ --secondary-foreground: oklch(0.96 0.01 250);
54
+ --muted: oklch(0.24 0.01 250);
55
+ --muted-foreground: oklch(0.7 0.01 250);
56
+ --accent: oklch(0.28 0.01 250);
57
+ --destructive: oklch(0.62 0.2 25.35);
58
+ --warn: oklch(0.76 0.18 81.84);
59
+ --border: oklch(0.3 0.01 250);
60
+ --input: oklch(0.3 0.01 250);
61
+ --ring: oklch(0.54 0.13 250);
62
+ --chart-1: oklch(0.45 0.09 250);
63
+ --chart-2: oklch(0.6 0.11 260);
64
+ --chart-3: oklch(0.75 0.13 250);
65
+ --chart-4: oklch(0.8 0.13 250);
66
+ --chart-5: oklch(0.65 0.13 250);
67
+ --sidebar: var(--card);
68
+ --sidebar-foreground: oklch(0.96 0.01 250);
69
+ --sidebar-primary: var(--primary);
70
+ --sidebar-primary-foreground: var(--primary-foreground);
71
+ --sidebar-accent: oklch(0.23 0.01 250);
72
+ --sidebar-accent-foreground: oklch(0.96 0.01 250);
73
+ --sidebar-border: oklch(0.26 0.01 250);
74
+ --sidebar-ring: oklch(0.54 0.13 250);
76
75
  }
77
76
 
78
77
  :root {
@@ -95,7 +94,7 @@
95
94
  --color-accent: var(--accent);
96
95
  --color-accent-foreground: var(--accent-foreground);
97
96
  --color-destructive: var(--destructive);
98
- --color-destructive-foreground: var(--destructive-foreground);
97
+ --color-warn: var(--warn);
99
98
  --color-border: var(--border);
100
99
  --color-input: var(--input);
101
100
  --color-ring: var(--ring);
@@ -1,4 +1,4 @@
1
- import './global.css';
1
+ import "./global.css";
2
2
 
3
3
  export default async function RootLayout({
4
4
  children,
@@ -0,0 +1,24 @@
1
+ import createMiddleware from "next-intl/middleware";
2
+
3
+ import { vitNodeConfig } from "./vitnode.config";
4
+
5
+ export default createMiddleware({
6
+ locales: vitNodeConfig.i18n.locales.map(locale => locale.code),
7
+ defaultLocale: vitNodeConfig.i18n.defaultLocale,
8
+ localePrefix: vitNodeConfig.i18n.localePrefix,
9
+ });
10
+
11
+ export const config = {
12
+ matcher: [
13
+ // Enable a redirect to a matching locale at the root
14
+ "/",
15
+
16
+ // Set a cookie to remember the previous locale for
17
+ // all requests that have a locale prefix
18
+ "/(en)/:path*",
19
+
20
+ // Enable redirects that add missing locales
21
+ // (e.g. `/pathnames` -> `/en/pathnames`)
22
+ "/((?!_next|_vercel|api|.*\\..*).*)",
23
+ ],
24
+ };
@@ -0,0 +1,32 @@
1
+ import { buildConfig, handleRequestConfig } from "@vitnode/core/vitnode.config";
2
+ import { getRequestConfig } from "next-intl/server";
3
+
4
+ export const vitNodeConfig = buildConfig({
5
+ metadata: {
6
+ title: "VitNode",
7
+ shortTitle: "VitNode",
8
+ },
9
+ plugins: [],
10
+ i18n: {
11
+ locales: [
12
+ {
13
+ code: "en",
14
+ name: "English",
15
+ },
16
+ ],
17
+ defaultLocale: "en",
18
+ },
19
+ theme: {
20
+ defaultTheme: "light",
21
+ },
22
+ });
23
+
24
+ // This is the request config for the app. It will be used in the app router.
25
+ export default getRequestConfig(
26
+ async ({ requestLocale }) =>
27
+ await handleRequestConfig({
28
+ requestLocale,
29
+ vitNodeConfig,
30
+ pathToMessages: async path => await import(`./locales/${path}`),
31
+ }),
32
+ );
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/tsconfig",
3
- "extends": "eslint-config-typescript-vitnode/tsconfig",
3
+ "extends": "@vitnode/config/tsconfig",
4
4
  "compilerOptions": {
5
5
  "target": "ESNext",
6
6
  "module": "esnext",
@@ -0,0 +1,25 @@
1
+ {
2
+ "$schema": "https://swc.rs/schema.json",
3
+ "minify": true,
4
+ "jsc": {
5
+ "baseUrl": "./",
6
+ "target": "esnext",
7
+ "paths": {
8
+ "@/*": ["./src/*"]
9
+ },
10
+ "parser": {
11
+ "syntax": "typescript",
12
+ "tsx": true
13
+ },
14
+ "transform": {
15
+ "react": {
16
+ "runtime": "automatic"
17
+ }
18
+ }
19
+ },
20
+ "module": {
21
+ "type": "nodenext",
22
+ "strict": true,
23
+ "resolveFully": true
24
+ }
25
+ }
@@ -0,0 +1,10 @@
1
+ /// <reference types="next-intl" />
2
+
3
+ import core from "@vitnode/core/locales/en.json" with { type: "json" };
4
+ import plugin from "./src/locales/en.json" with { type: "json" };
5
+
6
+ declare module "next-intl" {
7
+ interface AppConfig {
8
+ Messages: typeof plugin & typeof core;
9
+ }
10
+ }
@@ -0,0 +1,19 @@
1
+ /src/*
2
+ !/src/app
3
+ !/src/app/**
4
+ !/src/app_admin
5
+ !/src/app_admin/**
6
+ !/src/locales
7
+ !/src/locales/**
8
+
9
+ /node_modules
10
+ /.turbo
11
+ /tsconfig.json
12
+ /.swcrc
13
+ /components.json
14
+ /global.d.ts
15
+ /tsup.config.ts
16
+ /vitest.config.ts
17
+ /tsconfig.json
18
+ /scripts
19
+ /config
@@ -0,0 +1,25 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "extends": "@vitnode/config/tsconfig",
4
+ "compilerOptions": {
5
+ "target": "ESNext",
6
+ "module": "esnext",
7
+ "moduleResolution": "bundler",
8
+ "rootDir": "./",
9
+ "outDir": "./dist",
10
+ "jsx": "react-jsx",
11
+ "emitDeclarationOnly": true,
12
+ "declaration": true,
13
+ "declarationMap": true,
14
+ "plugins": [
15
+ {
16
+ "name": "next"
17
+ }
18
+ ],
19
+ "paths": {
20
+ "@/*": ["./src/*"]
21
+ }
22
+ },
23
+ "exclude": ["node_modules"],
24
+ "include": ["src", "global.d.ts"]
25
+ }