Repository navigation
Update apigen dependencies - #6846
Merged
Merged
Conversation
PHPDoc descriptions are rendered as Markdown, which passes inline HTML through. A type such as array<int> written in a description therefore lost its <int>, because browsers treat it as an unknown tag. league/commonmark 2.10.3 also stopped escaping tags with uppercase letters, so array<T> would lose its <T> as well. Keep the formatting tags PHPDocs use, such as <code>, and escape the rest.
TypeScript 6 no longer includes every package in typeRoots by default, so list the Node.js types explicitly. Amp-Thread-ID: https://ampcode.com/threads/T-01a176c6-528a-7430-b296-e66930d153b4
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.
Updates ApiGen and the apiref.phpstan.org CDK app in small steps, one commit per step.
ApiGen (
apigen/apigenis already pinned to the latest upstream master commit):array<int>in a description was rendered asarraybecause browsers treat<int>as an unknown tag. league/commonmark 2.10.3 also stopped escaping tags with uppercase letters (case insensitive for HTML attributes thephpleague/commonmark#1096), so after the updatearray<T>,<TKey>and similar would have disappeared too. A small HtmlInline renderer keeps the formatting tags PHPDocs actually use (php-parser uses<code>) and escapes the rest.I generated the docs locally before and after (
apigen -c apigen/apigen.neon --output docs -- src vendor/nikic/php-parser vendor/ondrejmirtes/better-reflection vendor/phpstan/phpdoc-parser). Both runs produce 1776 files. ApiGen lists implementers in a different order on each run, so I compared sorted file contents. The only differences are raw<…>generics that are now escaped.<code>in the php-parser pages is kept.apigen/infra (CDK app):
npm audit: 0 vulnerabilities)typeRootsby default, sotsconfig.jsonlists"types": ["node"].After every step,
npm run check,npm test(38 tests) andcdk synth --allpass. The synthesizedPhpstanApirefOidcRolesandPhpstanApirefWebsitetemplates are identical to the ones from before the change, apart from theCDKMetadataanalytics string, which encodes the CDK version.Not updated: TypeScript 7. It type-checks this code fine but no longer ships the JavaScript compiler API that ts-node uses, so
cdk synth(npx ts-node bin/infra.ts) fails. Moving to TypeScript 7 means replacing ts-node, for example with tsx. That is best done together with the main-site infra in phpstan/phpstan, which this app mirrors and which uses the same ts-node setup.Supersedes #6309 and #5925.