teleporthq / teleport-code-generators

A collection of code generators for modern JavaScript applications
https://teleporthq.io
MIT License
995 stars 158 forks source link

Can't use component from external package with dash-case tagname #900

Open Julia-Alberici opened 5 months ago

Julia-Alberici commented 5 months ago

use case: Want to generate code to Angular flavour using components from the package @angular/material, the pattern of angular libs tagnames is dash-case, so i'm declaring a ProjectUIDL with this as one of the children page

{
    "type": "element",
    "content": {
        "elementType": "mat-autocomplete",
        "referencedStyles": {},
        "abilities": {},
        "children": [],
        "semanticType": "mat-autocomplete",
        "dependency": {
            "type": "package",
            "version": "latest",
            "path": "@angular/material",
            "meta": {
                "namedImport": true,
                "originalName": "MatAutocompleteModule"
            }
        }
    }
}

but the tagname will always end as camelCase bcz it has an external dependency. I understand that for other flavours this behaviour makes sense, but it's broken to angular, shoudn't have a flag or something to fix this?

JayaKrishnaNamburu commented 5 months ago

@Julia-Alberici thanks for reporting this. Yes, ideally we handle this behaviour for angular and vue flavour of code. I will take a look once 👍