joshwcomeau / guppy

🐠A friendly application manager and task runner for React.js
ISC License
3.27k stars 154 forks source link

Allow custom project name #229

Closed c-kirkeby closed 6 years ago

c-kirkeby commented 6 years ago

Is your feature request related to a problem? Please describe. I have an existing project split into a front-end and a backend folder structure as per below:

/snazzy_project_name
  /client (CRA root directory)
  /api (express backend)

When you import the client directory, it shows up as 'client' in your projects. I'd imagine that if you have a few projects named this way, it'd be hard to distinguish between them. It's not possible to import the top level directory as Guppy says it can't detect CRA or gatsby.

Describe the solution you'd like A nice simple option would be to create an onClick handler on the project title or an icon button next to it to allow the text to be changed.

Describe alternatives you've considered Alternatively Guppy could detect that CRA or Guppy are located at a lower directory and inherit the name from the top directory, but I understand the complexity of searching potentially many folders.

Additional context I'm using this on Windows 10 64-bit 1803 build 17134.228.

AWolf81 commented 6 years ago

@JheeBz Thanks for the feature request. I think this should be possible once PR #120 Project configuration landed (It's almost ready - just need to do one final fix due to recent projectPath change feature).

Once this is available you can import client folder and then re-name the project. After the rename you will get a prompt if you want to rename the project folder as well. Clicking no will keep your client folder name and only change name inside package.json of client project.

Maybe we could also add it to the import dialog so you can rename this directly - something like an import options dialog.

Or we could also add a scanning for subfolders with a CRA app then you could import the top-level directory and it would use the name of the top-level package.json.

c-kirkeby commented 6 years ago

@AWolf81 thanks, I did a quick search for existing tickets and I couldn't find one like this, I clearly missed #120. I'm happy for this to be closed either in advance or once that PR is merged.

mathieudutour commented 6 years ago

it's now merged 🎉