If you would like to contribute an improvement or a fix please pay attention to these items:
To start development and improvement of the source code you should have the following things:
- git
- node.js (we recommend the latest LTS version)
- npm (the minimal supported version is 3.0.0)
- Playwright Chromium, installed as described in How to run unit tests locally
Firstly, you should clone a copy of the repository by using one of the following commands:
- HTTPS:
git clone https://github.com/Microsoft/powerbi-visuals-utils-chartutils.git - SSH:
git clone git@github.com:Microsoft/powerbi-visuals-utils-chartutils.git
After that, you should change the current working directory to powerbi-visuals-utils-chartutils by using the following command:
cd powerbi-visuals-utils-chartutilsAfter that, you should install dependencies by using the following command:
npm installThe final step is installation of necessary type declarations by using the following command:
npm run typings:installThe repository is ready for development now.
We use Less and TypeScript for the repository. To build source code you should run the following command:
npm run buildThis command compiles less code to CSS and TypeScript code to JavaScript. The result of the compilation is available in the lib directory.
We use eslint as a linter for TypeScript code. To check source code you should run the following command:
npm run lintThis command checks style of TypeScript code and provides a list of problems. Please address all of problems reported by eslint before sending a pull request to the repository.
We use Vitest in browser mode to run unit tests. Tests are executed in headless Chromium provided by Playwright, so make sure the browser is installed:
npx playwright install --with-deps chromiumTo run unit tests locally on your machine you should run the following command:
npm run testTo collect code coverage run:
npm run test:coverageTo run unit tests in watch mode you should run the following command:
npm run test:watchThis command runs unit tests in the browser and watches tests files, in other words, you have an ability to run unit tests automatically after any changing.