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

org-cli

v1.0.1

Published

通用快速构建工具

Downloads

5

Readme

通用的交互式代码模板构建工具 u-cli

安装

$ npm install org-cli -g

可用命令

| 命令 | 参数 | 参数简写 | 描述 | 示例 | | ------ | ----------------- | -------- | ------------------------ | ------------------------------------------------------------- | | create | [目录(项目名)] | | 创建项目 | ocli create demo | | ├─ | --tmpid <模板 id> | -t | 用指定模板创建 | ocli create demo -t default | | └─ | --config <配置> | -c | 指定在线配置, 将加入缓存 | ocli create demo -c https://gitee.com/org-cli/demo-config.git | | list | | | 查看可用模板列表 | ocli list | | └─ | --update | -u | 更新并查看 | ocli list -u | | clean | | | 删除所有缓存 | ocli clean | | ├─ | --tmp | -t | 删除模板缓存 | ocli clean -t | | └─ | --list | -l | 删除模板列表缓存 | ocli clean -l | | -h | | | 查看使用文档 | ocli -h |

create 构建流程

  1. 选择模板

    1.1 获取模板配置(优先取缓存,默认本项目模板) √

    1.2 选择模板 √

  2. 拉取模板

    2.1 下载 git 代码到缓存 √

  3. 解析模板

    3.1 解析模板 prompts 并收集问答 √

    3.2 根据问答获得的属性来解析 generator 中 模板 √

    3.3 创建项目复制解析后的模板到项目文件夹 √

  4. 模板初始化

    4.1 自动安装依赖 √

    4.2 运行提示 √

    4.3 模板自定义运行提示 √

模板仓库

示例模板仓库 地址

配置分支(模板配置列表)

方便及时同步模板列表(手动),更新模板配置

  • 远程模板配置列表 地址
  • 自带模板配置列表(插件目录) /config.json

模板配置列表格式

[
  {
    "name": "默认模板", //模板名称
    "value": "gitee:https://gitee.com/org-cli/template-demo.git", // 模板地址
    "id": "default", // 模板id
    "description": "基于uni-app的模板" // 模板描述
  }
]

如果没有远程模板配置列表缓存,将使用自带模板配置列表,可手动操作缓存

# 更新模板配置列表缓存
$ ocli list -u

# 删除模板配置列表缓存
$ ocli clean -l

模板分支

  • tmp-[A]

    模板[A], vue-cli preset 风格的模板 文档 最简版本,暂未完全兼容 preset

Todos

  • 逐步兼容 preset

第三方插件

  • commander 命令行框架,源自同名 Ruby 项目
  • download-git-repo 下载 git 代码文档
  • ejs 文件内容解析,生成动态代码
  • inquirer 交互式命令行
  • execa child_process 改进版,支持多操作系统
  • chalk 控制台带样式输出
  • cli-table3 表格插件(支持中文)
  • fs-extra 文件操作,fs 增强版
  • globby glob 增强版,模式匹配目录文件 Promise 接口、多模式匹配、否定模式匹配、扩展目录: dir → dir/\*_/_ 、支持 .gitignore
  • ora 优雅的终端转轮动画