-
Notifications
You must be signed in to change notification settings - Fork 29
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
[Theme Checks] Added in a check for theme block settings validation #620
Conversation
b95fc84
to
866ea6c
Compare
packages/theme-check-common/src/checks/valid-block-preset-settings/index.ts
Outdated
Show resolved
Hide resolved
packages/theme-check-common/src/checks/valid-block-preset-settings/index.ts
Outdated
Show resolved
Hide resolved
packages/theme-check-common/src/checks/valid-block-preset-settings/index.ts
Outdated
Show resolved
Hide resolved
packages/theme-check-common/src/checks/valid-block-preset-settings/index.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Position information can't be ignored for this check. We'll probably need to rewrite it and iterate over each blocks separately rather than push all of them in the same bucket.
b20d7f0
to
0a7932b
Compare
05d6e6c
to
07c3295
Compare
3ef48eb
to
eee6ce7
Compare
Finished tests Added changeset
eee6ce7
to
6f90bcc
Compare
8f6b402
to
8745150
Compare
8745150
to
a262ff6
Compare
a005288
to
299e675
Compare
9d91791
to
b7a7bd6
Compare
const currentPath = [...path, blockIndex.toString()]; | ||
|
||
for (const [settingId, _] of Object.entries(block.settings ?? {})) { | ||
const node = nodeAtPath(ast, [...currentPath, 'settings']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to nest this one level deeper - the node is highlighting all of settings rather than the specific id key
Closing this PR for this one: #742 Thank you Ariba for the initial PR ❤️ |
What are you adding in this PR?
First part of #602
Adding in a theme check for checking theme blocks for valid preset and default setting keys. The preset and default setting keys (and the presets of any theme block preset settings) must match the settings keys configured in either the preset settings or the nested theme block settings.
What did you learn?
A lot about presets, sections and theme blocks and how they are configured. That was the trickiest part of all of this (managing the types, knowing how to grab nested information, etc).
Before you deploy
changeset
allChecks
array insrc/checks/index.ts
yarn build
and committed the updated configuration filestheme-app-extension.yml
configchangeset
changeset