Uppercase letters in the value of "name" parameter (validation)
1. Summary
If I generate my package.json use generate-package:
value "name" parameter may contain uppercase letters.
See official npm docs:
New packages must not have uppercase letters in the name.
2. Environment
- Windows 10 Enterprise LTSB 64-bit EN,
- Node.js 9.6.0,
- generate 0.14.0.
3. Steps to reproduce
I install generate and generate-package → I create blank folder D:\SashaDemoRepositories\SashaNpmInitVsGeneratePackage → I run gen package command:
D:\SashaDemoRepositories\SashaNpmInitVsGeneratePackage>gen package
[09:59:35] starting generate
[09:59:44] √ running tasks: [ 'package' ]
[09:59:47] starting package
? Project description? Demo generate-package
? Author's name? Sasha Chernykh
? Author's URL? https://vk.com/hair_in_the_wind
[10:00:13] finished package √ 26s
I get package.json:
{
"name": "SashaNpmInitVsGeneratePackage",
"description": "Demo generate-package",
"version": "0.1.0",
"homepage": "https://github.com/Kristinita/SashaNpmInitVsGeneratePackage",
"author": "Sasha Chernykh (https://vk.com/hair_in_the_wind)",
"repository": "Kristinita/SashaNpmInitVsGeneratePackage",
"bugs": {
"url": "https://github.com/Kristinita/SashaNpmInitVsGeneratePackage/issues"
},
"license": "MIT",
"engines": {
"node": ">=4"
},
"scripts": {
"test": "mocha"
},
"keywords": [
"SashaNpmInitVsGeneratePackage"
]
}
4. Expected behavior
Lowercase:
"name": "sashanpminitvsgeneratepackage"
5. Actual behavior
Uppercase letters:
"name": "SashaNpmInitVsGeneratePackage"
Thanks.
Hi Kristinita,
Thanks for posting this issue.
Indeed, a NO_UPPERCASE formating rule for the package name would be a good idea, relating to the relying npm docs.
But in a such case I think the expected behavior should better be sasha-npm-init-vs-generate-package.
Don't you think ? What about you @jonschlinkert, @doowb ?
I just edited the title of this issue to remove the "bug" mention because it should not be concidered as a bug but an enhancement. The actual expected behavior do not care about uppercase. But @Kristinita you're right it probably should be.