phcode-dev / phoenix

Phoenix is a modern open-source Code Editor for the web, built for the browser.
https://phcode.io
GNU Affero General Public License v3.0
1.78k stars 124 forks source link

docs: refine API docs for files in Command dir #1906

Closed devvaannsh closed 2 weeks ago

devvaannsh commented 4 weeks ago

The following changes are made:-

API Documentation Cleanup: Removed all internal details from the API docs. Now, only the exports.* content is included.

DefaultMenus.js Exclusion: This file is internal, so it won’t show up in the API docs anymore.

Refactor in Menus.js: The object literals inside MenuSection are now declared separately and assigned to the MenuSection object afterward. This doesn’t affect any existing functionality. The change was made because Docusaurus had trouble parsing nested object literals when generating markdown, which caused errors.

devvaannsh commented 4 weeks ago

The tests were failing because in file Menus.js, the variables were used before they were initialized! Fixed the issue!

devvaannsh commented 3 weeks ago

In keybindingManager.js, the @private tags are placed after the function description. Why? Because the jsdoc-2-md library showed a warning that @private tags cannot have a description. So, if @private is defined above the description, it mistakenly treats the description as part of @private.

In keybindingManager.js, the @type tag for UN_SWALLOWED_EVENTS was changed from {(string)[]} to {Array.}, because the former format is invalid and throws an error.

In Commands.js, each export needs to be handled separately. JSDoc should be added for each export individually so that they show up correctly in the API docs.

sonarcloud[bot] commented 3 weeks ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

abose commented 2 weeks ago

LGTM. Thanks for contributing @devvaannsh