Repository navigation
BPS-10: Render templates with mustache.js and fix unset tags - #57
Merged
Merged
Conversation
These tags had no value, so content-model plugins shipped QueryControls, TaxonomyFilter and PostSelector with empty taxonomy and post type defaults, and every .pot had an empty creation date. TaxonomyFilter's default also appended _category to the slug, a taxonomy that is never registered. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Moved back from lightspeedwp/ls-test. The workflow no longer holds template tags, so the generator can copy it without rendering (BPS-10). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
BPS-10 Mustache placeholder review. Templates render with mustache.js
(escaping off). Filters become dotted names ({{upper.namespace}}), a tag
with no value fails generation, workflows are copied without rendering,
and template mode renders only plugin-template/. The audit's fixes:
query.js and content-model plugins without post types defaulted to an
empty post type, and QueryControls now keys taxQuery by a constant.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. Note Some coding-guideline sources were skipped; the reason is listed next to each one. Other guidelines were applied as usual. On a public repository, sources from your configuration are listed without their names. Skipped guideline sources: 1
Finishing Touches
Warning Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of BPS-10 (#55): the Mustache placeholder review. The generator now renders templates with mustache.js, and the review fixed the tags that were rendering empty. The generated-plugin side is in lightspeedwp/ls-test (
fix/bps-10-mustache-placeholders).Rendering with mustache.js (
d0b760b){{namespace|upper}}is now{{upper.namespace}}, and the same forlower,pascalCase,camelCase,kebabCase,snakeCaseandtitle. Before,titlereturned the value unchanged; now it title-cases. All template uses, docs, tests and helper scripts are converted.author_uriis the only optional tag (the config schema requires a URL, so it can't default to empty).plugin-template/.github/workflows/is copied without rendering, so mustache.js leaves the${{ github.* }}expressions alone.release.ymlreads the slug frompackage.json(f4f5d12).--in-place) renders onlyplugin-template/. Before, it also rendered the scaffold's own docs and workflows.mustache^4.2.0 is added as a devDependency. The lockfile gains only its entry;npm installalso wanted to prune an unrelated subtree, which I left out.Tags that rendered empty (
76ec47c,d0b760b){{taxonomy_slug}}and{{post_type_slug}}were never set, so content-model plugins shippedQueryControls,TaxonomyFilter,PostSelectoranduseTaxonomieswith an empty taxonomy or post type. They now get the first taxonomy and post type, orcategoryandpost.TaxonomyFilteralso defaulted to<taxonomy>_category, which is never registered.{{pot_date}}was never set, so every.potfile had an emptyPOT-Creation-Date.src/utils/query.jsdefaulted to an empty post type, and a content-model plugin with no post types rendered pattern slugs and field group locations with an empty post type. Both now use the first post type, orpost. In functional-only plugins, the example field groups still attach to no post type.QueryControlskeystaxQueryby aTAXONOMYconstant. With a real taxonomy,taxQuery?.[ 'region' ]failed ESLint's dot-notation rule, and a slug with a hyphen needs brackets.DEVELOPMENT.mdlists the plugin's names instead of the template tag syntax, which means nothing inside a plugin.Testing
node scripts/toolchain/check-generation.js: both fixtures pass generate, leftover check, install, build, every lint step andtest:unit.compare-toolchain.jsfinds no differences between a freshly generatedls-testand the ls-test branch.npx jest scripts: no failing test that does not already fail ondevelop. New tests cover dotted filters, no escaping,findUnsetTags()and unrendered workflows.Not changed
scripts/mustache-variables-registry.jsonand its scanner cover the whole repository and are not used by the generator, so the registry still lists the oldname|filterforms until it is regenerated.🤖 Generated with Claude Code