diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index fad4514..bad1b9d 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -110,6 +110,13 @@ jobs: echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV echo "release version: $RELEASE_VERSION" + - name: Generate buildConfig + shell: bash + env: + ENABLE_LOGIN_WITH_PROTON: false + run: | + npm run generate:buildconfig + - name: Build lite version if: ${{ matrix.variant }} == 'lite' shell: bash diff --git a/package.json b/package.json index fca5e0c..97b6eed 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "build:beta": "cross-env NODE_ENV=production BETA=1 webpack", "build:dev": "cross-env NODE_ENV=development BETA=1 webpack", "build-zip": "node scripts/build-zip.js", + "generate:buildconfig": "node scripts/generateBuildConfig.js", "watch": "npm run build -- --watch", "watch:dev": "cross-env HMR=true npm run build:dev -- --watch", "start": "cross-env HMR=true npm run build:dev -- --watch" diff --git a/scripts/generateBuildConfig.js b/scripts/generateBuildConfig.js new file mode 100644 index 0000000..bead752 --- /dev/null +++ b/scripts/generateBuildConfig.js @@ -0,0 +1,13 @@ +const fs = require('fs'); +const path = require('path'); + +const PATH = path.join(__dirname, '../src', 'popup', 'buildConfig.json'); + +const config = { + features: { + loginWithProtonEnabled: process.env.ENABLE_LOGIN_WITH_PROTON === 'true' + }, + buildTime: new Date().getTime() +}; + +fs.writeFileSync(PATH, JSON.stringify(config, null, 2)); \ No newline at end of file diff --git a/src/images/proton.svg b/src/images/proton.svg new file mode 100644 index 0000000..1236b3f --- /dev/null +++ b/src/images/proton.svg @@ -0,0 +1,19 @@ + diff --git a/src/popup/Utils.js b/src/popup/Utils.js index b4e2b94..f283dcc 100644 --- a/src/popup/Utils.js +++ b/src/popup/Utils.js @@ -1,4 +1,6 @@ const browser = require("webextension-polyfill"); +const buildConfig = require("./buildConfig.json"); + let toasted = null; class Utils { @@ -82,6 +84,10 @@ class Utils { static cloneObject(obj) { return JSON.parse(JSON.stringify(obj)); } + + static getBuildConfig() { + return buildConfig; + } } export default Utils; diff --git a/src/popup/buildConfig.json b/src/popup/buildConfig.json new file mode 100644 index 0000000..4516a4e --- /dev/null +++ b/src/popup/buildConfig.json @@ -0,0 +1,6 @@ +{ + "features": { + "loginWithProtonEnabled": false + }, + "buildTime": 1655462531232 +} \ No newline at end of file diff --git a/src/popup/components/Login.vue b/src/popup/components/Login.vue index a9e1f85..1656d5a 100644 --- a/src/popup/components/Login.vue +++ b/src/popup/components/Login.vue @@ -33,21 +33,35 @@ -