codebread 1.0.2__tar.gz → 1.0.3__tar.gz

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.
Files changed (29) hide show
  1. {codebread-1.0.2 → codebread-1.0.3}/PKG-INFO +33 -9
  2. {codebread-1.0.2 → codebread-1.0.3}/README.md +32 -8
  3. {codebread-1.0.2 → codebread-1.0.3}/codebread/web/app.js +43 -18
  4. {codebread-1.0.2 → codebread-1.0.3}/codebread.egg-info/PKG-INFO +33 -9
  5. {codebread-1.0.2 → codebread-1.0.3}/pyproject.toml +1 -1
  6. {codebread-1.0.2 → codebread-1.0.3}/LICENSE +0 -0
  7. {codebread-1.0.2 → codebread-1.0.3}/codebread/__init__.py +0 -0
  8. {codebread-1.0.2 → codebread-1.0.3}/codebread/analyzer.py +0 -0
  9. {codebread-1.0.2 → codebread-1.0.3}/codebread/classifier.py +0 -0
  10. {codebread-1.0.2 → codebread-1.0.3}/codebread/cli.py +0 -0
  11. {codebread-1.0.2 → codebread-1.0.3}/codebread/connections.py +0 -0
  12. {codebread-1.0.2 → codebread-1.0.3}/codebread/diff.py +0 -0
  13. {codebread-1.0.2 → codebread-1.0.3}/codebread/export.py +0 -0
  14. {codebread-1.0.2 → codebread-1.0.3}/codebread/languages.py +0 -0
  15. {codebread-1.0.2 → codebread-1.0.3}/codebread/models.py +0 -0
  16. {codebread-1.0.2 → codebread-1.0.3}/codebread/parsers/__init__.py +0 -0
  17. {codebread-1.0.2 → codebread-1.0.3}/codebread/parsers/generic_parser.py +0 -0
  18. {codebread-1.0.2 → codebread-1.0.3}/codebread/parsers/javascript_parser.py +0 -0
  19. {codebread-1.0.2 → codebread-1.0.3}/codebread/parsers/python_parser.py +0 -0
  20. {codebread-1.0.2 → codebread-1.0.3}/codebread/scanner.py +0 -0
  21. {codebread-1.0.2 → codebread-1.0.3}/codebread/server.py +0 -0
  22. {codebread-1.0.2 → codebread-1.0.3}/codebread/web/index.html +0 -0
  23. {codebread-1.0.2 → codebread-1.0.3}/codebread/web/style.css +0 -0
  24. {codebread-1.0.2 → codebread-1.0.3}/codebread.egg-info/SOURCES.txt +0 -0
  25. {codebread-1.0.2 → codebread-1.0.3}/codebread.egg-info/dependency_links.txt +0 -0
  26. {codebread-1.0.2 → codebread-1.0.3}/codebread.egg-info/entry_points.txt +0 -0
  27. {codebread-1.0.2 → codebread-1.0.3}/codebread.egg-info/requires.txt +0 -0
  28. {codebread-1.0.2 → codebread-1.0.3}/codebread.egg-info/top_level.txt +0 -0
  29. {codebread-1.0.2 → codebread-1.0.3}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codebread
3
- Version: 1.0.2
3
+ Version: 1.0.3
4
4
  Summary: Interactive codebase analyzer & visualizer — slice open a project and see how it's wired together.
5
5
  Author: Danial Irsyad
6
6
  License: MIT
@@ -164,14 +164,38 @@ the map already scanned.
164
164
 
165
165
  ## Language support
166
166
 
167
- | Language | Parser | Extracted |
168
- |---|---|---|
169
- | Python | stdlib `ast` (precise) | functions, classes, params/annotations, docstrings, Flask/FastAPI/Django routes, SQLAlchemy/Django models, raw SQL, `requests`/`httpx` calls |
170
- | JavaScript / TypeScript / JSX / TSX / Vue / Svelte | structural regex + brace matching | functions, arrow fns, classes, Express/Nest/Fastify routes, `fetch`/`axios` calls, Mongoose/Prisma/Sequelize/Knex/TypeORM, raw SQL |
171
- | Java, C#, Go, PHP, Ruby | structural regex | functions/methods, classes, Spring/ASP.NET/Laravel/Rails/Gin routes, raw SQL |
172
- | SQL | regex | `CREATE TABLE` schemas with columns |
173
- | Config (`.env`, json/yaml/toml/ini, settings.py…) | key scan | DB connection settings **credentials always masked** |
174
- | Anything else (Rust, Kotlin, Swift, C/C++…) | | shown in the UI as "⚠ Unsupported parsing skipped", never silently dropped |
167
+ Parser used per language, then exactly what gets extracted — checked feature
168
+ by feature against the actual parser code, not a marketing table:
169
+
170
+ | Language | Parser | Functions / methods | Classes / structs | Backend routes | Outgoing API calls | ORM / DB models | Raw SQL | Call graph | Page-nav links |
171
+ |---|---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|
172
+ | Python | stdlib `ast` (precise) | ✅ | ✅ | ✅ Flask / FastAPI / Django | ✅ `requests` / `httpx` / `aiohttp` / `urllib` | ✅ SQLAlchemy / Django / peewee / tortoise | ✅ | ✅ | – |
173
+ | JavaScript / TypeScript / JSX / TSX | regex + brace matching | ✅ | ✅ | ✅ Express / Fastify / Koa / NestJS | `fetch` / `axios` | Mongoose / Prisma / Sequelize / Knex / TypeORM | ✅ | ✅ | – |
174
+ | Vue / Svelte | regex, `<script>` block only¹ | | | (same as JS) | (same as JS) | (same as JS) | ✅ | ✅ | – |
175
+ | Java | regex | ✅ | ✅ | ✅ Spring `@*Mapping` | – | – | ✅ | ✅ | – |
176
+ | C# | regex | ✅ | ✅ | ✅ ASP.NET `[Http*]` | – | – | ✅ | ✅ | – |
177
+ | Go | regex | ✅ | ✅ (structs) | ✅ Gin / net-http style | – | – | ✅ | ✅ | – |
178
+ | PHP | regex | ✅ | ✅ | ✅ Laravel `Route::` | – | – | ✅ | ✅ | ✅ |
179
+ | Ruby | regex | ✅ | ✅ | ✅ Rails / Sinatra | – | – | ✅ | ✅ | ✅ |
180
+ | SQL (`.sql` files) | regex | – | – | – | – | ✅ `CREATE TABLE` schemas + columns | ✅ | – | – |
181
+ | Config (`.env`, json/yaml/toml/ini/xml…)² | key scan | – | – | – | – | – | – | – | – |
182
+ | Anything else (Rust, Kotlin, Swift, C/C++, Scala, Elixir, Erlang, Lua, R, Perl, Dart, Zig…) | – | – | – | – | – | – | – | – | – |
183
+
184
+ Unsupported languages still show up in the Explorer tree with an
185
+ "⚠ Unsupported — parsing skipped" badge — never silently dropped — they just
186
+ have no functions/edges to draw.
187
+
188
+ ¹ Vue/Svelte only parse the `<script>` block — template-only bindings
189
+ (`@click`, `v-on`, Svelte reactive markup) aren't extracted.
190
+ ² Config-format files get a DB-connection-settings scan instead of code
191
+ extraction — **credentials always masked**, see [export.py](codebread/export.py)-embedded
192
+ source too. Files like `settings.py` or `config.js` are parsed as their real
193
+ language (full extraction above), not this bucket — only non-code formats
194
+ (json/yaml/toml/ini/`.env`/xml/properties) land here.
195
+
196
+ Only Python's `ast`-based parser captures real parameter type annotations,
197
+ return types, and docstrings — every regex-based parser above extracts
198
+ parameter *names* only.
175
199
 
176
200
  ## How it classifies layers
177
201
 
@@ -150,14 +150,38 @@ the map already scanned.
150
150
 
151
151
  ## Language support
152
152
 
153
- | Language | Parser | Extracted |
154
- |---|---|---|
155
- | Python | stdlib `ast` (precise) | functions, classes, params/annotations, docstrings, Flask/FastAPI/Django routes, SQLAlchemy/Django models, raw SQL, `requests`/`httpx` calls |
156
- | JavaScript / TypeScript / JSX / TSX / Vue / Svelte | structural regex + brace matching | functions, arrow fns, classes, Express/Nest/Fastify routes, `fetch`/`axios` calls, Mongoose/Prisma/Sequelize/Knex/TypeORM, raw SQL |
157
- | Java, C#, Go, PHP, Ruby | structural regex | functions/methods, classes, Spring/ASP.NET/Laravel/Rails/Gin routes, raw SQL |
158
- | SQL | regex | `CREATE TABLE` schemas with columns |
159
- | Config (`.env`, json/yaml/toml/ini, settings.py…) | key scan | DB connection settings **credentials always masked** |
160
- | Anything else (Rust, Kotlin, Swift, C/C++…) | | shown in the UI as "⚠ Unsupported parsing skipped", never silently dropped |
153
+ Parser used per language, then exactly what gets extracted — checked feature
154
+ by feature against the actual parser code, not a marketing table:
155
+
156
+ | Language | Parser | Functions / methods | Classes / structs | Backend routes | Outgoing API calls | ORM / DB models | Raw SQL | Call graph | Page-nav links |
157
+ |---|---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|
158
+ | Python | stdlib `ast` (precise) | ✅ | ✅ | ✅ Flask / FastAPI / Django | ✅ `requests` / `httpx` / `aiohttp` / `urllib` | ✅ SQLAlchemy / Django / peewee / tortoise | ✅ | ✅ | – |
159
+ | JavaScript / TypeScript / JSX / TSX | regex + brace matching | ✅ | ✅ | ✅ Express / Fastify / Koa / NestJS | `fetch` / `axios` | Mongoose / Prisma / Sequelize / Knex / TypeORM | ✅ | ✅ | – |
160
+ | Vue / Svelte | regex, `<script>` block only¹ | | | (same as JS) | (same as JS) | (same as JS) | ✅ | ✅ | – |
161
+ | Java | regex | ✅ | ✅ | ✅ Spring `@*Mapping` | – | – | ✅ | ✅ | – |
162
+ | C# | regex | ✅ | ✅ | ✅ ASP.NET `[Http*]` | – | – | ✅ | ✅ | – |
163
+ | Go | regex | ✅ | ✅ (structs) | ✅ Gin / net-http style | – | – | ✅ | ✅ | – |
164
+ | PHP | regex | ✅ | ✅ | ✅ Laravel `Route::` | – | – | ✅ | ✅ | ✅ |
165
+ | Ruby | regex | ✅ | ✅ | ✅ Rails / Sinatra | – | – | ✅ | ✅ | ✅ |
166
+ | SQL (`.sql` files) | regex | – | – | – | – | ✅ `CREATE TABLE` schemas + columns | ✅ | – | – |
167
+ | Config (`.env`, json/yaml/toml/ini/xml…)² | key scan | – | – | – | – | – | – | – | – |
168
+ | Anything else (Rust, Kotlin, Swift, C/C++, Scala, Elixir, Erlang, Lua, R, Perl, Dart, Zig…) | – | – | – | – | – | – | – | – | – |
169
+
170
+ Unsupported languages still show up in the Explorer tree with an
171
+ "⚠ Unsupported — parsing skipped" badge — never silently dropped — they just
172
+ have no functions/edges to draw.
173
+
174
+ ¹ Vue/Svelte only parse the `<script>` block — template-only bindings
175
+ (`@click`, `v-on`, Svelte reactive markup) aren't extracted.
176
+ ² Config-format files get a DB-connection-settings scan instead of code
177
+ extraction — **credentials always masked**, see [export.py](codebread/export.py)-embedded
178
+ source too. Files like `settings.py` or `config.js` are parsed as their real
179
+ language (full extraction above), not this bucket — only non-code formats
180
+ (json/yaml/toml/ini/`.env`/xml/properties) land here.
181
+
182
+ Only Python's `ast`-based parser captures real parameter type annotations,
183
+ return types, and docstrings — every regex-based parser above extracts
184
+ parameter *names* only.
161
185
 
162
186
  ## How it classifies layers
163
187
 
@@ -348,36 +348,61 @@ function visibleEdges() {
348
348
  }
349
349
 
350
350
  /* ---------------- DOM (re)build ---------------- */
351
+ /* Incremental: only the nodes/edges that actually entered or left the
352
+ visible set touch the DOM. A full teardown+rebuild here would mean every
353
+ single click in a large, densely-linked graph re-creates *everything*
354
+ already on screen (elements + listeners) just to add one more node —
355
+ that's the "too many links = lag" complaint this replaced. */
351
356
  function rebuild() {
352
- nodesG.innerHTML = ""; edgesG.innerHTML = "";
353
- S.elNodes.clear(); S.elEdges.clear();
354
- S.drawnEdges = [];
357
+ const newEdges = visibleEdges();
358
+ const newEdgeKeys = new Set(newEdges.map(edgeKey));
355
359
 
356
- for (const e of visibleEdges()) {
360
+ for (const { key } of S.drawnEdges) {
361
+ if (newEdgeKeys.has(key)) continue;
362
+ const els = S.elEdges.get(key);
363
+ if (!els) continue;
364
+ els.vis.remove(); els.hit.remove();
365
+ S.elEdges.delete(key);
366
+ }
367
+
368
+ const drawnEdges = [];
369
+ for (const e of newEdges) {
357
370
  const key = edgeKey(e);
358
- const vis = document.createElementNS(SVGNS, "path");
359
- vis.setAttribute("class", "edge k-" + e.kind + (e.cycle ? " cycle" : ""));
360
- const hit = document.createElementNS(SVGNS, "path");
361
- hit.setAttribute("class", "edge-hit");
362
- hit.addEventListener("mousemove", (ev) => showEdgeTooltip(e, ev));
363
- hit.addEventListener("mouseleave", hideTooltip);
364
- hit.addEventListener("contextmenu", (ev) => {
365
- ev.preventDefault(); ev.stopPropagation();
366
- onEdgeContextMenu(e, ev);
367
- });
368
- edgesG.appendChild(vis); edgesG.appendChild(hit);
369
- S.elEdges.set(key, { vis, hit });
370
- S.drawnEdges.push({ edge: e, key });
371
+ let els = S.elEdges.get(key);
372
+ if (!els) {
373
+ const vis = document.createElementNS(SVGNS, "path");
374
+ vis.setAttribute("class", "edge k-" + e.kind + (e.cycle ? " cycle" : ""));
375
+ const hit = document.createElementNS(SVGNS, "path");
376
+ hit.setAttribute("class", "edge-hit");
377
+ hit.addEventListener("mousemove", (ev) => showEdgeTooltip(e, ev));
378
+ hit.addEventListener("mouseleave", hideTooltip);
379
+ hit.addEventListener("contextmenu", (ev) => {
380
+ ev.preventDefault(); ev.stopPropagation();
381
+ onEdgeContextMenu(e, ev);
382
+ });
383
+ edgesG.appendChild(vis); edgesG.appendChild(hit);
384
+ els = { vis, hit };
385
+ S.elEdges.set(key, els);
386
+ }
387
+ drawnEdges.push({ edge: e, key });
371
388
  }
389
+ S.drawnEdges = drawnEdges;
372
390
 
391
+ for (const [id, g] of S.elNodes) {
392
+ const n = S.nodesById.get(id);
393
+ if (S.visible.has(id) && n && passesFilter(n)) continue;
394
+ g.remove();
395
+ S.elNodes.delete(id);
396
+ }
373
397
  for (const id of S.visible) {
374
398
  const n = S.nodesById.get(id);
375
- if (!n || !passesFilter(n)) continue;
399
+ if (!n || !passesFilter(n) || S.elNodes.has(id)) continue;
376
400
  ensurePos(id);
377
401
  const g = makeNodeEl(n);
378
402
  nodesG.appendChild(g);
379
403
  S.elNodes.set(id, g);
380
404
  }
405
+
381
406
  applyHighlight();
382
407
  updatePositions();
383
408
  renderMinimap();
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codebread
3
- Version: 1.0.2
3
+ Version: 1.0.3
4
4
  Summary: Interactive codebase analyzer & visualizer — slice open a project and see how it's wired together.
5
5
  Author: Danial Irsyad
6
6
  License: MIT
@@ -164,14 +164,38 @@ the map already scanned.
164
164
 
165
165
  ## Language support
166
166
 
167
- | Language | Parser | Extracted |
168
- |---|---|---|
169
- | Python | stdlib `ast` (precise) | functions, classes, params/annotations, docstrings, Flask/FastAPI/Django routes, SQLAlchemy/Django models, raw SQL, `requests`/`httpx` calls |
170
- | JavaScript / TypeScript / JSX / TSX / Vue / Svelte | structural regex + brace matching | functions, arrow fns, classes, Express/Nest/Fastify routes, `fetch`/`axios` calls, Mongoose/Prisma/Sequelize/Knex/TypeORM, raw SQL |
171
- | Java, C#, Go, PHP, Ruby | structural regex | functions/methods, classes, Spring/ASP.NET/Laravel/Rails/Gin routes, raw SQL |
172
- | SQL | regex | `CREATE TABLE` schemas with columns |
173
- | Config (`.env`, json/yaml/toml/ini, settings.py…) | key scan | DB connection settings **credentials always masked** |
174
- | Anything else (Rust, Kotlin, Swift, C/C++…) | | shown in the UI as "⚠ Unsupported parsing skipped", never silently dropped |
167
+ Parser used per language, then exactly what gets extracted — checked feature
168
+ by feature against the actual parser code, not a marketing table:
169
+
170
+ | Language | Parser | Functions / methods | Classes / structs | Backend routes | Outgoing API calls | ORM / DB models | Raw SQL | Call graph | Page-nav links |
171
+ |---|---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|
172
+ | Python | stdlib `ast` (precise) | ✅ | ✅ | ✅ Flask / FastAPI / Django | ✅ `requests` / `httpx` / `aiohttp` / `urllib` | ✅ SQLAlchemy / Django / peewee / tortoise | ✅ | ✅ | – |
173
+ | JavaScript / TypeScript / JSX / TSX | regex + brace matching | ✅ | ✅ | ✅ Express / Fastify / Koa / NestJS | `fetch` / `axios` | Mongoose / Prisma / Sequelize / Knex / TypeORM | ✅ | ✅ | – |
174
+ | Vue / Svelte | regex, `<script>` block only¹ | | | (same as JS) | (same as JS) | (same as JS) | ✅ | ✅ | – |
175
+ | Java | regex | ✅ | ✅ | ✅ Spring `@*Mapping` | – | – | ✅ | ✅ | – |
176
+ | C# | regex | ✅ | ✅ | ✅ ASP.NET `[Http*]` | – | – | ✅ | ✅ | – |
177
+ | Go | regex | ✅ | ✅ (structs) | ✅ Gin / net-http style | – | – | ✅ | ✅ | – |
178
+ | PHP | regex | ✅ | ✅ | ✅ Laravel `Route::` | – | – | ✅ | ✅ | ✅ |
179
+ | Ruby | regex | ✅ | ✅ | ✅ Rails / Sinatra | – | – | ✅ | ✅ | ✅ |
180
+ | SQL (`.sql` files) | regex | – | – | – | – | ✅ `CREATE TABLE` schemas + columns | ✅ | – | – |
181
+ | Config (`.env`, json/yaml/toml/ini/xml…)² | key scan | – | – | – | – | – | – | – | – |
182
+ | Anything else (Rust, Kotlin, Swift, C/C++, Scala, Elixir, Erlang, Lua, R, Perl, Dart, Zig…) | – | – | – | – | – | – | – | – | – |
183
+
184
+ Unsupported languages still show up in the Explorer tree with an
185
+ "⚠ Unsupported — parsing skipped" badge — never silently dropped — they just
186
+ have no functions/edges to draw.
187
+
188
+ ¹ Vue/Svelte only parse the `<script>` block — template-only bindings
189
+ (`@click`, `v-on`, Svelte reactive markup) aren't extracted.
190
+ ² Config-format files get a DB-connection-settings scan instead of code
191
+ extraction — **credentials always masked**, see [export.py](codebread/export.py)-embedded
192
+ source too. Files like `settings.py` or `config.js` are parsed as their real
193
+ language (full extraction above), not this bucket — only non-code formats
194
+ (json/yaml/toml/ini/`.env`/xml/properties) land here.
195
+
196
+ Only Python's `ast`-based parser captures real parameter type annotations,
197
+ return types, and docstrings — every regex-based parser above extracts
198
+ parameter *names* only.
175
199
 
176
200
  ## How it classifies layers
177
201
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "codebread"
7
- version = "1.0.2"
7
+ version = "1.0.3"
8
8
  description = "Interactive codebase analyzer & visualizer — slice open a project and see how it's wired together."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes