Skip to content

Latest commit

 

History

History
117 lines (77 loc) · 4.41 KB

CONTRIBUTING.md

File metadata and controls

117 lines (77 loc) · 4.41 KB

Contributing to Undercut

Please ensure that you have the latest Node.js and Yarn.

Quicklinks

Setup

This project follows GitHub's standard forking model. Please fork the project to submit pull requests.

Clone your fork:

git clone https://github.com/${username}/undercut.git
cd undercut

Undercut is a monorepo based on Yarn Workspaces. Yarn is also used for managing dependencies, running scripts, etc.

Install Node modules before running any scripts:

yarn install

Workflow

  1. Create a branch from the master with a meaningful name like fix-{something}.
  2. Make your changes.
  3. Make sure that tests pass: yarn test.
  4. Check linting errors: yarn lint.
  5. Check that build works: yarn build.
  6. Make required documentation changes.
  7. Commit your changes and push the branch.
  8. Submit a pull request to the upstream repository.
  9. Make sure that CI build has no issues.

Making a commit

The project adheres to Semantic Versioning and Conventional Commits.

Commit types are similar to the Angular convention with slight modifications:

  • chore type is used for most maintenance changes.
  • build and ci types are moved to scopes.
  • style type is renamed to polish.

Types:

  • chore -- build scripts, infrastructure, configuration, dependencies, and maintenance tasks (example scopes: ci, deps, release, website).
  • docs -- documentation only changes.
  • feat -- a new feature.
  • fix -- a bug fix.
  • perf -- code performance related changes (hopefully, an improvement).
  • polish -- changes that do not affect the meaning of the code code (typos, white-space, formatting, missing semi-colons, etc).
  • refactor -- code refactoring: big/structural changes without adding new features or fixing bugs.
  • test -- adding missing tests or correcting existing tests.

Additional scopes:

  • Package related: cli, node, pull, push, struct, utils.
  • ci -- continious integration and build servers related.
  • deps -- adding/updating/removing package dependencies.
  • release -- a commit related to a release, usually includes version bumps, changelog updates and has a version tag.
  • website -- changes related to the website.
  • any other that makes sense.

Linting

Linting is done by ESLint. Script's name is "lint", and it's available at both the root (lints the entire monorepo) and an individual package level (lints just that package):

yarn lint

No output means OK. You can pass additional options to ESLint here.

Tests

Tests are done with Jest. Script's name is "test", and it's available at both the root (tests primary packages) and an individual package level (tests just that package):

yarn test

You can pass additional options (like "--watch") to Jest here.

Add "--coverage" to see test coverage.

Build

Build is done with the build script at an individual package level. Some projects doesn't have a build step right now, in this case there will be a message in terminal that build step is empty. If the build step isn't empty, built files go to the build directory in the respective package.

Dist

The dist script produces tarballs ready for distribution or publishing in the dist folder.

Documentation

Documentation is written in Markdown or MDX and is located in the docs folder. The files will be used later to build and publish static pages on undercut.js.org.

If you're adding a new document, don't forget to reference it on the website's sidebar.

Website

The website is built with Docusaurus and published to the gp-pages branch and GitHub Pages service.

Algolia search configuration is located in their repo.

Custom domain is provided by JS.ORG and configured in their repo.