This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

## Available Scripts

In the project directory, you can run:

### `npm run dev / yarn dev`

Runs the app in the development mode.<br />
Open [http://localhost:3001](http://localhost:3001) to view it in the browser.

The page will reload if you make edits.<br />
You will also see any lint errors in the console.

### `npm test / yarn test`

Launches the test runner in the interactive watch mode.<br />
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `npm run build / yarn build`

Builds the app for production to the `build` folder.<br />
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.<br />
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `yarn eject`

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**

If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

### Learn More

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).

To learn React, check out the [React documentation](https://reactjs.org/).

## Usar esté proyecto como dependencia/modulo en desarrollo/local

La instalación de la dependencia [yalc](https://github.com/whitecolor/yalc) es necesaria para utilizar en entorno de desarrollo/local el proyecto `front-components` y referenciarlo adecuadamente en otros proyectos que necesiten integrarlo.

> Es una herramienta como alternativa a `npm link`

### Instalación

```sh
$ npm install yalc -g
```

### Publicar proyecto para usarlo como dependencia en local

En la ubicación del proyecto `/metrocuadrado-front-components` correr en la terminal:

> `--no-scripts` flag is used to publish without running `pre/post` scripts.

```sh
$ yalc publish --no-scripts
```

### En el proyecto donde utilizara la dependencia

La dependencia `metrocuadrado-ui` corresponde al nombre del paquete/modulo del proyecto `metrocuadrado-front-components`. Entonces procedemos a instalarlo en el proyecto que lo requiere:

```sh
$ yalc add metrocuadrado-ui
# or if don't want to touch package.json
$ yalc link metrocuadrado-ui
```

### Publicar los cambios realizados

Es necesario que cuando se realicen cambios en el paquete de la dependencia, y quiera que se vean reflejados en los proyectos que están usando este paquete, se ejecute el siguiente comando en la terminal:

> **Nota**: esto actualizará la dependencia en todos los proyectos donde se haya incluido.

```sh
$ yalc publish --push --no-scripts
# o
$ yalc push --no-scripts
```

Si no desea actualizar automáticamente la dependencia en todos los proyectos en los que se ha añadido (por ejemplo, si tiene varios proyectos con versiones distintas de la dependencia), utilizar:

```sh
# en el directorio del paquete en desarrollo
$ yalc publish --no-scripts
```

```sh
# en el proyecto donde se prueba el paquete
$ yalc update
```

## Shell's Commands

Comando para habilitar la terminal alterna a cmd, como la Powershell o Git Bash de Windows

```sh
$ npm config set script-shell = "C:\\windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe"
```
o

```sh
$ npm config set script-shell = "C:\Program Files\Git\bin\bash.exe"
```

**para revertirlo**

```sh
$ npm config delete script-shell
```

## PUBLISH NPM PACKAGE

Instructivo para la publicación para npm new version package

**Login En Npm**
Consulte el documento Centralizado de Metrocuadrado CEET TI
- Busque Cuenta NPM

**npm login**

```sh
$ npm login
Username: metrocuadrado
Password: 
Email: (this IS public) micorreo@eltiempo.com
Logged in as metrocuadrado on ...
```

**Verifique la version a publicar**
En el archivo package.json 
```json
"name": "metrocuadrado-ui",
"description": "A library of react components.",
"version": "X.X.X",
"engines": {
	"node": ">=10"
}
```

**npm run build**

En la raíz del proyecto front-components
```sh
$ npm run build
```

**npm publish**

Si el paso anterior no contiene errores eso quiere decir que puede publicar la version de metrocuadrado-ui y utilizar en el proyecto donde requiera utilizarlo. (recomendación es npm uninstall <metrocuadrado-ui> e npm install<metrocuadrado-ui>)

https://www.npmjs.com/package/metrocuadrado-ui
