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

@leslies/fe-cli

v1.2.0

Published

简单优雅的前端脚手架: 提高前端的研发效能

Downloads

44

Readme

简单优雅的前端脚手架 fe-cli

使用

# 安装
npm i @leslies/fe-cli -g

# 添加模版
fe add

# 查看模板
fe list

# 创建项目  <project-name> : 项目名称,中横线分割
fe create <project-name>

# 发布 开发/测试环境
fe deploy

fe create

项目初始化的标准流程:

# 初始化 abc-test 项目
fe create abc-test
fe info v1.0.1
? 请选择初始化类型 项目
? 请选择项目模板 Taro小程序模板
正在下载模版... \
fe success 模板下载成功

# 先创建远程仓库,然后 本地仓库与远程仓库关联
cd abc-test
git init
git add .
git commit -m "first commit"
git branch -M main # 主分支重命名为 main
git remote add origin https://github.com/luozyiii/abc-test.git
git push -u origin main # 强制推送

fe add 添加模版

将平时喜欢的项目模版添加到 fe 脚手架(仅支持 git 仓库)

luozhiyi@luozhiyideMacBook-Pro: ~ $fe add
fe info v1.0.1
fe notice 开始添加模版...
? 请选择添加模版的类型 项目
? 请输入项目名称 Taro小程序模板
? 请输入项目仓库Git地址 https://github.com/luozyiii/taro-app.git
fe success 模版添加成功...

fe list 查看模版

luozhiyi@luozhiyideMacBook-Pro: ~ $fe list
fe info v1.0.1
【项目】Taro小程序模板
【组件】小程序表单组件
【项目】pc 项目

fe deploy 发布(建议只用于发布开发/测试环境)

# 1、在项目根目录配置deploy.config.json; 标准格式如下
[
  {
    "name": "开发环境",
    "enviroment": "dev",
    "ssh": {
      "host": "112.74.201.142",
      "port": 22,
      "username": "root",
      "password": "***"
    },
    "cmd": "npm run build",
    "romotePath": "/home/fe-test/dev",
    "localPath": "./lib"
  },
  {
    "name": "测试环境",
    "enviroment": "test",
    "ssh": {
      "host": "112.74.201.142",
      "port": 22,
      "username": "root",
      "password": "***"
    },
    "romotePath": "/home/fe-test/test",
    "localPath": "./dist"
  }
]

# 2、在项目根目录执行 fe deploy
luozhiyi@luozhiyideMacBook-Pro: ~/Work/project/fe-cli (git::main)$fe deploy
fe info v1.0.1
? 请选择部署的环境 开发环境
? 远程目录存在,请选择更新类型 覆盖更新
fe notice 远程目录清理完毕!
正在部署... -
fe success 部署前后文件差异!!!
┌─────────┬────────────┬──────────────────────────────┬─────────────┬────────────────────────────────┐
│ (index) │    name    │             path             │    size     │              diff              │
├─────────┼────────────┼──────────────────────────────┼─────────────┼────────────────────────────────┤
│    0    │ 'index.js' │ '/home/fe-test/dev/index.js' │ '845.45 KB' │ '变小: 895.65 KB => 845.45 KB' │
└─────────┴────────────┴──────────────────────────────┴─────────────┴────────────────────────────────┘
fe success 开发环境部署成功!

发布

借助 release-it 自动打 tag,生成 CHANGELOG.md, => github 仓库上配置 tag => 发布到 npm

# patch 1.0.0 => 1.0.1
npm run release -- patch

# minor 1.0.0 => 1.1.0
npm run release -- minor

# major 1.0.0 => 2.0.0
npm run release -- major

感谢支持

Github

npm