Skip to content
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

bug: updating a component with the CLI does not remove files that are deleted upstream #530

Closed
ollema opened this issue Dec 9, 2023 · 4 comments
Labels
type: bug A confirmed report of unexpected behavior in the application

Comments

@ollema
Copy link
Contributor

ollema commented Dec 9, 2023

Current Behavior

right now, when updating the Select component from a version < #500 to a version >= #500 with the CLI results in a leftover select.svelte.

this file was removed in #500 but the CLI only add or modifies files so it's still present after upgrading, which can be confusing (especially if it causes linting issues like it did for me in #528)

Expected Behavior

the select.svelte file should not remain after updating the Select component

More Information

I think the most reasonable option is to delete all files in a component folder before writing the new version there.

there is already a disclaimer that any potential modifications will be overwritten and the one should use source control.

so I don't think there is any additional risks with clearing the component folder before writing to it. instead I think it will lead to less confusion and fewer surprises

@ollema ollema added the type: bug A confirmed report of unexpected behavior in the application label Dec 9, 2023
@ollema
Copy link
Contributor Author

ollema commented Dec 9, 2023

if you agree, I can attempt to work on this

@ollema ollema changed the title bug?: updating a component with the CLI does not remove files that are deleted upstream bug: updating a component with the CLI does not remove files that are deleted upstream Dec 9, 2023
@huntabyte
Copy link
Owner

Hmm, this is something I'm not 100% sure if we want to wipe the entire directory out with, even files that we don't control, but if not, we'd basically need a way to track the previous and current versions to determine if a file was deleted.

It should be very very rare that something is deleted from the original, in the case of the Select it wasn't necessary to include it in the first place, and was an oversight on my end.

I'll see if @AdrianGonz97 has any thoughts on this one, but my gut tells me we should not blow out the entire directory!

@AdrianGonz97
Copy link
Collaborator

I'm not really comfortable deleting the whole folder as there may be additional files in there that we may not even own.. Honestly, I don't think any action is really necessary and we should just let the user handle it on their own.

@huntabyte
Copy link
Owner

Closing as not planned for now!

@huntabyte huntabyte closed this as not planned Won't fix, can't repro, duplicate, stale Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

3 participants