feat(db): mesh data model — meshes, members, invites, audit log

- pgSchema "mesh" with 4 tables isolating the peer mesh domain
- Enums: visibility, transport, tier, role
- audit_log is metadata-only (E2E encryption enforced at broker/client)
- Cascade on mesh delete, soft-delete via archivedAt/revokedAt

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Alejandro Gutiérrez
2026-04-04 21:19:32 +01:00
commit d3163a5bff
1384 changed files with 314925 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
import baseConfig from "@turbostarter/eslint-config/base";
export default baseConfig;

View File

@@ -0,0 +1,90 @@
import { execSync } from "node:child_process";
import type { PlopTypes } from "@turbo/gen";
export function createPackageGenerator(plop: PlopTypes.NodePlopAPI): void {
plop.setGenerator("package", {
description: "Generate a new package within monorepo",
prompts: [
{
type: "input",
name: "name",
message:
"What is the name of the package? (You can skip the `@turbostarter/` prefix): ",
},
{
type: "input",
name: "deps",
message:
"Enter a space separated list of dependencies you would like to install: ",
},
],
actions: [
(answers) => {
if ("name" in answers && typeof answers.name === "string") {
if (answers.name.startsWith("@turbostarter/")) {
answers.name = answers.name.replace("@turbostarter/", "");
}
}
return "Config sanitized";
},
{
type: "add",
path: "packages/{{ name }}/eslint.config.js",
templateFile: "templates/package/eslint.config.js.hbs",
},
{
type: "add",
path: "packages/{{ name }}/package.json",
templateFile: "templates/package/package.json.hbs",
},
{
type: "add",
path: "packages/{{ name }}/tsconfig.json",
templateFile: "templates/package/tsconfig.json.hbs",
},
{
type: "add",
path: "packages/{{ name }}/vitest.config.ts",
templateFile: "templates/package/vitest.config.ts.hbs",
},
{
type: "add",
path: "packages/{{ name }}/src/index.ts",
template: "export const name = '{{ name }}';",
},
{
type: "modify",
path: "packages/{{ name }}/package.json",
async transform(content, answers) {
const pkg = JSON.parse(content);
for (const dep of answers.deps.split(" ").filter(Boolean)) {
const version = await fetch(
`https://registry.npmjs.org/-/package/${dep}/dist-tags`,
)
.then((res) => res.json())
.then((json) => json.latest);
if (!pkg.dependencies) pkg.dependencies = {};
pkg.dependencies[dep] = `^${version}`;
}
return JSON.stringify(pkg, null, 2);
},
},
async (answers) => {
/**
* Install dependencies and format everything
*/
execSync(
"pnpm dlx sherif@latest -r packages-without-package-json --fix",
{
stdio: "inherit",
},
);
execSync("pnpm i", { stdio: "inherit" });
execSync(`pnpm run format:fix`);
return "Package scaffolded";
},
],
});
}

View File

@@ -0,0 +1,27 @@
{
"name": "@turbostarter/{{ name }}",
"version": "0.1.0",
"private": true,
"type": "module",
"exports": {
".": "./src/index.ts"
},
"scripts": {
"clean": "git clean -xdf .cache .turbo dist node_modules",
"format": "prettier --check . --ignore-path ../../.gitignore",
"lint": "eslint",
"typecheck": "tsc --noEmit",
"test": "vitest run"
},
"prettier": "@turbostarter/prettier-config",
"devDependencies": {
"@turbostarter/eslint-config": "workspace:*",
"@turbostarter/prettier-config": "workspace:*",
"@turbostarter/tsconfig": "workspace:*",
"@turbostarter/vitest-config": "workspace:*",
"eslint": "catalog:",
"prettier": "catalog:",
"typescript": "catalog:",
"vitest": "catalog:"
}
}

View File

@@ -0,0 +1,6 @@
{
"extends": "@turbostarter/tsconfig/internal.json",
"compilerOptions": {},
"include": ["*.ts", "src/**/*"],
"exclude": ["node_modules"]
}

View File

@@ -0,0 +1,3 @@
import baseConfig from "@turbostarter/vitest-config/base";
export default baseConfig;