Skip to content

Commit eee49ef

Browse files
authored
chore: enhance CLAUDE.md with repository overview and package details (#201)
* docs: add repository overview and package responsibilities to CLAUDE.md * chore: run format * chore: add .claude/ to .gitignore
1 parent d84c1be commit eee49ef

4 files changed

Lines changed: 59 additions & 65 deletions

File tree

.cursor/rules/project-overview.mdc

Lines changed: 0 additions & 56 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
node_modules/
44
dist/
55
.env
6+
.claude/

CLAUDE.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Repository Overview
2+
3+
Monorepo providing a Directus endpoint extension, a CLI for syncing schema/data, an e2e test harness, and documentation.
4+
5+
## High-level flow
6+
7+
- The CLI connects to a Directus instance and orchestrates pull/diff/push/seed/specs operations.
8+
- The API extension exposes endpoints used by the CLI for SyncID↔LocalID mapping and helpers.
9+
- E2E tests spin up a Directus server locally and validate the full flow (CLI + extension) end-to-end.
10+
11+
## Packages
12+
13+
### `packages/api` — Directus endpoint extension
14+
- Exposes `/directus-extension-sync` routes for SyncID mapping and helpers (e.g., permissions deduplication).
15+
- Uses Express-style router via Directus SDK, Zod validation, and Knex for a small mapping table.
16+
- Key files: `src/index.ts` (routes), `src/api/*` (middleware/helpers), `src/database/*` (IdMapper, Permissions).
17+
18+
### `packages/cli` — Directus Sync CLI
19+
- Orchestrates schema and system collections synchronization; supports seed data and API specifications dump.
20+
- Structure:
21+
- `services/config`: options resolution (defaults → config file → CLI flags), Zod validation.
22+
- `services/collections`: per-collection pull/diff/push with id mapping.
23+
- `services/snapshot`: schema snapshot pull/diff/push.
24+
- `services/seed`: seed files loader/differ/pusher with dynamic id mapping.
25+
- `services/specifications`: GraphQL/OpenAPI dump.
26+
- `services/*-client.ts`: Directus SDK client, extension HTTP client, health checks.
27+
- `commands` + `program.ts`: command wiring and execution.
28+
- Technologies: TypeScript, typedi (DI), pino (logging), Zod, @directus/sdk.
29+
30+
### `packages/e2e` — End-to-end tests
31+
- Jasmine-based tests against a locally started Directus server.
32+
- Helpers start the server, create a Directus client, and run CLI commands programmatically, asserting logs and state.
33+
- See `spec/helpers/sdk/*`, `spec/pull-diff-push/*`.
34+
35+
### `website` — Documentation
36+
- Docusaurus site documenting installation, features, and how the sync works.
37+
- When updating the CLI help outputs, build the whole project (`npm run build` at the root), then run `npm run update-help-outputs` to update the help outputs in the website.
38+
39+
## Other top-level
40+
41+
- `docker/`: build/publish scripts and Dockerfile for distributing Directus with the extension.
42+
- `lerna.json`: monorepo management.
43+
- `DOCUMENTATION.md`, `CHANGELOG.md`, etc.: project docs and changelog.
44+
45+
## Conventions
46+
47+
- TypeScript across packages; DI via `typedi`; logging via `pino`; validation via `zod`.
48+
- Keep business logic in services; commands/endpoints orchestrate only.
49+
- Follow per-package rules under `.cursor/rules/` for detailed guidance.
50+
51+
## Checks
52+
53+
- Before committing, run `npm run lint` to run the linter and fix any issues.
54+
- Before pushing, run `npm run test` to run the tests and fix any issues.
55+
- Before pushing, run `npm run build` to build the project and fix any issues.
56+
- Before pushing, run `npm run docs:update` to update the help outputs in the website.

packages/e2e/dumps/sources/operations-dynamic-flow-id/collections/settings.json

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,8 @@
4747
"ai_openai_compatible_name": null,
4848
"ai_openai_compatible_models": null,
4949
"ai_openai_compatible_headers": null,
50-
"ai_openai_allowed_models": [
51-
"gpt-5-nano",
52-
"gpt-5-mini",
53-
"gpt-5"
54-
],
55-
"ai_anthropic_allowed_models": [
56-
"claude-haiku-4-5",
57-
"claude-sonnet-4-5"
58-
],
50+
"ai_openai_allowed_models": ["gpt-5-nano", "gpt-5-mini", "gpt-5"],
51+
"ai_anthropic_allowed_models": ["claude-haiku-4-5", "claude-sonnet-4-5"],
5952
"ai_google_allowed_models": [
6053
"gemini-3-pro-preview",
6154
"gemini-3-flash-preview",

0 commit comments

Comments
 (0)