Hi! I'm really excited that you are interested in contributing to Vue.js. Before submitting your contribution, please make sure to take a moment and read through the following guidelines:
- Code of Conduct
- Issue Reporting Guidelines
- Pull Request Guidelines
- Development Setup
- Scripts
- Project Structure
- Contributing Tests
- Financial Contribution
- Always use https://github.com/gitsindonesia/ui-component/issues/new/choose to create new issues.
-
Checkout a topic branch from a base branch, e.g.
main, and merge back against that branch. -
Make sure to tick the "Allow edits from maintainers" box. This allows us to directly make minor edits / refactors and saves a lot of time.
-
If adding a new feature:
- Add accompanying test case.
- Provide a convincing reason to add this feature. Ideally, you should open a suggestion issue first and have it approved before working on it.
-
If fixing a bug:
- If you are resolving a special issue, add
(fix #xxxx[,#xxxx])(#xxxx is the issue id) in your PR title for a better release log, e.g.update entities encoding/decoding (fix #3899). - Provide a detailed description of the bug in the PR. Live demo preferred.
- Add appropriate test coverage if applicable. You can check the coverage of your code addition by running
nr test-coverage.
- If you are resolving a special issue, add
-
It's OK to have multiple small commits as you work on the PR - GitHub can automatically squash them before merging.
-
Make sure tests pass!
-
Commit messages must follow the commit message convention so that changelogs can be automatically generated. Commit messages are automatically validated before commit (by invoking Git Hooks via simple-git-hooks).
-
No need to worry about code style as long as you have installed the dev dependencies - modified files are automatically formatted with Prettier on commit (by invoking Git Hooks via simple-git-hooks).
You will need Node.js version 16+, and PNPM version 7+.
We also recommend installing ni to help switching between repos using different package managers. ni also provides the handy nr command which running npm scripts easier.
After cloning the repo, run:
$ pnpm i # install the dependencies of the projectA high level overview of tools used:
- TypeScript as the development language
- Vite and ESBuild for development bundling
- Rollup for production bundling
- Vitest for unit testing
- Prettier for code formatting
- ESLint for static error prevention (outside of types)
Unit tests are collocated with the code being tested in each package, inside directories named __tests__. Consult the Vitest docs and existing test cases for how to write new test specs. Here are some additional guidelines:
-
Use the minimal API needed for a test case. For example, if a test can be written without involving the reactivity system or a component, it should be written so. This limits the test's exposure to changes in unrelated parts and makes it more stable.
-
If testing platform agnostic behavior or asserting low-level virtual DOM operations, use
@vue/runtime-test. -
Only use platform-specific runtimes if the test is asserting platform-specific behavior.
Thank you to all the people who have already contributed to Morpheme UI!