From 62f0fec33447a96695a9922fd6a24f98da08c10a Mon Sep 17 00:00:00 2001 From: Matthew Salcido Date: Tue, 29 Jul 2025 07:47:26 -0700 Subject: [PATCH 1/3] Add build command --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index b1d2e918..b39a048b 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "scripts": { "build:chrome": "NODE_ENV=production PLATFORM=chrome webpack --progress", "build:firefox": "NODE_ENV=production PLATFORM=firefox webpack --progress", + "build": "npm-run-all build:chrome build:firefox", "watch:chrome": "NODE_ENV=development PLATFORM=chrome webpack --watch --progress", "watch:firefox": "NODE_ENV=development PLATFORM=firefox webpack --watch --progress", "watch": "npm-run-all --parallel watch:chrome watch:firefox", From 58f17af0df4fb8f80fb0894c061b8aaaffa416ad Mon Sep 17 00:00:00 2001 From: Matthew Salcido Date: Tue, 29 Jul 2025 07:47:43 -0700 Subject: [PATCH 2/3] Get version from package.json --- manifest.template.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/manifest.template.js b/manifest.template.js index b3dc8c59..a066faa1 100644 --- a/manifest.template.js +++ b/manifest.template.js @@ -1,3 +1,5 @@ +const pkg = require('./package.json'); + module.exports = (env) => { const firefox = env === 'firefox'; return { @@ -5,7 +7,7 @@ module.exports = (env) => { name: 'Discogs Enhancer', short_name: 'Discogs Enhancer', description: 'Enhance your Discogs experience with dark themes, seller tools, price comparisons, currency conversion, powerful filters, and more!', - version: '3.10.2', + version: pkg.version, author: 'Matthew Salcido', homepage_url: 'https://www.discogs-enhancer.com', action: { @@ -58,7 +60,6 @@ module.exports = (env) => { browser_specific_settings: { gecko: { id: '{190dbc44-5dee-4ad4-86e9-a38d7a2d1c61}', - strict_min_version: '101.0' }, }, host_permissions: [ From 27706b6184dc06060b2c1e69a1d2d7cac176995a Mon Sep 17 00:00:00 2001 From: Matthew Salcido Date: Tue, 29 Jul 2025 07:48:09 -0700 Subject: [PATCH 3/3] Update version-bump.js --- version-bump.js | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/version-bump.js b/version-bump.js index 5f8e244d..9a804c28 100644 --- a/version-bump.js +++ b/version-bump.js @@ -20,6 +20,7 @@ */ const fs = require('fs'); +const path = require('path'); // new version number {string} const newVersion = process.argv[2]; @@ -35,21 +36,22 @@ const newVersion = process.argv[2]; */ function updateJSONfiles(version) { - let files = [ - './chrome-dist/manifest.json', - './firefox-dist/manifest.json', - 'package.json', - 'package-lock.json' - ]; + let files = ['package.json', 'package-lock.json']; - files.forEach(file => { + files.forEach((file) => { - let data = JSON.parse(fs.readFileSync(file)); + let filePath = path.resolve(__dirname, file); + + if (!fs.existsSync(filePath)) { + console.warn(`⚠️ Skipped ${file}, not found.`); + return; + } + + let data = JSON.parse(fs.readFileSync(filePath, 'utf-8')); data.version = version; - fs.writeFileSync(file, JSON.stringify(data, null, 2)); - // add new line to end of file - fs.appendFileSync(file, '\n'); + + fs.writeFileSync(filePath, JSON.stringify(data, null, 2) + '\n'); console.log(`✅ Updated ${file} to ${version}.`); });