421 Commits

Author SHA1 Message Date
Bob Farrell
ecd66db3dc Fixes for misc. Zig nightly changes
* Removal of std.ArrayList.popOrNull
* Removal of std.mem.page_size
2025-02-13 18:23:04 +00:00
bobf
b71e738ec0
Merge pull request #152 from talvdav/update-httpz
updated http.zig to newer version, containig fix for 0.14.0-dev.3026+…
2025-02-03 19:39:22 +00:00
Thomas A. Alvarado Davalos
1ccaa45d34 updated http.zig to newer version, containig fix for 0.14.0-dev.3026+c225b780e 2025-02-03 20:18:12 +01:00
bobf
492ac4a999
Merge pull request #151 from jetzig-framework/0.14-fixes-for-test-runners
Zig 0.14 test runner config changes
2025-02-02 11:37:00 +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
bobf
1b5c72b75f
Merge pull request #143 from erg/fix-142-jetzig-init
util.zig: more helpful error message when `zig` is not in path
2025-02-01 11:53:50 +00:00
bobf
6223f256d8
Merge pull request #147 from jetzig-framework/misc-zig-updates
Misc. Zig updates
2025-01-25 12:27:43 +00:00
Bob Farrell
a99999af52 Misc. Zig updates
Changes to latest Zig nightly build required several minor fixes across
multiple dependencies.
2025-01-25 12:22:19 +00:00
Doug Coleman
b5ae4ec181 util.zig: more helpful error message when zig is not in path 2025-01-16 14:55:01 -06:00
bobf
5ebb60d759
Merge pull request #135 from jetzig-framework/zig-build-fixes
Latest Zig changes accommodation (missed one)
2024-12-22 13:16:44 +00:00
Bob Farrell
350f9512e6 Latest Zig changes accommodation (missed one) 2024-12-22 12:57:52 +00:00
bobf
413fd30aee
Merge pull request #134 from jetzig-framework/zig-build-fixes
Zig build fixes for latest Zig nightly build
2024-12-22 12:41:48 +00:00
Bob Farrell
76f14a89a1 Zig build fixes for latest Zig nightly build 2024-12-22 12:34:11 +00:00
bobf
475ed26952
Merge pull request #133 from jetzig-framework/jetkv-valkey
Valkey backend for JetKV
2024-12-06 21:36:26 +00:00
Bob Farrell
35adaf3009 Valkey backend for JetKV 2024-12-06 21:31:02 +00:00
Zackary Housend
31f8a4a93c
Merge pull request #131 from z1fire/wip
New custom print function to handle windows unicode
2024-11-30 16:39:22 -05: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
63cd638149 Merge branch 'wip' of https://github.com/z1fire/jetzig into wip 2024-11-30 15:24:19 -05:00
z1fire
f9d8ef3776 update allow unicode images in windows terminal 2024-11-30 15:13:02 -05:00
Zackary Housend
2f7687a0e5
Merge branch 'jetzig-framework:main' into wip 2024-11-30 14:25:03 -05:00
bobf
7b03850593
Merge pull request #130 from jetzig-framework/per-request-database-connection
Per-request database connection
2024-11-30 12:58:57 +00:00
Bob Farrell
9cf6705c88 Per-request database connection
Use JetQuery's new `Repo.bindConnect()` to get a new Repo bound to a
connection for each request. This significantly simplifies connection
management and offloads all the connection pool
management/reconnecting/etc. to pg.zig where it belongs.

Improve development mode SQL syntax highlighting - highlight `SELECT`,
`UPDATE`, `DELETE`, `INSERT` in different bolded colors for clarity.
2024-11-30 12:48:18 +00:00
z1fire
22badde8c0 Jetzigg init direction update 2024-11-30 07:18:06 -05:00
bobf
e8ce232700
Merge pull request #129 from z1fire/wip
Added imports to mailers
2024-11-29 23:20:01 +00:00
z1fire
50bcda1cbe Added imports to mailers 2024-11-29 17:55:09 -05:00
bobf
ac600326a9
Merge pull request #127 from jetzig-framework/jetquery-optionals-rework
JetQuery optionals rework
2024-11-28 22:39:13 +00:00
Bob Farrell
6075708bf4 JetQuery optionals rework
Optionals now supported as param types.
2024-11-28 22:25:39 +00:00
Bob Farrell
54480a7b39 Update JetQuery 2024-11-27 22:39:02 +00:00
Bob Farrell
e27fc06d8c Update JetQuery 2024-11-27 22:32:40 +00:00
bobf
6dbeed7109
Merge pull request #125 from jetzig-framework/schema-reflection-improvements
Schema reflection improvements
2024-11-27 22:20:40 +00:00
Bob Farrell
c91eda51d3 Schema reflection improvements
Reflect foreign keys, fix pk/fk serial type inference, add missing
numeric types.
2024-11-27 22:15:15 +00:00
bobf
a3e3cb6dfe
Merge pull request #124 from jetzig-framework/database-in-jobs
Make database repo available in background jobs
2024-11-27 20:52:08 +00:00
Bob Farrell
1fa6db77df Make database repo available in background jobs 2024-11-27 20:43:35 +00:00
bobf
b4b7251021
Merge pull request #123 from jetzig-framework/jetquery-fix-datetime-coercion
JetQuery: fix datetime coercion
2024-11-26 19:33:17 +00:00
Bob Farrell
8ffbbbbf6a JetQuery: fix datetime coercion
Fix for coercing datetime values in where/insert/etc. params and
managing optional datetimes in schema.
2024-11-26 19:25:35 +00:00
Bob Farrell
4e1a26a5f9 Add zUI to related projects
Add Karl as a contributor (pg.zig and http.zig author + a few PRs direct
to Jetzig/JetQuery)
2024-11-24 21:35:42 +00:00
Bob Farrell
6bd0273e2d Fix default production cookie value 2024-11-24 21:14:28 +00:00
bobf
937efd9121
Merge pull request #122 from jetzig-framework/pseudo-http-verbs-and-edit-action
Routing updates
2024-11-24 20:53:48 +00: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
bobf
835885a947
Merge pull request #121 from jetzig-framework/debug-console
Debug console
2024-11-23 20:12:34 +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
9684181c64 Fix middleware render detection 2024-11-23 19:31:37 +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
8095bbcb76 Implement request.renderTemplate
Clean up request state.
2024-11-23 13:42:14 +00:00
Bob Farrell
036aec1682 Misc. tidying 2024-11-23 13:14:11 +00:00
bobf
130a7c81a8
Merge pull request #120 from jetzig-framework/anti-csrf
Closes #108: Anti-CSRF middleware
2024-11-23 12:58:03 +00:00
Bob Farrell
6e6f1bec1b Closes #108: Anti-CSRF middleware
Add to middleware in app's `src/main.zig`:

```zig
pub const jetzig_options = struct {
    pub const middleware: []const type = &.{
        jetzig.middleware.AntiCsrfMiddleware,
    };
};
```

CSRF token available in Zmpl templates:

```
{{context.authenticityToken()}}
```
or render a hidden form element:
```
{{context.authenticityFormElement()}}
```

The following HTML requests are rejected (403 Forbidden) if the
submitted query param does not match the value stored in the encrypted
session (added automatically when the token is generated for a template
value):

* POST
* PUT
* PATCH
* DELETE

JSON requests are not impacted - users should either disable JSON
endpoints or implement a different authentication method to protect
them.
2024-11-23 12:49:49 +00:00
bobf
b1becfd6ec
Merge pull request #119 from karlseguin/update_karl_deps
update pg.zig dep (out of bound fix)
2024-11-21 18:15:22 +00:00
Karl Seguin
7f71d1d6da update pg.zig dep (out of bound fix)
update smtp_client (merged tls PR)
2024-11-21 10:06:09 +08:00