|
1 |
| -# vue-i18n-loader Contributing Guide |
| 1 | +# @intlify/vue-i18n-loader Contributing Guide |
2 | 2 |
|
3 | 3 | - [Issue Reporting Guidelines](#issue-reporting-guidelines)
|
4 | 4 | - [Pull Request Guidelines](#pull-request-guidelines)
|
5 | 5 | - [Development Setup](#development-setup)
|
| 6 | +- [Contributing Tests](#contributing-tests) |
| 7 | +- [Financial Contribution](#financial-contribution) |
6 | 8 |
|
7 | 9 | ## Issue Reporting Guidelines
|
8 | 10 |
|
9 | 11 | - The issue list of this repo is **exclusively** for bug reports and feature requests. Non-conforming issues will be closed immediately.
|
10 | 12 |
|
11 | 13 | - Try to search for your issue, it may have already been answered or even fixed in the master branch.
|
12 | 14 |
|
13 |
| -- Check if the issue is reproducible with the latest stable version of vue-i18n-loader. If you are using a pre-release, please indicate the specific version you are using. |
| 15 | +- Check if the issue is reproducible with the latest stable version of `intlify/vue-i18n-loader`. If you are using a pre-release, please indicate the specific version you are using. |
14 | 16 |
|
15 | 17 | - It is **required** that you clearly describe the steps necessary to reproduce the issue you are running into. Issues with no clear repro steps will not be triaged. If an issue labeled `Status: Need More Info` receives no further input from the issue author for more than 5 days, it will be closed.
|
16 | 18 |
|
|
20 | 22 |
|
21 | 23 | ## Pull Request Guidelines
|
22 | 24 |
|
23 |
| -- Checkout a topic branch from the `master` branch. |
| 25 | +- Checkout a topic branch from the `v1.x` branch. |
24 | 26 |
|
25 | 27 | - It's OK to have multiple small commits as you work on the PR - we will let GitHub automatically squash it before merging.
|
26 | 28 |
|
|
35 | 37 | - Add appropriate test coverage if applicable.
|
36 | 38 |
|
37 | 39 | ### Work Step Example
|
38 |
| -- Fork the repository from [intlify/vue-i18n-loader](https://github.com/intlify/vue-i18n-loader) ! |
39 |
| -- Create your topic branch from `master`: `git branch my-new-topic origin/master` |
| 40 | +- Fork the repository from [`intlify/vue-i18n-loader`](https://github.com/intlify/vue-i18n-loader) ! |
| 41 | +- Create your topic branch from `v1.x`: `git branch my-new-topic origin/master` |
40 | 42 | - Add codes and pass tests !
|
41 | 43 | - Commit your changes: `git commit -am 'Add some topic'`
|
42 | 44 | - Push to the branch: `git push origin my-new-topic`
|
43 |
| -- Submit a pull request to `master` branch of `intlify/vue-i18n-loader` repository ! |
| 45 | +- Submit a pull request to `v1.x` branch of `intlify/vue-i18n-loader` repository ! |
44 | 46 |
|
45 | 47 | ## Development Setup
|
46 | 48 |
|
| 49 | +You will need [Node.js](http://nodejs.org) **version 10+**, and [Yarn](https://yarnpkg.com/en/docs/install). |
| 50 | + |
47 | 51 | After cloning the repo, run:
|
48 | 52 |
|
49 |
| - $ npm install |
| 53 | +```bash |
| 54 | +$ yarn # install the dependencies of the project |
| 55 | +``` |
| 56 | + |
| 57 | + |
| 58 | +A high level overview of tools used: |
| 59 | + |
| 60 | +- [TypeScript](https://www.typescriptlang.org/) as the development language |
| 61 | +- [Rollup](https://rollupjs.org) for bundling |
| 62 | +- [Jest](https://jestjs.io/) for unit testing |
| 63 | +- [Puppeteer](https://pptr.dev/) for e2e testing |
| 64 | +- [ESLint](https://eslint.org/) for code linting |
| 65 | +- [Prettier](https://prettier.io/) for code formatting |
| 66 | + |
| 67 | +## Scripts |
| 68 | + |
| 69 | +### `yarn build` |
| 70 | + |
| 71 | +The `build` script builds transpile to CommonJS module file. |
| 72 | + |
| 73 | +### `yarn test` |
| 74 | + |
| 75 | +The `yarn test` script simply calls the `jest` binary, so all [Jest CLI Options](https://jestjs.io/docs/en/cli) can be used. Some examples: |
| 76 | + |
| 77 | +```bash |
| 78 | +# run all tests |
| 79 | +$ yarn test |
| 80 | + |
| 81 | +# run unit tests |
| 82 | +$ yarn test:unit |
| 83 | + |
| 84 | +# run unit test coverages |
| 85 | +$ yarn test:coverage |
| 86 | + |
| 87 | +# run unit tests in watch mode |
| 88 | +$ yarn test:watch |
| 89 | + |
| 90 | +# run e2e tests |
| 91 | +$ yarn test:e2e |
| 92 | +``` |
| 93 | + |
| 94 | +## Contributing Tests |
| 95 | + |
| 96 | +Unit tests are collocated with directories named `test`. Consult the [Jest docs](https://jestjs.io/docs/en/using-matchers) and existing test cases for how to write new test specs. Here are some additional guidelines: |
| 97 | + |
| 98 | +Use the minimal API needed for a test case. For example, if a test can be written without involving the reactivity system ra component, it should be written so. This limits the test's exposure to changes in unrelated parts and makes it more stable. |
50 | 99 |
|
51 |
| -### Commonly used NPM scripts |
| 100 | +## Financial Contribution |
52 | 101 |
|
53 |
| - # lint source codes |
54 |
| - $ npm run lint |
| 102 | +As a pure community-driven project without major corporate backing, we also welcome financial contributions via GitHub Sponsors and Patreon |
55 | 103 |
|
56 |
| - # run the full test suite, include linting |
57 |
| - $ npm test |
| 104 | +- [Become a backer or sponsor on GitHub Sponsors](https://github.com/sponsors/kazupon) |
| 105 | +- [Become a backer or sponsor on Patreon](https://www.patreon.com/evanyou) |
58 | 106 |
|
59 |
| -There are some other scripts available in the `scripts` section of the `package.json` file. |
| 107 | +Funds donated via GitHub Sponsors and Patreon go to support kazuya kawaguchi full-time work on Intlify. |
60 | 108 |
|
61 |
| -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. |
| 109 | +## Credits |
62 | 110 |
|
| 111 | +Thank you to all the people who have already contributed to Intlify project and my OSS work ! |
0 commit comments