You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| --globs | string[]| Globs to analyze |`--globs "foo.js"`|
10
+
| --exclude | string[]| Globs to exclude |`--exclude "foo.js"`|
11
+
| --outdir | string | Directory to output the Manifest to |`--outdir dist`|
12
+
| --dependencies | boolean | Include third party custom elements manifests |`--dependencies`|
13
+
| --packagejson | boolean | Output CEM path to `package.json`, defaults to true |`--packagejson`|
14
+
| --watch | boolean | Enables watch mode, generates a new manifest on file change |`--watch`|
15
+
| --dev | boolean | Enables extra logging for debugging |`--dev`|
16
+
| --litelement | boolean | Enable special handling for LitElement syntax |`--litelement`|
17
+
| --fast | boolean | Enable special handling for FASTElement syntax |`--fast`|
18
+
| --stencil | boolean | Enable special handling for Stencil syntax |`--stencil`|
19
+
| --catalyst | boolean | Enable special handling for Catalyst syntax |`--catalyst`|
18
20
19
21
## Config File
20
22
@@ -35,6 +37,10 @@ export default {
35
37
dev:true,
36
38
/** Run in watch mode, runs on file changes */
37
39
watch:true,
40
+
/** Include third party custom elements manifests */
41
+
dependencies:true,
42
+
/** Output CEM path to `package.json`, defaults to true */
43
+
packagejson:false,
38
44
/** Enable special handling for litelement */
39
45
litelement:true,
40
46
/** Enable special handling for catalyst */
@@ -67,6 +73,8 @@ interface userConfigOptions {
67
73
outdir:string,
68
74
dev:boolean,
69
75
watch:boolean,
76
+
dependencies:boolean,
77
+
packagejson:boolean,
70
78
71
79
litelement:boolean,
72
80
catalyst:boolean,
@@ -79,10 +87,8 @@ interface userConfigOptions {
79
87
80
88
```
81
89
82
-
### Custom config location
90
+
### Analyzing dependencies
83
91
84
-
Using the `--config` flag in the CLI you can supply a custom path to your configuration file as follows:
92
+
By default, the analyzer doesn't analyze any code inside `node_modules/`. This has several reasons; you dont want all of `lodash` to accidentally get analyzed and output in your manifest, but also, we don't actually know which dependencies your project uses _until_ we're analyzing the code, by which time glob collection and compilation has already happened.
85
93
86
-
```bash
87
-
cem analyze --config "../configs/custom-elements-manifest.js"
88
-
```
94
+
If you want to include metadata about third party packages in your `custom-elements.json` you can enable the `--dependencies` flag. This will try to find your dependencies' `custom-elements.json` files, by either looking at the `customElements` field in your `package.json`, or the `./customElements` field in the packages' exports map if available. If a `custom-elements.json` is found, the output will be included in your `custom-elements.json`.
Copy file name to clipboardexpand all lines: packages/analyzer/CHANGELOG.md
+5
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,8 @@
1
+
## Release 0.6.0
2
+
- Allow inclusion of third party `custom-elements.json`s from `node_modules`
3
+
- If a package has an export map, add the `./customElements` key in the export map
4
+
- This feature can be disabled with the `--packagejson` flag, but make sure to include the path to the `custom-elements.json` in your `package.json` so that tools can find it.
5
+
1
6
## Release 0.5.7
2
7
- Only remove unexported declarations _after_ applying inheritance. Usecase as described in [#145](https://github.com/open-wc/custom-elements-manifest/issues/145).
3
8
- Log analyzer version number to default CLI message. Via [#144](https://github.com/open-wc/custom-elements-manifest/pull/144)
console.log(`Could not add 'customElements' property to ${process.cwd()}${path.sep}package.json. \nAdding this property helps tooling locate your Custom Elements Manifest. Please consider adding it yourself, or file an issue if you think this is a bug.\nhttps://www.github.com/open-wc/custom-elements-manifest`);
0 commit comments