1.3.0 • Published 4 years ago

mf-bootstrap v1.3.0

Weekly downloads
3
License
MIT
Repository
-
Last release
4 years ago

mf-bootstrap

mf-bootstrap allows you to generate micro frontends to be used with mf-maestro and 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
1.3.0

4 years ago

1.2.13

4 years ago

1.2.12

4 years ago

1.2.10

4 years ago

1.2.11

4 years ago

1.2.9

4 years ago

1.2.8

4 years ago

1.2.7

4 years ago

1.2.6

4 years ago

1.2.5

4 years ago

1.2.4

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago

2.0.0

7 years ago