@zeroheight/adoption-cli 0.4.0 → 0.4.2

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/CHANGELOG.md CHANGED
@@ -1,6 +1,15 @@
1
1
  # Release notes
2
2
 
3
- ## [0.4.0](https://www.npmjs.com/package/@zeroheight/adoption-cli/v/0.3.1) - 2nd August 2024
3
+ ## [0.4.2](https://www.npmjs.com/package/@zeroheight/adoption-cli/v/0.4.2) - 10th September 2024
4
+
5
+ - Update README
6
+
7
+ ## [0.4.1](https://www.npmjs.com/package/@zeroheight/adoption-cli/v/0.4.1) - 9th August 2024
8
+
9
+ - Update README
10
+ - Fix Changelog links
11
+
12
+ ## [0.4.0](https://www.npmjs.com/package/@zeroheight/adoption-cli/v/0.4.0) - 2nd August 2024
4
13
 
5
14
  - Allow `--interactive false` option for `analyze` command to better sipport CI
6
15
 
package/README.md CHANGED
@@ -12,24 +12,72 @@ npm i @zeroheight/adoption-cli
12
12
 
13
13
  ## Usage
14
14
 
15
+ ### Component usage analysis
16
+
15
17
  In the repository in which you wish to analyze the component usage, run the following command:
16
18
 
17
- ```
19
+ ```bash
18
20
  zh-adoption analyze
19
21
  ```
20
22
 
21
- You are able to limit the file extensions to include when searching for components by using `-e, --extensions [ext]` with a glob pattern to determine file extensions.
23
+ #### Options
22
24
 
23
- You are able to state files to ignore when searching for components by using `-i, --ignore [ext]` with a glob pattern to determine ignored files.
25
+ `-e` / `--extensions`
24
26
 
25
- ---
27
+ Provide a glob pattern to search for files with a specific extension.
28
+
29
+ ```bash
30
+ zh-adoption analyze -e "**/*.{js,jsx,ts,tsx}"
31
+ ```
32
+
33
+ `-i` / `--ignore`
34
+
35
+ Provide a glob pattern to ignore files, directories or file extensions when searching for components.
36
+
37
+ ```bash
38
+ zh-adoption analyze -i "**/*.{test,spec}.*"
39
+ ```
40
+
41
+ `-r` / `--repo-name`
42
+
43
+ Provide a name for the current repository. This must be passed when `-in` / `--interactive` is set to `false`.
44
+
45
+ ```bash
46
+ zh-adoption analyze -r "My Repo"
47
+ ```
26
48
 
27
- To send adoption data to your [zeroheight](https://zeroheight.com/) account you will need to authenticate. This can be done as part of the `analyze` flow or separately by running:
49
+ `-in` / `--interactive`
50
+
51
+ Pass in `false` to disable the interactive mode e.g. when running in a CI environment.
52
+
53
+ ```bash
54
+ zh-adoption analyze --interactive false -r "My Repo"
55
+ ```
56
+
57
+
58
+
59
+ To send adoption data to your [zeroheight](https://zeroheight.com/) account you will need to authenticate using a Client ID and Access Token.
60
+
61
+ ### Authentication
62
+ #### Interactive mode
63
+
64
+ When running the `analyze` command, you will be prompted to authenticate. This will save the Client ID and Access Token to your local machine.
65
+
66
+ Alternatively, you can authenticate by running the following command:
28
67
 
29
68
  ```
30
69
  zh-adoption auth
31
70
  ```
32
71
 
72
+ #### Non-interactive mode
73
+
74
+ When running the `analyze` command with the `--interactive false` flag, you will need to provide the Client ID and Access Token as environment variables.
75
+
76
+ ```bash
77
+ export ZEROHEIGHT_CLIENT_ID="your-client-id"
78
+ export ZEROHEIGHT_ACCESS_TOKEN="your-access-token"
79
+ ```
80
+
33
81
  ---
34
82
 
35
83
  More info on the commands can be seen by running
package/dist/cli.js CHANGED
@@ -10,7 +10,7 @@ const { output, cleanup } = render(React.createElement(HelpInfo, null));
10
10
  program
11
11
  .name("zh-adoption")
12
12
  .description("CLI for measuring design system usage usage in your products")
13
- .version("0.4.0")
13
+ .version("0.4.2")
14
14
  .addHelpText("before", output)
15
15
  .addCommand(analyzeCommand())
16
16
  .addCommand(authCommand());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeroheight/adoption-cli",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "license": "ISC",
5
5
  "main": "dist/cli.js",
6
6
  "bin": {