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

@rafong/publish

v0.0.32

Published

web端项目发布工具

Downloads

5

Readme

web 自动发布工具

安装

推荐采用全局安装的方式

npm install @rafong/publish -g

使用

工具默认忽略 node_modules 文件夹 本工具支持两种发布模式

  • 手动发布
  • 自动发布
手动发布

在终端执行命令,根据提示输入对应的参数即可

publish
自动发布

需要先在项目根目录下创建配置文件, 本工具自带创建配置功能,执行以下命令

publish init

工具会在项目根目录创建server.config.json

注意:配置文件每个字段都不可为空,不填写需要删除

{
  "ignore": ["node_modules", ".git"], // 忽略上传的文件/夹
  "dev": {      // 环境名称
    "switch": true    // 开关
    "branch": ["dev"], // 分支管理,限定在指定分支进行发布
    // 环境配置 [必填]
    "host": "192.xxx.xxx.xxx",
    "username": "root",
    "password": "password",
    // 本地打包地址[选填],默认dist
    "local": "/dist",
    // 远程打包地址[选填],如不填写,默认为:/app_server/nginx/html/xxxx
    "remote": "/app_server/nginx/html/xxxx",
    // 发布成功后,在服务器执行对应的命令
    "exec": ["npm run build"]// 执行的命令
  },
  // 支持多个环境同时上传
  "test" : {
    "switch": false
    ....
  }
}

在配置文件中填写对应的字段,执行命令进行发布。

publish

本工具会检查远程服务器是否有对应的目录,如果没有会自动创建。

开发

安装

npm install

开发

安装后运行以下命令进行开发,在src目录下进行开发工作

npm run dev

请不要在master分支进行开发

发布

开发完成后,请提交到开发分支,联系管理员进行 review 和发布