From eabc10454ca0e5142f608e761e88c6faaaff187c Mon Sep 17 00:00:00 2001 From: Jeremy-Z Date: Wed, 10 Jun 2026 14:57:52 -0400 Subject: [PATCH 1/6] Added initial code to display a build version string on the index.html page. --- public/index.html | 3 ++- vue.config.js | 38 +++++++++++++++++++++++++++++++++++--- 2 files changed, 37 insertions(+), 4 deletions(-) diff --git a/public/index.html b/public/index.html index 5e2434b9..bd345695 100644 --- a/public/index.html +++ b/public/index.html @@ -46,6 +46,7 @@
+ + - \ No newline at end of file diff --git a/vue.config.js b/vue.config.js index d9d97c60..07ff90bd 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,3 +1,30 @@ +const { execSync } = require('child_process'); +const pkg = require('./package.json'); + +function safeExec(cmd, fallback = 'unknown') { + try { + return execSync(cmd).toString().trim(); + } catch { + return fallback; + } +} + +const buildTime = new Date().toISOString(); +const buildTimeStamp = Math.floor(Date.now() / 1000); + +const gitInfo = { + commit: safeExec('git rev-parse --short HEAD', 'dev'), + branch: safeExec('git rev-parse --abbrev-ref HEAD', 'unknown') +}; + +const buildInfo = { + version: pkg.version, + buildTime: buildTime, + buildTimeStamp: buildTimeStamp, + ...gitInfo, + versionString: `${pkg.version}-${gitInfo.branch}-${gitInfo.commit}-${buildTimeStamp}` +}; + process.env.VUE_APP_CONSUMER_CF_DISTRO = 'https://digitalapi.dev.safelite.io'; process.env.VUE_APP_CURRENT_ENVIRONMENT = 'Localhost'; process.env.VUE_APP_CUSTOMER_PORTAL_URL = 'https://myaccountdev.safelite.com/'; @@ -32,7 +59,12 @@ module.exports = { } } }, - configureWebpack: { - devtool: 'source-map' + configureWebpack: { + devtool: 'source-map', + plugins: [ + new (require('webpack')).DefinePlugin({ + __BUILD_INFO__: JSON.stringify(buildInfo) + }) + ] } -}; +}; \ No newline at end of file From cb811c804c698701dd584760a5a4fcdf7928b822 Mon Sep 17 00:00:00 2001 From: Jeremy-Z Date: Thu, 11 Jun 2026 11:09:49 -0400 Subject: [PATCH 2/6] Updates to build info. --- package.json | 2 +- public/index.html | 4 ++-- vue.config.js | 52 +++++++++++++++++++++++++---------------------- 3 files changed, 31 insertions(+), 27 deletions(-) diff --git a/package.json b/package.json index 04a0f3a4..2d57cec7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "digitalconsumer.iss", - "version": "0.1.0", + "version": "1.1.0", "private": true, "eslintConfig": { "env": { diff --git a/public/index.html b/public/index.html index bd345695..6fe17575 100644 --- a/public/index.html +++ b/public/index.html @@ -46,7 +46,7 @@
- - + + \ No newline at end of file diff --git a/vue.config.js b/vue.config.js index 07ff90bd..bd31d343 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,30 +1,6 @@ const { execSync } = require('child_process'); const pkg = require('./package.json'); -function safeExec(cmd, fallback = 'unknown') { - try { - return execSync(cmd).toString().trim(); - } catch { - return fallback; - } -} - -const buildTime = new Date().toISOString(); -const buildTimeStamp = Math.floor(Date.now() / 1000); - -const gitInfo = { - commit: safeExec('git rev-parse --short HEAD', 'dev'), - branch: safeExec('git rev-parse --abbrev-ref HEAD', 'unknown') -}; - -const buildInfo = { - version: pkg.version, - buildTime: buildTime, - buildTimeStamp: buildTimeStamp, - ...gitInfo, - versionString: `${pkg.version}-${gitInfo.branch}-${gitInfo.commit}-${buildTimeStamp}` -}; - process.env.VUE_APP_CONSUMER_CF_DISTRO = 'https://digitalapi.dev.safelite.io'; process.env.VUE_APP_CURRENT_ENVIRONMENT = 'Localhost'; process.env.VUE_APP_CUSTOMER_PORTAL_URL = 'https://myaccountdev.safelite.com/'; @@ -42,6 +18,34 @@ process.env.VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC = process.env.VUE_APP_GOOGLE_MAPS_API_SCRIPT = "(g=>{var h,a,k,p='The Google Maps JavaScript API',c='google',l='importLibrary',q='__ib__',m=document,b=window;b=b[c]||(b[c]={});var d=b.maps||(b.maps={}),r=new Set,e=new URLSearchParams,u=()=>h||(h=new Promise(async(f,n)=>{await (a=m.createElement('script'));e.set('libraries',[...r]+'');for(k in g)e.set(k.replace(/[A-Z]/g,t=>'_'+t[0].toLowerCase()),g[k]);e.set('callback',c+'.maps.'+q);a.src=`https://maps.googleapis.com/maps/api/js?`+e;d[q]=f;a.onerror=()=>h=n(Error(p+' could not load.'));a.nonce=m.querySelector('script[nonce]')?.nonce||'';m.head.append(a)}));d[l]?console.warn(p+' only loads once. Ignoring:',g):d[l]=(f,...n)=>r.add(f)&&u().then(()=>d[l](f,...n))})({key: 'AIzaSyCuLhQcDdZTTb4JzpUFms1OCch2dk5lHF0', v: 'weekly'});"; +function safeExec(cmd, fallback = 'unknown') { + try { + return execSync(cmd).toString().trim(); + } catch { + return fallback; + } +} + +const gitInfo = { + commit: safeExec('git rev-parse --short HEAD', 'dev'), + branch: safeExec('git rev-parse --abbrev-ref HEAD', 'unknown') +}; + +const buildTimes = { + buildTime: new Date().toISOString(), + buildTimeLocal: new Date().toLocaleString(), + buildTimeStamp: Math.floor(Date.now() / 1000) +} + +const buildInfo = { + version: pkg.version, + buildTime: buildTimes.buildTime, + buildTimeLocal: buildTimes.buildTimeLocal, + buildTimeStamp: buildTimes.buildTimeStamp, + ...gitInfo, + versionString: `${pkg.version}-${gitInfo.commit}-${buildTimes.buildTimeStamp}-${gitInfo.branch}` +}; + module.exports = { publicPath: '/', css: { From cb76253882273161bb783f1f73c3026bb08dca99 Mon Sep 17 00:00:00 2001 From: Jeremy-Z Date: Thu, 11 Jun 2026 11:50:11 -0400 Subject: [PATCH 3/6] Updates for build info. Added it to the error logger. --- src/helpers/logger.js | 2 ++ src/store/index.js | 3 +++ vue.config.js | 3 +++ 3 files changed, 8 insertions(+) diff --git a/src/helpers/logger.js b/src/helpers/logger.js index e583f7c1..b07013f9 100644 --- a/src/helpers/logger.js +++ b/src/helpers/logger.js @@ -51,6 +51,8 @@ export class Logger { return [ `Application: ${applicationConfig.APPLICATION_NAME}`, + `Build Version: ${store.issConfig?.buildInfo?.versionString}`, + `Build Time: ${store.issConfig?.buildInfo?.buildTimeLocal}`, `ClientTag: ${store.issConfig?.clientTag}`, `ParentAccountNumber: ${store.issConfig?.parentAccountNumber}`, `ClientName: ${store.issConfig?.clientName}`, diff --git a/src/store/index.js b/src/store/index.js index 0dbf8c29..5be85c4b 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -269,6 +269,7 @@ export const getDefaultState = () => ({ policyZipCode: null, dateOfLoss: null }, + buildInfo: (typeof __BUILD_INFO__ !== 'undefined') ? __BUILD_INFO__ : null, // Contains the build info for the website, set during the build process. Version, Time, Git info etc.... siteType: null, // SiteType / SubType the site is set to (Essential/Advanced). enableNoCompQuote: false } @@ -2258,6 +2259,8 @@ export const useMainStore = defineStore({ this.issConfig.siteType = null; this.issConfig.enableNoCompQuote = false; this.issConfig.billToAccountNumber = null; + + // NOTE: Do not wipe out build info. }, disableKeyFields() { diff --git a/vue.config.js b/vue.config.js index bd31d343..41fd8c5d 100644 --- a/vue.config.js +++ b/vue.config.js @@ -46,6 +46,9 @@ const buildInfo = { versionString: `${pkg.version}-${gitInfo.commit}-${buildTimes.buildTimeStamp}-${gitInfo.branch}` }; +// This will be replaced by the actual build info during the build process via webpack.DefinePlugin in this config file. +__BUILD_INFO__ = buildInfo; + module.exports = { publicPath: '/', css: { From 0e0e1305f046a77f6530a7d2313cc6370d479f55 Mon Sep 17 00:00:00 2001 From: Jeremy-Z Date: Thu, 11 Jun 2026 12:02:30 -0400 Subject: [PATCH 4/6] Updates. --- vue.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vue.config.js b/vue.config.js index 41fd8c5d..4d556775 100644 --- a/vue.config.js +++ b/vue.config.js @@ -74,4 +74,4 @@ module.exports = { }) ] } -}; \ No newline at end of file +}; From 4415a21e9c720f63d6b677b71fae87eee4ed12b2 Mon Sep 17 00:00:00 2001 From: Jeremy-Z Date: Thu, 11 Jun 2026 12:11:10 -0400 Subject: [PATCH 5/6] Adding updates for release vue config file. --- vue.release.config.js | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/vue.release.config.js b/vue.release.config.js index 43abce0e..18cc1771 100644 --- a/vue.release.config.js +++ b/vue.release.config.js @@ -1,3 +1,6 @@ +const { execSync } = require('child_process'); +const pkg = require('./package.json'); + process.env.VUE_APP_CONSUMER_CF_DISTRO = "__VUE_APP_CONSUMER_CF_DISTRO__"; process.env.VUE_APP_CURRENT_ENVIRONMENT = "__VUE_APP_CURRENT_ENVIRONMENT__"; process.env.VUE_APP_CUSTOMER_PORTAL_URL = '__VUE_APP_CUSTOMER_PORTAL_URL__'; @@ -11,6 +14,37 @@ process.env.VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY = "__VUE_APP_GOOGLE_TAG_MANAG process.env.VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC = "__VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__" process.env.VUE_APP_GOOGLE_MAPS_API_SCRIPT = "__VUE_APP_GOOGLE_MAPS_API_SCRIPT__"; +function safeExec(cmd, fallback = 'unknown') { + try { + return execSync(cmd).toString().trim(); + } catch { + return fallback; + } +} + +const gitInfo = { + commit: safeExec('git rev-parse --short HEAD', 'dev'), + branch: safeExec('git rev-parse --abbrev-ref HEAD', 'unknown') +}; + +const buildTimes = { + buildTime: new Date().toISOString(), + buildTimeLocal: new Date().toLocaleString(), + buildTimeStamp: Math.floor(Date.now() / 1000) +} + +const buildInfo = { + version: pkg.version, + buildTime: buildTimes.buildTime, + buildTimeLocal: buildTimes.buildTimeLocal, + buildTimeStamp: buildTimes.buildTimeStamp, + ...gitInfo, + versionString: `${pkg.version}-${gitInfo.commit}-${buildTimes.buildTimeStamp}-${gitInfo.branch}` +}; + +// This will be replaced by the actual build info during the build process via webpack.DefinePlugin in this config file. +__BUILD_INFO__ = buildInfo; + module.exports = { publicPath: "/", css: { @@ -29,6 +63,11 @@ module.exports = { }, }, configureWebpack: { - devtool: 'source-map' + devtool: 'source-map', + plugins: [ + new (require('webpack')).DefinePlugin({ + __BUILD_INFO__: JSON.stringify(buildInfo) + }) + ] }, }; From ed188f329108acafb645fb7a5f2239bc86a22b71 Mon Sep 17 00:00:00 2001 From: Jeremy-Z Date: Thu, 11 Jun 2026 12:30:43 -0400 Subject: [PATCH 6/6] Changed build info to be in JS instead of comments so it is not stripped during release build. --- public/index.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/index.html b/public/index.html index 6fe17575..c344f758 100644 --- a/public/index.html +++ b/public/index.html @@ -4,6 +4,9 @@