2026-10-20 11:20:55 +00:00
|
|
|
// Mounts the crash-safe file storage for share links and accounts.
|
|
|
|
|
import { join, resolve } from 'node:path'
|
|
|
|
|
|
|
|
|
|
export default defineNitroPlugin(() => {
|
|
|
|
|
const root = resolve(process.cwd(), 'data')
|
|
|
|
|
const storage = useStorage()
|
A campaign with unlocks, synthesised sound, puzzles and the puzzle of the week
- Campaign projects start with NAND only; challenges open along a
dependency chain, each solution becomes a usable part, and basic parts
unlock on the way. Locked parts and challenges say what opens them.
- Sound effects made with Web Audio: place, connect, switches, buttons,
delete, clock ticks (opt-in), solve, fail, unlock, record. Mute and
volume in the top bar and Display settings.
- Publish any circuit as a puzzle link; only its behaviour is shared.
The server re-runs the checks on submitted solutions, counts their
transistors and keeps each player's best; the board shows a histogram
and your place. A generated puzzle of the week for everyone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 17:54:57 +00:00
|
|
|
for (const name of ['shares', 'users', 'sessions', 'accounts', 'puzzles']) {
|
2026-10-20 11:20:55 +00:00
|
|
|
storage.mount(name, safeFsDriver({ base: join(root, name) }))
|
|
|
|
|
}
|
|
|
|
|
void removeStaleTemp(root)
|
|
|
|
|
})
|