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
4 changes: 2 additions & 2 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The repository is a monorepo for the VitNode framework, which includes a backend

- **Monorepo Structure:**
- `apps/` contains main apps (`api` for backend, `docs` for docs site)
- `packages/` holds shared code, core framework, Biome configs, and CLI tools
- `packages/` holds shared code, core framework, ESLint and Prettier configs, and CLI tools
- `plugins/` for extendable features
- **Frontend:**
- Next.js 15, App Router, Server Components
Expand All @@ -35,7 +35,7 @@ The repository is a monorepo for the VitNode framework, which includes a backend
- `pnpm dev` (dev server), `pnpm build`, `pnpm lint`, `pnpm db:migrate`, `pnpm docker:dev`
- **CLI:**
- Create apps/plugins via `pnpm create vitnode-app@canary` (see `packages/create-vitnode-app`)
- CLI prompts for package manager, app mode, Biome, Docker, install (see `questions.ts`)
- CLI prompts for package manager, app mode, ESLint, Prettier, Docker, install (see `questions.ts`)
- **Linting/Formatting:**
- Use configs from `packages/config/`
- File names: snake_case, ESModule only
Expand Down
11 changes: 11 additions & 0 deletions .prettierrc.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import vitnodePrettier from "@vitnode/config/prettierrc";

/**
* @see https://prettier.io/docs/en/configuration.html
* @type {import("prettier").Config}
*/
const config = {
...vitnodePrettier,
};

export default config;
24 changes: 0 additions & 24 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,5 @@
],
"search.exclude": {
"**/(plugins)/*": true
},
"[javascriptreact]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[css]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[jsonc]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[typescriptreact]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[html]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[json]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[javascript]": {
"editor.defaultFormatter": "biomejs.biome"
}
}
20 changes: 20 additions & 0 deletions apps/api/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import eslintVitNode from "@vitnode/config/eslint";
import { fileURLToPath } from "node:url";
import { dirname } from "node:path";

const __dirname = dirname(fileURLToPath(import.meta.url));

export default [
...eslintVitNode,
{
ignores: ["drizzle.config.ts"],
},
{
languageOptions: {
parserOptions: {
project: "./tsconfig.json",
tsconfigRootDir: __dirname,
},
},
},
];
5 changes: 4 additions & 1 deletion apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
"dev:email": "email dev --dir src/emails",
"build": "tsc && tsc-alias -p tsconfig.json",
"start": "node dist/index.js",
"drizzle-kit": "drizzle-kit"
"drizzle-kit": "drizzle-kit",
"lint": "eslint .",
"lint:fix": "eslint . --fix"
},
"dependencies": {
"@hono/zod-openapi": "^1.1.0",
Expand All @@ -32,6 +34,7 @@
"@types/react-dom": "^19.1.9",
"@vitnode/config": "workspace:*",
"dotenv": "^17.2.2",
"eslint": "^9.36.0",
"react-email": "^4.2.8",
"tsc-alias": "^1.8.16",
"tsx": "^4.20.5",
Expand Down
2 changes: 1 addition & 1 deletion apps/api/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ serve(
info => {
const initMessage = "\x1b[34m[VitNode]\x1b[0m";

// biome-ignore lint/suspicious/noConsole: <start>
// eslint-disable-next-line no-console
console.log(
`${initMessage} API server is running on http://localhost:${info.port}`,
);
Expand Down
2 changes: 1 addition & 1 deletion apps/api/src/vitnode.api.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ config({
});

export const POSTGRES_URL =
process.env.POSTGRES_URL || "postgresql://root:root@localhost:5432/vitnode";
process.env.POSTGRES_URL ?? "postgresql://root:root@localhost:5432/vitnode";

export const vitNodeApiConfig = buildApiConfig({
plugins: [],
Expand Down
14 changes: 8 additions & 6 deletions apps/docs/content/docs/dev/contribution.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -84,21 +84,21 @@ vitnode/
│ └── docs/ # Documentation site
├── packages/
│ ├── vitnode/ # Core framework code
│ ├── config/ # Shared Biome,TypeScript configs
│ ├── config/ # Shared ESLInt, TypeScript configs
│ └── create-vitnode-app/ # CLI tool for creating new projects
└── plugins/ # Official open-source plugins
```

<Callout type="info" title="Monorepo Magic!">
VitNode uses Turborepo to keep everything organized. Apps, packages, and plugins all live together
in harmony!
VitNode uses Turborepo to keep everything organized. Apps, packages, and
plugins all live together in harmony!
</Callout>

## Coding Standards

- We use TypeScript for type safety ([TypeScript Docs](https://www.typescriptlang.org/))
- Follow ESM (ECMAScript Modules) conventions ([ESM Guide](https://nodejs.org/api/esm.html))
- Respect the Biome configuration in each workspace ([Biome](https://biomejs.dev/))
- Respect the ESLint & Prettier configuration in each workspace ([ESLint](https://eslint.org/) & [Prettier](https://prettier.io/))
- Use React Server Components where appropriate
- Write meaningful commit messages ([Conventional Commits](https://www.conventionalcommits.org/))

Expand Down Expand Up @@ -137,7 +137,7 @@ pnpm db:migrate # Run migrations
- TypeScript for type safety
- ESM module conventions
- React Server Components where appropriate
- Respect Biome rules in each workspace
- Respect ESLint, Prettier rules in each workspace

<Callout type="warn">
Don't forget to test your changes locally! 🧪
Expand Down Expand Up @@ -190,4 +190,6 @@ pnpm db:migrate # Run migrations

Thank you for contributing to VitNode! 🚀

<Callout title="You rock!">Every contribution makes VitNode better. We appreciate you! 💜</Callout>
<Callout title="You rock!">
Every contribution makes VitNode better. We appreciate you! 💜
</Callout>
20 changes: 20 additions & 0 deletions apps/docs/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import eslintVitNode from "@vitnode/config/eslint";
import { fileURLToPath } from "node:url";
import { dirname } from "node:path";

const __dirname = dirname(fileURLToPath(import.meta.url));

export default [
...eslintVitNode,
{
ignores: [".source"],
},
{
languageOptions: {
parserOptions: {
project: "./tsconfig.json",
tsconfigRootDir: __dirname,
},
},
},
];
5 changes: 4 additions & 1 deletion apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
"test:e2e:debug": "playwright test --debug",
"test:e2e:report": "playwright show-report",
"postinstall": "fumadocs-mdx",
"drizzle-kit": "drizzle-kit"
"drizzle-kit": "drizzle-kit",
"lint": "eslint .",
"lint:fix": "eslint . --fix"
},
"dependencies": {
"@hono/zod-openapi": "^1.1.0",
Expand Down Expand Up @@ -53,6 +55,7 @@
"@types/react-dom": "^19.1.9",
"@vitnode/config": "workspace:*",
"class-variance-authority": "^0.7.1",
"eslint": "^9.36.0",
"postcss": "^8.5.6",
"react-email": "^4.2.8",
"shiki": "^3.12.2",
Expand Down
3 changes: 2 additions & 1 deletion apps/docs/src/app/[locale]/(docs)/docs/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { DocsLayout } from "fumadocs-ui/layouts/notebook";
import type { ReactNode } from "react";

import { DocsLayout } from "fumadocs-ui/layouts/notebook";

import { baseOptions } from "@/app/[locale]/(main)/layout.config";
import { source } from "@/lib/source";

Expand Down
3 changes: 2 additions & 1 deletion apps/docs/src/app/[locale]/(main)/(home)/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import type { Metadata } from "next";

import { buttonVariants } from "@vitnode/core/components/ui/button";
import { cn } from "@vitnode/core/lib/utils";
import Link from "fumadocs-core/link";
import { ChevronRight } from "lucide-react";
import type { Metadata } from "next";

import { AnimatedBeamHome } from "../../../../components/animated-beam/animated-beam-home";
import { AdminSection } from "./sections/admin/admin";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import type { Metadata } from "next";

import { I18nProvider } from "@vitnode/core/components/i18n-provider";
import { DataTableSkeleton } from "@vitnode/core/components/table/data-table";
import { HeaderContent } from "@vitnode/core/components/ui/header-content";
import type { Metadata } from "next";
import dynamic from "next/dynamic";
import { getTranslations } from "next-intl/server";
import dynamic from "next/dynamic";
import React from "react";

import { ActionsCategoriesAdmin } from "@vitnode/blog/views/admin/categories/actions/actions";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import type { Metadata } from "next";

import { I18nProvider } from "@vitnode/core/components/i18n-provider";
import { DataTableSkeleton } from "@vitnode/core/components/table/data-table";
import { HeaderContent } from "@vitnode/core/components/ui/header-content";
import type { Metadata } from "next";
import dynamic from "next/dynamic";
import { getTranslations } from "next-intl/server";
import dynamic from "next/dynamic";
import React from "react";

import { ActionsPostsAdmin } from "@vitnode/blog/views/admin/posts/actions/actions";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import dynamic from "next/dynamic";
import { getTranslations } from "next-intl/server";
import dynamic from "next/dynamic";
import React from "react";

import { I18nProvider } from "@vitnode/core/components/i18n-provider";
import { DataTableSkeleton } from "@vitnode/core/components/table/data-table";
import { HeaderContent } from "@vitnode/core/components/ui/header-content";
Expand Down Expand Up @@ -30,7 +31,7 @@ export default async function Page(
return (
<I18nProvider namespaces={["admin.advanced.cron"]}>
<div className="p-4">
<HeaderContent h1={t("title")} desc={t("desc")} />
<HeaderContent desc={t("desc")} h1={t("title")} />

<React.Suspense fallback={<DataTableSkeleton columns={6} />}>
<CronTableView {...props} />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import dynamic from "next/dynamic";
import { getTranslations } from "next-intl/server";
import dynamic from "next/dynamic";
import React from "react";

import { I18nProvider } from "@vitnode/core/components/i18n-provider";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { Metadata } from "next/dist/types";
import dynamic from "next/dynamic";

import { getTranslations } from "next-intl/server";
import dynamic from "next/dynamic";
import React from "react";

import { DataTableSkeleton } from "@vitnode/core/components/table/data-table";
Expand Down
3 changes: 2 additions & 1 deletion apps/docs/src/app/[locale]/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import type { RootLayoutProps } from "@vitnode/core/views/layouts/root-layout";
import type { Metadata } from "next";

import {
generateMetadataRootLayout,
RootLayout,
} from "@vitnode/core/views/layouts/root-layout";
import { RootProvider } from "fumadocs-ui/provider";
import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google";

import { vitNodeConfig } from "@/vitnode.config";
Expand Down
1 change: 0 additions & 1 deletion apps/docs/src/app/global.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/** biome-ignore-all lint/suspicious/noUnknownAtRules: <tailwind> */
@import "tailwindcss";
@import "fumadocs-ui/css/shadcn.css";
@import "fumadocs-ui/css/preset.css";
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import "./global.css";

export default function RootLayout({
export default async function RootLayout({
children,
}: {
children: React.ReactNode;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"use client";

import type React from "react";

import {
Tooltip,
TooltipContent,
Expand All @@ -18,7 +20,6 @@ import {
Sparkle,
Users,
} from "lucide-react";
import type React from "react";
import { useRef } from "react";

import { LogoVitNode } from "../logo-vitnode";
Expand Down
3 changes: 2 additions & 1 deletion apps/docs/src/components/fumadocs/img.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type React from "react";

import { ImageZoom } from "fumadocs-ui/components/image-zoom";
import { cn } from "fumadocs-ui/utils/cn";
import type React from "react";

export const ImgDocs = ({
className,
Expand Down
3 changes: 1 addition & 2 deletions apps/docs/src/components/infinite-slider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import { cn } from "@vitnode/core/lib/utils";
import {
type AnimationPlaybackControlsWithThen,
animate,
type AnimationPlaybackControlsWithThen,
motion,
useMotionValue,
} from "motion/react";
Expand Down Expand Up @@ -35,7 +35,6 @@ export function InfiniteSlider({
const [isTransitioning, setIsTransitioning] = React.useState(false);
const [key, setKey] = React.useState(0);

// biome-ignore lint/correctness/useExhaustiveDependencies: <we need key to reset the animation>
React.useEffect(() => {
let controls: AnimationPlaybackControlsWithThen | undefined;
const size = direction === "horizontal" ? width : height;
Expand Down
18 changes: 8 additions & 10 deletions apps/docs/src/components/text-animate.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
"use client";

import { cn } from "@vitnode/core/lib/utils";
import type { MotionProps, Variants } from "motion/react";
import { AnimatePresence, motion } from "motion/react";
import type { ElementType } from "react";

import { cn } from "@vitnode/core/lib/utils";
import { AnimatePresence, motion } from "motion/react";
import { memo } from "react";

type AnimationType = "character" | "line" | "text" | "word";
Expand Down Expand Up @@ -323,12 +324,12 @@ const TextAnimateBase = ({
case "line":
segments = children.split("\n");
break;
case "word":
segments = children.split(/(\s+)/);
break;
case "text":
segments = [children];
break;
case "word":
segments = children.split(/(\s+)/);
break;
default:
segments = [children];
break;
Expand Down Expand Up @@ -392,7 +393,7 @@ const TextAnimateBase = ({
className={cn("whitespace-pre-wrap", className)}
exit="exit"
initial="hidden"
variants={finalVariants.container as Variants}
variants={finalVariants.container}
viewport={{ once }}
whileInView={startOnView ? "show" : undefined}
{...props}
Expand All @@ -405,10 +406,7 @@ const TextAnimateBase = ({
segmentClassName,
)}
custom={i * staggerTimings[by]}
key={`${by}-${segment}-${
// biome-ignore lint/suspicious/noArrayIndexKey: <text animate>
i
}`}
key={`${by}-${segment}`}
variants={finalVariants.item}
>
{segment}
Expand Down
Loading
Loading