diff --git a/resources/doc/config.md b/resources/doc/config.md index 356806f..e1f384f 100644 --- a/resources/doc/config.md +++ b/resources/doc/config.md @@ -379,7 +379,7 @@ You can define the custom directory for `package.json` file with the option `roo { "config": { "foxy": { - "root-package-dir": "./module/theme" + "root-package-json-dir": "module/theme" } } } diff --git a/src/Asset/AbstractAssetManager.php b/src/Asset/AbstractAssetManager.php index cb45e5b..a445fad 100644 --- a/src/Asset/AbstractAssetManager.php +++ b/src/Asset/AbstractAssetManager.php @@ -137,7 +137,7 @@ public function run(): int return 0; } - $rootPackageDir = $this->config->get('root-package-dir'); + $rootPackageDir = $this->config->get('root-package-json-dir'); if (is_string($rootPackageDir) && !empty($rootPackageDir)) { if (!is_dir($rootPackageDir)) { diff --git a/src/Util/AssetUtil.php b/src/Util/AssetUtil.php index 1041efc..f835992 100644 --- a/src/Util/AssetUtil.php +++ b/src/Util/AssetUtil.php @@ -64,7 +64,7 @@ public static function getPath( if (null !== $composerJsonPath && \file_exists($composerJsonPath)) { /** @var array[] $composerJson */ $composerJson = \json_decode(\file_get_contents($composerJsonPath), true); - $rootPackageDir = $composerJson['config']['foxy']['root-package-dir'] ?? null; + $rootPackageDir = $composerJson['config']['foxy']['root-package-json-dir'] ?? null; if (null !== $installPath && \is_string($rootPackageDir)) { $installPath .= '/' . $rootPackageDir; diff --git a/tests/Asset/AssetManager.php b/tests/Asset/AssetManager.php index 6eab47b..c2e756b 100644 --- a/tests/Asset/AssetManager.php +++ b/tests/Asset/AssetManager.php @@ -294,11 +294,11 @@ public function testSpecifyCustomDirectoryFromPackageJson(): void { $this->config = new Config( [], - ['run-asset-manager' => true, 'root-package-dir' => $this->cwd], + ['run-asset-manager' => true, 'root-package-json-dir' => $this->cwd], ); $this->manager = $this->getManager(); - $this->assertSame($this->cwd, $this->config->get('root-package-dir')); + $this->assertSame($this->cwd, $this->config->get('root-package-json-dir')); $this->assertSame(0, $this->getManager()->run()); } @@ -309,7 +309,7 @@ public function testSpecifyCustomDirectoryFromPackageJsonException(): void $this->config = new Config( [], - ['run-asset-manager' => true, 'root-package-dir' => 'path/to/invalid'], + ['run-asset-manager' => true, 'root-package-json-dir' => 'path/to/invalid'], ); $this->manager = $this->getManager(); diff --git a/tests/Fixtures/package/global/composer.json b/tests/Fixtures/package/global/composer.json index 6fa349c..7f9ee8a 100644 --- a/tests/Fixtures/package/global/composer.json +++ b/tests/Fixtures/package/global/composer.json @@ -1,7 +1,7 @@ { "config": { "foxy": { - "root-package-dir": "theme", + "root-package-json-dir": "theme", "global-composer-foo": 70, "global-composer-bar": 70 }