From 64fb3595d22876a3dc3c09436eb4073f67be8a51 Mon Sep 17 00:00:00 2001 From: Leon Bubova Date: Wed, 15 Dec 2021 00:57:06 +0100 Subject: [PATCH] add doc to Get Started on how to create bundled source files --- CONTRIBUTING.md | 29 ++++++++++++++++ Extensions/combined/init/init.js | 0 Extensions/combined/manifest.json | 29 ++++------------ Extensions/combined/manifestv2.json | 27 --------------- Extensions/combined/manifestv3.json | 41 +++++++++++++++++++++++ Extensions/combined/ryd.content-script.js | 2 +- Extensions/combined/ryd.tools.js | 2 -- src/index.js | 1 - webpack.config.js | 1 + 9 files changed, 79 insertions(+), 53 deletions(-) delete mode 100644 Extensions/combined/init/init.js delete mode 100644 Extensions/combined/manifestv2.json create mode 100644 Extensions/combined/manifestv3.json delete mode 100644 Extensions/combined/ryd.tools.js delete mode 100644 src/index.js diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 607bb00..1a41707 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,6 +4,35 @@ Thank you for investing your time in contributing to our project! All your chang ## Getting Started Please use Prettier with default settings for formatting. + +#### Prerequisites + +You need to have node and npm installed to create the bundled version of the source. + +Versions used when setting up: + +- node: 12.18.4 +- npm: 6.14.6 + +To create the `bundled-content-script.js` that contains most of the business logic of this extension you have to install all dependencies first. + +1. Go to the root of the repo and run: + +``` +npm install +``` + +2. Run the following command to create `bundled-content-script.js` which is used in `manifest.json` + +``` +npm run bundle +``` + +This will also start a watcher that re-bundles automatically once you save a file inside the source. + +Congratulations, You are now ready to develop! + + ### Issues #### Opening a new issue If you have any issues with the extension, please search to make sure the issue isn't already reported. If it isn't, open an issue, using the issue form is highly recommended but not mandatory. diff --git a/Extensions/combined/init/init.js b/Extensions/combined/init/init.js deleted file mode 100644 index e69de29..0000000 diff --git a/Extensions/combined/manifest.json b/Extensions/combined/manifest.json index 07bb4ad..854518d 100644 --- a/Extensions/combined/manifest.json +++ b/Extensions/combined/manifest.json @@ -2,41 +2,26 @@ "name": "Return YouTube Dislike", "description": "Returns ability to see dislikes", "version": "2.0.0.2", - "manifest_version": 3, + "manifest_version": 2, "background": { - "service_worker": "ryd.background.js" + "scripts": ["ryd.background.js"] }, "icons": { "48": "icons/icon48.png", - "128": "icons/icon128.png" + "128": "icons/icon128.png" }, - "host_permissions": ["*://*.youtube.com/*"], - "permissions": [ - "storage" - ], - "action": { + "permissions": ["activeTab", "*://*.youtube.com/*", "storage"], + "browser_action": { "default_popup": "popup.html" }, "content_scripts": [ { - "matches": [ - "*://youtube.com/*", - "*://www.youtube.com/*", - "*://m.youtube.com/*" - ], + "matches": ["*://*.youtube.com/*"], "exclude_matches": ["*://*.music.youtube.com/*"], "run_at": "document_idle", "css": ["content-style.css"], "js": ["bundled-content-script.js"] } - ], - "externally_connectable": { - "matches": ["*://*.youtube.com/*"] - }, - "web_accessible_resources": [ - { - "resources": ["ryd.script.js"], - "matches": ["*://*.youtube.com/*"] - } ] + } diff --git a/Extensions/combined/manifestv2.json b/Extensions/combined/manifestv2.json deleted file mode 100644 index 854518d..0000000 --- a/Extensions/combined/manifestv2.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "Return YouTube Dislike", - "description": "Returns ability to see dislikes", - "version": "2.0.0.2", - "manifest_version": 2, - "background": { - "scripts": ["ryd.background.js"] - }, - "icons": { - "48": "icons/icon48.png", - "128": "icons/icon128.png" - }, - "permissions": ["activeTab", "*://*.youtube.com/*", "storage"], - "browser_action": { - "default_popup": "popup.html" - }, - "content_scripts": [ - { - "matches": ["*://*.youtube.com/*"], - "exclude_matches": ["*://*.music.youtube.com/*"], - "run_at": "document_idle", - "css": ["content-style.css"], - "js": ["bundled-content-script.js"] - } - ] - -} diff --git a/Extensions/combined/manifestv3.json b/Extensions/combined/manifestv3.json new file mode 100644 index 0000000..717d17d --- /dev/null +++ b/Extensions/combined/manifestv3.json @@ -0,0 +1,41 @@ +{ + "name": "Return YouTube Dislike", + "description": "Returns ability to see dislikes", + "version": "2.0.0.2", + "manifest_version": 3, + "background": { + "service_worker": "ryd.background.js" + }, + "icons": { + "48": "icons/icon48.png", + "128": "icons/icon128.png" + }, + "host_permissions": ["*://*.youtube.com/*"], + "permissions": [ + "storage" + ], + "action": { + "default_popup": "popup.html" + }, + "content_scripts": [ + { + "matches": [ + "*://youtube.com/*", + "*://www.youtube.com/*", + "*://m.youtube.com/*" + ], + "exclude_matches": ["*://*.music.youtube.com/*"], + "js": ["bundled-content-script.js"], + "css": ["content-style.css"] + } + ], + "externally_connectable": { + "matches": ["*://*.youtube.com/*"] + }, + "web_accessible_resources": [ + { + "resources": ["ryd.script.js"], + "matches": ["*://*.youtube.com/*"] + } + ] +} diff --git a/Extensions/combined/ryd.content-script.js b/Extensions/combined/ryd.content-script.js index 5ef712d..0a494f0 100644 --- a/Extensions/combined/ryd.content-script.js +++ b/Extensions/combined/ryd.content-script.js @@ -392,4 +392,4 @@ RYDTools.getBrowser = function () { } }; -RYD.getInstance().init(); \ No newline at end of file +RYD.getInstance().init(); diff --git a/Extensions/combined/ryd.tools.js b/Extensions/combined/ryd.tools.js deleted file mode 100644 index 139597f..0000000 --- a/Extensions/combined/ryd.tools.js +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/src/index.js b/src/index.js deleted file mode 100644 index e5918aa..0000000 --- a/src/index.js +++ /dev/null @@ -1 +0,0 @@ -console.log(path.resolve(__dirname, "Extensions/combined")) \ No newline at end of file diff --git a/webpack.config.js b/webpack.config.js index 9452fa7..002b243 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -10,4 +10,5 @@ module.exports = { ramda: "R", }, module: {}, + watch: true };