New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

github.com/g-plane/zsh-yarn-autocompletions

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/g-plane/zsh-yarn-autocompletions

  • v2.0.2+incompatible
  • Source
  • Go
  • Socket score

Version published
Created
Source

zsh-yarn-autocompletions

license Github Releases

Supported yarn commands

  • yarn run
  • yarn remove
  • yarn add
  • yarn why

You can customize the autocompletion of yarn add command. It's configurable.

Installation

Manually

Download

Please go to the GitHub releases page and download the latest binary files.

Note that you should choose correct file according to your OS.

Add as a Zsh plugin

Unzip the compressed file you downloaded.

For 1.x (or above) users, please run:

$ ./install.sh $ZSH_CUSTOM/plugins

For 0.2 users, please run:

$ ./install.sh $ZSH_CUSTOM

Next please edit your .zshrc file. Add yarn-autocompletions to plugins section.

Like this:

plugins=(
  # ... your other plugins
+ yarn-autocompletions
)

Restart your terminal.

With a plugin manager

zinit

Update your .zshrc file with the following line:

zinit ice atload"zpcdreplay" atclone'./zplug.zsh'
zinit light g-plane/zsh-yarn-autocompletions
zplug

Update your .zshrc file with the following line:

zplug "g-plane/zsh-yarn-autocompletions", hook-build:"./zplug.zsh", defer:2

Customize the autocompletion of yarn add command

Since v1.0.0

This plugin support adding your favorite packages name for autocompletion of yarn add and yarn add --dev command.

Adding a configuration file

First, put a new file called .yarn-autocompletions.yml in your home directory.

For example:

$ touch ~/.yarn-autocompletions.yml

This file is in YAML format.

Adding your favorite packages

We assume you want to add vue and react. So you can edit that file like this:

dependencies:
  - vue
  - react

And dev_dependencies:

dev_dependencies:
  - vue-loader
  - parcel-bundler

Excluding some packages

In fact, this plugin has some builtin packages autocompletion which can provide out-of-the-box experience, such as vue or react.

However you don't like those builtin packages.

So you can add it to exclude section:

exclude:
  - react

Now you won't see react in autocompletion.

All sections are optional

Now the whole configuration file looks like:

dependencies:
  - vue
  - react
dev_dependencies:
  - vue-loader
  - parcel-bundler
exclude:
  - react

Keep in mind that any sections are optional.

Build from source

Make sure that you've installed rustup first and use rustup to install Rust.

Next, follow the steps below:

git clone https://github.com/g-plane/zsh-yarn-autocompletions.git
cd zsh-yarn-autocompletions
cargo build --release
mkdir -p $ZSH_CUSTOM/plugins/yarn-autocompletions
cp ./yarn-autocompletions.plugin.zsh $ZSH_CUSTOM/plugins/yarn-autocompletions/
cp ./target/release/yarn-autocompletions $ZSH_CUSTOM/plugins/yarn-autocompletions/

Then, edit your .zshrc like this:

plugins=(
  # ... your other plugins
+ yarn-autocompletions
)

Restart your terminal.

Contribution

Any contributions are welcome.

License

MIT License

Copyright (c) 2018-present Pig Fang

FAQs

Package last updated on 12 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc