scp-next 1.0.13 → 1.0.14

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/CHANGELOG.md CHANGED
@@ -1,7 +1,12 @@
1
1
  # Changelog
2
2
 
3
- ## 0.1.0
3
+ ## 1.0.14
4
4
 
5
- - Initial `scp-next` TypeScript CLI and library.
5
+ - Production-ready `scp-next` TypeScript CLI and library.
6
6
  - Added upload, download, recursive directory transfer, dry-run mode, configuration files,
7
7
  profiles, jobs, environment-variable support, typed errors, and dual ESM/CommonJS builds.
8
+ - Added GitHub Pages developer documentation and expanded README usage sections.
9
+ - Improved SCP-style destination handling for files and directories.
10
+ - Enabled destination directory creation by default with `--no-create-directories` opt-out.
11
+ - Improved host verification guidance, Git Bash remote path handling, and progress output behavior.
12
+ - Removed unused legacy tooling and Docker configuration files.
package/README.md CHANGED
@@ -19,6 +19,14 @@
19
19
  It uses SFTP internally through `ssh2-sftp-client` instead of implementing SCP or SFTP protocols manually.
20
20
  Developer documentation is available at <https://chengchuu.github.io/scp-next/>.
21
21
 
22
+ ## Contents
23
+
24
+ - [Installation](#installation)
25
+ - [Quick Start](#quick-start)
26
+ - [Basic Usage](#basic-usage)
27
+ - [Library Usage](#library-usage)
28
+ - [Advanced Usage](#advanced-usage)
29
+
22
30
  ## Features
23
31
 
24
32
  - Upload and download files or directories recursively.
@@ -200,6 +208,28 @@ try {
200
208
  }
201
209
  ```
202
210
 
211
+ ### Use a Configuration File
212
+
213
+ The CLI loads configuration files automatically. The library API receives options directly,
214
+ so load JSON in your application and pass the relevant `server` and `transfer` values.
215
+
216
+ ```ts
217
+ import { readFile } from "node:fs/promises";
218
+
219
+ import { upload, type ScpNextConfig } from "scp-next";
220
+
221
+ const config = JSON.parse(
222
+ await readFile(new URL("./scp-next.config.json", import.meta.url), "utf8")
223
+ ) as ScpNextConfig;
224
+
225
+ await upload({
226
+ ...config.server,
227
+ ...config.transfer,
228
+ localPath: "./dist",
229
+ remotePath: "/var/www/example"
230
+ });
231
+ ```
232
+
203
233
  ## Advanced Usage
204
234
 
205
235
  ### Configuration Files
@@ -218,6 +248,14 @@ Use `--config` for an explicit path:
218
248
  scp-next upload ./dist /var/www/example --config ./deploy/scp-next.json
219
249
  ```
220
250
 
251
+ Use `--profile` with a configuration file:
252
+
253
+ ```bash
254
+ scp-next upload ./dist /var/www/example \
255
+ --config ./scp-next.config.json \
256
+ --profile production
257
+ ```
258
+
221
259
  Example:
222
260
 
223
261
  ```json
@@ -237,6 +275,19 @@ Example:
237
275
  }
238
276
  ```
239
277
 
278
+ Configuration file options:
279
+
280
+ | Key | Description |
281
+ | ---------------- | ------------------------------------------------------------------- |
282
+ | `server` | SSH connection options such as `host`, `port`, and `username`. |
283
+ | `transfer` | Transfer defaults such as `recursive`, `overwrite`, and `timeout`. |
284
+ | `defaultProfile` | Profile name used when `--profile` or `SCP_NEXT_PROFILE` is absent. |
285
+ | `profiles` | Named server connection profiles. |
286
+ | `jobs` | Reusable upload or download jobs for `scp-next run <job>`. |
287
+
288
+ Root-level server options such as `host`, `username`, `privateKeyFile`, `knownHostsFile`,
289
+ and `hostFingerprint` are also supported for simple configuration files, but `server` keeps connection values grouped and easier to read.
290
+
240
291
  ### Named Profiles
241
292
 
242
293
  ```json
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scp-next",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "description": "A SCP CLI and library for secure SSH file transfers using SFTP.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",