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

Custom element tag name not contained in the manifest #158

Closed sanjatasic closed 2 years ago

sanjatasic commented 2 years ago

Checklist

Completing the items above will greatly improve triaging time of your issue.

Expected behavior Would expect a custom element tag name to be included in the manifest. What is the reason that this is not the case?

thepassle commented 2 years ago

I dont know

sanjatasic commented 2 years ago

Should this question be asked in the JSON schema spec project?

thepassle commented 2 years ago

Probably not. But you didnt make a minimal reproduction in the playground (like it says in the issue template that you edited), so there's no way for me to know whats going on.

sanjatasic commented 2 years ago

Sorry, my bad. Did not create minimal reproduction in the playground, but did run the analyzer with --dev flag, as suggested.

Here is custom element class:

import { LitElement, TemplateResult, html } from "lit";
import { customElement, property } from "lit/decorators.js";

/**
 * @CustomElement my-element
 */
@customElement("my-element")
export default class MyElement extends LitElement {
  @property({
    type: Boolean,
  })
  disabled: boolean = false;

  // eslint-disable-next-line class-methods-use-this
  render(): TemplateResult {
    return html`<div></div>`;
  }
}

Command executed:

cem analyze --globs src/my-element.ts --litelement --dev

Output:

[PACKAGE LINK PHASE]
{
  "schemaVersion": "1.0.0",
  "readme": "",
  "modules": []
}
[9:32:20 AM] @custom-elements-manifest/analyzer: Created new manifest.

But in the meantime figured out, that probably support for Lit decorators (at least the @customElement one) is still not implemented...

thepassle commented 2 years ago

The analyzer supports Lit, and its decorators. Did you run the analyzer with special handling for Lit enabled? e.g. cem analyze --litelement

Please make sure to thoroughly read the documentation and issue template before creating an issue https://custom-elements-manifest.open-wc.org/

sanjatasic commented 2 years ago

I did, with the same result, as noted in the command above...