... | @@ -62,7 +62,7 @@ The component library is a resource that makes PubSweet better for everyone. The |
... | @@ -62,7 +62,7 @@ The component library is a resource that makes PubSweet better for everyone. The |
|
|
|
|
|
When thinking of adding a component, be sure you check beforehand in the PubSweet component library for existing ones. As the library is constantly growing, it might be that a similar component has already been submitted.
|
|
When thinking of adding a component, be sure you check beforehand in the PubSweet component library for existing ones. As the library is constantly growing, it might be that a similar component has already been submitted.
|
|
|
|
|
|
Usually components are developed with reusabilty in mind, but they also follow YAGNI ("[You aren't gonna need it](https://en.wikipedia.org/wiki/Y ou_aren%27t_gonna_need_it)") and KISS ("[Keep it simple, stupid](https:// en.wikipedia.org/wiki/KISS_principle)") principles. It's up to the contributor to decide if a component can be reused, extended, or a new one could be created.
|
|
Usually components are developed with reusabilty in mind, but they also follow YAGNI ("[You aren't gonna need it](https://en.wikipedia.org/wiki/You_aren%27t_gonna_need_it)") and KISS ("[Keep it simple, stupid](https:// en.wikipedia.org/wiki/KISS_principle)") principles. It's up to the contributor to decide if a component can be reused, extended, or a new one could be created.
|
|
|
|
|
|
If you develop components, please add them to the library. If you use components developed by others, please consider helping maintain them by reporting issues and contributing bug fixes.
|
|
If you develop components, please add them to the library. If you use components developed by others, please consider helping maintain them by reporting issues and contributing bug fixes.
|
|
The process for contributing a component, or any other code, is described in the Contributing to PubSweet (inline) chapter. The technical requirements and suggestions for components are as follows:
|
|
The process for contributing a component, or any other code, is described in the Contributing to PubSweet (inline) chapter. The technical requirements and suggestions for components are as follows:
|
... | @@ -79,7 +79,7 @@ A PubSweet component, whether a server or client component, is an npm package an |
... | @@ -79,7 +79,7 @@ A PubSweet component, whether a server or client component, is an npm package an |
|
|
|
|
|
Things to keep in mind when creating a new component:
|
|
Things to keep in mind when creating a new component:
|
|
* Start with reusability in mind;
|
|
* Start with reusability in mind;
|
|
* Follow the principles of DRY ("Don't repeat yourself (https://en.wiki pedia.org/wiki/Don%27t_repeat_yourself)"), KISS, YAGNI;
|
|
* Follow the principles of DRY ("Don't repeat yourself (https://en.wikipedia.org/wiki/Don%27t_repeat_yourself)"), KISS, YAGNI;
|
|
* Use variables, theme variables for styling, React props, etc., instead of hardcoded values;
|
|
* Use variables, theme variables for styling, React props, etc., instead of hardcoded values;
|
|
* Follow [Conventional Commits](https://www.conventionalcommits.o rg/en/v1.0.0-beta.2/) or keep a healthy changelog;
|
|
* Follow [Conventional Commits](https://www.conventionalcommits.o rg/en/v1.0.0-beta.2/) or keep a healthy changelog;
|
|
* Write documentation;
|
|
* Write documentation;
|
... | | ... | |