carto-md 1.1.1 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +26 -12
- package/README.md +259 -220
- package/index.js +20 -0
- package/package.json +2 -2
- package/src/cache/file-hash.js +84 -0
- package/src/cache/graph-cache.js +77 -0
- package/src/cli/check.js +124 -0
- package/src/cli/impact.js +30 -138
- package/src/cli/index.js +6 -0
- package/src/cli/watch.js +148 -15
- package/src/engine/carto.js +590 -0
- package/src/engine/incremental.js +149 -0
- package/src/engine/worker-pool.js +119 -0
- package/src/engine/worker.js +55 -0
- package/src/extractors/languages/go.js +124 -0
- package/src/extractors/languages/javascript.js +119 -0
- package/src/extractors/languages/typescript.js +204 -200
- package/src/extractors/models.js +85 -18
- package/src/extractors/routes.js +38 -16
- package/src/mcp/server.js +360 -146
- package/src/sync.js +193 -146
- package/src/watcher/watch.js +30 -10
package/CONTRIBUTING.md
CHANGED
|
@@ -10,23 +10,32 @@ Carto is free, open source, and community-maintained. The core team owns the mer
|
|
|
10
10
|
|
|
11
11
|
New language support lives in `src/extractors/languages/`. Each language is an isolated module.
|
|
12
12
|
|
|
13
|
-
Currently supported: JavaScript/TypeScript, Python, R.
|
|
13
|
+
Currently supported: JavaScript/TypeScript, Python, Go, R.
|
|
14
14
|
|
|
15
|
-
Wanted:
|
|
15
|
+
Wanted: Rust, Ruby, Java, PHP, C#, Swift, Kotlin.
|
|
16
16
|
|
|
17
17
|
### Tier 2 — Framework extractors (safe to add, easy to review)
|
|
18
18
|
|
|
19
19
|
Framework-specific route and model extraction lives in `src/extractors/`. Each framework is an isolated module.
|
|
20
20
|
|
|
21
|
-
Currently supported:
|
|
21
|
+
Currently supported:
|
|
22
|
+
- **JS/TS**: Express, Next.js (App + Pages Router), tRPC, Drizzle, Zod
|
|
23
|
+
- **Python**: FastAPI, Pydantic, SQLAlchemy, Django (models + URLs)
|
|
24
|
+
- **Go**: Gin, Echo, Chi, net/http
|
|
25
|
+
- **Schema**: Prisma
|
|
26
|
+
- **Frontend**: HTML fetch()
|
|
27
|
+
- **R**: Plumber, Shiny, R6, S7
|
|
22
28
|
|
|
23
|
-
Wanted:
|
|
29
|
+
Wanted: Rails, Laravel, NestJS, Hono, Spring, Flask, Fastify.
|
|
24
30
|
|
|
25
31
|
### Tier 3 — Core (review carefully before merging)
|
|
26
32
|
|
|
27
33
|
- `src/agents/merger.js` — merger logic. One bad merge = developer loses manual notes = project dies.
|
|
28
34
|
- `src/agents/domains.js` — graph-based domain clustering. Wrong clusters = wrong context files.
|
|
35
|
+
- `src/engine/carto.js` — programmatic module API. Breaking changes affect tools that import Carto.
|
|
29
36
|
- `src/mcp/server.js` — MCP server tools. Breaking changes affect Kiro/Cursor/Claude integration.
|
|
37
|
+
- `src/engine/incremental.js` — incremental graph update engine. Bugs here cause stale graphs.
|
|
38
|
+
- `src/cache/` — file hash + graph cache. Bugs here cause wrong re-index behavior.
|
|
30
39
|
- `src/detector/` — framework detection logic.
|
|
31
40
|
- `src/cli/` — CLI commands.
|
|
32
41
|
|
|
@@ -36,23 +45,27 @@ Wanted: Django, Rails, Laravel, NestJS, Hono, Gin, Spring.
|
|
|
36
45
|
|
|
37
46
|
1. Create `src/extractors/languages/yourlanguage.js`
|
|
38
47
|
2. Export a plugin object:
|
|
48
|
+
|
|
39
49
|
```js
|
|
40
50
|
module.exports = {
|
|
41
51
|
name: 'yourlanguage',
|
|
42
52
|
extensions: ['.ext'],
|
|
43
53
|
extract(content, relPath) {
|
|
44
54
|
return {
|
|
45
|
-
routes:
|
|
46
|
-
models:
|
|
47
|
-
functions:
|
|
48
|
-
envVars:
|
|
49
|
-
dbTables:
|
|
50
|
-
fetches:
|
|
51
|
-
storageKeys: []
|
|
55
|
+
routes: [{ method, path, functionName }],
|
|
56
|
+
models: [{ className, fields: [{ name, type }], kind: 'yourlanguage' }],
|
|
57
|
+
functions: [{ name, params, returnType }],
|
|
58
|
+
envVars: ['VAR_NAME'],
|
|
59
|
+
dbTables: [{ tableName, modelName }],
|
|
60
|
+
fetches: [],
|
|
61
|
+
storageKeys: [],
|
|
62
|
+
events: [{ type: 'listener'|'emitter', event: 'event.name' }],
|
|
63
|
+
jobs: [{ type: 'cron'|'queue'|'interval', expression?: '* * * * *', name?: 'job-name' }],
|
|
52
64
|
};
|
|
53
65
|
}
|
|
54
66
|
};
|
|
55
67
|
```
|
|
68
|
+
|
|
56
69
|
3. The loader auto-discovers it — no changes to `loader.js` needed
|
|
57
70
|
4. Test on at least 3 real open-source projects
|
|
58
71
|
5. Open a PR with before/after AGENTS.md examples
|
|
@@ -96,7 +109,7 @@ cd carto
|
|
|
96
109
|
npm install
|
|
97
110
|
node src/cli/index.js init # test in any project
|
|
98
111
|
node src/cli/index.js serve # test MCP server
|
|
99
|
-
npm test # run test suite
|
|
112
|
+
npm test # run test suite (30 tests)
|
|
100
113
|
```
|
|
101
114
|
|
|
102
115
|
---
|
|
@@ -105,6 +118,7 @@ npm test # run test suite
|
|
|
105
118
|
|
|
106
119
|
- [ ] Tested on at least 2-3 real open-source projects
|
|
107
120
|
- [ ] Before/after AGENTS.md included in PR description
|
|
121
|
+
- [ ] Plugin returns all fields including `events` and `jobs` (can be empty arrays)
|
|
108
122
|
- [ ] No changes to merger logic (unless explicitly fixing a merger bug)
|
|
109
123
|
- [ ] No network calls added
|
|
110
124
|
- [ ] `carto --version` still works
|