0.0.41 • Published 4 years ago

@afzalh/pattern-library v0.0.41

Weekly downloads
-
License
-
Repository
-
Last release
4 years ago

Introduction

Welcome to the @dhl/pattern-library repository. In here you will find the React codebase of the components used by DHL. This library was created to 1) ensure consistency between different projects and 2) increase the development speed of the teams.

Installing and Running

To install the project and all it dependencies, you can simply run the standard script:

npm install

To run the project, please run:

npm start

Scripts

There are 5 scripts you need to know in order to be able to start developing.

Development

Build

npm run build

Builds the library to the dist/ directory. This is what is pushed to the package registry when the library is published.

Lint

npm run lint

Runs eslint to statically analyze the code. The project uses prettier in the standard configuration to account for formatting rules.

npm run lint:fix

Tries to automatically fix any issues raised by the linter.

Starting

npm start

Starts the project.

Testing

npm test

Runs the unit tests. The tests are run with -coverage enabled.

Continuous Integration

Storybook

CI server automatically pushes the generated storybook build to a remote static server - scoping to the current branch name - for every commit.

npm run storybook:build

Builds the storybook project to the styleguide-site/ directory. The build contain only static assets, so running any static server rooting to that folder is enought to see how it looks.

Publishing Beta

CI server run the script for every commit, checking and publishing a beta version of the package if needed.

npm run publish:beta

Publishes the library to the package registry if its version contains a well formated beta version number. The published version is tagged with the branch name. It can be referenced by @dhl/pattern-library@branch-name.

Publishing

CI server runs the script whenever a new change is made to the master branch.

npm run publish:official

Publishes a new version of the library to the package registry if it was never published before. The published version is tagged latest.

❤️ Contributing

We welcome contributions!

They are made possible via pull requests. To enhance the codebase, please create a separate branch and raise a pull request against the master branch.

When creating your own branch please ensure that you follow the correct namespace describing what the change is about. There are 6 types of changes that we currently support.

Feature

feature/branch-name major | minor

For adding new features to the library, regardless if a major, minor or patch update. Should be used whenever the change afects the library API or style.

Examples

ChangeBranch NameVersion
Adding a new component to the libraryfeature/new-toggle-componentminor
Adding a new property to a componentfeature/support-aria-live-in-componentminor
Removing a componentfeature/remove-componentmajor
Removing a property from a componentfeature/remove-aria-live-in-componentmajor

Documentation

docs/branch-name

For a documentation only change. Should be used whenever the change is only updating MD files or the storybook stories.

Examples

ChangeBranch NameVersion
Updating the README filedocs/update-readme-section-
Add knob support to a storydocs/add-knobs-to-component-
Create a new story for componentdocs/add-story-to-component-
Remove story for componentdocs/remove-component-story-

Fix

fix/branch-name minor | patch

For fixing a bug. Usually the API won't change after the fix. Should be used whenever the change is only about fixing an issue in the library and it's not adding any new feature.

Examples

ChangeBranch NameVersion
Fix componentfix/componentpatch
Fix a bug in a propertyfix/property-in-componentpatch
Fix a styling issuefix/component-stylepatch
Fix a property that is not exposedfix/expose-propertyminor

Test

test/branch-name

For adding tests only changes. Should be used when the change is only about writing new tests. The API of the library is not affected.

Examples

ChangeBranch NameVersion
Add tests to componenttest/add-for-component-
Remove tests from componenttest/remove-from-component-
Update tests is componenttest/component-
Update testing librarytest/update-library-

Refactoring

refactoring/branch-name minor

For refactoring the code. Should be used for internal code changes that doesn't affect the library's API.

ChangeBranch NameVersion
Increase component performancerefactoring/performance-componentminor
Add react-hooks to componentrefactoring/component-support-hooksminor
Update dependenciesrefactoring/update-dependenciesminor
Reduce function complexityrefactoring/update-functionminor

Infrastructure

infra/branch-name

For changing the file structure or the build process. Should be used when the change is only related to infrastructure.

ChangeBranch NameVersion
Update build processinfra/update-build-process-
Remove unused codeinfra/remove-code-from-component-
Change directory structureinfra/update-structure-
Update bundler processinfra/update-webpack-

Code of Conduct

As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.

We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or nationality.

Examples of unacceptable behavior by participants include:

  • The use of sexualized language or imagery
  • Personal attacks
  • Trolling or insulting/derogatory comments
  • Public or private harassment
  • Publishing other's private information, such as physical or electronic - addresses, without explicit permission
  • Other unethical or unprofessional conduct

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project. Project maintainers who do not follow or enforce the Code of Conduct may be permanently removed from the project team.

This Code of Conduct is adapted from the Contributor Covenant, version 1.3.0, available at https://www.contributor-covenant.org/version/1/3/0/

0.0.40

4 years ago

0.0.41

4 years ago

0.0.38

4 years ago

0.0.39

4 years ago

0.0.37

4 years ago

0.0.36

4 years ago

0.0.35

4 years ago