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

fix(cli): improve guessing of package names that contain a dot (#5102) #5135

Merged
merged 1 commit into from
Jan 15, 2018

Conversation

iansu
Copy link
Contributor

@iansu iansu commented Dec 29, 2017

Summary

Improve guessing of package names that contain a dot. It was reported that the scottoffen/jquery.toaster package from GitHub was being saved as jquery. With this change that package is now saved as jquery.toaster.

Fixes #5102

Test plan

  1. Run yarn add scottoffen/jquery.toaster
  2. Look in node_modules and observe that the package is saved as jquery.toaster instead of just jquery

@iansu
Copy link
Contributor Author

iansu commented Dec 29, 2017

The current solution to this problem isn't good. I don't know that mine is much better. I'm open to suggestions for improving this.

Current solution: Split on . and take the first segment (jquery.toaster becomes jquery)

My solution: Trim filename extensions if they match those in a list (/\.git$|\.zip$|\.tar\.gz$|\.tar\.bz2$/ which surely won't cover everything)

Copy link
Member

@arcanis arcanis left a comment

Choose a reason for hiding this comment

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

Sounds reasonable

@arcanis arcanis merged commit 1c3a2de into yarnpkg:master Jan 15, 2018
agoldis added a commit to agoldis/yarn that referenced this pull request Feb 2, 2018
…readdir_files

* upstream/master: (34 commits)
  feat(upgrade, add): Separately log added/upgraded dependencies (yarnpkg#5227)
  feat(publish): Publish command uses publishConfig.access in package.json (yarnpkg#5290)
  fix(CLI): Use process exit instead of exitCode for node < 4 (yarnpkg#5291)
  feat(cli): error on missing workspace directory (yarnpkg#5206) (yarnpkg#5222)
  feat: better error when package is not found (yarnpkg#5213)
  Allow scoped package as alias source (yarnpkg#5229)
  fix(cli): Use correct directory for upgrade-interactive (yarnpkg#5272)
  nohoist baseline implementation (yarnpkg#4979)
  1.4.1
  1.4.0
  Show current version, when new version is not supplied on "yarn publish" (yarnpkg#4947)
  fix(install): use node-gyp from homebrew npm (yarnpkg#4994)
  Fix transient symlinks overriding direct ones v2 (yarnpkg#5016)
  fix(auth): Fixes authentication conditions and logic with registries (yarnpkg#5216)
  chore(package): move devDeps to appropriate place (yarnpkg#5166)
  fix(resolution) Eliminate "missing peerDep" warning when dep exists at root level. (yarnpkg#5088)
  fix(cli): improve guessing of package names that contain a dot (yarnpkg#5102) (yarnpkg#5135)
  feat(cli): include notice with license when generating disclaimer (yarnpkg#5072) (yarnpkg#5111)
  feat(cli): group by license in licenses list (yarnpkg#5074) (yarnpkg#5110)
  feat(cli): improve error message when file resolver can't find file (yarnpkg#5134) (yarnpkg#5145)
  ...
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.

3 participants