mirror of
https://github.com/jackwener/OpenCLI.git
synced 2026-09-14 18:25:42 +08:00
51bc48ec61
* feat: decouple extension version from CLI version Extension and CLI had tightly coupled version numbers (both 1.7.2), requiring manual sync across 3 files on every release. This decouples them so each can release independently. Changes: - Extension version reset to 1.0.0 with independent versioning - Extension sends compatRange (e.g. ">=1.7.0") in hello message so doctor can check CLI/extension compatibility - Daemon stores and exposes extensionCompatRange via /status - Doctor uses compatRange for compatibility checks (falls back to major-version check for older extensions without compatRange) - Doctor shows extension update availability from cached GitHub Releases data - release.yml always builds and attaches extension zip to every CLI release, so users always find both in the same release page - build-extension.yml triggers on ext-v* tags (not v*) to avoid duplicate builds * fix: version extension release assets
26 lines
636 B
TypeScript
26 lines
636 B
TypeScript
import { defineConfig } from 'vite';
|
|
import { resolve } from 'path';
|
|
import { readFileSync } from 'fs';
|
|
|
|
const pkg = JSON.parse(readFileSync(resolve(__dirname, 'package.json'), 'utf-8'));
|
|
const compatRange: string = pkg.opencli?.compatRange ?? '>=0.0.0';
|
|
|
|
export default defineConfig({
|
|
define: {
|
|
__OPENCLI_COMPAT_RANGE__: JSON.stringify(compatRange),
|
|
},
|
|
build: {
|
|
outDir: 'dist',
|
|
emptyOutDir: true,
|
|
rollupOptions: {
|
|
input: resolve(__dirname, 'src/background.ts'),
|
|
output: {
|
|
entryFileNames: 'background.js',
|
|
format: 'es',
|
|
},
|
|
},
|
|
target: 'esnext',
|
|
minify: false,
|
|
},
|
|
});
|