diff --git a/.github/actions/setup-for-build/action.yaml b/.github/actions/setup-for-build/action.yaml index 12fa874..a8a1b50 100644 --- a/.github/actions/setup-for-build/action.yaml +++ b/.github/actions/setup-for-build/action.yaml @@ -14,12 +14,14 @@ runs: - name: Determine Version uses: gittools/actions/gitversion/execute@v0 id: version + with: + useConfigFile: true - name: Use the version shell: bash run: | - echo SZ_VERSION="${{ steps.version.outputs.AssemblySemFileVer }}" >> $GITHUB_ENV - echo SZ_VERSION_NAME="${{ steps.version.outputs.InformationalVersion }}" >> $GITHUB_ENV + echo VITE_SZ_VERSION="${{ steps.version.outputs.AssemblySemFileVer }}" >> $GITHUB_ENV + echo VITE_SZ_VERSION_INFO="${{ steps.version.outputs.InformationalVersion }}" >> $GITHUB_ENV - uses: pnpm/action-setup@v2 name: Install pnpm diff --git a/src/composables/useStorageLocal.ts b/src/composables/useStorageLocal.ts index 5706dc9..b972ce0 100644 --- a/src/composables/useStorageLocal.ts +++ b/src/composables/useStorageLocal.ts @@ -8,15 +8,11 @@ const storageLocal: StorageLikeAsync = { }, setItem(key: string, value: string) { - console.log("setItem"); - console.dir(value); return storage.local.set({ [key]: value }); }, async getItem(key: string) { - console.log("getItem"); const item = (await storage.local.get(key))[key]; - console.dir(item); return item; }, }; diff --git a/src/manifest.ts b/src/manifest.ts index 4b7f74a..a768a9f 100644 --- a/src/manifest.ts +++ b/src/manifest.ts @@ -11,7 +11,7 @@ export async function getManifest() { const manifest: Manifest.WebExtensionManifest = { name: pkg.displayName, description: pkg.description, - version: process.env.SZ_VERSION || pkg.version, + version: process.env.VITE_SZ_VERSION || pkg.version, manifest_version: 2, icons: { 16: "./assets/icon-128.png", @@ -38,13 +38,16 @@ export async function getManifest() { js: ["./dist/contentScripts/index.global.js"], }, ], - browser_specific_settings: { - gecko: { - id: "{13372607-2257-4360-8f51-5ce66fa73350}", - }, - }, }; + if (process.env.SZ_GECKO_ID) { + manifest.browser_specific_settings = { + gecko: { + id: process.env.SZ_GECKO_ID, + }, + }; + } + if (isDev) { // for content script, as browsers will cache them for each reload, // we use a background script to always inject the latest version diff --git a/src/options/App.vue b/src/options/App.vue index e1172ba..67f7ae7 100644 --- a/src/options/App.vue +++ b/src/options/App.vue @@ -5,8 +5,11 @@ import { SzuruSiteConfig } from "~/config"; import { cfg } from "~/stores"; import { getErrorMessage } from "~/utils"; -let statusText = ref("Version " + browser.runtime.getManifest().version); -let statusType = ref("status-quiet"); +const statusText = ref("Version " + browser.runtime.getManifest().version); +const statusType = ref("status-quiet"); +const versionInfo = import.meta.env.VITE_SZ_VERSION_INFO ?? "info not available"; + +console.log("Version: " + versionInfo); const selectedSite = computed(() => { if (cfg.value.selectedSiteId) {