# How to create a component?

1. Create component folder `/Components/MyComponent` or go to the existed folder.
2. `yarn init` or `npm init` for create `package.json`
    * Transfer dependencies from root [package.json](./package.json) to `package.json` for new component. For example - `react-select` - is developer dependency `Select` component.
3. `yarn` or `yarn install` for create `yarn.lock`

## Publish a component to [NPM](https://www.npmjs.com/settings/propellerads/packages)
1. Make sure that you have NPM account
2. Make sure that you are have [Members](https://www.npmjs.com/settings/propellerads/members) role in `PropellerAds` organisation on NPM.
3. Make sure that you is logged to NPM registry, Command - `npm login`. [Подробнее](https://docs.npmjs.com/logging-in-to-an-npm-enterprise-registry-from-the-command-line)
4. For working with monorepo we use a [Lerna](https://github.com/lerna/lerna)
    *. The two primary commands in `Lerna` are [lerna bootstrap](https://github.com/lerna/lerna/tree/master/commands/bootstrap#readme) and [lerna publish](https://github.com/lerna/lerna/tree/master/commands/publish#readme)
    > To keep the JavaScript ecosystem healthy, reliable, and secure, every time you make significant updates to an npm package you own, we recommend publishing a new version of the package with an updated version number in the package.json file that follows the semantic versioning spec. Following the semantic versioning spec helps other developers who depend on your code understand the extent of changes in a given version, and adjust their own code if necessary. [More about](https://docs.npmjs.com/about-semantic-versioning)
