Skip to content

Commit

Permalink
feat: display current version
Browse files Browse the repository at this point in the history
  • Loading branch information
kunish committed Sep 3, 2023
1 parent 0a8312d commit 1765ada
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "metacubexd",
"version": "1.58.0",
"description": "Clash-Meta Dashboard",
"description": "Clash.Meta Dashboard, The Official One, XD",
"license": "MIT",
"type": "module",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,11 @@ export const Header = () => {
</div>

<a
class="text-xl font-bold normal-case"
class="whitespace-nowrap text-xl font-bold uppercase"
href="https://github.com/metacubex/metacubexd"
target="_blank"
>
metacubexd
metacube, xd
</a>
</div>

Expand Down
2 changes: 2 additions & 0 deletions src/pages/Config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,8 @@ export default () => {
<DNSQueryForm />
<ConfigForm />
<ConfigForXd />

{import.meta.env.version}
</div>
)
}
File renamed without changes.
7 changes: 7 additions & 0 deletions src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
interface ImportMetaEnv {
readonly version: string
}

interface ImportMeta {
readonly env: ImportMetaEnv
}
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "node",
"resolveJsonModule": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"jsx": "preserve",
Expand Down
4 changes: 4 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import { defineConfig, splitVendorChunkPlugin } from 'vite'
import { VitePWA } from 'vite-plugin-pwa'
import solidPlugin from 'vite-plugin-solid'
import pkgJSON from './package.json'

export default defineConfig({
base: './',
build: { chunkSizeWarningLimit: 1000 },
resolve: { alias: { '~': '/src' } },
define: {
'import.meta.env.version': JSON.stringify(pkgJSON.version),
},
plugins: [
solidPlugin(),
splitVendorChunkPlugin(),
Expand Down

0 comments on commit 1765ada

Please sign in to comment.