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

lugia-cli

v1.1.22

Published

npm i -g lugia-cli

Downloads

6

Readme

安装

npm i -g lugia-cli

参数说明

  -V, --version                   output the version number
  -p, --path <String>             指定进行扫描安装的目录
  -t, --type <String>             指定操作类型:
          update            进行依赖更新
          find              进行依赖检索
          add               依赖不存在时,自动添加最新依赖
          yarn              找到目录执行yarn操作
          rm                清空node_modules文件夹
          download          根据参数进行项目clone代码, 可指定安装npm依赖.
          pull              根据查到的npm项目进行代码拉取操作
          build             根据查到的npm项目进行项目构建操作,但指定了上传信息将会进行pull更新、yarn模块安装后进行项目构建.
          replaceWidget     根据查到的mega项目进行lugiad页面的组件替换处理
          mergeProps        根据找到的mega项目进行lugiad页面的属性合并处理
          mergeModel        根据找到的mega项目进行lugiad页面的进行模型绑定信息合并
          backup            检索项目录下lugia-cli/back目录,列出可以恢复的项目目录供用户选择进行恢复.

  -m, --modules <String[]>        指定需要进行更新的模块,多个用逗号[,]隔开
  -r, --registry <String>         指定用于扫描的源
  -git, --gitHost <String>        git地址的前缀
  -u, --userName <String>         git用户名
  -pwd, --password <String>       git密码
  -hs, --host <String>            ssh地址
  --skip                          跳过构建前的代码更新操作
  -rdir, --remoteDir <String>     上传的远程根目录
  --force                         强制切换代码到最新到分支,上传部署文件时将会强制删除已存在的目录文件。请慎用避免误删操作
  -i, --install                   下载代码后是否进行yarn install操作,默认为:false
  -inc, --instance <Number>       启动并行操作的数量,建议instance的值与CPU内核数一致
  -l, --projectList <String[]>    要下载的项目名称列表,多个用逗号[,]隔开
  -b --branch <String>            指定要下载代码的git分支,默认为: dev
  -mn, --moduleName <String>      指定查找替换的组件库名称
  -w, --widgetName <String>       指定查找替换的组件名称
  -nmn, --newModuleName <String>  替换为新的模块名称
  -nw, --newWidgetName <String>   替换为新的组件名称
  -nv, --newVersion <String>      替换为新的组件库版本
  -mu, --mutation <String>        待合并的模型操作
  -bi, --bind <String>            待合并的模型绑定
  -z, --zip                       是否进行压缩处理,默认不进行压缩
  --uglify                        是否进行压缩处理,默认不进行压缩
  --uploadRoot                    是否直接上传到根目录,默认上传到对应的发布目录,如果开启该参数则会将代码直接上传到根目录下,不会删除原有目录及备份代码。
  --dev                           添加模块时是否添加到devDependencies上,默认为false
  --onlyAdd                       更新模块时、添加模块时仅进行package.json的更新处理
  -mp, --mergeProps  <JSON>       指定要合并到组件的属性JSON信息
  -h, --help                      display help for command

模块处理对应目录必须有 package.json 文件

添加依赖

lugia-cli -t add -p  "/test/*" -m @ysstech-data/ssf-fida-bussiness@beta -r http://192.168.102.79/verdaccio

更新项目依赖

lugia-cli -t update -p  "/test/*" -m @lugia/lugia-web@beta,@ysstech-data/data-web@beta,@ysstech-data/data-web-bussiness@beta,@ysstech-data/ssf-fida-bussiness@beta -r http://192.168.102.79/verdaccio

查找依赖

lugia-cli -t find -p  "/test/*" -m @ysstech-data/ssf-fida-bussiness@beta -r http://192.168.102.79/verdaccio

执行 yarn 操作

lugia-cli -t yarn -p "/test/*" -r http://192.168.102.79/verdaccio

[

执行 清空 node-modules 操作

lugia-cli -t rm -p "/test/*"

删除所有 test 下子目录的 node-modules 目录。

下载代码操作

lugia-cli -p /test -l  ssf-fida-classifiedAssetAnalysis -t download -git http://localhost:3000/product-code/web -u liguoxin -pwd 123456
# 下载并进行yarn install
lugia-cli -p /test -l  ssf-fida-classifiedAssetAnalysis -t download -git http://localhost:3000/product-code/web -u liguoxin -pwd 123456 -i

pull 代码操作

lugia-cli -p /test  -t pull -b dev --force

lugiad 页面的组件替换

lugia-cli -p "./*"  -t replaceWidget -mn @ysstech-data/ssf-fida-bussiness -w contentLayout -nmn @ysstech-data/ssf-fida-bussine -nw ContentLayout

lugiad 页面的组件属性合并

lugia-cli -p "./*"  -t mergeProps -mn @ysstech-data/ssf-fida-bussiness -w contentLayout -nmn @ysstech-data/ssf-fida-bussine -nw ContentLayout

项目构建

lugia-cli -p "./*"  -t build

项目构建进后生成压缩包

lugia-cli -p "./*"  -t build --zip

项目构建后进行 uglify-js 处理

lugia-cli -p "./*"  -t build --uglify

项目构建后进行上传处理

lugia-cli -p "./*"  -t build --uglify -u root -pwd 123456 --host 127.0.0.1 --remoteDir /home/work

恢复备份的项目文件

lugia-cli -p "./*"  -t backup --uglify -u root -pwd 123456 --host 127.0.0.1 --remoteDir /home/work

上传规则为将打包后的文件上传到 ${remoteDir}/${deployPath}目录上。

PS: deployPath 读取自 package.json 的配置,如若读取不到则使用 name 作为该目录.

合并 lugiad 内部的模型绑定、事件绑定

 lugia-cli -p /Users/liguoxin/WebstormProjects/ssf-project/ssf-fida-abdInvest -t mergeModel -mn @ysstech-data/ssf-fida-bussiness -w FloatWindowTable -mu '{"onHello":{"e":"onHello","m":"strategyAnalysist","mo":"@/models","mu":"onExpand"}}'  -bi '{"ligx":{"m":"strategyAnalysist","mo":"@/models","f":"tableColumns","p":"ligx","b":"connect","d":false}}'