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/
226 stars 37 forks source link

Objects that get spread into `properties` don't get read by the analyzer #245

Open KonnorRogers opened 3 months ago

KonnorRogers commented 3 months ago

Checklist

Playground: https://custom-elements-manifest.netlify.app/?source=CmltcG9ydCB7IExpdEVsZW1lbnQgfSBmcm9tICdsaXQtZWxlbWVudCc7Cgpjb25zdCBmb3JtUHJvcGVydGllcyA9IHsKICAgIGZvbzogewogICAgICAgIHJlZmxlY3Q6IHRydWUsCiAgICAgICAgYXR0cmlidXRlOiAiZm9vIgogICAgfQp9CgpleHBvcnQgY2xhc3MgTXlFbGVtZW50IGV4dGVuZHMgTGl0RWxlbWVudCB7CiAgc3RhdGljIGdldCBwcm9wZXJ0aWVzICgpIHsKICAgIHJldHVybiB7CiAgICAgIC4uLmZvcm1Qcm9wZXJ0aWVzLAogICAgICBiYXI6IHtyZWZsZWN0OiB0cnVlfQogICAgfQogIH0KfQo%3D&library=litelement

TLDR: When you do something like:

const formProperties = { foo: {}}

static properties = {
  ...formProperties
}

The form properties never get added to the custom elements manifest.

Expected behavior

          "members": [
            {
              "kind": "field",
              "name": "foo",
              "privacy": "public",
              "attribute": "foo",
              "reflects": true,
            },
          ]

Current behavior:

          "members": [
            {
              "kind": "field",
              "name": "-",
              "privacy": "public",
              "attribute": "",
            },
          ]