diff --git a/.gitignore b/.gitignore index 5ae4a7725927b83277ebf750f473bc6d7bfae066..fc0004cd9d9d20f59de474765f875f5ffc07117b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /node_modules -/js \ No newline at end of file +/js +/dist \ No newline at end of file diff --git a/README.md b/README.md index cb02fb57c8a7736101a363f1f15d65f2cdd57150..c4359d37922ba3abbed3086fb5cc29ce1b654030 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,37 @@ -The official WebExtension for the German search engine MetaGer. - -This extension is currently in an unfinished state and not recomended for production use. +# The official WebExtension for the German search engine MetaGer. Copyright © SUMA-EV and contributors +## Build the extension yourself (Firefox) + +We are using webpack to provide the necessary libraries for this extension. You will either need to have [nodejs v20](https://nodejs.org/en/download) or [docker](https://docs.docker.com/engine/install/) installed on your system for the build. + +### Debug using nodejs + +#### Build the js files: +```bash +npm run dev +``` +#### Debug the extension in your browser +```bash +node_modules/web-ext/bin/web-ext.js run +``` + +### Build production using nodejs + +#### Build the js files and package the extension under `./dist/` using nodejs +```bash +npm run prod +``` + +#### Build the js files and package the extension under `./dist/` using docker +There is a helper script in this repo that runs the necessary docker command +```bash +./build/helpers/prod.sh +``` + +## License + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the diff --git a/build/helpers/.env b/build/helpers/.env index ebbf24935a0095237f4f1dcb3ffe3842ad58049f..a5ee6774ea88a8677e1f08b64a789be90bb3cadf 100644 --- a/build/helpers/.env +++ b/build/helpers/.env @@ -1 +1 @@ -NODE_VERSION=21 \ No newline at end of file +NODE_VERSION=20 \ No newline at end of file diff --git a/build/helpers/prod.sh b/build/helpers/prod.sh new file mode 100755 index 0000000000000000000000000000000000000000..4acdfe24ba2fbafd3eb8b0418c2625f17a05fef2 --- /dev/null +++ b/build/helpers/prod.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# Verify that docker is installed +if ! command -v docker &> /dev/null +then + echo "docker seems to not be installed on your system"; + exit 1; +fi + +CURRENT_DIR=`dirname $BASH_SOURCE`; + +# Export variables to this environment +source $CURRENT_DIR/.env + +docker run -it --rm -v $CURRENT_DIR/../../:/data --workdir=/data node:$NODE_VERSION npm run prod diff --git a/manifest.json b/manifest.json index c0398454f6569b80f97e552b30b71e5d2643c932..3ef657127fe12dbaf244ca449eb6d5b55e095b7e 100644 --- a/manifest.json +++ b/manifest.json @@ -7,7 +7,7 @@ "default_locale": "en", "browser_specific_settings": { "gecko": { - "id": "firefoxextension@metager.org", + "id": "firefoxextension@metager.de", "strict_min_version": "120.0" } }, diff --git a/package-lock.json b/package-lock.json index 89f21b791455eceeecf7c9c3b3aa137606ac30d3..e20b26f0413b8b1084af173abe8b0034a675c140 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "metager-webextension", + "name": "data", "lockfileVersion": 3, "requires": true, "packages": { @@ -7,7 +7,6 @@ "dependencies": { "blind-signatures": "^1.0.7", "buffer": "^6.0.3", - "cookie": "^0.6.0", "crypto-browserify": "^3.12.0", "node-rsa": "^1.1.1", "process": "^0.11.10", @@ -2049,14 +2048,6 @@ "url": "https://github.com/yeoman/configstore?sponsor=1" } }, - "node_modules/cookie": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", - "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", - "engines": { - "node": ">= 0.6" - } - }, "node_modules/core-js": { "version": "3.29.0", "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.29.0.tgz", diff --git a/package.json b/package.json index 12572190f0c452cb196edc18b5005867072f22a1..c676fda037f87a98507c4f356176368b7251ea57 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,6 @@ "dependencies": { "blind-signatures": "^1.0.7", "buffer": "^6.0.3", - "cookie": "^0.6.0", "crypto-browserify": "^3.12.0", "node-rsa": "^1.1.1", "process": "^0.11.10", @@ -15,6 +14,7 @@ "webpack-cli": "^5.1.4" }, "scripts": { - "dev": "npm i --clean && webpack --mode=development" + "dev": "npm i --clean && webpack --mode=development", + "prod": "npm i --clean && webpack --mode=production --no-devtool --no-watch && node_modules/web-ext/bin/web-ext.js build -a dist --overwrite-dest --ignore-files=build dist .gitignore .git *.md package* webpack.config.js" } -} +} \ No newline at end of file