ghost-import-hunter 2.0.0 → 2.0.2
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 +10 -5
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<img src="https://raw.githubusercontent.com/01Developer95/Ghost-Hunter/main/media/header.png" alt="Ghost Hunter" width="100%">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/01Developer95/Ghost-Import-Hunter/main/media/header.png" alt="Ghost Hunter" width="100%">
|
|
3
3
|
</div>
|
|
4
4
|
|
|
5
5
|
<div align="center">
|
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
## 🚀 Features
|
|
16
16
|
|
|
17
17
|
- **Deterministic Validation** - Verify every import against your actual installed modules. No guessing or regex.
|
|
18
|
+
- **Deep Export Analysis** - Uses TypeScript Compiler API to correctly resolve `export *`, re-exports, and aliases.
|
|
19
|
+
- **Local File Scanning** - Validates imports from your own local files, not just external packages.
|
|
18
20
|
- **Zero Configuration** - Works out of the box. Just run `npx ghost-hunter` in your project root.
|
|
19
21
|
- **CI/CD Ready** - Fails the build if hallucinations are detected. Preventing bad code from merging.
|
|
20
22
|
|
|
@@ -54,9 +56,12 @@ Ghost Hunter uses three core technologies to ensure your code is safe:
|
|
|
54
56
|
**Role:** Finding your files.
|
|
55
57
|
Just like your terminal finds files when you type `ls *.ts`, Ghost Hunter uses `glob` to scan your entire project's TypeScript and JavaScript files, ignoring junk like `node_modules`.
|
|
56
58
|
|
|
57
|
-
### 2.
|
|
58
|
-
**Role:**
|
|
59
|
-
|
|
59
|
+
### 2. TypeScript Compiler API - The Brain
|
|
60
|
+
**Role:** Understanding your code.
|
|
61
|
+
Unlike v1 which used Regex, v2.0 uses the real **TypeScript Compiler API** to parse your code, resolve symbols, and track exports across files. This allows it to:
|
|
62
|
+
- Follow `export * from ...` chains.
|
|
63
|
+
- Understand aliased imports (`import { foo as bar }`).
|
|
64
|
+
- Detect missing exports in local files.
|
|
60
65
|
|
|
61
66
|
### 3. `chalk` - The Reporter
|
|
62
67
|
**Role:** Making sense of the output.
|
|
@@ -167,7 +172,7 @@ Contributions are welcome! Please feel free to submit a Pull Request.
|
|
|
167
172
|
## 📧 Contact
|
|
168
173
|
|
|
169
174
|
- GitHub: [@01Developer95](https://github.com/01Developer95)
|
|
170
|
-
- Repository: [Ghost-Hunter](https://github.com/01Developer95/Ghost-Hunter)
|
|
175
|
+
- Repository: [Ghost-Import-Hunter](https://github.com/01Developer95/Ghost-Import-Hunter)
|
|
171
176
|
|
|
172
177
|
---
|
|
173
178
|
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ghost-import-hunter",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "Deterministic tool to detect AI hallucinations and code bloat by verifying import safety against installed node_modules",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
|
-
"url": "git+https://github.com/01Developer95/Ghost-Hunter.git"
|
|
7
|
+
"url": "git+https://github.com/01Developer95/Ghost-Import-Hunter.git"
|
|
8
8
|
},
|
|
9
9
|
"main": "dist/index.js",
|
|
10
10
|
"bin": {
|
|
@@ -45,4 +45,4 @@
|
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"ts-node": "^10.9.2"
|
|
47
47
|
}
|
|
48
|
-
}
|
|
48
|
+
}
|