Skip to content

Commit b82dd38

Browse files
authored
feat(api): full PHP API coverage for products flagged fullApi (Gravity Forms) (#5)
Adds a per-product `fullApi` flag (repos-config.json) that documents every non-internal class and non-underscore function, bypassing the @api/@see reference filter. Enables it for Gravity Forms, whose canonical classes (GFAPI, GFCommon, GFFormsModel, ...) are not @api-tagged upstream. gravityforms: 13 -> 627 symbols (353 classes, 274 functions); GFAPI now documented (57 methods).
1 parent e70436a commit b82dd38

2 files changed

Lines changed: 15 additions & 8 deletions

File tree

repos-config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@
290290
{
291291
"id": "gravityforms",
292292
"repo": "gravityforms/gravityforms",
293+
"fullApi": true,
293294
"label": "Gravity Forms",
294295
"description": "The best WordPress form plugin. Starter templates, advanced calculations, and more.",
295296
"category": "gravity-forms",

scripts/generate-php-api.mjs

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2047,11 +2047,14 @@ function main() {
20472047
const hasReferencedMethods = referencedMethods.size > 0;
20482048
const isReferenced = classReferenced || hasReferencedMethods;
20492049

2050-
// Include if: explicitly marked @api/@public, referenced in @see, or has meaningful docs (when no filter)
2050+
// Include if: explicitly marked @api/@public, referenced in @see, or has meaningful docs (when no filter).
2051+
// Products flagged `fullApi` (e.g. Gravity Forms) document every non-internal class.
20512052
const markedPublic = isMarkedPublicApi(doc) || methods.some((m) => isMarkedPublicApi(m));
2052-
const publicApi = markedPublic || (hasReferenceFilter
2053-
? isReferenced
2054-
: (hasMeaningfulDoc(doc) || methods.some((m) => hasMeaningfulDoc(m))));
2053+
const publicApi = product.fullApi
2054+
? true
2055+
: markedPublic || (hasReferenceFilter
2056+
? isReferenced
2057+
: (hasMeaningfulDoc(doc) || methods.some((m) => hasMeaningfulDoc(m))));
20552058

20562059
return {
20572060
...c,
@@ -2086,11 +2089,14 @@ function main() {
20862089
// Check if function is referenced in @see
20872090
const isReferenced = referencedSymbols.functions.has(fqfn) || referencedSymbols.functions.has(funcName);
20882091

2089-
// Include if: explicitly marked @api/@public, referenced in @see, or has meaningful docs (when no filter)
2092+
// Include if: explicitly marked @api/@public, referenced in @see, or has meaningful docs (when no filter).
2093+
// Products flagged `fullApi` document every non-underscore function.
20902094
const markedPublic = isMarkedPublicApi(doc);
2091-
const publicApi = markedPublic || (hasReferenceFilter
2092-
? isReferenced
2093-
: (hasMeaningfulDoc(doc) && !funcName.startsWith('_')));
2095+
const publicApi = product.fullApi
2096+
? !funcName.startsWith('_')
2097+
: markedPublic || (hasReferenceFilter
2098+
? isReferenced
2099+
: (hasMeaningfulDoc(doc) && !funcName.startsWith('_')));
20942100

20952101
return {
20962102
...f,

0 commit comments

Comments
 (0)