chore: remove redundant features
- Remove getPackageJson and getGitInfo from vite config - Remove Updates tab and all related logic as there was no true update logic in the codebase
This commit is contained in:
@@ -5,72 +5,9 @@ import { nodePolyfills } from 'vite-plugin-node-polyfills';
|
||||
import { optimizeCssModules } from 'vite-plugin-optimize-css-modules';
|
||||
import tsconfigPaths from 'vite-tsconfig-paths';
|
||||
import * as dotenv from 'dotenv';
|
||||
import { execSync } from 'child_process';
|
||||
import { readFileSync } from 'fs';
|
||||
import { join } from 'path';
|
||||
|
||||
dotenv.config();
|
||||
|
||||
// Get detailed git info with fallbacks
|
||||
const getGitInfo = () => {
|
||||
try {
|
||||
return {
|
||||
commitHash: execSync('git rev-parse --short HEAD').toString().trim(),
|
||||
branch: execSync('git rev-parse --abbrev-ref HEAD').toString().trim(),
|
||||
commitTime: execSync('git log -1 --format=%cd').toString().trim(),
|
||||
author: execSync('git log -1 --format=%an').toString().trim(),
|
||||
email: execSync('git log -1 --format=%ae').toString().trim(),
|
||||
remoteUrl: execSync('git config --get remote.origin.url').toString().trim(),
|
||||
repoName: execSync('git config --get remote.origin.url')
|
||||
.toString()
|
||||
.trim()
|
||||
.replace(/^.*github.com[:/]/, '')
|
||||
.replace(/\.git$/, ''),
|
||||
};
|
||||
} catch {
|
||||
return {
|
||||
commitHash: 'no-git-info',
|
||||
branch: 'unknown',
|
||||
commitTime: 'unknown',
|
||||
author: 'unknown',
|
||||
email: 'unknown',
|
||||
remoteUrl: 'unknown',
|
||||
repoName: 'unknown',
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
// Read package.json with detailed dependency info
|
||||
const getPackageJson = () => {
|
||||
try {
|
||||
const pkgPath = join(process.cwd(), 'package.json');
|
||||
const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
|
||||
|
||||
return {
|
||||
name: pkg.name,
|
||||
description: pkg.description,
|
||||
license: pkg.license,
|
||||
dependencies: pkg.dependencies || {},
|
||||
devDependencies: pkg.devDependencies || {},
|
||||
peerDependencies: pkg.peerDependencies || {},
|
||||
optionalDependencies: pkg.optionalDependencies || {},
|
||||
};
|
||||
} catch {
|
||||
return {
|
||||
name: 'bolt.diy',
|
||||
description: 'A DIY LLM interface',
|
||||
license: 'MIT',
|
||||
dependencies: {},
|
||||
devDependencies: {},
|
||||
peerDependencies: {},
|
||||
optionalDependencies: {},
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
const pkg = getPackageJson();
|
||||
const gitInfo = getGitInfo();
|
||||
|
||||
export default defineConfig((config) => {
|
||||
return {
|
||||
define: {
|
||||
|
||||
Reference in New Issue
Block a user