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
package/dist/index.js
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Command } from 'commander';
|
|
3
|
+
import { readFile } from 'fs/promises';
|
|
4
|
+
import { resolve, dirname } from 'path';
|
|
5
|
+
import { fileURLToPath } from 'url';
|
|
6
|
+
import { DocumentationLoader } from './services/loader.js';
|
|
7
|
+
import { Searcher } from './services/searcher.js';
|
|
8
|
+
import { Formatter } from './services/formatter.js';
|
|
9
|
+
// Get package.json for version
|
|
10
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
11
|
+
const __dirname = dirname(__filename);
|
|
12
|
+
const packageJsonPath = resolve(__dirname, '../package.json');
|
|
13
|
+
async function getVersion() {
|
|
14
|
+
try {
|
|
15
|
+
const content = await readFile(packageJsonPath, 'utf-8');
|
|
16
|
+
const pkg = JSON.parse(content);
|
|
17
|
+
return pkg.version || '1.0.0';
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
return '1.0.0';
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
async function main() {
|
|
24
|
+
const version = await getVersion();
|
|
25
|
+
const program = new Command();
|
|
26
|
+
program
|
|
27
|
+
.name('ng-explorer')
|
|
28
|
+
.description('Search and explore Angular components, services, directives, etc.')
|
|
29
|
+
.version(version)
|
|
30
|
+
.argument('[query]', 'Search query (optional - omit to list all)')
|
|
31
|
+
.option('-d, --doc-path <path>', 'Path to documentation.json file', './documentation.json')
|
|
32
|
+
.option('-t, --type <type>', 'Filter by type (component, injectable, directive, pipe, module, class, all)', 'all')
|
|
33
|
+
.option('-p, --path <pattern>', 'Filter by file path pattern (supports wildcards like apps/web/**)')
|
|
34
|
+
.option('-l, --limit <number>', 'Limit number of results', '50')
|
|
35
|
+
.option('-v, --verbose', 'Show full API details for each result')
|
|
36
|
+
.option('-e, --exact', 'Use exact name matching instead of fuzzy search')
|
|
37
|
+
.action(async (query, options) => {
|
|
38
|
+
try {
|
|
39
|
+
// Validate type option
|
|
40
|
+
const validTypes = [
|
|
41
|
+
'component',
|
|
42
|
+
'injectable',
|
|
43
|
+
'directive',
|
|
44
|
+
'pipe',
|
|
45
|
+
'module',
|
|
46
|
+
'class',
|
|
47
|
+
'all',
|
|
48
|
+
];
|
|
49
|
+
if (!validTypes.includes(options.type)) {
|
|
50
|
+
console.error(`Invalid type: ${options.type}. Valid types: ${validTypes.join(', ')}`);
|
|
51
|
+
process.exit(1);
|
|
52
|
+
}
|
|
53
|
+
// Load documentation
|
|
54
|
+
const loader = new DocumentationLoader(options.docPath);
|
|
55
|
+
const data = await loader.load();
|
|
56
|
+
// Search or list
|
|
57
|
+
const searcher = new Searcher(data);
|
|
58
|
+
const limit = parseInt(options.limit, 10);
|
|
59
|
+
let results;
|
|
60
|
+
if (query) {
|
|
61
|
+
// Search with query
|
|
62
|
+
if (options.exact) {
|
|
63
|
+
// Exact name matching
|
|
64
|
+
results = searcher.searchExact(query, options.type, options.path, limit);
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
// Fuzzy search
|
|
68
|
+
results = searcher.search(query, options.type, options.path, limit);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
// List all (no query)
|
|
73
|
+
results = searcher.listByType(options.type, options.path, limit);
|
|
74
|
+
}
|
|
75
|
+
// Format and display results
|
|
76
|
+
const formatter = new Formatter();
|
|
77
|
+
if (options.verbose) {
|
|
78
|
+
// Show full API details for each result
|
|
79
|
+
results.forEach((result, index) => {
|
|
80
|
+
if (index > 0) {
|
|
81
|
+
console.log('\n' + '─'.repeat(80) + '\n');
|
|
82
|
+
}
|
|
83
|
+
console.log(formatter.formatApiDetails(result));
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
// Show list view
|
|
88
|
+
console.log(formatter.formatSearchResults(results));
|
|
89
|
+
}
|
|
90
|
+
// Show count
|
|
91
|
+
if (results.length > 0) {
|
|
92
|
+
if (!query) {
|
|
93
|
+
// When listing (no query), show total count
|
|
94
|
+
const totalCount = searcher.getCountByType(options.type, options.path);
|
|
95
|
+
if (results.length < totalCount) {
|
|
96
|
+
console.log(`\nShowing ${results.length} of ${totalCount} result(s). Use --limit to show more.`);
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
console.log(`\nFound ${results.length} result(s)`);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
// When searching with query, just show count
|
|
104
|
+
console.log(`\nFound ${results.length} result(s)`);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
catch (error) {
|
|
109
|
+
if (error instanceof Error) {
|
|
110
|
+
console.error(`Error: ${error.message}`);
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
console.error('An unexpected error occurred');
|
|
114
|
+
}
|
|
115
|
+
process.exit(1);
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
// Parse and execute
|
|
119
|
+
await program.parseAsync(process.argv);
|
|
120
|
+
}
|
|
121
|
+
main().catch((error) => {
|
|
122
|
+
console.error('Fatal error:', error.message);
|
|
123
|
+
process.exit(1);
|
|
124
|
+
});
|
|
125
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,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,CAAC,MAAM,YAAY,CAAC,CAAC;gBACrD,CAAC;YACH,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;gBAC3B,OAAO,CAAC,KAAK,CAAC,UAAU,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;YAC3C,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAC;YAChD,CAAC;YACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;IAEL,oBAAoB;IACpB,MAAM,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACzC,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IAC7C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { AngularConstruct } from '../types/compodoc.js';
|
|
2
|
+
/**
|
|
3
|
+
* Formatter service for displaying search results and API details
|
|
4
|
+
*/
|
|
5
|
+
export declare class Formatter {
|
|
6
|
+
/**
|
|
7
|
+
* Format search results as a list
|
|
8
|
+
*/
|
|
9
|
+
formatSearchResults(results: AngularConstruct[]): string;
|
|
10
|
+
/**
|
|
11
|
+
* Format API details for a construct
|
|
12
|
+
*/
|
|
13
|
+
formatApiDetails(construct: AngularConstruct): string;
|
|
14
|
+
/**
|
|
15
|
+
* Format component-specific details
|
|
16
|
+
*/
|
|
17
|
+
private formatComponentDetails;
|
|
18
|
+
/**
|
|
19
|
+
* Format injectable (service) details
|
|
20
|
+
*/
|
|
21
|
+
private formatInjectableDetails;
|
|
22
|
+
/**
|
|
23
|
+
* Format directive details
|
|
24
|
+
*/
|
|
25
|
+
private formatDirectiveDetails;
|
|
26
|
+
/**
|
|
27
|
+
* Format pipe details
|
|
28
|
+
*/
|
|
29
|
+
private formatPipeDetails;
|
|
30
|
+
/**
|
|
31
|
+
* Format module details
|
|
32
|
+
*/
|
|
33
|
+
private formatModuleDetails;
|
|
34
|
+
/**
|
|
35
|
+
* Format inputs
|
|
36
|
+
*/
|
|
37
|
+
private formatInputs;
|
|
38
|
+
/**
|
|
39
|
+
* Format outputs
|
|
40
|
+
*/
|
|
41
|
+
private formatOutputs;
|
|
42
|
+
/**
|
|
43
|
+
* Format properties
|
|
44
|
+
*/
|
|
45
|
+
private formatProperties;
|
|
46
|
+
/**
|
|
47
|
+
* Format methods
|
|
48
|
+
*/
|
|
49
|
+
private formatMethods;
|
|
50
|
+
/**
|
|
51
|
+
* Format constructor
|
|
52
|
+
*/
|
|
53
|
+
private formatConstructor;
|
|
54
|
+
/**
|
|
55
|
+
* Get selector or pipe name value (unformatted)
|
|
56
|
+
*/
|
|
57
|
+
private getSelectorValue;
|
|
58
|
+
/**
|
|
59
|
+
* Format construct type as a tag [type]
|
|
60
|
+
*/
|
|
61
|
+
private formatTypeTag;
|
|
62
|
+
/**
|
|
63
|
+
* Format description for list display
|
|
64
|
+
*/
|
|
65
|
+
private formatDescription;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=formatter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatter.d.ts","sourceRoot":"","sources":["../../src/services/formatter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,gBAAgB,EASjB,MAAM,sBAAsB,CAAC;AAS9B;;GAEG;AACH,qBAAa,SAAS;IACpB;;OAEG;IACH,mBAAmB,CAAC,OAAO,EAAE,gBAAgB,EAAE,GAAG,MAAM;IAuCxD;;OAEG;IACH,gBAAgB,CAAC,SAAS,EAAE,gBAAgB,GAAG,MAAM;IAqCrD;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAgD9B;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAwB/B;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAoC9B;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAkBzB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IA0B3B;;OAEG;IACH,OAAO,CAAC,YAAY;IAUpB;;OAEG;IACH,OAAO,CAAC,aAAa;IAUrB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAWxB;;OAEG;IACH,OAAO,CAAC,aAAa;IAarB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAazB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAUxB;;OAEG;IACH,OAAO,CAAC,aAAa;IAcrB;;OAEG;IACH,OAAO,CAAC,iBAAiB;CAW1B"}
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import { isComponent, isInjectable, isDirective, isPipe, isModule, } from '../types/compodoc.js';
|
|
3
|
+
/**
|
|
4
|
+
* Formatter service for displaying search results and API details
|
|
5
|
+
*/
|
|
6
|
+
export class Formatter {
|
|
7
|
+
/**
|
|
8
|
+
* Format search results as a list
|
|
9
|
+
*/
|
|
10
|
+
formatSearchResults(results) {
|
|
11
|
+
if (results.length === 0) {
|
|
12
|
+
return chalk.yellow('No results found.');
|
|
13
|
+
}
|
|
14
|
+
const lines = [];
|
|
15
|
+
for (const result of results) {
|
|
16
|
+
// First line: [type] Name
|
|
17
|
+
const type = this.formatTypeTag(result.type);
|
|
18
|
+
const name = result.deprecated
|
|
19
|
+
? chalk.yellow.bold(`${result.name} (deprecated)`)
|
|
20
|
+
: chalk.bold.white(result.name);
|
|
21
|
+
lines.push(`${type} ${name}`);
|
|
22
|
+
// Second line: file path
|
|
23
|
+
const filePath = result.file.replace(/^\.\//, '');
|
|
24
|
+
lines.push(chalk.dim(` File: ${filePath}`));
|
|
25
|
+
// Third line: selector (if available)
|
|
26
|
+
const selector = this.getSelectorValue(result);
|
|
27
|
+
if (selector) {
|
|
28
|
+
lines.push(chalk.cyan(` Selector: ${selector}`));
|
|
29
|
+
}
|
|
30
|
+
// Fourth line: description (if available)
|
|
31
|
+
if (result.rawdescription) {
|
|
32
|
+
const description = this.formatDescription(result.rawdescription);
|
|
33
|
+
lines.push(chalk.gray(` ${description}`));
|
|
34
|
+
}
|
|
35
|
+
// Empty line between results
|
|
36
|
+
lines.push('');
|
|
37
|
+
}
|
|
38
|
+
return lines.join('\n');
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Format API details for a construct
|
|
42
|
+
*/
|
|
43
|
+
formatApiDetails(construct) {
|
|
44
|
+
const sections = [];
|
|
45
|
+
// Header
|
|
46
|
+
sections.push(chalk.bold.green(construct.name));
|
|
47
|
+
sections.push(chalk.gray(`File: ${construct.file}`));
|
|
48
|
+
sections.push(chalk.gray(`Type: ${construct.type}`));
|
|
49
|
+
if (construct.deprecated) {
|
|
50
|
+
sections.push(chalk.yellow(`⚠️ Deprecated${construct.deprecationMessage ? `: ${construct.deprecationMessage}` : ''}`));
|
|
51
|
+
}
|
|
52
|
+
if (construct.rawdescription) {
|
|
53
|
+
sections.push('');
|
|
54
|
+
sections.push(chalk.white(construct.rawdescription.trim()));
|
|
55
|
+
}
|
|
56
|
+
// Type-specific sections
|
|
57
|
+
if (isComponent(construct)) {
|
|
58
|
+
sections.push(...this.formatComponentDetails(construct));
|
|
59
|
+
}
|
|
60
|
+
else if (isInjectable(construct)) {
|
|
61
|
+
sections.push(...this.formatInjectableDetails(construct));
|
|
62
|
+
}
|
|
63
|
+
else if (isDirective(construct)) {
|
|
64
|
+
sections.push(...this.formatDirectiveDetails(construct));
|
|
65
|
+
}
|
|
66
|
+
else if (isPipe(construct)) {
|
|
67
|
+
sections.push(...this.formatPipeDetails(construct));
|
|
68
|
+
}
|
|
69
|
+
else if (isModule(construct)) {
|
|
70
|
+
sections.push(...this.formatModuleDetails(construct));
|
|
71
|
+
}
|
|
72
|
+
return sections.join('\n');
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Format component-specific details
|
|
76
|
+
*/
|
|
77
|
+
formatComponentDetails(component) {
|
|
78
|
+
const sections = [];
|
|
79
|
+
if (component.selector) {
|
|
80
|
+
sections.push('');
|
|
81
|
+
sections.push(chalk.cyan('Selector:'));
|
|
82
|
+
sections.push(` ${component.selector}`);
|
|
83
|
+
}
|
|
84
|
+
sections.push('');
|
|
85
|
+
sections.push(chalk.cyan('Standalone:'), component.standalone ? chalk.green('Yes') : chalk.gray('No'));
|
|
86
|
+
if (component.inputsClass && component.inputsClass.length > 0) {
|
|
87
|
+
sections.push('');
|
|
88
|
+
sections.push(chalk.cyan('Inputs:'));
|
|
89
|
+
sections.push(this.formatInputs(component.inputsClass));
|
|
90
|
+
}
|
|
91
|
+
if (component.outputsClass && component.outputsClass.length > 0) {
|
|
92
|
+
sections.push('');
|
|
93
|
+
sections.push(chalk.cyan('Outputs:'));
|
|
94
|
+
sections.push(this.formatOutputs(component.outputsClass));
|
|
95
|
+
}
|
|
96
|
+
if (component.propertiesClass && component.propertiesClass.length > 0) {
|
|
97
|
+
sections.push('');
|
|
98
|
+
sections.push(chalk.cyan('Properties:'));
|
|
99
|
+
sections.push(this.formatProperties(component.propertiesClass));
|
|
100
|
+
}
|
|
101
|
+
if (component.methodsClass && component.methodsClass.length > 0) {
|
|
102
|
+
sections.push('');
|
|
103
|
+
sections.push(chalk.cyan('Methods:'));
|
|
104
|
+
sections.push(this.formatMethods(component.methodsClass));
|
|
105
|
+
}
|
|
106
|
+
if (component.constructorObj) {
|
|
107
|
+
sections.push('');
|
|
108
|
+
sections.push(chalk.cyan('Constructor:'));
|
|
109
|
+
sections.push(this.formatConstructor(component.constructorObj));
|
|
110
|
+
}
|
|
111
|
+
return sections;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Format injectable (service) details
|
|
115
|
+
*/
|
|
116
|
+
formatInjectableDetails(injectable) {
|
|
117
|
+
const sections = [];
|
|
118
|
+
if (injectable.properties && injectable.properties.length > 0) {
|
|
119
|
+
sections.push('');
|
|
120
|
+
sections.push(chalk.cyan('Properties:'));
|
|
121
|
+
sections.push(this.formatProperties(injectable.properties));
|
|
122
|
+
}
|
|
123
|
+
if (injectable.methods && injectable.methods.length > 0) {
|
|
124
|
+
sections.push('');
|
|
125
|
+
sections.push(chalk.cyan('Methods:'));
|
|
126
|
+
sections.push(this.formatMethods(injectable.methods));
|
|
127
|
+
}
|
|
128
|
+
if (injectable.constructorObj) {
|
|
129
|
+
sections.push('');
|
|
130
|
+
sections.push(chalk.cyan('Constructor Dependencies:'));
|
|
131
|
+
sections.push(this.formatConstructor(injectable.constructorObj));
|
|
132
|
+
}
|
|
133
|
+
return sections;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Format directive details
|
|
137
|
+
*/
|
|
138
|
+
formatDirectiveDetails(directive) {
|
|
139
|
+
const sections = [];
|
|
140
|
+
if (directive.selector) {
|
|
141
|
+
sections.push('');
|
|
142
|
+
sections.push(chalk.cyan('Selector:'));
|
|
143
|
+
sections.push(` ${directive.selector}`);
|
|
144
|
+
}
|
|
145
|
+
sections.push('');
|
|
146
|
+
sections.push(chalk.cyan('Standalone:'), directive.standalone ? chalk.green('Yes') : chalk.gray('No'));
|
|
147
|
+
if (directive.inputsClass && directive.inputsClass.length > 0) {
|
|
148
|
+
sections.push('');
|
|
149
|
+
sections.push(chalk.cyan('Inputs:'));
|
|
150
|
+
sections.push(this.formatInputs(directive.inputsClass));
|
|
151
|
+
}
|
|
152
|
+
if (directive.outputsClass && directive.outputsClass.length > 0) {
|
|
153
|
+
sections.push('');
|
|
154
|
+
sections.push(chalk.cyan('Outputs:'));
|
|
155
|
+
sections.push(this.formatOutputs(directive.outputsClass));
|
|
156
|
+
}
|
|
157
|
+
if (directive.methodsClass && directive.methodsClass.length > 0) {
|
|
158
|
+
sections.push('');
|
|
159
|
+
sections.push(chalk.cyan('Methods:'));
|
|
160
|
+
sections.push(this.formatMethods(directive.methodsClass));
|
|
161
|
+
}
|
|
162
|
+
return sections;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Format pipe details
|
|
166
|
+
*/
|
|
167
|
+
formatPipeDetails(pipe) {
|
|
168
|
+
const sections = [];
|
|
169
|
+
if (pipe.pipeName) {
|
|
170
|
+
sections.push('');
|
|
171
|
+
sections.push(chalk.cyan('Pipe Name:'));
|
|
172
|
+
sections.push(` ${pipe.pipeName}`);
|
|
173
|
+
}
|
|
174
|
+
sections.push('');
|
|
175
|
+
sections.push(chalk.cyan('Pure:'), pipe.pure !== false ? chalk.green('Yes') : chalk.gray('No'));
|
|
176
|
+
return sections;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Format module details
|
|
180
|
+
*/
|
|
181
|
+
formatModuleDetails(module) {
|
|
182
|
+
const sections = [];
|
|
183
|
+
if (module.declarations && module.declarations.length > 0) {
|
|
184
|
+
sections.push('');
|
|
185
|
+
sections.push(chalk.cyan('Declarations:'));
|
|
186
|
+
sections.push(module.declarations.map((d) => ` • ${d.name}`).join('\n'));
|
|
187
|
+
}
|
|
188
|
+
if (module.imports && module.imports.length > 0) {
|
|
189
|
+
sections.push('');
|
|
190
|
+
sections.push(chalk.cyan('Imports:'));
|
|
191
|
+
sections.push(module.imports.map((i) => ` • ${i.name}`).join('\n'));
|
|
192
|
+
}
|
|
193
|
+
if (module.exports && module.exports.length > 0) {
|
|
194
|
+
sections.push('');
|
|
195
|
+
sections.push(chalk.cyan('Exports:'));
|
|
196
|
+
sections.push(module.exports.map((e) => ` • ${e.name}`).join('\n'));
|
|
197
|
+
}
|
|
198
|
+
return sections;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Format inputs
|
|
202
|
+
*/
|
|
203
|
+
formatInputs(inputs) {
|
|
204
|
+
return inputs
|
|
205
|
+
.map((input) => {
|
|
206
|
+
const deprecated = input.deprecated ? chalk.yellow(' (deprecated)') : '';
|
|
207
|
+
const desc = input.rawdescription ? `\n ${chalk.gray(input.rawdescription.trim())}` : '';
|
|
208
|
+
return ` • ${chalk.green(input.name)}: ${chalk.gray(input.type)}${deprecated}${desc}`;
|
|
209
|
+
})
|
|
210
|
+
.join('\n');
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Format outputs
|
|
214
|
+
*/
|
|
215
|
+
formatOutputs(outputs) {
|
|
216
|
+
return outputs
|
|
217
|
+
.map((output) => {
|
|
218
|
+
const deprecated = output.deprecated ? chalk.yellow(' (deprecated)') : '';
|
|
219
|
+
const desc = output.rawdescription ? `\n ${chalk.gray(output.rawdescription.trim())}` : '';
|
|
220
|
+
return ` • ${chalk.green(output.name)}: ${chalk.gray(output.type)}${deprecated}${desc}`;
|
|
221
|
+
})
|
|
222
|
+
.join('\n');
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Format properties
|
|
226
|
+
*/
|
|
227
|
+
formatProperties(properties) {
|
|
228
|
+
return properties
|
|
229
|
+
.map((prop) => {
|
|
230
|
+
const deprecated = prop.deprecated ? chalk.yellow(' (deprecated)') : '';
|
|
231
|
+
const defaultVal = prop.defaultValue ? ` = ${prop.defaultValue}` : '';
|
|
232
|
+
const desc = prop.rawdescription ? `\n ${chalk.gray(prop.rawdescription.trim())}` : '';
|
|
233
|
+
return ` • ${chalk.green(prop.name)}: ${chalk.gray(prop.type)}${defaultVal}${deprecated}${desc}`;
|
|
234
|
+
})
|
|
235
|
+
.join('\n');
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Format methods
|
|
239
|
+
*/
|
|
240
|
+
formatMethods(methods) {
|
|
241
|
+
return methods
|
|
242
|
+
.map((method) => {
|
|
243
|
+
const args = method.args?.map((arg) => `${arg.name}: ${arg.type}`).join(', ') || '';
|
|
244
|
+
const returnType = method.returnType || 'void';
|
|
245
|
+
const deprecated = method.deprecated ? chalk.yellow(' (deprecated)') : '';
|
|
246
|
+
const desc = method.rawdescription ? `\n ${chalk.gray(method.rawdescription.trim())}` : '';
|
|
247
|
+
return ` • ${chalk.green(method.name)}(${args}): ${chalk.gray(returnType)}${deprecated}${desc}`;
|
|
248
|
+
})
|
|
249
|
+
.join('\n');
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Format constructor
|
|
253
|
+
*/
|
|
254
|
+
formatConstructor(constructor) {
|
|
255
|
+
if (!constructor.args || constructor.args.length === 0) {
|
|
256
|
+
return chalk.gray(' No dependencies');
|
|
257
|
+
}
|
|
258
|
+
return constructor.args
|
|
259
|
+
.map((arg) => ` • ${chalk.green(arg.name)}: ${chalk.gray(arg.type)}`)
|
|
260
|
+
.join('\n');
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Get selector or pipe name value (unformatted)
|
|
264
|
+
*/
|
|
265
|
+
getSelectorValue(construct) {
|
|
266
|
+
if (isComponent(construct) || isDirective(construct)) {
|
|
267
|
+
return construct.selector || '';
|
|
268
|
+
}
|
|
269
|
+
if (isPipe(construct)) {
|
|
270
|
+
return construct.pipeName || '';
|
|
271
|
+
}
|
|
272
|
+
return '';
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Format construct type as a tag [type]
|
|
276
|
+
*/
|
|
277
|
+
formatTypeTag(type) {
|
|
278
|
+
const colors = {
|
|
279
|
+
component: chalk.blue,
|
|
280
|
+
injectable: chalk.magenta,
|
|
281
|
+
directive: chalk.cyan,
|
|
282
|
+
pipe: chalk.yellow,
|
|
283
|
+
module: chalk.green,
|
|
284
|
+
class: chalk.white,
|
|
285
|
+
};
|
|
286
|
+
const color = colors[type] || chalk.white;
|
|
287
|
+
return color(`[${type}]`);
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Format description for list display
|
|
291
|
+
*/
|
|
292
|
+
formatDescription(description) {
|
|
293
|
+
// Take first 2 lines or 200 characters, whichever is shorter
|
|
294
|
+
const lines = description.split('\n').filter(line => line.trim());
|
|
295
|
+
const firstLines = lines.slice(0, 2).join(' ');
|
|
296
|
+
if (firstLines.length > 200) {
|
|
297
|
+
return firstLines.substring(0, 197) + '...';
|
|
298
|
+
}
|
|
299
|
+
return firstLines;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
//# sourceMappingURL=formatter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatter.js","sourceRoot":"","sources":["../../src/services/formatter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAY1B,OAAO,EACL,WAAW,EACX,YAAY,EACZ,WAAW,EACX,MAAM,EACN,QAAQ,GACT,MAAM,sBAAsB,CAAC;AAE9B;;GAEG;AACH,MAAM,OAAO,SAAS;IACpB;;OAEG;IACH,mBAAmB,CAAC,OAA2B;QAC7C,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACzB,OAAO,KAAK,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC;QAC3C,CAAC;QAED,MAAM,KAAK,GAAa,EAAE,CAAC;QAE3B,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;YAC7B,0BAA0B;YAC1B,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YAC7C,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU;gBAC5B,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,IAAI,eAAe,CAAC;gBAClD,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YAElC,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,IAAI,IAAI,EAAE,CAAC,CAAC;YAE9B,yBAAyB;YACzB,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;YAClD,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,QAAQ,E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O,UAAU,CAAC,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,KAAK,CAAC;QAC9C,CAAC;QAED,OAAO,UAAU,CAAC;IACpB,CAAC;CACF"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { CompodocData } from '../types/compodoc.js';
|
|
2
|
+
/**
|
|
3
|
+
* Loader service for Compodoc documentation.json
|
|
4
|
+
* Implements caching to avoid re-reading the file on subsequent calls
|
|
5
|
+
*/
|
|
6
|
+
export declare class DocumentationLoader {
|
|
7
|
+
private cache;
|
|
8
|
+
private docPath;
|
|
9
|
+
constructor(docPath?: string);
|
|
10
|
+
/**
|
|
11
|
+
* Load the documentation.json file
|
|
12
|
+
* Uses cache if available, otherwise reads from disk
|
|
13
|
+
*/
|
|
14
|
+
load(): Promise<CompodocData>;
|
|
15
|
+
/**
|
|
16
|
+
* Clear the cache, forcing a reload on next load() call
|
|
17
|
+
*/
|
|
18
|
+
clearCache(): void;
|
|
19
|
+
/**
|
|
20
|
+
* Get the documentation path being used
|
|
21
|
+
*/
|
|
22
|
+
getDocPath(): string;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/services/loader.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD;;;GAGG;AACH,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,KAAK,CAA6B;IAC1C,OAAO,CAAC,OAAO,CAAS;gBAEZ,OAAO,GAAE,MAA+B;IAIpD;;;OAGG;IACG,IAAI,IAAI,OAAO,CAAC,YAAY,CAAC;IA+BnC;;OAEG;IACH,UAAU,IAAI,IAAI;IAIlB;;OAEG;IACH,UAAU,IAAI,MAAM;CAGrB"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { readFile } from 'fs/promises';
|
|
2
|
+
import { resolve } from 'path';
|
|
3
|
+
/**
|
|
4
|
+
* Loader service for Compodoc documentation.json
|
|
5
|
+
* Implements caching to avoid re-reading the file on subsequent calls
|
|
6
|
+
*/
|
|
7
|
+
export class DocumentationLoader {
|
|
8
|
+
cache = null;
|
|
9
|
+
docPath;
|
|
10
|
+
constructor(docPath = './documentation.json') {
|
|
11
|
+
this.docPath = resolve(process.cwd(), docPath);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Load the documentation.json file
|
|
15
|
+
* Uses cache if available, otherwise reads from disk
|
|
16
|
+
*/
|
|
17
|
+
async load() {
|
|
18
|
+
if (this.cache) {
|
|
19
|
+
return this.cache;
|
|
20
|
+
}
|
|
21
|
+
try {
|
|
22
|
+
const content = await readFile(this.docPath, 'utf-8');
|
|
23
|
+
const data = JSON.parse(content);
|
|
24
|
+
this.cache = data;
|
|
25
|
+
return data;
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
if (error instanceof Error) {
|
|
29
|
+
if ('code' in error && error.code === 'ENOENT') {
|
|
30
|
+
throw new Error(`Documentation file not found at: ${this.docPath}\n\n` +
|
|
31
|
+
'Please run Compodoc to generate the documentation.json file:\n' +
|
|
32
|
+
' npx compodoc -p tsconfig.json -e json -d . --disablePrivate --disableProtected');
|
|
33
|
+
}
|
|
34
|
+
if (error instanceof SyntaxError) {
|
|
35
|
+
throw new Error(`Failed to parse documentation.json at: ${this.docPath}\n` +
|
|
36
|
+
`The file may be corrupted. Error: ${error.message}`);
|
|
37
|
+
}
|
|
38
|
+
throw new Error(`Failed to load documentation: ${error.message}`);
|
|
39
|
+
}
|
|
40
|
+
throw error;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Clear the cache, forcing a reload on next load() call
|
|
45
|
+
*/
|
|
46
|
+
clearCache() {
|
|
47
|
+
this.cache = null;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Get the documentation path being used
|
|
51
|
+
*/
|
|
52
|
+
getDocPath() {
|
|
53
|
+
return this.docPath;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../../src/services/loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAG/B;;;GAGG;AACH,MAAM,OAAO,mBAAmB;IACtB,KAAK,GAAwB,IAAI,CAAC;IAClC,OAAO,CAAS;IAExB,YAAY,UAAkB,sBAAsB;QAClD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,OAAO,CAAC,CAAC;IACjD,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,IAAI;QACR,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YACf,OAAO,IAAI,CAAC,KAAK,CAAC;QACpB,CAAC;QAED,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YACtD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAiB,CAAC;YACjD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;YAClB,OAAO,IAAI,CAAC;QACd,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;gBAC3B,IAAI,MAAM,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;oBAC/C,MAAM,IAAI,KAAK,CACb,oCAAoC,IAAI,CAAC,OAAO,MAAM;wBACpD,gEAAgE;wBAChE,kFAAkF,CACrF,CAAC;gBACJ,CAAC;gBACD,IAAI,KAAK,YAAY,WAAW,EAAE,CAAC;oBACjC,MAAM,IAAI,KAAK,CACb,0CAA0C,IAAI,CAAC,OAAO,IAAI;wBACxD,qCAAqC,KAAK,CAAC,OAAO,EAAE,CACvD,CAAC;gBACJ,CAAC;gBACD,MAAM,IAAI,KAAK,CAAC,iCAAiC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;YACpE,CAAC;YACD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;IAED;;OAEG;IACH,UAAU;QACR,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;IAED;;OAEG;IACH,UAAU;QACR,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;CACF"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { CompodocData, AngularConstruct } from '../types/compodoc.js';
|
|
2
|
+
export type ConstructType = 'component' | 'injectable' | 'directive' | 'pipe' | 'module' | 'class' | 'all';
|
|
3
|
+
/**
|
|
4
|
+
* Searcher service for finding Angular constructs in documentation
|
|
5
|
+
*/
|
|
6
|
+
export declare class Searcher {
|
|
7
|
+
private data;
|
|
8
|
+
private allConstructs;
|
|
9
|
+
private fuse;
|
|
10
|
+
constructor(data: CompodocData);
|
|
11
|
+
/**
|
|
12
|
+
* Strip common Angular suffixes from a name
|
|
13
|
+
*/
|
|
14
|
+
private stripSuffix;
|
|
15
|
+
/**
|
|
16
|
+
* Build search index from all constructs
|
|
17
|
+
*/
|
|
18
|
+
private buildSearchIndex;
|
|
19
|
+
/**
|
|
20
|
+
* Search for constructs by query string
|
|
21
|
+
*/
|
|
22
|
+
search(query: string, type?: ConstructType, pathPattern?: string, limit?: number): AngularConstruct[];
|
|
23
|
+
/**
|
|
24
|
+
* Search for constructs by exact name matching
|
|
25
|
+
*/
|
|
26
|
+
searchExact(query: string, type?: ConstructType, pathPattern?: string, limit?: number): AngularConstruct[];
|
|
27
|
+
/**
|
|
28
|
+
* Find a construct by exact name
|
|
29
|
+
*/
|
|
30
|
+
findByName(name: string, type?: ConstructType): AngularConstruct | null;
|
|
31
|
+
/**
|
|
32
|
+
* List all constructs of a specific type
|
|
33
|
+
*/
|
|
34
|
+
listByType(type: ConstructType, pathPattern?: string, limit?: number): AngularConstruct[];
|
|
35
|
+
/**
|
|
36
|
+
* Get total count of constructs by type (before limit)
|
|
37
|
+
*/
|
|
38
|
+
getCountByType(type: ConstructType, pathPattern?: string): number;
|
|
39
|
+
/**
|
|
40
|
+
* Filter constructs by path pattern
|
|
41
|
+
*/
|
|
42
|
+
private filterByPath;
|
|
43
|
+
/**
|
|
44
|
+
* Get statistics about the documentation
|
|
45
|
+
*/
|
|
46
|
+
getStats(): Record<string, number>;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=searcher.d.ts.map
|