Code Monkey home page Code Monkey logo

yvm's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yvm's Issues

Support a default version of yarn/commands

➜  yvm git:(yvm-which) yvm list
Checking for installed yarn versions...
Installed yarn versions:
  - v1.7.0

➜  yvm git:(yvm-which) yvm which
Checking yarn version
You don't have yvm version installed

If I've installed a version, it should default to that.

Seeing You don't have yvm version installed
I have YVM installed, but I don't have a yvmrc. Should we have the concept of a default version to use?

yvm logo

Is your feature request related to a problem? Please describe.
Lets get a logo

yvm - semantic release versioning

Is your feature request related to a problem? Please describe.
It would be good for users to install specific versions (and easily identify what versions have problems, will break API's etc). We are running under continuous release right now, and while this is great for us, is not so great for the wider internet.

Describe the solution you'd like
Someway to version yvm (open to suggestions)

Describe alternatives you've considered
We could use npm to host the core of our JS app

PATH is not updated for globally installed packages

Describe the bug
On a machine that never had Yarn installed, the install script for YVM does not set up the PATH correctly for global installed packages. The Yarn website says:

Path Setup

Unix/Linux/macOS

If you chose manual installation, the following steps will add Yarn to path variable and run it from anywhere.

Note: your profile may be in your .profile, .bash_profile, .bashrc, .zshrc, etc.

  1. Add this to your profile: export PATH="$PATH:/opt/yarn-[version]/bin" (the path may vary depending on where you extracted Yarn to)
  2. In the terminal, log in and log out for the changes to take effect

To have access to Yarn’s executables globally, you will need to set up the PATH environment variable in your terminal. To do this, add export PATH="$PATH:yarn global bin" to your profile.

https://yarnpkg.com/en/docs/install#alternatives-stable

To Reproduce
Steps to reproduce the behavior:

  1. Completely remove Yarn and YVM from your machine (remember to edit your PATH!!!)
  2. Run curl -fsSL https://raw.githubusercontent.com/tophatmonocle/yvm/master/scripts/install.sh | bash
  3. Run source yvm
  4. Run yvm install 1.7.0
  5. Run yvm use 1.7.0
  6. Run yarn global add serve
  7. Run which serve

Expected behavior
It should print out a path to the executable in the ~/.yarn/bin/ directory.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Ubuntu
  • YVM Release: Fri, 27 Jul 2018 15:09:28 GMT

Additional context
Add any other context about the problem here.

Make it easier to test changes to JS files

Before, we could run node yvm.js to test the JS code, but since we added Babel, we need to compile every time.

So far, I have just been running make install every time, but it would be nice to have either:

  • make watch - to watch, rebuild and copy to ~/.yvm
  • symlink webpack build artifacts to ~/.yvm

`yvm install` crashes when trying to install a non-existent version of `yarn`

milan:yvm milanmilojic$ npm start install 1.0.2

> @thm/[email protected] start /Users/milanmilojic/dev/yvm
> node yvm.js "install" "1.0.2"

Installing yarn v1.0.2
Finished downloading yarn version 1.0.2
Finished extracting yarn version 1.0.2
milan:yvm milanmilojic$ npm start install 1.0.3

> @thm/[email protected] start /Users/milanmilojic/dev/yvm
> node yvm.js "install" "1.0.3"

Installing yarn v1.0.3
Finished downloading yarn version 1.0.3
{ Error: incorrect header check
    at Zlib._handle.onerror (zlib.js:371:17) errno: -3, code: 'Z_DATA_ERROR' }
milan:yvm milanmilojic$

yvm does not set a default global yarn version

Describe the bug
If you don't have a global version of yarn installed, yvm does not provide one, so yarn in any shell does not work until doing yvm use, and even then, it only persists for the current shell.

To Reproduce
Steps to reproduce the behavior:

  • Do not have a global version of yarn installed
  • Run yvm install <any version>
  • yarn -v works
  • Open a new shell
  • yarn -v is an unrecognized command
  • yvm use <the installed version>
  • yarn -v works

Expected behavior

  • Do not have a global version of yarn installed
  • Run yvm install <any version>, this installs this version of yarn as default
  • yarn -v works
  • Open a new shell
  • yarn -v uses the same version as above automatically

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: macOS 10.13.6
  • YVM Release: any

Running `yvm exec` in a nested directory, says it can't find the .yvmrc file

Describe the bug
Running yvm exec in a nested directory fails saying it can't find the .yvmrc file

To Reproduce
Steps to reproduce the behavior:

  1. Create a valid .yvmrc file
  2. Create a new directory, enter that sub-directory
  3. Run yvm exec list
  4. See error

Expected behavior
yvm should search up the tree for .yvmrc files

Additional notes
This has introduced other behaviour (such as having a root level yvm.config.js file, or declaring in package.json. Do we want this?

Make sure that user has minimum node version

Currently yvm is built on node 8.11.3. If a user tries to use yvm with a lower version (e.g 6.11.5) it will throw a syntax error.

This can be tackled by either:

  1. Displaying a message to ensure the correct node version (index.js)
  2. Using backwards compatible syntax

Consistent formatting for list commands

yvm list and yvm list-remote list version numbers in two different ways: one with "v" prefix and one without. We should make the listing consistent with the commands that the user may run next (eg. yvm use 1.7.0 or yvm exec 1.7.0), so we should remove the "v" prefix.

You can use stripVersionPrefix in src/common/utils.js

Verify integrity of tarball

Is your feature request related to a problem? Please describe.
In order to reach parity with the Yarn install script (linked below), we should verify the integrity of the downloaded tarball.

Describe the solution you'd like
If the user has GPG installed, run the integrity check by downloading the public key, spawning a child process, and running GPG. If there is an error in the integrity check or GPG is not installed, notify the user, and prompt the user on whether or not to continue without verifying. Clean up the downloaded files regardless.

Describe alternatives you've considered
YOLO it and download tarballs from who knows where without verifying integrity (I am being sarcastic 😐).

Additional context
https://github.com/yarnpkg/website/blob/master/install.sh#L50

The exec command doesn't forward arguments correctly

Describe the bug

yvm exec tag --help

tag --help gets passed to the yvm command instead of being passed to the yarn command directly. The --help triggers the yvm help instead of getting passed correctly to the yarn command.

Workaround:

yvm exec -- tag --help

This will pass arguments to the underlying command correctly, but it's not ideal.

Expected behavior
A clear and concise description of what you expected to happen.

All arguments passed to exec should get passed to the underlying yarn version

Support for `yvm use` command

Support yvm use for switching currently active yarn version

Detect other yarn versions on path, and warn about conflicts?
e.g. $PATH contains: /Users/jakebolam/.yarn/bin:/

Open source repo setup

  • Create repo
  • Collaborators
  • CircleCI (Test runner, auto publish to install script in the future)
  • Basic PR template
  • Basic issue template #94
  • Basic Readme
  • Basic Contributing
  • Open source license

Installing an invalid version fails

```milan:yvm` milanmilojic$ npm start install 1.0.2

@thm/[email protected] start /Users/milanmilojic/dev/yvm
node yvm.js "install" "1.0.2"

Installing yarn v1.0.2
Finished downloading yarn version 1.0.2
Finished extracting yarn version 1.0.2
milan:yvm milanmilojic$ npm start install 1.0.3

@thm/[email protected] start /Users/milanmilojic/dev/yvm
node yvm.js "install" "1.0.3"

Installing yarn v1.0.3
Finished downloading yarn version 1.0.3
{ Error: incorrect header check
at Zlib._handle.onerror (zlib.js:371:17) errno: -3, code: 'Z_DATA_ERROR' }
milan:yvm milanmilojic$```
leaves us with with invalid tarball

total 256
drwxr-xr-x  5 501  20     160 Jun 18 17:04 .
drwxr-xr-x  3 501  20      96 Jun 18 16:15 ..
drwxr-xr-x  7 501  20     224 Jun 18 17:04 v1.0.2
-rw-r--r--  1 501  20  129195 Jun 18 17:04 v1.0.3.tar.gz
drwxr-xr-x  7 501  20     224 Jun 18 17:01 v1.7.0```

Support Fish shell

Is your feature request related to a problem? Please describe.
To use yvm use, I have to source yvm within my shell environment. However, because yvm shell syntax is not compatible with fish shell,
sourcing will not work properly.

> source /usr/local/bin/yvm
/usr/local/bin/yvm (line 25): Unsupported use of '&&'. In fish, please use 'COMMAND; and COMMAND'.
    [ -n "${1-}" ] && [ -x "$(yvm_version_path "$1" 2> /dev/null)"/bin/yarn ]
                    ^
from sourcing file /usr/local/bin/yvm
        called on standard input

source: Error while reading file '/usr/local/bin/yvm'

Describe the solution you'd like
Provide additional shell script for sourcing yvm in fish shell.

virtualenv uses a similar approach. In its environment directory, has separate activate scripts for bash, fish shell, and windows CMD.

Describe alternatives you've considered

Additional context

Highlight currently active Yarn version in `yvm list` and `yvm list-remote`

Is your feature request related to a problem? Please describe.
If I have multiple versions of Yarn installed and I want to switch from one to another, I have to first run yvm which to determine which version I am currently using. Then I have to remember this version, and run yvm list to see what versions are installed. This requires more cognitive overhead than should be required for a tool like this.

Describe the solution you'd like
When you run yvm list or yvm list-remote, the currently active version should be highlighted with a different color AND an arrow should be pointing to it like in nvm (see screenshot below).

Describe alternatives you've considered
An alternate solution is to simply add a line at the beginning or end of the version output that states what version is currently being used. This approach is not the best because there is a lot of info being printed on the screen in these commands, so it is likely to be missed.

Additional context

nvm list output

Remove dependency on npm

Yarn version manager should not depend on npm.

Remove need for npm install on host.
Switch build over to use YVM.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.