mirror of
https://github.com/horizon-rust/horizon-mixins.git
synced 2026-12-03 19:34:02 +07:00
[PR #5] [MERGED] 0.6.0: named hooks, bundle crates, data and post-build steps #11
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
horizon-rust/horizon-mixins#11
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/horizon-rust/horizon-mixins/pull/5
Author: @levzzz5154
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @levzzz5154
Base:
main← Head:feat/crates-data-named-hooks📝 Commits (2)
0291f4dNamed hooks, bundle crates, data and post-build steps (0.6.0)b74802dTest and document 0.6.0 bundle crates, data, named hooks and post-build📊 Changes
50 files changed (+1924 additions, -46 deletions)
View changed files
📝
AGENTS.md(+1 -1)📝
Cargo.lock(+5 -3)📝
Cargo.toml(+4 -2)📝
README.md(+14 -1)📝
crates/horizon-mixins-cli/src/main.rs(+6 -4)📝
crates/horizon-mixins-cli/tests/cases/advanced.rs(+1 -1)📝
crates/horizon-mixins-cli/tests/cases/boundary.rs(+3 -1)📝
crates/horizon-mixins-cli/tests/cases/effects.rs(+1 -1)➕
crates/horizon-mixins-cli/tests/cases/native.rs(+375 -0)📝
crates/horizon-mixins-cli/tests/cases/scoped.rs(+1 -1)📝
crates/horizon-mixins-cli/tests/integration.rs(+3 -0)📝
crates/horizon-mixins-cli/tests/snapshots/advanced-plan.json(+2 -2)📝
crates/horizon-mixins-cli/tests/snapshots/boundary-plan.json(+3 -3)📝
crates/horizon-mixins-cli/tests/snapshots/effects-plan.json(+2 -2)📝
crates/horizon-mixins-cli/tests/snapshots/plan.json(+2 -2)📝
crates/horizon-mixins-cli/tests/snapshots/scoped-plan.json(+2 -2)📝
crates/horizon-mixins-core/Cargo.toml(+2 -0)📝
crates/horizon-mixins-core/src/diagnostic.rs(+8 -1)📝
crates/horizon-mixins-core/src/index.rs(+17 -0)📝
crates/horizon-mixins-core/src/lib.rs(+2 -1)...and 30 more files
📄 Description
horizon-mixins 0.6.0: the horizon-mixins half of the native mod API, round 2. Native bundles can now be bigger than a few helper files.
hook+hook_versioninstead oftarget. These are resolved from<workspace>/native-hooks.jsonbefore planning. Name resolution follows arismoko's catalog in horizon-rust/horizon#3871, using the same format. The plan keeps the resolvedtargetand also recordshook/hook_version. New codes:E_HOOK_CATALOG,E_HOOK_UNKNOWN(lists the known names) andE_HOOK_VERSION(lists the versions it has).targettogether withhook, orhookwithouthook_version, isE_MANIFEST.[[crate]]. A bundle's own Cargo package is copied tonative-crates/<mod>/<crate>/and added to the rootmembers. The dependent gets<package> = { path = … }(default dependent:horizon-client). The crate is also added toCargo.lockin Cargo's own format, so the stage still builds with--locked. Manifests are edited withtoml_edit. Dependencies must be plain registry requirements that match a package already in the lock (E_CRATE_DEPENDENCY: "boost needs rand ^0.8, which isn't in Horizon's Cargo.lock").E_CRATErejects[workspace]/[target]/[patch], aCargo.lockin the crate, escaping paths, package-name collisions and unknown dependents.data/is staged tonative-data/<mod>/. This closes the gap that horizon-rust/horizon#3880 notes.[[post_build]]steps are checked (the crate belongs to the same mod, the bin exists) and written tonative-post-build.json, which is[]when no mod has one. The tool never runs them.Everything stays under the existing staging rules: atomic publication, deterministic output, unchanged bytes and mtimes, symlinks and
..rejected. Plans use schema 6.toml_editandsemverwere already inCargo.lockthroughtomlandcargo_metadata, so no new packages were added. Docs:docs/crates-data-and-named-hooks.md, plus a roadmap row and README notes.Tests: new
fixtures/native+fixtures/native-mods/boost. It has a named HEAD hook whose helper calls the bundle crate (boost-engine→ lockedserde_json, which reads its owndata/table.jsonwithinclude_bytes!), reads bundle data, and has abakepost-build bin. The staged workspace passescargo test --workspace --locked --offline. Nine new integration tests (89 in total) cover this path, two mods' crates, and every new error.cargo fmt --check,clippy -D warningsandcargo test --workspace --lockedpass on both 1.95.0 and stable. I also applied a crate bundle to a Horizonmainexport carrying the #3871 catalog;cargo metadata --lockedaccepts the resulting stage.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.