Thank you for considering to contribute to Compiled! Pull requests, issues and comments are welcome.
For pull requests, please:
- Add tests for new features and bug fixes
- Follow the existing style
- Separate unrelated changes into multiple pull requests
See the existing issues for things to start contributing.
For bigger changes, please make sure you start a discussion first by creating an issue and explaining the intended change.
Atlassian requires contributors to sign a Contributor License Agreement, known as a CLA. This serves as a record stating that the contributor is entitled to contribute the code/documentation/translation to the project and is willing to have it used in distributions and derivative works (or is willing to transfer ownership).
Prior to accepting your contributions we ask that you please follow the appropriate link below to digitally sign the CLA. The Corporate CLA is for those who are contributing as a member of an organization and the individual CLA is for those contributing as an individual.
Make sure to install dependencies with yarn
locally before continuing.
Run tests locally where <filter>
can be omitted,
a file path,
or a partial file name.
yarn test <filter> --watch
Looking at tests first is generally the best way to get started.
Run storybook locally.
yarn start
We use Loki for visual regression tests.
Start a storybook in another terminal (yarn start
)
yarn test:vr
If there are expected changes, you can accept them with the command in the test or use the approve command.
yarn test:vr update --storiesFilter="^...\$"
yarn test:vr approve
We want to support both Webpack 4 and 5.
yarn start:webpack
will use Webpack 5 but to test Webpack 4 you just need to make
a few small changes to the examples/webpack folder.
-
In examples/webpack/webpack.config.js, remove the
'...'
in theoptimization.minimizer
property. Sooptimization: { minimizer: ['...', new CssMinimizerPlugin()], usedExports: false, }
becomes
optimization: { minimizer: [new CssMinimizerPlugin()], usedExports: false, }
-
Update the examples/webpack/package.json dependency versions for the following packages:
"webpack": "^4"
"html-webpack-plugin": "^4"
- astexplorer.net — When working on the Babel Plugin make sure to utilise this, it's a super useful tool that can visualize the abstract syntax tree (AST).
- Babel Handbook — For getting started with Babel Plugins have a read of this first.