Docs / Changelog
Changelog
Release history for Hopak packages, with links to each upgrade guide.
Release notes for Hopak packages. Each section links to the relevant upgrade guide.
Current versions
| Package | Version | Notes |
|---|---|---|
@hopak/core | 0.5.0 | framework core |
@hopak/cli | 0.3.9 | CLI tool |
@hopak/auth | 0.1.9 | auth + OAuth |
@hopak/testing | 0.2.9 | in-process test server |
@hopak/common | 0.1.13 | shared primitives |
0.5.0 — db.sql, db.builder(), deprecated db.execute() (breaking)
- New primitive:
db.sql— tagged-template SQL for the ~5% of queries.model()doesn’t cover. Interpolations become driver-native placeholders (?/$N); values never reach the SQL text, so${attacker}is safe by construction. - Driver-native on every dialect: SQLite routes through
bun:sqlite.prepare().all(), Postgres throughpostgres.js sql.unsafe(), MySQL throughmysql2 pool.execute(). No Drizzle on the raw-SQL read path. db.raw()→db.builder(). Same return type (the dialect’s Drizzle client), clearer name. Breaking rename, mechanical search-and-replace.db.execute(sql, params?)is@deprecated— kept as a thin forwarder so existing migration files keep compiling. New code should usedb.sql. Removed in 0.6.0.MigrationContextgetsctx.sqlalongsidectx.execute(also deprecated).hopak migrate newscaffoldsctx.sqlby default.- Framework internals (
tracker.ts,introspect.ts) migrated off thedb.raw() as { all?, execute? }cast hack ontodb.sql.
0.4.9 — Prototype-pollution hygiene in deepMerge
deepMergein@hopak/commondrops__proto__,constructor, andprototypekeys from merged sources, so a JSON-parsed payload can no longer swap the result’s prototype chain. First regression tests for thecommonpackage.- Algorithm pinning on JWT verification in
@hopak/auth: the verifier no longer accepts a token signed with a different algorithm from the one configured — closes the algorithm-confusion attack. - Static-file handler re-uses a cached canonical root path (realpath) per handler instance; a symlink that resolves outside the public root still fails cleanly.
FileField.maxSize(n)now actually constrains the Valibot schema at validation time, not just at config-write time.
0.4.0 — Valibot, safer validation
- Validation runtime swapped from Zod to Valibot: ~10× smaller bundle, ~2–3× faster parse.
validate()andbuildModelSchema()keep the same API; model-driven validation is untouched.RouteSchemas.body | query | paramsare nowv.GenericSchemainstead ofz.ZodType.@hopak/coreno longer depends onzod.ZodFieldSchematype export renamed toFieldSchema.
0.3.0 — Migrations
- New
hopak migratesubcommands:init,new,up,down,status. hopak syncbecomes the dev-bootstrap path; it refuses to run onceapp/migrations/has files.hopak devskips boot-timedb.sync()when migrations exist — the runtime never alters the schema on its own.hopak syncnow prints a drift warning when models declare columns the live DB doesn’t have..index()on a field now actually createsCREATE INDEX IF NOT EXISTSduring sync (previously silently ignored).- New public API:
ctx.db.execute(sql, params?)for raw SQL.
0.2.0 — Scaffolded CRUD (breaking)
- CRUD endpoints move from runtime generation to CLI scaffolding via
hopak generate crud <model>. { crud: true }on models is removed; route files become real.tsyou can read and edit.- Dev HTTPS certs require
hopak generate cert— boot no longer invokesopensslbehind your back. @hopak/testingdropswithCrud: true; wire routes via the newcrud.*helpers or passrootDirfor end-to-end tests.- Removed unused model options:
owner,publicRead,auth,softDelete.
0.1.0 — Initial release
- Models, relations, query ergonomics, validation, serialization, typed errors.
- Runtime-generated CRUD via
{ crud: true }, runtime-generated dev certs forserver.https.enabled. - First pass at the CLI:
hopak new,hopak use,hopak sync,hopak check,hopak dev.