add beta build script

This commit is contained in:
ngxson
2020-07-27 10:32:56 +02:00
parent 01e121b871
commit b8a3ce2349
8 changed files with 35 additions and 5 deletions
+2 -1
View File
@@ -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"
+3 -1
View File
@@ -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
}
};
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

+10
View File
@@ -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;
}
+7 -1
View File
@@ -2,7 +2,11 @@
<div class="header">
<div class="row mt-2 pb-2" style="border-bottom: 1px #eee solid;">
<div class="col ml-3">
<div v-on:click="navigateBack()" v-bind:class="{ back: canBack }">
<div
v-on:click="navigateBack()"
v-bind:class="{ back: canBack }"
style="display: inline-block;"
>
<img
v-if="canBack"
src="/images/back-button.svg"
@@ -10,6 +14,7 @@
/>
<img src="/images/horizontal-logo.svg" style="height: 18px;" />
</div>
<div class="beta-badge" v-if="isBeta">BETA</div>
</div>
<div v-if="apiKey === ''" class="col mr-2">
@@ -61,6 +66,7 @@ export default {
apiUrl: "",
canBack: false,
showDropdownMenu: false,
isBeta: process.env.BETA,
};
},
async mounted() {
+13 -2
View File
@@ -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),
},
}),
]);