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

vite-plugin-better-deploy

v0.1.0-alpha.7

Published

auto deploy

Downloads

17

Readme

中文

使用SSH自动部署到服务器

项目采用 chalkora实现与vite一致的控制台风格

目前仅支持vite项目,计划后续支持所有node项目类型,支持的配置项如下:

安装

npm install vite-plugin-better-deploy -D

或者

pnpm install vite-plugin-better-deploy -D

或者

yarn add vite-plugin-better-deploy -D

使用示例

vite.config.ts

import AutoDeploy from 'vite-plugin-better-deploy'

export default {
  plugins: [
    AutoDeploy({
      host: '127.0.0.1',
      username: 'root',
      password: '123456',
      remotePath: '/www/wwwroot/example',
      previewPath: 'https://github.com/strange-qwq/auto_deploy',
    })
  ]
}

配置项

export type PluginConfig = ClientConfig & {
    /**
     * 是否需要确认(默认为 true)
     */
    needInquire?: boolean
    /**
     * 部署前是否删除整个远程路径,true则删除整个文件夹,false则只删除与打包文件名称重复的文件(默认为 false)
     */
    removeRemote?: boolean
    /**
     * 部署后是否删除本地文件(默认为 false)
     */
    removeLocal?: boolean
    /**
     * 服务器上传的完整路径
     */
    remotePath: string
    /**
     * 服务器预览地址,用于部署后提示访问
     */
    previewPath?: string
}

export interface ClientConfig {
    /**
     * SSH地址
     */
    host: string
    /**
     * SSH端口(默认为 22)
     */
    port?: number
    /**
     * SSH用户名
     */
    username: string
    /**
     * SSH密码
     */
    password: string
}

English

Automatically deploy to servers using SSH

The project uses chalk and ora to implement a console style consistent with vite.

At present, only the vite project is supported, and plans to support all node project types in the future.

Install

npm install vite-plugin-better-deploy -D

or

pnpm install vite-plugin-better-deploy -D

or

yarn add vite-plugin-better-deploy -D

Example

vite.config.ts

import AutoDeploy from 'vite-plugin-better-deploy'

export default {
    plugins: [
        AutoDeploy({
            host: '127.0.0.1',
            username: 'root',
            password: '123456',
            remotePath: '/www/wwwroot/example',
            previewPath: 'https://github.com/strange-qwq/auto_deploy',
        })
    ]
}

Configuration

export type PluginConfig = ClientConfig & {
    /**
     * Do you need to confirm (default to true)
     */
    needInquire?: boolean
    /**
     * Do you want to delete the entire remote path before deployment? If true, delete the entire folder. If false, only delete files with duplicate packaging file names (default to false)
     */
    removeRemote?: boolean
    /**
     * Delete local files after deployment (default to false)
     */
    removeLocal?: boolean
    /**
     * The complete path uploaded by the server
     */
    remotePath: string
    /**
     * Server preview address, used to prompt access after deployment
     */
    previewPath?: string
}

export interface ClientConfig {
    /**
     * SSH address
     */
    host: string
    /**
     * SSH port (default to 22)
     */
    port?: number
    /**
     * SSH username
     */
    username: string
    /**
     * SSH password
     */
    password: string
}

Special Thanks