[build] Fix Bazel JSDocs implementation#16949
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||||||
There was a problem hiding this comment.
Pull request overview
This PR fixes JavaScript documentation generation in Bazel by correcting JSDoc syntax and properly configuring the jsdoc binary. The fix was verified during yesterday's release.
Changes:
- Fixed JSDoc type annotation syntax for optional properties to use union types instead of TypeScript-style optional syntax
- Added jsdoc binary configuration to Bazel build rules
- Updated jsdoc.bzl rule to accept and use the configured jsdoc binary
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| javascript/selenium-webdriver/bidi/storage.js | Fixed JSDoc return type syntax from partitionKey?: PartitionKey to partitionKey: (PartitionKey|undefined) for proper JSDoc parsing |
| javascript/selenium-webdriver/BUILD.bazel | Added jsdoc binary import and configuration, passing jsdoc_binary parameter to the jsdoc rule |
| javascript/private/jsdoc.bzl | Enhanced jsdoc rule to accept jsdoc_binary parameter, use it in generated scripts, and merge its runfiles for proper execution |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
User description
💥 What does this PR do?
🔧 Implementation Notes
This fix was verified successful during yesterday's release
🔄 Types of changes
PR Type
Bug fix
Description
Fix Bazel jsdoc rule to properly reference npm-managed jsdoc binary
Update jsdoc templates to output to workspace build directory
Add verification that documentation was successfully generated
Correct JSDoc type annotation for optional partition key property
Diagram Walkthrough
File Walkthrough
jsdoc.bzl
Refactor jsdoc rule templates and add binary attributejavascript/private/jsdoc.bzl
jsdoc_binaryattribute to rule definition for npm-managed jsdocbinary
workspace build directory
directory
generated
BAZEL_BINDIRenvironment variable to suppress rules_js errorsBUILD.bazel
Wire npm jsdoc binary to docs rule targetjavascript/selenium-webdriver/BUILD.bazel
package_json.bzljsdoc_bintarget wrapping the npm jsdoc binaryjsdoc_binaryattribute to jsdoc rule invocationstorage.js
Fix JSDoc type annotation for optional propertyjavascript/selenium-webdriver/bidi/storage.js
@returnstype annotation forgetCookiesmethodpartitionKey?: PartitionKeytopartitionKey:(PartitionKey|undefined)for proper type documentation