Bundle component styles into the BGS viewer script

This commit is contained in:
coyotte508 2026-10-10 16:07:47 +02:00
commit 9febf0a2cd
4 changed files with 16 additions and 4 deletions

View file

@ -91,3 +91,6 @@ Viewer 0.1.45 uses the printed English Monumental Edition names for Objectives,
Viewer 0.1.46 and engine 0.4.51 add an Effects indicator with a count and a rules dialog for active public effects, including Trojan Horse, Great Diplomat agreements, Negotiations and public wonders. Scopes distinguish shared effects, affected players and the current player's temporary action effects. Great Seer assignments remain private. Public-wonder draw choices display the wonder's effect, construction cost, required advance and points; Great Mausoleum discard previews include event rules and both uses of action cards. Trojan Horse now requires another human player's defended city, as stated on printed E42, and is no longer offered against barbarians. Existing saved activation prompts remain valid: decline an already-pending barbarian activation to continue without paying. Publish the matching viewer and engine together; historical battle outcomes are preserved. Cultural influence warns before rolling when another eligible city has a lower range cost, offers a source switch with the culture saving, and requires an explicit second click to retain the more expensive source. Automatic movement-group selection and switching seats during movement now select the whole compatible group instead of only its first unit.
Viewer 0.1.47 and engine 0.4.52 label active effects with their source event or action card. Source names use the same quiet link style as advance references and open the full source rules without changing the game. Event sources include their printed E number; action-card sources use the played copy from public history, ignoring undone actions. Older effects without a recoverable copy show the common action rules without inventing a battle use. Each effect has its own padded block with spacing between blocks. Saved effect data and game outcomes are unchanged.
# Viewer 0.1.48
Component styles are bundled into the viewer script because BGS does not load a separate stylesheet. This restores active-effect spacing and source-label layout, as well as the cultural-influence warning styles, in the published game.

View file

@ -1,12 +1,12 @@
{
"name": "@boardgamers/clash-web-client",
"version": "0.1.47",
"version": "0.1.48",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@boardgamers/clash-web-client",
"version": "0.1.47",
"version": "0.1.48",
"dependencies": {
"@boardgamers/protocol": "0.9.0",
"lucide-svelte": "^0.577.0",

View file

@ -1,6 +1,6 @@
{
"name": "@boardgamers/clash-web-client",
"version": "0.1.47",
"version": "0.1.48",
"private": true,
"type": "module",
"scripts": {

View file

@ -6,6 +6,14 @@ export default defineConfig({
base: './',
publicDir: false,
plugins: [
{
name: 'viewer-styles-in-script',
generateBundle(_, bundle) {
if (Object.values(bundle).some((file) => file.fileName.endsWith('.css'))) {
this.error('BGS only loads viewer.js; bundle all styles into the viewer script.');
}
},
},
{
name: 'localization-font-licenses',
generateBundle() {
@ -35,7 +43,8 @@ export default defineConfig({
);
},
},
svelte(),
// BGS loads the viewer script alone, so component styles must travel with it.
svelte({ emitCss: false }),
previewApi(),
],
build: {