feat: component create --project flag and next-step hints#934
Merged
Conversation
- Add --project flag to 'component create' for one-step component registration + project attachment. - When --project is omitted, output includes a hint with the exact attach command. If a sibling component in the same parent directory belongs to a project, suggest that project by name. - Include attached project_ids in the output extra field.
Contributor
Homeboy Results —
|
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.
Summary
Fixes #900 —
component createnow guides the user to attach the component to a project.Changes
1.
--projectflagOne command creates the
homeboy.jsonAND attaches the component to the project. No second step needed.2. Next-step hints
When
--projectis omitted, the output includes ahintfield with the exact command to run:3. Smart project suggestion
The hint auto-detects which project to suggest by checking if sibling components in the same parent directory belong to a project. For example, if
/workspace/data-machine/is already attached toextrachill-site, a new component at/workspace/data-machine-socials/will suggestextrachill-site.4. Output includes project attachment
When
--projectis used, the output'sextra.project_idsfield includes the attached project, making it machine-readable.Testing
cargo checkpasses clean