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:
2026-10-17 15:33:07 +03:00
parent 4b880e7d9a
commit 04b150f3c3
23 changed files with 5792 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
{
"name": "@kvarta/api",
"private": true,
"type": "module",
"scripts": {
"dev": "tsx watch src/index.ts",
"build": "tsup",
"start": "node dist/index.js",
"typecheck": "tsc -p ."
},
"dependencies": {
"@hono/node-server": "^2.1.5",
"better-sqlite3": "^13.0.3",
"hono": "^4.13.13"
},
"devDependencies": {
"@kvarta/shared": "workspace:*",
"@types/better-sqlite3": "^9.6.0",
"tsup": "^9.0.0",
"tsx": "^4.20.0"
}
}
+7
View File
@@ -0,0 +1,7 @@
import { Hono } from 'hono';
export function createApp() {
const app = new Hono();
app.get('/api/health', (c) => c.json({ ok: true, version: process.env.APP_VERSION ?? 'dev' }));
return app;
}
+7
View File
@@ -0,0 +1,7 @@
import { serve } from '@hono/node-server';
import { createApp } from './app.js';
const port = Number(process.env.PORT ?? 3001);
serve({ fetch: createApp().fetch, port }, (info) => {
console.log(`api listening on :${info.port}`);
});
+5
View File
@@ -0,0 +1,5 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": { "types": ["node"] },
"include": ["src"]
}
+12
View File
@@ -0,0 +1,12 @@
import { defineConfig } from 'tsup';
export default defineConfig({
entry: ['src/index.ts'],
format: ['esm'],
platform: 'node',
target: 'node22',
clean: true,
// shared поставляется исходниками — вшиваем; нативный better-sqlite3 остаётся внешним
noExternal: ['@kvarta/shared'],
external: ['better-sqlite3'],
});
+3
View File
@@ -0,0 +1,3 @@
import { defineConfig } from 'vitest/config';
export default defineConfig({ test: { name: 'api', environment: 'node' } });