2026-11-07 17:34:12 +00:00
|
|
|
// Preview builds: set the background scene tier in dist/config.json (default 'low'); config.json
|
2026-11-07 20:25:02 +00:00
|
|
|
// in the repo stays 'off'. Previews are static directories with no SPA fallback, so they also switch
|
|
|
|
|
// to the hash router: a reload on /login/matrix.org would otherwise be an nginx 404. Usage: node scripts/preview-config.js [tier] [style]
|
2026-11-07 17:34:12 +00:00
|
|
|
import fs from 'fs';
|
|
|
|
|
import path from 'path';
|
|
|
|
|
import { fileURLToPath } from 'url';
|
|
|
|
|
|
|
|
|
|
const tier = process.argv[2] ?? 'low';
|
scene: terrain style, a baked Phacelle height map on a displaced grid lit by the baked sky
style 'terrain' (WebGL2, tier-gated, dynamic import): height map baked once on the
GPU into RGBA8 (promoted from the terrain-tier-spike), a displaced grid, the baked
gradient as sky, baked sun/ambient/haze. Sky from option, ?sky=, or the stars'
night notion. Cadence guard, pauses, context loss and compile failure follow the
ridge scene. preview-config.js takes an optional style argument.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 18:36:18 +00:00
|
|
|
const style = process.argv[3];
|
2026-11-07 17:34:12 +00:00
|
|
|
const file = path.join(path.dirname(fileURLToPath(import.meta.url)), '..', 'dist', 'config.json');
|
|
|
|
|
const config = JSON.parse(fs.readFileSync(file, 'utf8'));
|
2026-11-07 20:25:02 +00:00
|
|
|
config.hashRouter = { enabled: true, basename: '/' };
|
scene: terrain style, a baked Phacelle height map on a displaced grid lit by the baked sky
style 'terrain' (WebGL2, tier-gated, dynamic import): height map baked once on the
GPU into RGBA8 (promoted from the terrain-tier-spike), a displaced grid, the baked
gradient as sky, baked sun/ambient/haze. Sky from option, ?sky=, or the stars'
night notion. Cadence guard, pauses, context loss and compile failure follow the
ridge scene. preview-config.js takes an optional style argument.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 18:36:18 +00:00
|
|
|
config.backgroundScene = { ...config.backgroundScene, tier, ...(style ? { style } : {}) };
|
2026-11-07 17:34:12 +00:00
|
|
|
fs.writeFileSync(file, `${JSON.stringify(config, null, 2)}\n`);
|
scene: terrain style, a baked Phacelle height map on a displaced grid lit by the baked sky
style 'terrain' (WebGL2, tier-gated, dynamic import): height map baked once on the
GPU into RGBA8 (promoted from the terrain-tier-spike), a displaced grid, the baked
gradient as sky, baked sun/ambient/haze. Sky from option, ?sky=, or the stars'
night notion. Cadence guard, pauses, context loss and compile failure follow the
ridge scene. preview-config.js takes an optional style argument.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 18:36:18 +00:00
|
|
|
console.log(`${file}: backgroundScene.tier = ${tier}${style ? `, style = ${style}` : ''}`);
|