BuilderIO / mitosis

Write components once, run everywhere. Compiles to React, Vue, Qwik, Solid, Angular, Svelte, and more.
https://mitosis.builder.io
MIT License
11.84k stars 512 forks source link

Angular selector does not follow angular selector names #1442

Open seofernando25 opened 1 month ago

seofernando25 commented 1 month ago

I am interested in helping provide a fix!

Yes

Which generators are impacted?

Reproduction case

The default playground example using the Angular output

Expected Behaviour

@Component({
  selector: "my-component",

Actual Behaviour

@Component({
  selector: "my-component, MyComponent",

https://angular.io/guide/styleguide#component-selectors

Additional Information

Source Line: https://github.com/BuilderIO/mitosis/blob/1c800ed94e76f928a0c3ef834dce649711d59e6b/packages/core/src/generators/angular/index.ts#L640

See angular style guide for components selector

don't mind the specific prefix warning, the issues is regarding the ", Counter"

image

I suggest we change make these changes

- selector: `'${kebabCase(json.name || 'my-component')}, ${json.name}'`,
+ selector: `'${kebabCase(json.name || 'my-component')}`,