We prefer using pnpm for installing dependencies and running scripts.
You cannot push into the main branch.
We always use the main branch to create releases.
For proposing changes, use the standard pull request approach. We recommend to discuss fixes or new functionality in the Issues, first. Create pull requests into main branch.
After cloning the repo, run pnpm install to install packages.
Run pnpm build for creating a build in dist folder. After building, the dist/fingerprint-pro-segment-source-function.js file is created. This file is also used as the release artifact on GitHub.
This project depends on the Fingerprint Webhook OpenAPI Schema. Run pnpm generateTypes to apply the latest webhook type changes.
The code style is controlled by ESLint and Prettier. Run to check that the code style is ok:
pnpm lintYou 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:fixFollow the conventional commits rules.
Run pnpm test to run unit and integration tests.
For running end-to-end tests locally, follow these steps:
- Ensure you have playwright installed
- Create an
.envfile (look at.env.example) - Populate
.envwith required fields - Run
pnpm test:e2e-local
The workflow release.yml is used for releasing a new version. Run it on the main branch. It uses semantic-release, so it will create a new release, generate release notes, and add the dist/fingerprint-pro-segment-source-function.js file as an artifact. As a result, the latest source function is reachable through the latest release artifact link.