feat: added automatic publishing

This commit is contained in:
Joseph 2021-10-02 21:29:17 +00:00 committed by JRedOW
parent 1ea18b1e1e
commit 734fdb16ef
3 changed files with 2284 additions and 58 deletions

View File

@ -47,6 +47,7 @@
- ES6 modules support
- React UI Library by default
- Smart reload
- Automatic Publishing
## Browser Support
@ -130,6 +131,25 @@ Note: By default the `manifest.json` is set with version `0.0.0`. The webpack lo
If you don't want to use `package.json` version, you can disable the option [here](https://github.com/abhijithvijayan/web-extension-starter/blob/e10158c4a49948dea9fdca06592876d9ca04e028/webpack.config.js#L79).
### Automatic Publishing
- To publish your extention automatically, you first have to set some enviroment variables.
- ### Chrome
- Set `EXTENSION_ID` as the Chrome Extention ID.
- Set `CLIENT_ID` as the Chrome Dev Client ID.
- Set `CLIENT_SECRET` as the Chrome Dev Client Secret (If Needed).
- Set `REFRESH_TOKEN` as the Chrome Dev Client Refresh Token.
- You can find how to get your Client ID and Refresh Token [here](https://github.com/fregante/chrome-webstore-upload/blob/main/How%20to%20generate%20Google%20API%20keys.md).
- ### Firefox
- Set `WEB_EXT_API_KEY` as the Firefox Web Extention API Key.
- Set `WEB_EXT_API_SECRET` as the Firefox Web Extention API Secret.
- Now you can publish your application through either `yarn run publish:chrome` for Chrome or `yarn run publish:firefox` for Firefox (or `yarn run publish` for both)!
### Generating browser specific manifest.json
Update `source/manifest.json` file with browser vendor prefixed manifest keys

View File

@ -22,6 +22,9 @@
"build:firefox": "cross-env NODE_ENV=production cross-env TARGET_BROWSER=firefox webpack",
"build:opera": "cross-env NODE_ENV=production cross-env TARGET_BROWSER=opera webpack",
"build": "yarn run build:chrome && yarn run build:firefox && yarn run build:opera",
"publish:chrome": "yarn run build:chrome && cd chrome-webstore-upload upload --source extention/chrome.zip --auto-publish",
"publish:firefox": "yarn run build:firefox && cd ./extension/firefox && web-ext-submit",
"publish": "yarn run publish:chrome && yarn run publish:firefox",
"lint": "eslint . --ext .ts,.tsx",
"lint:fix": "eslint . --ext .ts,.tsx --fix"
},
@ -54,6 +57,7 @@
"@typescript-eslint/parser": "^4.4.1",
"autoprefixer": "^10.2.5",
"babel-loader": "^8.2.2",
"chrome-webstore-upload-cli": "^2.0.1",
"clean-webpack-plugin": "^3.0.0",
"copy-webpack-plugin": "^6.4.1",
"cross-env": "^7.0.3",
@ -79,6 +83,7 @@
"sass-loader": "^10.2.0",
"terser-webpack-plugin": "^4.2.3",
"typescript": "4.1.5",
"web-ext-submit": "^6.4.0",
"webpack": "^4.46.0",
"webpack-cli": "^4.7.0",
"webpack-extension-reloader": "^1.1.4",

2317
yarn.lock

File diff suppressed because it is too large Load Diff