WordPress / twentytwentyfive

88 stars 48 forks source link

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

Open carolinan opened 2 months ago

carolinan commented 2 months ago

The community themes repository has some custom tools, including this recent update which adds a command to validate theme.json: https://github.com/WordPress/community-themes/pull/221

Would it be beneficial to use the same tools in this repository? @ajlende @MaggieCabrera

MaggieCabrera commented 2 months ago

I think it would be nice to have. The escape pattern script can be very useful if TT5 ends up having as many patterns as TT4 had

carolinan commented 1 month ago

Who may be able to help with copying the tools over? :)

richtabor commented 1 month ago

Curious, what tooling exists in that repo that should be standard for all theme designers?

karmatosed commented 1 month ago

I am also curious what should be standard and if they should be standard how can we make them more accessible to everyone? It's one thing adding them but we also need to document clearly any tools added here that might be unexpected or new. They are going to be amazing once people know about them but confusing until they do.

ajlende commented 1 month ago

One thing about the validateSchema script in community-themes:

The custom script is required for supporting both Draft 4 & 7 in the same repo. WordPress 6.6 uses Draft 4, but WordPress 6.7 will use Draft 7. And Draft 7 is already being used in Gutenberg trunk (https://schemas.wp.org/trunk/theme.json).

Since TT5 only needs the new script, we could use ajv-cli for validation to keep things simple. Something like this will work once https://github.com/ajv-validator/ajv-cli/pull/242 is merged.

ajv-cli validate \
--allow-matching-properties \
-s <(curl -sSL https://schemas.wp.org/trunk/theme.json) \
-d theme.json

Otherwise, you'll have to download the schema first, but it'll still work.

curl -sSL https://schemas.wp.org/trunk/theme.json -o schema.json &&
ajv-cli validate \
--allow-matching-properties \
-s schema.json \
-d theme.json
carolinan commented 1 day ago

Who may be able to help with copying the tools over? :)