-
-
Notifications
You must be signed in to change notification settings - Fork 165
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
Allow using scoped package names #272
Comments
We should handle scoped packages way better. What's the behavior you would expect? |
I think a piece of the solution would be to get rid of the kebab case modification and validate npm package name with https://www.npmjs.com/package/validate-npm-package-name instead. |
I made a WIP PR to fix some of those issues. Still need to work on the URL issue you pointed out. Can you check the branch out and tell me if it fixes most of your issues? |
* Add supports for scoped package (Fix #272) * Streamline option `githubAccount` * change option name from `github-account` to `githubAccount` in git/index.js (githubAccount is used everywhere else, and the result is the same) * change option description in readme/index.js to match the description in app/index.js * Add option `repositoryName` Add the option `repositoryName`, being the ‘Name of the GitHub repository’. * fixup! Add supports for scoped package (Fix #272) * Update package-lock.json * fixup! fixup! Add supports for scoped package (Fix #272) Fix on node@4.x.x * Bump dependencies (inquirer-npm-name@3) * Use package scope as default `githubUser` If a scoped name is supplied, use the scope part (after the `@` and before the first `/`) as default value for `githubUser`, even ignoring the `authorEmail` which is otherwise used to find the default value. * Drop `name`-option from git-generator * Only write `repository` into pkg if available Only write `repository` to the package file if both `githubAccount` and `repositoryName` are passed to the `git`-generator. Re-read the package before adding the `origin`-remote to repository in case some other generator has modified it. * fixup! Use package scope as default `githubUser` * fixup! Only write `repository` into pkg if available * fixup! fixup! Only write `repository` into pkg if available * Remove _readPkg side effects from git subgenerator * Remove the side effects of _getModuleNameParts Have `_getModuleNameParts` return an object with the parts of the module name instead of directly writing it to `props`.
When using a scope in the package name, both the
@
and the/
are stripped from the name;@scope/project-name
, for example, gets turned intoscope-project-name
. This makes it quite hard to use this generator for scoped packages (including all private packages), as the name has to be altered in different ways at different places.Things to consider
scope
to supply the scope?@scope/
if the package name and scope are not treated separately?example.com
, for example, gets turned intoexample-com
through it.README.md
reference the package, and some reference the repository (e.g.npm-url
references the package andtravis-url
the repo)The text was updated successfully, but these errors were encountered: