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

create-vite issue of prompts after scaffolding project #6896

Closed
7 tasks done
ghost opened this issue Feb 13, 2022 · 2 comments · Fixed by #6897
Closed
7 tasks done

create-vite issue of prompts after scaffolding project #6896

ghost opened this issue Feb 13, 2022 · 2 comments · Fixed by #6897

Comments

@ghost
Copy link

ghost commented Feb 13, 2022

Describe the bug

Hi team, when I create a vite project inside a folder and input project name with current directory ./.

✔ Project name:  ./

I got prompts after scaffolding project as below:

Done. Now run:

  cd 
  npm install
  npm run dev

I checked packages/create-vite and found the reason at line 266:

if (root !== cwd) {}

I think the condition here needs to be:

if (path.relative(cwd, root)) {}

In this way, when typing ./ is still make sense. If this is a bug, I can raise a PR to fix it.

Reproduction

https://telegra.ph/create-vite-issue-of-prompts-after-scaffolding-project-02-13

System Info

System:
  OS: macOS 12.2
  CPU: (8) x64 Apple M1
  Memory: 390.95 MB / 16.00 GB
  Shell: 3.3.1 - /usr/local/bin/fish
Binaries:
  Node: 17.4.0 - /usr/local/bin/node
  Yarn: 1.22.17 - /usr/local/bin/yarn
  npm: 8.4.1 - /usr/local/bin/npm
Browsers:
  Chrome: 98.0.4758.80
  Safari: 15.3

Used Package Manager

npm

Logs

No response

Validations

@ghost ghost added the pending triage label Feb 13, 2022
@bluwy
Copy link
Member

bluwy commented Feb 13, 2022

Maybe we should use path.resolve here instead?

const root = path.join(cwd, targetDir)

It looks like using path.join and ./, the root would be something like /foo/bar/my-project/ (with a trailing slash), while using path.resolve doesn't have the trailing slash.

Feel free to test it out and make a PR though. I think this is a minor bug.

@Olyno
Copy link
Contributor

Olyno commented Feb 13, 2022

Hi 👋🏻
Looks like it was a mistake from me. I did a pr to fix that. Thanks you for the report!

@github-actions github-actions bot locked and limited conversation to collaborators May 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants