16 Commits

Author SHA1 Message Date
Bob Farrell
5b285df07b Add new to view generator 2024-11-14 21:36:45 +00:00
Bob Farrell
4330cc93e9 Update JetQuery, improve migration CLI docstring 2024-11-14 08:31:38 +00:00
Bob Farrell
6f8de03f07 WIP 2024-11-09 17:13:32 +00:00
Bob Farrell
43cd55c5aa WIP 2024-11-09 17:13:32 +00:00
Bob Farrell
320c2706ae WIP 2024-11-09 17:13:32 +00:00
Bob Farrell
1c2cbaca77 WIP 2024-11-09 17:12:49 +00:00
Bob Farrell
a8a552cfa3 More Type fixes 2024-08-31 11:04:33 +01:00
Bob Farrell
a46bc0ed19 Test helpers
Add `jetzig test` command which runs build step `jetzig:test`.

Add `jetzig.testing` namespace which provides test helpers and a test
app.

Add tests to view generator (i.e. include tests for generated routes).
2024-06-03 21:56:32 +01:00
JSantoro
b7217593de Fixed jetzig generate layout from zmpl v1 syntax 2024-05-22 00:05:31 +02:00
Bob Farrell
65edd20092 Allow mailers to modify mail template params
Remove need to add all mail template params to view response data. This
was originally intended functionality but the wrong value was passed to
the `deliver` function, and no `data` argument was given, making it
cumbersome to create new values.
2024-05-05 20:04:57 +01:00
Bob Farrell
47c35632b5 Email framework
Create mailers with `jetzig generate mailer <name>`. Mailers define
default values for email fields (e.g. subject, from address, etc.).
Mailers use Zmpl for rendering text/HTML parts.

Send an email from a request with `request.mail()`. Call
`deliver(.background, .{})` on the return value to use the built-in
mail job to send the email asynchronously.

Improve query/HTTP request body param parsing - unescape `+` and `%XX`
characters.
2024-04-21 21:00:03 +01:00
Bob Farrell
0c7a11497f Background jobs
Use in-memory KV store (JetKV) for simple job queue.

Build script generates an array of Zig modules in `src/app/jobs/` and
stores their name + run function (`run(allocator, params, logger)`).

View functions schedule jobs with arbitrary params.

Thread pool spawns a (configurable) number of workers and pops jobs from
the queue, then invokes the appropriate run function.
2024-04-15 18:12:40 +01:00
Bob Farrell
ec045cccd6 Add environments, use pretty-printed JSON in development
Fix secret generation - overallocate length to ensure we have enough
bytes.

Error if no secret provided in production mode.
2024-03-28 22:39:58 +00:00
Bob Farrell
87bcc4c9e0 Provide tooling for running Jetzig in deployment 2024-03-19 23:03:55 +00:00
Bob Farrell
aa036fde8b Implement layouts
Latest Zmpl provides `template.renderWithLayout(other_template, data)`,
allowing a template to be renedered within another template.

Create layouts in `src/app/views/layouts/` or use
`jetzig generate layout [name]` and set `pub const layout = "name";` in
each view file.
2024-03-11 22:36:18 +00:00
Bob Farrell
f954439489 CLI generate command
Provide `jetzig generate ...` commands for views, middleware, and
partials.
2024-03-09 18:47:08 +00:00