Download scripts/refresh_html.ts from VanyaJ/bada-terminal: direct link, hf CLI and curl.
- Browser
- Download file 2.26 kB
-
https://huggingface.co/VanyaJ/bada-terminal/resolve/main/scripts/refresh_html.ts
- Command line
-
hf download hf://VanyaJ/bada-terminal/scripts/refresh_html.ts
-
curl -L -o refresh_html.ts https://huggingface.co/VanyaJ/bada-terminal/resolve/main/scripts/refresh_html.ts
2.26 kB
| 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)'); | |