Skip to content

Latest commit

 

History

History
76 lines (47 loc) · 4.12 KB

File metadata and controls

76 lines (47 loc) · 4.12 KB

Contributing Guide

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:

Issue Reporting Guidelines

Pull Request Guidelines

  • 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.
  • 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).

Development Setup

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 project

A high level overview of tools used:

Contributing Tests

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.

Credits

Thank you to all the people who have already contributed to Morpheme UI!