Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

omicro-cli

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

omicro-cli

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

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

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": "normal-app@1.0.0",
        "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上已部署的前端微服务
  • 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技术构建的前端静态资源部署应用

Keywords

FAQs

Package last updated on 24 May 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc