mirror of
https://github.com/lobehub/lobehub.git
synced 2026-03-26 13:19:34 +07:00
* v2 init * chore: update eslint suppressions and package dependencies - Removed several eslint suppressions related to array sorting and reversing from eslint-suppressions.json to clean up the configuration. - Updated @lobehub/lint package version from 2.0.0-beta.6 to 2.0.0-beta.7 in package.json for improvements and bug fixes. - Made minor formatting adjustments in vitest.config.mts and various SKILL.md files for better readability and consistency. Signed-off-by: Innei <tukon479@gmail.com> * fix: clean up import statements and formatting - Removed unnecessary whitespace in replaceComponentImports.ts for improved readability. - Standardized import statements in contextEngineering.ts and createAgentExecutors.ts by adding missing spaces for consistency. Signed-off-by: Innei <tukon479@gmail.com> * chore: update eslint suppressions and clean up code formatting * 🐛 fix: use vi.hoisted for mock variable initialization Fix TDZ error in persona service test by using vi.hoisted() to ensure mock variables are available when vi.mock factory runs. --------- Signed-off-by: Innei <tukon479@gmail.com>
52 lines
1.4 KiB
TypeScript
52 lines
1.4 KiB
TypeScript
import { execSync } from 'node:child_process';
|
|
import os from 'node:os';
|
|
|
|
/**
|
|
* Build desktop application based on current operating system platform
|
|
*/
|
|
const buildElectron = () => {
|
|
const platform = os.platform();
|
|
const startTime = Date.now();
|
|
|
|
console.log(`🔨 Starting to build desktop app for ${platform} platform...`);
|
|
|
|
try {
|
|
let buildCommand = '';
|
|
|
|
// Determine build command based on platform
|
|
switch (platform) {
|
|
case 'darwin': {
|
|
buildCommand = 'npm run package:mac --prefix=./apps/desktop';
|
|
console.log('📦 Building macOS desktop application...');
|
|
break;
|
|
}
|
|
case 'win32': {
|
|
buildCommand = 'npm run package:win --prefix=./apps/desktop';
|
|
console.log('📦 Building Windows desktop application...');
|
|
break;
|
|
}
|
|
case 'linux': {
|
|
buildCommand = 'npm run package:linux --prefix=./apps/desktop';
|
|
console.log('📦 Building Linux desktop application...');
|
|
break;
|
|
}
|
|
default: {
|
|
throw new Error(`Unsupported platform: ${platform}`);
|
|
}
|
|
}
|
|
|
|
// Execute build command
|
|
execSync(buildCommand, { stdio: 'inherit' });
|
|
|
|
const endTime = Date.now();
|
|
const buildTime = ((endTime - startTime) / 1000).toFixed(2);
|
|
console.log(`✅ Desktop application build completed! (${buildTime}s)`);
|
|
} catch (error) {
|
|
console.error('❌ Build failed:', error);
|
|
process.exit(1);
|
|
}
|
|
};
|
|
|
|
// Execute build
|
|
buildElectron();
|