build: add turbo workspace manifests

This commit is contained in:
vince 2026-06-20 05:23:04 +02:00
parent 4eadd21f71
commit 87261b5a3f
9 changed files with 261 additions and 54 deletions

49
apps/web/package.json Normal file
View 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"
]
}
}

View 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
View 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"]
}

View file

@ -1,63 +1,28 @@
{ {
"name": "dimensionlab-website", "name": "dimensionlab",
"version": "0.0.1", "version": "0.0.1",
"private": true, "private": true,
"type": "module", "type": "module",
"packageManager": "bun@1.3.14",
"workspaces": [
"apps/*",
"packages/*"
],
"scripts": { "scripts": {
"dev": "bun src/server/dev.ts", "dev": "turbo dev --filter=@dimensionlab/web",
"build": "vite build && bun build src/server/index.ts --target bun --outdir build", "build": "turbo build",
"preview": "HOST=0.0.0.0 PORT=4173 bun build/index.js", "preview": "bun --cwd apps/web run preview",
"storybook": "storybook dev -p 6006 --host 0.0.0.0", "storybook": "turbo storybook --filter=@dimensionlab/ui",
"build-storybook": "storybook build", "build-storybook": "turbo build-storybook --filter=@dimensionlab/ui",
"check": "tsc --noEmit", "check": "turbo check",
"test": "vitest run", "test": "turbo test:unit",
"test:unit": "vitest run", "test:unit": "turbo test:unit",
"test:e2e": "env -u NO_COLOR playwright test", "test:e2e": "turbo test:e2e --filter=@dimensionlab/web",
"test:qa": "bun run check && bun run test:unit && bun run build && bun run build-storybook && bun run test:e2e", "test:qa": "turbo test:qa",
"db:generate": "drizzle-kit generate", "db:generate": "bun --cwd apps/web run db:generate",
"db:check": "drizzle-kit check" "db:check": "bun --cwd apps/web run db:check"
},
"dependencies": {
"@fontsource-variable/geist": "^5.2.9",
"@iconify/react": "^6.0.2",
"@sinclair/typebox": "^0.34.49",
"ajv": "^8.20.0",
"ajv-formats": "^3.0.1",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"drizzle-orm": "^0.45.2",
"lucide-react": "^1.21.0",
"radix-ui": "^1.6.0",
"react": "^19.2.7",
"react-dom": "^19.2.7",
"tailwind-merge": "^3.6.0",
"tw-animate-css": "^1.4.0",
"uplot": "^1.6.32"
}, },
"devDependencies": { "devDependencies": {
"@axe-core/playwright": "^4.11.3", "turbo": "^2.5.0"
"@playwright/test": "^1.61.0",
"@storybook/addon-a11y": "^10.4.6",
"@storybook/addon-vitest": "^10.4.6",
"@storybook/react-vite": "^10.4.6",
"@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",
"storybook": "^10.4.6",
"tailwindcss": "^4.3.1",
"typescript": "^6.0.3",
"vite": "^8.0.16",
"vitest": "^4.1.9"
},
"msw": {
"workerDirectory": [
"static"
]
} }
} }

50
packages/ui/package.json Normal file
View file

@ -0,0 +1,50 @@
{
"name": "@dimensionlab/ui",
"version": "0.0.1",
"private": true,
"type": "module",
"sideEffects": ["*.css", "**/*.css"],
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"./styles.css": "./dist/styles.css",
"./tokens.css": "./dist/tokens.css"
},
"scripts": {
"build": "rm -rf dist && tsc -p tsconfig.build.json && mkdir -p dist/components && cp src/styles.css dist/styles.css && cp src/tokens.css dist/tokens.css && cp src/components/styles.css dist/components/styles.css",
"check": "tsc --noEmit",
"test": "vitest run",
"test:unit": "vitest run",
"storybook": "storybook dev -p 6006 --host 0.0.0.0",
"build-storybook": "storybook build"
},
"dependencies": {
"@fontsource-variable/geist": "^5.2.9",
"@iconify/react": "^6.0.2",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"lucide-react": "^1.21.0",
"radix-ui": "^1.6.0",
"tailwind-merge": "^3.6.0",
"tw-animate-css": "^1.4.0",
"uplot": "^1.6.32"
},
"peerDependencies": {
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
"devDependencies": {
"@storybook/addon-a11y": "^10.4.6",
"@storybook/addon-vitest": "^10.4.6",
"@storybook/react-vite": "^10.4.6",
"@types/bun": "^1.3.14",
"@types/node": "^25.9.3",
"@types/react": "^19.2.17",
"@types/react-dom": "^19.2.3",
"typescript": "^6.0.3",
"vite": "^8.0.16",
"vitest": "^4.1.9"
}
}

View file

@ -0,0 +1,18 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"declaration": true,
"emitDeclarationOnly": false,
"noEmit": false,
"outDir": "dist",
"rootDir": "src"
},
"exclude": [
"dist",
"node_modules",
"storybook-static",
"src/**/*.test.ts",
"src/**/*.test.tsx",
"src/stories/**"
]
}

View file

@ -0,0 +1,8 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": "."
},
"include": ["src/**/*.ts", "src/**/*.tsx", ".storybook/**/*.ts"],
"exclude": ["dist", "node_modules", "storybook-static"]
}

18
tsconfig.base.json Normal file
View file

@ -0,0 +1,18 @@
{
"compilerOptions": {
"allowJs": true,
"checkJs": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"ignoreDeprecations": "6.0",
"jsx": "react-jsx",
"module": "ESNext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
"target": "ES2022",
"types": ["node", "bun-types", "react", "react-dom", "vite/client"]
}
}

43
turbo.json Normal file
View file

@ -0,0 +1,43 @@
{
"$schema": "https://turbo.build/schema.json",
"tasks": {
"build": {
"dependsOn": ["^build"],
"outputs": ["dist/**", "build/**"]
},
"check": {
"dependsOn": ["^build"],
"outputs": []
},
"test:unit": {
"dependsOn": ["^build"],
"outputs": []
},
"build-storybook": {
"dependsOn": ["^build"],
"outputs": ["storybook-static/**"]
},
"test:e2e": {
"dependsOn": ["build", "^build"],
"outputs": ["test-results/**", "playwright-report/**"]
},
"test:qa": {
"dependsOn": [
"check",
"test:unit",
"build",
"build-storybook",
"test:e2e"
],
"outputs": []
},
"dev": {
"cache": false,
"persistent": true
},
"storybook": {
"cache": false,
"persistent": true
}
}
}