diff --git a/package.json b/package.json index 95e8fcc..79e1ace 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,8 @@ "prettier": "prettier \"src/**/*.{js,vue}\"", "prettier:write": "npm run prettier -- --write", "build": "cross-env NODE_ENV=production webpack --hide-modules", - "build:dev": "cross-env NODE_ENV=development webpack --hide-modules", + "build:beta": "cross-env NODE_ENV=production BETA=1 webpack --hide-modules", + "build:dev": "cross-env NODE_ENV=development BETA=1 webpack --hide-modules", "build-zip": "node scripts/build-zip.js", "watch": "npm run build -- --watch", "watch:dev": "cross-env HMR=true npm run build:dev -- --watch" diff --git a/scripts/build-zip.js b/scripts/build-zip.js index 9a84c2a..f447c15 100644 --- a/scripts/build-zip.js +++ b/scripts/build-zip.js @@ -9,9 +9,11 @@ const DEST_ZIP_DIR = path.join(__dirname, '../dist-zip'); const extractExtensionData = () => { const extPackageJson = require('../package.json'); + const distManifestJson = require('../dist/manifest.json'); + const isBeta = distManifestJson.name.match(/beta/i); return { - name: extPackageJson.name, + name: extPackageJson.name + (isBeta ? '-beta' : ''), version: extPackageJson.version } }; diff --git a/src/icons/icon_48.png b/src/icons/icon_48.png index 903fe81..36ea033 100644 Binary files a/src/icons/icon_48.png and b/src/icons/icon_48.png differ diff --git a/src/icons/icon_beta_128.png b/src/icons/icon_beta_128.png new file mode 100644 index 0000000..bea34c3 Binary files /dev/null and b/src/icons/icon_beta_128.png differ diff --git a/src/icons/icon_beta_48.png b/src/icons/icon_beta_48.png new file mode 100644 index 0000000..a63712f Binary files /dev/null and b/src/icons/icon_beta_48.png differ diff --git a/src/popup/App.scss b/src/popup/App.scss index 8487bf9..a8ea49b 100644 --- a/src/popup/App.scss +++ b/src/popup/App.scss @@ -170,4 +170,14 @@ em { .more-options > .action { margin-top: 10px; min-height: 25px; +} + +/* BETA badge */ +.beta-badge { + padding: 0.1em 0.4em; + font-size: 0.65em; + margin-left: 1em; + border: 0.7px solid #b02a8f; + display: inline-block; + color: #b02a8f; } \ No newline at end of file diff --git a/src/popup/components/Header.vue b/src/popup/components/Header.vue index ead3a01..61833a9 100644 --- a/src/popup/components/Header.vue +++ b/src/popup/components/Header.vue @@ -2,7 +2,11 @@
-
+
+
BETA
@@ -61,6 +66,7 @@ export default { apiUrl: "", canBack: false, showDropdownMenu: false, + isBeta: process.env.BETA, }; }, async mounted() { diff --git a/webpack.config.js b/webpack.config.js index 19eb166..351d130 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -99,6 +99,15 @@ const config = { jsonContent['permissions'] = jsonContent['permissions'].concat(devConfig.permissions); } + if (process.env.BETA) { + jsonContent['name'] = jsonContent['name'].replace('SimpleLogin', 'SimpleLogin (BETA)'); + + jsonContent['icons'] = { + '48': 'icons/icon_beta_48.png', + '128': 'icons/icon_beta_128.png' + }; + } + return JSON.stringify(jsonContent, null, 2); }, }, @@ -109,7 +118,8 @@ const config = { if (config.mode === 'development') { config.plugins = (config.plugins || []).concat([ new webpack.DefinePlugin({ - devConfig: JSON.stringify(devConfig), + 'devConfig': JSON.stringify(devConfig), + 'process.env.BETA': JSON.stringify(!!process.env.BETA), }), ]); } @@ -118,7 +128,8 @@ if (config.mode === 'production') { config.plugins = (config.plugins || []).concat([ new webpack.DefinePlugin({ 'process.env': { - NODE_ENV: '"production"', + 'NODE_ENV': '"production"', + 'BETA': JSON.stringify(!!process.env.BETA), }, }), ]);