open-wc / custom-elements-manifest

Custom Elements Manifest is a file format that describes custom elements in your project.
https://custom-elements-manifest.open-wc.org/
227 stars 37 forks source link

feat: analyze node modules #129

Closed thepassle closed 2 years ago

netlify[bot] commented 2 years ago

✔️ Deploy Preview for custom-elements-manifest-analyzer ready!

🔨 Explore the source changes: fed42218788ee7935631cd9c4d4e55842ff801a0

🔍 Inspect the deploy log: https://app.netlify.com/sites/custom-elements-manifest-analyzer/deploys/615c91668fc8ef0007e1c3eb

😎 Browse the preview: https://deploy-preview-129--custom-elements-manifest-analyzer.netlify.app

thepassle commented 2 years ago

closes https://github.com/open-wc/custom-elements-manifest/issues/123

thepassle commented 2 years ago

TODO: Some considerations as brought up in https://github.com/open-wc/custom-elements-manifest/issues/130: Getting the CEM from a third-party module is hard. We either have to analyze stuff in node_modules/, which may be minified code, or built code (TS) in which case we may lose type information/completeness of the CEM.

Alternatively, we could try to find the third-party's custom-elements-manifest.json file, which is also hard; if the third-party uses package exports, but doesnt list their CEM in the package exports, there's virtually no way for us to get it.

We could always try to see if the third party has a CEM (either by checking the package exports or see if they have a customElements field in the package.json), and if all else fails; analyze the package.

If a CEM does exist in the third party package, we have to merge two CEMs together:

thepassle commented 2 years ago

closing in favour of https://github.com/open-wc/custom-elements-manifest/pull/142