File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -81,6 +81,10 @@ export const ActionsDropdown = () => {
8181 { t ( { en : 'Restore Defaults' , fr : 'Restaurer les paramètres par défaut' } ) }
8282 </ button >
8383 </ DropdownMenu . Item >
84+ < DropdownMenu . Separator />
85+ < DropdownMenu . Label className = "text-muted-foreground text-xs font-normal" >
86+ { t ( { en : 'ODC Version' , fr : 'Version ODC' } ) } { __APP_VERSION__ }
87+ </ DropdownMenu . Label >
8488 </ DropdownMenu . Content >
8589 </ DropdownMenu >
8690 < UserSettingsDialog isOpen = { showUserSettingsDialog } setIsOpen = { setShowUserSettingsDialog } />
Original file line number Diff line number Diff line change 1+ const __APP_VERSION__ : string ;
12const __GITHUB_REPO_URL__ : string ;
Original file line number Diff line number Diff line change 1+ import fs from 'fs' ;
12import path from 'path' ;
23
34import runtime from '@opendatacapture/vite-plugin-runtime' ;
45import tailwindcss from '@tailwindcss/vite' ;
56import react from '@vitejs/plugin-react-swc' ;
67import { defineConfig } from 'vite' ;
78
9+ // Read straight from the monorepo root rather than through `@opendatacapture/release-info`: that
10+ // package pulls in `@opendatacapture/schemas`, which ships raw TypeScript, and loading it here would
11+ // mean running this config under tsx as `apps/web` does.
12+ const { version } = JSON . parse ( fs . readFileSync ( path . resolve ( import . meta. dirname , '../../package.json' ) , 'utf-8' ) ) as {
13+ version : string ;
14+ } ;
15+
816export default defineConfig ( ( { mode } ) => ( {
917 build : {
1018 chunkSizeWarningLimit : 1000 ,
@@ -16,6 +24,7 @@ export default defineConfig(({ mode }) => ({
1624 target : 'es2022'
1725 } ,
1826 define : {
27+ __APP_VERSION__ : JSON . stringify ( version ) ,
1928 __GITHUB_REPO_URL__ : `'${ process . env . GITHUB_REPO_URL ?? '#' } '`
2029 } ,
2130 optimizeDeps : {
You can’t perform that action at this time.
0 commit comments