diff --git a/CHANGELOG.md b/CHANGELOG.md index c2065ec..79efdf4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,9 @@ # 1.1.0 - Updated extension to pull colours from https://github.com/ozh/github-colors - colours are loaded every week, which roughly coincides with how often the above repo is updated -- Updated to manifest v3 to bring back the chrome version - - also removed the background script from the distributed version since it was only for 0.1.9 integrity issues +- Updated Chrome version to manifest v3 to allow it to be used + - Firefox version continues to use manifest v2 +- Removed the background script from the distributed version since it was only for 0.1.9 integrity issues - Setting up project to be also used within my personal website # 1.0.13 diff --git a/bump.py b/bump.py index abb208e..7caae12 100644 --- a/bump.py +++ b/bump.py @@ -33,13 +33,25 @@ with open('package.json', 'w') as f: json.dump(data, f, sort_keys=True, indent=2) -# Now the manifest file +# Now the manifest files with open('dist/manifest.json') as f: data = json.load(f) data['version'] = new_ver with open('dist/manifest.json', 'w') as f: json.dump(data, f, sort_keys=True, indent=2) +# Open the dist specific manifests +with open('dist/manifests/firefox.json') as f: + data = json.load(f) +data['version'] = new_ver +with open('dist/manifest.json', 'w') as f: + json.dump(data, f, sort_keys=True, indent=2) +with open('dist/manifests/chrome.json') as f: + data = json.load(f) +data['version'] = new_ver +with open('dist/manifest.json', 'w') as f: + json.dump(data, f, sort_keys=True, indent=2) + # Also append the new version to the start of the CHANGELOG with open('CHANGELOG.md') as f: lines = f.readlines() diff --git a/chromify.js b/chromify.js deleted file mode 100644 index dc0ac8a..0000000 --- a/chromify.js +++ /dev/null @@ -1,11 +0,0 @@ -const fs = require('fs') -const fileName = './dist/manifest.json' -const file = require(fileName) - -delete file.browser_specific_settings - -fs.writeFile(fileName, JSON.stringify(file), function writeJSON(err) { - if (err) return console.log(err) - console.log(JSON.stringify(file)) - console.log('writing to ' + fileName) -}) diff --git a/dist/manifest.json b/dist/manifest.json index 4b2092a..5183723 100644 --- a/dist/manifest.json +++ b/dist/manifest.json @@ -1,38 +1,36 @@ { - "action": { - "default_icon": "images/github-user-languages.128.png", - "default_popup": "popup.html" - }, - "author": "freyamade", - "browser_specific_settings": { - "gecko": { - "id": "extension@github-user-languages.github.com" - } - }, - "content_scripts": [ - { - "js": [ - "js/vendor.js", - "js/content_script.js" - ], - "matches": [ - "https://github.com/*" - ] - } - ], - "description": "See the language usage breakdown of a User or Org right on their GitHub profile page.", - "host_permissions": [ - "https://api.github.com/", - "https://raw.githubusercontent.com/ozh/github-colors/master/colors.json" - ], - "icons": { - "128": "images/github-user-languages.128.png" - }, - "manifest_version": 3, - "name": "GitHub User Languages", - "permissions": [ - "storage" - ], - "short_name": "github-user-languages", - "version": "1.1.0" -} \ No newline at end of file + "author": "freyamade", + "browser_action": { + "default_icon": "images/github-user-languages.128.png", + "default_popup": "popup.html" + }, + "browser_specific_settings": { + "gecko": { + "id": "extension@github-user-languages.github.com" + } + }, + "content_scripts": [ + { + "js": [ + "js/vendor.js", + "js/content_script.js" + ], + "matches": [ + "https://github.com/*" + ] + } + ], + "description": "See the language usage breakdown of a User or Org right on their GitHub profile page.", + "icons": { + "128": "images/github-user-languages.128.png" + }, + "manifest_version": 2, + "name": "GitHub User Languages", + "permissions": [ + "https://api.github.com/", + "https://raw.githubusercontent.com/ozh/github-colors/master/colors.json", + "storage" + ], + "short_name": "github-user-languages", + "version": "1.1.0" + } \ No newline at end of file diff --git a/manifests/chrome.json b/manifests/chrome.json new file mode 100644 index 0000000..9c8e459 --- /dev/null +++ b/manifests/chrome.json @@ -0,0 +1,33 @@ +{ + "action": { + "default_icon": "images/github-user-languages.128.png", + "default_popup": "popup.html" + }, + "author": "freyamade", + "content_scripts": [ + { + "js": [ + "js/vendor.js", + "js/content_script.js" + ], + "matches": [ + "https://github.com/*" + ] + } + ], + "description": "See the language usage breakdown of a User or Org right on their GitHub profile page.", + "host_permissions": [ + "https://api.github.com/", + "https://raw.githubusercontent.com/ozh/github-colors/master/colors.json" + ], + "icons": { + "128": "images/github-user-languages.128.png" + }, + "manifest_version": 3, + "name": "GitHub User Languages", + "permissions": [ + "storage" + ], + "short_name": "github-user-languages", + "version": "1.1.0" + } \ No newline at end of file diff --git a/manifests/firefox.json b/manifests/firefox.json new file mode 100644 index 0000000..5183723 --- /dev/null +++ b/manifests/firefox.json @@ -0,0 +1,36 @@ +{ + "author": "freyamade", + "browser_action": { + "default_icon": "images/github-user-languages.128.png", + "default_popup": "popup.html" + }, + "browser_specific_settings": { + "gecko": { + "id": "extension@github-user-languages.github.com" + } + }, + "content_scripts": [ + { + "js": [ + "js/vendor.js", + "js/content_script.js" + ], + "matches": [ + "https://github.com/*" + ] + } + ], + "description": "See the language usage breakdown of a User or Org right on their GitHub profile page.", + "icons": { + "128": "images/github-user-languages.128.png" + }, + "manifest_version": 2, + "name": "GitHub User Languages", + "permissions": [ + "https://api.github.com/", + "https://raw.githubusercontent.com/ozh/github-colors/master/colors.json", + "storage" + ], + "short_name": "github-user-languages", + "version": "1.1.0" + } \ No newline at end of file diff --git a/package.json b/package.json index 34eeacd..6ea2481 100644 --- a/package.json +++ b/package.json @@ -23,8 +23,8 @@ "url": "https://github.com/freyamade/github-user-languages.git" }, "scripts": { - "archive-c-dist": "git stash && node chromify.js && cd dist && zip -r ../c-dist.zip * && git reset --hard && git stash pop", - "archive-ff-dist": "cd dist && zip -r ../ff-dist.zip *", + "archive-c-dist": "cp manifests/chrome.json dist/manifest.json && cd dist && zip -r ../c-dist.zip * && cp ../manifests/firefox.json manifest.json", + "archive-ff-dist": "cp manifests/firefox.json dist/manifest.json && cd dist && zip -r ../ff-dist.zip *", "archive-src": "zip -r src.zip package.json package-lock.json src/ webpack/ tsconfig.json tslint.json README.md", "build": "webpack --config webpack/webpack.prod.js", "lint": "tslint src/*.ts",