Skip to content

Latest commit

 

History

History
71 lines (45 loc) · 3.31 KB

contributing.md

File metadata and controls

71 lines (45 loc) · 3.31 KB

Contributing to FingerprintJS Pro React integration

Working with code

We prefer using pnpm for installing dependencies and running scripts.

The main branch is locked for the push action. For proposing changes, use the standard pull request approach. It's recommended to discuss fixes or new functionality in the Issues, first.

Development playground

There are 4 demo pages for this integration:

  1. In /examples/create-react-app folder. It is a rich demo with scenarios of using different caching strategies. You can find more info about configuration and starting demo in the readme.
  2. In /examples/next folder. It is a demo built with NextJS that allows testing SSR scenarios. You can find more info about configuration and starting demo in the readme.
  3. In /examples/next-appDir folder. It is the same demo built with NextJS, but with new app directory approach. You can find more info about configuration and starting demo in the readme.
  4. In /examples/preact folder. It is a demo built with Preact. You can find more info about configuration and starting demo in the readme.
  5. In /examples/webpack-based folder. It is a simple demo built with raw webpack.

If you want to test integration with fingerprintjs-pro-spa, just link the package with the pnpm link <spa-directory>.

❗ Build projects before testing integration. First build fingerprintjs-pro-spa, then fingerprintjs-pro-react, and then start spa example app.

How to build

Just run:

pnpm build

Code style

The code style is controlled by ESLint and Prettier. Run to check that the code style is ok:

pnpm lint

You aren't required to run the check manually, the CI will do it. Run the following command to fix style issues (not all issues can be fixed automatically):

pnpm lint:fix

How to test

Tests are located in __tests__ folder and run by jest in jsdom environment.

To run tests you can use IDE instruments or just run:

pnpm test

To check the distributive TypeScript declarations, build the project and run:

pnpm test:dts

How to publish

The library is automatically released and published to NPM on every push to the main branch if there are relevant changes using semantic-release with following plugins:

The workflow must be approved by one of the maintainers, first.