Skip to content

Commit

Permalink
dev: add tooling
Browse files Browse the repository at this point in the history
Signed-off-by: Patrizio Bekerle <patrizio@bekerle.com>
  • Loading branch information
pbek committed Dec 5, 2024
1 parent b86d5de commit 949e538
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 0 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use nix
39 changes: 39 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Use `just <recipe>` to run a recipe
# https://just.systems/man/en/

# By default, run the `--list` command
default:
@just --list

# Variables

zellijSession := "mono-app"

# Open a terminal with the mono-app session
[group('dev')]
term-run:
zellij --layout term.kdl attach {{ zellijSession }} -c

# Kill the mono-app session
[group('dev')]
term-kill:
-zellij delete-session {{ zellijSession }} -f

# Kill and run a terminal with the mono-app session
[group('dev')]
term: term-kill term-run

# Open a browser with the application
[group('dev')]
open-browser:
xdg-open https://127.0.0.1:8001/dist/de/mono-processpayment

# Format all justfiles
[group('linter')]
just-format:
#!/usr/bin/env bash
# Find all files named "justfile" recursively and run just --fmt --unstable on them
find . -type f -name "justfile" -print0 | while IFS= read -r -d '' file; do
echo "Formatting $file"
just --fmt --unstable -f "$file"
done
12 changes: 12 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
# nativeBuildInputs is usually what you want -- tools you need to run
nativeBuildInputs = with pkgs; [
nodejs_22
curl
zellij # smart terminal workspace
lazygit # git terminal
just # task runner
];
}

34 changes: 34 additions & 0 deletions term.kdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// https://zellij.dev/documentation/creating-a-layout
layout {
tab name="main" focus=true {
pane size=1 borderless=true {
plugin location="zellij:tab-bar"
}
pane size="60%" {
command "lazygit"
focus true
}
pane split_direction="vertical" size="40%" {
pane {
command "npm"
args "run" "watch"
}
pane {
command "npm"
args "install"
}
}
pane size=1 borderless=true {
plugin location="zellij:status-bar"
}
}
tab name="term" {
pane size=1 borderless=true {
plugin location="zellij:tab-bar"
}
pane
pane size=1 borderless=true {
plugin location="zellij:status-bar"
}
}
}

0 comments on commit 949e538

Please sign in to comment.