diff --git a/CHANGELOG.md b/CHANGELOG.md index 57b9beb..6d98f83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Removed +## [0.4.2] - 2026-05-27 + +### Fixed + +- Refactored `ActivatePromptCommand` and `PromptManager` to Use `ResolvesVersion` trait for version resolution in prompt retrieval and activation and support mixed types for version signature on `get` and `activate` methods. + ## [0.4.1] - 2026-05-17 ### Fixed diff --git a/src/Concerns/ResolvesVersion.php b/src/Concerns/ResolvesVersion.php new file mode 100644 index 0000000..9cc1baa --- /dev/null +++ b/src/Concerns/ResolvesVersion.php @@ -0,0 +1,29 @@ +getActiveVersion($name); + if ($version === null) { + $version = $this->getActiveVersion($name); + } else { + $versionInput = (string) $version; + $version = $this->parseVersion($versionInput); + } + $cacheKey = $this->config->get('deck.cache.prefix', 'deck:')."{$name}.v{$version}"; // Attempt to load from cache. @@ -233,7 +243,7 @@ protected function getActiveVersion(string $name): int * version directory, so any role scaffolded by make:prompt is * automatically available at runtime. */ - protected function loadFromFiles(string $name, int $version): array + protected function loadFromFiles(string $name, ?int $version): array { $versionPath = "{$this->basePath}/{$name}/v{$version}";