61 Commits

Author SHA1 Message Date
TheJltres
6f0e731303
Testing seeders 2025-05-01 22:23:39 +02:00
Sean M. Collins
9e4e8529c5 Create a template file for init
This allows us to use database.zig for CI, while still creating a blank
database.zig for new projects that are created via jetzig init
2025-03-10 21:49:36 -04:00
Bob Farrell
7eea1e3f0a Minor CLI improvements
Show some progress "..." when running external commands to give the user
a bit of extra feedback while commands run.
2025-03-02 14:14:42 +00:00
Bob Farrell
099a2a5349 Use Zig compiler
Default to not using LLVM for application compilation. This gives more
than 2x performance improvement for compilation stage.
2025-03-01 14:33:17 +00:00
Bob Farrell
a5430ff380 Zig 0.14 test runner config changes
Update dependencies to match new Zig build config API for test runners,
misc. fixes needed after upgrading dependencies.
2025-02-02 11:31:40 +00:00
z1fire
be8e517a06 unicode for windows 2024-11-30 16:25:31 -05:00
z1fire
6cabafc63f unicode for windows 2024-11-30 15:31:36 -05:00
z1fire
f9d8ef3776 update allow unicode images in windows terminal 2024-11-30 15:13:02 -05:00
z1fire
22badde8c0 Jetzigg init direction update 2024-11-30 07:18:06 -05:00
z1fire
50bcda1cbe Added imports to mailers 2024-11-29 17:55:09 -05:00
Bob Farrell
f44a6b33c5 Routing updates
Implement `/foo/1/edit` route/view.

Allow setting HTTP verb by passing e.g. `/_PATCH` as the last segment of
a URL - this allows browsers to submit a `POST` request with a
pseudo-HTTP verb encoded in the URL which Jetzig can translate, i.e.
allowing forms to submit a `PATCH`.
2024-11-24 20:46:56 +00:00
Bob Farrell
773eb1dc6e Add --debug option to jetzig server
Defaults to true, allow disabling new debug console.
2024-11-23 19:58:52 +00:00
Bob Farrell
1565ae3b73 Debug console
Use `jetzig server` or `zig build -Ddebug_console=true run` to launch a
development server with the debug console enabled.

When an error is encountered a formatted stack trace is dumped to the
browser along with the current response data. Both outputs are
syntax-highlighted using Prism JS.
2024-11-23 18:07:19 +00:00
Bob Farrell
92dce21244 Database CLI improvements
Eradication of `data` arg to requests. We no longer need to pass this
value around as we have a) type inference, b) nested object insertion
via `put` and `append`.

Fix `joinPath` numeric type coercion

Detect empty string params and treat them as blank with expectParams()

Fix error logging/stack trace printing.

Update Zmpl - includes debug tokens + error tracing to source template
in debug builds.
2024-11-19 21:39:01 +00:00
Bob Farrell
78b6938530 Fix custom routes
Fix CLI view generator
2024-11-17 19:32:46 +00:00
Bob Farrell
b95506caf9 Params helpers
Implement `request.expectParams()` to coerce params to a given struct.
`request.paramsInfo()` provides information about each param (present,
blank, failed + original values and errors where applicable).
2024-11-17 19:07:27 +00:00
Bob Farrell
5b285df07b Add new to view generator 2024-11-14 21:36:45 +00:00
Bob Farrell
b1dc086afb GH actions fixes
Fix `/.json` root path detection
2024-11-14 18:54:26 +00:00
Bob Farrell
4330cc93e9 Update JetQuery, improve migration CLI docstring 2024-11-14 08:31:38 +00:00
Bob Farrell
c8ae44b508 Accept password at command line for auth user create
Intended for local development only
2024-11-13 20:35:50 +00:00
Bob Farrell
f9c6f9f38f Fix memory leak in auth CLI command 2024-11-13 20:15:24 +00:00
Bob Farrell
a6d1b92f5e Simplify DevelopmentLogger, add ProductionLogger
Add auth helper to create a user from CLI:

```
jetzig auth user:create user@example.com
```
2024-11-11 22:25:35 +00:00
Bob Farrell
d219a3ce83 Fix environment for bundle command 2024-11-10 22:24:27 +00:00
Bob Farrell
88e9136075 Update JetQuery 2024-11-10 21:09:44 +00:00
Bob Farrell
78a9ccaaa4 Fix database config path 2024-11-09 18:06:16 +00:00
Bob Farrell
88f1ac46f4 Add missing database config file 2024-11-09 17:22:38 +00:00
Bob Farrell
d27907a1c5 WIP 2024-11-09 17:13:32 +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
6c53ccf8fc WIP 2024-11-09 17:13:32 +00:00
Bob Farrell
320c2706ae WIP 2024-11-09 17:13:32 +00:00
Bob Farrell
405762504d WIP 2024-11-09 17:13:32 +00:00
Bob Farrell
dc11412587 WIP 2024-11-09 17:13:32 +00:00
Bob Farrell
fa5b3f240e WIP 2024-11-09 17:13:32 +00:00
Bob Farrell
9bc1b26c10 WIP 2024-11-09 17:12:49 +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
3882eba2f3 Clean up static params and init script 2024-06-09 11:13:33 +01:00
Bob Farrell
2d921a1c27 Add jetzig routes command
Output all current routes. Invokes `zig build jetzig:routes`.
2024-06-05 21:26:23 +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
6b940e8a53 0.13 support
Add support for 0.13. For now, we can be compatible with both 0.12 and
0.13. We will drop 0.12 after a while.
2024-04-27 23:03:53 +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
68ca4d3bba jetzig bundle improvements
Generate a bundle that includes markdown files (needed for dynamic
markdown rendering). In future these will be compiled into static
outputs by the bundle command but for now we copy them into the source
tree. `bundle.tar.gz` includes one directory which is named after the
compiled exe, containing a `server` executable, `public` and `static`
directories, and any markdown files.

Windows support removed for now - will re-add when we overhaul all of
this to no longer do command line invocation of `tar` (we will build
tarball/Zip file ourselves).
2024-04-07 15:47:15 +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
bobf
c2cc9c50f2
Merge pull request #46 from jetzig-framework/replicate-exe-imports
Replicate exe imports
2024-03-28 21:54:14 +00:00
Bob Farrell
29d13917a6 Add a dependency to demo app
Use as a regression test to ensure dependencies always work.
2024-03-28 21:07:16 +00:00
axispx
397e76b2d0 Print message when server detects changes after build failure 2024-03-28 10:00:17 +05:45