forked from stackblitz-labs/bolt.diy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: updated vite config to inject add version metadata into the…
… app on build (stackblitz-labs#841) * refactor: removes commit.json and used vite.config to load these variables * updated precommit hook * updated the pre start script * updated the workflows
- Loading branch information
1 parent
56edbc4
commit d8a277f
Showing
10 changed files
with
63 additions
and
79 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
declare const __COMMIT_HASH: string; | ||
declare const __APP_VERSION: string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,26 @@ | ||
const { commit } = require('./app/commit.json'); | ||
const { execSync } =require('child_process'); | ||
|
||
// Get git hash with fallback | ||
const getGitHash = () => { | ||
try { | ||
return execSync('git rev-parse --short HEAD').toString().trim(); | ||
} catch { | ||
return 'no-git-info'; | ||
} | ||
}; | ||
|
||
let commitJson = { | ||
hash: JSON.stringify(getGitHash()), | ||
version: JSON.stringify(process.env.npm_package_version), | ||
}; | ||
|
||
console.log(` | ||
★═══════════════════════════════════════★ | ||
B O L T . D I Y | ||
⚡️ Welcome ⚡️ | ||
★═══════════════════════════════════════★ | ||
`); | ||
console.log('📍 Current Commit Version:', commit); | ||
console.log(' Please wait until the URL appears here') | ||
console.log('★═══════════════════════════════════════★'); | ||
console.log('📍 Current Version Tag:', `v${commitJson.version}`); | ||
console.log('📍 Current Commit Version:', commitJson.hash); | ||
console.log(' Please wait until the URL appears here'); | ||
console.log('★═══════════════════════════════════════★'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters