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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@tuvmdainam/mfe-cli

v1.0.11

Published

Scaffold CLI for Micro Frontend modules

Downloads

904

Readme

@tuvmdainam/mfe-cli

CLI scaffold module cho kiến trúc Micro Frontend hiện tại.

Usage

npx @tuvmdainam/mfe-cli@latest create --name mod-payments --scope payments --port 3004
npx @tuvmdainam/mfe-cli@latest create --name mod-dynaform-builder --scope dynaform --port 9268 --host 192.168.101.15

Options

  • --name: tên module, bắt buộc, format mod-xxx
  • --scope: scope Module Federation, bắt buộc
  • --port: port dev server, bắt buộc (1024-65535)
  • --dir: thư mục đích tạo module (mặc định là thư mục hiện tại)
  • --host: host/IP dùng chung cho shell/backend/module (ưu tiên cao hơn default localhost)
  • --shell-url: override URL shell khi cần tách host riêng (ví dụ http://192.168.101.15:6978)
  • --backend-url: override URL backend khi cần tách host riêng (ví dụ http://192.168.101.15:6976)
  • --public-url: override PUBLIC_URL của module khi cần tách host riêng (ví dụ http://localhost:9268/)
  • --install: tự chạy npm install sau khi tạo xong

Ghi chú: nếu không truyền override, CLI sẽ tạo .env theo dạng host-agnostic (APP_PROTOCOL, APP_HOST, SHELL_PORT, BACKEND_PORT, MFE_PORT). CLI cũng tự dò shell-app/.env để lấy giá trị mặc định, nếu không tìm thấy mới fallback về localhost.

Template mới cài @sth87/shadcn-design-system trực tiếp trong module để dev local thuận tiện. Entry federated dùng file side-effect-free để tránh kéo runtime/bootstrap CSS ngoài ý muốn khi mount qua shell.

Ví dụ module local gọi shell trên server IP:

npx @tuvmdainam/mfe-cli@latest create --name mod-dynaform-builder --scope dynaform --port 9268 --shell-url http://192.168.101.15:6978 --public-url http://localhost:9268/

Template updates (Language Sync)

Template mfe-module-base đã được cập nhật theo mô hình i18n tập trung ở shell:

  1. Thêm hook useShellI18n cho remote module:
    • Ưu tiên shell/i18n
    • Fallback window.__SHELL_I18N_BRIDGE__
    • Fallback dictionary local ở standalone mode
  2. Bổ sung typing declare module 'shell/i18n' trong src/types/shell.d.ts.
  3. App template dùng i18n cho preview warning và 403 access denied.
  4. Home page mẫu dùng i18n key theo namespace module scope (__MFE_SCOPE__.*).
  5. Tránh polling render không cần thiết trong remote i18n hook (retry có giới hạn, subscribe theo event).

Checklist cho module generate mới:

  1. Khai báo key trên language service theo scope module.
  2. Dùng t(...) từ useShellI18n trong UI.
  3. Không gọi trực tiếp i18n backend từ remote.

Local test

npm run check
node bin/mfe.js create --name mod-sample --scope sample --port 3011 --dir /tmp
node bin/mfe.js create --name mod-sample --scope sample --port 3011 --host 192.168.101.15 --dir /tmp

Publish (private)

  1. Đăng nhập private registry.
  2. Tăng version.
  3. Publish package.
  4. Dev module dùng npx @tuvmdainam/mfe-cli@latest create ....