vidup 1.0.18 → 1.0.20

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vidup",
3
- "version": "1.0.18",
3
+ "version": "1.0.20",
4
4
  "description": "Synchronize a local directory of video files to remote streaming services.",
5
5
  "keywords": [
6
6
  "bunnycdn-stream",
@@ -43,43 +43,39 @@
43
43
  "dependencies": {
44
44
  "@types/yargs": "^17.0.35",
45
45
  "bunnycdn-stream": "^2.5.5",
46
- "execa": "^9.6.1",
46
+ "execa": "^10.0.1",
47
47
  "ffmpeg-static": "^5.3.0",
48
48
  "hasha": "^7.0.0",
49
+ "lognow": "^0.8.4",
49
50
  "lowdb": "^7.0.1",
50
- "ora": "^9.4.0",
51
- "picocolors": "^1.1.1",
52
- "pretty-ms": "^9.3.0",
51
+ "ora": "^9.4.1",
52
+ "pretty-ms": "^9.3.1",
53
53
  "untildify": "^6.0.0",
54
- "yargs": "^18.0.0"
54
+ "yargs": "^18.2.0"
55
55
  },
56
56
  "devDependencies": {
57
- "@arethetypeswrong/core": "^0.18.2",
58
- "@kitschpatrol/shared-config": "^7.6.0",
59
- "@types/node": "^20.19.41",
60
- "bumpp": "^11.1.0",
61
- "mdat-plugin-cli-help": "^3.0.0",
62
- "publint": "^0.3.21",
57
+ "@arethetypeswrong/core": "^0.18.5",
58
+ "@kitschpatrol/shared-config": "^8.12.1",
59
+ "@types/node": "~24.13.4",
60
+ "brewpub": "^0.5.0",
61
+ "bumpp": "^12.3.0",
62
+ "mdat-plugin-cli-help": "^3.4.0",
63
+ "publint": "^0.3.25",
63
64
  "shx": "^0.4.0",
64
- "tsdown": "^0.22.0",
65
- "typescript": "^5.9.3",
66
- "vitest": "^4.1.6"
65
+ "skills": "^1.7.0",
66
+ "tsdown": "^0.23.0",
67
+ "typescript": "^6.0.3",
68
+ "vitest": "^5.0.3"
67
69
  },
68
70
  "engines": {
69
- "node": ">=20.19.0"
70
- },
71
- "devEngines": {
72
- "runtime": {
73
- "name": "node",
74
- "version": ">=22.18.0"
75
- }
71
+ "node": "^24.16.0 || >=26.3.0"
76
72
  },
77
73
  "scripts": {
78
74
  "build": "tsdown",
79
- "clean": "shx rm -f pnpm-lock.yaml && git clean -fdX -e !.claude/",
75
+ "clean-deep": "shx rm -f pnpm-lock.yaml && git clean -fdX -e !.claude/",
80
76
  "fix": "ksc fix",
81
77
  "lint": "ksc lint",
82
- "release": "bumpp --commit 'Release: %s' && pnpm build && NPM_AUTH_TOKEN=$(op read 'op://Personal/npm/token') pnpm publish",
78
+ "release": "bumpp --commit 'Release: %s' && pnpm build && pnpm publish --otp $(op item get npm --otp) && brewpub --tap kitschpatrol/tap",
83
79
  "test": "vitest run"
84
80
  }
85
81
  }
package/readme.md CHANGED
@@ -6,9 +6,10 @@
6
6
 
7
7
  <!-- badges -->
8
8
 
9
- [![NPM Package vidup](https://img.shields.io/npm/v/vidup.svg)](https://npmjs.com/package/vidup)
10
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/license/mit/)
9
+ [![NPM Package vidup](https://img.shields.io/npm/v/vidup.svg)](https://www.npmjs.com/package/vidup)
10
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/license/mit)
11
11
  [![CI](https://github.com/kitschpatrol/vidup/actions/workflows/ci.yml/badge.svg)](https://github.com/kitschpatrol/vidup/actions/workflows/ci.yml)
12
+ [![Homebrew](https://img.shields.io/badge/Homebrew-kitschpatrol%2Ftap%2Fvidup-FBB040?logo=homebrew&logoColor=white)](https://github.com/kitschpatrol/homebrew-tap/blob/HEAD/Formula/vidup.rb)
12
13
 
13
14
  <!-- /badges -->
14
15
 
@@ -31,32 +32,54 @@ Currently, only Bunny.net's [Bunny Stream](https://bunny.net/stream/) service is
31
32
 
32
33
  ## Getting started
33
34
 
35
+ <!-- dependencies -->
36
+
34
37
  ### Dependencies
35
38
 
36
- The vidup CLI tool requires Node 20.9.0+. The exported APIs are ESM-only and share the Node 20.9.0+ requirement. Vidup is implemented in TypeScript and bundles type definitions.
39
+ - [Node.js](https://nodejs.org/) 24.16.0 or newer (specifically `^24.16.0 || >=26.3.0`)
40
+
41
+ <!-- /dependencies -->
42
+
43
+ The exported APIs are ESM-only. Vidup is implemented in TypeScript and bundles type definitions.
37
44
 
38
45
  A [Bunny Stream](https://bunny.net/stream/) account, API key, and library ID are required.
39
46
 
47
+ <!-- install -->
48
+
40
49
  ### Installation
41
50
 
42
- Invoke directly:
51
+ There are several ways to install vidup depending on how you're planning to use it:
52
+
53
+ #### CLI
54
+
55
+ Run it once without installing:
43
56
 
44
57
  ```sh
45
58
  npx vidup
46
59
  ```
47
60
 
48
- Or, install locally to access the CLI commands in a single project or to import the provided TypeScript APIs:
61
+ Or install it globally with Homebrew:
49
62
 
50
63
  ```sh
51
- npm install vidup
64
+ brew install kitschpatrol/tap/vidup
52
65
  ```
53
66
 
54
- Or, install globally for access across your system:
67
+ Or install it globally with npm:
55
68
 
56
69
  ```sh
57
70
  npm install --global vidup
58
71
  ```
59
72
 
73
+ #### Library
74
+
75
+ Add it to your project to import the TypeScript API. This also puts the `vidup` CLI on your project's path:
76
+
77
+ ```sh
78
+ npm install vidup
79
+ ```
80
+
81
+ <!-- /install -->
82
+
60
83
  ## Usage
61
84
 
62
85
  Vidup treats local videos' file names as keys, and will look for a file with the same name / title on the remote streaming service.
@@ -70,11 +93,13 @@ Vidup tracks the content hash of each local video. If you replace a local video
70
93
 
71
94
  Any videos present on the remote service that aren't matched to a video file in the local folder **will be deleted from the remote service**.
72
95
 
73
- ### CLI
96
+ ### CLI usage
74
97
 
75
98
  <!-- cli-help -->
76
99
 
77
- #### Command: `vidup`
100
+ #### Commands
101
+
102
+ ##### Command: `vidup`
78
103
 
79
104
  Run a vidup command.
80
105
 
@@ -94,7 +119,7 @@ vidup [command]
94
119
 
95
120
  _See the sections below for more information on each subcommand._
96
121
 
97
- #### Subcommand: `vidup sync`
122
+ ##### Subcommand: `vidup sync`
98
123
 
99
124
  Synchronize a remote video streaming service to mirror the contents of a local directory. Warning: This command will irrevocably delete remote videos that are not present in the local directory.
100
125
 
@@ -116,7 +141,7 @@ vidup sync <directory> [options]
116
141
  | `--strip-metadata` | Remove all metadata from the video files before uploading them to the streaming service. Warning: This will modify local videos in-place. | `boolean` | `false` |
117
142
  | `--dry-run`<br>`-d` | Perform a dry run without making any changes. Useful for testing and debugging. Pairs well with the `--json` command. | `boolean` | `false` |
118
143
  | `--json` | Output the sync report as JSON. | `boolean` | `false` |
119
- | `--verbose` | Enable verbose logging. All verbose logs and prefixed with their log level and are printed to `stderr` for ease of redirection. | `boolean` | `false` |
144
+ | `--verbose` | Enable verbose logging. All verbose logs are prefixed with their log level and are printed to `stderr` for ease of redirection. | `boolean` | `false` |
120
145
  | `--help`<br>`-h` | Show help | `boolean` | |
121
146
  | `--version`<br>`-v` | Show version number | `boolean` | |
122
147
 
@@ -147,7 +172,7 @@ vidup . --json --dry-run --service bunny --key <BUNNY_API_KEY> --library <BUNNY_
147
172
 
148
173
  The JSON version of the output provides some extra info.
149
174
 
150
- ### Library
175
+ ### Library usage
151
176
 
152
177
  #### API
153
178
 
@@ -165,7 +190,6 @@ async function syncVideoInDirectory(
165
190
  }
166
191
  dryRun?: boolean // Defaults to false
167
192
  service: Service
168
- verbose?: boolean // Defaults to false
169
193
  },
170
194
  ): Promise<SyncReport>
171
195
  ```
@@ -173,11 +197,10 @@ async function syncVideoInDirectory(
173
197
  A `stripVideoMetadataInDirectory` function is also exported, which will remove metadata from all videos in the target directory. It returns a list of video filepaths with metadata:
174
198
 
175
199
  ```ts
176
- export async function stripVideoMetadataInFiles(
200
+ async function stripVideoMetadataInDirectory(
177
201
  directory: string,
178
202
  options: {
179
203
  dryRun?: boolean // Defaults to false
180
- verbose?: boolean // Defaults to false
181
204
  },
182
205
  ): Promise<string[]>
183
206
  ```
@@ -198,6 +221,21 @@ const syncReport = await syncVideoInDirectory(process.cwd(), {
198
221
  console.log(JSON.stringify(syncReport, undefined, 2))
199
222
  ```
200
223
 
224
+ #### Logging
225
+
226
+ Vidup logs progress at the `debug` level and problems at the `warn` and `error` levels via [lognow](https://github.com/kitschpatrol/lognow). By default, only warnings and errors are shown. To see everything, or to route the library's logs into your own logging system, inject a logger:
227
+
228
+ ```ts
229
+ import { setLogger } from 'vidup'
230
+
231
+ // Send all library logs to the console
232
+ setLogger(console)
233
+
234
+ // Or pass any LogLayer instance
235
+ ```
236
+
237
+ Call `setLogger()` with no argument to silence the library entirely.
238
+
201
239
  ## Background
202
240
 
203
241
  ### Motivation
@@ -206,7 +244,6 @@ Video streaming providers have slow and clunky web UIs. I'd rather not maintain
206
244
 
207
245
  ## The future
208
246
 
209
- - [ ] Tests
210
247
  - [ ] Add [Cosmiconfig](https://github.com/cosmiconfig/cosmiconfig)
211
248
  - [ ] Synchronize thumbnails and other metadata
212
249
  - [ ] Remote collection / folder support