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

vue-cli-plugin-ftp-deploy

v0.1.16

Published

vue-cli-plugin for deploying via ftp to remote server

Downloads

461

Readme

vue-cli-plugin-ftp-deploy

vue-cli-plugin for deploying via ftp

Installation

via command line

vue add ftp-deploy

via Vue UI

Click Plugins -> Add plugin
search for ftp-deploy
install it
*** don't forget to click 'Finish installation' to generate config file

the plugin will generate ftpdeploy folder and config.js inside

Before Use

add this to your .env.local

ftpHost = your-ftp-host
ftpPort = your-ftp-port
ftpUsr  = your-ftp-username
ftpPwd  = your-ftp-password

or

VUE_APP_ftpHost = your-ftp-host
VUE_APP_ftpPort = your-ftp-port
VUE_APP_ftpUsr  = your-ftp-username
VUE_APP_ftpPwd  = your-ftp-password

example

VUE_APP_ftpHost = 127.0.0.1
VUE_APP_ftpPort = 21
VUE_APP_ftpUsr  = usr@localhost
VUE_APP_ftpPwd  = pwdpwdpwd

Default Settings

default ftpdeploy/config.js

module.exports = {
  localBasePath: "/",
  remoteBasePath: "/",
  sync: [{ src: "/dist", dest: "/" }]
};

By default, will upload everything in /dist folder to base path of your remote server.

Usage

add more settings in ftpdeploy/config.js

module.exports = {
  localBasePath: "/",
  remoteBasePath: "/test_ftp_deploy/",
  del: ["/folder0/", "/folder1", "folder2", "folder3/folder4"],
  // folder0, folder1, folder2, folder4 on remote server will be deleted
  clear: ["folder5", { dir: "folder6", test: "*.js" }],
  // folder5 will be empty, folder6's all .js files will be deleted
  // `test` use minimatch to match
  create: ["folder7", "folder8/folder9", { dir: "folder10", perm: "777" }],
  // create folder7, folder8, folder8/folder9, folder10 with permission 777 (chmod command)
  sync: [
    { src: { dir: "/dist", ignore: "dist/css/**" }, dest: "/" },
    // `ignore` use glob to match
    { src: "/api", dest: "/api/" },
    { src: "foo/cfg", dest: "/cfg" }
  ]
};

More info about minimatch here. More info about glob pattern here. The plugin will delete, clear, create then upload.

Config.js Setting

| Parameters | Detail | | -------------- | ------------------------------------------------ | | localBasePath | local path relative to project path | | remoteBasePath | remote path on the server | | del | array of directory to delete | | clear | array of directory to clear it's content | | create | array of directory to create | | sync | array of source ==> destination folder to upload |

Vue UI Setting

| Parameters | Default Value | Detail | | ------------------------------- | ------------- | ---------------------------------------------------------- | | config.js location | /ftpdeploy/ | setting file | | path to write hist.json | /ftpdeploy/ | md5 of file content, use for upload changed file only mode | | gen file checksum | true | save md5 of uploaded files as hist.json | | upload diff file from hist only | true | will upload only changed file only |

Sample UI Image

Command Line Setting

Add command to 'scripts' part of package.json

  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "deploy": "vue-cli-service ftpdeploy --genHist --diffFileOnly --ftpCfgPath /ftpdeploy/ --ftpHistPath /ftpdeploy/"
  },

Now you can

npm run deploy

or

yarn deploy

Deploy to Multiple Sites

An example for different build configuration and different deploy target i.e. site2

.env.site2.local

NODE_ENV=production
VUE_APP_ftpHost = 127.0.0.2
VUE_APP_ftpPort = 21
VUE_APP_ftpUsr  = usr2@localhost
VUE_APP_ftpPwd  = pwd2pwd2pwd2

Add another build command to 'scripts' part of package.json to build with site2 mode which will use above env file and set /site2 as built destination.

Add another deploy command to 'scripts' part of package.json to deploy with site2 mode and use /ftpdeploy_site2 as configuartion directory.

  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "deploy": "vue-cli-service ftpdeploy --genHist --diffFileOnly --ftpCfgPath /ftpdeploy/ --ftpHistPath /ftpdeploy/",
    "build:site2": "vue-cli-service build --mode site2 --dest site2",
    "deploy:site2": "vue-cli-service ftpdeploy --mode site2 --genHist --diffFileOnly --ftpCfgPath /ftpdeploy_site2/ --ftpHistPath /ftpdeploy_site2/"
  },

then duplicate /ftpdeploy or create another folder i.e. /ftpdeploy_site2 and change /ftpdeploy_site2/config.js to

module.exports = {
  localBasePath: "/",
  remoteBasePath: "/",
  sync: [{ src: "/site2", dest: "/" }]
};

Now you can

npm run deploy:site2

or

npm run build:site2 && npm run deploy:site2