tophat / yvm Goto Github PK
View Code? Open in Web Editor NEW𧢠Manage multiple versions of Yarn (deprecated)
Home Page: https://yvm.js.org
License: Apache License 2.0
π§Ά Manage multiple versions of Yarn (deprecated)
Home Page: https://yvm.js.org
License: Apache License 2.0
β 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?
Is your feature request related to a problem? Please describe.
Lets get a logo
i
from install
ls
for list
rm
for remove
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
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.
- Add this to your profile: export PATH="$PATH:/opt/yarn-[version]/bin" (the path may vary depending on where you extracted Yarn to)
- 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:
curl -fsSL https://raw.githubusercontent.com/tophatmonocle/yvm/master/scripts/install.sh | bash
source yvm
yvm install 1.7.0
yvm use 1.7.0
yarn global add serve
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):
Additional context
Add any other context about the problem here.
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
~/.yvm
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.sh exec install --frozen-lockfile
error: unknown option `--frozen-lockfile'
NVM does this:
$ nvm uninstall 10.5.0
nvm: Cannot uninstall currently-active node version, v10.5.0 (inferred from 10.5.0).
.description('Some description')
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:
yvm install <any version>
yarn -v
worksyarn -v
is an unrecognized commandyvm use <the installed version>
yarn -v
worksExpected behavior
yvm install <any version>
, this installs this version of yarn as defaultyarn -v
worksyarn -v
uses the same version as above automaticallyScreenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
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:
yvm exec list
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?
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:
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
Describe the bug
yvm use, looks in the current directory for a .yvmrc
file. yvm exec does a more indepth tree and file search
Expected behavior
They should behave the same
Describe the bug
Code coverage is not being reported
Fix
Tried to activate but it seems there app is having trouble:
https://codecov.io/gh
Will need to update the CODECOV_TOKEN
here https://circleci.com/gh/tophat/yvm/edit#env-vars when they come back
Implement yvm which command
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
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 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:/
When this happens, the PATH isn't correctly updated
```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```
At the end of the install script, tell user to source yvm or open a new shell window.
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
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
Instead of requiring the yarn bin js file, lets exec
the yarn command.
If yarn ever changes their entry point to a shell script instead of a js file, we will suddenly stop working π
Can we make the error messaging a little more helpful.
Something like:
$yvm exec list
No version supplied, no .yvmrc
Perhaps you wanted to specify your version like?
yvm exec 1.2.0 list
Yarn version manager should not depend on npm.
Remove need for npm install on host.
Switch build over to use YVM.
Describe the bug
When I run yarn install
with yvm
I'm getting a segfault:
75162/91112/Users/******/.yvm/yvm.sh: line 82: 60566 Segmentation fault: 11 node "${YVM_DIR}/yvm.js" $@
make: *** [node_modules] Error 139
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.