behavioral-analytics-tracker

Stars
0
Committers
2

Behavioral Analytics Tracker Mono Repo

This repository contains the source code for the Behavioral Analytics Tracker.

Packages

JavaScript Tracker

The JavaScript tracker is a library that allows you to track events from your web application. It is available as a npm package.

You can find more information about the JavaScript tracker in the README.

Browser Tracker

The Browser tracker is a library that allows you to embed the Behavioral Analytics tracker in your web application. It is as a script that you can include in your web application.

You can find more information about the Browser tracker in the README.

Versioning & Publishing

All packages are versioned and published using changesets. For convenience, the following commands are available on the root:

For every PR:

  • yarn changeset: Create a new changeset. Run every time you make a change to the packages. You will be prompted to select the packages that have changed and the type of change. A changeset file will be created in the .changeset folder. You can have multiple changesets in the same PR.

For every release:

  • yarn publish-packages: Will run the build & test tasks. Then will adjust the package versions based on changesets and publish the packages to npm.

Development

All packages have unit tests. To run the tests, run the following command on the root of the repository:

yarn test

This will run the tests for all packages.

Linting

All packages have linting rules. To run the linter, run the following command on the root of the repository:

yarn lint

Integration tests

We have cypress tests for the repository and a small test app. Follow the instructions in the README to run the tests. You must run the yarn deploy script in the packages/browser-tracker directory to copy the distribution to the test app.

Updating the distribution

The browser-tracker is distributed as a script that is part of the ent-search distribution. When the browser-tracker is updated, the distribution needs to be updated as well. To do so, run the following command:

make deploy ent_search_dir=<path-to-ent-search>