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

[CLI] lb4 does not create app with uppercase letters #1663

Open
hacksparrow opened this issue Aug 31, 2018 · 10 comments
Open

[CLI] lb4 does not create app with uppercase letters #1663

hacksparrow opened this issue Aug 31, 2018 · 10 comments
Assignees
Labels
CLI developer-experience Issues affecting ease of use and overall experience of LB users feature good first issue

Comments

@hacksparrow
Copy link
Contributor

hacksparrow commented Aug 31, 2018

Description / Steps to reproduce / Feature proposal

$ lb4 myLB4app
> Generation is aborted: Invalid npm package name: myLB4app

This is likely due to the package.json's name format restriction. We should use the user-submitted name for everything (directory name etc.), except for the name property in package.json; for that, CLI should do the hyphenation and lowercasing for the user.

Thoughts?

Current Behavior

lb4 refuses to create an app if it contains uppercase letters.

Expected Behavior

Should allow creation of apps with uppercase and lowercase letters.

See Reporting Issues for more tips on writing good issues

@raymondfeng
Copy link
Contributor

Another option is to prompt the npm package name with a default value by convention if the name fails validation. The other use case is for scoped packages such as @myorg/mypkg.

@dhmlau dhmlau added the developer-experience Issues affecting ease of use and overall experience of LB users label Sep 23, 2018
@dhmlau dhmlau removed the post-GA label Nov 2, 2018
@vvdwivedi
Copy link
Contributor

@raymondfeng can I implement an extra option for npm package name in the generator as this seems the right implementation.

@bajtos
Copy link
Member

bajtos commented Jun 20, 2019

can I implement an extra option for npm package name in the generator as this seems the right implementation.

@vvdwivedi that's great! Let us know if you need any help along the way. See Contributing code and Submitting a pull request to LoopBack 4 to get you started.

@vvdwivedi
Copy link
Contributor

Sure, will start a PR soon.

@javiersantossanchez
Copy link

javiersantossanchez commented Dec 24, 2019

Hi everybody, I am looking for an open-source project to contribute, and I found this issue and I would like to work on it. This issue is unassigned I just want to validate there is nobody working on it.

I was reviewing the source code and I found that utils.js is using validate-npm-package-name package from npm repository validate-npm-package-name. the validate allows lowercase characters only on the packages name.

Then I have a question, the lb4 command must allow the user to create packages with uppercase letters??

@vvdwivedi
Copy link
Contributor

@javiersantossanchez I was supposed to work on this, but stuck with something else. I am not sure I understand your second question correctly, but if you want to know:
if users should be able to create packages with uppercase letters?

Then npm doesn't allow Capital letters anymore in the package name.

@bajtos
Copy link
Member

bajtos commented Mar 6, 2020

@javiersantossanchez sorry for responding so late. Are you still keen to work on this issue?

Based on the previous discussion, I think the agreement is to add a new prompt for the npm package name. This prompt should use a lower-case version of the project name as the default value offered by CLI to the user running it, and we can use validate-npm-package-name to ensure the prompt is answered with a valid package name.

@javiersantossanchez
Copy link

Hello, @bajtos
Yes I would happy to work on this task.
Then I going to start to work on it tomorrow.

@bajtos
Copy link
Member

bajtos commented Apr 30, 2020

@javiersantossanchez ping 😄 Have you managed to make any progress? Is there anything you need help with?

@javiersantossanchez
Copy link

Hi, @bajtos
A long time ago we talk about this issue. And I finally submit the change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI developer-experience Issues affecting ease of use and overall experience of LB users feature good first issue
Projects
None yet
6 participants