Skip to content

Latest commit

 

History

History
79 lines (52 loc) · 2.46 KB

CONTRIBUTING.md

File metadata and controls

79 lines (52 loc) · 2.46 KB

Contributing to Experience.js

Folder structure

  • packages/: Experience.js is a NX monorepo containing Ninetailed SDKs and plugins. You can learn more about monorepo here and the packages/ structure.
    • playgrounds/: Testing projects to experiment with the SDKs and plugins with common frameworks such as gatsby, next.js, etc.
    • plugins/: contains plugins that can be used with the SDKs such as google analytics, preiew plugins, insights, etc.
    • sdks/: contains the Software Development Kits (SDKs) for js, node, and different frameworks such as React, Next, Gatsby, etc.
    • utils/ contains utilities used by the tests, SDKs and plugins
  • tools/: internal tooling

Building the Project

After cloning the project to your machine, to install the dependencies, run:

yarn

yarn prepare

To build all the packages, run:

nx run-many --target=build

Running Unit Tests

To make sure your changes do not break any unit tests or build, run the following:

nx affected --target=test

nx affected --target=build

Running E2E tests (only for Ninetailed crew)

This step is only possible to be run by Ninetailed members. The CI will run it for you if you don't have access.

doppler login
doppler secrets download --no-file --format=env --project=experience-js-sdks --config=dev > ./.env
# https://nx.dev/recipes/tips-n-tricks/define-environment-variables

Publishing to a local registry

To test if your changes will actually work once the changes are published, it can be useful to publish to a local registry.

Start the local NPM registry verdaccio in 1 tab with:

nx local-registry

Open a new tab in your terminal, and run the following script to publish to your local registry:

./tools/bump_and_publish_sdks.sh
# then select the version you wish to locally publish

Then use the new version in a fresh repo or on a demo repo. You can update package.json and run npm i to install the local package.

Submitting a PR

Please follow the following guidelines:

  • Make sure unit tests pass (nx affected --target=test)
  • Make sure builds pass (nx affected --target=build)
  • Make sure you run nx format
  • Update documentation if needed
  • Update your commit message to follow the guidelines below

Commit Message Guidelines

Please follow the conventional commit convention: https://www.conventionalcommits.org/en/v1.0.0/