We want this community to be friendly and respectful to each other. Please read the full text so that you can understand what actions will and will not be tolerated.
The core team works directly on GitHub and all work is public.
Working on your first pull request? You can learn how from this free series: How to Contribute to an Open Source Project on GitHub.
-
Fork the repo and create your branch from
master
(a guide on how to fork a repository). -
Linaria uses Yarn for running development scripts. If you haven't already done so, please install yarn.
-
Run
yarn bootstrap
to setup the development environment. -
When working on the code, you can use the watch mode to watch and compiles changed files:
yarn watch
-
If you've added code that should be tested, add tests.
-
You can test the changes you are making in our website located under the
website/
folder in the repo. -
If you've changed APIs, remember to update the documentation under
docs/
.
If you are making changes to the website, test the website folder and run the server to check if your changes are being displayed accurately. To run the development server with live reloading, run:
yarn website start
We follow the conventional commits specification for our commit messages:
fix
: bug fixes, e.g. fix wrong classname generated by babel plugin.feat
: new features, e.g. add support for a config file.refactor
: code refactor, e.g. split the babel plugin into multiple visitors.docs
: changes into documentation, e.g. add usage example for styled tag.test
: adding or updating tests, eg unit, snapshot testing.chore
: tooling changes, e.g. change the eslint config.BREAKING CHANGE
: for changes that break existing usage, e.g. change the API or behaviour.
Our pre-commit hooks verify that your commit message matches this format when committing. If you are working on some in progress commits and don't care about the pre-commit hook, pass the --no-verify
(-n
) flag to git when committing (e.g. git commit -n -m "wip"
).
We use flow
for type checking, eslint
with prettier
for linting and formatting the code, and jest
for testing. Our pre-commit hooks verify that the linter and tests pass when commiting. You can also run the following commands manually:
yarn flow
: run flow on all files.yarn typescript
: run tests for typescript definitions.yarn lint
: lint files with eslint and prettier.yarn test
: run unit tests with jest.yarn test:integration
: run integration tests with jest and puppeteer.
When you're sending a pull request:
- Prefer small pull requests focused on one change.
- Verify that
flow
,eslint
and all tests are passing. - Preview the documentation to make sure it looks good.
- Follow the pull request template when opening a pull request.
To link linaria
on the command line to local copy in a development build:
cd /path/to/your/linaria_clone/
yarn
yarn link
cd /path/to/test_project/
yarn link linaria
To unlink it:
yarn unlink linaria
We use release-it to automate our release. If you have publish access to the NPM package, run the following from the master branch to publish a new release:
yarn release
NOTE: You must have a GITHUB_TOKEN
environment variable available. You can create a GitHub access token with the "repo" access here.
The best way to get your bug fixed is to provide a reduced test case. Please provide a public repository with a runnable example.
- Callstack Open Source Discord - #linaria.
We use Prettier with ESLint integration for linting and formatting. To fix any auto-fixable lint or matting errors, run:
yarn lint --fix
By contributing to Linaria, you agree that your contributions will be licensed under its MIT license.