Refactor project and add pkldoc

This commit is contained in:
Tobias Reisinger 2026-07-19 17:38:38 +02:00
commit 6c75b0ab72
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
10 changed files with 36 additions and 10 deletions

View file

@ -1,4 +0,0 @@
{
"schemaVersion": 1,
"resolvedDependencies": {}
}

View file

@ -1,4 +1,4 @@
amends "./lib/controller.pkl"
amends "./emgauwa/controller.pkl"
server {
host = "127.0.0.1"
@ -14,5 +14,6 @@ permissions {
logging {
level = "INFO"
file = "stdout"
}
midnight = "00:00"

View file

@ -1,4 +1,4 @@
amends "./lib/core.pkl"
amends "./emgauwa/core.pkl"
server {
host = "127.0.0.1"
@ -14,5 +14,4 @@ permissions {
logging {
level = "INFO"
file = "stdout"
}

View file

@ -3,6 +3,6 @@ amends "pkl:Project"
package {
name = "emgauwa"
baseUri = "package://emgauwa.app/pkl/\(name)"
version = "0.1.1"
version = "0.2.2"
packageZipUrl = "https://emgauwa.app/pkl/\(name)@\(version).zip"
}

View file

@ -1,6 +1,9 @@
module emgauwa.common
class ServerConfig {
host: String
port: UInt16
token: String
}
/// Set to a user and a group to drop privileges to after binding to the port
@ -11,5 +14,4 @@ class PermissionsConfig {
class LoggingConfig {
level: "TRACE"|"DEBUG"|"INFO"|"WARN"|"ERROR"|"FATAL"
file: String
}

View file

@ -1,3 +1,5 @@
module emgauwa.controller
import "./common.pkl"
server: common.ServerConfig
@ -8,6 +10,8 @@ permissions: common.PermissionsConfig
logging: common.LoggingConfig
midnight: String(matches(Regex(#"([01]?[0-9]|2[0-3]):[0-5][0-9]"#)))
class RelayConfig {
number: Number
driver: "null"|"gpio"|"piface"

View file

@ -1,3 +1,5 @@
module emgauwa.core
import "./common.pkl"
server: common.ServerConfig

View file

@ -0,0 +1,13 @@
/// Emgauwa is a project to manage the automated switching of relays.
amends "pkl:DocPackageInfo"
name = "Emgauwa"
version = "0.2.2"
importUri = "https://emgauwa.app/"
sourceCode = "https://git.serguzim.me/emgauwa/pkl"
sourceCodeUrlScheme = "\(sourceCode)/src/tag/v\(version)/lib%{path}#L%{line}"
issueTracker = "https://git.serguzim.me/emgauwa/pkl/issues"
authors {
"tobias@msrg.cc"
}

3
emgauwa/docsite-info.pkl Normal file
View file

@ -0,0 +1,3 @@
amends "pkl:DocsiteInfo"
title = "Emgauwa"

6
release Executable file
View file

@ -0,0 +1,6 @@
#!/usr/bin/env sh
pkldoc -o "$PWD/.out/docs" emgauwa/*
pkl project package --output-path="$PWD/.out" --working-dir=emgauwa --skip-publish-check
rclone copy -L .out/ scaleway:emgauwa-website.serguzim.me/