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

auto-deploy-cli

v0.0.5

Published

auto deploy cli

Downloads

5

Readme

AUTO DEPLOY CLI

对自有服务器自动化构建并打包发布。

重要提示(important)

如果不是在win平台使用,请直接跳过这段内容!

0.0.4 中,新增了对win平台打包成功后的弹窗提醒。由于涉及平台库的使用,引入了 ffi-napi 包。此包使用的 node-gyp 对node的版本有所要求(^16.14.0 || >=18.0.0)因此使用此版本需要使用对应版本的node来升级。

此外,工具编译过程需要使用python,建议安装3.6.8版本的。对于win编译环境的要求,请先安装:

npm install --global --production windows-build-tools

注意:新版本仅仅是应网友需求增加的弹窗提示,但这会增加对包安装的难度,如果不需要弹窗就还是继续用 0.0.3 版本!

  1. 安装脚手架(建议全局安装)
npm i -g auto-deploy-cli
  1. 在您的项目根目录下执行
deploy init
  1. 配置您的项目部署配置文件
module.exports = {
  projectName: '',            // 项目名称
  dev: {                      // 测试环境
    name: '测试环境',
    script: 'npm run build',  // 测试环境打包脚本
    host: '',                 // 测试服务器地址
    port: 22,                 // ssh port,一般默认22
    username: '',             // 登录服务器用户名
    password: '',             // 登录服务器密码
    distPath: '',             // 本地打包dist目录
    webDir: ''                // 测试环境服务器地址
  },
  prod: {                     // 线上环境
    name: '线上环境',
    script: 'npm run build',  // 线上环境打包脚本,如果要用yarn可以换成yarn
    host: '',                 // 线上服务器地址
    port: 22,                 // ssh port,一般默认22
    username: '',             // 登录服务器用户名
    password: '',             // 登录服务器密码
    distPath: '',             // 本地打包dist目录
    webDir: ''                // 线上环境web目录
  }
}

您可以在执行init 命令后在deploy/deploy.config.js下查看完整的配置说明。

  1. 完成配置后
deploy -h

查看您配置的构建命令

  1. 执行
deploy prod

如果您修改了配置文件,即环境属性名,那么您需在使用您自己定义的名称。

注意:在填写您的 distPath 的时候,只需告诉 cli 您项目打包后的目录名即可,一般打包后的目录都在项目的根目录。cli 当前只以项目根目录路径来获取目标目录,如您打包后的目录在项目根目录的某个子目录内,则需要您表明路径关系。