Skip to content

natura-cosmeticos/natds-commons

Repository files navigation

natds-commons

A monorepo containing Natura Design System multiplatform packages.

Build Status codecov GitHub issues GitHub lerna


Getting started

Make sure you have node and yarn installed

Instalation

At the root directory run yarn install


Commands available to all packages

The commands bellow can be run by:

yarn <command>

test: runs packages tests

test:watch: runs packages tests and watch for changes

lint: runs eslint using the @naturacosmeticos/eslint-config-natura rules

commit: opens an interactive GUI to help you write commits in compliance with conventional commits

build: run packages build task

release: analize commits, bump packages and make the apropriate releases

prerelease: analize commits, bump packages and make the apropriate pre-releases

start: runs packages start task, generally used to open a browser visualization


Adding new packages

Create a new package

create a new folder inside the packages folder and run

yarn init

and fill the package information.

Create the package scripts

After that, create in the package's package.json file the above scripts.

This enable us to run all packages commands from the root folder.

Register the new package

Add the created package in the root package.json workspaces array

{
"workspaces": [
    "packages/natds-themes",
    "packages/<your-new-package>"
  ]
}

Adding dependencies to a package

from the root folder

npx lerna add <package-I-want-to-add> --scope @naturacosmeticos/<my-package> -D

Adding shared dependencies to all packages

from the root folder (devDependencies only. if it is a dependency, it should be added and listed in the packages package.json with the above command)

yarn add <package-I-want-to-add> -D -W

Start hacking!


Commiting

We are using the conventional commits guidelines to automate our versioning and changelog criation process.

You can read more about here.

If you are unsure about how to follow the commit guidelines, we have an interective guide to help you with this. See the commit command above.

All the commits have to contain an issue number starting with DSY-. If you are having trouble commiting (reference error) you probably forgot that! Using the commit command, you can include this information on the long description field