dev: add justfile for local builds
This commit is contained in:
6
Dockerfile
Normal file
6
Dockerfile
Normal file
@@ -0,0 +1,6 @@
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:9.0.6
|
||||
|
||||
COPY dist/ /app
|
||||
|
||||
WORKDIR /app
|
||||
CMD [ "dotnet", "/app/Server.dll" ]
|
||||
@@ -100,6 +100,7 @@ in
|
||||
tailwindcss_4
|
||||
bun
|
||||
npins
|
||||
just
|
||||
];
|
||||
|
||||
DOTNET_ROOT = "${dotnet-sdk}/share/dotnet";
|
||||
|
||||
68
justfile
Normal file
68
justfile
Normal file
@@ -0,0 +1,68 @@
|
||||
# Install just: https://github.com/casey/just
|
||||
|
||||
set dotenv-load
|
||||
|
||||
src_path := "src"
|
||||
server_path := "src/Server"
|
||||
client_path := "src/Client"
|
||||
test_path := "test"
|
||||
|
||||
dist_path := "dist"
|
||||
pack_path := "packages"
|
||||
|
||||
vite_prod := "bunx --bun vite build -c ../../vite.config.js -m production --emptyOutDir --outDir " + "../../dist/public"
|
||||
vite_dev := "bunx --bun vite build -c ../../vite.config.js -m development --minify false --sourcemap true --emptyOutDir --outDir " + "../../dist/public"
|
||||
vite := "vite -c ../../vite.config.js"
|
||||
|
||||
# Default recipe - show available commands
|
||||
default:
|
||||
@just --list
|
||||
|
||||
# Clean build artifacts
|
||||
clean:
|
||||
rm -rf {{dist_path}}
|
||||
|
||||
# Build production bundle (server + client)
|
||||
[parallel]
|
||||
bundle: clean bundle-server bundle-client
|
||||
|
||||
bundle-server:
|
||||
dotnet build -tl -c Release -o {{dist_path}} {{server_path}}
|
||||
|
||||
bundle-client:
|
||||
fable --cwd {{client_path}} -e .jsx -o build --test:MSBuildCracker --run {{vite_prod}}
|
||||
|
||||
# Build debug bundle (server + client)
|
||||
[parallel]
|
||||
bundle-debug: clean bundle-debug-server bundle-debug-client
|
||||
|
||||
bundle-debug-server:
|
||||
dotnet build -tl -c Debug -o {{dist_path}} {{server_path}}
|
||||
|
||||
bundle-debug-client:
|
||||
fable --cwd {{client_path}} -e .jsx -o build --test:MSBuildCracker --run {{vite_dev}}
|
||||
|
||||
# Run development server (watch mode)
|
||||
[parallel]
|
||||
run: clean run-server run-client
|
||||
|
||||
run-server:
|
||||
dotnet watch run {{server_path}}
|
||||
|
||||
# Run client only in watch mode
|
||||
run-client:
|
||||
fable watch --cwd {{client_path}} -e .jsx -o build --run {{vite}}
|
||||
|
||||
# Format code with Fantomas
|
||||
format:
|
||||
fantomas {{src_path}} -r
|
||||
|
||||
# Run tests
|
||||
[parallel]
|
||||
test: clean test-server test-client
|
||||
|
||||
test-server:
|
||||
dotnet run {{test_path}}/Server
|
||||
|
||||
test-client:
|
||||
fable --cwd {{test_path}}/Client -e .jsx -o build --run {{vite}}
|
||||
Reference in New Issue
Block a user