Repository navigation
feat(release): resolve @since version placeholders at release time - #547
faisalahammad wants to merge 2 commits into
Conversation
New SCF APIs can now use @SInCE SCF {NEXT_MAJOR_VERSION} instead of guessing the next version. The placeholder is replaced with the actual release version by composer prepare-release, after the maintainer enters and confirms the version, so annotations stay correct even when a release slips. Since_Resolver only rewrites the token inside an @SInCE annotation and normalises it to @SInCE SCF <version>. Legacy ACF tags and versions that are already resolved are left alone. The release script then regenerates the docs and commits just the resolved sources plus the generated reference files. Closes WordPress#151
|
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 Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Match the editor preview menu item with a tolerant pattern because WP trunk renamed it to Preview (opens in a new tab). Refs WordPress#547
CI Fix SummaryThe failing E2E checks were not caused by this PR. WordPress trunk renamed the editor preview menu item from "Preview in new tab" to "Preview (opens in a new tab)". The pinned test helper This is a trunk wide breakage that hits every branch, and it is already fixed on the Change
Test only change. No plugin runtime code touched. Errors fixed
Validation
Refs #547 |
Closes #151
New SCF APIs can now be written as
@since SCF {NEXT_MAJOR_VERSION}instead of guessing the version number.composer prepare-releasereplaces the placeholder with the real release version after the maintainer enters and confirms it, so annotations stay correct when a release slips and the version changes.Since_Resolverinbin/class-scf-since-resolver.phpscansincludes,srcandassets/srcfor PHP, JS, JSX, TS and TSX files. It only rewrites the token inside an@sinceannotation and normalises the result to@since SCF <version>, so legacy@since ACF ...tags, versions that are already resolved, and an unrelated placeholder in a string literal are left untouched. The resolver returns the list of changed files and fails loudly if a write does not go through.The release script calls it right after the changelog confirmation, then regenerates the docs and commits only the resolved source files plus
docs/code-referenceanddocs/bin/manifest.json. The commit is skipped when nothing changed.Contributor docs now describe the convention in
docs/contributing/index.md, anddocs/contributing/releases.mddocuments the release step.Two limits worth knowing:
pro/is not scanned because it has no@sincetags today, and the docs generator only parses PHP underincludes, so a placeholder insrc/or in JS is rewritten in source but does not show up in the generated code reference.Testing instructions
composer test:php(the newTest_SCF_Since_Resolvercovers placeholder replacement, existing ACF and SCF tags staying put, a bare placeholder outside an annotation being ignored, unsupported file types, and the no-op case)vendor/bin/phpunit --filter Test_SCF_Since_Resolver tests/phpcomposer lint:phpnpm run test:unitManual check: copy the plugin to a temp directory, add
@since SCF {NEXT_MAJOR_VERSION}to a PHP file underincludesand a JS file underassets/src, then run the resolver against that tree. The new annotations become@since SCF <version>, and existing@since ACF 6.1and@since SCF 6.9.5tags are unchanged.bin/andtests/are not part of the release zip, so this change has no effect on the distributed plugin. E2E tests were not run because nothing in the shipped runtime path changed.