Skip to content

Commit e0afc20

Browse files
(release)
1 parent f51542d commit e0afc20

File tree

21 files changed

+343
-323
lines changed

21 files changed

+343
-323
lines changed

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"manifest_version": 3,
33
"name": "__MSG_appName__",
4-
"version": "2.8.6",
4+
"version": "2.8.7",
55
"description": "__MSG_appDesc__",
66
"author": "Gus Gaidelevicius",
77
"default_locale": "en",

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "weather-please",
3-
"version": "2.8.6",
3+
"version": "2.8.7",
44
"description": "Savor the elegance and grace of Weather Please as it integrates flawlessly into your browser. A symphony of design and performance awaits – where weather meets artistry in the most subtle, yet captivating, manner.",
55
"private": true,
66
"author": {
@@ -21,10 +21,10 @@
2121
"license": "SEE LICENSE IN LICENSE.md",
2222
"scripts": {
2323
"dev": "next dev",
24-
"build": "node renameAppDir rename && pnpm compile && next build && node build && node renameAppDir restore",
24+
"build": "node scripts/renameAppDir.mjs rename && pnpm compile && next build && node scripts/build.mjs && node scripts/renameAppDir.mjs restore",
2525
"start": "next start",
2626
"lint": "pnpm tsc && pnpm prettier . --write",
27-
"release": "pnpm build && node release",
27+
"release": "pnpm build && node scripts/release.mjs",
2828
"extract": "lingui extract",
2929
"compile": "lingui compile",
3030
"prepare": "husky",

build.js renamed to scripts/build.mjs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
/* eslint-disable no-console */
2-
const fs = require('fs-extra')
3-
const glob = require('glob')
4-
const { execSync } = require('child_process')
5-
const os = require('os')
6-
const path = require('path')
2+
import fs from 'fs-extra'
3+
import { globSync } from 'glob'
4+
import path from 'path'
5+
import { setCwdToRoot } from './lib/root.mjs'
6+
7+
setCwdToRoot()
78

8-
const moveCommand = os.platform() === 'win32' ? 'move' : 'mv'
99
const sourcePath = 'out/_next'
1010
const destinationPath = 'out/next'
1111

1212
try {
13-
execSync(`${moveCommand} ${sourcePath} ${destinationPath}`)
13+
fs.moveSync(sourcePath, destinationPath, { overwrite: true })
1414
console.log('Moved _next directory to next.')
1515
} catch (error) {
1616
console.error('Move operation failed:', error)
@@ -35,7 +35,7 @@ const main = () => {
3535
}
3636

3737
// Replace content in HTML and JS files
38-
const files = glob.sync('out/**/*.{html,js}', { nodir: true })
38+
const files = globSync('out/**/*.{html,js}', { nodir: true })
3939
for (const file of files) {
4040
let content = fs.readFileSync(file, 'utf-8')
4141
content = content.replace(/\/_next\//g, '/next/')

scripts/lib/json.mjs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import fs from 'fs-extra'
2+
3+
const readJson = ({ filePath }) => fs.readJsonSync(filePath)
4+
5+
const writeJson = ({ filePath, data }) => {
6+
fs.writeJsonSync(filePath, data, { spaces: 2 })
7+
}
8+
9+
export { readJson, writeJson }

scripts/lib/root.mjs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import path from 'path'
2+
import { fileURLToPath } from 'url'
3+
4+
const __filename = fileURLToPath(import.meta.url)
5+
const __dirname = path.dirname(__filename)
6+
7+
const rootPath = path.resolve(__dirname, '..', '..')
8+
9+
const setCwdToRoot = () => {
10+
process.chdir(rootPath)
11+
}
12+
13+
export { rootPath, setCwdToRoot }

release.js renamed to scripts/release.mjs

Lines changed: 38 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
/* eslint-disable no-console */
2-
const fs = require('fs')
3-
const path = require('path')
4-
const AdmZip = require('adm-zip')
2+
import fs from 'fs'
3+
import path from 'path'
4+
import AdmZip from 'adm-zip'
5+
import { readJson, writeJson } from './lib/json.mjs'
6+
import { setCwdToRoot } from './lib/root.mjs'
7+
8+
setCwdToRoot()
59

610
const EXTENSION_DIR = 'extension'
711
const MANIFEST_PATH = 'manifest.json'
812
const PACKAGE_PATH = 'package.json'
13+
const EXTENSION_MANIFEST_PATH = path.join(EXTENSION_DIR, MANIFEST_PATH)
914

1015
const args = process.argv.slice(2)
1116
const releaseType = args[0]
@@ -55,38 +60,26 @@ const createZipWithContents = (zip, contentPath, zipName) => {
5560
fs.renameSync(zipName, EXTENSION_DIR + '/' + zipName)
5661
}
5762

58-
const addAttributesToManifest = (attributes) => {
59-
const manifestContent = JSON.parse(
60-
fs.readFileSync(path.join(EXTENSION_DIR, MANIFEST_PATH), 'utf-8'),
61-
)
62-
Object.assign(manifestContent, attributes)
63-
fs.writeFileSync(
64-
path.join(EXTENSION_DIR, MANIFEST_PATH),
65-
JSON.stringify(manifestContent, null, 2),
66-
)
67-
}
63+
const readExtensionManifest = () =>
64+
readJson({ filePath: EXTENSION_MANIFEST_PATH })
6865

69-
const removeAttributesFromManifest = (attributes) => {
70-
const manifestContent = JSON.parse(
71-
fs.readFileSync(path.join(EXTENSION_DIR, MANIFEST_PATH), 'utf-8'),
72-
)
73-
attributes.forEach((attribute) => {
74-
delete manifestContent[attribute]
75-
})
76-
fs.writeFileSync(
77-
path.join(EXTENSION_DIR, MANIFEST_PATH),
78-
JSON.stringify(manifestContent, null, 2),
79-
)
66+
const writeExtensionManifest = (manifestContent) => {
67+
writeJson({ filePath: EXTENSION_MANIFEST_PATH, data: manifestContent })
8068
}
8169

82-
const modifyManifest = (attributesToAdd, attributesToRemove) => {
83-
if (attributesToAdd && Object.keys(attributesToAdd).length > 0) {
84-
addAttributesToManifest(attributesToAdd)
85-
}
70+
const updateExtensionManifest = ({
71+
baseManifest,
72+
attributesToAdd = {},
73+
attributesToRemove = [],
74+
}) => {
75+
const nextManifest = { ...baseManifest, ...attributesToAdd }
8676

87-
if (attributesToRemove && attributesToRemove.length > 0) {
88-
removeAttributesFromManifest(attributesToRemove)
77+
for (const attribute of attributesToRemove) {
78+
delete nextManifest[attribute]
8979
}
80+
81+
writeExtensionManifest(nextManifest)
82+
return nextManifest
9083
}
9184

9285
const processReleaseType = (releaseType) => {
@@ -98,37 +91,42 @@ const processReleaseType = (releaseType) => {
9891
process.exit(1)
9992
}
10093

101-
const manifestContent = JSON.parse(fs.readFileSync(MANIFEST_PATH, 'utf-8'))
102-
const packageContent = JSON.parse(fs.readFileSync(PACKAGE_PATH, 'utf-8'))
94+
const manifestContent = readJson({ filePath: MANIFEST_PATH })
95+
const packageContent = readJson({ filePath: PACKAGE_PATH })
10396

10497
const newVersion = bumpVersion(manifestContent.version, releaseType)
10598

10699
manifestContent.version = newVersion
107100
packageContent.version = newVersion
108101

109-
fs.writeFileSync(MANIFEST_PATH, JSON.stringify(manifestContent, null, 2))
110-
fs.writeFileSync(PACKAGE_PATH, JSON.stringify(packageContent, null, 2))
102+
writeJson({ filePath: MANIFEST_PATH, data: manifestContent })
103+
writeJson({ filePath: PACKAGE_PATH, data: packageContent })
111104

112105
console.log(
113106
`Version in manifest.json and package.json updated to: ${newVersion}`,
114107
)
115108

116-
modifyManifest({ version: newVersion }, [])
109+
const extensionManifest = readExtensionManifest()
110+
const baseExtensionManifest = updateExtensionManifest({
111+
baseManifest: extensionManifest,
112+
attributesToAdd: { version: newVersion },
113+
})
117114
processZipCreation(EXTENSION_DIR, newVersion, '')
118115

119-
modifyManifest(
120-
{
116+
updateExtensionManifest({
117+
baseManifest: baseExtensionManifest,
118+
attributesToAdd: {
121119
browser_specific_settings: {
122120
gecko: {
123121
id: '{9282bc49-b1b4-4f46-b135-1dfe00f182c9}',
124122
},
125123
},
126124
},
127-
['background'],
128-
)
125+
attributesToRemove: ['background'],
126+
})
129127
processZipCreation(EXTENSION_DIR, newVersion, '-firefox')
130128

131-
modifyManifest({}, ['browser_specific_settings'])
129+
writeExtensionManifest(baseExtensionManifest)
132130

133131
packageSource()
134132
process.exit(0)
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
const fs = require('fs-extra')
2-
const path = require('path')
3-
4-
const srcAppPath = path.join(__dirname, 'src', 'app')
5-
const destAppPath = path.join(__dirname, 'src', '_app')
1+
import fs from 'fs-extra'
2+
import path from 'path'
3+
import { rootPath } from './lib/root.mjs'
4+
const srcAppPath = path.join(rootPath, 'src', 'app')
5+
const destAppPath = path.join(rootPath, 'src', '_app')
66

77
async function renameAppDir(action) {
88
try {

src/locales/bn/messages.po

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,19 @@ msgstr "{0} মাইল/ঘণ্টা"
5353
#~ msgid "{label}"
5454
#~ msgstr "ভাষা"
5555

56-
#: src/components/weather-alert.tsx:247
56+
#: src/components/weather-alert.tsx:258
5757
msgid "{precipitationInches} inches of precipitation expected over the next {durationHours} hours"
5858
msgstr "আগামী {durationHours} ঘণ্টায় {precipitationInches} ইঞ্চি বৃষ্টিপাত প্রত্যাশিত."
5959

60-
#: src/components/weather-alert.tsx:239
60+
#: src/components/weather-alert.tsx:250
6161
msgid "{precipitationInches} inches of precipitation expected over the next hour"
6262
msgstr "আগামী এক ঘণ্টায় {precipitationInches} ইঞ্চি বৃষ্টিপাত প্রত্যাশিত."
6363

64-
#: src/components/weather-alert.tsx:231
64+
#: src/components/weather-alert.tsx:242
6565
msgid "{precipitationMm}mm of precipitation expected over the next {durationHours} hours"
6666
msgstr "আগামী {durationHours} ঘণ্টায় {precipitationMm} mm বৃষ্টিপাত প্রত্যাশিত."
6767

68-
#: src/components/weather-alert.tsx:224
68+
#: src/components/weather-alert.tsx:235
6969
msgid "{precipitationMm}mm of precipitation expected over the next hour"
7070
msgstr "আগামী এক ঘণ্টায় {precipitationMm} mm বৃষ্টিপাত প্রত্যাশিত."
7171

@@ -463,19 +463,19 @@ msgstr "আজও কাগজের হৃদয় আর নীরব ছোট
463463
msgid "Evergreens, candles, bells, and stars echo a shared theme drawn from those early traditions: light enduring through the darkest part of the year in the cultures where the holiday first formed."
464464
msgstr "চিরসবুজ গাছ, মোমবাতি, ঘণ্টা, আর তারা একটি যৌথ থিমকে স্মরণ করিয়ে দেয় ... যে সংস্কৃতিগুলোতে এই উৎসব প্রথম গড়ে উঠেছিল, বছরের সবচেয়ে অন্ধকার সময়ে আলো টিকে থাকার থিম।"
465465

466-
#: src/components/weather-alert.tsx:191
466+
#: src/components/weather-alert.tsx:202
467467
msgid "Extreme UV for the next {durationOfExtremeUv} hours"
468468
msgstr "পরের {durationOfExtremeUv} ঘণ্টা ধরে আত্যধিক ইউভি"
469469

470470
#: src/components/weather-alert.tsx:49
471471
#~ msgid "Extreme UV for the next 12 hours"
472472
#~ msgstr "পরের 12 ঘণ্টা ধরে আত্যধিক ইউভি"
473473

474-
#: src/components/weather-alert.tsx:195
474+
#: src/components/weather-alert.tsx:206
475475
msgid "Extreme UV for the next hour"
476476
msgstr "পরের এক ঘণ্টা ধরে আত্যধিক ইউভি"
477477

478-
#: src/components/weather-alert.tsx:182
478+
#: src/components/weather-alert.tsx:193
479479
msgid "Extreme UV starting in {timeUntilExtremeUv} hours"
480480
msgstr "{timeUntilExtremeUv} ঘণ্টা পরে আত্যধিক ইউভি শুরু হবে"
481481

@@ -563,19 +563,19 @@ msgstr "জেমিনিডস উল্কাবৃষ্টি"
563563
msgid "General"
564564
msgstr "সাধারণ"
565565

566-
#: src/components/weather-alert.tsx:277
566+
#: src/components/weather-alert.tsx:291
567567
msgid "Generally strong wind for the next {durationOfStrongWind} hours"
568568
msgstr "আগামী {durationOfStrongWind} ঘণ্টা ধরে সাধারণত প্রবল বাতাস"
569569

570-
#: src/components/weather-alert.tsx:283
570+
#: src/components/weather-alert.tsx:297
571571
msgid "Generally strong wind for the next 24 hours"
572572
msgstr "আগামী ২৪ ঘণ্টা ধরে সাধারণত প্রবল বাতাস"
573573

574-
#: src/components/weather-alert.tsx:286
574+
#: src/components/weather-alert.tsx:300
575575
msgid "Generally strong wind for the next hour"
576576
msgstr "আগামী এক ঘণ্টা ধরে সাধারণত প্রবল বাতাস"
577577

578-
#: src/components/weather-alert.tsx:269
578+
#: src/components/weather-alert.tsx:283
579579
msgid "Generally strong wind starting in {timeUntilStrongWind} hours"
580580
msgstr "{timeUntilStrongWind} ঘণ্টা পর থেকে সাধারণত প্রবল বাতাস শুরু হবে"
581581

@@ -927,19 +927,19 @@ msgstr "দ্রাঘিমাংশ"
927927
#~ msgid "Looks like we can't grab your location info automatically."
928928
#~ msgstr "মনে হচ্ছে আমরা আপনার অবস্থানের তথ্য স্বয়ংক্রিয়ভাবে পেতে পারছি না।"
929929

930-
#: src/components/weather-alert.tsx:345
930+
#: src/components/weather-alert.tsx:369
931931
msgid "Low visibility for the next {durationOfLowVisibility} hours"
932932
msgstr "পরের {durationOfLowVisibility} ঘণ্টা ধরে কম দৃশ্যতা"
933933

934-
#: src/components/weather-alert.tsx:351
934+
#: src/components/weather-alert.tsx:375
935935
msgid "Low visibility for the next 24 hours"
936936
msgstr "পরের 24 ঘণ্টা ধরে কম দৃশ্যতা"
937937

938-
#: src/components/weather-alert.tsx:354
938+
#: src/components/weather-alert.tsx:378
939939
msgid "Low visibility for the next hour"
940940
msgstr "পরের এক ঘণ্টা ধরে কম দৃশ্যতা"
941941

942-
#: src/components/weather-alert.tsx:339
942+
#: src/components/weather-alert.tsx:361
943943
msgid "Low visibility starting in {timeUntilLowVisibility} hours"
944944
msgstr "{timeUntilLowVisibility} ঘণ্টা পরে কম দৃশ্যতা শুরু হবে"
945945

@@ -1424,19 +1424,19 @@ msgstr "হোলিকে ঘিরে গল্প অঞ্চলভেদে
14241424
#~ msgid "Strong wind for the next hour"
14251425
#~ msgstr "পরের এক ঘণ্টা ধরে শক্তিশালী বাতাস"
14261426

1427-
#: src/components/weather-alert.tsx:311
1427+
#: src/components/weather-alert.tsx:330
14281428
msgid "Strong wind gusts for the next {durationOfStrongWind} hours"
14291429
msgstr "পরের {durationOfStrongWind} ঘণ্টা ধরে শক্তিশালী বাতাসের ঝড়"
14301430

1431-
#: src/components/weather-alert.tsx:317
1431+
#: src/components/weather-alert.tsx:336
14321432
msgid "Strong wind gusts for the next 24 hours"
14331433
msgstr "পরের 24 ঘণ্টা ধরে শক্তিশালী বাতাসের ঝড়"
14341434

1435-
#: src/components/weather-alert.tsx:320
1435+
#: src/components/weather-alert.tsx:339
14361436
msgid "Strong wind gusts for the next hour"
14371437
msgstr "পরের এক ঘণ্টা ধরে শক্তিশালী বাতাসের ঝড়"
14381438

1439-
#: src/components/weather-alert.tsx:305
1439+
#: src/components/weather-alert.tsx:322
14401440
msgid "Strong wind gusts starting in {timeUntilStrongWind} hours"
14411441
msgstr "{timeUntilStrongWind} ঘণ্টা পর শক্তিশালী বাতাসের ঝড় শুরু হবে"
14421442

0 commit comments

Comments
 (0)