Skip to main content

How to contribute to doxygen2docusaurus

GitHub package.json version NPM Version license GitHub issues GitHub pulls TypeScript ESLint license

This page is designed for developers who intend to contribute new features or resolve bugs within the Doxygen Documentation Converter project and provides documentation on building and testing the package.

Prerequisites

@xpack/doxygen2docusaurus is a portable Node.js project; development can be conducted on macOS, GNU/Linux and Windows (although some npm scripts must be executed within a Git Bash terminal).

The prerequisites are:

  • git
  • node >= 20.0.0
  • npm

To ensure compatibility with older node versions, it is preferable to revert to an older one:

nvm use --lts 20
code

Obtain project sources

The project is hosted on GitHub:

Branches

This project utilises multiple branches:

  • master, containing the latest stable version (default)
  • development, containing the current development version
  • website, containing the current website content; pushes to this branch automatically trigger publication of the main website
  • webpreview, containing the current preview website content; pushes to this branch automatically trigger publication of the preview website

All development is conducted in the development branch, and contributions via Pull Requests should be directed to this branch.

When new releases are published, the development branch is merged into master.

To clone the stable branch (master), execute the following commands in a terminal (on Windows use the Git Bash console):

rm -rf ~/Work/xpack/doxygen2docusaurus-cli-ts.git && \
mkdir -p ~/Work/xpack && \
git clone \
--branch master \
https://github.com/xpack/doxygen2docusaurus-cli-ts.git \
~/Work/xpack/doxygen2docusaurus-cli-ts.git
For development purposes, clone the development branch.
rm -rf ~/Work/xpack/doxygen2docusaurus-cli-ts.git && \
mkdir -p ~/Work/xpack && \
git clone \
--branch development \
https://github.com/xpack/doxygen2docusaurus-cli-ts.git \
~/Work/xpack/doxygen2docusaurus-cli-ts.git

Alternatively, if the repository has already been cloned:

git -C ~/Work/xpack/doxygen2docusaurus-cli-ts.git pull
tip

To contribute Pull Requests, fork the project and ensure the Copy the master branch only is disabled.

Utilise the development branch and ensure you contribute the Pull Requests back to the development branch.

During development, it is convenient to maintain a writable instance of the source code to enable changes in parallel with the parent project.

To facilitate the use of a writable instance of this source code in other projects, add a link from the user's global npm store to this local development folder:

npm link -C ~/Work/xpack/doxygen2docusaurus-cli-ts.git

And in the projects referring it:

npm link @xpack/doxygen2docusaurus

Satisfy dependencies

npm install

Start the compile background task

The TypeScript compiler can automatically recompile modified files. For this, start it in watch mode.

npm run compile-watch

Language standard compliance

The current version is compiled with TypeScript 5.8.3:

The compiler is configured to produce ECMAScript6 es2020 files that can be imported by any other project either via import.

For more details on how to configure tsconfig.json, please see:

Style

As style, the project uses typescript-eslint, a set of rules for static analysis of JavaScript and TypeScript code

For spacial cases, it is possible to configure/disable some rules.

/* eslint-disable-next-line no-xxx-yyy */

The known rules are documented in the eslint project.

Known and accepted exceptions:

  • none

Prettier

The project uses Prettier to format the code.

Documentation metadata

The documentation metadata utilises the TSDoc tags, without explicit types, as they are provided by TypeScript.

Tips & tricks

To trace TypeScript module resolution:

    "compile": "tsc --traceResolution  -p ./",