Skip to content

Commit

Permalink
updated changelog & readme, v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
flyx committed Mar 10, 2023
1 parent 300dbce commit ab3ff9f
Show file tree
Hide file tree
Showing 4 changed files with 158 additions and 123 deletions.
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
## 1.1.0

Features:

* ``YamlNode`` now contains node styles and preserves them
when serializing to YAML again
* Added ``maxLineLength`` to ``PresentationOptions``. (#119)
* Added ``loadFlattened`` to resolve aliases while loading,
instead of deserializing them into pointers. (#117)

Bugfixes

* Fixed problems with ARC/ORC (#120)
* Fixes some edge cases around whitespace while parsing
* Fixed a problem that made ``{.ignore: [].}`` fail when trying
to ignore collection values. (#127)
* Always write a newline character at the end of output, as required
by POSIX for text files.
* Fixed an error with loading recursive nodes into YamlNodes.
* Fixed an error where ``0`` could not be loaded into an unsigned
integer lvalue. (#123)
* Fixed an error where `float32` values could not properly
be deserialized. (#124)
* Fixed a compiler error concerning stricteffects. (#125)

## 1.0.0

Features:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ available as tags in this repository and can be fetched via nimble:

This library is stable.
I only maintain it and will not add any features due to lack of time and interest.
NimYAML passes almost all tests of the current YAML 1.2 test suite and is currently lacking in few exotic edge-cases.
NimYAML passes all tests of the current YAML 1.2 test suite.
See [the official YAML test matrix][4] for details.

PRs for bugs are welcome. If you want to add a feature, you are free to; but be aware that I will not maintain it and am unlikely to review it in depth, so if I accept it, you will be co-maintainer.
Expand Down
252 changes: 131 additions & 121 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,128 +1,138 @@
{
inputs = {
nixpkgs.url = github:NixOS/nixpkgs/22.05;
utils.url = github:numtide/flake-utils;
nix-filter.url = github:numtide/nix-filter;
nixpkgs.url = "github:NixOS/nixpkgs/22.05";
utils.url = "github:numtide/flake-utils";
nix-filter.url = "github:numtide/nix-filter";
};
outputs = {
self, nixpkgs, utils, nix-filter
}: let
version = "0.16.0";
systemDependent = with utils.lib; eachSystem allSystems (system: let
pkgs = nixpkgs.legacyPackages.${system};
in with nix-filter.lib; {
devShell = pkgs.mkShell {
buildInputs = with pkgs; [ nim ];
};
packages.webdocs = let
nim-jester = pkgs.stdenv.mkDerivation {
name = "nim-jester-0.5.0";
src = pkgs.fetchFromGitHub {
owner = "dom96";
repo = "jester";
rev = "v0.5.0";
sha256 = "0m8a4ss4460jd2lcbqcbdd68jhcy35xg7qdyr95mh8rflwvmcvhk";
outputs = { self, nixpkgs, utils, nix-filter }:
let
version = "1.1.0";
systemDependent = with utils.lib;
eachSystem allSystems (system:
let pkgs = nixpkgs.legacyPackages.${system};
in with nix-filter.lib; {
devShell = pkgs.mkShell { buildInputs = with pkgs; [ nim ]; };
packages.webdocs = let
nim-jester = pkgs.stdenv.mkDerivation {
name = "nim-jester-0.5.0";
src = pkgs.fetchFromGitHub {
owner = "dom96";
repo = "jester";
rev = "v0.5.0";
sha256 =
"0m8a4ss4460jd2lcbqcbdd68jhcy35xg7qdyr95mh8rflwvmcvhk";
};
dontBuild = true;
installPhase = ''
mkdir -p $out/lib
cp -r jester.nim jester $out/lib
'';
};
nim-httpbeast = pkgs.stdenv.mkDerivation {
name = "nim-httpbeast-0.2.2";
src = pkgs.fetchFromGitHub {
owner = "dom96";
repo = "httpbeast";
rev = "v0.2.2";
sha256 =
"1f8ch7sd5kcyaw1b1lpqywvhx2h6aa5an37zm7x0j22giqlml5c6";
};
dontBuild = true;
installPhase = ''
mkdir -p $out/lib
cp -r src/* $out/lib
'';
};
nim-cligen = pkgs.stdenv.mkDerivation {
name = "nim-cligen-0.15.3";
src = pkgs.fetchFromGitHub {
owner = "c-blake";
repo = "cligen";
rev = "v1.5.23";
sha256 = "rcledZbmcAXs0l5uQRmOennyMiw4G+zye6frGqksjyA=";
};
dontBuild = true;
installPhase = ''
mkdir -p $out/lib
cp -rt $out/lib cligen.nim cligen
'';
};
in pkgs.stdenv.mkDerivation {
pname = "nimyaml-server-deamon";
inherit version;
src = filter {
root = ./.;
exclude =
[ ./flake.nix ./flake.lock ./tools ./bench ./.github ];
};
configurePhase = ''
mkdir -p docout/api
(
cd doc
for rstFile in *.rst; do
${pkgs.nim}/bin/nim rst2html -o:../docout/''${rstFile%.rst}.html $rstFile
done
${pkgs.nim}/bin/nim c --nimcache:.cache rstPreproc
for txtFile in *.txt; do
./rstPreproc -o:tmp.rst $txtFile
${pkgs.nim}/bin/nim rst2html -o:../docout/''${txtFile%.txt}.html tmp.rst
done
cp docutils.css style.css processing.svg ../docout
)
${pkgs.nim}/bin/nim doc2 -o:docout/api/yaml.html --docSeeSrcUrl:https://github.com/flyx/NimYAML/blob/${
self.rev or "master"
} yaml
for srcFile in yaml/*.nim; do
bn=''${srcFile#yaml/}
${pkgs.nim}/bin/nim doc2 -o:docout/api/''${bn%.nim}.html --docSeeSrcUrl:https://github.com/flyx/NimYAML/blob/yaml/${
self.rev or "master"
} $srcFile
done
'';
buildPhase = ''
cat <<EOF >server/server_cfg.nim
proc shareDir*(): string =
result = "$out/share"
EOF
${pkgs.nim}/bin/nim c --d:release --d:yamlScalarRepInd -p:"${nim-jester}/lib" -p:"${nim-httpbeast}/lib" -p:"${nim-cligen}/lib" --nimcache:.cache server/server
'';
installPhase = ''
mkdir -p $out/{bin,share}
cp server/server $out/bin
cp -rt $out/share docout/*
'';
};
});
in systemDependent // {
nixosModule = { config, lib, pkg, ... }:
with lib;
let
cfg = config.services.nimyaml-webdocs;
webdocs = systemDependent.packages.${config.nixpkgs.system}.webdocs;
in {
options.services.nimyaml-webdocs = {
enable = mkEnableOption "NimYAML webdocs server";
address = mkOption {
type = types.str;
default = "127.0.0.1";
description = "Listen address";
};
port = mkOption {
type = types.int;
default = 5000;
description = "Listen port";
};
};
dontBuild = true;
installPhase = ''
mkdir -p $out/lib
cp -r jester.nim jester $out/lib
'';
};
nim-httpbeast = pkgs.stdenv.mkDerivation {
name = "nim-httpbeast-0.2.2";
src = pkgs.fetchFromGitHub {
owner = "dom96";
repo = "httpbeast";
rev = "v0.2.2";
sha256 = "1f8ch7sd5kcyaw1b1lpqywvhx2h6aa5an37zm7x0j22giqlml5c6";
};
dontBuild = true;
installPhase = ''
mkdir -p $out/lib
cp -r src/* $out/lib
'';
};
nim-cligen = pkgs.stdenv.mkDerivation {
name = "nim-cligen-0.15.3";
src = pkgs.fetchFromGitHub {
owner = "c-blake";
repo = "cligen";
rev = "v1.5.23";
sha256 = "rcledZbmcAXs0l5uQRmOennyMiw4G+zye6frGqksjyA=";
config = mkIf cfg.enable {
systemd.services.nimyaml-webdocs = {
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
serviceConfig.ExecStart = ''
${webdocs}/bin/server --address "${cfg.address}" --port ${
toString cfg.port
}'';
};
};
dontBuild = true;
installPhase = ''
mkdir -p $out/lib
cp -rt $out/lib cligen.nim cligen
'';
};
in pkgs.stdenv.mkDerivation {
pname = "nimyaml-server-deamon";
inherit version;
src = filter {
root = ./.;
exclude = [ ./flake.nix ./flake.lock ./tools ./bench ./.github ];
};
configurePhase = ''
mkdir -p docout/api
(
cd doc
for rstFile in *.rst; do
${pkgs.nim}/bin/nim rst2html -o:../docout/''${rstFile%.rst}.html $rstFile
done
${pkgs.nim}/bin/nim c --nimcache:.cache rstPreproc
for txtFile in *.txt; do
./rstPreproc -o:tmp.rst $txtFile
${pkgs.nim}/bin/nim rst2html -o:../docout/''${txtFile%.txt}.html tmp.rst
done
cp docutils.css style.css processing.svg ../docout
)
${pkgs.nim}/bin/nim doc2 -o:docout/api/yaml.html --docSeeSrcUrl:https://github.com/flyx/NimYAML/blob/${self.rev or "master"} yaml
for srcFile in yaml/*.nim; do
bn=''${srcFile#yaml/}
${pkgs.nim}/bin/nim doc2 -o:docout/api/''${bn%.nim}.html --docSeeSrcUrl:https://github.com/flyx/NimYAML/blob/yaml/${self.rev or "master"} $srcFile
done
'';
buildPhase = ''
cat <<EOF >server/server_cfg.nim
proc shareDir*(): string =
result = "$out/share"
EOF
${pkgs.nim}/bin/nim c --d:release --d:yamlScalarRepInd -p:"${nim-jester}/lib" -p:"${nim-httpbeast}/lib" -p:"${nim-cligen}/lib" --nimcache:.cache server/server
'';
installPhase = ''
mkdir -p $out/{bin,share}
cp server/server $out/bin
cp -rt $out/share docout/*
'';
};
});
in systemDependent // {
nixosModule = {config, lib, pkg, ...}: with lib; let
cfg = config.services.nimyaml-webdocs;
webdocs = systemDependent.packages.${config.nixpkgs.system}.webdocs;
in {
options.services.nimyaml-webdocs = {
enable = mkEnableOption "NimYAML webdocs server";
address = mkOption {
type = types.str;
default = "127.0.0.1";
description = "Listen address";
};
port = mkOption {
type = types.int;
default = 5000;
description = "Listen port";
};
};
config = mkIf cfg.enable {
systemd.services.nimyaml-webdocs = {
wantedBy = ["multi-user.target"];
after = ["network.target"];
serviceConfig.ExecStart = ''${webdocs}/bin/server --address "${cfg.address}" --port ${toString cfg.port}'';
};
};
};
};
}
}
2 changes: 1 addition & 1 deletion yaml.nimble
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Package

version = "1.0.0"
version = "1.1.0"
author = "Felix Krause"
description = "YAML 1.2 implementation for Nim"
license = "MIT"
Expand Down

0 comments on commit ab3ff9f

Please sign in to comment.