2026-05-22 19:07:10 +03:00
|
|
|
import path from 'node:path';
|
|
|
|
|
import { fileURLToPath } from 'node:url';
|
|
|
|
|
|
|
|
|
|
import { prepareDocs } from '../_shared/lib/prepare-docs';
|
|
|
|
|
import { run } from '../_shared/lib/run';
|
|
|
|
|
import { writeZipFromDirectory } from '../_shared/lib/zip';
|
|
|
|
|
import config from './project.config';
|
|
|
|
|
|
|
|
|
|
const projectDir = path.dirname(fileURLToPath(import.meta.url));
|
|
|
|
|
const rootDir = path.resolve(projectDir, '../..');
|
|
|
|
|
const docsDir = path.join(projectDir, config.docsDir);
|
|
|
|
|
|
|
|
|
|
await prepareDocs(projectDir, config);
|
|
|
|
|
run('npx', ['vitepress', 'build', docsDir], rootDir);
|
|
|
|
|
|
|
|
|
|
if (config.archive) {
|
|
|
|
|
const zipPath = path.join(rootDir, 'public', config.slug, `${config.slug}.zip`);
|
|
|
|
|
writeZipFromDirectory(path.join(docsDir, 'content'), zipPath, config.slug);
|
|
|
|
|
console.log(`Собран ${path.relative(rootDir, zipPath)}`);
|
|
|
|
|
}
|
2026-05-22 23:23:14 +03:00
|
|
|
|
|
|
|
|
await import('./scripts/build-skill');
|