Conversation
Deck::activate() only accepted an int, so Deck::activate('order-summary', 'v2')
raised a TypeError. The 0.4.2 notes described both get() and activate() as
accepting mixed version types, but only get() was widened at the time. The CLI
masked it because ActivatePromptCommand parses to an int before calling.
Both methods now resolve through the ResolvesVersion trait, so 2, '2', and 'v2'
are equivalent. Passing an int continues to work.
An unparseable version previously produced a message with the version missing
entirely, such as "Version for prompt [order-summary] does not exist." Both
methods now throw InvalidVersionException naming the offending value.
Every structure diagram omitted the version-level metadata.json that make:prompt has written since 0.4.4. The README additionally showed a user.md that make:prompt does not create without --user, and a second version that a single run does not create. Multi-version diagrams now mark which version is live, and the README shows prompt:list output alongside the tree. Creating a version has not changed the active version since 0.4.4, but the README still described new versions as activating automatically. Documents activate() accepting string|int, and corrects the get() signature, which read ?int rather than string|int|null. Diagrams were taken from real scaffolds rather than written by hand.
Formatting was never verified in CI, which let the whole codebase drift out of Pint compliance before 0.4.4. The style check runs on a single PHP version since formatting does not vary across the matrix. CHANGELOG.md and the documentation site's changelog are written separately and drift silently, which happened while preparing this release. The parity job asserts every released version appears in both, in the same order. The test workflow now runs `composer test` rather than calling Pest directly, so CI and the documented contributor command cannot diverge.
Contributor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation and Context
Deck::activate()never accepted the string versions its release notes promised. Thev0.4.2entry states thatget()andactivate()both "support mixed types for version signature", but onlyget()was widened.Deck::activate('order-summary', 'v2')has raised aTypeErrorever since. The CLI hid it, becauseActivatePromptCommandparses to anintbefore calling — so the bug only surfaced for anyone calling the facade directly, which is exactly what the notes told them they could do.Both methods now resolve through the
ResolvesVersiontrait, so2,'2', and'v2'are equivalent. Widening a parameter is backward compatible; passing anintis unaffected.Unparseable versions produced a message with the version missing.
Deck::get('order-summary', 'banana')reportedVersion for prompt [order-summary] does not exist.— note the empty gap. Both methods now throwInvalidVersionExceptionnaming the offending value.Every prompt structure diagram was out of date. None showed the version-level
metadata.jsonthatmake:prompthas written sincev0.4.4. The README was wrong in two further ways: it showed auser.mdthat is not created without--user, and a second version that a single run does not create. It also described new versions as becoming active automatically, which stopped being true inv0.4.4.Two CI gaps. Formatting was never checked, which is how the codebase drifted out of Pint compliance before
v0.4.4. AndCHANGELOG.mdand the docs changelog drifted apart while preparing this very release.Dependencies
None. No new packages, no migrations, no configuration changes.
Test Instructions
Each of the four commits was verified green in isolation, so the history is bisectable.
Manual QA:
Deck::activate('order-summary', 'v2')andDeck::activate('order-summary', 2)both promote v2. Previously the first raised aTypeError.Deck::get('order-summary', 'banana')throwsInvalid version [banana] for prompt [order-summary]. Use a positive number like [1] or [v1].php artisan make:prompt order-summaryproduces exactly the tree in the README —metadata.json,v1/metadata.json,v1/system.md, and nouser.md.Notes for review
get()names the offending value butactivate()stillTypeErrors on strings — a worse state to bisect to than either endpoint.