HF-249 bullet 3: generate built-in functions docs from the HF API (single source of truth)#1699
Open
marcin-kordas-hoc wants to merge 15 commits into
Open
Conversation
…ation preserves it (HF-249)
…API (HF-249) getAvailableFunctions/getFunctionDetails excluded the protected functions OFFSET and VERSION because they have no plugin for resolveFunctionMetadata to read arity from. A user can still call both from a formula, so they must be documented too: getListableFunctionIds (static and instance) now include the protected ids, and resolveFunctionMetadata resolves them from a new authored PROTECTED_FUNCTION_METADATA map together with their catalogue FunctionDoc entries in the lookup-and-reference and information categories.
…d VERSION (HF-249)
…venance comments (HF-249) Mirror buildAvailableFunctions' canonicalName tiebreaker in the built-in functions table renderer so equal localizedNames sort deterministically regardless of input order. Also soften the information/lookup-and-reference category file comments, which claimed full ownership by scripts/hf249-migrate-function-docs.ts even though they now carry hand-authored protected-function entries (VERSION, OFFSET).
Contributor
|
Task linked: HF-249 HF function documentation available via API |
Performance comparison of head (4b5ef17) vs base (8207bf3) |
Collaborator
Author
|
Paired tests PR: handsontable/hyperformula-tests#19 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feature/hf-249-function-metadata-api #1699 +/- ##
========================================================================
+ Coverage 97.17% 97.18% +0.01%
========================================================================
Files 192 195 +3
Lines 15446 15499 +53
Branches 3412 3422 +10
========================================================================
+ Hits 15009 15063 +54
+ Misses 437 436 -1
🚀 New features to boost your workflow:
|
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.
HF-249 bullet 3 — build the docs functions table from HyperFormula (single source of truth)
Third in-scope bullet of HF-249: the built-in functions table in
docs/guide/built-in-functions.mdis now generated from the public API (getAvailableFunctions/getFunctionDetails) instead of being hand-maintained, so function data lives in one place.What's here
src/interpreter/functionMetadata/(browser-safe, not exported from the package index):formatFunctionSyntax(reuses the reviewed syntax convention),renderBuiltinFunctionsTable,spliceFunctionsTable.scripts/generate-builtin-functions-doc.ts(excluded from the npm package viatsconfig include:["src"]): sources data only from the API, splices the table betweenAUTOGENERATED:FUNCTIONSmarkers; hand-written prose and footnote defs stay outside. Deterministic (pinnedIntl.Collator, LF, byte-idempotent).<a id="canonicalName">) on every row — deep-linkable, ready to backdocumentationUrl.getAvailableFunctions/getFunctionDetailsnow return them; the table has 418 functions.npm run docs:functions:check(byte-drift + Function-ID membership) wired into thebuild-docsCI workflow before the docs build;npm run docs:generate-functionsregenerates.Verification
npm run docs:buildclean;verify:typings+lintclean; drift check green in-sync.feature/hf-249-docs-single-source.Base:
feature/hf-249-function-metadata-api(ships together with the HF-249 API in #1692).Note
Medium Risk
Expands the public function-metadata API (protected ids) and replaces a large hand-maintained doc with generated output; runtime formula behavior is largely unchanged, but API consumers and docs must stay in sync via the new check.
Overview
The built-in functions guide no longer maintains a hand-written table: content between
AUTOGENERATED:FUNCTIONSmarkers inbuilt-in-functions.mdis produced bynpm run docs:generate-functions, which callsgetAvailableFunctions/getFunctionDetailsand splices markdown viarenderBuiltinFunctionsTable.npm run docs:functions:checkruns in the build-docs workflow so CI fails on stale output or changed function membership.The metadata API now lists protected
OFFSETandVERSION(catalogue entries +PROTECTED_FUNCTION_METADATA, early resolution inresolveFunctionMetadata, andgetListableFunctionIdson static and instance registries), so the generated docs match what users can call. Rows gain per-function anchors and syntax strings fromformatFunctionSyntax.DEV_DOCS and CHANGELOG document the single-source-of-truth workflow.
Reviewed by Cursor Bugbot for commit 4b5ef17. Bugbot is set up for automated code reviews on this repo. Configure here.