@ui-context/parser-angular 0.1.0

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.
@@ -0,0 +1,20 @@
1
+ import type { ComponentParser, ParserOptions, ComponentMetadata } from "@ui-context/core";
2
+ export declare class AngularParser implements ComponentParser {
3
+ name: string;
4
+ supportedExtensions: string[];
5
+ parse(options: ParserOptions): Promise<ComponentMetadata[]>;
6
+ private getDecorator;
7
+ private extractComponent;
8
+ private extractDecoratorProperty;
9
+ private extractInputs;
10
+ private getInputAlias;
11
+ private extractOutputs;
12
+ private extractPublicMethods;
13
+ private buildMethodSignature;
14
+ private extractSlots;
15
+ private getJsDocDescription;
16
+ private findExamples;
17
+ }
18
+ /** Factory function for parser discovery */
19
+ export declare function createParser(): AngularParser;
20
+ //# sourceMappingURL=angular-parser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"angular-parser.d.ts","sourceRoot":"","sources":["../src/angular-parser.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,eAAe,EACf,aAAa,EACb,iBAAiB,EAMlB,MAAM,kBAAkB,CAAC;AAE1B,qBAAa,aAAc,YAAW,eAAe;IACnD,IAAI,SAAa;IACjB,mBAAmB,WAAW;IAExB,KAAK,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAuDjE,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,gBAAgB;IA+BxB,OAAO,CAAC,wBAAwB;IAqBhC,OAAO,CAAC,aAAa;IAkCrB,OAAO,CAAC,aAAa;IAUrB,OAAO,CAAC,cAAc;IAiCtB,OAAO,CAAC,oBAAoB;IAsB5B,OAAO,CAAC,oBAAoB;IAc5B,OAAO,CAAC,YAAY;IAgBpB,OAAO,CAAC,mBAAmB;YAMb,YAAY;CAqC3B;AAED,4CAA4C;AAC5C,wBAAgB,YAAY,IAAI,aAAa,CAE5C"}
@@ -0,0 +1,300 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.AngularParser = void 0;
37
+ exports.createParser = createParser;
38
+ const ts_morph_1 = require("ts-morph");
39
+ const glob_1 = require("glob");
40
+ const fs = __importStar(require("node:fs"));
41
+ const path = __importStar(require("node:path"));
42
+ class AngularParser {
43
+ name = "angular";
44
+ supportedExtensions = [".ts"];
45
+ async parse(options) {
46
+ const { sourcePath, include, exclude } = options;
47
+ const patterns = include ?? ["**/*.component.ts", "**/*.ts"];
48
+ const ignorePatterns = exclude ?? [
49
+ "**/*.spec.ts",
50
+ "**/*.test.ts",
51
+ "**/*.stories.ts",
52
+ "**/node_modules/**",
53
+ "**/__tests__/**",
54
+ "**/*.module.ts",
55
+ "**/*.routing.ts",
56
+ ];
57
+ const files = [];
58
+ for (const pattern of patterns) {
59
+ const matches = await (0, glob_1.glob)(pattern, {
60
+ cwd: sourcePath,
61
+ absolute: true,
62
+ ignore: ignorePatterns,
63
+ });
64
+ files.push(...matches);
65
+ }
66
+ const project = new ts_morph_1.Project({
67
+ compilerOptions: {
68
+ experimentalDecorators: true,
69
+ strict: false,
70
+ skipLibCheck: true,
71
+ },
72
+ skipAddingFilesFromTsConfig: true,
73
+ });
74
+ for (const file of files) {
75
+ project.addSourceFileAtPath(file);
76
+ }
77
+ const components = [];
78
+ for (const sourceFile of project.getSourceFiles()) {
79
+ const classes = sourceFile.getClasses();
80
+ for (const cls of classes) {
81
+ const componentDecorator = this.getDecorator(cls, "Component");
82
+ if (!componentDecorator)
83
+ continue;
84
+ const metadata = this.extractComponent(cls, componentDecorator, sourceFile.getFilePath(), sourcePath);
85
+ if (metadata) {
86
+ metadata.examples = await this.findExamples(sourceFile.getFilePath(), sourcePath);
87
+ components.push(metadata);
88
+ }
89
+ }
90
+ }
91
+ return components;
92
+ }
93
+ getDecorator(cls, name) {
94
+ return cls.getDecorators().find((d) => d.getName() === name);
95
+ }
96
+ extractComponent(cls, decorator, filePath, sourcePath) {
97
+ const name = cls.getName();
98
+ if (!name)
99
+ return null;
100
+ const selector = this.extractDecoratorProperty(decorator, "selector");
101
+ const description = this.getJsDocDescription(cls);
102
+ const props = this.extractInputs(cls);
103
+ const events = this.extractOutputs(cls);
104
+ const methods = this.extractPublicMethods(cls);
105
+ const slots = this.extractSlots(decorator);
106
+ return {
107
+ name,
108
+ selector: selector ?? undefined,
109
+ description,
110
+ props,
111
+ events,
112
+ methods,
113
+ slots,
114
+ examples: [],
115
+ sourceFile: path.relative(sourcePath, filePath),
116
+ framework: "angular",
117
+ };
118
+ }
119
+ extractDecoratorProperty(decorator, property) {
120
+ const args = decorator.getArguments();
121
+ if (args.length === 0)
122
+ return null;
123
+ const objLiteral = args[0];
124
+ if (objLiteral.getKind() !== ts_morph_1.SyntaxKind.ObjectLiteralExpression)
125
+ return null;
126
+ const obj = objLiteral.asKind(ts_morph_1.SyntaxKind.ObjectLiteralExpression);
127
+ if (!obj)
128
+ return null;
129
+ const prop = obj.getProperty(property);
130
+ if (!prop)
131
+ return null;
132
+ const init = prop.asKind(ts_morph_1.SyntaxKind.PropertyAssignment)?.getInitializer();
133
+ if (!init)
134
+ return null;
135
+ const text = init.getText();
136
+ // Remove surrounding quotes
137
+ return text.replace(/^['"`]|['"`]$/g, "");
138
+ }
139
+ extractInputs(cls) {
140
+ const props = [];
141
+ for (const property of cls.getProperties()) {
142
+ const inputDecorator = property.getDecorators().find((d) => d.getName() === "Input");
143
+ if (!inputDecorator)
144
+ continue;
145
+ const name = this.getInputAlias(inputDecorator) ?? property.getName();
146
+ const type = property.getType().getText(property) ?? "any";
147
+ const initializer = property.getInitializer();
148
+ const required = !property.hasQuestionToken() && !initializer;
149
+ const defaultValue = initializer?.getText();
150
+ const description = this.getJsDocDescription(property);
151
+ props.push({ name, type, required, defaultValue, description });
152
+ }
153
+ // Also check for signal-based inputs: input(), input.required()
154
+ for (const property of cls.getProperties()) {
155
+ const init = property.getInitializer();
156
+ if (!init)
157
+ continue;
158
+ const text = init.getText();
159
+ if (text.startsWith("input(") || text.startsWith("input.required(")) {
160
+ const name = property.getName();
161
+ const isRequired = text.startsWith("input.required(");
162
+ const type = property.getType().getText(property) ?? "any";
163
+ const description = this.getJsDocDescription(property);
164
+ props.push({ name, type, required: isRequired, description });
165
+ }
166
+ }
167
+ return props;
168
+ }
169
+ getInputAlias(decorator) {
170
+ const args = decorator.getArguments();
171
+ if (args.length === 0)
172
+ return null;
173
+ const first = args[0];
174
+ if (first.getKind() === ts_morph_1.SyntaxKind.StringLiteral) {
175
+ return first.getText().replace(/^['"`]|['"`]$/g, "");
176
+ }
177
+ return null;
178
+ }
179
+ extractOutputs(cls) {
180
+ const events = [];
181
+ for (const property of cls.getProperties()) {
182
+ const outputDecorator = property.getDecorators().find((d) => d.getName() === "Output");
183
+ if (!outputDecorator)
184
+ continue;
185
+ const name = property.getName();
186
+ const typeText = property.getType().getText(property);
187
+ // Extract generic type from EventEmitter<T>
188
+ const payloadMatch = typeText.match(/EventEmitter<(.+)>/);
189
+ const payloadType = payloadMatch ? payloadMatch[1] : undefined;
190
+ const description = this.getJsDocDescription(property);
191
+ events.push({ name, payloadType, description });
192
+ }
193
+ // Also check for signal-based outputs: output()
194
+ for (const property of cls.getProperties()) {
195
+ const init = property.getInitializer();
196
+ if (!init)
197
+ continue;
198
+ const text = init.getText();
199
+ if (text.startsWith("output(") || text.startsWith("output<")) {
200
+ const name = property.getName();
201
+ const type = property.getType().getText(property) ?? "any";
202
+ const description = this.getJsDocDescription(property);
203
+ events.push({ name, payloadType: type, description });
204
+ }
205
+ }
206
+ return events;
207
+ }
208
+ extractPublicMethods(cls) {
209
+ return cls
210
+ .getMethods()
211
+ .filter((m) => {
212
+ const name = m.getName();
213
+ // Skip Angular lifecycle hooks and private/protected methods
214
+ const isLifecycle = [
215
+ "ngOnInit", "ngOnDestroy", "ngOnChanges", "ngAfterViewInit",
216
+ "ngAfterContentInit", "ngDoCheck", "ngAfterViewChecked",
217
+ "ngAfterContentChecked",
218
+ ].includes(name);
219
+ const isPrivate = m.hasModifier(ts_morph_1.SyntaxKind.PrivateKeyword) || name.startsWith("_");
220
+ const isProtected = m.hasModifier(ts_morph_1.SyntaxKind.ProtectedKeyword);
221
+ return !isLifecycle && !isPrivate && !isProtected;
222
+ })
223
+ .map((m) => ({
224
+ name: m.getName(),
225
+ signature: this.buildMethodSignature(m),
226
+ description: this.getJsDocDescription(m),
227
+ }));
228
+ }
229
+ buildMethodSignature(method) {
230
+ const params = method
231
+ .getParameters()
232
+ .map((p) => {
233
+ const name = p.getName();
234
+ const type = p.getType().getText(p);
235
+ const optional = p.isOptional() ? "?" : "";
236
+ return `${name}${optional}: ${type}`;
237
+ })
238
+ .join(", ");
239
+ const returnType = method.getReturnType().getText(method);
240
+ return `${method.getName()}(${params}): ${returnType}`;
241
+ }
242
+ extractSlots(decorator) {
243
+ const template = this.extractDecoratorProperty(decorator, "template");
244
+ if (!template)
245
+ return [];
246
+ const slots = [];
247
+ const ngContentRegex = /<ng-content\s*(?:select="([^"]*)")?\s*\/?>/g;
248
+ let match;
249
+ while ((match = ngContentRegex.exec(template)) !== null) {
250
+ slots.push({
251
+ name: match[1] ?? "default",
252
+ description: match[1] ? `Content projected into ${match[1]}` : "Default content projection slot",
253
+ });
254
+ }
255
+ return slots;
256
+ }
257
+ getJsDocDescription(node) {
258
+ const jsDocs = node.getJsDocs();
259
+ if (jsDocs.length === 0)
260
+ return "";
261
+ return jsDocs[0].getDescription().trim();
262
+ }
263
+ async findExamples(componentFile, sourcePath) {
264
+ const examples = [];
265
+ const baseName = path.basename(componentFile, path.extname(componentFile));
266
+ const dir = path.dirname(componentFile);
267
+ // Look for .stories.ts files
268
+ const storyFile = path.join(dir, `${baseName.replace(".component", "")}.stories.ts`);
269
+ if (fs.existsSync(storyFile)) {
270
+ const content = fs.readFileSync(storyFile, "utf-8");
271
+ examples.push({
272
+ title: `${baseName} Storybook`,
273
+ code: content,
274
+ language: "angular",
275
+ });
276
+ }
277
+ // Look for usage in spec files
278
+ const specFile = path.join(dir, `${baseName}.spec.ts`);
279
+ if (fs.existsSync(specFile)) {
280
+ const content = fs.readFileSync(specFile, "utf-8");
281
+ // Extract template strings from TestBed configurations
282
+ const templateRegex = /template:\s*`([^`]+)`/g;
283
+ let match;
284
+ while ((match = templateRegex.exec(content)) !== null) {
285
+ examples.push({
286
+ title: `${baseName} test usage`,
287
+ code: match[1].trim(),
288
+ language: "html",
289
+ });
290
+ }
291
+ }
292
+ return examples;
293
+ }
294
+ }
295
+ exports.AngularParser = AngularParser;
296
+ /** Factory function for parser discovery */
297
+ function createParser() {
298
+ return new AngularParser();
299
+ }
300
+ //# sourceMappingURL=angular-parser.js.map
@@ -0,0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C/B,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE;oBACrB,QAAQ,EAAE,MAAM;iBACjB,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AA/RD,sCA+RC;AAED,4CAA4C;AAC5C,SAAgB,YAAY;IAC1B,OAAO,IAAI,aAAa,EAAE,CAAC;AAC7B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { AngularParser, createParser } from "./angular-parser.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createParser = exports.AngularParser = void 0;
4
+ var angular_parser_js_1 = require("./angular-parser.js");
5
+ Object.defineProperty(exports, "AngularParser", { enumerable: true, get: function () { return angular_parser_js_1.AngularParser; } });
6
+ Object.defineProperty(exports, "createParser", { enumerable: true, get: function () { return angular_parser_js_1.createParser; } });
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,yDAAkE;AAAzD,kHAAA,aAAa,OAAA;AAAE,iHAAA,YAAY,OAAA"}
package/package.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "@ui-context/parser-angular",
3
+ "version": "0.1.0",
4
+ "description": "Angular component parser for ui-context",
5
+ "main": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
7
+ "files": ["dist"],
8
+ "scripts": {
9
+ "build": "tsc --build"
10
+ },
11
+ "dependencies": {
12
+ "@ui-context/core": "0.1.0",
13
+ "ts-morph": "^22.0.0",
14
+ "glob": "^10.3.0"
15
+ },
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "https://github.com/oluizcarvalho/ui-context.git",
19
+ "directory": "packages/parser-angular"
20
+ },
21
+ "homepage": "https://oluizcarvalho.github.io/ui-context",
22
+ "bugs": {
23
+ "url": "https://github.com/oluizcarvalho/ui-context/issues"
24
+ },
25
+ "author": "oluizcarvalho",
26
+ "keywords": ["mcp", "angular", "parser", "component", "ts-morph", "design-system"],
27
+ "engines": {
28
+ "node": ">=18"
29
+ },
30
+ "license": "MIT"
31
+ }