Coder Social home page Coder Social logo

drkdelaney / yvm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tophat/yvm

0.0 0.0 0.0 1.95 MB

🧢 Manage multiple versions of Yarn

Home Page: https://yvm.js.org

License: Apache License 2.0

JavaScript 91.01% CSS 0.59% HTML 0.24% Shell 5.57% Makefile 2.58%

yvm's Introduction

Yarn Version Manager (yvm)

Logo

YVM Latest Version Minimum Node Version Builds codecov semantic-release Deps Dev Deps Green Keeper All Contributors Slack workspace Maturity badge - level 3 Pull Reminders

Overview

Pesky yarn versions got you down? Automatically and easily manage those versions.

YVM will automatically use the correct yarn version when you run any yarn commands in any folder with a package.json, .yvmrc or any other supported configuration file. Otherwise, it will use you a globally set version of yarn.

Motivation

Manually managing different yarn versions across projects is a pain. This fixes that.

Installation

Node: >=8.0.0

Homebrew

Installs the latest stable version.

brew install tophat/bar/yvm

Script

Execute the following in your terminal:

curl -s https://raw.githubusercontent.com/tophat/yvm/master/scripts/install.js | node

Or to install a specific version:

curl -s https://raw.githubusercontent.com/tophat/yvm/v2.4.3/scripts/install.sh | INSTALL_VERSION="v2.4.3" bash

Manual

Navigate to yvm releases and download the yvm.js file for the latest release into your desired yvm install directory.

Typically .yvm your home directory, then run the following command to configure your shell.

node ./home/joe_user/.yvm/yvm.js configure-shell

You will need to reload the shell to get yvm, or source the generated yvm.{sh,fish} scripts.

Upgrade

To upgrade yvm to the lastest version either install as normal, or run

yvm update-self

Usage

Automagic

Run any yarn command and watch it automagically use the correct version of yarn.

Yarn is shimmed to use the default version or the version defined your current directory config file.

yarn --version

Basic

To download and install a specific version of yarn, run:

yvm install <version>

To get the latest version of Yarn, run:

yvm install latest

Execute an arbitrary command using a specific version of yarn:

yvm exec <version> <command>

Additional commands

Switch the current yarn versions:

yvm use <version>
yarn --version

NOTE: The above disables yarn shimming until a new shell is loaded.

Control version aliasing:

yvm alias stable
# stable β†’ 1.13.0 (1.13.0)

yvm alias default stable
# default β†’ stable (1.13.0)

yvm alias
# default β†’ stable (1.13.0)
# latest β†’ 1.14.0 (1.14.0)
# stable β†’ 1.13.0 (1.13.0)
# system β†’ 1.13.0 (1.13.0)

yvm alias default '^1.7'
# default β†’ ^1.7 (1.14.0)

Show path to version used:

yvm which

List installed yarn versions:

yvm list

Full list of available commands:

yvm --help

Configuration file

Yvm defaults to using the yarn version in your package.json engines. Otherwise you can create a .yvmrc file containing the version number of yarn in your project's root directory. Afterwards, yvm use, yvm install and yvm exec will use the version specified in the config file if no version number is supplied to the command. You can also declare the version using other configuration files

Additional reference

A full list of commands is on the api reference page

Have questions? List of common questions and answers

Removing

To remove yvm simply execute

rm -rf $YVM_DIR

Next, edit $HOME/.bashrc and $HOME/.zshrc and remove those lines:

export YVM_DIR=/home/joe_user/.yvm
[ -r $YVM_DIR/yvm.sh ] && source $YVM_DIR/yvm.sh

Remove in $HOME/.config/fish/config.fish for fishers:

set -x YVM_DIR /home/joe_user/.yvm
. $YVM_DIR/yvm.fish

In case you had older version of yvm installed, there could also be a line like

source /home/joe_user/.yvm/yvm.sh

or those lines could be in $HOME/.bash_profile instead of $HOME/.bashrc.

Contributing

We welcome contributions from the community, Top Hatters and non-Top Hatters alike. Here are some guidelines to help you get started!

Basic development flow

  1. Ensure the problem you are solving is an issue or you've created one
  2. Clone the repo
  3. We use make. make help will show you a list of development commands
  4. make install-watch will install yvm on your shell and update when you make changes. Make sure to only run this in the root yvm directory, it will fail elsewhere.
  5. make test and make lint are also commonly helpful

Make sure all changes are well documented. Our documentation can be found inside the docs section of this repo. Be sure to read it carefully and make modifications wherever necessary. You can also access the documentation on our website

Please make sure to look over our Code of Conduct as well!

Manual testing command contributions

make install
yvm <your-command-here>

Technologies to Familiarize Yourself with

Contributors

Thanks goes to these wonderful people (emoji key):

Francois Campbell
Francois Campbell

πŸ’»
Jake Bolam
Jake Bolam

πŸ“– πŸ’» πŸš‡
Brandon Baksh
Brandon Baksh

πŸ’»
Milan Milojic
Milan Milojic

πŸ’»
Umar Ahmed
Umar Ahmed

πŸ’»
Nicholas Dujay
Nicholas Dujay

πŸ’»
Aser Eldamaty
Aser Eldamaty

πŸ’»
Michael Rose
Michael Rose

πŸ’»
Sanchit Gera
Sanchit Gera

πŸ“–
sdcosta
sdcosta

πŸ“–
Siavash Mahmoudian
Siavash Mahmoudian

πŸš‡
greenkeeper[bot]
greenkeeper[bot]

πŸš‡
Jay Crumb
Jay Crumb

πŸ“–
Michael LunΓΈe
Michael LunΓΈe

πŸ“–
Yash Shah
Yash Shah

πŸ’»
WacΕ‚aw Schiller
WacΕ‚aw Schiller

πŸ’»
yvm-bot
yvm-bot

πŸš‡
Emmanuel Ogbizi
Emmanuel Ogbizi

πŸ’» ⚠️ πŸ“–
Martin Lai
Martin Lai

πŸ’»
Marc Cataford
Marc Cataford

πŸ’»
Ahmed Elkady
Ahmed Elkady

πŸ‘€
Noah
Noah

πŸ’»

This project follows the all-contributors specification. Contributions of any kind welcome!

Credits

Thanks to Carol Skelly for donating the github organization!

yvm's People

Contributors

jakebolam avatar iamogbz avatar francoiscampbell avatar umar-tophat avatar greenkeeper[bot] avatar brandonbaksh avatar aeldamaty avatar sanchitgera avatar torinthiel avatar dat2 avatar allcontributors[bot] avatar sdcosta avatar dependabot[bot] avatar nepodmitljivi avatar msrose avatar noahnu avatar yashshah avatar yvm-bot avatar mcataford avatar syavash avatar umar-ahmed avatar abinoda avatar jcrumb avatar eastenluis avatar mlunoe avatar semantic-release-bot avatar

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.