16 Commits

Author SHA1 Message Date
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
Froxcey
94a325fcbc
Cli: Fix bad code
Silly me, made some dumb mistakes. Welp, here's a commmit to fix all of
that!
2024-03-26 13:52:12 +08:00
Froxcey
f01abb86f5
Cli: Reload for fail build
When zig build fails, the `jetzig server` command also exits. This
should be an uninteneded behavior. This commit fixes this by catching
failed build and restart after file change is detected.
Fixes #33
2024-03-25 18:12:34 +08:00
Froxcey
19c04f1482
Cli: Add zig compiler color
The compiler doesn't pass color to the parent process unless it is
called with `--colour on`. This commit adds those arguments to add
support for coloring in compiler outputs.
2024-03-25 18:08:27 +08:00
Froxcey
646c45ea65
Replace exit with std.process.exit
`std.os.exit` got removed in [cd62005](cd62005f19 (diff-4284cdf770ea88be46f4aab7f82ed3c58821e4b3433b7c6152278a9911348dc5))
This commit fixes this by replacing all `std.os.exit` calls with
`std.process.exit`.
2024-03-25 18:03:49 +08:00
Bob Farrell
09bbcebb56 Deployment bundle
This needs some work (and testing on Windows) but it solves simple cases
and provides a starting point for a more advanced bundler.
2024-03-20 23:14:51 +00:00
Bob Farrell
87bcc4c9e0 Provide tooling for running Jetzig in deployment 2024-03-19 23:03:55 +00:00
Bob Farrell
304c2cba42 Fix Windows "jetzig server" command 2024-03-14 20:32:43 +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
e980782316 Implement jetzig server command
Runs a development server and auto-reloads when changes are detected to
files.

Note that a "change" is just an mtime update, Zig does a more
intelligent change detection so avoids unnecessary recompiles, so the
server reloads very quickly.
2024-03-11 18:38:48 +00:00
Bob Farrell
bec5f9c905 Add update command to CLI tool
Automatically update to latest version of Jetzig with `jetzig update`.
2024-03-09 19:45:59 +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