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

@tmsfe/tms-cli

v0.1.18-alpha.8

Published

tms-cli

Downloads

59

Readme

tms-cli使用教程

[TOC]

TMSWEB团队核心工程效能工具。提供多种类型前端项目的创建、构建、部署等功能。

1. 安装

卸载完成后。 安装

sudo npm i @tmsfe/[email protected] -g

安装成功后, 全局可以运行tms命令

2. 快速创建小程序开发环境

使用tms-cli快速初始化小程序开发环境

  1. 克隆tms-frontend代码

    git clone https://git.woa.com/tmsfe/tms-frontend.git
  2. 初始化开发环境

    # -m 参数如果不传, 默认构建全部模块 -p是小程序名 
    # 因为配置文件代码还没有合入master, 需要加一个-b参数指定分支
    tms run init -p <小程序名> -m <模块名> -b feat-dongxuwang-newmpconfig
    # 例如
    tms run init -p sinan -m aggrerent -b feat-dongxuwang-newmpconfig
  3. 启动监听服务

    tms run dev
  4. 更新小程序

    如果小程序的模块配置文件修改, 或者想新增一些开发的模块。 修改tms-frontend根目录下面的mp.config.json后运行

    tms run update

2. 常用命令

2-1 tms help 帮助命令

tms -h

2-2 初始化小程序项目

tms create <projectName>

该命令会在当前目录下面创建一个名为projectName的项目。

作为模块开发的开发环境。

示例:

# 这个会创建一个名字叫project1的项目模版
tms create project1

2-3 构建小程序

命令

tms build -t <需要构建的小程序的名称> -b <模版分支名> -p <是否构建模块> -d <构建目录> -r <是否构建远程>

参数说明:

  1. -t 如果不传, 默认选择本地项目构建。
  2. -t 表示构建生产环境, 会构建出可以用来发布的小程序。会拉取模版项目和各个模块的构建分支, 组成小程序
  3. -b 指定模版的分支 不传选择的master。
  4. -d 指定需要构建的目录。
  5. -m 指定需要构建的模块。
  6. -n 本地构建时, 即不传 -t 参数的时候, -n 表示小程序的名称(构建时会根据本地的mp.config.json进行构建,文件中可能会包含多个小程序)
  7. -r 构建本地项目时, 根据配置文件, 拉取模块远端分支代码, 会覆盖掉本地模块的改动
  8. -w 是否提示用户风险

build命令使用的几种场景:

  1. 构建本地应用。

    tms build

    这个命令会检索你src下面所有的有配置文件module.config.json的模块。 将他们构建到小程序中。

  2. 根据本地的mp.config.json, 将远程模块仓库同步到本地,

tms build -r

该命令会读取你本地开发目录下面的mp.config.json。将下面配置的小程序模块更新到本地的src目录中

  1. 打包官方小程序

    tms build -t <mpname>

    该命令会打包接入腾讯出行服务的官方小程序

    例如

    tms build -t sinan

2-4 上传小程序

上传当前目录下面的小程序

tms upload

2-5 清除编译生成的文件

清除本地改动以及还原主分支的配置

tms clean

2-5 预览小程序

tms preview

2-6 更新小程序以及模块的依赖

tms update

2-7 执行tslint检查

tms tsc

2-8 增量覆盖率检查

tms diffcovcheck

2-9 初始化默认模版项目

tms init-project

2-10 更新模版

tms upgrade

2-11 打印当前的开发环境信息

tms info