Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom element manifest paths are pointing to source files, not published files #725

Closed
justinfagnani opened this issue Apr 8, 2022 · 2 comments
Assignees
Labels
bug Things that aren't working right in the library.

Comments

@justinfagnani
Copy link
Contributor

Describe the bug

The path files in custom-elements.json are pointing to TS source files, like src/components/alert/alert.ts. These paths are supposed to be where consumers can import the element definitions and should be the .js files published to pm.

To Reproduce

Steps to reproduce the behavior:
See the path files here: https://unpkg.com/browse/@shoelace-style/shoelace@2.0.0-beta.72/dist/custom-elements.json

@justinfagnani justinfagnani added the bug Things that aren't working right in the library. label Apr 8, 2022
@claviska
Copy link
Member

claviska commented Apr 8, 2022

This is happening because the CEM is run on the source. This serves a few purposes:

  1. Generates a large portion of the documentation
  2. Generates static source code for the React wrappers
  3. Generates vscode.html-custom-data.json for IntelliSense in VS Code
  4. Generates web-types.json for JetBrains IDEs

I don't know how the analyzer can know about the final path, since the source gets run through esbuild after everything is generated. And if the CEM were run on the output code, it wouldn't be able to generate types since those are stripped by esbuild. I'm also not sure how it would handle bundled modules.

What are you using those paths for? Any suggestions for how to solve this?

@claviska claviska added this to the 2.0.0 stable milestone Nov 8, 2022
@claviska
Copy link
Member

For now, I'm translating these with a small CEM plugin. When Lit gets unbundled, I'll probably have to generate two separate CEM files but I'm OK with that.

This will be available in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Things that aren't working right in the library.
Projects
None yet
Development

No branches or pull requests

2 participants