@lvnt/release-radar 1.7.2 → 1.7.4

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
@@ -16,6 +16,14 @@ Built for environments with limited internet access (e.g., intranet) where manua
16
16
  - Periodic checks via cron (configurable interval)
17
17
  - Manual check via Telegram `/check` command
18
18
  - Persistent version storage (survives restarts)
19
+ - **Auto-publishes companion CLI** when updates are detected
20
+
21
+ ## Packages
22
+
23
+ | Package | Description |
24
+ |---------|-------------|
25
+ | [@lvnt/release-radar](https://www.npmjs.com/package/@lvnt/release-radar) | Main service - monitors versions, sends notifications |
26
+ | [@lvnt/release-radar-cli](https://www.npmjs.com/package/@lvnt/release-radar-cli) | Companion CLI - download tools through Nexus proxy |
19
27
 
20
28
  ## Tracked Tools
21
29
 
@@ -129,16 +137,63 @@ Edit `config/tools.json` to add/remove tools:
129
137
  | `vscode-marketplace` | `extensionId` | VS Code extension (e.g., `"publisher.extension"`) |
130
138
  | `custom` | `customFetcher` | Built-in fetchers: `vscode`, `claude-cli`, `cmake` |
131
139
 
140
+ ### Downloads Configuration
141
+
142
+ Edit `config/downloads.json` to configure CLI download URLs:
143
+
144
+ ```json
145
+ {
146
+ "ninja": {
147
+ "displayName": "Ninja",
148
+ "downloadUrl": "https://github.com/ninja-build/ninja/releases/download/v{{VERSION}}/ninja-win.zip",
149
+ "filename": "ninja-{{VERSION}}.zip"
150
+ },
151
+ "ralphy": {
152
+ "type": "npm",
153
+ "displayName": "Ralphy",
154
+ "package": "ralphy"
155
+ }
156
+ }
157
+ ```
158
+
159
+ Placeholders:
160
+ - `{{VERSION}}` - Full version (e.g., `2.52.0.windows.1`)
161
+ - `{{VERSION_BASE}}` - Base semver (e.g., `2.52.0`)
162
+ - `{{NEXUS_URL}}` - Replaced by CLI with user's Nexus URL
163
+
132
164
  ## Usage
133
165
 
134
166
  ### Telegram Commands
135
167
 
136
168
  | Command | Description |
137
169
  |---------|-------------|
138
- | `/check` | Manually trigger version check |
139
- | `/status` | Show all tracked versions |
170
+ | `/check` | Manually trigger version check (auto-publishes CLI if updates found) |
171
+ | `/status` | Show all tracked versions + last/next check times |
140
172
  | `/interval` | Show current check interval |
141
173
  | `/setinterval <hours>` | Set check interval (1-24 hours) |
174
+ | `/generate` | Generate versions.json file locally |
175
+ | `/clipreview` | Preview tools/versions that will be included in CLI |
176
+ | `/publishcli` | Manually publish CLI with current tracked versions |
177
+
178
+ ## Companion CLI
179
+
180
+ The companion CLI (`@lvnt/release-radar-cli`) allows users on intranet machines to download tracked tools through a Nexus proxy.
181
+
182
+ ### How It Works
183
+
184
+ 1. **ReleaseRadar** monitors tool versions
185
+ 2. When updates are detected, it **auto-publishes** the CLI with new versions
186
+ 3. Users run `release-radar-cli` on their machines
187
+ 4. CLI shows available tools and downloads through configured Nexus proxy
188
+
189
+ ### CLI Installation
190
+
191
+ ```bash
192
+ npm install -g @lvnt/release-radar-cli
193
+ release-radar-cli
194
+ ```
195
+
196
+ See [@lvnt/release-radar-cli](https://www.npmjs.com/package/@lvnt/release-radar-cli) for full documentation.
142
197
 
143
198
  ## Auto-Updater (Optional)
144
199
 
@@ -174,15 +229,24 @@ sudo visudo
174
229
  # yourusername ALL=(ALL) NOPASSWD: /usr/bin/npm
175
230
  ```
176
231
 
232
+ ## Data Storage
233
+
234
+ | Location | Contents |
235
+ |----------|----------|
236
+ | Package directory (`config/`) | `tools.json`, `downloads.json` (read-only config) |
237
+ | `~/.release-radar/` | `versions.json` (tracked versions), `cli/` (CLI source for publishing) |
238
+
177
239
  ## Project Structure
178
240
 
179
241
  ```
180
242
  release-radar/
181
243
  ├── src/
182
- │ ├── index.ts # Main entry point
244
+ │ ├── index.ts # Main entry point, Telegram bot
183
245
  │ ├── checker.ts # Version check orchestration
184
246
  │ ├── storage.ts # JSON persistence
185
247
  │ ├── notifier.ts # Telegram notifications
248
+ │ ├── cli-publisher.ts # CLI auto-publishing
249
+ │ ├── versions-generator.ts # Generate versions.json
186
250
  │ ├── types.ts # TypeScript interfaces
187
251
  │ └── fetchers/
188
252
  │ ├── index.ts # Fetcher registry
@@ -190,19 +254,23 @@ release-radar/
190
254
  │ ├── npm.ts
191
255
  │ ├── vscode-marketplace.ts
192
256
  │ └── custom.ts
257
+ ├── cli/ # Companion CLI source
258
+ │ ├── src/
259
+ │ │ ├── index.ts # CLI entry point
260
+ │ │ ├── downloader.ts # wget/npm execution
261
+ │ │ ├── ui.ts # Interactive prompts
262
+ │ │ └── updater.ts # Auto-update
263
+ │ └── versions.json # Embedded version data
193
264
  ├── config/
194
- └── tools.json # Tool configuration
195
- ├── data/
196
- │ └── versions.json # Persisted version state
197
- ├── docs/
198
- │ └── OPERATIONS.md # Operations guide
265
+ ├── tools.json # Tools to monitor
266
+ │ └── downloads.json # Download URL templates
199
267
  └── dist/ # Compiled JavaScript
200
268
  ```
201
269
 
202
270
  ## Testing
203
271
 
204
272
  ```bash
205
- # Run all tests
273
+ # Run all tests (59 tests)
206
274
  npm test
207
275
 
208
276
  # Watch mode
@@ -217,19 +285,16 @@ npm run test:watch
217
285
  🔄 Git: 2.43.0 → 2.44.0
218
286
  ```
219
287
 
288
+ ### CLI Published
289
+ ```
290
+ 📦 CLI published: v0.2.8
291
+ ```
292
+
220
293
  ### Fetch Failure
221
294
  ```
222
295
  ⚠️ Failed to check CMake: Request timeout
223
296
  ```
224
297
 
225
- ## Operations
226
-
227
- See [docs/OPERATIONS.md](docs/OPERATIONS.md) for detailed instructions on:
228
- - Starting/stopping the service
229
- - Viewing logs
230
- - Auto-start configuration
231
- - Troubleshooting
232
-
233
298
  ## License
234
299
 
235
300
  ISC
package/cli/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvnt/release-radar-cli",
3
- "version": "0.2.2",
3
+ "version": "0.2.8",
4
4
  "description": "Interactive CLI for downloading tools through Nexus proxy",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -16,7 +16,8 @@
16
16
  "files": [
17
17
  "dist",
18
18
  "bin",
19
- "versions.json"
19
+ "versions.json",
20
+ "README.md"
20
21
  ],
21
22
  "keywords": [
22
23
  "release",
@@ -26,6 +27,12 @@
26
27
  ],
27
28
  "author": "lvnt",
28
29
  "license": "ISC",
30
+ "repository": {
31
+ "type": "git",
32
+ "url": "git+https://github.com/lvntbkdmr/release-radar.git",
33
+ "directory": "cli"
34
+ },
35
+ "homepage": "https://github.com/lvntbkdmr/release-radar#readme",
29
36
  "dependencies": {
30
37
  "chalk": "^5.3.0",
31
38
  "inquirer": "^9.2.12"
package/cli/src/index.ts CHANGED
@@ -46,7 +46,7 @@ ${chalk.bold('EXAMPLES:')}
46
46
  ${chalk.bold('CONFIG LOCATION:')}
47
47
  ~/.release-radar-cli/config.json
48
48
 
49
- ${chalk.gray('For more info: https://github.com/lvnt/release-radar')}
49
+ ${chalk.gray('For more info: https://github.com/lvntbkdmr/release-radar')}
50
50
  `);
51
51
  }
52
52
 
@@ -2,6 +2,24 @@
2
2
  import { execSync } from 'child_process';
3
3
  import { readFileSync, writeFileSync, existsSync } from 'fs';
4
4
  import { generateVersionsJson } from './versions-generator.js';
5
+ function getLatestNpmVersion(packageName) {
6
+ try {
7
+ const result = execSync(`npm view ${packageName} version`, {
8
+ encoding: 'utf-8',
9
+ stdio: ['pipe', 'pipe', 'pipe'],
10
+ timeout: 15000,
11
+ });
12
+ return result.trim();
13
+ }
14
+ catch {
15
+ return null;
16
+ }
17
+ }
18
+ function bumpPatchVersion(version) {
19
+ const parts = version.split('.').map(Number);
20
+ parts[2]++;
21
+ return parts.join('.');
22
+ }
5
23
  export class CliPublisher {
6
24
  downloadsConfig;
7
25
  cliPath;
@@ -22,14 +40,16 @@ export class CliPublisher {
22
40
  // Write to CLI package
23
41
  const cliVersionsPath = `${this.cliPath}/versions.json`;
24
42
  writeFileSync(cliVersionsPath, JSON.stringify(versionsJson, null, 2));
25
- // Read current CLI version
43
+ // Get latest version from npm (fallback to local if npm unreachable)
26
44
  const pkgPath = `${this.cliPath}/package.json`;
27
45
  const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
28
- const currentVersion = pkg.version;
29
- // Bump patch version
30
- const versionParts = currentVersion.split('.').map(Number);
31
- versionParts[2]++;
32
- const newVersion = versionParts.join('.');
46
+ const packageName = pkg.name;
47
+ console.log('[CliPublisher] Checking latest version on npm...');
48
+ const latestNpmVersion = getLatestNpmVersion(packageName);
49
+ const baseVersion = latestNpmVersion || pkg.version;
50
+ console.log(`[CliPublisher] Base version: ${baseVersion} (from ${latestNpmVersion ? 'npm' : 'local'})`);
51
+ // Bump patch version from the latest
52
+ const newVersion = bumpPatchVersion(baseVersion);
33
53
  pkg.version = newVersion;
34
54
  writeFileSync(pkgPath, JSON.stringify(pkg, null, 2));
35
55
  // Install dependencies (including devDependencies for TypeScript)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvnt/release-radar",
3
- "version": "1.7.2",
3
+ "version": "1.7.4",
4
4
  "description": "Monitor tool versions and notify via Telegram when updates are detected",
5
5
  "main": "dist/index.js",
6
6
  "bin": {