|
| 1 | +# vue-i18n-loader Contributing Guide |
| 2 | + |
| 3 | + |
| 4 | +- [Pull Request Guidelines](#pull-request-guidelines) |
| 5 | +- [Development Setup](#development-setup) |
| 6 | + |
| 7 | + |
| 8 | +## Pull Request Guidelines |
| 9 | + |
| 10 | +- The `master` branch is basically just a snapshot of the latest stable release. All development should be done in dedicated branches. **Do not submit PRs against the `master` branch.** |
| 11 | + |
| 12 | +- Checkout a topic branch from the relevant branch, e.g. `dev`, and merge back against that branch. |
| 13 | + |
| 14 | +- Work in the `src` folder and **DO NOT** checkin `dist` in the commits. |
| 15 | + |
| 16 | +- It's OK to have multiple small commits as you work on the PR - we will let GitHub automatically squash it before merging. |
| 17 | + |
| 18 | +- Make sure `npm test` passes. (see [development setup](#development-setup)) |
| 19 | + |
| 20 | +- If adding new feature: |
| 21 | + - Add accompanying test case. |
| 22 | + - Provide convincing reason to add this feature. Ideally you should open a suggestion issue first and have it greenlighted before working on it. |
| 23 | + |
| 24 | +- If fixing a bug: |
| 25 | + - Provide detailed description of the bug in the PR. Live demo preferred. |
| 26 | + - Add appropriate test coverage if applicable. |
| 27 | + |
| 28 | +### Work Step Example |
| 29 | +- Fork the repository from [kazupon/vue-i18n-loader](https://github.com/kazupon/vue-i18n-loader) ! |
| 30 | +- Create your topic branch from `dev`: `git branch my-new-topic origin/dev` |
| 31 | +- Add codes and pass tests ! |
| 32 | +- Commit your changes: `git commit -am 'Add some topic'` |
| 33 | +- Push to the branch: `git push origin my-new-topic` |
| 34 | +- Submit a pull request to `dev` branch of `kazupon/vue-i18n-loader` repository ! |
| 35 | + |
| 36 | +## Development Setup |
| 37 | + |
| 38 | +After cloning the repo, run: |
| 39 | + |
| 40 | + $ npm install |
| 41 | + |
| 42 | +### Commonly used NPM scripts |
| 43 | + |
| 44 | + # lint source codes |
| 45 | + $ npm run lint |
| 46 | + |
| 47 | + # run unit tests |
| 48 | + $ npm run test:unit |
| 49 | + |
| 50 | + # build all dist files, including npm packages |
| 51 | + $ npm run build |
| 52 | + |
| 53 | + # run the full test suite, include linting |
| 54 | + $ npm test |
| 55 | + |
| 56 | +There are some other scripts available in the `scripts` section of the `package.json` file. |
| 57 | + |
| 58 | +The default test script will do the following: lint with ESLint -> unit tests with coverage. **Please make sure to have this pass successfully before submitting a PR.** Although the same tests will be run against your PR on the CI server, it is better to have it working locally beforehand. |
| 59 | + |
0 commit comments