@zeroheight/adoption-cli 0.2.4 → 0.2.6
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
CHANGED
|
@@ -9,7 +9,9 @@ npm i @zeroheight/adoption-cli
|
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
|
+
|
|
12
13
|
In the repository in which you wish to analyze the component usage, run the following command:
|
|
14
|
+
|
|
13
15
|
```
|
|
14
16
|
zh-adoption analyze
|
|
15
17
|
```
|
|
@@ -21,6 +23,7 @@ zh-adoption auth
|
|
|
21
23
|
```
|
|
22
24
|
|
|
23
25
|
More info on the commands can be seen by running
|
|
26
|
+
|
|
24
27
|
```
|
|
25
28
|
zh-adoption --help
|
|
26
|
-
```
|
|
29
|
+
```
|
package/dist/ast/analyze.js
CHANGED
|
@@ -75,12 +75,15 @@ export function analyze(ast) {
|
|
|
75
75
|
TSEnumDeclaration() { },
|
|
76
76
|
TSParameterProperty() { },
|
|
77
77
|
TSImportEqualsDeclaration() { },
|
|
78
|
+
TSInstantiationExpression() { },
|
|
79
|
+
TSDeclareMethod() { },
|
|
78
80
|
};
|
|
79
81
|
try {
|
|
80
82
|
walk.ancestor(ast, visitors, base, visitorState);
|
|
81
83
|
}
|
|
82
84
|
catch (e) {
|
|
83
|
-
|
|
85
|
+
// We don't want to log the error to the users - maybe could add some actually logging in the future
|
|
86
|
+
// console.log("error", e);
|
|
84
87
|
}
|
|
85
88
|
finally {
|
|
86
89
|
return transformVisitorStateToRawUsage(visitorState);
|
|
@@ -46,8 +46,11 @@ export default function Analyze({ onAnalyzeFiles, dryRun, repoName, }) {
|
|
|
46
46
|
resourceURL.pathname = "/adoption/";
|
|
47
47
|
setResourceURL(resourceURL);
|
|
48
48
|
}
|
|
49
|
-
catch (
|
|
50
|
-
|
|
49
|
+
catch (e) {
|
|
50
|
+
const errorMessage = e.message === "Unauthorized"
|
|
51
|
+
? "Unauthorized. Please reset your authentication by running: zh-adoption auth"
|
|
52
|
+
: "Failed to send data to zeroheight";
|
|
53
|
+
setErrorList((s) => [...s, errorMessage]);
|
|
51
54
|
}
|
|
52
55
|
finally {
|
|
53
56
|
setIsSendingData(false);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeroheight/adoption-cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"main": "dist/cli.js",
|
|
6
6
|
"bin": {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"scripts": {
|
|
14
14
|
"cleanup": "rm -rf dist",
|
|
15
15
|
"setup": "npm run build && npm i -g",
|
|
16
|
-
"start": "
|
|
16
|
+
"start": "node dist/cli.js",
|
|
17
17
|
"start-dev": "export NODE_ENV=dev && zh-adoption",
|
|
18
18
|
"build": "tsc",
|
|
19
19
|
"dev": "tsc --watch",
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
"acorn-walk": "^8.3.2",
|
|
31
31
|
"chalk": "^5.2.0",
|
|
32
32
|
"commander": "^12.0.0",
|
|
33
|
+
"glob": "^10.3.15",
|
|
33
34
|
"ignore": "^5.3.1",
|
|
34
35
|
"ink": "^4.1.0",
|
|
35
|
-
"glob": "^10.3.15",
|
|
36
36
|
"ink-link": "^3.0.0",
|
|
37
37
|
"ink-render-string": "^1.0.0",
|
|
38
38
|
"ink-select-input": "^5.0.0",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"ink-testing-library": "git+ssh://git@github.com/vadimdemedes/ink-testing-library.git#f44b077e9a05a1d615bab41c72906726d34ea085",
|
|
53
53
|
"memfs": "^4.9.2",
|
|
54
54
|
"mock-stdin": "^1.0.0",
|
|
55
|
-
"prettier": "^2.8.
|
|
55
|
+
"prettier": "^2.8.8",
|
|
56
56
|
"ts-node": "^10.9.1",
|
|
57
57
|
"typescript": "^5.4.5",
|
|
58
58
|
"vitest": "^1.5.2"
|