File size: 2,262 Bytes
d739b1b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | import fs from 'node:fs';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import {OCEAN_OPENWORK_CSS} from '../packages/core/src/bong/ocean-openwork-theme';
import {createOceanComponents,createOceanConversationModel,createOceanConversation,OCEAN_COMPONENTS_CSS} from '../packages/core/src/bong/ocean-components';
import { OCEAN_THEME_CSS } from '../packages/core/src/bong/ocean-theme';
import { BongAppShell } from '../packages/core/src/bong/app-shell.js';
const rootDir = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
const appShell = new BongAppShell();
let html: string;
// ์ค๋ช
๋ฌธ์: /docs/specs/bada-bong-appearance.md (v0.1.0)
// HTML ์์ฑ์ด ์คํจํด๋ ์ฑ ์
ธ์ด ์์ ํ ์์งยท๋ฆฌ์ค๋๋ฅผ ๋จ๊ธฐ์ง ์๋๋ค.
try {
html = appShell.generateStandaloneHtml({
title: '๋ด(Bong) - ๊ฐ์ฑ ์ธํฐ๋์
& ๋ก๋ด ๋๋ฐ์',
forceGenesisWizard: false,
// ์ค์นํ ๋ด์ BADA ๋ฐ์คํฌํฑ Gateway์ ์ฐ๊ฒฐํ๋ค. ๋ณ๋ ์น ์๋ฒ์ ๊ธฐ๋ณธ ํฌํธ์ ๊ตฌ๋ถํ๋ค.
wsGatewayUrl: 'ws://localhost:55070/bong/ws',
});
} finally {
appShell.dispose();
}
fs.writeFileSync(path.join(rootDir, 'ocean-ui.js'),[createOceanComponents,createOceanConversationModel,createOceanConversation].map(fn=>fn.toString()).join('\n')+'\nglobalThis.BadaOcean={createOceanComponents,createOceanConversationModel,createOceanConversation};\n','utf-8');
fs.writeFileSync(path.join(rootDir, 'ocean-components.css'),OCEAN_COMPONENTS_CSS.trimEnd()+'\n','utf-8');
fs.writeFileSync(path.join(rootDir,'src/openwork/web/bada-ocean-theme.css'),OCEAN_OPENWORK_CSS.trimEnd()+'\n','utf-8');
fs.writeFileSync(path.join(rootDir,'src/openwork/web/bada-ocean-components.css'),OCEAN_COMPONENTS_CSS.trimEnd()+'\n','utf-8');
fs.writeFileSync(path.join(rootDir, 'ocean-theme.css'), OCEAN_THEME_CSS + '\n', 'utf-8');
fs.writeFileSync(path.join(rootDir, 'artifacts/bong-app.html'), html, 'utf-8');
fs.writeFileSync(path.join(rootDir, 'apps/bong-app-project/app/src/main/assets/index.html'), html, 'utf-8');
fs.writeFileSync(path.join(rootDir, 'apps/bong-android/app/src/main/assets/index.html'), html, 'utf-8');
console.log('โ
HTML ์ํฐํฉํธ ๋ฐ ์๋๋ก์ด๋ Assets ๊ฐฑ์ ์๋ฃ (ํฌ๊ธฐ: ' + html.length + ' bytes)');
|