sftp-zip-deploy 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,8 +1,9 @@
1
1
  # sftp-zip-deploy
2
2
 
3
+ [![Build Status](https://github.com/vitaly-t/sftp-zip-deploy/actions/workflows/ci.yml/badge.svg)](https://github.com/vitaly-t/sftp-zip-deploy/actions/workflows/ci.yml)
3
4
  [![Node Version](https://img.shields.io/badge/nodejs-%2026-green.svg?logo=node.js&style=flat)](https://nodejs.org)
4
5
 
5
- Simple and efficient way to auto-deploy your project to a server:
6
+ Fast and efficient way to auto-deploy your project to a server:
6
7
 
7
8
  - It zips your distribution folder and sends the archive to your server via SFTP
8
9
  - It optionally runs remote commands, before / after zip deployment, via SSH2
@@ -22,14 +23,14 @@ npm i sftp-zip-deploy --save-dev
22
23
 
23
24
  In the example below, we deploy a NodeJS project into `/root/web` on our remote server.
24
25
 
25
- Once the zip file is deployed, we run commands to set that folder as active, then unpack
26
+ Once the zip file is deployed, we use `cmd.after` commands to set that folder as active, then unpack
26
27
  the archive and install the project's dependencies.
27
28
 
28
29
  ```ts
29
30
  import {zipAndDeploy} from 'sftp-zip-deploy';
30
31
 
31
32
  await zipAndDeploy({
32
- srcDir: './dist', // folder with content to deploy
33
+ srcDir: './dist', // local folder with content to deploy
33
34
  destDir: '/root/web/', // remote folder to copy our zip file
34
35
  zipFile: {
35
36
  name: 'release.zip', // set custom name for the archive
@@ -62,9 +63,9 @@ The main interface [ISftpZipDeployConfig] has a number of options, including eve
62
63
  * [onFilter] - to let you filter files inside distribution folder
63
64
  * [onCmdOutput] - to get all output from remote commands
64
65
 
65
- [onZipReady]:https://github.com/vitaly-t/sftp-zip-deploy/blob/main/src/config.ts#L67
66
- [onFilter]:https://github.com/vitaly-t/sftp-zip-deploy/blob/main/src/config.ts#L61
67
- [onCmdOutput]:https://github.com/vitaly-t/sftp-zip-deploy/blob/main/src/config.ts#L81
66
+ [onZipReady]:https://github.com/vitaly-t/sftp-zip-deploy/blob/main/src/config.ts#L69
67
+ [onFilter]:https://github.com/vitaly-t/sftp-zip-deploy/blob/main/src/config.ts#L63
68
+ [onCmdOutput]:https://github.com/vitaly-t/sftp-zip-deploy/blob/main/src/config.ts#L86
68
69
 
69
70
  [ISftpZipDeployConfig]:https://github.com/vitaly-t/sftp-zip-deploy/blob/main/src/config.ts#L6
70
71
 
package/dist/utils.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { Client as SSH2Client, ConnectConfig } from 'ssh2';
1
+ import { Client as SSH2Client } from 'ssh2';
2
+ import type { ConnectConfig } from 'ssh2';
2
3
  export declare function connectSSH2Client(client: SSH2Client, cn: ConnectConfig): Promise<SSH2Client>;
3
4
  export declare function execSSH2Command(client: SSH2Client, cmd: string, output: (err?: Buffer, std?: Buffer) => void): Promise<void>;
4
5
  /**
package/package.json CHANGED
@@ -1,12 +1,14 @@
1
1
  {
2
2
  "name": "sftp-zip-deploy",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Zip and deploy folder over SFTP",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "type": "module",
8
8
  "scripts": {
9
- "build": "tsc -p src"
9
+ "build": "tsc -p src",
10
+ "test": "node --test test/utils.test.ts",
11
+ "test:coverage": "node --experimental-test-coverage --test test/utils.test.ts"
10
12
  },
11
13
  "files": [
12
14
  "dist"