@lakindu_perera/toren 1.0.7 → 1.0.8
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/CHANGELOG.md +19 -0
- package/README.md +120 -31
- package/bin/toren.js +3 -0
- package/package.json +7 -3
- package/src/detectors/health-detector.js +72 -0
- package/src/detectors/important-files-detector.js +515 -0
- package/src/detectors/package-manager-detector.js +112 -0
- package/src/detectors/project-info-detector.js +89 -0
- package/src/detectors/script-detector.js +226 -10
- package/src/focused-output.js +78 -8
- package/src/renderers/console-renderer.js +53 -4
- package/src/renderers/html-renderer.js +128 -6
- package/src/renderers/json-renderer.js +15 -1
- package/src/renderers/markdown-renderer.js +70 -10
- package/src/scanner/scan.js +28 -6
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [1.0.7] - 2026-08-29
|
|
9
|
+
### Added
|
|
10
|
+
- **Project Intelligence Upgrade**: Added Package Manager detection, project metadata extraction (name, language, runtime, architecture), and important file detection.
|
|
11
|
+
- **Project Health Checks**: New `--health` flag to evaluate repository health (checking for README, License, linting, tests, docker files).
|
|
12
|
+
- **Richer Output Formats**: Expanded HTML and Markdown renderers to include the newly extracted project details, ensuring a highly readable and comprehensive project overview.
|
|
13
|
+
- **Enhanced JSON schema**: Output JSON schema has been substantially updated to support these rich data properties in a deterministic order.
|
|
14
|
+
- **New CLI flags**: `--summary`, `--important-files`, and `--health`.
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
- Refactored `ScanResult` object with `packageManager`, `projectInfo`, `health`, and `importantFiles`.
|
|
18
|
+
- Updated test suite for new CLI flags and deterministic JSON output.
|
|
19
|
+
|
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
# Toren —
|
|
1
|
+
# Toren — Fast Repository Discovery CLI
|
|
2
2
|
|
|
3
3
|
> The fastest way to understand any project structure. A zero-dependency codebase scanner CLI for modern developers.
|
|
4
4
|
|
|
5
|
-
[](https://www.npmjs.com/package/@lakindudev/toren)
|
|
6
6
|
[](https://nodejs.org)
|
|
7
7
|
[](package.json)
|
|
8
8
|
[](LICENSE)
|
|
@@ -23,6 +23,8 @@ Built with zero external dependencies, this **Node.js repository explorer** is t
|
|
|
23
23
|
- **Framework Detection**: Instantly identifies Node.js, React, Next.js, Vue, Nuxt, Angular, Svelte, Python, Go, Rust, Spring Boot, Ruby, PHP, Elixir and more.
|
|
24
24
|
- **Entry Point Detection**: Automatically pinpoints where execution begins (e.g., `index.js`, `main.ts`, `App.tsx`, `main.go`).
|
|
25
25
|
- **Project Structure Visualizer**: Generates clean, hierarchical file trees.
|
|
26
|
+
- **Project Health Diagnostics**: Provides observations and warnings for common project health issues.
|
|
27
|
+
- **Package Manager Detection**: Identifies whether a project uses npm, pnpm, yarn, bun, etc.
|
|
26
28
|
- **Multiple Output Formats**: Choose between `console` (default), `json`, `markdown`, or `html` reports.
|
|
27
29
|
- **Zero Dependencies**: A pure Node.js CLI tool with no external runtime packages. Lightning fast install, infinitely secure.
|
|
28
30
|
- **CLI Lifecycle Tools**: Native diagnostic and uninstallation tools (`--doctor`, `--uninstall`).
|
|
@@ -34,7 +36,7 @@ Built with zero external dependencies, this **Node.js repository explorer** is t
|
|
|
34
36
|
Install Toren globally via npm to make the **repository inspection CLI** available anywhere on your machine:
|
|
35
37
|
|
|
36
38
|
```bash
|
|
37
|
-
npm install -g @
|
|
39
|
+
npm install -g @lakindudev/toren
|
|
38
40
|
```
|
|
39
41
|
|
|
40
42
|
**Requirements:** Node.js 18.0.0 or higher.
|
|
@@ -69,6 +71,9 @@ toren --entry-points
|
|
|
69
71
|
toren --structure
|
|
70
72
|
toren --configs
|
|
71
73
|
toren --scripts
|
|
74
|
+
toren --summary
|
|
75
|
+
toren --important-files
|
|
76
|
+
toren --health
|
|
72
77
|
|
|
73
78
|
# Lifecycle & Help Commands
|
|
74
79
|
toren --help
|
|
@@ -88,6 +93,9 @@ toren --uninstall
|
|
|
88
93
|
| `--structure` | Show repository structure only. |
|
|
89
94
|
| `--configs` | Show detected project configuration files. |
|
|
90
95
|
| `--scripts` | Show available package scripts only. |
|
|
96
|
+
| `--summary` | Show project summary only. |
|
|
97
|
+
| `--important-files` | Show important files only. |
|
|
98
|
+
| `--health` | Show project health observations only. |
|
|
91
99
|
| `--format <type>` | Output format: `console` (default), `json`, `markdown`, `html`. |
|
|
92
100
|
| `--include-hidden` | Include hidden files and dot-directories in the scan. |
|
|
93
101
|
| `--max-files <n>` | Override the default 50,000-file scan limit. |
|
|
@@ -97,7 +105,7 @@ toren --uninstall
|
|
|
97
105
|
| `--uninstall` | Safely remove Toren from the global npm environment. |
|
|
98
106
|
|
|
99
107
|
> **Note:** `--format md` is not a valid alias. Use `--format markdown` in full.
|
|
100
|
-
> **Note:** Focused output flags
|
|
108
|
+
> **Note:** Focused output flags are mutually exclusive.
|
|
101
109
|
|
|
102
110
|
---
|
|
103
111
|
|
|
@@ -107,7 +115,7 @@ toren --uninstall
|
|
|
107
115
|
The default `console` format renders a beautiful summary directly in your terminal:
|
|
108
116
|
|
|
109
117
|
```text
|
|
110
|
-
Toren v1.0.
|
|
118
|
+
Toren v1.0.7 — Fast Repository Discovery CLI
|
|
111
119
|
|
|
112
120
|
Project Summary
|
|
113
121
|
───────────────
|
|
@@ -153,25 +161,6 @@ Project Type
|
|
|
153
161
|
|
|
154
162
|
Node.js / JavaScript
|
|
155
163
|
|
|
156
|
-
$ toren --frameworks
|
|
157
|
-
Frameworks
|
|
158
|
-
──────────
|
|
159
|
-
|
|
160
|
-
React
|
|
161
|
-
|
|
162
|
-
$ toren --entry-points
|
|
163
|
-
Entry Points
|
|
164
|
-
────────────
|
|
165
|
-
|
|
166
|
-
src/main.tsx
|
|
167
|
-
|
|
168
|
-
$ toren --configs
|
|
169
|
-
Configuration Files
|
|
170
|
-
───────────────────
|
|
171
|
-
|
|
172
|
-
package.json
|
|
173
|
-
vite.config.ts
|
|
174
|
-
|
|
175
164
|
$ toren --scripts
|
|
176
165
|
Package Scripts
|
|
177
166
|
───────────────
|
|
@@ -185,19 +174,54 @@ Generate machine-readable output for scripts, toolchains, or AI context windows
|
|
|
185
174
|
|
|
186
175
|
```json
|
|
187
176
|
{
|
|
177
|
+
"meta": {
|
|
178
|
+
"version": "1.0.7",
|
|
179
|
+
"scanDurationMs": 4,
|
|
180
|
+
"timestamp": "2026-08-29T23:51:00.000Z"
|
|
181
|
+
},
|
|
188
182
|
"project": {
|
|
183
|
+
"name": "my-react-app",
|
|
189
184
|
"path": "./my-react-app",
|
|
190
185
|
"type": "React",
|
|
191
|
-
"framework": "React"
|
|
192
|
-
|
|
193
|
-
"summary": {
|
|
194
|
-
"totalFiles": 32,
|
|
195
|
-
"totalFolders": 6,
|
|
196
|
-
"scanDurationMs": 4
|
|
186
|
+
"framework": "React",
|
|
187
|
+
"packageManager": "npm"
|
|
197
188
|
},
|
|
189
|
+
"frameworks": [
|
|
190
|
+
"React"
|
|
191
|
+
],
|
|
198
192
|
"entryPoints": [
|
|
199
193
|
"src/main.tsx"
|
|
200
194
|
],
|
|
195
|
+
"configs": [
|
|
196
|
+
"package.json",
|
|
197
|
+
"vite.config.ts"
|
|
198
|
+
],
|
|
199
|
+
"scripts": [
|
|
200
|
+
{
|
|
201
|
+
"name": "start",
|
|
202
|
+
"command": "vite",
|
|
203
|
+
"description": "Start the development server",
|
|
204
|
+
"category": "development",
|
|
205
|
+
"usage": "npm start"
|
|
206
|
+
}
|
|
207
|
+
],
|
|
208
|
+
"importantFiles": [
|
|
209
|
+
{
|
|
210
|
+
"path": "package.json",
|
|
211
|
+
"reason": "Defines dependencies"
|
|
212
|
+
}
|
|
213
|
+
],
|
|
214
|
+
"health": [
|
|
215
|
+
{
|
|
216
|
+
"id": "readme",
|
|
217
|
+
"status": "pass",
|
|
218
|
+
"message": "README file is present"
|
|
219
|
+
}
|
|
220
|
+
],
|
|
221
|
+
"statistics": {
|
|
222
|
+
"totalFiles": 32,
|
|
223
|
+
"totalFolders": 6
|
|
224
|
+
},
|
|
201
225
|
"structure": [
|
|
202
226
|
{
|
|
203
227
|
"type": "folder",
|
|
@@ -208,7 +232,12 @@ Generate machine-readable output for scripts, toolchains, or AI context windows
|
|
|
208
232
|
]
|
|
209
233
|
},
|
|
210
234
|
{ "type": "file", "name": "package.json" }
|
|
211
|
-
]
|
|
235
|
+
],
|
|
236
|
+
"summary": {
|
|
237
|
+
"totalFiles": 32,
|
|
238
|
+
"totalFolders": 6,
|
|
239
|
+
"scanDurationMs": 4
|
|
240
|
+
}
|
|
212
241
|
}
|
|
213
242
|
```
|
|
214
243
|
|
|
@@ -218,6 +247,12 @@ Generate machine-readable output for scripts, toolchains, or AI context windows
|
|
|
218
247
|
|
|
219
248
|
## Release Notes
|
|
220
249
|
|
|
250
|
+
### v1.0.7 - Intelligence Upgrade
|
|
251
|
+
- **Project Intelligence Upgrade**: Added Package Manager detection, project metadata extraction (name, language, runtime, architecture), and important file detection.
|
|
252
|
+
- **Project Health Checks**: New `--health` flag to evaluate repository health (checking for README, License, linting, tests, docker files).
|
|
253
|
+
- **Richer Output Formats**: Expanded HTML and Markdown renderers to include the newly extracted project details, ensuring a highly readable and comprehensive project overview.
|
|
254
|
+
- **Enhanced JSON schema**: Output JSON schema has been substantially updated to support these rich data properties in a deterministic order.
|
|
255
|
+
|
|
221
256
|
### v1.0.6 - CLI Experience Update
|
|
222
257
|
- **Redesigned CLI Output**: Completely revamped the console layout to use minimal typography, bold section titles, and dynamic divider lines matching the title width.
|
|
223
258
|
- **Improved Error Handling**: Transformed raw exceptions into user-friendly error messages outlining the issue and potential fixes, ensuring consistent exit codes.
|
|
@@ -273,6 +308,60 @@ Contributions to improve this codebase analyzer CLI are always welcome!
|
|
|
273
308
|
|
|
274
309
|
---
|
|
275
310
|
|
|
311
|
+
## Maintainer: Releasing a New Version
|
|
312
|
+
|
|
313
|
+
Toren uses **automated npm publishing via GitHub Actions** and [npm Trusted Publishing (OIDC)](https://docs.npmjs.com/generating-provenance-statements).
|
|
314
|
+
**Do not run `npm publish` manually** — GitHub Actions owns the publish step.
|
|
315
|
+
|
|
316
|
+
### Release checklist
|
|
317
|
+
|
|
318
|
+
```text
|
|
319
|
+
1. Implement changes on a feature branch.
|
|
320
|
+
|
|
321
|
+
2. Update the version in package.json:
|
|
322
|
+
"version": "1.0.8"
|
|
323
|
+
|
|
324
|
+
3. Run tests and lint locally:
|
|
325
|
+
npm test
|
|
326
|
+
npm run lint
|
|
327
|
+
|
|
328
|
+
4. Commit the version bump and any other changes:
|
|
329
|
+
git commit -m "chore: release v1.0.8"
|
|
330
|
+
|
|
331
|
+
5. Open a Pull Request → merge to main.
|
|
332
|
+
|
|
333
|
+
6. On GitHub, create a new Release:
|
|
334
|
+
Tag: v1.0.8 ← must match package.json exactly (with leading v)
|
|
335
|
+
Title: v1.0.8
|
|
336
|
+
Body: paste CHANGELOG.md entry
|
|
337
|
+
|
|
338
|
+
7. Click "Publish Release".
|
|
339
|
+
|
|
340
|
+
8. GitHub Actions runs automatically:
|
|
341
|
+
✔ npm ci
|
|
342
|
+
✔ npm test (all 233+ tests must pass)
|
|
343
|
+
✔ npm run lint
|
|
344
|
+
✔ tag format validated (vX.Y.Z)
|
|
345
|
+
✔ tag v1.0.8 == package.json 1.0.8
|
|
346
|
+
✔ npm pack --dry-run
|
|
347
|
+
✔ npm publish --access public --provenance
|
|
348
|
+
|
|
349
|
+
9. @lakindudev/toren@1.0.8 is live on npmjs.com.
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
### If the workflow fails
|
|
353
|
+
|
|
354
|
+
| Failure step | Cause | Fix |
|
|
355
|
+
|---|---|---|
|
|
356
|
+
| Run tests | A test is failing | Fix the test, push, re-create release |
|
|
357
|
+
| Run lint | Syntax error in source | Fix lint error, push, re-create release |
|
|
358
|
+
| Validate tag format | Tag is not `vX.Y.Z` | Delete the release, re-create with correct tag |
|
|
359
|
+
| Verify version matches | `package.json` not bumped | Update `package.json`, push, re-create release |
|
|
360
|
+
| Verify package contents | `files` array misconfigured | Fix `package.json`, push, re-create release |
|
|
361
|
+
| Publish to npm | Trusted Publisher not configured | Follow the npm Trusted Publisher setup in `.github/workflows/publish.yml` header |
|
|
362
|
+
|
|
363
|
+
---
|
|
364
|
+
|
|
276
365
|
## License
|
|
277
366
|
|
|
278
367
|
Distributed under the MIT License. See `LICENSE` for more information.
|
package/bin/toren.js
CHANGED
|
@@ -70,6 +70,9 @@ Fast Repository Discovery CLI
|
|
|
70
70
|
--structure Show repository structure only
|
|
71
71
|
--configs Show detected project configuration files
|
|
72
72
|
--scripts Show available package scripts only
|
|
73
|
+
--summary Show project summary only
|
|
74
|
+
--important-files Show important files only
|
|
75
|
+
--health Show project health observations only
|
|
73
76
|
--include-hidden Include hidden files and folders
|
|
74
77
|
--max-files <n> Set scan file limit
|
|
75
78
|
--doctor Run CLI diagnostics
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lakindu_perera/toren",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "A powerful codebase scanner CLI tool for project analysis, framework detection, and understanding repository structure instantly.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -10,12 +10,16 @@
|
|
|
10
10
|
"bin",
|
|
11
11
|
"src",
|
|
12
12
|
"LICENSE",
|
|
13
|
-
"README.md"
|
|
13
|
+
"README.md",
|
|
14
|
+
"CHANGELOG.md"
|
|
14
15
|
],
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public"
|
|
18
|
+
},
|
|
15
19
|
"scripts": {
|
|
16
20
|
"start": "node bin/toren.js",
|
|
17
21
|
"test": "node --test",
|
|
18
|
-
"lint": "node --check bin/toren.js src/scanner/scan.js src/lifecycle.js src/renderers/index.js src/renderers/console-renderer.js src/renderers/json-renderer.js src/renderers/markdown-renderer.js src/renderers/html-renderer.js"
|
|
22
|
+
"lint": "node --check bin/toren.js src/scanner/scan.js src/lifecycle.js src/renderers/index.js src/renderers/console-renderer.js src/renderers/json-renderer.js src/renderers/markdown-renderer.js src/renderers/html-renderer.js src/detectors/config-detector.js src/detectors/script-detector.js src/detectors/package-manager-detector.js"
|
|
19
23
|
},
|
|
20
24
|
"keywords": [
|
|
21
25
|
"cli tool",
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Detect project health observations.
|
|
3
|
+
*/
|
|
4
|
+
export function detectHealth({
|
|
5
|
+
flatFiles,
|
|
6
|
+
configs,
|
|
7
|
+
importantFiles,
|
|
8
|
+
scripts,
|
|
9
|
+
projectType
|
|
10
|
+
}) {
|
|
11
|
+
const health = [];
|
|
12
|
+
const fileSet = new Set(flatFiles);
|
|
13
|
+
|
|
14
|
+
// README
|
|
15
|
+
if (fileSet.has('README.md') || fileSet.has('README') || fileSet.has('readme.md')) {
|
|
16
|
+
health.push({ id: 'readme', status: 'pass', message: 'README found' });
|
|
17
|
+
} else {
|
|
18
|
+
health.push({ id: 'readme', status: 'warning', message: 'README not found' });
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// LICENSE
|
|
22
|
+
if (fileSet.has('LICENSE') || fileSet.has('LICENSE.md') || fileSet.has('LICENSE.txt')) {
|
|
23
|
+
health.push({ id: 'license', status: 'pass', message: 'LICENSE found' });
|
|
24
|
+
} else {
|
|
25
|
+
health.push({ id: 'license', status: 'warning', message: 'LICENSE not found' });
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// ENVIRONMENT EXAMPLE
|
|
29
|
+
if (fileSet.has('.env.example') || fileSet.has('.env.sample')) {
|
|
30
|
+
health.push({ id: 'env-example', status: 'pass', message: 'Environment example found' });
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// TESTS
|
|
34
|
+
const hasTestFiles = flatFiles.some(f =>
|
|
35
|
+
f.startsWith('test/') ||
|
|
36
|
+
f.startsWith('tests/') ||
|
|
37
|
+
f.startsWith('__tests__/') ||
|
|
38
|
+
f.includes('.test.') ||
|
|
39
|
+
f.includes('.spec.')
|
|
40
|
+
);
|
|
41
|
+
const hasTestScripts = (scripts || []).some(s => s.category === 'testing' || s.name === 'test');
|
|
42
|
+
if (hasTestFiles || hasTestScripts) {
|
|
43
|
+
health.push({ id: 'tests', status: 'pass', message: 'Tests detected' });
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// LINTER
|
|
47
|
+
const hasLinter = (configs || []).some(c =>
|
|
48
|
+
c.includes('eslint') ||
|
|
49
|
+
c.includes('biome') ||
|
|
50
|
+
c.includes('stylelint')
|
|
51
|
+
) || (scripts || []).some(s => s.category === 'quality' || s.name === 'lint');
|
|
52
|
+
if (hasLinter) {
|
|
53
|
+
health.push({ id: 'lint', status: 'pass', message: 'Linter detected' });
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// TYPESCRIPT
|
|
57
|
+
if (fileSet.has('tsconfig.json')) {
|
|
58
|
+
health.push({ id: 'typescript', status: 'pass', message: 'TypeScript configuration found' });
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// GIT
|
|
62
|
+
if (fileSet.has('.gitignore')) {
|
|
63
|
+
health.push({ id: 'git', status: 'info', message: '.gitignore found' });
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// DOCKER
|
|
67
|
+
if (fileSet.has('Dockerfile') || fileSet.has('docker-compose.yml') || fileSet.has('compose.yml')) {
|
|
68
|
+
health.push({ id: 'docker', status: 'info', message: 'Docker configuration found' });
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return { health };
|
|
72
|
+
}
|