aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-08-09 11:20:24 +0900
committernsfisis <nsfisis@gmail.com>2026-08-09 11:20:24 +0900
commita8a4b54b90e6433cf4a25a88a4765243f831ebef (patch)
tree91cceee5d792c6973e7a053a36d60441ce30bf64
parent6051927c8fa32cfffa102d2a170c5a6cf747a1b9 (diff)
downloadphp-shirabe-a8a4b54b90e6433cf4a25a88a4765243f831ebef.tar.gz
php-shirabe-a8a4b54b90e6433cf4a25a88a4765243f831ebef.tar.zst
php-shirabe-a8a4b54b90e6433cf4a25a88a4765243f831ebef.zip
refactor(seld-json-lint): extract seld/json_lint into the shirabe-seld-json-lint crate
Move `Seld\JsonLint` out of shirabe-external-packages and into its own crate, so the path is `shirabe_seld_json_lint::ParsingException` instead of `shirabe_external_packages::seld::json_lint::ParsingException`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
-rw-r--r--Cargo.lock9
-rw-r--r--Cargo.toml1
-rw-r--r--crates/shirabe-external-packages/src/seld.rs2
-rw-r--r--crates/shirabe-seld-json-lint/Cargo.toml11
-rw-r--r--crates/shirabe-seld-json-lint/src/lib.rs (renamed from crates/shirabe-external-packages/src/seld/json_lint.rs)0
-rw-r--r--crates/shirabe-seld-json-lint/src/parsing_exception.rs (renamed from crates/shirabe-external-packages/src/seld/json_lint/parsing_exception.rs)0
-rw-r--r--crates/shirabe/Cargo.toml1
-rw-r--r--crates/shirabe/src/console/application.rs2
-rw-r--r--crates/shirabe/src/installer.rs2
-rw-r--r--crates/shirabe/src/json/json_file.rs2
-rw-r--r--crates/shirabe/src/package/locker.rs2
-rw-r--r--crates/shirabe/tests/json/json_file_test.rs2
12 files changed, 27 insertions, 7 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 6fab5780..f50b37dc 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2102,6 +2102,7 @@ dependencies = [
"shirabe-pcre",
"shirabe-php-rpc",
"shirabe-php-shim",
+ "shirabe-seld-json-lint",
"shirabe-semver",
"shirabe-spdx-licenses",
"shirabe-symfony-console",
@@ -2205,6 +2206,14 @@ name = "shirabe-php-src"
version = "0.0.1"
[[package]]
+name = "shirabe-seld-json-lint"
+version = "0.0.1"
+dependencies = [
+ "anyhow",
+ "shirabe-php-shim",
+]
+
+[[package]]
name = "shirabe-semver"
version = "0.0.1"
dependencies = [
diff --git a/Cargo.toml b/Cargo.toml
index afe64563..e87efbe6 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -15,6 +15,7 @@ shirabe-pcre = { path = "crates/shirabe-pcre" }
shirabe-php-rpc = { path = "crates/shirabe-php-rpc" }
shirabe-php-shim = { path = "crates/shirabe-php-shim" }
shirabe-php-src = { path = "crates/shirabe-php-src" }
+shirabe-seld-json-lint = { path = "crates/shirabe-seld-json-lint" }
shirabe-semver = { path = "crates/shirabe-semver" }
shirabe-spdx-licenses = { path = "crates/shirabe-spdx-licenses" }
shirabe-symfony-console = { path = "crates/shirabe-symfony-console" }
diff --git a/crates/shirabe-external-packages/src/seld.rs b/crates/shirabe-external-packages/src/seld.rs
index b7c12c45..ffe32e07 100644
--- a/crates/shirabe-external-packages/src/seld.rs
+++ b/crates/shirabe-external-packages/src/seld.rs
@@ -1,5 +1,3 @@
-pub mod json_lint;
pub mod signal;
-pub use json_lint::*;
pub use signal::*;
diff --git a/crates/shirabe-seld-json-lint/Cargo.toml b/crates/shirabe-seld-json-lint/Cargo.toml
new file mode 100644
index 00000000..907e382c
--- /dev/null
+++ b/crates/shirabe-seld-json-lint/Cargo.toml
@@ -0,0 +1,11 @@
+[package]
+name = "shirabe-seld-json-lint"
+version.workspace = true
+edition.workspace = true
+
+[dependencies]
+shirabe-php-shim.workspace = true
+anyhow.workspace = true
+
+[lints]
+workspace = true
diff --git a/crates/shirabe-external-packages/src/seld/json_lint.rs b/crates/shirabe-seld-json-lint/src/lib.rs
index 2165c8f2..2165c8f2 100644
--- a/crates/shirabe-external-packages/src/seld/json_lint.rs
+++ b/crates/shirabe-seld-json-lint/src/lib.rs
diff --git a/crates/shirabe-external-packages/src/seld/json_lint/parsing_exception.rs b/crates/shirabe-seld-json-lint/src/parsing_exception.rs
index 9d3eaa57..9d3eaa57 100644
--- a/crates/shirabe-external-packages/src/seld/json_lint/parsing_exception.rs
+++ b/crates/shirabe-seld-json-lint/src/parsing_exception.rs
diff --git a/crates/shirabe/Cargo.toml b/crates/shirabe/Cargo.toml
index 6623ba80..35aa4737 100644
--- a/crates/shirabe/Cargo.toml
+++ b/crates/shirabe/Cargo.toml
@@ -10,6 +10,7 @@ shirabe-metadata-minifier.workspace = true
shirabe-pcre.workspace = true
shirabe-php-rpc.workspace = true
shirabe-php-shim.workspace = true
+shirabe-seld-json-lint.workspace = true
shirabe-semver.workspace = true
shirabe-spdx-licenses.workspace = true
shirabe-symfony-console.workspace = true
diff --git a/crates/shirabe/src/console/application.rs b/crates/shirabe/src/console/application.rs
index 2e93c33d..f5c953da 100644
--- a/crates/shirabe/src/console/application.rs
+++ b/crates/shirabe/src/console/application.rs
@@ -55,7 +55,6 @@ use crate::util::Platform;
use crate::util::Silencer;
use indexmap::IndexMap;
use shirabe_external_packages::composer::xdebug_handler::XdebugHandler;
-use shirabe_external_packages::seld::json_lint::ParsingException;
use shirabe_php_shim::Catch as _;
use shirabe_php_shim::{
LogicException as ShimLogicException, PHP_VERSION, PHP_VERSION_ID, PhpMixed, RuntimeException,
@@ -66,6 +65,7 @@ use shirabe_php_shim::{
php_uname, posix_getuid, random_bytes, realpath, restore_error_handler, round, str_contains,
str_replace, strpos, strtoupper, sys_get_temp_dir, time, unlink,
};
+use shirabe_seld_json_lint::ParsingException;
use shirabe_symfony_console::application::Application as BaseApplication;
use shirabe_symfony_console::command::Command as SymfonyCommand;
use shirabe_symfony_console::command::help_command::HelpCommand;
diff --git a/crates/shirabe/src/installer.rs b/crates/shirabe/src/installer.rs
index 22da3fff..4ff6af3d 100644
--- a/crates/shirabe/src/installer.rs
+++ b/crates/shirabe/src/installer.rs
@@ -34,11 +34,11 @@ pub use suggested_packages_reporter::*;
use crate::io::io_interface;
use indexmap::IndexMap;
-use shirabe_external_packages::seld::json_lint::ParsingException;
use shirabe_php_shim::{
PhpMixed, RuntimeException, array_map, array_unique, implode, intval, is_dir, is_numeric,
strcmp, strpos, strtolower, touch, usort,
};
+use shirabe_seld_json_lint::ParsingException;
use shirabe_semver;
use crate::advisory::AuditConfig;
diff --git a/crates/shirabe/src/json/json_file.rs b/crates/shirabe/src/json/json_file.rs
index f506a831..b08a7a97 100644
--- a/crates/shirabe/src/json/json_file.rs
+++ b/crates/shirabe/src/json/json_file.rs
@@ -9,7 +9,6 @@ use crate::util::Filesystem;
use crate::util::HttpDownloader;
use crate::util::Silencer;
use indexmap::IndexMap;
-use shirabe_external_packages::seld::json_lint::{ParsingException, ParsingExceptionDetails};
use shirabe_pcre::{CaptureKey, Preg};
use shirabe_php_shim::Catch as _;
use shirabe_php_shim::{
@@ -18,6 +17,7 @@ use shirabe_php_shim::{
file_put_contents, is_dir, is_file, json_decode, json_encode_ex, mkdir, php_regex, realpath,
str_contains, str_ends_with, str_repeat, strlen, strpos, usleep,
};
+use shirabe_seld_json_lint::{ParsingException, ParsingExceptionDetails};
#[derive(Debug, Clone)]
pub struct JsonEncodeOptions {
diff --git a/crates/shirabe/src/package/locker.rs b/crates/shirabe/src/package/locker.rs
index 67b2d5b4..ccfb2ddf 100644
--- a/crates/shirabe/src/package/locker.rs
+++ b/crates/shirabe/src/package/locker.rs
@@ -24,7 +24,6 @@ use crate::repository::RootPackageRepository;
use crate::util::Git as GitUtil;
use crate::util::ProcessExecutor;
use indexmap::IndexMap;
-use shirabe_external_packages::seld::json_lint::ParsingException;
use shirabe_pcre::{CaptureKey, Preg};
use shirabe_php_shim::Catch as _;
use shirabe_php_shim::{
@@ -32,6 +31,7 @@ use shirabe_php_shim::{
array_map, array_merge, file_get_contents, filemtime, function_exists, hash, in_array_loose,
is_int, ksort, php_regex, realpath, strcmp, strtolower, touch2, trim, usort,
};
+use shirabe_seld_json_lint::ParsingException;
/// Reads/writes project lockfile (composer.lock).
#[derive(Debug)]
diff --git a/crates/shirabe/tests/json/json_file_test.rs b/crates/shirabe/tests/json/json_file_test.rs
index a20e7234..27b43a05 100644
--- a/crates/shirabe/tests/json/json_file_test.rs
+++ b/crates/shirabe/tests/json/json_file_test.rs
@@ -2,9 +2,9 @@
use indexmap::IndexMap;
use shirabe::json::{JsonEncodeOptions, JsonFile, JsonValidationException};
-use shirabe_external_packages::seld::json_lint::ParsingException;
use shirabe_php_shim::Catch as _;
use shirabe_php_shim::PhpMixed;
+use shirabe_seld_json_lint::ParsingException;
/// ref: JsonFileTest::expectParseException
fn expect_parse_exception(text: &str, json: &str) {