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

Validate directory name <rootPath> provided with gatsby new #13153

Closed
jamesgeorge007 opened this issue Apr 5, 2019 · 2 comments · Fixed by #13158
Closed

Validate directory name <rootPath> provided with gatsby new #13153

jamesgeorge007 opened this issue Apr 5, 2019 · 2 comments · Fixed by #13158
Assignees

Comments

@jamesgeorge007
Copy link
Contributor

jamesgeorge007 commented Apr 5, 2019

Description

rootPath name provided with gatsby new should be validated inorder to keep up with npm naming conventions.

There is actually an npm package inorder to perform the validation => validate-npm-package-name

Steps to reproduce

Fire in gatsby new *^#

Expected result

A suitable warning such as that the naming is not as per convention.

Actual result

A directory is being created <rootPath> named as *^#

Environment

System:
    OS: Linux 4.18 Ubuntu 18.10 (Cosmic Cuttlefish)
    CPU: (4) x64 Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz
    Shell: 4.4.19 - /bin/bash
  Binaries:
    Node: 8.11.4 - /usr/bin/node
    Yarn: 1.13.0 - /usr/local/bin/yarn
    npm: 6.9.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 73.0.3683.75
    Firefox: 66.0.2
  npmGlobalPackages:
    gatsby-cli: 2.5.5
@jamesgeorge007 jamesgeorge007 added type: bug An issue or pull request relating to a bug in Gatsby type: feature or enhancement labels Apr 5, 2019
@jamesgeorge007 jamesgeorge007 self-assigned this Apr 5, 2019
@jamesgeorge007 jamesgeorge007 changed the title Validate directory names as provided with gatsby new Validate directory name <rootPath> provided with gatsby new Apr 5, 2019
@jamesgeorge007 jamesgeorge007 added the type: question or discussion Issue discussing or asking a question about Gatsby label Apr 5, 2019
@jamesgeorge007
Copy link
Contributor Author

@pieh Your thoughts 🤔

@pieh
Copy link
Contributor

pieh commented Apr 5, 2019

It does make sense. I'm not sure if validate-npm-package-name is one to use - npm package names might have additional restrictions that directory names might not have. What about https://www.npmjs.com/package/is-valid-path ?

@LekoArts LekoArts removed type: bug An issue or pull request relating to a bug in Gatsby type: question or discussion Issue discussing or asking a question about Gatsby labels Apr 6, 2019
jamesgeorge007 added a commit to jamesgeorge007/gatsby that referenced this issue Apr 8, 2019
pieh pushed a commit that referenced this issue Apr 13, 2019
…equired (#13158)

* Validate rootPath to follow the naming conventions

Towards #13153

* Linting fixes 🚧

* Minor fix 🚧

Use is-valid-path instead of validate-npm-package-name

* Minor fix 🚧

Co-Authored-By: jamesgeorge007 <jamesgeorge998001@gmail.com>

* show resolved path

* update yarn.lock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants