@lvnt/release-radar 1.6.1 → 1.6.3

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.
Files changed (2) hide show
  1. package/dist/index.js +20 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -15,6 +15,7 @@ import { CliPublisher } from './cli-publisher.js';
15
15
  const __filename = fileURLToPath(import.meta.url);
16
16
  const __dirname = dirname(__filename);
17
17
  const PKG_ROOT = join(__dirname, '..'); // dist/../ = package root
18
+ console.log(`ReleaseRadar package root: ${PKG_ROOT}`);
18
19
  const BOT_TOKEN = process.env.TELEGRAM_BOT_TOKEN;
19
20
  const CHAT_ID = process.env.TELEGRAM_CHAT_ID;
20
21
  const CONFIG_PATH = join(PKG_ROOT, 'config', 'tools.json');
@@ -25,20 +26,36 @@ if (!BOT_TOKEN || !CHAT_ID) {
25
26
  // Type-safe constants after validation
26
27
  const validatedChatId = CHAT_ID;
27
28
  // Load config
28
- let configData = JSON.parse(readFileSync(CONFIG_PATH, 'utf-8'));
29
+ console.log(`Loading config from: ${CONFIG_PATH}`);
30
+ if (!existsSync(CONFIG_PATH)) {
31
+ console.error(`Config file not found: ${CONFIG_PATH}`);
32
+ process.exit(1);
33
+ }
34
+ let configData;
35
+ try {
36
+ configData = JSON.parse(readFileSync(CONFIG_PATH, 'utf-8'));
37
+ }
38
+ catch (error) {
39
+ console.error(`Failed to parse config: ${error}`);
40
+ process.exit(1);
41
+ }
29
42
  const DOWNLOADS_PATH = join(PKG_ROOT, 'config', 'downloads.json');
43
+ console.log(`Loading downloads config from: ${DOWNLOADS_PATH}`);
30
44
  let downloadsConfig = {};
31
45
  try {
32
46
  downloadsConfig = JSON.parse(readFileSync(DOWNLOADS_PATH, 'utf-8'));
47
+ console.log(`Loaded ${Object.keys(downloadsConfig).length} download configs`);
33
48
  }
34
49
  catch {
35
50
  console.log('No downloads.json found, CLI generation disabled');
36
51
  }
37
- // Data directory - use package root for now, could be made configurable
38
- const DATA_DIR = join(PKG_ROOT, 'data');
52
+ // Data directory - use ~/.release-radar for user-writable storage
53
+ const HOME_DIR = process.env.HOME || process.env.USERPROFILE || '/tmp';
54
+ const DATA_DIR = process.env.RELEASE_RADAR_DATA_DIR || join(HOME_DIR, '.release-radar');
39
55
  if (!existsSync(DATA_DIR)) {
40
56
  mkdirSync(DATA_DIR, { recursive: true });
41
57
  }
58
+ console.log(`Data directory: ${DATA_DIR}`);
42
59
  // Initialize components
43
60
  const bot = new TelegramBot(BOT_TOKEN, { polling: true });
44
61
  const storage = new Storage(join(DATA_DIR, 'versions.json'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvnt/release-radar",
3
- "version": "1.6.1",
3
+ "version": "1.6.3",
4
4
  "description": "Monitor tool versions and notify via Telegram when updates are detected",
5
5
  "main": "dist/index.js",
6
6
  "bin": {