Contributing¶
Getting Started¶
Install just
Fork and clone the repo
Create, activate & install dependencies
$ python -m venv venv $ . venv/bin/activate $ just install
Coding style¶
Linters¶
Formatter¶
Format js code with prettier:
$ npm run format
Commit messages¶
Prefix your commit messages with an emoji according to this list:
Commit type |
Emoji |
---|---|
Initial commit |
|
Version tag |
|
New feature |
|
Bugfix |
|
Metadata |
|
Documentation |
|
Documenting source code |
|
Performance |
|
Cosmetic |
|
Tests |
|
Adding a test |
|
General update |
|
Improve format/structure |
|
Move code |
|
Refactor code |
|
DRY up code |
|
Removing code/files |
|
Continuous Integration |
|
Security |
|
Upgrading dependencies |
|
Downgrading dependencies |
|
Lint |
|
Translation |
|
Text |
|
Critical hotfix |
|
Deploying stuff |
|
Fixing on MacOS |
|
Fixing on Linux |
|
Fixing on Windows |
|
Adding CI build system |
|
Analytics or tracking code |
|
Removing a dependency |
|
Adding a dependency |
|
Docker |
|
Configuration files |
|
Bundles update |
|
Merging branches |
|
Bad code / need improv. |
|
Reverting changes |
|
Breaking changes |
|
Code review changes |
|
Accessibility |
|
Move/rename repository |
|
Add component(s) |
|
Other |
Guides¶
If you add a feature or fix a bug, it should also have a test.
Features and component should have a standalone demo in
tests/apps/pages
ortests/components/pages
.Bundle tests by package/system, components tests in
tests/components
.
Get a new external url
Download the url to vendors (eg:
cd dazzler/assets/vendors && wget https://unpkg.com/react@16.8.6/umd/react.production.min.js
)Ensure new filename has version in it for cache breaking, vendors are copied flat.
Also download dev bundles to vendors if available.
Change the requirements urls and paths.
Create a new directory in
src
for the components.Add webpack entrypoint.
Add a package in
dazzler/components/<package_name>/__init__.py
(Copydazzler/components/core/__init__.py
and change_name
)Add a
build:dazzler::<package_name>
npm command, add the comma
Build the components:
$ just build
.Watch
$ just watch
.Components styles should be using css classes primarily.
SCSS for styling, scoped with
library-name-component-name
.Spinal casing for css classes.
extension
.(t|j)sx
for react components.(t|j)s
otherwise.Include a docstring for every component/props.
Include a test page in
tests/components/pages
.Include an acceptance test in
tests/components/test_[package_name].py
Run
$ just publish