1 | # Contributing
|
2 |
|
3 |
|
4 | Check out the [contribution guide on DoneJS.com](https://donejs.com/contributing.html) for information on:
|
5 |
|
6 | - [Code of Conduct](https://donejs.com/contributing.html#section=section_CodeofConduct)
|
7 | - [Getting Help](https://donejs.com/contributing.html#section=section_GettingHelp)
|
8 | - [Project Organization](https://donejs.com/contributing.html#section=section_ProjectOrganization)
|
9 | - [Reporting Bugs](https://donejs.com/contributing.html#section=section_ReportingBugs)
|
10 | - [Suggesting Features](https://donejs.com/contributing.html#section=section_SuggestingFeatures)
|
11 | - [Finding Ways to Contribute](https://donejs.com/contributing.html#section=section_FindingWaystoContribute)
|
12 | - [Finding open issues](https://donejs.com/contributing.html#section=section_Findingopenissues)
|
13 | - [Getting involved in the community](https://donejs.com/contributing.html#section=section_Gettinginvolvedinthecommunity)
|
14 | - [Spreading the word](https://donejs.com/contributing.html#section=section_Spreadingtheword)
|
15 | - [Developing Locally](https://donejs.com/contributing.html#section=section_DevelopingLocally)
|
16 | - [Signing up for GitHub](https://donejs.com/contributing.html#section=section_SigningupforGitHub)
|
17 | - [Forking & cloning the repository](https://donejs.com/contributing.html#section=section_Forking_cloningtherepository)
|
18 | - [Installing the dependencies](https://donejs.com/contributing.html#section=section_Installingthedependencies)
|
19 | - [Running the tests](https://donejs.com/contributing.html#section=section_Runningthetests)
|
20 | - [Building the documentation](https://donejs.com/contributing.html#section=section_Buildingthedocumentation)
|
21 | - [Viewing the site](https://donejs.com/contributing.html#section=section_Viewingthesite)
|
22 | - [Changing the Code](https://donejs.com/contributing.html#section=section_ChangingtheCode)
|
23 | - [Creating a new branch](https://donejs.com/contributing.html#section=section_Creatinganewbranch)
|
24 | - [Style guide](https://donejs.com/contributing.html#section=section_Styleguide)
|
25 | - [Updating the tests](https://donejs.com/contributing.html#section=section_Updatingtests)
|
26 | - [Updating the documentation](https://donejs.com/contributing.html#section=section_Updatingthedocumentation)
|
27 | - [Submitting a pull request](https://donejs.com/contributing.html#section=section_Submittingapullrequest)
|
28 | - [Updating DoneJS.com](https://donejs.com/contributing.html#section=section_UpdatingDoneJS_com)
|
29 | - [Evangelism](https://donejs.com/contributing.html#section=section_Evangelism)
|
30 | - [Writing a blog article](https://donejs.com/contributing.html#section=section_Writingablogarticle)
|
31 | - [Speaking at a conference or meetup](https://donejs.com/contributing.html#section=section_Speakingataconferenceormeetup)
|
32 | - [Organizing a DoneJS meetup](https://donejs.com/contributing.html#section=section_OrganizingaDoneJSmeetup)
|
33 |
|
34 | The rest of this guide has information that’s specific to this repository.
|
35 |
|
36 | ## Developing Locally
|
37 |
|
38 | ### Forking & cloning the repository
|
39 |
|
40 | ```shell
|
41 | git clone git@github.com:bitovi/syn.git
|
42 | cd syn
|
43 | ```
|
44 |
|
45 | ### Installing the dependencies
|
46 |
|
47 | ```shell
|
48 | npm install
|
49 | ```
|
50 |
|
51 | ### Running the tests
|
52 |
|
53 | You can run the tests with:
|
54 |
|
55 | ```shell
|
56 | npm test
|
57 | ```
|
58 |
|
59 | ### Making a build
|
60 |
|
61 | You can create a new build in the `dist` folder with:
|
62 |
|
63 | ```shell
|
64 | npm run build
|
65 | ```
|
66 |
|
67 | ## Changing the Code
|
68 |
|
69 | All source files are in the _src_ folder. Here's what each files does:
|
70 |
|
71 | - _browsers.js_ - Contains the output of _utils/recorder.html_ data.
|
72 | - _drag.js_ - Drag / drop utility.
|
73 | - _key.js_ - Typing and key event simulation.
|
74 | - _key.support.js_ - Feature detection of key event behavior.
|
75 | - _mouse.js_ - Click and mouse event simulation.
|
76 | - _mouse.support.js_ - Feature detection of mouse event behavior.
|
77 | - _syn.js_ - Main entrypoint that loads all other modules.
|
78 | - _synthtic.js_ - Creates the `syn` object and adds helpers used by other modules.
|
79 | - _typeable.js_ - Used to test if an element can be typed into.
|
80 |
|
81 | Tests are in the _test_ folder.
|
82 |
|
83 | _utils/recorder.html_ is used to record behaviors of the browser that can not be feature detected. Those
|
84 | behaviors are added to _src/browser.js_.
|
85 |
|
86 | ### Updating tests
|
87 |
|
88 | Please add a test within the _tests_ folder and make your changes to _syn.js_ source files in the _src_
|
89 | folder. For a quick check that everything is working, open _test/test.html_.
|
90 |
|
91 | After updating the tests, make sure you [run the tests](#running-the-tests).
|
92 |
|
93 | ## Publishing & Releasing
|
94 |
|
95 | This project follows the [Semantic Versioning](http://semver.org/) guidelines in the form of `MAJOR.MINOR.PATCH` for:
|
96 |
|
97 | - `MAJOR` version when you make incompatible API changes,
|
98 | - `MINOR` version when you add functionality in a backwards-compatible manner, and
|
99 | - `PATCH` version when you make backwards-compatible bug fixes.
|
100 |
|
101 | Before making any release please make sure that:
|
102 |
|
103 | - You have write access to this GitHub repository.
|
104 | - Have an [npm](https://www.npmjs.com) account and are logged in on the CLI tool (`npm whoami`).
|
105 | - 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](https://www.npmjs.com/package/syn/access).
|
106 |
|
107 | To make a release:
|
108 |
|
109 | 1. Switch to the `master` branch: `git checkout master`
|
110 | 2. Fetch all latest changes from the repository: `git fetch --all && git rebase`
|
111 | 3. Reinstall the Node modules: `npm cache clean && npm install`
|
112 | 4. Run `npm run release:<versiontype>`. For example, to make a `PATCH` release:
|
113 |
|
114 | ```
|
115 | npm run release:patch
|
116 | ```
|
117 |
|
118 | This will run the tests, build, bump the version number accordingly, and publish [the module to npm](https://www.npmjs.com/package/syn/).
|