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

fix(clover): .setDefaultValue in asset definition func if there is a default value in the prop spec #5411

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

britmyerss
Copy link
Contributor

@britmyerss britmyerss commented Feb 2, 2025

If there is a default value on the prop spec, we need to add .setDefaultValue({defaultValue}) to the asset definition function, otherwise on regenerate, this is missing, and we interpret that the user wants to remove the default value for that prop.

I have not yet uploaded this to a local module index and installed for testing, but hoping this gets us a head start.

Copy link

github-actions bot commented Feb 2, 2025

Dependency Review

✅ No vulnerabilities or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Files

Copy link
Contributor

@vbustamante vbustamante left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! The VS code formatter and the intellij one seem to disagree about some things, we probably should fix that for Clover at some point

}` +
`${prop.data?.defaultValue ? `${indent(indent_level)}.setDefaultValue(${JSON.stringify(prop.data.defaultValue)})\n` : ''}` +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only functional change right?

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.

2 participants