npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

create-my-microfrontend

v1.1.7

Published

Micro Frontend Framework

Downloads

18

Readme

My Micro Frontend

The My Micro Frontend is used to generate framework templates from the micro frontend which can be used directly. For the configuration of the My Micro Frontend which will be used to create a micro frontend directly from the .env file. This My Micro Frontend is already available in several frameworks such as React, Vue and will likely continue to grow again.

npx create-my-microfrontend [project-name] [project-framework]

Example:

npx create-my-microfrontend main --vue

or

npm i -g create-my-microfrontend
npx create-my-microfrontend [project-name] [project-framework]

Example:

npm i -g create-my-microfrontend
npx create-my-microfrontend main --vue

No | Command | Description | Default --- | --- | --- | --- 1 | project-name | To determine the name of the project you will create | micro 2 | project-framework | To determine the framework to be used, you can use --react --vue | --react

Internal App

No | Name --- | --- 1 | APP_NAME 2 | PORT_APP_DEV 3 | PORT_APP_PROD 4 | ENDPOINT_DEV 5 | ENDPOINT_PROD 6 | FILE_NAME 7 | NAME_COMPONENT_EXPOSE 8 | SRC_COMPONENT_EXPOSE

External App

No | Name --- | --- 1 | REMOTE_NAME 2 | REMOTE_PORT_APP_DEV 3 | REMOTE_PORT_APP_PROD 4 | REMOTE_ENDPOINT_DEV 5 | REMOTE_ENDPOINT_PROD 6 | REMOTE_FILE

===========================

APP_NAME=main
PORT_APP_DEV=8080
PORT_APP_PROD=8000
ENDPOINT_DEV=http://localhost
ENDPOINT_PROD=http://prod.com
FILE_NAME=remoteEntry.js
NAME_COMPONENT_EXPOSE_1=./Navbar
NAME_COMPONENT_EXPOSE_2=./Footer
NAME_COMPONENT_EXPOSE_3=./Sidebar
SRC_COMPONENT_EXPOSE_1=./src/components/Navbar
SRC_COMPONENT_EXPOSE_2=./src/components/Footer
SRC_COMPONENT_EXPOSE_3=./src/components/Sidebar

===========================

REMOTE_NAME_1=app2
REMOTE_PORT_APP_DEV_1=8081
REMOTE_PORT_APP_PROD_1=8001
REMOTE_ENDPOINT_DEV_1=http://localhost
REMOTE_ENDPOINT_PROD_1=http://prod.com
REMOTE_FILE_1=remoteEntry.js

===============================

npx create-my-microfrontend main

src/App.js

import React, { lazy } from "react";

const Navbar = lazy(() => import("app2/Navbar"));
const Footer = lazy(() => import("app2/Footer"));

function App() {
    return (
        <div>
            <React.Suspense fallback={null}>
                <Navbar/>
            </React.Suspense>
            Hello Microfrontend
            <React.Suspense fallback={null}>
                <Footer/>
            </React.Suspense>
        </div>
    );
}

export default App;

.env

# ======== For Internal App ===========
# === Initial name app ===
APP_NAME=main
# === Port of app on dev mode === 
PORT_APP_DEV=8080
# === Port of app on prod mode if any === 
PORT_APP_PROD=8000
# === Endpoint dev ===
ENDPOINT_DEV=http://localhost
# === Endpoint prod ===
ENDPOINT_PROD=http://prod.com


# ======== For External app or remote app ========
# === For remote name ===
REMOTE_NAME_1=app2
# === Port of app on dev mode === 
REMOTE_PORT_APP_DEV_1=8081
# === Port of app on prod mode if any === 
REMOTE_PORT_APP_PROD_1=8001
# === Endpoint dev ===
REMOTE_ENDPOINT_DEV_1=http://localhost
# === Endpoint prod ===
; REMOTE_ENDPOINT_PROD_1=http://prod.com
# === File remote ====
REMOTE_FILE_1=remoteEntry.js
npm start
npx create-my-microfrontend app2

Create components "src/components/Navbar"

import React from 'react'

export default function Navbar() {
  return (
    <div>Navbar from app2</div>
  )
}

Create components "src/components/Footer"

import React from 'react'

export default function Footer() {
  return (
    <div>Footer from app2</div>
  )
}

.env

# ======== For Internal App ===========
# === Initial name app ===
APP_NAME=app2
# === Port of app on dev mode === 
PORT_APP_DEV=8081
# === Port of app on prod mode if any === 
PORT_APP_PROD=8001
# === Endpoint dev ===
ENDPOINT_DEV=http://localhost
# === Endpoint prod ===
ENDPOINT_PROD=http://prod.com
# === File name of remote file ===
FILE_NAME=remoteEntry.js
# === File name of file expose to another app ===
NAME_COMPONENT_EXPOSE_1=./Navbar
NAME_COMPONENT_EXPOSE_2=./Footer

# === Src component of file expose to another app ===
SRC_COMPONENT_EXPOSE_1=./src/components/Navbar
SRC_COMPONENT_EXPOSE_2=./src/components/Footer
npm start

Open on browser http://localhost:8080

Live preview

https://github.com/my-microfrontend/create-my-microfrontend/issues

By: Ugi Ispoyo Widodo