ng-explorer 0.0.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/.claude-plugin/plugin.json +14 -0
- package/LICENSE +674 -0
- package/README.md +140 -0
- package/bin/ng-explorer.js +6 -0
- package/dist/commands/api.d.ts +3 -0
- package/dist/commands/api.d.ts.map +1 -0
- package/dist/commands/api.js +60 -0
- package/dist/commands/api.js.map +1 -0
- package/dist/commands/list.d.ts +3 -0
- package/dist/commands/list.d.ts.map +1 -0
- package/dist/commands/list.js +58 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/commands/search.d.ts +3 -0
- package/dist/commands/search.d.ts.map +1 -0
- package/dist/commands/search.js +97 -0
- package/dist/commands/search.js.map +1 -0
- package/dist/commands/stats.d.ts +3 -0
- package/dist/commands/stats.d.ts.map +1 -0
- package/dist/commands/stats.js +41 -0
- package/dist/commands/stats.js.map +1 -0
- package/dist/commands/usage.d.ts +3 -0
- package/dist/commands/usage.d.ts.map +1 -0
- package/dist/commands/usage.js +110 -0
- package/dist/commands/usage.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +125 -0
- package/dist/index.js.map +1 -0
- package/dist/services/formatter.d.ts +67 -0
- package/dist/services/formatter.d.ts.map +1 -0
- package/dist/services/formatter.js +302 -0
- package/dist/services/formatter.js.map +1 -0
- package/dist/services/loader.d.ts +24 -0
- package/dist/services/loader.d.ts.map +1 -0
- package/dist/services/loader.js +56 -0
- package/dist/services/loader.js.map +1 -0
- package/dist/services/searcher.d.ts +48 -0
- package/dist/services/searcher.d.ts.map +1 -0
- package/dist/services/searcher.js +162 -0
- package/dist/services/searcher.js.map +1 -0
- package/dist/services/usage-finder.d.ts +33 -0
- package/dist/services/usage-finder.d.ts.map +1 -0
- package/dist/services/usage-finder.js +156 -0
- package/dist/services/usage-finder.js.map +1 -0
- package/dist/types/compodoc.d.ts +292 -0
- package/dist/types/compodoc.d.ts.map +1 -0
- package/dist/types/compodoc.js +40 -0
- package/dist/types/compodoc.js.map +1 -0
- package/package.json +54 -0
- package/skills/ng-explorer/SKILL.md +141 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TypeScript type definitions for Compodoc's documentation.json format
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Type guard to check if a construct is a Component
|
|
6
|
+
*/
|
|
7
|
+
export function isComponent(construct) {
|
|
8
|
+
return construct.type === 'component';
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Type guard to check if a construct is an Injectable
|
|
12
|
+
*/
|
|
13
|
+
export function isInjectable(construct) {
|
|
14
|
+
return construct.type === 'injectable';
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Type guard to check if a construct is a Directive
|
|
18
|
+
*/
|
|
19
|
+
export function isDirective(construct) {
|
|
20
|
+
return construct.type === 'directive';
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Type guard to check if a construct is a Pipe
|
|
24
|
+
*/
|
|
25
|
+
export function isPipe(construct) {
|
|
26
|
+
return construct.type === 'pipe';
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Type guard to check if a construct is a Module
|
|
30
|
+
*/
|
|
31
|
+
export function isModule(construct) {
|
|
32
|
+
return construct.type === 'module';
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Type guard to check if a construct is a Class
|
|
36
|
+
*/
|
|
37
|
+
export function isClass(construct) {
|
|
38
|
+
return construct.type === 'class';
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=compodoc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compodoc.js","sourceRoot":"","sources":["../../src/types/compodoc.ts"],"names":[],"mappings":"AAAA;;GAEG;AAiRH;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,SAA2B;IACrD,OAAO,SAAS,CAAC,IAAI,KAAK,WAAW,CAAC;AACxC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,SAA2B;IACtD,OAAO,SAAS,CAAC,IAAI,KAAK,YAAY,CAAC;AACzC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,SAA2B;IACrD,OAAO,SAAS,CAAC,IAAI,KAAK,WAAW,CAAC;AACxC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,MAAM,CAAC,SAA2B;IAChD,OAAO,SAAS,CAAC,IAAI,KAAK,MAAM,CAAC;AACnC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,QAAQ,CAAC,SAA2B;IAClD,OAAO,SAAS,CAAC,IAAI,KAAK,QAAQ,CAAC;AACrC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,OAAO,CAAC,SAA2B;IACjD,OAAO,SAAS,CAAC,IAAI,KAAK,OAAO,CAAC;AACpC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ng-explorer",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "CLI tool to explore Angular components and services using Compodoc documentation",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"packageManager": "pnpm@10.28.1",
|
|
8
|
+
"bin": {
|
|
9
|
+
"ng-explorer": "./bin/ng-explorer.js"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist",
|
|
13
|
+
"bin",
|
|
14
|
+
".claude-plugin",
|
|
15
|
+
"skills"
|
|
16
|
+
],
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "tsc",
|
|
19
|
+
"watch": "tsc --watch",
|
|
20
|
+
"clean": "rm -rf dist"
|
|
21
|
+
},
|
|
22
|
+
"keywords": [
|
|
23
|
+
"angular",
|
|
24
|
+
"cli",
|
|
25
|
+
"compodoc",
|
|
26
|
+
"explorer",
|
|
27
|
+
"documentation",
|
|
28
|
+
"claude-code",
|
|
29
|
+
"claude-plugin"
|
|
30
|
+
],
|
|
31
|
+
"author": "Will Martin",
|
|
32
|
+
"license": "GPL-3.0",
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "git+https://github.com/willmartian/ng-explorer.git"
|
|
36
|
+
},
|
|
37
|
+
"bugs": {
|
|
38
|
+
"url": "https://github.com/willmartian/ng-explorer/issues"
|
|
39
|
+
},
|
|
40
|
+
"homepage": "https://github.com/willmartian/ng-explorer#readme",
|
|
41
|
+
"engines": {
|
|
42
|
+
"node": ">=18.0.0"
|
|
43
|
+
},
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"chalk": "^5.3.0",
|
|
46
|
+
"commander": "^12.0.0",
|
|
47
|
+
"fuse.js": "^7.0.0",
|
|
48
|
+
"minimatch": "^9.0.3"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@types/node": "^20.11.0",
|
|
52
|
+
"typescript": "^5.3.3"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ng-explorer
|
|
3
|
+
description: Search and explore Angular components, services, directives, and other constructs in Angular projects using Compodoc documentation
|
|
4
|
+
argument-hint: [query] [--type component|injectable|directive|pipe|module|class] [--verbose] [--exact]
|
|
5
|
+
allowed-tools: Bash(ng-explorer*)
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# ng-explorer
|
|
9
|
+
|
|
10
|
+
Use the `ng-explorer` CLI to search and explore Angular constructs in the codebase.
|
|
11
|
+
|
|
12
|
+
## Prerequisites
|
|
13
|
+
|
|
14
|
+
The project must have a `documentation.json` file generated by Compodoc. If it doesn't exist, generate it first:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npx compodoc -p tsconfig.json -e json -d . --disablePrivate --disableProtected
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
ng-explorer [query] [options]
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Options
|
|
27
|
+
|
|
28
|
+
- `--type <type>` - Filter by type: component, injectable, directive, pipe, module, class, all (default: all)
|
|
29
|
+
- `--path <pattern>` - Filter by file path pattern (supports wildcards)
|
|
30
|
+
- `--limit <number>` - Limit number of results (default: 50)
|
|
31
|
+
- `--verbose` or `-v` - Show full API details for each result
|
|
32
|
+
- `--exact` or `-e` - Use exact name matching instead of fuzzy search
|
|
33
|
+
- `--doc-path <path>` - Path to documentation.json (default: ./documentation.json)
|
|
34
|
+
|
|
35
|
+
## Common Operations
|
|
36
|
+
|
|
37
|
+
### Search for a construct (fuzzy)
|
|
38
|
+
Fuzzy search automatically strips common Angular suffixes (Component, Service, Directive, Pipe) for better matching.
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
# Search for "Foo" matches FooComponent, FooService, etc.
|
|
42
|
+
ng-explorer foo
|
|
43
|
+
|
|
44
|
+
# Search only components
|
|
45
|
+
ng-explorer foo --type component
|
|
46
|
+
|
|
47
|
+
# Search only services
|
|
48
|
+
ng-explorer bar --type injectable
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Find exact construct by name
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
# Exact name match
|
|
55
|
+
ng-explorer FooComponent --exact
|
|
56
|
+
|
|
57
|
+
# Exact match with verbose output
|
|
58
|
+
ng-explorer BarService --exact --verbose
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### List all constructs of a type
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
# List all components
|
|
65
|
+
ng-explorer --type component
|
|
66
|
+
|
|
67
|
+
# List all services
|
|
68
|
+
ng-explorer --type injectable
|
|
69
|
+
|
|
70
|
+
# List all directives
|
|
71
|
+
ng-explorer --type directive
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### View detailed API information
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
# Show full API details for search results
|
|
78
|
+
ng-explorer foo --verbose
|
|
79
|
+
|
|
80
|
+
# Exact match with full details
|
|
81
|
+
ng-explorer FooComponent --exact --verbose
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Filter by path
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
# Search in specific directory
|
|
88
|
+
ng-explorer foo --path "apps/web/**"
|
|
89
|
+
|
|
90
|
+
# Search in library
|
|
91
|
+
ng-explorer bar --path "libs/common/**"
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Output Formats
|
|
95
|
+
|
|
96
|
+
### List view (default)
|
|
97
|
+
Shows construct type, name, file path, and selector/pipe name in a compact format.
|
|
98
|
+
|
|
99
|
+
### Verbose view (--verbose)
|
|
100
|
+
Shows complete API information:
|
|
101
|
+
- **Components**: selector, standalone status, inputs, outputs, properties, methods, constructor dependencies
|
|
102
|
+
- **Services/Injectables**: properties, methods, constructor dependencies
|
|
103
|
+
- **Directives**: selector, inputs, outputs, methods
|
|
104
|
+
- **Pipes**: pipe name, pure status
|
|
105
|
+
|
|
106
|
+
## How to use this skill
|
|
107
|
+
|
|
108
|
+
When the user asks about Angular components, services, or project structure:
|
|
109
|
+
|
|
110
|
+
1. Use `ng-explorer` to search for relevant constructs
|
|
111
|
+
2. Interpret the results and explain them to the user
|
|
112
|
+
3. Use `--verbose` when the user needs detailed API information
|
|
113
|
+
4. Use `--exact` when you know the precise name
|
|
114
|
+
|
|
115
|
+
## Examples
|
|
116
|
+
|
|
117
|
+
**User asks: "What components do we have for navigation?"**
|
|
118
|
+
```bash
|
|
119
|
+
ng-explorer nav --type component
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
**User asks: "Show me the API for the AuthService"**
|
|
123
|
+
```bash
|
|
124
|
+
ng-explorer AuthService --exact --verbose --type injectable
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
**User asks: "What services are in the common library?"**
|
|
128
|
+
```bash
|
|
129
|
+
ng-explorer --type injectable --path "libs/common/**"
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
**User asks: "Find all directives that handle tooltips"**
|
|
133
|
+
```bash
|
|
134
|
+
ng-explorer tooltip --type directive
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## Notes
|
|
138
|
+
|
|
139
|
+
- Exact search requires the full construct name
|
|
140
|
+
- Results are limited to 50 by default; use `--limit` to show more
|
|
141
|
+
- The tool requires Compodoc documentation to be generated first
|