feat(workflow): example stats page with embedded Chart.js, inline form validation errors

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-24 01:59:27 +02:00
co-authored by Claude Sonnet 5.5
parent 16a0bb0de4
commit 00af65613d
36 changed files with 1274 additions and 138 deletions
+14 -11
View File
@@ -1,19 +1,22 @@
#include "App.hpp"
#include "gen/assets.hpp"
namespace molo::example::app {
namespace {
// Byte-identical reproducible bundle. Production bundles are generated by
// the asset embedder CLI (09-cli-ops.md); this hand-written copy proves the
// serving path with sorted names and no timestamps.
} // namespace
// The bundle is generated at build time from example/assets by the MoloApp
// embedder (see example/example.mk, target example-assets). Names are
// sorted and byte-identical across runs.
void load_embedded(Services& services) {
services.embedded["/app.css"] =
"/* embedded bundle */\nbody{font-family:sans-serif}\n";
services.embedded["/hello.txt"] = "hello from embedded assets\n";
const gen::EmbeddedFile* files = gen::bundle_files();
for (unsigned long i = 0; i < gen::bundle_count(); ++i) {
std::string body;
body.reserve(files[i].size);
for (unsigned long c = 0; c < files[i].chunk_count; ++c)
body.append(reinterpret_cast<const char*>(files[i].chunks[c].data),
files[i].chunks[c].size);
services.embedded["/" + std::string(files[i].path)] = std::move(body);
}
}
} // namespace molo::example::app