ide на основе vs code
Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import path from 'path';
import { spawn } from 'child_process';
import { promises as fs } from 'fs';
const npm = process.platform === 'win32' ? 'npm.cmd' : 'npm';
const rootDir = path.resolve(import.meta.dirname, '..', '..');
function runProcess(command: string, args: ReadonlyArray<string> = [], shell = process.platform === 'win32') {
return new Promise<void>((resolve, reject) => {
const child = spawn(command, args, { cwd: rootDir, stdio: 'inherit', env: process.env, shell });
child.on('exit', err => !err ? resolve() : process.exit(err ?? 1));
child.on('error', reject);
});
}
async function exists(subdir: string) {
try {
await fs.stat(path.join(rootDir, subdir));
return true;
} catch {
return false;
}
}
async function ensureNodeModules() {
if (!(await exists('node_modules'))) {
await runProcess(npm, ['ci']);
}
}
async function getElectron() {
// `npm run electron` deletes and re-downloads `.build/electron` on every
// invocation. When preLaunch runs repeatedly (e.g. once per integration test
// section) this is both wasteful and a source of flaky failures on Windows,
// where the just-exited Electron process can still hold file locks while the
// directory is being removed and re-extracted. Skip the refresh when the
// already-present Electron matches the expected version; any detection
// failure falls back to a (re)download to preserve the previous behavior.
if (!process.env['VSCODE_FORCE_PRELAUNCH'] && await isExpectedElectronInstalled()) {
return;
}
await runProcess(npm, ['run', 'electron']);
}
async function isExpectedElectronInstalled(): Promise<boolean> {
try {
const { getElectronVersion } = await import('./electronVersion.ts');
const { electronVersion } = getElectronVersion();
const installedVersion = (await fs.readFile(path.join(rootDir, '.build', 'electron', 'version'), 'utf8')).trim().replace(/^v/, '');
return installedVersion === electronVersion;
} catch {
return false;
}
}
async function ensureCompiled() {
// Aura: языковые пакеты требуют NLS-индексы и в обычных dev-файлах.
if (!(await exists('out/nls.keys.json')) || !(await exists('out/nls.messages.json'))) {
await runProcess(process.execPath, ['build/next/index.ts', 'transpile', '--nls', '--out', 'out'], false);
}
}
async function main() {
await ensureNodeModules();
await getElectron();
await ensureCompiled();
// Can't require this until after dependencies are installed
const { getBuiltInExtensions } = await import('./builtInExtensions.ts');
await getBuiltInExtensions();
}
if (import.meta.main) {
main().catch(err => {
console.error(err);
process.exit(1);
});
}