From a2c87a4c69cb19e7041c60ecfe2f2e6ee3c2ab5e Mon Sep 17 00:00:00 2001 From: julixian Date: Sat, 14 Nov 2026 05:26:37 +0800 Subject: [PATCH 1/2] feat(pkg): add julixian.tomlkitpp 1.0.0 --- .../2026-11-14-add-julixian-tomlkitpp-plan.md | 24 ++++++++++ mcpp.toml | 1 + pkgs/j/julixian.tomlkitpp.lua | 48 +++++++++++++++++++ tests/examples/julixian.tomlkitpp/mcpp.toml | 15 ++++++ .../tests/parse_edit_roundtrip.cpp | 42 ++++++++++++++++ 5 files changed, 130 insertions(+) create mode 100644 .agents/docs/2026-11-14-add-julixian-tomlkitpp-plan.md create mode 100644 pkgs/j/julixian.tomlkitpp.lua create mode 100644 tests/examples/julixian.tomlkitpp/mcpp.toml create mode 100644 tests/examples/julixian.tomlkitpp/tests/parse_edit_roundtrip.cpp diff --git a/.agents/docs/2026-11-14-add-julixian-tomlkitpp-plan.md b/.agents/docs/2026-11-14-add-julixian-tomlkitpp-plan.md new file mode 100644 index 00000000..bf082e83 --- /dev/null +++ b/.agents/docs/2026-11-14-add-julixian-tomlkitpp-plan.md @@ -0,0 +1,24 @@ +# Add `julixian.tomlkitpp` (v1.0.0) + +## 1. Source & Package Shape + +- **Upstream Repository**: `https://github.com/julixian/tomlkitpp` +- **Package Identity**: `namespace = "julixian"`, `name = "tomlkitpp"` (`pkgs/j/julixian.tomlkitpp.lua`) +- **Version & Tag**: `1.0.0` (`v1.0.0`, SHA256 `b011a2a7a177e3256c2c2d469b65c0a8a85dd8017956092168f0394cc61c49a1`, verified across repeated downloads) +- **License**: `Apache-2.0` +- **Shape**: **Form A** native `mcpp` C++23 module library (`export module tomlkitpp;`). + - Upstream ships a `[workspace]` manifest at the repository root (`mcpp.toml`) covering both the library (`tomlkitpp/`) and the `toml-test` compliance adapter (`tools/toml-test-adapter/`). + - The self-contained library package manifest lives at `tomlkitpp/mcpp.toml`, referenced via `mcpp = "*/tomlkitpp/mcpp.toml"`. + +## 2. Mirror & Autoupdate + +- **CN Mirror**: Author submission without `gitcode.com/mcpp-res` write access; uses plain-string upstream GitHub archive URL per `docs/cn-mirror.md` fallback rules. +- **Autoupdate**: Configured `extensions.autoupdate` with `tag = "v${version}"` and `url = "https://github.com/julixian/tomlkitpp/archive/refs/tags/${tag}.tar.gz"`. + +## 3. Feature Assessment + +- Pure C++23 standard library module library (`import std;`), cross-platform across Linux, macOS, and Windows with zero external dependencies and no optional compiled components; no `features` gating required. + +## 4. Consumer Smoke Test + +- Added workspace member `tests/examples/julixian.tomlkitpp` exercising `import tomlkitpp;`, TOML v1.1.0 parsing (optional seconds, `\xHH` escapes, multiline/trailing-comma inline tables), multidimensional subscript edits, and comment/radix-preserving serialization round-trip. diff --git a/mcpp.toml b/mcpp.toml index 84489f03..c10bbb10 100644 --- a/mcpp.toml +++ b/mcpp.toml @@ -118,6 +118,7 @@ members = [ "tests/examples/imgui-module", "tests/examples/imgui-window", "tests/examples/jwt-cpp", + "tests/examples/julixian.tomlkitpp", "tests/examples/libstdcxx-llvm", "tests/examples/marzer.tomlplusplus", "tests/examples/marzer.tomlplusplus-build-mcpp", diff --git a/pkgs/j/julixian.tomlkitpp.lua b/pkgs/j/julixian.tomlkitpp.lua new file mode 100644 index 00000000..b6375bf2 --- /dev/null +++ b/pkgs/j/julixian.tomlkitpp.lua @@ -0,0 +1,48 @@ +-- Form A descriptor: tomlkitpp ships its own native mcpp.toml under tomlkitpp/. +-- The archive root mcpp.toml is the upstream [workspace] manifest (which also +-- covers the toml-test compliance adapter), so `mcpp = "*/tomlkitpp/mcpp.toml"` +-- points directly at the library package manifest. +-- +-- Pure C++23 standard library implementation (`export module tomlkitpp;`), +-- cross-platform across Linux, macOS, and Windows with no external dependencies. +-- No mcpp-res mirror is configured yet (no CN write access); the plain GLOBAL +-- URL is used until a maintainer mirrors the tarball. +package = { + spec = "1", + namespace = "julixian", + name = "tomlkitpp", + description = "C++23 module-only format-preserving TOML v1.1.0 parser, editor, and serializer (import tomlkitpp;)", + licenses = {"Apache-2.0"}, + repo = "https://github.com/julixian/tomlkitpp", + type = "package", + + extensions = { + autoupdate = { + tag = "v${version}", + url = "https://github.com/julixian/tomlkitpp/archive/refs/tags/${tag}.tar.gz", + }, + }, + + xpm = { + linux = { + ["1.0.0"] = { + url = "https://github.com/julixian/tomlkitpp/archive/refs/tags/v1.0.0.tar.gz", + sha256 = "b011a2a7a177e3256c2c2d469b65c0a8a85dd8017956092168f0394cc61c49a1", + }, + }, + macosx = { + ["1.0.0"] = { + url = "https://github.com/julixian/tomlkitpp/archive/refs/tags/v1.0.0.tar.gz", + sha256 = "b011a2a7a177e3256c2c2d469b65c0a8a85dd8017956092168f0394cc61c49a1", + }, + }, + windows = { + ["1.0.0"] = { + url = "https://github.com/julixian/tomlkitpp/archive/refs/tags/v1.0.0.tar.gz", + sha256 = "b011a2a7a177e3256c2c2d469b65c0a8a85dd8017956092168f0394cc61c49a1", + }, + }, + }, + + mcpp = "*/tomlkitpp/mcpp.toml", +} diff --git a/tests/examples/julixian.tomlkitpp/mcpp.toml b/tests/examples/julixian.tomlkitpp/mcpp.toml new file mode 100644 index 00000000..0923a552 --- /dev/null +++ b/tests/examples/julixian.tomlkitpp/mcpp.toml @@ -0,0 +1,15 @@ +# julixian.tomlkitpp test project: consumes the native Form A C++23 module +# `tomlkitpp` and verifies TOML v1.1.0 parsing, multidimensional subscript edits, +# and comment/format-preserving round-trip serialization under `mcpp test`. +# +# Overrides the workspace-root `compat` redirect with `julixian` so the package +# resolves from this checkout. +[indices] +julixian = { path = "../../.." } + +[package] +name = "julixian-tomlkitpp-tests" +version = "0.1.0" + +[dependencies.julixian] +tomlkitpp = "1.0.0" diff --git a/tests/examples/julixian.tomlkitpp/tests/parse_edit_roundtrip.cpp b/tests/examples/julixian.tomlkitpp/tests/parse_edit_roundtrip.cpp new file mode 100644 index 00000000..1dc250cb --- /dev/null +++ b/tests/examples/julixian.tomlkitpp/tests/parse_edit_roundtrip.cpp @@ -0,0 +1,42 @@ +// Behavioral test for julixian.tomlkitpp: +// TOML v1.1.0 parsing (optional seconds, multiline inline table, \xHH escape), +// typed lookup, in-place surgical edit, and comment/radix preservation. +import std; +import tomlkitpp; + +int main() { + constexpr std::string_view input = + "# Header comment\n" + "mask = 0xff_00\n" + "\n" + "[server]\n" + "endpoint = { host = \"127.0.0.1\", port = 8080, }\n" + "window = 07:30 # TOML 1.1 optional seconds\n" + "tag = \"\\x41B\"\n"; + + auto doc = tomlkit::tryParse(input); + if (!doc) return 1; + + if (tomlkit::findOr(*doc, "mask", std::int64_t{0}) != 0xff00) return 2; + if ((*doc)["server", "endpoint", "host"].get() != "127.0.0.1") return 3; + if ((*doc)["server", "endpoint", "port"].get() != 8080) return 4; + if ((*doc)["server", "tag"].get() != "AB") return 5; + + const auto lt = (*doc)["server", "window"].tryGet(); + if (!lt || lt->hour != 7 || lt->minute != 30 || lt->hasSeconds) return 6; + + // Surgical edit: modify port while keeping comments, 0xff_00 literal, and optional seconds intact. + (*doc)["server", "endpoint", "port"] = 9090; + const std::string emitted = tomlkit::format(*doc); + + if (emitted.find("# Header comment\n") == std::string::npos) return 7; + if (emitted.find("mask = 0xff_00\n") == std::string::npos) return 8; + if (emitted.find("# TOML 1.1 optional seconds\n") == std::string::npos) return 9; + if (emitted.find("window = 07:30") == std::string::npos) return 10; + + auto reparsed = tomlkit::tryParse(emitted); + if (!reparsed) return 11; + if ((*reparsed)["server", "endpoint", "port"].get() != 9090) return 12; + + return 0; +} From a364d33a341c2f7381956c72eaef4912ee8553e9 Mon Sep 17 00:00:00 2001 From: julixian Date: Sat, 14 Nov 2026 06:55:06 +0800 Subject: [PATCH 2/2] feat(julixian.tomlkitpp): sync v1.0.0 archive hash with quickstart template --- .agents/docs/2026-11-14-add-julixian-tomlkitpp-plan.md | 3 ++- pkgs/j/julixian.tomlkitpp.lua | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.agents/docs/2026-11-14-add-julixian-tomlkitpp-plan.md b/.agents/docs/2026-11-14-add-julixian-tomlkitpp-plan.md index bf082e83..f5c1ab07 100644 --- a/.agents/docs/2026-11-14-add-julixian-tomlkitpp-plan.md +++ b/.agents/docs/2026-11-14-add-julixian-tomlkitpp-plan.md @@ -4,11 +4,12 @@ - **Upstream Repository**: `https://github.com/julixian/tomlkitpp` - **Package Identity**: `namespace = "julixian"`, `name = "tomlkitpp"` (`pkgs/j/julixian.tomlkitpp.lua`) -- **Version & Tag**: `1.0.0` (`v1.0.0`, SHA256 `b011a2a7a177e3256c2c2d469b65c0a8a85dd8017956092168f0394cc61c49a1`, verified across repeated downloads) +- **Version & Tag**: `1.0.0` (`v1.0.0`, SHA256 `0a242d7eed2bf1fc785b6becf45b78f948c07c4e36097f4b898e300239691979`, verified across repeated downloads) - **License**: `Apache-2.0` - **Shape**: **Form A** native `mcpp` C++23 module library (`export module tomlkitpp;`). - Upstream ships a `[workspace]` manifest at the repository root (`mcpp.toml`) covering both the library (`tomlkitpp/`) and the `toml-test` compliance adapter (`tools/toml-test-adapter/`). - The self-contained library package manifest lives at `tomlkitpp/mcpp.toml`, referenced via `mcpp = "*/tomlkitpp/mcpp.toml"`. + - Ships a default starter template at `templates/quickstart/` for `mcpp new --template julixian.tomlkitpp`. ## 2. Mirror & Autoupdate diff --git a/pkgs/j/julixian.tomlkitpp.lua b/pkgs/j/julixian.tomlkitpp.lua index b6375bf2..762c20b5 100644 --- a/pkgs/j/julixian.tomlkitpp.lua +++ b/pkgs/j/julixian.tomlkitpp.lua @@ -27,19 +27,19 @@ package = { linux = { ["1.0.0"] = { url = "https://github.com/julixian/tomlkitpp/archive/refs/tags/v1.0.0.tar.gz", - sha256 = "b011a2a7a177e3256c2c2d469b65c0a8a85dd8017956092168f0394cc61c49a1", + sha256 = "0a242d7eed2bf1fc785b6becf45b78f948c07c4e36097f4b898e300239691979", }, }, macosx = { ["1.0.0"] = { url = "https://github.com/julixian/tomlkitpp/archive/refs/tags/v1.0.0.tar.gz", - sha256 = "b011a2a7a177e3256c2c2d469b65c0a8a85dd8017956092168f0394cc61c49a1", + sha256 = "0a242d7eed2bf1fc785b6becf45b78f948c07c4e36097f4b898e300239691979", }, }, windows = { ["1.0.0"] = { url = "https://github.com/julixian/tomlkitpp/archive/refs/tags/v1.0.0.tar.gz", - sha256 = "b011a2a7a177e3256c2c2d469b65c0a8a85dd8017956092168f0394cc61c49a1", + sha256 = "0a242d7eed2bf1fc785b6becf45b78f948c07c4e36097f4b898e300239691979", }, }, },