Skip to content

Latest commit

 

History

History
86 lines (66 loc) · 2.91 KB

CONTRIBUTING.md

File metadata and controls

86 lines (66 loc) · 2.91 KB

Contributing to Watching-You

We welcome contributions to improve this DOM animation library that enables element tracking across multiple frameworks. This document provides essential guidelines for setting up your development environment, implementing new features.

Development Environment Setup

Prerequisites

Initial Setup

  1. Fork repository
  2. Clone repository: git clone https://github.com/[your-username]/watching-you.git // e.g. git clone https://github.com/[your-username]/watching-you.git
  3. Install dependencies: yarn install from root directory

Building and Running

Core Development

cd packages/core
yarn start # Starts core package in dev mode

Framework

For framework-specific development (React, Vue, etc.):

cd packages/[framework-name]
yarn start # Starts framework implementation in dev mode

Tips

Implementing New Targets

Targets define coordinate calculation logic for different element types. To create a new target type:

  1. Create new file in packages/core/src/targetPlugin folder
  2. Implement class extending BaseTarget interface (packages/core/src/type/Target.ts):
  3. Register target in plugin index:
// packages/core/src/targetPlugin/index.ts
+ import NewTarget from './NewTarget';

const targetPlugins = {
  // Existing targets
  mouse: MouseTarget,
  // Add new entry
+ newTarget: NewTarget
};

You can refer to other files in packages/core/src/targetPlugin/* for details on how to develop watching-you target

Support a New Framework

  1. Create new package in packages folder
  2. implementing (ref: package/react)

Testing

Our testing strategy focuses on real-world usage scenarios (after build):

  1. Build all dependencies: Always run yarn build in both core and all relevant framework packages before testing
cd packages/core
yarn build
cd ../react
yarn build
cd ../vue
yarn build
  1. Start test environment:
cd packages/tests
yarn start

PULL REQUEST

Feel free to open PRs, but please note that more comprehensive descriptions will help reviewers better understand your contributions and increase the likelihood of merging.

Here are some tips to improve merge probability:

  1. PR Description: Provide complete and clear documentation of your contribution in the pull request description
  2. Commit Hygiene: Maintain clean, atomic commits
  3. Test Coverage: When contributing new features or bug fixes, please add corresponding test cases in packages/tests to validate functionality