Skip to content

Latest commit

 

History

History
118 lines (86 loc) · 5.49 KB

CONTRIBUTING.md

File metadata and controls

118 lines (86 loc) · 5.49 KB

Contributing

Check out the contribution guide on DoneJS.com for information on:

The rest of this guide has information that’s specific to this repository.

Developing Locally

Forking & cloning the repository

git clone [email protected]:bitovi/syn.git
cd syn

Installing the dependencies

npm install

Running the tests

You can run the tests with:

npm test

Making a build

You can create a new build in the dist folder with:

npm run build

Changing the Code

All source files are in the src folder. Here's what each files does:

  • browsers.js - Contains the output of utils/recorder.html data.
  • drag.js - Drag / drop utility.
  • key.js - Typing and key event simulation.
  • key.support.js - Feature detection of key event behavior.
  • mouse.js - Click and mouse event simulation.
  • mouse.support.js - Feature detection of mouse event behavior.
  • syn.js - Main entrypoint that loads all other modules.
  • synthtic.js - Creates the syn object and adds helpers used by other modules.
  • typeable.js - Used to test if an element can be typed into.

Tests are in the test folder.

utils/recorder.html is used to record behaviors of the browser that can not be feature detected. Those behaviors are added to src/browser.js.

Updating tests

Please add a test within the tests folder and make your changes to syn.js source files in the src folder. For a quick check that everything is working, open test/test.html.

After updating the tests, make sure you run the tests.

Publishing & Releasing

This project follows the Semantic Versioning guidelines in the form of MAJOR.MINOR.PATCH for:

  • MAJOR version when you make incompatible API changes,
  • MINOR version when you add functionality in a backwards-compatible manner, and
  • PATCH version when you make backwards-compatible bug fixes.

Before making any release please make sure that:

  • You have write access to this GitHub repository.
  • Have an npm account and are logged in on the CLI tool (npm whoami).
  • Your user is a collaborator on npm. You can ask an existing collaborator to add you. Existing collaborators can be listed via npm owner ls <packagename> or on the collaborators page on npm.

To make a release:

  1. Switch to the master branch: git checkout master
  2. Fetch all latest changes from the repository: git fetch --all && git rebase
  3. Reinstall the Node modules: npm cache clean && npm install
  4. Run npm run release:<versiontype>. For example, to make a PATCH release:
npm run release:patch

This will run the tests, build, bump the version number accordingly, and publish the module to npm.