Skip to content
This repository was archived by the owner on Nov 18, 2024. It is now read-only.

Conversation

@ajlende
Copy link
Contributor

@ajlende ajlende commented Sep 17, 2024

Description

Closes #4

Copied from Automattic/themes since there are some recent changes that haven't made it into WordPress/community-themes yet. I had to make some modifications so that it can work on single-theme repos.

This does not include the modifications that escape-patterns would make to files or GitHub Automations to run validation on PRs.

Difference from WordPress/community-themes:

  • Names of npm scripts
    • lint:theme: Instead of patterns:escape in community-themes
    • lint:patterns:fix: Instead of schema:validate in community-themes
  • escape-patterns runs on all patterns instead of only modified files. (See node theme-utils.mjs help escape-patterns for instructions to run on only modified files.)

Testing Instructions

Don't forget to npm install as there are some new dev dependencies.

Run both commands

  • npm run lint:theme
  • npm run lint:patterns:fix

Verify issues/changes reported are correct.

@ajlende ajlende changed the title Add theme-utils dependencies Add theme-utils Sep 17, 2024
@ajlende ajlende marked this pull request as ready for review September 18, 2024 06:19
@github-actions
Copy link

github-actions bot commented Sep 18, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: ajlende <[email protected]>
Co-authored-by: juanfra <[email protected]>
Co-authored-by: MaggieCabrera <[email protected]>
Co-authored-by: richtabor <[email protected]>
Co-authored-by: karmatosed <[email protected]>
Co-authored-by: carolinan <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@juanfra
Copy link
Member

juanfra commented Sep 18, 2024

Thanks for working on this, Alex. We already have a PR for escaping the patterns here. Maybe we should go with this one given that it also has the validate theme functionality.

@juanfra juanfra added the [Type] Enhancement A suggestion for improvement. label Sep 18, 2024
@github-actions
Copy link

github-actions bot commented Sep 18, 2024

Preview changes

You can preview these changes by following the link below:

I will update this comment with the latest preview links as you push more changes to this PR.
⚠️ Note: The preview sites are created using WordPress Playground. You can add content, edit settings, and test the themes as you would on a real site, but please note that changes are not saved between sessions.

@ajlende
Copy link
Contributor Author

ajlende commented Sep 18, 2024

Thanks for working on this, Alex. We already have a PR for escaping the patterns here. Maybe we should go with this one given that it also has the validate theme functionality.

Sorry @juanfra I didn't see that you already had that one open 😅

Would you be willing to give this one a test to make sure things are working as expected with my modifications?

@juanfra
Copy link
Member

juanfra commented Sep 19, 2024

Sorry @juanfra I didn't see that you already had that one open 😅

No problem @ajlende! Thank you for working on this.

Would you be willing to give this one a test to make sure things are working as expected with my modifications?

I've tested this one, and it is not working for me.

Screen.Recording.2024-09-19.at.11.24.37.mov

@ajlende
Copy link
Contributor Author

ajlende commented Sep 19, 2024

@juanfra Thanks for testing! That issue should be fixed now. Give it another try.

Copy link
Member

@juanfra juanfra left a comment

Choose a reason for hiding this comment

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

Thanks @ajlende - works like a charm 🏅

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

[Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Should this repository use the same utilities as the community themes?

2 participants