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

omicro-cli

v1.0.0

Published

a command line interface tool to create and deploy a front-end micro-service

Downloads

5

Readme

omicro-cli

创建obvious前端微服务的脚手架工具

使用

  • 全局安装脚手架
    npm install -g @runnan/omicro-cli
  • 创建项目
    • 执行omicro init
    • 生成的项目结构:
      |--serviceName@version
          |--dist:生产环境代码(自动生成)
          |--mock: 用于mock其他前端微服务和平台html的代码,方便开发调试
          |--typings: typescript声明文件
          |--script: 构建辅助代码
          |--src: 微服务业务代码
          |--eslint/webpack/jest等配置文件
          |--omicro.config.json:feda的资源声明配置文件
    • 执行npm start,启动样例工程:
  • 打包生产环境代码
    • 执行npm run build: 代码被打包到dist目录,且构建脚本自动把静态资源信息在omicro.config.json中注册:
    {
        "name": "[email protected]",
        "assets": {
            "css": [
                "entry.1ffa7be5.css"
            ],
            "js": [
                "entry.8f02d439.js"
            ]
        }
    }
  • 部署到Feda
    • 在服务端部署Feda
    • 假设Feda被部署在https://feda.com, 执行omicro deploy --agent https://feda.com, 本微服务的前端静态资源和资源声明文件omicro.config.json将被打包发送到Feda,被部署到Nginx服务器上

工程模板

  • 语言:typeScript
  • 样式:less、css-module
  • 框架:obvious、react(可选)
  • 构建:webpack
  • 代码检查:eslint
  • 单元测试:jest

omicro命令

Usage: omicro [Options] [Command]

Options:

  • -v, --version: 查看版本号
  • -h, --help: 查看帮助信息

Commands:

  • omicro init: 初始化前端微服务开发模板
  • omicro list [options]: 打印出所有Feda上已部署的前端微服务
    • -a, --agent < host >: 指定Feda所部署的服务端地址,默认是https://127.0.0.1:3000
  • omicro deploy [options]: 把前端微服务部署到Feda
    • -a, --agent < host >: 指定Feda所部署的服务端地址,默认是https://127.0.0.1:3000
    • -c, --config < path >: 指定omicro.config.json的路径,默认是项目根路径

关联项目

  • obvious:轻量级的微前端框架
  • react-obvious: 结合react和obvious的类react-redux框架
  • Feda: Front End Deploy Agent, 基于Node.js、Nginx、Docker技术构建的前端静态资源部署应用