From 0047ff19b2a474755a3512448f9f238d1d75bdb0 Mon Sep 17 00:00:00 2001 From: Gaspard Kirira Date: Thu, 2 Apr 2026 00:57:15 +0300 Subject: [PATCH] chore(release): prepare v2.1.1 --- CHANGELOG.md | 31 +++++ README.md | 2 - docs/cmake_registry_guide.md | 211 +++++++++++++++++++++++++++++++++++ modules/cli | 2 +- modules/db | 2 +- 5 files changed, 244 insertions(+), 4 deletions(-) create mode 100644 docs/cmake_registry_guide.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 0172405..283640c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,37 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 --- ## [Unreleased] +## v2.1.1 + +### Fixes + +- fix(install): support `deps` fallback when loading package manifests + `vix install` now correctly resolves dependencies declared using both `dependencies` and `deps` fields, ensuring proper topological ordering. + +- fix(cmake): stabilize dependency loading order in `.vix/vix_deps.cmake` + Prevents missing target errors when packages depend on each other (e.g. router → http). + +### Improvements + +- feat(cmake): registry-safe generated CMake for applications + Generated `CMakeLists.txt` now: + - safely includes `.vix/vix_deps.cmake` only when present + - allows adding registry packages without breaking builds + - introduces `vix_link_optional_targets(...)` helper for optional dependencies + - provides clear inline guidance for linking registry libraries + +- improve(cmake): better resilience for mixed package formats + Ensures consistent behavior between `vix install`, `vix build`, and `vix run`. + +### Notes + +- This release improves reliability when using the Vix registry with CMake projects. +- Recommended to standardize on `"dependencies"` in package manifests, although `deps` remains supported. + +--- + +Small release. Big stability upgrade. + ## [v2.1.0] This release focuses on performance, developer experience, and ecosystem maturity. diff --git a/README.md b/README.md index 524824f..a4fb7f1 100644 --- a/README.md +++ b/README.md @@ -131,8 +131,6 @@ Run C++ like a script: vix run main.cpp ``` -Open http://localhost:8080 - ## Why Vix.cpp Most systems assume perfect conditions. diff --git a/docs/cmake_registry_guide.md b/docs/cmake_registry_guide.md new file mode 100644 index 0000000..d832263 --- /dev/null +++ b/docs/cmake_registry_guide.md @@ -0,0 +1,211 @@ +# CMake Principles and Vix Registry Strategy + +Deterministic. Composable. Registry-safe. + +--- + +## Overview + +Vix uses CMake as the integration layer between packages, local projects, and generated build scripts. + +This document explains: + +- CMake principles for package authors +- how the Vix registry resolves dependencies safely + +Goal: + +- packages must be easy to consume +- builds must be deterministic +- registry installs must behave consistently across: + - vix install + - vix build + - vix run + +--- + +## Why this matters + +A package in the Vix registry is never built in isolation. + +It becomes part of a dependency graph. + +Therefore it must be: + +- composable +- non-invasive +- predictable +- safe to include + +A package that works alone but pollutes CMake globally is NOT registry-safe. + +--- + +## Core Principles + +### 1. Packages must be dependency-safe + +A package must work in all contexts: + +- standalone +- add_subdirectory(...) +- vix_deps.cmake +- vix run generated CMake + +Avoid global side effects. + +--- + +### 2. Tests and examples must be OFF by default + +```cmake +option(MY_PACKAGE_BUILD_TESTS "Build tests" OFF) +option(MY_PACKAGE_BUILD_EXAMPLES "Build examples" OFF) +``` + +--- + +### 3. Example targets must be prefixed + +Bad: + +```cmake +add_executable(server main.cpp) +``` + +Good: + +```cmake +add_executable(cnerium_server_example_basic main.cpp) +``` + +--- + +### 4. Libraries must expose stable target names + +```cmake +add_library(cnerium_http INTERFACE) +add_library(cnerium::http ALIAS cnerium_http) +``` + +--- + +### 5. Header-only packages must behave like real packages + +```cmake +add_library(cnerium_router INTERFACE) +add_library(cnerium::router ALIAS cnerium_router) + +target_include_directories(cnerium_router INTERFACE include) +target_link_libraries(cnerium_router INTERFACE cnerium::http) +``` + +--- + +### 6. Dependency resolution must be tolerant + +```cmake +if(TARGET cnerium::http) +elseif(TARGET cnerium_http) +elseif(TARGET http::http) +elseif(TARGET http) +endif() +``` + +--- + +### 7. Packages should fail clearly + +```cmake +message(FATAL_ERROR + "cnerium http target not found. + Run: + vix add @cnerium/http + vix install") +``` + +--- + +### 8. Use helper functions + +```cmake +function(cnerium_add_example target file) + add_executable(${target} ${file}) + target_link_libraries(${target} PRIVATE cnerium::server) +endfunction() +``` + +--- + +## Vix Registry Strategy + +### What vix install does + +- reads vix.lock +- resolves dependencies +- builds graph +- sorts packages +- generates `.vix/vix_deps.cmake` + +--- + +### Dependency order + +Correct: + +json → http → router + +--- + +### Metadata + +```json +{ + "dependencies": { + "cnerium/http": "0.7.0" + } +} +``` + +--- + +### vix_deps.cmake + +- loads packages in order +- disables extras +- bridges aliases + +--- + +### Alias bridging + +Supports: + +- cnerium::http +- cnerium_http +- http::http +- http + +--- + +## Checklist + +- tests OFF +- examples OFF +- canonical alias +- no collisions +- clear errors + +--- + +## Rule + +A package is ready when it integrates cleanly into another project. + +--- + +## License + +MIT License +Copyright (c) Gaspard Kirira + diff --git a/modules/cli b/modules/cli index 57d851e..923ea2b 160000 --- a/modules/cli +++ b/modules/cli @@ -1 +1 @@ -Subproject commit 57d851e4ee2b52995f6f09e61959a708ce90cfe8 +Subproject commit 923ea2b5bad1cfd9b0fc76a913a9a4ee821fd636 diff --git a/modules/db b/modules/db index 663c1fd..d589aaa 160000 --- a/modules/db +++ b/modules/db @@ -1 +1 @@ -Subproject commit 663c1fdd181f0621b17d4fb64db123abebbaacb1 +Subproject commit d589aaa932cf3d8c224a3aba072e3a299a229181