From 99ef82a9807578c1e5749156a027949efaba75c4 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Mon, 22 Jun 2026 23:40:47 +0900 Subject: feat(json): resolve bundled Composer schema files via build.rs JsonFile's schema paths previously relied on php_dir() (__DIR__), which has no runtime equivalent. Add a build.rs that copies composer-schema.json and composer-lock-schema.json next to the built executable, and resolve them with std::env::current_exe(). FilesystemRepository now embeds InstalledVersions.php directly via include_str! instead of reading it through php_dir(). Co-Authored-By: Claude Opus 4.8 (1M context) --- .../src/repository/filesystem_repository.rs | 32 +++++++++------------- 1 file changed, 13 insertions(+), 19 deletions(-) (limited to 'crates/shirabe/src/repository') diff --git a/crates/shirabe/src/repository/filesystem_repository.rs b/crates/shirabe/src/repository/filesystem_repository.rs index 86887d1..2f74eaf 100644 --- a/crates/shirabe/src/repository/filesystem_repository.rs +++ b/crates/shirabe/src/repository/filesystem_repository.rs @@ -9,8 +9,8 @@ use shirabe_external_packages::composer::pcre::Preg; use shirabe_php_shim::{ Exception, InvalidArgumentException, LogicException, PhpMixed, SORT_NATURAL, UnexpectedValueException, array_flip, dirname, r#eval, file_get_contents, get_class, - get_class_err, get_debug_type, in_array, is_array, is_null, is_string, ksort, php_dir, - realpath, sort, sort_with_flags, str_repeat, strtr, trim, usort, var_export, + get_class_err, get_debug_type, in_array, is_array, is_null, is_string, ksort, realpath, sort, + sort_with_flags, str_repeat, strtr, trim, usort, var_export, }; use crate::config::is_php_integer_key; @@ -329,25 +329,19 @@ impl FilesystemRepository { &format!("{}/installed.php", repo_dir), &format!("