Skip to content

Latest commit

 

History

History
120 lines (81 loc) · 3.82 KB

CONTRIBUTING.md

File metadata and controls

120 lines (81 loc) · 3.82 KB

Contributing to Medium Zoom

Thank you for getting involved in Medium Zoom!

Concept

This module is meant to reproduce the zoom from Medium. We want to provide a great UX (User Experience) with a lightweight vanilla JavaScript solution. Thus, this package must remain focused on this core principle, yet be extended with a composable API.

Folder structure

▸ cypress           The end-to-end tests written for Cypress
▸ examples          The Medium Zoom featured examples available on CodeSandbox
▸ src               The source code of the module
  ▸ __tests__       The tests for the module API
▸ stories           The stories for the Medium Zoom Storybook
▸ website           The Medium Zoom website source code

Requirements

Conventions

Commits

This project follows the conventional changelog guidelines. All commit messages should be formatted using the following scheme:

type(scope): description

Workflow

Filing issues

Reporting a bug or requesting a feature is always welcome. Feel free to open an issue with the according template which helps you create an effective report.

Submit code

After discussing in an issue about the need to change the code, you will need to follow these steps:

  • Fork the repository
  • Clone your fork
  • Install the dependencies: yarn
  • For a documentation change:
    • Create a branch docs/what-you-change
    • Make the changes
    • Run yarn run format
  • For a bug fix:
    • Create a branch fix/issue-number
    • Write a test to reproduce the bug (run yarn run test)
    • Fix the bug in the source code
    • Make your test pass the previous bug
    • Run yarn run format and fix problems if any
  • For a feature:
    • Create a branch feat/name-of-the-feature
    • Add the feature to the source code
    • Create a story in the storybook showcasing the feature
    • Write a test to ensure it's working as expected (run yarn run test)
    • Run yarn run format and fix problems if any
  • Create a pull request

We will then review your pull request!

Testing

Unit and integration tests

Unit and integration tests with Jest ensure that the API works as documented.

Commands
  • Run the tests: yarn run test
  • Watch the tests: yarn run test --watch
  • Run the tests with coverage: yarn run test --coverage

End-to-end tests

End-to-end tests with Cypress take screenshots of the stories to ensure that the zoom looks as expected.

Commands
  • Open the Cypress UI: yarn run test:cypress:open
  • Run the Cypress tests: yarn run test:cypress:run

Releasing

We rely on release-it to release new versions of this package.

Release flow

The release flow goes through these steps:

  1. Run acceptance tests
  2. Bump the project version in package.json based on the commits
  3. Commit the release version
  4. Create the new Git tag for this release
  5. Push to GitHub
  6. Publish to npm

Release steps

Unstable version
  1. Make sure you're on the next branch
  2. Run npm run release:next (do not use yarn for releasing)
  3. Follow the command-line instructions
Stable version
  1. Make sure you're on the master branch
  2. Run npm run release (do not use yarn for releasing)
  3. Follow the command-line instructions

Thank you for contributing!