larats 1.0.2 → 1.1.1
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/README.md +58 -6
- package/dist/index.js +575 -17
- package/dist/index.js.map +1 -1
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# LaraTS ⚡
|
|
2
2
|
|
|
3
3
|
> **Smart Architecture Visualizer & Contextual Module Scaffolder CLI**
|
|
4
|
-
> Tailor-made for **Laravel**
|
|
4
|
+
> Tailor-made for **Laravel**, **TypeScript**, and **JavaScript (Node.js)** projects.
|
|
5
5
|
|
|
6
6
|
[](https://www.npmjs.com/package/larats)
|
|
7
7
|
[](https://github.com/SidiqFatuh187/Larats/actions/workflows/ci.yml)
|
|
@@ -18,8 +18,8 @@ When codebases grow large, developers often struggle to understand the architect
|
|
|
18
18
|
|
|
19
19
|
1. 🔍 **Architecture Scanner & Visualizer (`scan`)**: Instantly scans your repository, categorizes layers (Models, Controllers, Services, Actions, Filament Resources, Routes, etc.), and generates a clean `ARCHITECTURE.md` with an interactive **Mermaid.js flowchart** and directory tree.
|
|
20
20
|
2. 🏗️ **Contextual Module Scaffolder (`scaffold` / `make`)**: Quickly generates cohesive feature modules with clean, production-ready boilerplate code tailored to your exact stack (Laravel or TypeScript).
|
|
21
|
-
3.
|
|
22
|
-
|
|
21
|
+
3. 🤖 **AI Architecture Context Packager (`ai`)**: Exports a token-efficient system prompt teaching Cursor AI, Claude, Copilot, or ChatGPT your exact layered boundaries (`--copy`, `--cursor`, `--claude`).
|
|
22
|
+
4. 🔒 **100% Local & Secure**: No data ever leaves your computer. Sensitive files (`.env`, private keys, vendor folders) are strictly excluded.
|
|
23
23
|
---
|
|
24
24
|
|
|
25
25
|
## 🚀 Quick Start
|
|
@@ -30,9 +30,15 @@ Run instantly without installation via `npx`:
|
|
|
30
30
|
# Interactive menu mode
|
|
31
31
|
npx larats
|
|
32
32
|
|
|
33
|
-
#
|
|
33
|
+
# Scan architecture & display terminal pipeline
|
|
34
34
|
npx larats scan
|
|
35
35
|
|
|
36
|
+
# Open interactive Mermaid diagram in your browser
|
|
37
|
+
npx larats view
|
|
38
|
+
|
|
39
|
+
# Export architecture context rules for AI (Cursor, Claude, Copilot)
|
|
40
|
+
npx larats ai --copy
|
|
41
|
+
|
|
36
42
|
# Or scaffold a new module directly
|
|
37
43
|
npx larats scaffold Payment
|
|
38
44
|
```
|
|
@@ -44,6 +50,38 @@ npm install -g larats
|
|
|
44
50
|
larats
|
|
45
51
|
```
|
|
46
52
|
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## 👀 How to View Your Project Architecture
|
|
57
|
+
|
|
58
|
+
LaraTS makes your codebase architecture visible in 4 convenient ways:
|
|
59
|
+
|
|
60
|
+
1. 🌐 **Interactive Local Browser (`larats view` / `larats scan --view`)**:
|
|
61
|
+
Spawns a local browser tab displaying the interactive Mermaid flowchart, component counts, and directory tree.
|
|
62
|
+
```bash
|
|
63
|
+
npx larats view
|
|
64
|
+
# or scan and open viewer immediately
|
|
65
|
+
npx larats scan --view
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
2. 📟 **Terminal Architecture Pipeline**:
|
|
69
|
+
Every time you run `larats scan`, LaraTS prints an ASCII pipeline of your request lifecycle directly in the terminal:
|
|
70
|
+
```text
|
|
71
|
+
Client ──> Routes [4] ──> Controllers [4] ──> Services [2] ──> Models [6] ──> Database
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
3. 🐙 **GitHub & GitLab Native Preview**:
|
|
75
|
+
Commit and push `ARCHITECTURE.md` to your repository. GitHub natively renders Mermaid.js flowcharts into interactive graphics directly on the web page.
|
|
76
|
+
|
|
77
|
+
4. 💻 **VS Code & Cursor**:
|
|
78
|
+
Open `ARCHITECTURE.md` and press `Ctrl+Shift+V` (`Cmd+Shift+V` on macOS) to open the built-in Markdown Preview.
|
|
79
|
+
|
|
80
|
+
5. 📄 **Standalone HTML Export (`--html`)**:
|
|
81
|
+
Generate a self-contained `ARCHITECTURE.html` file that can be opened in any web browser without any server:
|
|
82
|
+
```bash
|
|
83
|
+
npx larats scan --html
|
|
84
|
+
```
|
|
47
85
|
---
|
|
48
86
|
|
|
49
87
|
## ✨ Key Features
|
|
@@ -83,6 +121,13 @@ Create new features in seconds with consistent boilerplate:
|
|
|
83
121
|
### 3. 🛡️ Anti-Overwrite Protection
|
|
84
122
|
LaraTS will **NEVER** silently overwrite your existing code. If a target file already exists, LaraTS skips it and alerts you. You can only overwrite files by explicitly providing `--force`.
|
|
85
123
|
|
|
124
|
+
|
|
125
|
+
### 4. 🤖 AI Architecture Context Packager (`ai`)
|
|
126
|
+
Teach AI coding assistants (Cursor, Claude Code, GitHub Copilot, ChatGPT) your exact project architecture rules so they never write misplaced code again:
|
|
127
|
+
- **Copy to Clipboard**: `larats ai --copy` — Copies clean, compressed architecture instructions (< 500 tokens) ready to paste into ChatGPT or Claude.
|
|
128
|
+
- **Cursor AI Rules**: `larats ai --cursor` — Injects architecture boundaries and directory maps directly into `.cursorrules`.
|
|
129
|
+
- **Claude Code Rules**: `larats ai --claude` — Injects architecture conventions into `CLAUDE.md`.
|
|
130
|
+
*(Safe merge: uses `<!-- larats-rules:start -->` tags so existing user instructions are never overwritten).*
|
|
86
131
|
---
|
|
87
132
|
|
|
88
133
|
## 🔒 Strict Security & Safety Guarantees
|
|
@@ -106,19 +151,26 @@ USAGE:
|
|
|
106
151
|
|
|
107
152
|
COMMANDS:
|
|
108
153
|
scan Scan repository & generate ARCHITECTURE.md
|
|
154
|
+
view, preview Open interactive architecture diagram in local browser
|
|
155
|
+
ai Export architecture context prompt for AI (Cursor, Claude, Copilot)
|
|
109
156
|
scaffold, make [name] Scaffold a new module or feature with clean boilerplate
|
|
110
157
|
info Show detected project type & architectural flavor
|
|
111
158
|
help Display help message
|
|
112
159
|
|
|
113
160
|
OPTIONS:
|
|
114
|
-
-o, --output <file> Output
|
|
161
|
+
-o, --output <file> Output path for scan (default: ARCHITECTURE.md)
|
|
162
|
+
--view Open local browser viewer immediately after scanning
|
|
163
|
+
--copy Copy AI architecture context prompt to clipboard
|
|
164
|
+
--cursor Inject architecture rules into .cursorrules
|
|
165
|
+
--claude Inject architecture rules into CLAUDE.md
|
|
166
|
+
-t, --tree Print directory tree in terminal
|
|
167
|
+
--html Also export standalone ARCHITECTURE.html
|
|
115
168
|
-m, --modular Enforce modular directory structure
|
|
116
169
|
-s, --standard Enforce standard/layered directory structure
|
|
117
170
|
--dry-run Simulate generation without writing files
|
|
118
171
|
-f, --force Overwrite files if they already exist
|
|
119
172
|
-v, --version Display CLI version
|
|
120
173
|
-h, --help Display help message
|
|
121
|
-
```
|
|
122
174
|
|
|
123
175
|
### Examples
|
|
124
176
|
|