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/
234 stars 43 forks source link

Catalyst Plugin: attribute names aren't dasherised #186

Closed keithamus closed 4 months ago

keithamus commented 2 years ago

Checklist

Playground link

Catalyst attributes are dasherised when serialised to HTML, which the Catalyst plugin does not quite properly reflect.

Expected behavior

The following code:

import { controller, attr } from '@github/catalyst'

@controller
class HelloWorldElement extends HTMLElement {
  @attr fooBar = 'hello'
}

Would result in an attribute of data-foo-bar in Catalyst 1.x and an attribute of foo-bar in 2.x and so the attributes json should be:

          "attributes": [
            {
              "name": "data-foo-bar", // just `foo-bar` in v2
              "type": {
                "text": "string"
              },
              "default": "'hello'",
              "fieldName": "fooBar"
            }
          ],

Actual behavior

The generated manifest has the following:

          "attributes": [
            {
              "name": "fooBar",
              "type": {
                "text": "string"
              },
              "default": "'hello'",
              "fieldName": "fooBar"
            }
          ],
thepassle commented 1 year ago

@keithamus Could you take a look at this PR to make sure I got it right? 🙂 Thanks https://github.com/open-wc/custom-elements-manifest/pull/188

thepassle commented 4 months ago

This was fixed :) closing