Skip to content

Lowercase and trim npm package names for templates#706

Merged
mousetraps merged 4 commits intomicrosoft:masterfrom
mjbvz:template-npm-normalization
Feb 26, 2016
Merged

Lowercase and trim npm package names for templates#706
mousetraps merged 4 commits intomicrosoft:masterfrom
mjbvz:template-npm-normalization

Conversation

@mjbvz
Copy link
Copy Markdown
Contributor

@mjbvz mjbvz commented Feb 25, 2016

Adds a little extra normalization when converting a VS project names to npm project names when generating the package.json for the templates:

  • Lowercase names. Inserts hyphens between camelcased strings: "ExpressApp4" -> "express-app4"
  • Trim name length to 214 characters.

closes #705

Adds a little extra normalization when converting a VS project names to npm project names in the templates:
* Lowercase names. Inserts hypens between camelcased strings: "ExpressApp4" -> "express-app-4"
* Trim to name to 214 characters

closes microsoft#705
@msftclas
Copy link
Copy Markdown

Hi @mjbvz, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!


It looks like you're a Microsoft contributor (Matt Bierner). If you're full-time, we DON'T require a Contribution License Agreement. If you are a vendor, please DO sign the electronic Contribution License Agreement. It will take 2 minutes and there's no faxing! https://cla.microsoft.com.

TTYL, MSBOT;


// Remove all leading url-invalid, underscore, and period characters from the string
/// <summary>
/// Normalize a project name to be a valid Npm package name.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you include a link to the docs on valid package names in the comment here?
https://docs.npmjs.com/files/package.json#name

@mousetraps
Copy link
Copy Markdown
Contributor

minor comments, and 👍 after that!

Small fix to spelling and reordering to put private methods last based on review comments.
mousetraps added a commit that referenced this pull request Feb 26, 2016
Lowercase and trim npm package names for templates
@mousetraps mousetraps merged commit aa52f80 into microsoft:master Feb 26, 2016
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 this pull request may close these issues.

Project Templates Generate Invalid package.json name

3 participants