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

Feature requests and suggestions #17

Open
2 of 5 tasks
ganapativs opened this issue Feb 15, 2020 · 8 comments
Open
2 of 5 tasks

Feature requests and suggestions #17

ganapativs opened this issue Feb 15, 2020 · 8 comments
Labels
enhancement New feature or request

Comments

@ganapativs
Copy link

ganapativs commented Feb 15, 2020

This tool has great potential. Here are some features I could think of.

  • Resolving multiple files with the same extension(Not sure if it's already supported)
    If a folder has .js and .jsx and has been imported without extension, resolve order matters here. Make it configurable, optionally use butler.config.js?

  • Watch mode?

    • Need to rethink performance issues as we are reading and modifying most of the files on every run
    • When to really move the file in watch mode?
  • Dry run
    Potentially there will be too many folders/files movement, this might not be what the user always wants by default. There should be a way to see what happens before it actually happens. I could think of two options(Note: we already have information about this in the graph).

    • Print visual diff in the terminal before applying the changes(maybe too long for large projects)
    • Move files and folders and prompt user do you want to keep the changes, If no, revert the changes

These features are already suggested, but, re-adding here with a bit more context.

  • Ignore directories/files/regex pattern
    Some tools like next.js and Gatsby depend on the folder structure. Allow skipping some of the folders and files(Ignore-rules #11)

  • Support running programmatically
    Allow running via node(or any other tool) for flexibility. also, we might need some sort of config file like butler.config.js(oh, no, another config file?)(config file and flags #8)

We can also have a GitHub project board where we can track progress. I'm really excited about the future of this project 🎉

@AnatoleLucet AnatoleLucet added the enhancement New feature or request label Feb 16, 2020
@sQVe sQVe mentioned this issue Feb 18, 2020
@waynevanson
Copy link
Contributor

waynevanson commented Feb 18, 2020

Love what you have here.

My two cents on watch mode: I feel like this package should be part of a git workflow and not watch mode at all.

I would personally use this package only after my tree is clean and I'm about to push. Similar to how yarn publish will auto commit the bump of a version number in package.json.

Config files are gross, but what other options are there? We could just put them inline as CLI args in package.json. So destiny --arg-one value --arg-2-as-boolean

@sQVe
Copy link
Collaborator

sQVe commented Feb 18, 2020

@waynevanson I agree and think one of the major issues we need to solve is how to use destiny in a project using git or any other version control solution. Moving and renaming files can be such a hassle for merge conflicts.

I do not really envision destiny to be a tool that should run automatically but rather a tool that you run at specific times when you and your team members are all in sync.

@waynevanson
Copy link
Contributor

@sQVe I just added to my comment if you'd like to see more.

Moving and renaming files can be such a hassle for merge conflicts.

Yeah that looks like a huge pain. I wonder what will be the solution.

In teams, it would be harder to use on an automatic basis. I agree with you.

@benawad
Copy link
Owner

benawad commented Feb 18, 2020

We are using git mv, so I think that should prevent any merge conflicts related to the file being moved/renamed. Haven't tested that yet though, so not 100% sure.

@ganapativs
Copy link
Author

We are using git mv, so I think that should prevent any merge conflicts related to the file being moved/renamed. Haven't tested that yet though, so not 100% sure.

There will be conflicts if the team/individual use squash and merge when merging. This should be added to FAQ probably.

Watch mode?

Also, I completely agree that probably there should not be a watch mode. Watch mode complicates things a lot and might not really be useful in most of the cases.

@benawad
Copy link
Owner

benawad commented Feb 21, 2020

@ganapativs What would be the sequence of steps to replicate the conflict? Are you thinking:
User 1 git move a file
User 2 make a change in that file then squash, then pull User 1 changes

@ganapativs
Copy link
Author

This probably should work(Needs testing)

User 1 git moves the file(say in fresh branch-1 from the master)
User 2 edits the same file(in fresh branch-2 from the master, may be just editing the imports in the
same file should work)
User 2 squashes and merges his changes to master
User 1 takes the pull(should probably get the conflict as User 2 changes history is lost when squashed)

Optionally, User 2 should get conflicts if User 1 changes are squashed and merged first.

This happened to me many times in large PRs, I expect it to happen here also.

@sQVe
Copy link
Collaborator

sQVe commented Feb 22, 2020

@ganapativs Squashing is not relevant in your example. Squashing problems will occur when you branch from a commit that later in time gets squashes - for example a feature branch that is based on another feature branch. What your example is explaining is just a simple merge conflict due to two parts changing the same thing. This is nothing that we'll be able to solve and will have to be handled manually.

What we do is make the merge conflicts easier by marking moved files as moved in Git.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants