ngx-locatorjs 0.5.0 → 0.5.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/README.ko.md CHANGED
@@ -10,6 +10,10 @@ Angular 인기가 적어서인지 [LocatorJs](https://www.locatorjs.com/)와 같
10
10
  - Alt 키 홀드: 컴포넌트 하이라이트 + 툴팁 표시
11
11
  - Antigravity IDE, Cursor, Zed, VS Code, WebStorm 지원
12
12
 
13
+ **Angular 버전 지원**
14
+
15
+ 지원 범위: **Angular 15~22**
16
+
13
17
  **필수 단계 (1~4 반드시 수행)**
14
18
 
15
19
  1. 패키지 설치: `npm i -D ngx-locatorjs`
package/README.md CHANGED
@@ -20,6 +20,10 @@ Inspired by [locatorjs.com](https://www.locatorjs.com/).
20
20
  - **Hold Alt**: highlight component + tooltip
21
21
  - Supports **Antigravity IDE**, **Cursor**, **Zed**, **VS Code**, **WebStorm**
22
22
 
23
+ ## Angular Version Support
24
+
25
+ Tested support: **Angular 15–22**.
26
+
23
27
  ## Install
24
28
 
25
29
  ```bash
@@ -56,16 +56,20 @@ function extractTemplateUrl(node) {
56
56
  }
57
57
  return undefined;
58
58
  }
59
+ function getDecorators(node) {
60
+ const modernTs = ts;
61
+ if (modernTs.canHaveDecorators?.(node) && modernTs.getDecorators) {
62
+ return modernTs.getDecorators(node) ?? [];
63
+ }
64
+ const legacyNode = node;
65
+ return legacyNode.decorators ?? legacyNode.modifiers?.filter(ts.isDecorator) ?? [];
66
+ }
59
67
  function findComponentDecorator(node) {
60
- if (!node.modifiers)
61
- return undefined;
62
- for (const modifier of node.modifiers) {
63
- if (ts.isDecorator(modifier)) {
64
- const expr = modifier.expression;
65
- if (ts.isCallExpression(expr) && ts.isIdentifier(expr.expression)) {
66
- if (expr.expression.text === 'Component') {
67
- return modifier;
68
- }
68
+ for (const decorator of getDecorators(node)) {
69
+ const expr = decorator.expression;
70
+ if (ts.isCallExpression(expr) && ts.isIdentifier(expr.expression)) {
71
+ if (expr.expression.text === 'Component') {
72
+ return decorator;
69
73
  }
70
74
  }
71
75
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngx-locatorjs",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "LocatorJs open-in-editor tools for Angular projects",
5
5
  "keywords": [
6
6
  "angular",
@@ -51,6 +51,7 @@
51
51
  "prepare": "npm run build",
52
52
  "test": "node --test",
53
53
  "test:ci": "npm run build && npm test",
54
+ "test:angular:e2e": "node scripts/angular-e2e-matrix.mjs",
54
55
  "format": "oxfmt",
55
56
  "format:check": "oxfmt --check",
56
57
  "publish:github": "node scripts/publish-github.mjs"
@@ -61,6 +62,7 @@
61
62
  "devDependencies": {
62
63
  "@types/node": "^18.18.0",
63
64
  "oxfmt": "^0.35.0",
65
+ "playwright": "^1.61.0",
64
66
  "typescript": "^5.5.4"
65
67
  }
66
68
  }