Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: --stencil now outputs default & description for attributes #286

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Kai-Richardson
Copy link

Fixes #285

The stencil plugin now correctly populates the artificially created attribute for a field with default and description from the detected member (if present), where it did not before:

stencil code output
image image

I investigated using handleDefaultValue per #285 (comment), but I don't think that function applies.

This is an artificially created attribute being injected into the class, and since handleDefaultValue is already ran to obtain the resultant values we see in the member already, we just need to copy values over to our artificial object.

I tested this locally on my custom stencil elements and it all seemed to work as expected. Members which did not have a default value nor description did not create extant fields in the produced attributes:

(no default, no desc) (no default, no desc)
image image

I also cleaned up some errant whitespace.

Copy link

netlify bot commented Dec 7, 2024

Deploy Preview for custom-elements-manifest-analyzer ready!

Name Link
🔨 Latest commit e452cab
🔍 Latest deploy log https://app.netlify.com/sites/custom-elements-manifest-analyzer/deploys/6753a92a571fe70008b1b808
😎 Deploy Preview https://deploy-preview-286--custom-elements-manifest-analyzer.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@Kai-Richardson
Copy link
Author

Weird - didn't encounter these test failures when running locally. I'll investigate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Analyzer (stencil): default values not being represented in attributes
1 participant