fix(ext): inject versions
This commit is contained in:
@@ -7,9 +7,8 @@ import { DEMO_API_KEY, DEMO_BASE_URL, DEMO_MODEL } from '@/agent/constants'
|
|||||||
import { Button } from '@/components/ui/button'
|
import { Button } from '@/components/ui/button'
|
||||||
import { Input } from '@/components/ui/input'
|
import { Input } from '@/components/ui/input'
|
||||||
|
|
||||||
import extPkg from '../../../../package.json'
|
declare const __EXT_VERSION__: string
|
||||||
|
declare const __CORE_VERSION__: string
|
||||||
const CORE_VERSION = extPkg.dependencies['@page-agent/core']
|
|
||||||
|
|
||||||
interface ConfigPanelProps {
|
interface ConfigPanelProps {
|
||||||
config: LLMConfig | null
|
config: LLMConfig | null
|
||||||
@@ -220,10 +219,10 @@ export function ConfigPanel({ config, onSave, onClose }: ConfigPanelProps) {
|
|||||||
|
|
||||||
<div className="flex flex-col items-end">
|
<div className="flex flex-col items-end">
|
||||||
<span>
|
<span>
|
||||||
Extension <span className="font-mono">v{extPkg.version}</span>
|
Extension <span className="font-mono">v{__EXT_VERSION__}</span>
|
||||||
</span>
|
</span>
|
||||||
<span>
|
<span>
|
||||||
PageAgent <span className="font-mono">v{CORE_VERSION}</span>
|
PageAgent <span className="font-mono">v{__CORE_VERSION__}</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
import tailwindcss from '@tailwindcss/vite'
|
import tailwindcss from '@tailwindcss/vite'
|
||||||
import { mkdirSync } from 'node:fs'
|
import { mkdirSync, readFileSync } from 'node:fs'
|
||||||
import { defineConfig } from 'wxt'
|
import { defineConfig } from 'wxt'
|
||||||
|
|
||||||
const chromeProfile = '.wxt/chrome-data'
|
const chromeProfile = '.wxt/chrome-data'
|
||||||
mkdirSync(chromeProfile, { recursive: true })
|
mkdirSync(chromeProfile, { recursive: true })
|
||||||
|
|
||||||
|
const pkg = JSON.parse(readFileSync('./package.json', 'utf-8'))
|
||||||
|
|
||||||
// See https://wxt.dev/api/config.html
|
// See https://wxt.dev/api/config.html
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
srcDir: 'src',
|
srcDir: 'src',
|
||||||
@@ -16,6 +18,10 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
vite: () => ({
|
vite: () => ({
|
||||||
plugins: [tailwindcss()],
|
plugins: [tailwindcss()],
|
||||||
|
define: {
|
||||||
|
__EXT_VERSION__: JSON.stringify(pkg.version),
|
||||||
|
__CORE_VERSION__: JSON.stringify(pkg.dependencies['@page-agent/core']),
|
||||||
|
},
|
||||||
optimizeDeps: {
|
optimizeDeps: {
|
||||||
force: true,
|
force: true,
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user