build: add turbo workspace manifests
This commit is contained in:
parent
4eadd21f71
commit
87261b5a3f
9 changed files with 261 additions and 54 deletions
49
apps/web/package.json
Normal file
49
apps/web/package.json
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
{
|
||||
"name": "@dimensionlab/web",
|
||||
"version": "0.0.1",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite --host 0.0.0.0",
|
||||
"build": "vite build && bun build src/server/index.ts --target bun --outdir build",
|
||||
"preview": "HOST=0.0.0.0 PORT=4173 bun build/index.js",
|
||||
"check": "tsc --noEmit",
|
||||
"test": "vitest run",
|
||||
"test:unit": "vitest run",
|
||||
"test:e2e": "env -u NO_COLOR playwright test",
|
||||
"test:qa": "bun run check && bun run test:unit && bun run build && bun run test:e2e",
|
||||
"db:generate": "drizzle-kit generate",
|
||||
"db:check": "drizzle-kit check"
|
||||
},
|
||||
"dependencies": {
|
||||
"@dimensionlab/ui": "workspace:*",
|
||||
"@sinclair/typebox": "^0.34.49",
|
||||
"ajv": "^8.20.0",
|
||||
"ajv-formats": "^3.0.1",
|
||||
"drizzle-orm": "^0.45.2",
|
||||
"react": "^19.2.7",
|
||||
"react-dom": "^19.2.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@axe-core/playwright": "^4.11.3",
|
||||
"@playwright/test": "^1.61.0",
|
||||
"@tailwindcss/vite": "^4.3.1",
|
||||
"@types/bun": "^1.3.14",
|
||||
"@types/node": "^25.9.3",
|
||||
"@types/react": "^19.2.17",
|
||||
"@types/react-dom": "^19.2.3",
|
||||
"@vitejs/plugin-react": "^6.0.2",
|
||||
"drizzle-kit": "^0.31.10",
|
||||
"msw": "^2.14.6",
|
||||
"shadcn": "^4.11.0",
|
||||
"tailwindcss": "^4.3.1",
|
||||
"typescript": "^6.0.3",
|
||||
"vite": "^8.0.16",
|
||||
"vitest": "^4.1.9"
|
||||
},
|
||||
"msw": {
|
||||
"workerDirectory": [
|
||||
"static"
|
||||
]
|
||||
}
|
||||
}
|
||||
37
apps/web/src/lib/workspace-boundary.test.ts
Normal file
37
apps/web/src/lib/workspace-boundary.test.ts
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
import { existsSync, readFileSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
import { describe, expect, test } from "vitest";
|
||||
|
||||
const root = process.cwd();
|
||||
|
||||
describe("workspace boundaries", () => {
|
||||
test("declares the root as a turbo-managed bun workspace", () => {
|
||||
const packageJson = JSON.parse(
|
||||
readFileSync(join(root, "package.json"), "utf8"),
|
||||
) as {
|
||||
private?: boolean;
|
||||
scripts?: Record<string, string>;
|
||||
workspaces?: string[];
|
||||
};
|
||||
|
||||
expect(packageJson.private).toBe(true);
|
||||
expect(packageJson.workspaces).toEqual(["apps/*", "packages/*"]);
|
||||
expect(packageJson.scripts?.build).toBe("turbo build");
|
||||
expect(existsSync(join(root, "turbo.json"))).toBe(true);
|
||||
});
|
||||
|
||||
test("keeps the website app and reusable UI library as separate packages", () => {
|
||||
const webPackage = JSON.parse(
|
||||
readFileSync(join(root, "apps/web/package.json"), "utf8"),
|
||||
) as { dependencies?: Record<string, string>; name?: string };
|
||||
const uiPackage = JSON.parse(
|
||||
readFileSync(join(root, "packages/ui/package.json"), "utf8"),
|
||||
) as { exports?: Record<string, unknown>; name?: string };
|
||||
|
||||
expect(webPackage.name).toBe("@dimensionlab/web");
|
||||
expect(webPackage.dependencies?.["@dimensionlab/ui"]).toBe("workspace:*");
|
||||
expect(uiPackage.name).toBe("@dimensionlab/ui");
|
||||
expect(uiPackage.exports).toHaveProperty(".");
|
||||
expect(uiPackage.exports).toHaveProperty("./styles.css");
|
||||
});
|
||||
});
|
||||
19
apps/web/tsconfig.json
Normal file
19
apps/web/tsconfig.json
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"$lib/*": ["src/lib/*"]
|
||||
},
|
||||
"types": ["node", "bun-types", "react", "react-dom", "vite/client"]
|
||||
},
|
||||
"include": [
|
||||
"src/**/*.ts",
|
||||
"src/**/*.tsx",
|
||||
"tests/**/*.ts",
|
||||
"vite.config.ts",
|
||||
"playwright.config.ts",
|
||||
"drizzle.config.ts"
|
||||
],
|
||||
"exclude": ["build", "dist", "node_modules"]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue