chore: pnpm workspace — landing, api, shared
apps/landing: Next.js 16 (App Router, standalone), Tailwind 4, ESLint с запретом импорта из api. apps/api: Hono + better-sqlite3, сборка tsup, /api/health. packages/shared: исходники TS без сборки. Vitest projects.
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import next from 'eslint-config-next';
|
||||
|
||||
const config = [
|
||||
...next,
|
||||
{
|
||||
rules: {
|
||||
// лендинг не знает о бэкенде: общий код только через @kvarta/shared
|
||||
'no-restricted-imports': ['error', { patterns: ['@kvarta/api', '**/apps/api/**'] }],
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export default config;
|
||||
@@ -0,0 +1,16 @@
|
||||
import path from 'node:path';
|
||||
import type { NextConfig } from 'next';
|
||||
|
||||
const config: NextConfig = {
|
||||
output: 'standalone',
|
||||
outputFileTracingRoot: path.join(import.meta.dirname, '../..'),
|
||||
transpilePackages: ['@kvarta/shared'],
|
||||
poweredByHeader: false,
|
||||
// в проде /api/ отдаёт nginx на контейнер api; локально проксируем на dev-сервер api
|
||||
async rewrites() {
|
||||
if (process.env.NODE_ENV === 'production') return [];
|
||||
return [{ source: '/api/:path*', destination: 'http://127.0.0.1:3001/api/:path*' }];
|
||||
},
|
||||
};
|
||||
|
||||
export default config;
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"name": "@kvarta/landing",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "next dev -p 3000",
|
||||
"build": "next build",
|
||||
"start": "next start -p 3000",
|
||||
"typecheck": "tsc -p .",
|
||||
"lint": "eslint ."
|
||||
},
|
||||
"dependencies": {
|
||||
"next": "^16.4.2",
|
||||
"react": "^19.3.1",
|
||||
"react-dom": "^19.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@kvarta/shared": "workspace:*",
|
||||
"@tailwindcss/postcss": "^4.3.3",
|
||||
"@types/react": "^19.3.0",
|
||||
"@types/react-dom": "^19.2.0",
|
||||
"eslint": "^9.39.0",
|
||||
"eslint-config-next": "^16.4.2",
|
||||
"tailwindcss": "^4.3.3"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
const config = { plugins: { '@tailwindcss/postcss': {} } };
|
||||
|
||||
export default config;
|
||||
@@ -0,0 +1 @@
|
||||
@import 'tailwindcss';
|
||||
@@ -0,0 +1,15 @@
|
||||
import type { Metadata } from 'next';
|
||||
import './globals.css';
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: 'Кварта — свежая обжарка в Минске',
|
||||
description: 'Обжариваем по четвергам, привозим по пятницам.',
|
||||
};
|
||||
|
||||
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
||||
return (
|
||||
<html lang="ru">
|
||||
<body>{children}</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export default function Page() {
|
||||
return <main>Кварта</main>;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"lib": ["ES2023", "DOM", "DOM.Iterable"],
|
||||
"jsx": "preserve",
|
||||
"allowJs": false,
|
||||
"incremental": true,
|
||||
"plugins": [{ "name": "next" }],
|
||||
"paths": { "@/*": ["./src/*"] }
|
||||
},
|
||||
"include": ["next-env.d.ts", "src", ".next/types/**/*.ts"],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
import { defineConfig } from 'vitest/config';
|
||||
|
||||
export default defineConfig({ test: { name: 'landing', environment: 'node' } });
|
||||
Reference in New Issue
Block a user