Compare commits

..

No commits in common. "fde4197f1202a7ded9ba147c8722d35d5e72dce8" and "041527e7a451d0af2b21651944e9aebf2882ae61" have entirely different histories.

7 changed files with 8220 additions and 10761 deletions

1
.nvmrc
View File

@ -1 +0,0 @@
v18.18.0

View File

@ -78,29 +78,30 @@ curl -fsSL https://github.com/abhijithvijayan/web-extension-starter/archive/reac
Ensure you have Ensure you have
- [Node.js](https://nodejs.org) 10 or later installed - [Node.js](https://nodejs.org) 10 or later installed
- [Yarn](https://yarnpkg.com) v1 or v2 installed
Then run the following: Then run the following:
- `npm install` to install dependencies. - `yarn install` to install dependencies.
- `npm run dev:chrome` to start the development server for chrome extension - `yarn run dev:chrome` to start the development server for chrome extension
- `npm run dev:firefox` to start the development server for firefox addon - `yarn run dev:firefox` to start the development server for firefox addon
- `npm run dev:opera` to start the development server for opera extension - `yarn run dev:opera` to start the development server for opera extension
- `npm run build:chrome` to build chrome extension - `yarn run build:chrome` to build chrome extension
- `npm run build:firefox` to build firefox addon - `yarn run build:firefox` to build firefox addon
- `npm run build:opera` to build opera extension - `yarn run build:opera` to build opera extension
- `npm run build` builds and packs extensions all at once to extension/ directory - `yarn run build` builds and packs extensions all at once to extension/ directory
### Development ### Development
- `npm install` to install dependencies. - `yarn install` to install dependencies.
- To watch file changes in development - To watch file changes in development
- Chrome - Chrome
- `npm run dev:chrome` - `yarn run dev:chrome`
- Firefox - Firefox
- `npm run dev:firefox` - `yarn run dev:firefox`
- Opera - Opera
- `npm run dev:opera` - `yarn run dev:opera`
- **Load extension in browser** - **Load extension in browser**
@ -123,7 +124,7 @@ Then run the following:
### Production ### Production
- `npm run build` builds the extension for all the browsers to `extension/BROWSER` directory respectively. - `yarn run build` builds the extension for all the browsers to `extension/BROWSER` directory respectively.
Note: By default the `manifest.json` is set with version `0.0.0`. The webpack loader will update the version in the build with that of the `package.json` version. In order to release a new version, update version in `package.json` and run script. Note: By default the `manifest.json` is set with version `0.0.0`. The webpack loader will update the version in the build with that of the `package.json` version. In order to release a new version, update version in `package.json` and run script.

10694
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -26,62 +26,63 @@
"lint:fix": "eslint . --ext .ts,.tsx --fix" "lint:fix": "eslint . --ext .ts,.tsx --fix"
}, },
"dependencies": { "dependencies": {
"@babel/runtime": "^7.23.9", "@babel/runtime": "^7.14.0",
"advanced-css-reset": "^1.2.2", "advanced-css-reset": "^1.2.2",
"emoji-log": "^1.0.2",
"react": "^17.0.2", "react": "^17.0.2",
"react-dom": "^17.0.2", "react-dom": "^17.0.2",
"webext-base-css": "^1.4.4", "webext-base-css": "^1.3.1",
"webextension-polyfill-ts": "^0.26.0" "webextension-polyfill-ts": "^0.25.0"
}, },
"devDependencies": { "devDependencies": {
"@abhijithvijayan/eslint-config": "^2.8.1", "@abhijithvijayan/eslint-config": "2.6.3",
"@abhijithvijayan/eslint-config-airbnb": "^1.1.0", "@abhijithvijayan/eslint-config-airbnb": "^1.0.2",
"@abhijithvijayan/tsconfig": "^1.3.0", "@abhijithvijayan/tsconfig": "^1.3.0",
"@babel/core": "^7.23.9", "@babel/core": "^7.14.3",
"@babel/eslint-parser": "^7.23.9", "@babel/eslint-parser": "^7.12.16",
"@babel/plugin-proposal-class-properties": "^7.18.6", "@babel/plugin-proposal-class-properties": "^7.13.0",
"@babel/plugin-proposal-object-rest-spread": "^7.20.7", "@babel/plugin-proposal-object-rest-spread": "^7.14.2",
"@babel/plugin-transform-destructuring": "^7.23.3", "@babel/plugin-transform-destructuring": "^7.13.17",
"@babel/plugin-transform-runtime": "^7.23.9", "@babel/plugin-transform-runtime": "^7.14.3",
"@babel/preset-env": "^7.23.9", "@babel/preset-env": "^7.14.2",
"@babel/preset-react": "^7.23.3", "@babel/preset-react": "^7.13.13",
"@babel/preset-typescript": "^7.23.3", "@babel/preset-typescript": "^7.13.0",
"@types/react": "^17.0.75", "@types/react": "^17.0.6",
"@types/react-dom": "^17.0.25", "@types/react-dom": "^17.0.5",
"@types/webpack": "^5.28.5", "@types/webpack": "^4.41.29",
"@typescript-eslint/eslint-plugin": "^6.20.0", "@typescript-eslint/eslint-plugin": "^4.4.1",
"@typescript-eslint/parser": "^6.20.0", "@typescript-eslint/parser": "^4.4.1",
"autoprefixer": "^10.4.17", "autoprefixer": "^10.2.5",
"babel-loader": "^9.1.3", "babel-loader": "^8.2.2",
"clean-webpack-plugin": "^4.0.0", "clean-webpack-plugin": "^3.0.0",
"copy-webpack-plugin": "^12.0.2", "copy-webpack-plugin": "^6.4.1",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"css-loader": "^6.10.0", "css-loader": "^5.2.5",
"eslint": "^8.56.0", "eslint": "^7.27.0",
"eslint-config-prettier": "^8.10.0", "eslint-config-prettier": "^6.15.0",
"eslint-plugin-import": "^2.29.1", "eslint-plugin-import": "^2.23.3",
"eslint-plugin-jsx-a11y": "^6.8.0", "eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-node": "^11.1.0", "eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^5.1.3", "eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-react": "^7.33.2", "eslint-plugin-react": "^7.23.2",
"eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-hooks": "^4.2.0",
"filemanager-webpack-plugin": "^8.0.0", "filemanager-webpack-plugin": "^3.1.1",
"fork-ts-checker-webpack-plugin": "^9.0.2", "fork-ts-checker-webpack-plugin": "^6.2.10",
"html-webpack-plugin": "^5.6.0", "html-webpack-plugin": "^4.5.2",
"mini-css-extract-plugin": "^2.7.7", "mini-css-extract-plugin": "^1.6.0",
"optimize-css-assets-webpack-plugin": "^6.0.1", "optimize-css-assets-webpack-plugin": "^5.0.6",
"postcss": "^8.4.33", "postcss": "^8.3.0",
"postcss-loader": "^8.1.0", "postcss-loader": "^4.3.0",
"prettier": "^3.2.4", "prettier": "^2.3.0",
"resolve-url-loader": "^5.0.0", "resolve-url-loader": "^3.1.3",
"sass": "^1.70.0", "sass": "^1.53.0",
"sass-loader": "^14.1.0", "sass-loader": "^10.2.0",
"terser-webpack-plugin": "^5.3.10", "terser-webpack-plugin": "^4.2.3",
"typescript": "4.9.5", "typescript": "4.1.5",
"webpack": "^5.90.0", "webpack": "^4.46.0",
"webpack-cli": "^5.1.4", "webpack-cli": "^4.7.0",
"webpack-ext-reloader": "^1.1.12", "webpack-extension-reloader": "^1.1.4",
"wext-manifest-loader": "^2.4.1", "wext-manifest-loader": "^2.3.0",
"wext-manifest-webpack-plugin": "^1.4.0" "wext-manifest-webpack-plugin": "^1.2.1"
} }
} }

View File

@ -1,5 +1,6 @@
import 'emoji-log';
import {browser} from 'webextension-polyfill-ts'; import {browser} from 'webextension-polyfill-ts';
browser.runtime.onInstalled.addListener((): void => { browser.runtime.onInstalled.addListener((): void => {
console.log('🦄', 'extension installed'); console.emoji('🦄', 'extension installed');
}); });

View File

@ -5,7 +5,7 @@ const TerserPlugin = require('terser-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin'); const CopyWebpackPlugin = require('copy-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin');
const {CleanWebpackPlugin} = require('clean-webpack-plugin'); const {CleanWebpackPlugin} = require('clean-webpack-plugin');
const ExtensionReloader = require('webpack-ext-reloader'); const ExtensionReloader = require('webpack-extension-reloader');
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const WextManifestWebpackPlugin = require('wext-manifest-webpack-plugin'); const WextManifestWebpackPlugin = require('wext-manifest-webpack-plugin');
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
@ -20,8 +20,8 @@ const targetBrowser = process.env.TARGET_BROWSER;
const extensionReloaderPlugin = const extensionReloaderPlugin =
nodeEnv === 'development' nodeEnv === 'development'
? new ExtensionReloader({ ? new ExtensionReloader({
port: 9090, // Which port use to create the server port: 9090,
reloadPage: true, // Force the reload of the page also reloadPage: true,
entries: { entries: {
// TODO: reload manifest on update // TODO: reload manifest on update
contentScript: 'contentScript', contentScript: 'contentScript',

8151
yarn.lock Normal file

File diff suppressed because it is too large Load Diff