Skip to content

Latest commit

 

History

History
139 lines (88 loc) · 3.58 KB

File metadata and controls

139 lines (88 loc) · 3.58 KB

CONTRIBUTING

Contributions are always welcome, no matter how large or small. Before contributing, please read the code of conduct.

Setup

Install node & npm on your system: https://nodejs.org/en/download/

Package Manager

This project uses pnpm as the package manager. If you don't have pnpm installed, you can install it globally:

# Install pnpm globally
npm install -g pnpm

# Or using other methods:
# curl -fsSL https://get.pnpm.io/install.sh | sh -
# brew install pnpm (on macOS)

Install dependencies

Only required when setting up the project

$ git clone https://github.com/davidwells/analytics
$ cd analytics
$ pnpm run setup

Because analytics has a large number of packages, we need to also install watchman for better watching.

brew update
brew install watchman

Run locally

To run analytics locally follow these steps:

  1. Make sure you have run pnpm run setup to install all packages
  2. Run pnpm run build to ensure analytics packages are built
  3. Run watch mode pnpm run watch to have changes reflected live in the demo app.
  4. In a new terminal window, change directories into the /examples/demo folder & install the demo apps dependencies pnpm install
  5. Finally, you can start the demo app with pnpm start

If you have any questions please ping @DavidWells on Twitter.

Available scripts

setup

Installs and sets up all analytics package dependencies.

Usage

$ pnpm run setup

watch

Watches all analytics packages and builds them on change.

Usage

$ pnpm run watch

clean

Removes all of the analytics packages dist directories.

Usage

pnpm run clean

reset

Runs the clean script and removes all the node_modules from the analytics packages.

Usage

pnpm run reset

build

Runs the clean script and builds the analytics packages.

Usage

pnpm run build

test

Runs all the analytics packages tests.

Usage

pnpm run test

Pull Requests

We actively welcome your pull requests!

If you need help with Git or our workflow, please ask on David on twitter. We want your contributions even if you're just learning Git. Our maintainers are happy to help!

Analytics uses the Forking Workflow + Feature Branches. Additionally, PR's should be rebased on master when opened, and again before merging.

  1. Fork the repo.
  2. Create a branch from master. If you're addressing a specific issue, prefix your branch name with the issue number.
  3. If you've added code that should be tested, add tests.
  4. If you've changed APIs, update the documentation.
  5. Run pnpm run test and ensure the test suite passes.
  6. PR's must be rebased before merge (feel free to ask for help).
  7. PR should be reviewed by two maintainers prior to merging.

Troubleshooting

Publishing error

Hard link is not allowed means the node_modules folder is in the npm package. Delete those from /analytics-core/{client|server} dirs.

License

By contributing to analytics, you agree that your contributions will be licensed under its MIT license.