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: [ 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", 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}.`); });