sondakika 2.0.1 → 2.0.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.
package/package.json CHANGED
@@ -1,60 +1,25 @@
1
1
  {
2
2
  "name": "sondakika",
3
- "version": "2.0.1",
4
- "description": "Modern Electron-based news reader with RSS feeds",
5
- "main": "src/main/main.js",
3
+ "version": "2.0.3",
4
+ "description": "Full-featured Turkish news CLI with interactive UI. Identical news sources, parsing, and image extraction as the Electron desktop app. 10 major Turkish news sources with blessed terminal interface.",
5
+ "bin": {
6
+ "sondakika": "./cli.js"
7
+ },
8
+ "files": ["cli.js"],
9
+ "keywords": [
10
+ "news", "rss", "turkish", "cli", "terminal", "haber",
11
+ "son dakika", "electron", "desktop", "trt", "cumhuriyet",
12
+ "mynet", "sabah", "haberturk", "cnnturk", "yenisafak",
13
+ "interactive", "blessed", "terminal-ui", "pagination"
14
+ ],
6
15
  "author": {
7
16
  "name": "Sedat Ergoz",
8
17
  "email": "sedatergoz@gmail.com",
9
18
  "url": "https://github.com/eaeoz"
10
19
  },
11
20
  "license": "ISC",
12
- "scripts": {
13
- "start": "electron .",
14
- "dev": "electron .",
15
- "build": "electron-builder --win --x64",
16
- "build:dir": "electron-builder --win --x64 --dir"
17
- },
18
21
  "dependencies": {
19
22
  "blessed": "^0.1.81",
20
23
  "rss-parser": "^3.13.0"
21
- },
22
- "devDependencies": {
23
- "electron": "^28.0.0",
24
- "electron-builder": "^24.9.1",
25
- "png-to-ico": "^3.0.1"
26
- },
27
- "build": {
28
- "appId": "com.sondakika.app",
29
- "productName": "Sondakika",
30
- "copyright": "Copyright © 2024 Sedat Ergoz",
31
- "directories": {
32
- "output": "dist"
33
- },
34
- "win": {
35
- "target": [
36
- {
37
- "target": "nsis",
38
- "arch": [
39
- "x64"
40
- ]
41
- }
42
- ],
43
- "icon": "assets/icon.ico",
44
- "signAndEditExecutable": false
45
- },
46
- "nsis": {
47
- "installerIcon": "assets/icon.ico",
48
- "uninstallerIcon": "assets/icon.ico",
49
- "installerHeaderIcon": "assets/icon.ico"
50
- },
51
- "electronDownload": {
52
- "cache": "dist/electron-cache"
53
- },
54
- "files": [
55
- "src/**/*",
56
- "assets/**/*",
57
- "package.json"
58
- ]
59
24
  }
60
25
  }
package/AGENTS.md DELETED
@@ -1,184 +0,0 @@
1
- # AGENTS.md - News CLI Project
2
-
3
- ## Project Overview
4
-
5
- This is a simple Node.js CLI application that fetches and displays news from RSS feeds. It uses `rss-parser` to parse RSS feeds and displays news in a styled terminal output.
6
-
7
- ## Project Structure
8
-
9
- ```
10
- sondakika/
11
- ├── index.js # Main CLI entry point
12
- ├── package.json # Project dependencies and scripts
13
- └── AGENTS.md # This file - guidelines for AI agents
14
- ```
15
-
16
- ## Build & Run Commands
17
-
18
- ```bash
19
- # Run the CLI
20
- npm start # Runs: node index.js
21
- node index.js # Direct execution
22
-
23
- # With arguments
24
- node index.js ntv # Show NTV news (default 10 items)
25
- node index.js ntv 15 # Show 15 NTV news items
26
- node index.js haberturk 5 # Show Habertürk 5 news
27
-
28
- # Global installation (for 'sondakika' command)
29
- npm link
30
- sondakika ntv 15 # Run as global command
31
- ```
32
-
33
- ## Adding New RSS Sources
34
-
35
- To add a new news source, edit `index.js` and add to the `sources` object:
36
-
37
- ```javascript
38
- const sources = {
39
- ntv: 'https://www.ntv.com.tr/son-dakika.rss',
40
- // ...
41
- };
42
-
43
- const sourceInfo = {
44
- ntv: { name: 'NTV', isSondakika: true }, // isSondakika: true for breaking news
45
- // ...
46
- };
47
- ```
48
-
49
- Then run with:
50
- ```bash
51
- node index.js bbc
52
- ```
53
-
54
- ## Available News Sources
55
-
56
- ### Son Dakika (Breaking News)
57
- | Key | Name | Description |
58
- |-----|------|-------------|
59
- | ntv | NTV (Son Dakika) | NTV breaking news |
60
- | cumhuriyet | Cumhuriyet | Cumhuriyet breaking news |
61
- | trt | TRT Haber | TRT breaking news |
62
- | mynet | Mynet | Mynet breaking news |
63
-
64
- ### General News
65
- | Key | Name | Description |
66
- |-----|------|-------------|
67
- | sabah | Sabah | Sabah newspaper |
68
- | star | Star | Star newspaper |
69
- | vatan | Gazete Vatan | Vatan newspaper |
70
- | haberturk | Habertürk | Habertürk news |
71
- | cnnturk | CNN Türk | CNN Türk news |
72
- | yenisafak | Yeni Şafak | Yeni Şafak newspaper |
73
- | aa | Anadolu Ajansı | Anadolu Agency (English) |
74
-
75
- ## No Test/Lint Commands
76
-
77
- This project does not currently have:
78
- - Unit tests
79
- - Linting configuration
80
- - TypeScript
81
- - CI/CD pipelines
82
-
83
- If you add tests, use:
84
- ```bash
85
- npm test # Run tests
86
- npm run lint # Run ESLint (if configured)
87
- ```
88
-
89
- ## Code Style Guidelines
90
-
91
- ### General Principles
92
- - Keep the codebase simple and minimal
93
- - Use vanilla JavaScript (no TypeScript for this project)
94
- - Avoid unnecessary dependencies
95
- - Focus on readability and maintainability
96
-
97
- ### File Structure
98
- - `index.js` - Main entry point (single file application)
99
- - `package.json` - Project configuration
100
-
101
- ### Naming Conventions
102
- - **Variables/Functions**: camelCase (e.g., `fetchNews`, `wrapText`)
103
- - **Constants**: UPPER_SNAKE_CASE if truly constant (e.g., `MAX_WIDTH`)
104
- - **Files**: lowercase with hyphens (kebab-case)
105
-
106
- ### Code Style
107
- - Use **2 spaces** for indentation
108
- - **No semicolons** at end of statements (optional, but consistent with project)
109
- - Use template literals (backticks) for string interpolation
110
- - Use arrow functions for callbacks
111
- - Prefer `const` over `let`, avoid `var`
112
-
113
- ### Imports
114
- ```javascript
115
- // Direct require for Node built-ins
116
- const path = require('path');
117
-
118
- // Third-party packages
119
- const Parser = require('rss-parser');
120
- ```
121
-
122
- ### Functions
123
- - Keep functions small and focused
124
- - Use descriptive names
125
- - Add JSDoc comments for exported functions
126
-
127
- ```javascript
128
- /**
129
- * Wraps text to specified width for terminal display
130
- * @param {string} text - Text to wrap
131
- * @param {number} width - Maximum line width
132
- * @returns {string[]} Array of wrapped lines
133
- */
134
- function wrapText(text, width = 68) { ... }
135
- ```
136
-
137
- ### Error Handling
138
- - Use try-catch for async operations
139
- - Display user-friendly error messages
140
- - Exit with non-zero code on errors: `process.exit(1)`
141
-
142
- ```javascript
143
- try {
144
- const feed = await parser.parseURL(url);
145
- } catch (err) {
146
- console.error('Error fetching news:', err.message);
147
- process.exit(1);
148
- }
149
- ```
150
-
151
- ### CLI Output
152
- - Use Unicode characters for borders (┌─┐│└┘)
153
- - Support clickable URLs via ANSI escape codes (iTerm2/Windows Terminal)
154
- - Wrap long text to fit terminal width (default: 68 chars)
155
- - Add emoji for visual appeal (📰, 🔗)
156
- - Add separator lines between news items for clarity
157
-
158
- ### Dependencies
159
- - Keep dependencies minimal
160
- - Use well-maintained packages:
161
- - `rss-parser` - RSS feed parsing
162
- - `cli-table3` - Table formatting (if needed)
163
-
164
- ## Dependencies
165
-
166
- Current dependencies (from package.json):
167
- ```json
168
- {
169
- "rss-parser": "^3.13.0",
170
- "cli-table3": "^0.6.5"
171
- }
172
- ```
173
-
174
- ## Future Improvements (for agents)
175
-
176
- If adding features, consider:
177
- 1. Adding unit tests with Jest or Mocha
178
- 2. Adding ESLint for code quality
179
- 3. Supporting multiple RSS sources beyond NTV
180
- 4. Adding configuration file for sources
181
- 5. Adding caching to reduce network calls
182
- 6. Adding date/time formatting for news items
183
- 7. Adding color output for different news categories
184
- 8. Adding pagination for large result sets
package/assets/icon.ico DELETED
Binary file
package/assets/icon.png DELETED
Binary file
package/assets/icon.svg DELETED
@@ -1,21 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" width="256" height="256">
2
- <defs>
3
- <linearGradient id="bg" x1="0%" y1="0%" x2="100%" y2="100%">
4
- <stop offset="0%" style="stop-color:#1a1a2e;stop-opacity:1" />
5
- <stop offset="100%" style="stop-color:#16213e;stop-opacity:1" />
6
- </linearGradient>
7
- </defs>
8
- <rect width="256" height="256" rx="40" fill="url(#bg)"/>
9
- <rect x="48" y="40" width="160" height="176" rx="8" fill="#0f3460"/>
10
- <rect x="56" y="48" width="144" height="160" rx="4" fill="white"/>
11
- <line x1="56" y1="75" x2="200" y2="75" stroke="#e94560" stroke-width="3"/>
12
- <rect x="68" y="85" width="60" height="8" rx="2" fill="#1a1a2e"/>
13
- <rect x="68" y="100" width="80" height="6" rx="2" fill="#ccc"/>
14
- <rect x="68" y="112" width="70" height="6" rx="2" fill="#ccc"/>
15
- <rect x="68" y="124" width="75" height="6" rx="2" fill="#ccc"/>
16
- <rect x="68" y="140" width="60" height="6" rx="2" fill="#ccc"/>
17
- <rect x="68" y="152" width="65" height="6" rx="2" fill="#ccc"/>
18
- <rect x="68" y="164" width="55" height="6" rx="2" fill="#ccc"/>
19
- <rect x="140" y="85" width="56" height="85" rx="4" fill="#e94560" opacity="0.2"/>
20
- <text x="168" y="135" font-family="Arial" font-size="32" font-weight="bold" fill="#e94560" text-anchor="middle">S</text>
21
- </svg>