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

sy-cli

v1.7.12

Published

sy-fe-cli

Downloads

29

Readme

soyoung fe cli

Build Status Github Releases

大部分子命令都需要内网环境,外网环境使用暂不支持

关于sy-cli

sy-cli是为了更加高效解决日常sy前端工作中的开发/调试/部署问题,包含:

  • 小程序 - 自动生成二维码,
  • 统一发布流程 接入发布系统,
  • 基础js类库引用,
  • 跨平台调试工具,
  • 命令行生成雪碧图,
  • 命令行qshell使用(解决跨平台兼容问题),
  • 等等

sy-cli可以接入有帮助的各种,感兴趣的乡亲随时联系我~

安装sy-cli

npm install sy-cli

查看帮助及所有命令

sy-cli -h

查看帮助及所有命令

小程序 - 自动生成二维码

需要在打包机上安装好 微信开发者工具,配置好开发环境!才能有下面步骤!!!

// 在你的项目中 
// 新建 sy-cli-qr.json
// 修改package.json的scripts
// package.json

...
"scripts": {
    "dev": "wepy build --watch",
    "build": "cross-env NODE_ENV=production wepy build --no-cache",
    "test": "echo \"Error: no test specified\" && exit 1",
    "qr": "sy-cli qr \"./sy-cli-qr.json\""
  },
...
// sy-cli-qr.json

{
 "path":{
// mac上的cli路径都一样
   "cli":"/Applications/wechatwebdevtools.app/Contents/Resources/app.nw/bin/cli",
// wepy生成后的路径
   "wx":"./dist"
 },
 "source":{
// wepy的编译
   "scripts":"npm run build"
 },
// jenkins的工作空间里面
 "jenkinsURL":"http://ip:8080/job/XXX/ws/",
// 钉钉机器人的token
 "dingtalkToken":"XXXX"
}

ps: jenkins的打包机器为 物理mac机器,所以不能在内部gitlab 使用webhook触发。

jenkins上的图片也不能对外解析,所以钉钉里面无法直接展示

具体原理https://www.jianshu.com/p/bbe144ac0d6a

upload - 接入发布系统,统一发布流程

sy-cli upload  <path> (--am) (--test)

项目配置 对应的json 文件. 内容为下图格式

{
    // 项目名称
    "productName": "fe-m",
    "protocol": "http://",
    // 子项目git地址
    "url" : "*******.git",
    // git 用户名
    "userrname": "***",
    // git 密码
    "password": "***",
    // 对应path 路径
    "gitpath": "xxx"
}

image.png

utils - 在当前项目加入工具类

utils.js 引入方式为打包引用/cdn引用两种,选择后输入gitlab账户,提供最新版下载或者CDN地址

sy-cli utils

image.png

bsync - 代理URL及监听指定目录文件,实现浏览器同步刷新

集成 browser sync,输入要代理的URL及目录即可实现

sy-cli bsync

image.png

cdn - 目前包含qupload 上传 及 cdnrefresh 刷新CDN地址缓存两种

sy-cli cdn <path>

sy-cli cdn 会根据提供的path路径读取七牛上传配置文件, 集成了sy-qshell ,从服务器拉取最新的aksk, 实现文件上传。

r - 有条件展示的命令

如果sy-cli执行的当前目录包含package.json,且package包含scripts,在 sy-cli -h的时候会在带出当前可以执行命令

sy-cli r test

等同于

npm run test

r <option>

sprite - 生成精灵图及样式表

输入或默认在要生成的文件夹下,输入要生成为精灵图的图片前缀(eg : icon- ***.jpg) 会自动生成相对应的精灵图及样式表

操作流程:

  • sy-cli sprite
  • 按照步骤,是否在当前目录下执行,或可输入相对当前路径的执行目录
  • 将事先准备好要打包的图片的统一前缀填写
  • 调节图片直接的距离(默认为0)
  • 将生成出sprite的文件夹,文件夹中会出现精灵图,以及对应的样式表。
sy-cli sprite

image.png