# mf-bootstrap

> `mf-bootstrap` allows you to generate micro frontends to be used with [mf-maestro](https://github.com/calions-app/mf-maestro) and [mf-bundler](https://github.com/calions-app/mf-bundler)

Latest version **1.3.0** (published 2020-06-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install mf-bootstrap
pnpm add mf-bootstrap
yarn add mf-bootstrap
bun add mf-bootstrap
```

Provides the command `mf-generate`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2020-06-05 |
| First published | 2019-12-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 9 |
| Unpacked size | 368.4 KB |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| Author | Calions-app |
| Maintainers | fabienhenon |
| Keywords | micro frontends, calions |

## Links

- npm: https://www.npmjs.com/package/mf-bootstrap
- npm.io page: https://npm.io/package/mf-bootstrap

## Dependencies (9)

- [ejs](https://npm.io/package/ejs.md) ^2.6.1
- [path](https://npm.io/package/path.md) ^0.12.7
- [chalk](https://npm.io/package/chalk.md) ^3.0.0
- [shelljs](https://npm.io/package/shelljs.md) ^0.8.2
- [inquirer](https://npm.io/package/inquirer.md) ^6.2.0
- [commander](https://npm.io/package/commander.md) ^4.0.1
- [node-eval](https://npm.io/package/node-eval.md) ^2.0.0
- [esm-to-cjs](https://npm.io/package/esm-to-cjs.md) ^1.2.0
- [pascalcase](https://npm.io/package/pascalcase.md) ^1.0.0

## Recent versions

- 1.3.0 (latest) — 2020-06-05
- 1.2.13 — 2020-02-06
- 1.2.12 — 2020-01-20
- 1.2.11 — 2020-01-19
- 1.2.10 — 2020-01-19
- 1.2.9 — 2020-01-17
- 1.2.8 — 2020-01-16
- 1.2.7 — 2020-01-16
- 1.2.6 — 2020-01-16
- 1.2.5 — 2020-01-15
- 1.2.4 — 2020-01-15
- 1.2.3 — 2020-01-15
- 1.2.2 — 2020-01-15
- 1.2.1 — 2020-01-10
- 1.1.1 — 2020-01-02
- … 2 more at https://npm.io/package/mf-bootstrap/versions

## README

# mf-bootstrap

`mf-bootstrap` allows you to generate micro frontends to be used with [mf-maestro](https://github.com/calions-app/mf-maestro) and [mf-bundler](https://github.com/calions-app/mf-bundler)

## Install

You should install this package globally to easily use it anywhere:

```
$ npm install -g mf-bootstrap
```

## Quick start

We will start by creating a new project named `blog`:

```
$ mf-generate init blog ../main-styles
```

Now we will go to the created project:

```
$ cd blog
```

And we will create a first micro frontend for the domain users, a creation of account:

```
$ mf-generate mf users accounts new
```

You can install all dependencies with `npm install` (this will also install micro frontends' dependencies).

And now you can run the tests to be sure everything is working fine:

```
$ npm run test
```

This will run unit and end2end tests for all micro frontends.

You could also go to your micro frontend directory and start it to check everything is ok:

```
$ cd apps/users/accounts-new
$ npm start
```

If you don't have a webserver running, don't forget to run mocks with `npm run mocks` at the root of your project.
If you have a webserver running, be sure to configure its host and port in the `.env` file.

Everything is working and ready, you can adapt the base code for your needs and generate new micro frontends.

## Usage

With `mf-bootstrap` you can generate a new project that will host your micro frontends, and you can also add new micro frontends.

### Generate a new project

```
$ mf-generate init [project] [mainStylesPath] [-d destPath] [-a author]
```

This command will generate a new project named `<project>` in folder `<destPath>/<project>`.

#### Arguments

* `project`: The project name
* `mainStylesPath`: The relative path from your project's folder where you can find the main styles projects. This project is used to generate styles used by your instance of the maestro, so that your micro frontends can be run with these styles outside of the maestro.
* `destPath`: The destination folder where your project will be created. Default to `.`
* `author`: The author name to use in the `package.json` files. Default to `Calions apps`

### Generate a new micro frontend

Go to your project's folder. Then execute:

```
$ mf-generate mf [domain] [entity] [type] [-l lang]
```

This will generate a new micro frontend in your `apps` folder.

#### Arguments

* `domain`: The domain of your entity
* `entity`: The name of the entity linked to this view
* `type`: The UI type of the view. Possible values are:
    * `master`: List of entities
    * `detail`: A detailed view of an entity
    * `new`: A form to create a new entity
    * `edit`: A form to edit an existing entity
* `lang`: The language/framework to use for this micro frontend. Default to `elm`

---
_Source: https://npm.io/package/mf-bootstrap · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
