Skip to content

Latest commit

 

History

History
131 lines (87 loc) · 5.79 KB

CONTRIBUTING.md

File metadata and controls

131 lines (87 loc) · 5.79 KB

Contributing to Inferno

Many thanks for using Inferno and contributing to its development. The following is a quick set of guidelines designed to maximise your contribution's effectiveness.

Got a question or need help?

If you're having trouble getting Inferno to do what you want, there are a couple of places to get help before submitting an issue:

Of course, if you've encountered a bug, then the best course of action is to raise an issue (if no-one else has!).

Reporting security vulnerabilities

If you think you've found a security vulnerability, please email Dominic Gannaway with details, and he will respond to you if he isn't at work by that time.

Repository Layout

The repository structures as a monorepo utilizing lerna as a management tool of choice. Lerna setup and linking are part of the postinstall task so it should be automatically run after npm install. lerna executes command based on a topological-sorted order of packages based on their dependencies.

For example, if you want to see the order of packages being processed, you can do:

$ lerna exec -- node -e "console.log(require('./package.json').name)"
inferno-shared
inferno-vnode-flags
inferno
inferno-hyperscript
inferno-create-element
inferno-extras
inferno-router
inferno-compat
inferno-server
inferno-redux
inferno-mobx
inferno-test-utils

Source files are written in TypeScript and tests are written in JS/JSX consuming the dist files.

Running tests

Always include tests for the functionality you want to add into Inferno. This way we can avoid regression in future.

Make sure you have lerna tool installed globally.

npm i -g lerna
  • Clone the repository, and clean it. lerna clean
  • Install development dependencies npm i
  • build typescript files npm run build
  • run tests npm run test

Pull requests

All pull requests are welcome.

Caveat for what follows: If in doubt, submit the request - a PR that needs tweaking is infinitely more valuable than a request that wasn't made because you were worrying about meeting these requirements.

Before submitting, run npm run build (which will concatenate, lint and test the code) to ensure the build passes - but don't include files from outside the src and test folders in the PR.

And make sure the PR haven't been published before!

There isn't (yet) a formal style guide for Inferno, so please take care to adhere to existing conventions:

  • 2-space indentation, not tabs!
  • Semi-colons
  • Single-quotes for strings

Above all, code should be clean and readable, and commented where necessary. If you add a new feature, make sure you add a test to go along with it!

Before you commit your changes, please run npm run prettier to format code correctly

Small print

There's no contributor license agreement - contributions are made on a common sense basis. Inferno is distributed under the MIT license, which means your contributions will be too.

Debugging Browser

Just run npm run test:browser:debug Open localhost:9876 and click debug!

Debugging NodeJS

Its possible to debug inferno tests by running following command npm run debug and open chrome web address: chrome://inspect/#devices

Pro tip: You can filter down number of tests by editing debug -task: node --inspect-brk ./node_modules/.bin/jest {*edit this*} --runInBand --no-cache --no-watchman Change parameter to jest to match only files you want to run. Happy debugging!

Credits

Contributors

Thank you to all the people who have already contributed to inferno!

Backers

Thank you to all our backers! [Become a backer]

Sponsors

Thank you to all our sponsors! (please ask your company to also support this open source project by becoming a sponsor)