2.0.1 • Published 6 years ago

apparena-patterns v2.0.1

Weekly downloads
11
License
MIT
Repository
github
Last release
6 years ago

App-Arena Patterns

npm package PeerDependencies Dependencies DevDependencies Coverage Status Build Status semantic-release

App-Arena Patterns is a set of React components that implement the App-Arena CI.

Check out our documentation site for live examples. It's still a work in progress, but hopefully you can see where we're headed.

Recently Updated? Please read the changelog, this README and the documentation before posting an issue.

Getting Started

We recommend that you get to know React before diving into apparena-patterns-react. App-Arena Patterns is a set of React components, so understanding how React fits into web development is important.

Install dependencies and start the server

Install dependencies by running npm install or yarn.

Run npm run start and open localhost:3099 in your browser.

Installation

App-Arena Patterns are available as an npm package.

Stable channel

npm install apparena-patterns-react
yarn add apparena-patterns-react

Usage

Here is a quick example to get you started:

./App.js

import React from 'react';
import ReactDOM from 'react-dom';
import MyAwesomeReactComponent from './MyAwesomeReactComponent';

const App = () => (
    <MyAwesomeReactComponent />
);

ReactDOM.render(
  <App />,
  document.getElementById('app')
);

./MyAwesomeReactComponent.js

import React from 'react';
import {Button} from 'apparena-patterns-react';

const MyAwesomeReactComponent = () => (
  <Button type="primary">Label</Button>
);

export default MyAwesomeReactComponent;

Please refer to each component's documentation page to see how they should be imported.

Pattern documentation

This repository also contains the code for the pattern documentation. You can view the documentation at https://brand.app-arena.com/.

Contributing

If you would like to contribute to the documentation or write documentation for a new component please have a look at our guide to writing documentation! If you want to start hacking away at the frontend, which can be found at https://brand.app-arena.com/, please read our guide to working on the frontend.

Creating a new pattern

We provide a yeoman generator that requires 2 clicks to create a new pattern.

  1. Install the generator: npm install -g generator-apparena-pattern
  2. cd into the App-Arena patterns root directory (it contains a .yo-rc.json file)
  3. Run the generator: yo apparena-pattern
  4. Follow the onscreen prompts
  5. Overwrite the file source/patterns/index.js if prompted (make a backup of your changes!)

Done! Now edit your newly created pattern under source/patterns/...

Preparing for the pull request

Your commits leading up to the pull request should be named properly. Each commit should begin with the name of the component that you have worked on in square brackets followed by a quick summary of what was done.
Example: [Component] Added documentation

If you want to have your changes published to NPM as well then you should prefix the message when mergin the pull request into master branch with the semver release level in square brackets, these are: major, minor, or patch. If you add the component name into the message it has to come after the semver release level (e.g. "patch Added documentation").
Omitting the semver release level, or using an invalid one, skips the NPM deployment and only updates the documentation.

Always run the tests and the linter prior to opening a pull request and fix any issues, errors and warnings that occur.

License

This project is licensed under the terms of the MIT license