Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/lustre.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: lustre-configurator

on:
push:
branches:
- main
pull_request:

jobs:
build:
defaults:
run:
working-directory: lustre-configurator
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: "27.1.2"
gleam-version: "1.10.0"
rebar3-version: "3"
- run: gleam build
- run: gleam format --check src test
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
exclude: ["Gemfile", "Gemfile.lock", "jekyll.sh", "vue-configurator", "vendor"]
exclude: ["flake.nix", "flake.lock", "jekyll.sh", "lustre-configurator", "vendor"]
plugins:
- jekyll-paginate
highlighter: rouge
Expand Down
1 change: 0 additions & 1 deletion configurator/css/app.7254085a.css

This file was deleted.

70 changes: 69 additions & 1 deletion configurator/index.html
Original file line number Diff line number Diff line change
@@ -1 +1,69 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/images/favicon.png" type="image/png"><title>Inbucket Configurator</title><link href="/configurator/css/app.7254085a.css" rel="preload" as="style"><link href="/configurator/js/app.59a388aa.js" rel="preload" as="script"><link href="/configurator/js/chunk-vendors.55816ce4.js" rel="preload" as="script"><link href="/configurator/css/app.7254085a.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but vue-configurator doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="/configurator/js/chunk-vendors.55816ce4.js"></script><script src="/configurator/js/app.59a388aa.js"></script></body></html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<title>Inbucket Configurator</title>

<!-- Uncomment this if you add the TailwindCSS integration -->
<!-- <link rel="stylesheet" href="/priv/static/configurator.css"> -->
<script type="module" src="/configurator/static/configurator.min.mjs"></script>

<style>
html, body, div {
font-family: Verdana, Geneva, sans-serif;
}

#app {
margin: 20px auto;
max-width: 800px;
}

summary.section {
border-bottom: solid 1px #000;
font-size: 24px;
font-weight: 700;
margin: 20px 0;
}

h3 {
margin-top: 0;
}

samp {
font-family: Consolas, Monaco, monospace;
font-weight: bold;
}

code {
background-color: #d0dfef;
font-family: Consolas, Monaco, monospace;
padding: 1px 5px;
}

#config-form {
margin: 20px auto;
max-width: 800px;
}

.config-item {
background-color: #e0efff;
margin: 4px 0;
padding: 10px;
}

.env-line {
font-family: Consolas, Monaco, monospace;
}

input[type=text] {
width: 300px;
}
</style>
</head>

<body>
<div id="app"></div>
</body>
</html>
2 changes: 0 additions & 2 deletions configurator/js/app.59a388aa.js

This file was deleted.

1 change: 0 additions & 1 deletion configurator/js/app.59a388aa.js.map

This file was deleted.

8 changes: 0 additions & 8 deletions configurator/js/chunk-vendors.55816ce4.js

This file was deleted.

1 change: 0 additions & 1 deletion configurator/js/chunk-vendors.55816ce4.js.map

This file was deleted.

63 changes: 63 additions & 0 deletions configurator/static/configurator.min.mjs

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

81 changes: 58 additions & 23 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,63 @@
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = nixpkgs.legacyPackages.${system};

serve = pkgs.writeShellScriptBin "serve" ''
jekyll serve --watch
outputs =
{ nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};

scripts.serve = pkgs.writeShellScriptBin "serve" ''
jekyll serve --watch
'';

# TODO Replace with Jekyll + Lustre GHA
scripts.lustre-build = pkgs.writeShellScriptBin "lustre-build" ''
set -xeo pipefail

src=lustre-configurator
target=configurator

cd "$(git rev-parse --show-toplevel)"
test -d $src || (echo "ERROR: dir $src does not exist"; exit 5)

pushd $src
gleam clean
rm -rf priv
gleam run -m lustre/dev build app --minify
popd

test -d $target && rm -rf $target
mkdir $target
cp -r $src/priv/* $target

cp $src/index.html $target/index.html
sed -i 's|priv/static/configurator\.mjs|configurator/static/configurator.min.mjs|' $target/index.html
'';
in
{
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
(jekyll.override { withOptionalDependencies = true; })
scripts.serve
scripts.lustre-build

# Gleam
erlang_27
gleam
inotify-tools
rebar3
];

shellHook = ''
echo
echo "Commands:"
echo " serve - runs jekyll w/ --watch"
echo " lustre-build - builds the Lustre configurator"
echo
'';
in
{
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
(jekyll.override { withOptionalDependencies = true; })
serve
];

shellHook = ''
echo "Commands:"
echo " serve - runs jekyll w/ --watch"
'';
};
}
);
};
}
);
}
5 changes: 5 additions & 0 deletions lustre-configurator/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*.beam
*.ez
/build
erl_crash.dump
/priv/static
9 changes: 9 additions & 0 deletions lustre-configurator/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# lustre-configurator

The Inbucket Configurator, now in Gleam and Lustre.

## Development

```sh
gleam run -m lustre/dev start # Run the dev server
```
13 changes: 13 additions & 0 deletions lustre-configurator/gleam.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name = "configurator"
version = "1.0.0"
target = "javascript"

gleam = ">= 1.9.0"

[dependencies]
gleam_stdlib = ">= 0.44.0 and < 2.0.0"
lustre = ">= 5.0.3 and < 6.0.0"

[dev-dependencies]
gleeunit = ">= 1.0.0 and < 2.0.0"
lustre_dev_tools = ">= 1.8.0 and < 2.0.0"
69 changes: 69 additions & 0 deletions lustre-configurator/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<title>Inbucket Configurator</title>

<!-- Uncomment this if you add the TailwindCSS integration -->
<!-- <link rel="stylesheet" href="/priv/static/configurator.css"> -->
<script type="module" src="/priv/static/configurator.mjs"></script>

<style>
html, body, div {
font-family: Verdana, Geneva, sans-serif;
}

#app {
margin: 20px auto;
max-width: 800px;
}

summary.section {
border-bottom: solid 1px #000;
font-size: 24px;
font-weight: 700;
margin: 20px 0;
}

h3 {
margin-top: 0;
}

samp {
font-family: Consolas, Monaco, monospace;
font-weight: bold;
}

code {
background-color: #d0dfef;
font-family: Consolas, Monaco, monospace;
padding: 1px 5px;
}

#config-form {
margin: 20px auto;
max-width: 800px;
}

.config-item {
background-color: #e0efff;
margin: 4px 0;
padding: 10px;
}

.env-line {
font-family: Consolas, Monaco, monospace;
}

input[type=text] {
width: 300px;
}
</style>
</head>

<body>
<div id="app"></div>
</body>
</html>
49 changes: 49 additions & 0 deletions lustre-configurator/manifest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# This file was generated by Gleam
# You typically do not need to edit this file

packages = [
{ name = "argv", version = "1.0.2", build_tools = ["gleam"], requirements = [], otp_app = "argv", source = "hex", outer_checksum = "BA1FF0929525DEBA1CE67256E5ADF77A7CDDFE729E3E3F57A5BDCAA031DED09D" },
{ name = "directories", version = "1.2.0", build_tools = ["gleam"], requirements = ["envoy", "gleam_stdlib", "platform", "simplifile"], otp_app = "directories", source = "hex", outer_checksum = "D13090CFCDF6759B87217E8DDD73A75903A700148A82C1D33799F333E249BF9E" },
{ name = "envoy", version = "1.0.2", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "envoy", source = "hex", outer_checksum = "95FD059345AA982E89A0B6E2A3BF1CF43E17A7048DCD85B5B65D3B9E4E39D359" },
{ name = "exception", version = "2.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "exception", source = "hex", outer_checksum = "F5580D584F16A20B7FCDCABF9E9BE9A2C1F6AC4F9176FA6DD0B63E3B20D450AA" },
{ name = "filepath", version = "1.1.2", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "filepath", source = "hex", outer_checksum = "B06A9AF0BF10E51401D64B98E4B627F1D2E48C154967DA7AF4D0914780A6D40A" },
{ name = "fs", version = "11.4.1", build_tools = ["rebar3"], requirements = [], otp_app = "fs", source = "hex", outer_checksum = "DD00A61D89EAC01D16D3FC51D5B0EB5F0722EF8E3C1A3A547CD086957F3260A9" },
{ name = "gleam_community_ansi", version = "1.4.3", build_tools = ["gleam"], requirements = ["gleam_community_colour", "gleam_regexp", "gleam_stdlib"], otp_app = "gleam_community_ansi", source = "hex", outer_checksum = "8A62AE9CC6EA65BEA630D95016D6C07E4F9973565FA3D0DE68DC4200D8E0DD27" },
{ name = "gleam_community_colour", version = "2.0.0", build_tools = ["gleam"], requirements = ["gleam_json", "gleam_stdlib"], otp_app = "gleam_community_colour", source = "hex", outer_checksum = "FDD6AC62C6EC8506C005949A4FCEF032038191D5EAAEC3C9A203CD53AE956ACA" },
{ name = "gleam_crypto", version = "1.5.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_crypto", source = "hex", outer_checksum = "917BC8B87DBD584830E3B389CBCAB140FFE7CB27866D27C6D0FB87A9ECF35602" },
{ name = "gleam_deque", version = "1.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_deque", source = "hex", outer_checksum = "64D77068931338CF0D0CB5D37522C3E3CCA7CB7D6C5BACB41648B519CC0133C7" },
{ name = "gleam_erlang", version = "0.34.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_erlang", source = "hex", outer_checksum = "0C38F2A128BAA0CEF17C3000BD2097EB80634E239CE31A86400C4416A5D0FDCC" },
{ name = "gleam_http", version = "4.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_http", source = "hex", outer_checksum = "0A62451FC85B98062E0907659D92E6A89F5F3C0FBE4AB8046C99936BF6F91DBC" },
{ name = "gleam_httpc", version = "4.1.0", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_http", "gleam_stdlib"], otp_app = "gleam_httpc", source = "hex", outer_checksum = "1A38507AF26CACA145248733688703EADCB734EA971D4E34FB97B7613DECF132" },
{ name = "gleam_json", version = "2.3.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_json", source = "hex", outer_checksum = "C55C5C2B318533A8072D221C5E06E5A75711C129E420DD1CE463342106012E5D" },
{ name = "gleam_otp", version = "0.16.1", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_stdlib"], otp_app = "gleam_otp", source = "hex", outer_checksum = "50DA1539FC8E8FA09924EB36A67A2BBB0AD6B27BCDED5A7EF627057CF69D035E" },
{ name = "gleam_package_interface", version = "2.0.0", build_tools = ["gleam"], requirements = ["gleam_json", "gleam_stdlib"], otp_app = "gleam_package_interface", source = "hex", outer_checksum = "C2D2CA097831D27A20DAFA62D44F5D1B12E8470272337FD133368ACA4969A317" },
{ name = "gleam_regexp", version = "1.1.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_regexp", source = "hex", outer_checksum = "9C215C6CA84A5B35BB934A9B61A9A306EC743153BE2B0425A0D032E477B062A9" },
{ name = "gleam_stdlib", version = "0.59.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "F8FEE9B35797301994B81AF75508CF87C328FE1585558B0FFD188DC2B32EAA95" },
{ name = "gleam_yielder", version = "1.1.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_yielder", source = "hex", outer_checksum = "8E4E4ECFA7982859F430C57F549200C7749823C106759F4A19A78AEA6687717A" },
{ name = "gleeunit", version = "1.3.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "A7DD6C07B7DA49A6E28796058AA89E651D233B357D5607006D70619CD89DAAAB" },
{ name = "glint", version = "1.2.1", build_tools = ["gleam"], requirements = ["gleam_community_ansi", "gleam_community_colour", "gleam_stdlib", "snag"], otp_app = "glint", source = "hex", outer_checksum = "2214C7CEFDE457CEE62140C3D4899B964E05236DA74E4243DFADF4AF29C382BB" },
{ name = "glisten", version = "7.0.1", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_otp", "gleam_stdlib", "logging", "telemetry"], otp_app = "glisten", source = "hex", outer_checksum = "1A53CF9FB3231A93FF7F1BD519A43DC968C1722F126CDD278403A78725FC5189" },
{ name = "gramps", version = "3.0.1", build_tools = ["gleam"], requirements = ["gleam_crypto", "gleam_erlang", "gleam_http", "gleam_stdlib"], otp_app = "gramps", source = "hex", outer_checksum = "59194B3980110B403EE6B75330DB82CDE05FC8138491C2EAEACBC7AAEF30B2E8" },
{ name = "houdini", version = "1.1.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "houdini", source = "hex", outer_checksum = "5BA517E5179F132F0471CB314F27FE210A10407387DA1EA4F6FD084F74469FC2" },
{ name = "hpack_erl", version = "0.3.0", build_tools = ["rebar3"], requirements = [], otp_app = "hpack", source = "hex", outer_checksum = "D6137D7079169D8C485C6962DFE261AF5B9EF60FBC557344511C1E65E3D95FB0" },
{ name = "logging", version = "1.3.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "logging", source = "hex", outer_checksum = "1098FBF10B54B44C2C7FDF0B01C1253CAFACDACABEFB4B0D027803246753E06D" },
{ name = "lustre", version = "5.0.3", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_json", "gleam_otp", "gleam_stdlib", "houdini"], otp_app = "lustre", source = "hex", outer_checksum = "0BB69D69A9E75E675AA2C32A4A0E5086041D037829FC8AD385BA6A59E45A60A2" },
{ name = "lustre_dev_tools", version = "1.8.0", build_tools = ["gleam"], requirements = ["argv", "filepath", "fs", "gleam_community_ansi", "gleam_crypto", "gleam_deque", "gleam_erlang", "gleam_http", "gleam_httpc", "gleam_json", "gleam_otp", "gleam_package_interface", "gleam_regexp", "gleam_stdlib", "glint", "glisten", "lustre", "mist", "repeatedly", "simplifile", "term_size", "tom", "wisp"], otp_app = "lustre_dev_tools", source = "hex", outer_checksum = "D3D46D0AEA049F40C52534FD11441E11BC24521D332F5203D9D0B6A96D909B25" },
{ name = "marceau", version = "1.3.0", build_tools = ["gleam"], requirements = [], otp_app = "marceau", source = "hex", outer_checksum = "2D1C27504BEF45005F5DFB18591F8610FB4BFA91744878210BDC464412EC44E9" },
{ name = "mist", version = "4.0.7", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_http", "gleam_otp", "gleam_stdlib", "gleam_yielder", "glisten", "gramps", "hpack_erl", "logging"], otp_app = "mist", source = "hex", outer_checksum = "F7D15A1E3232E124C7CE31900253633434E59B34ED0E99F273DEE61CDB573CDD" },
{ name = "platform", version = "1.0.0", build_tools = ["gleam"], requirements = [], otp_app = "platform", source = "hex", outer_checksum = "8339420A95AD89AAC0F82F4C3DB8DD401041742D6C3F46132A8739F6AEB75391" },
{ name = "repeatedly", version = "2.1.2", build_tools = ["gleam"], requirements = [], otp_app = "repeatedly", source = "hex", outer_checksum = "93AE1938DDE0DC0F7034F32C1BF0D4E89ACEBA82198A1FE21F604E849DA5F589" },
{ name = "simplifile", version = "2.2.1", build_tools = ["gleam"], requirements = ["filepath", "gleam_stdlib"], otp_app = "simplifile", source = "hex", outer_checksum = "C88E0EE2D509F6D86EB55161D631657675AA7684DAB83822F7E59EB93D9A60E3" },
{ name = "snag", version = "1.1.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "snag", source = "hex", outer_checksum = "7E9F06390040EB5FAB392CE642771484136F2EC103A92AE11BA898C8167E6E17" },
{ name = "telemetry", version = "1.3.0", build_tools = ["rebar3"], requirements = [], otp_app = "telemetry", source = "hex", outer_checksum = "7015FC8919DBE63764F4B4B87A95B7C0996BD539E0D499BE6EC9D7F3875B79E6" },
{ name = "term_size", version = "1.0.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "term_size", source = "hex", outer_checksum = "D00BD2BC8FB3EBB7E6AE076F3F1FF2AC9D5ED1805F004D0896C784D06C6645F1" },
{ name = "tom", version = "1.1.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "tom", source = "hex", outer_checksum = "0910EE688A713994515ACAF1F486A4F05752E585B9E3209D8F35A85B234C2719" },
{ name = "wisp", version = "1.6.0", build_tools = ["gleam"], requirements = ["directories", "exception", "gleam_crypto", "gleam_erlang", "gleam_http", "gleam_json", "gleam_stdlib", "logging", "marceau", "mist", "simplifile"], otp_app = "wisp", source = "hex", outer_checksum = "AE1C568FE30718C358D3B37666DF0A0743ECD96094AD98C9F4921475075F660A" },
]

[requirements]
gleam_stdlib = { version = ">= 0.44.0 and < 2.0.0" }
gleeunit = { version = ">= 1.0.0 and < 2.0.0" }
lustre = { version = ">= 5.0.3 and < 6.0.0" }
lustre_dev_tools = { version = ">= 1.8.0 and < 2.0.0" }
Loading