diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..ebf0801 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,15 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 2 +trim_trailing_whitespace = true + +[*.md] +trim_trailing_whitespace = false + +[Makefile] +indent_style = tab diff --git a/README.md b/README.md index 7afdd92..3b1162d 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,28 @@ Monorepo de la suite collaborative BOTSU. - `apps/client` : client Matrix basé sur Cinny `v4.12.6` +## Structure + +- `apps/` : applications déployables +- `packages/` : bibliothèques partagées BOTSU +- `docs/` : architecture, décisions et sécurité +- `infra/` : modèles de déploiement et migrations sans secrets +- `scripts/` : vérifications reproductibles du dépôt + +## Commandes actuelles + +```bash +npm test +npm run build:client +npm run typecheck:client +npm run lint:client +``` + +`npm test` vérifie actuellement la structure du monorepo. Le build Cinny est +vert. Les échecs hérités de `typecheck:client` et `lint:client` sont documentés +dans `docs/adr/0001-development-isolation.md` et ne doivent pas être masqués. +Les futurs packages BOTSU auront leurs propres gates vertes dès leur création. + ## Dépôts Git - `origin` : dépôt privé BOTSU sur `git.botsu.net` diff --git a/infra/README.md b/infra/README.md new file mode 100644 index 0000000..f19b9f1 --- /dev/null +++ b/infra/README.md @@ -0,0 +1,5 @@ +# Infrastructure + +Version-controlled deployment templates, migrations, and canary configuration will live here. + +This directory must not contain production secrets, live state, database contents, or unencrypted credentials. Applying infrastructure changes always requires a separate reviewed and reversible operation. diff --git a/package.json b/package.json new file mode 100644 index 0000000..093053f --- /dev/null +++ b/package.json @@ -0,0 +1,20 @@ +{ + "name": "@botsu/suite", + "version": "0.0.0", + "private": true, + "description": "BOTSU collaborative suite monorepo", + "workspaces": [ + "apps/*", + "packages/*" + ], + "scripts": { + "test": "npm run test:workspace", + "test:workspace": "node scripts/verify-workspace.mjs", + "build:client": "npm --prefix apps/client run build", + "lint:client": "npm --prefix apps/client run lint", + "typecheck:client": "npm --prefix apps/client run typecheck" + }, + "engines": { + "node": ">=22.0.0" + } +} diff --git a/packages/README.md b/packages/README.md new file mode 100644 index 0000000..2a8cf52 --- /dev/null +++ b/packages/README.md @@ -0,0 +1,5 @@ +# Shared packages + +Reusable BOTSU packages will live here. Planned packages include UI, protocol, identity, presence SDK, and testing utilities. + +Each package must provide its own tests and public API. Application-specific behavior remains under `apps/`. diff --git a/scripts/verify-workspace.mjs b/scripts/verify-workspace.mjs new file mode 100644 index 0000000..2cfecc6 --- /dev/null +++ b/scripts/verify-workspace.mjs @@ -0,0 +1,30 @@ +import assert from 'node:assert/strict'; +import { access, readFile } from 'node:fs/promises'; +import { resolve } from 'node:path'; + +const root = resolve(import.meta.dirname, '..'); + +const requiredPaths = [ + '.editorconfig', + 'package.json', + 'apps/client/package.json', + 'docs/adr', + 'docs/architecture', + 'infra', + 'packages', +]; + +await Promise.all(requiredPaths.map((path) => access(resolve(root, path)))); + +const rootPackage = JSON.parse(await readFile(resolve(root, 'package.json'), 'utf8')); +const clientPackage = JSON.parse( + await readFile(resolve(root, 'apps/client/package.json'), 'utf8'), +); + +assert.equal(rootPackage.private, true, 'the monorepo must remain private'); +assert.equal(rootPackage.name, '@botsu/suite'); +assert.deepEqual(rootPackage.workspaces, ['apps/*', 'packages/*']); +assert.equal(clientPackage.name, 'cinny'); +assert.equal(clientPackage.version, '4.12.6'); + +console.log('BOTSU workspace structure: OK');