chore(release): prepare public source release

This commit is contained in:
MercuryToolbox Release
2026-07-18 15:33:01 +08:00
commit 34d6a57f38
510 changed files with 163501 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
[package]
name = "sysshape"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
authors.workspace = true
readme.workspace = true
publish.workspace = true
description = "Capture a compact local system and tool inventory for AI-friendly triage."
keywords.workspace = true
categories.workspace = true
[lints]
workspace = true
[dependencies]
common = { path = "../common", default-features = false }
lexopt.workspace = true
serde.workspace = true
[target.'cfg(windows)'.dependencies]
windows-sys = { workspace = true, features = ["Win32_Foundation", "Win32_Storage_FileSystem", "Win32_System_Registry", "Win32_System_SystemInformation", "Wdk_System_SystemServices"] }
[target.'cfg(not(windows))'.dependencies]
sysinfo.workspace = true
[dev-dependencies]
assert_cmd.workspace = true
predicates.workspace = true
tempfile.workspace = true
File diff suppressed because it is too large Load Diff
+6
View File
@@ -0,0 +1,6 @@
//! Binary entry point for `sysshape`.
#![allow(clippy::multiple_crate_versions)]
fn main() {
std::process::exit(sysshape::main_entry());
}
+57
View File
@@ -0,0 +1,57 @@
//! Integration tests for the `sysshape` command.
use assert_cmd::Command;
use predicates::prelude::*;
use std::fs;
use tempfile::tempdir;
fn cargo_command() -> Command {
Command::cargo_bin("sysshape").expect("binary")
}
#[test]
fn summarizes_system_as_json() {
let mut command = cargo_command();
command
.args(["--json", "--env", "safe", "--group", "shell"])
.assert()
.success()
.stdout(predicate::str::contains("\"system\""))
.stdout(predicate::str::contains("\"architecture\""))
.stdout(predicate::str::contains("\"tools\""));
}
#[test]
fn detects_only_present_shimmed_tools() {
let temp = tempdir().expect("tempdir");
let cargo_cmd = temp.path().join("cargo.cmd");
let cmake_cmd = temp.path().join("cmake.cmd");
fs::write(&cargo_cmd, "@echo off\r\necho cargo 9.9.9\r\n").expect("cargo shim");
fs::write(&cmake_cmd, "@echo off\r\necho cmake version 3.99.0\r\n").expect("cmake shim");
let mut command = cargo_command();
command
.args(["--json", "--env", "none", "--group", "all"])
.env("PATH", temp.path())
.env("PATHEXT", ".CMD;.EXE")
.assert()
.success()
.stdout(predicate::str::contains("\"name\":\"cargo\""))
.stdout(predicate::str::contains("\"version\":\"cargo 9.9.9\""))
.stdout(predicate::str::contains("\"name\":\"cmake\""))
.stdout(predicate::str::contains(
"\"version\":\"cmake version 3.99.0\"",
));
}
#[test]
fn help_includes_group_and_env_examples() {
let mut command = cargo_command();
command
.arg("--help")
.assert()
.success()
.stdout(predicate::str::contains("--env"))
.stdout(predicate::str::contains("--group"))
.stdout(predicate::str::contains("sysshape --json"));
}