sondakika 2.0.0 โ†’ 2.0.2

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.
@@ -1,47 +0,0 @@
1
- const fs = require('fs')
2
- const path = require('path')
3
- const zlib = require('zlib')
4
-
5
- // Create simple PNG data for different sizes
6
- function createSimplePNG(width, height, color) {
7
- // Minimal PNG creation
8
- const signature = Buffer.from([137, 80, 78, 71, 13, 10, 26, 10])
9
-
10
- // IHDR
11
- const ihdr = Buffer.alloc(25)
12
- ihdr.writeUInt32BE(13, 0)
13
- ihdr.write('IHDR', 4)
14
- ihdr.writeUInt32BE(width, 8)
15
- ihdr.writeUInt32BE(height, 12)
16
- ihdr[16] = 8 // bit depth
17
- ihdr[17] = 2 // RGB
18
- ihdr[18] = 0 // compression
19
- ihdr[19] = 0 // filter
20
- ihdr[20] = 0 // interlace
21
- const ihdrCrc = crc32(Buffer.from('IHDR' + ihdr.slice(8, 21).toString('binary'), 'binary'))
22
-
23
- // For simplicity, create a solid color PNG
24
- // This is a simplified version - real PNG creation is complex
25
- return null
26
- }
27
-
28
- function crc32(buf) {
29
- let crc = 0xFFFFFFFF
30
- for (let i = 0; i < buf.length; i++) {
31
- crc ^= buf.charCodeAt ? buf.charCodeAt(i) : buf[i]
32
- for (let j = 0; j < 8; j++) {
33
- crc = (crc >>> 1) ^ (crc & 1 ? 0xEDB88320 : 0)
34
- }
35
- }
36
- return (crc ^ 0xFFFFFFFF) >>> 0
37
- }
38
-
39
- // Since creating proper multi-size ICO is complex, let's use a different approach
40
- // Let's just copy the PNG and let electron-builder handle it
41
- // Or better yet, let's use a proper icon
42
-
43
- console.log('For proper Windows icon support, you need an ICO file with multiple sizes.')
44
- console.log('Recommended: Use an online ICO converter (https://icoconvert.com/)')
45
- console.log('Upload assets/icon.png and download a proper ICO file.')
46
- console.log('\nOr install ImageMagick and run:')
47
- console.log('magick convert assets/icon.png -define icon:auto-resize=256,128,96,64,48,32,24,16 assets/icon.ico')
package/fix-all-issues.js DELETED
@@ -1,55 +0,0 @@
1
- const fs = require('fs');
2
- const path = require('path');
3
-
4
- const filePath = path.join(__dirname, 'src', 'renderer', 'index.html');
5
- let content = fs.readFileSync(filePath, 'utf8');
6
-
7
- // Fix missing quotes in getElementById calls
8
- content = content.replace(/getElementById\(/g, "getElementById('");
9
- content = content.replace(/getElementById\('(\w+)'\)/g, "getElementById('$1')");
10
-
11
- // Fix Object.entries(sources) without quotes
12
- content = content.replace(/Object\.entries\(sources\)/g, "Object.entries(sources)");
13
-
14
- // Fix e.target.closest without quotes
15
- content = content.replace(/e\.target\.closest\(/g, "e.target.closest('");
16
-
17
- // Fix missing closing quotes in various places
18
- content = content.replace(/, \)/g, ", ')");
19
- content = content.replace(/, \}/g, ", }");
20
- content = content.replace(/, \]/g, ", ]");
21
-
22
- // Fix the forEach callback parameter
23
- content = content.replace(/forEach\(function\(news,/g, "forEach(function(news,");
24
- content = content.replace(/forEach\(function\(news\)/g, "forEach(function(entry)");
25
-
26
- // Fix news variable throughout
27
- content = content.replace(/var news = /g, "var news = ");
28
- content = content.replace(/news\.isSondakika/g, "news.isSondakika");
29
- content = content.replace(/news\.sourceName/g, "news.sourceName");
30
- content = content.replace(/news\.title/g, "news.title");
31
- content = content.replace(/news\.link/g, "news.link");
32
- content = content.replace(/news\.pubDate/g, "news.pubDate");
33
- content = content.replace(/news\.isoDate/g, "news.isoDate");
34
- content = content.replace(/news\.summary/g, "news.summary");
35
- content = content.replace(/news\.contentSnippet/g, "news.contentSnippet");
36
- content = content.replace(/news\.description/g, "news.description");
37
- content = content.replace(/news\.imageUrl/g, "news.imageUrl");
38
-
39
- // Fix returnedIndex
40
- content = content.replace(/returnedIndex/g, "returnedIndex");
41
-
42
- // Fix .classList typo
43
- content = content.replace(/\.classList/g, ".classList");
44
-
45
- // Fix keydown
46
- content = content.replace(/keydown/g, "keydown");
47
-
48
- // Fix 'nearest' typo
49
- content = content.replace(/'nearest'/g, "'nearest'");
50
-
51
- // Fix Math.min syntax
52
- content = content.replace(/Math\.min\(28, newSize\)/g, "Math.min(28, newSize)");
53
-
54
- fs.writeFileSync(filePath, content, 'utf8');
55
- console.log('All issues fixed in index.html');
package/fix-all.js DELETED
@@ -1,33 +0,0 @@
1
- const fs = require('fs');
2
- const path = require('path');
3
-
4
- const filePath = path.join(__dirname, 'src', 'renderer', 'index.html');
5
- let content = fs.readFileSync(filePath, 'utf8');
6
-
7
- // Fix all JavaScript variable name issues
8
- const fixes = [
9
- [/function\(news,/g, 'function(news,'],
10
- [/var newsIndex/g, 'var newsIndex'],
11
- [/news\.isSondakika/g, 'news.isSondakika'],
12
- [/news\.sourceName/g, 'news.sourceName'],
13
- [/news\.title/g, 'news.title'],
14
- [/news\.link/g, 'news.link'],
15
- [/news\.pubDate/g, 'news.pubDate'],
16
- [/news\.isoDate/g, 'news.isoDate'],
17
- [/news\.summary/g, 'news.summary'],
18
- [/news\.contentSnippet/g, 'news.contentSnippet'],
19
- [/news\.description/g, 'news.description'],
20
- [/news\.imageUrl/g, 'news.imageUrl'],
21
- [/returnedIndex/g, 'returnedIndex'],
22
- [/\.classList/g, '.classList'],
23
- [/keydown/g, 'keydown'],
24
- [/'nearest'/g, "'nearest'"],
25
- [/Math\.min\(28, newSize\)/g, 'Math.min(28, newSize)']
26
- ];
27
-
28
- fixes.forEach(([pattern, replacement]) => {
29
- content = content.replace(pattern, replacement);
30
- });
31
-
32
- fs.writeFileSync(filePath, content, 'utf8');
33
- console.log('All JavaScript syntax errors fixed in index.html');
@@ -1,52 +0,0 @@
1
- const fs = require('fs');
2
- const path = require('path');
3
-
4
- const filePath = path.join(__dirname, 'src', 'renderer', 'index.html');
5
- let content = fs.readFileSync(filePath, 'utf8');
6
-
7
- // Fix missing quotes in getElementById calls
8
- content = content.replace(/getElementById\((\w+)\)/g, "getElementById('$1')");
9
-
10
- // Fix closest method calls
11
- content = content.replace(/\.closest\((\.[^']+)\)/g, ".closest('$1')");
12
-
13
- // Fix addEventListener calls
14
- content = content.replace(/addEventListener\('(\w+)'\)/g, "addEventListener('$1')");
15
-
16
- // Fix button onclick attributes
17
- content = content.replace(/onclick="([^"]+)"/g, 'onclick="$1"');
18
-
19
- // Fix other method calls with missing quotes
20
- content = content.replace(/Object\.entries\((\w+)\)/g, "Object.entries($1)");
21
-
22
- // Fix news variable names
23
- content = content.replace(/function\(news,/g, 'function(news,');
24
- content = content.replace(/var news = /g, 'var news = ');
25
- content = content.replace(/news\.isSondakika/g, 'news.isSondakika');
26
- content = content.replace(/news\.sourceName/g, 'news.sourceName');
27
- content = content.replace(/news\.title/g, 'news.title');
28
- content = content.replace(/news\.link/g, 'news.link');
29
- content = content.replace(/news\.pubDate/g, 'news.pubDate');
30
- content = content.replace(/news\.isoDate/g, 'news.isoDate');
31
- content = content.replace(/news\.summary/g, 'news.summary');
32
- content = content.replace(/news\.contentSnippet/g, 'news.contentSnippet');
33
- content = content.replace(/news\.description/g, 'news.description');
34
- content = content.replace(/news\.imageUrl/g, 'news.imageUrl');
35
-
36
- // Fix returnedIndex
37
- content = content.replace(/returnedIndex/g, 'returnedIndex');
38
-
39
- // Fix .classList typo
40
- content = content.replace(/\.classList/g, '.classList');
41
-
42
- // Fix keydown
43
- content = content.replace(/keydown/g, 'keydown');
44
-
45
- // Fix 'nearest' typo
46
- content = content.replace(/'nearest'/g, "'nearest'");
47
-
48
- // Fix Math.min syntax
49
- content = content.replace(/Math\.min\(28, newSize\)/g, 'Math.min(28, newSize)');
50
-
51
- fs.writeFileSync(filePath, content, 'utf8');
52
- console.log('All issues fixed in index.html');
package/fix-final.js DELETED
@@ -1,54 +0,0 @@
1
- const fs = require('fs');
2
- const path = require('path');
3
-
4
- const filePath = path.join(__dirname, 'src', 'renderer', 'index.html');
5
- let content = fs.readFileSync(filePath, 'utf8');
6
-
7
- // Fix all occurrences of the variable name 'news' (should be 'news')
8
- // This is the main issue - the build script used 'news' instead of 'news'
9
- content = content.replace(/const item = document\.createElement/g, 'const item = document.createElement');
10
- content = content.replace(/var key = entry\[0\]/g, 'var key = entry[0]');
11
- content = content.replace(/var source = entry\[1\]/g, 'var source = entry[1]');
12
-
13
- // Fix the forEach callback parameter
14
- content = content.replace(/Object\.entries\(sources\)\.forEach\(function\(entry\)/g, 'Object.entries(sources).forEach(function(entry)');
15
-
16
- // Fix the news variable in forEach
17
- content = content.replace(/pageNews\.forEach\(function\(news,/g, 'pageNews.forEach(function(news,');
18
- content = content.replace(/\(news,/g, '(news,');
19
- content = content.replace(/var newsIndex/g, 'var newsIndex');
20
- content = content.replace(/news\.isSondakika/g, 'news.isSondakika');
21
- content = content.replace(/news\.sourceName/g, 'news.sourceName');
22
- content = content.replace(/news\.title/g, 'news.title');
23
- content = content.replace(/news\.link/g, 'news.link');
24
- content = content.replace(/news\.pubDate/g, 'news.pubDate');
25
- content = content.replace(/news\.isoDate/g, 'news.isoDate');
26
- content = content.replace(/news\.summary/g, 'news.summary');
27
- content = content.replace(/news\.contentSnippet/g, 'news.contentSnippet');
28
- content = content.replace(/news\.description/g, 'news.description');
29
- content = content.replace(/news\.imageUrl/g, 'news.imageUrl');
30
-
31
- // Fix function calls
32
- content = content.replace(/window\.openArticleView\(newsIndex\)/g, 'window.openArticleView(newsIndex)');
33
- content = content.replace(/openArticleView\(globalIdx\)/g, 'openArticleView(globalIdx)');
34
-
35
- // Fix returnedIndex
36
- content = content.replace(/returnedIndex/g, 'returnedIndex');
37
-
38
- // Fix textContent vs textContent
39
- content = content.replace(/\.textContent/g, '.textContent');
40
-
41
- // Fix classList typo
42
- content = content.replace(/\.classList/g, '.classList');
43
-
44
- // Fix event key
45
- content = content.replace(/keydown/g, 'keydown');
46
-
47
- // Fix nearest typo
48
- content = content.replace(/'nearest'/g, "'nearest'");
49
-
50
- // Fix Math.min syntax
51
- content = content.replace(/Math\.min\(28, newSize\)/g, 'Math.min(28, newSize)');
52
-
53
- fs.writeFileSync(filePath, content, 'utf8');
54
- console.log('All issues fixed in index.html');
package/fix-icon.js DELETED
@@ -1,32 +0,0 @@
1
- const fs = require('fs')
2
- const path = require('path')
3
-
4
- // Create a proper ICO file with multiple sizes
5
- // This is a simplified version - for production, use a proper icon conversion tool
6
-
7
- // Read the PNG file
8
- const pngPath = path.join(__dirname, 'assets', 'icon.png')
9
- const pngData = fs.readFileSync(pngPath)
10
-
11
- // For now, let's just use the PNG directly and rename it
12
- // Windows ICO files need multiple sizes (16, 32, 48, 64, 128, 256)
13
- // The easiest solution is to use a proper icon converter
14
-
15
- // Let's check if the current ICO is valid
16
- const icoPath = path.join(__dirname, 'assets', 'icon.ico')
17
- const icoData = fs.readFileSync(icoPath)
18
-
19
- console.log('PNG size:', pngData.length)
20
- console.log('ICO size:', icoData.length)
21
- console.log('ICO header:', icoData.slice(0, 6).toString('hex'))
22
-
23
- // The ICO format expects specific structure
24
- // Let me create a proper one using a different approach
25
-
26
- // Actually, electron-builder can use PNG files directly
27
- // Let's just update the config to use PNG and let electron-builder handle conversion
28
- console.log('\nThe icon files are ready. Try rebuilding the app.')
29
- console.log('If the icon still does not appear, you may need to:')
30
- console.log('1. Clear the dist folder: rm -rf dist')
31
- console.log('2. Rebuild: npm run build')
32
- console.log('3. Or use a proper ICO file from an online converter')
package/fix-index.js DELETED
@@ -1,60 +0,0 @@
1
- const fs = require('fs');
2
- const path = require('path');
3
-
4
- const filePath = path.join(__dirname, 'src', 'renderer', 'index.html');
5
- let content = fs.readFileSync(filePath, 'utf8');
6
-
7
- // Fix unicode escape sequences - replace with actual UTF-8 characters
8
- const replacements = [
9
- ['\\uD83D\\uDCF0', '๐Ÿ“ฐ'],
10
- ['\\uD83D\\uDD04', '๐Ÿ”„'],
11
- ['\\uD83D\\uDCFD', '๐Ÿ“ญ'],
12
- ['\\uD83D\\uDD52', '๐Ÿ•’'],
13
- ['\\uD83D\\uDD17', '๐Ÿ”—'],
14
- ['\\u2191', 'โ†‘'],
15
- ['\\u2193', 'โ†“'],
16
- ['\\u2190', 'โ†'],
17
- ['\\u2192', 'โ†’'],
18
- ['\\u00AB', 'ยซ'],
19
- ['\\u00BB', 'ยป'],
20
- ['\\u2039', 'โ€น'],
21
- ['\\u203A', 'โ€บ'],
22
- ['\\u2022', 'โ€ข'],
23
- ['\\u2713', 'โœ“']
24
- ];
25
-
26
- replacements.forEach(([esc, char]) => {
27
- content = content.split(esc).join(char);
28
- });
29
-
30
- // Fix .classList typo -> .classList
31
- content = content.replace(/\.classList/g, '.classList');
32
-
33
- // Fix variable name 'news' -> 'news' in forEach loops
34
- content = content.replace(/function\(news,/g, 'function(news,');
35
- content = content.replace(/var newsIndex/g, 'var newsIndex');
36
- content = content.replace(/news\.isSondakika/g, 'news.isSondakika');
37
- content = content.replace(/news\.sourceName/g, 'news.sourceName');
38
- content = content.replace(/news\.title/g, 'news.title');
39
- content = content.replace(/news\.link/g, 'news.link');
40
- content = content.replace(/news\.pubDate/g, 'news.pubDate');
41
- content = content.replace(/news\.isoDate/g, 'news.isoDate');
42
- content = content.replace(/news\.summary/g, 'news.summary');
43
- content = content.replace(/news\.contentSnippet/g, 'news.contentSnippet');
44
- content = content.replace(/news\.description/g, 'news.description');
45
- content = content.replace(/news\.imageUrl/g, 'news.imageUrl');
46
-
47
- // Fix returnedIndex -> returnedIndex
48
- content = content.replace(/returnedIndex/g, 'returnedIndex');
49
-
50
- // Fix Math.min syntax: Math.min(28, newSize) not Math.min(28, newSize)
51
- content = content.replace(/Math\.min\(28, newSize\)/g, 'Math.min(28, newSize)');
52
-
53
- // Fix event.key typos
54
- content = content.replace(/keydown/g, 'keydown');
55
-
56
- // Fix block: 'nearest' -> 'nearest'
57
- content = content.replace(/'nearest'/g, "'nearest'");
58
-
59
- fs.writeFileSync(filePath, content, 'utf8');
60
- console.log('Fixed all issues in index.html');
package/fix-syntax.js DELETED
@@ -1,53 +0,0 @@
1
- const fs = require('fs');
2
- const path = require('path');
3
-
4
- const filePath = path.join(__dirname, 'src', 'renderer', 'index.html');
5
- let content = fs.readFileSync(filePath, 'utf8');
6
-
7
- // Fix all JavaScript syntax issues
8
- const fixes = [
9
- // Fix 'news' variable name (should be 'news')
10
- [/function\(news,/g, 'function(news,'],
11
- [/var newsIndex/g, 'var newsIndex'],
12
- [/news\.isSondakika/g, 'news.isSondakika'],
13
- [/news\.sourceName/g, 'news.sourceName'],
14
- [/news\.title/g, 'news.title'],
15
- [/news\.link/g, 'news.link'],
16
- [/news\.pubDate/g, 'news.pubDate'],
17
- [/news\.isoDate/g, 'news.isoDate'],
18
- [/news\.summary/g, 'news.summary'],
19
- [/news\.contentSnippet/g, 'news.contentSnippet'],
20
- [/news\.description/g, 'news.description'],
21
- [/news\.imageUrl/g, 'news.imageUrl'],
22
-
23
- // Fix 'returnedIndex' -> 'returnedIndex'
24
- [/returnedIndex/g, 'returnedIndex'],
25
-
26
- // Fix '.classList' typo
27
- [/\.classList/g, '.classList'],
28
-
29
- // Fix 'keydown' typo
30
- [/keydown/g, 'keydown'],
31
-
32
- // Fix 'nearest' typo
33
- [/'nearest'/g, "'nearest'"],
34
-
35
- // Fix Math.min syntax
36
- [/Math\.min\(28, newSize\)/g, 'Math.min(28, newSize)'],
37
-
38
- // Fix method calls with wrong quotes
39
- [/getElementById\('/g, 'getElementById('],
40
- [/textContent = '/g, "textContent = '"],
41
- [/';/g, "';"]
42
- ];
43
-
44
- fixes.forEach(([pattern, replacement]) => {
45
- content = content.replace(pattern, replacement);
46
- });
47
-
48
- // Fix the forEach loops where 'news' should be 'news'
49
- content = content.replace(/forEach\(function\(news/g, 'forEach(function(news');
50
- content = content.replace(/forEach\(function\(news,/g, 'forEach(function(news,');
51
-
52
- fs.writeFileSync(filePath, content, 'utf8');
53
- console.log('All syntax errors fixed in index.html');
package/fix-unicode.js DELETED
@@ -1,66 +0,0 @@
1
- const fs = require('fs');
2
- const path = require('path');
3
-
4
- const filePath = path.join(__dirname, 'src', 'renderer', 'index.html');
5
- let c = fs.readFileSync(filePath, 'utf8');
6
-
7
- // Fix unicode escapes - these are literally in the file as \\uXXXX
8
- const fixes = [
9
- ['\\uD83D\\uDCF0', '๐Ÿ“ฐ'],
10
- ['\\uD83D\\uDD04', '๐Ÿ”„'],
11
- ['\\uD83D\\uDCFD', '๐Ÿ“ญ'],
12
- ['\\uD83D\\uDD52', '๐Ÿ•’'],
13
- ['\\uD83D\\uDD17', '๐Ÿ”—'],
14
- ['\\u2190', 'โ†'],
15
- ['\\u2192', 'โ†’'],
16
- ['\\u2191', 'โ†‘'],
17
- ['\\u2193', 'โ†“'],
18
- ['\\u00AB', 'ยซ'],
19
- ['\\u00BB', 'ยป'],
20
- ['\\u2039', 'โ€น'],
21
- ['\\u203A', 'โ€บ'],
22
- ['\\u2022', 'โ€ข'],
23
- ['\\u2713', 'โœ“']
24
- ];
25
-
26
- fixes.forEach(([esc, char]) => {
27
- c = c.split(esc).join(char);
28
- });
29
-
30
- // Fix curly quotes
31
- c = c.split('\u2018').join("'");
32
- c = c.split('\u2019').join("'");
33
- c = c.split('\u201C').join('"');
34
- c = c.split('\u201D').join('"');
35
-
36
- // Fix .classList typo
37
- c = c.split('.classList').join('.classList');
38
-
39
- // Fix 'keydown' typo
40
- c = c.split('keydown').join('keydown');
41
-
42
- // Fix 'nearest' typo
43
- c = c.split('nearest').join('nearest');
44
-
45
- // Fix news variable name
46
- c = c.split('function(news,').join('function(news,');
47
- c = c.split('var newsIndex').join('var newsIndex');
48
- c = c.split('news.isSondakika').join('news.isSondakika');
49
- c = c.split('news.sourceName').join('news.sourceName');
50
- c = c.split('news.title').join('news.title');
51
- c = c.split('news.link').join('news.link');
52
- c = c.split('news.pubDate').join('news.pubDate');
53
- c = c.split('news.isoDate').join('news.isoDate');
54
- c = c.split('news.summary').join('news.summary');
55
- c = c.split('news.contentSnippet').join('news.contentSnippet');
56
- c = c.split('news.description').join('news.description');
57
- c = c.split('news.imageUrl').join('news.imageUrl');
58
-
59
- // Fix returnedIndex
60
- c = c.split('returnedIndex').join('returnedIndex');
61
-
62
- // Fix Math.min syntax
63
- c = c.split('Math.min(28, newSize)').join('Math.min(28, newSize)');
64
-
65
- fs.writeFileSync(filePath, c, 'utf8');
66
- console.log('All fixes applied to index.html');