codarch 0.0.0-stage → 0.1.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 CodArch contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,78 @@
1
- # Temporary Holding Version
1
+ # codarch
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Mapa de arquitectura para equipos y agentes de IA. Analiza un repositorio TypeScript/JavaScript y
4
+ produce un snapshot interoperable con CodeCharta (`cc.json`), un mapa HTML autocontenido y un diff
5
+ de arquitectura para PR/CI.
6
+
7
+ ## Instalación
8
+
9
+ ```bash
10
+ npm install -g codarch
11
+ codarch --version
12
+ ```
13
+
14
+ Sin instalación global:
15
+
16
+ ```bash
17
+ npx codarch analyze .
18
+ ```
19
+
20
+ Requiere Node 22 o superior. El análisis usa `git log` para churn y autores; sin historial se puede
21
+ pasar `--no-git`.
22
+
23
+ ## Uso
24
+
25
+ ```bash
26
+ # Snapshot + mapa en .codarch/
27
+ codarch analyze .
28
+
29
+ # Elegir salida y título
30
+ codarch analyze . -o .codarch --title "Mi proyecto"
31
+
32
+ # Inspeccionar un cc.json existente (CodeCharta 1.x o 2.x)
33
+ codarch inspect mapa.cc.json --top 10
34
+
35
+ # Renderizar un cc.json sin volver a analizar
36
+ codarch render mapa.cc.json -o mapa.html --area rloc --color risk
37
+
38
+ # Comparar base y head, y bloquear el PR si hay violaciones nuevas
39
+ codarch diff base.cc.json head.cc.json -o report.json --config .codarch.yml --fail-on violations
40
+ ```
41
+
42
+ Códigos de salida de `diff`: `0` sin bloqueo, `2` política incumplida, `1` error de lectura o
43
+ configuración.
44
+
45
+ ## Reglas
46
+
47
+ `.codarch.yml` define capas, dependencias prohibidas, umbrales y ciclos. Solo bloquean las
48
+ violaciones **introducidas** con severidad `error`, así se puede adoptar en repos con deuda previa.
49
+
50
+ ```yaml
51
+ version: 1
52
+
53
+ layers:
54
+ - name: domain
55
+ paths: [src/domain/**]
56
+ - name: infrastructure
57
+ paths: [src/infra/**]
58
+
59
+ rules:
60
+ - name: domain-no-infra
61
+ type: forbidden
62
+ from: domain
63
+ to: infrastructure
64
+ severity: error
65
+ - name: sin-ciclos
66
+ type: cycles
67
+ severity: error
68
+ ```
69
+
70
+ ## Integración
71
+
72
+ - GitHub Action repo-local: [`apps/github-action`](https://github.com/jaminsmoke/codarch/tree/main/apps/github-action).
73
+ - MCP de solo lectura para agentes: [`docs/mcp.md`](https://github.com/jaminsmoke/codarch/blob/main/docs/mcp.md).
74
+ - Modelo y formato: [`docs/model.md`](https://github.com/jaminsmoke/codarch/blob/main/docs/model.md).
75
+
76
+ ## Licencia
77
+
78
+ MIT.