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

@xk5/cli

v0.1.20-7

Published

Xk5 Cli 是一个藤蔓专用的项目构建工具,通过 Xk5 Cli 可以快速搭建一个配置完整的移动端 Vue 项目。

Downloads

120

Readme

Xk5 Cli

Xk5 Cli 是一个藤蔓专用的项目构建工具,通过 Xk5 Cli 可以快速搭建一个配置完整的移动端 Vue 项目。

特点

  • 提供丰富的命令,涵盖从搭建到构建发布的完整流程
  • 基于约定的目录结构,自动生成完备的配置
  • 内置 ESlint、Prettier、Stylelint、Commitlint 校验规则,提交代码时自动执行校验
  • 根据定时部署约定,配合运维工具实现自动化生成标签、构建
  • 内置基础的 webpack resolve、预处理器、自动化导入(style-resource-loader)、postcss-plugin-px2rem 等配置
  • 为了方便开发和构建,根据环境变量,相对应地插入 log 文件、提供 API 代理

安装方式

# 通过 npm 安装
npm i @xk5/cli -D

# 通过 yarn 安装
yarn add @xk5/cli --dev

命令

Xk5 Cli 中内置了一系列的命令,可以将命令添加到 npm scripts 中进行使用。

// package.json
{
  "scripts": {
    "create": "xk5 create",
    "serve": "xk5 serve",
    "lint": "xk5 lint",
    "changelog": "xk5 changelog",
    "build": "xk5 lint",
    "tag": "xk5 tag",
    "release": "xk5 release",
    "test": "xk5 test"
  }
}

create

创建新项目。

xk5 create [projectName]

projectName是可选值,可以直接运行xk5 create,在后续命令行提示下再输入项目名。

如果项目是 monorepo,在packages目录下运行xk5 craete命令,则默认会使用 lerna 安装依赖。

serve

运行本地开发环境。

xk5 serve [server]

server是可选值,用户可以通过cross-env手动设置环境服务,但必须是目前 Xk5 Cli 已内置的服务。

运行 serve 命令,实际上执行vue-cli-service serve命令。

lint

校验 ESlint、Stylelint 规则并修复。

xk5 lint

仅校验src目录下的文件。

changelog

根据 commit 历史生成changelog

xk5 changelog

build

构建项目。

xk5 build [server]

server是可选值,用户可以通过cross-env手动设置环境服务,但必须是目前 Xk5 Cli 已内置的服务。

参数:

  • --report:在dist目录下生成report.html提供用户分析打包内容。

tag

生成特殊 git 标签。按照package.jsonversion值或过往的 tag 生成新的 tag。

xk5 tag [name]

name的值必须是符合 semver 规则的版本号,或者类似project-1.1.1.0.xk5的值。

例如:project-1.1.1.0.xk5,version 是1.1.1,其中0代表预发布(prerelease)的次数,xk5是环境变量。

参数:

  • -s, --server <name>:name`是对应的环境变量。

环境变量的值可以通过命令行的提示选择内置的环境,或者自定义。

注意:在项目根目录下生成tag.json文件作为 tag 缓存记录,请不要随意删除。

release

发布项目。发布前会执行changelog命令和更新package.jsonversion,如果是 monorepo,则会检查引用依赖的项目同步更新版本号。

xk5 release [version]

参数:

  • --yes:确认并忽略所有 prompt。意味着可以通过xk5 release version --yes进行快速发布。
  • -i, --inc <level>:level指更新的版本等级,可选值是majorminorpatchprerelease,默认值patch`。

deploy

部署项目。主要用于配合运维工具设置定时任务,部署过程会执行 build 命令。

目前定义了 sdev、dev、dev2 服务的部署脚本。各个服务执行过程稍有不同,sdev 逢周四会执行 release 命令,生成 tag。

xk5 deploy <server>

server必填,输入需要部署的环境服务。

参数:

  • -i, --install:重新安装依赖。

test

单元测试。