Release notes v0.0.84

This release contains some small fixes and features compared to the previous release. We also enabled tests and benchmarks in CI for the newly released Node.js 15!

Code gen

In preparation for structure stability we do loose validation of the structure to generate for. This enables us to add new fields in releases without breaking the generators of previous releases.

A small feature added to the route builder is support for 'PATCH' requests. Lbu still prefers to use 'PUT' by convention, but this allows a wider range of OpenAPI specs to be imported.

We also have a few fixes for the previous release. The structure is now correctly dumped. In lbu 0.0.83 we didn't nest groups in the structure export from structure.js. And sql in and notIn in the generated were clause should use the correct sql types now, even when the field is an reference.

Lastly support is added for app.addRelations(reference, ...relations). LBU requires that both sides of a relation are registered, but that wasn't possible without a hack:

import { storeStructure } from "./generated/index.js";
import { App, TypeCreator } from "@lbu/code-gen";

const app = await App.new();
const T = new TypeCreator();

app.add(
  T.object("myEntity")
    .keys({})
    .relations(T.manyToOne("file", T.reference("store", "file"), "entities")),
);

storeStructure.store.file.relations.push(
  T.oneToMany("entities", T.reference("app", "myEntity")),
);

While the new variant looks a bit cleaner:

import { App, TypeCreator } from "@lbu/code-gen";

const app = await App.new();
const T = new TypeCreator();

app.add(
  T.object("myEntity")
    .keys({})
    .relations(T.manyToOne("file", T.reference("store", "file"), "entities")),
);

const result = app.addRelations(
  T.reference("store", "file"),
  T.oneToMany("entities", T.reference("app", "myEntity")),
);

if (result.error) {
  throw result.error;
}

Server

We don't log the event call stack anymore for 'OPTIONS' requests. This is done to keep the logs a bit cleaner.

In closing

That's all for now. Have fun!