-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update component migration to support status of "stable" #1262
Conversation
🦋 Changeset detectedLatest commit: cb19c67 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow awesome, thanks! 🎉 Could you add a changeset tho?
Co-authored-by: Cameron Dutro <[email protected]>
problem
as part of #676, there are some components that need to be renamed but are already set as
status :stable
. for example, thePrimer::BoxComponent
needs to be renamed toPrimer::Box
. however, the current component migration task only support a status ofalpha
,beta
, ordeprecaated
.solution
this PR makes significant updates to
component_status_migrator.thor
, to allow for a status ofstable
in addition to the existing status entries.with this change, there are many file moves and file content changes that need to understand whether or not the new status is set to
stable
, and adjust the changes accordingly. for example, files do not need to be placed in astable
sub-folder. they should be placed in the root components folder. class names, variable names, etc, need to exclude the wordstable
when updating files, as well.this PR also cleans up some of the inconsistencies in the thor task code by extracting a
move_file
method, and adding some additional helper methods. some additional logging was also added to note when file moves or other changes are not neededexample: migrating
BoxComponent
toBox
the
Primer::BoxComponent
is currentlystable
and exists in the correct folder. however, the wordComponent
needs to be removed. here is the output of running the status migrator to handle the rename:and the file changes from
git status
(aftergit add .
to ensure file renames are displayed correctly):known issues
both the current and this updated version of the migration script are unable to move files from any folder other than the root
components/primer
folder. for example,Primer::Alpha::ButtonMarketing
currently exists in thecomponents/primer/alpha
folder. if the migration script is run to try and move this folder it will fail because the files don't currently exist in the root folder.this is a separate issue that has been logged as issue #1263 and will require a separate PR to correct