Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# CHANGELOG

## 2.0.0 (November 12, 2021)

Add support for npm

- Allow npm commands to be run with `run`
- Alias `add` to `install` when using npm
- Alias `remove` to `uninstall` when using npm

## 1.2.0 (October 31, 2021)

Only try to install types packages if the package doesn't include its own types
Expand Down
31 changes: 22 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
# Blarn

A Yarn wrapper with extra functionality
A package manager wrapper with extra functionality. Currently supports npm and Yarn v1.

## Features

- Automatically add and remove TypeScript `@types` packages when adding or removing packages in a TypeScript project
- List linked and linkable packages, unlink all packages and automatically rerun Yarn after unlinking packages.
- Ignores "placeholder" types packages that don't do anything
- List linked and linkable packages, unlink all packages and automatically rerun install after unlinking packages
- Automatically add `run` to npm commands
- Support `add` as an alias to `install` for npm
- Support `remove` as an alias to `uninstall` for npm

## Usage

### Requirements

- You must have Yarn 1 installed and available on your path
- You must have npm or Yarn 1 installed and available on your path

### Installation

Expand All @@ -23,19 +27,28 @@ npm install -g blarn
yarn global add blarn
```

### Aliases

If you really want to go all in on Blarn you can alias the `yarn` and `npm` commands to `blarn`. This will allow you to run either command in a project and Blarn will automatically use the correct package manager. It also allows you to run npm commands like yarn without specifying `run`. For example you could run `npm build` instead of `npm run build`. This could be useful if you are migrating from Yarn to npm. To do this add the following aliases in your shell:

```sh
alias npm="blarn"
alias yarn="blarn"
```

### Upgrading

```sh
// npm
npm install -g blarn

// yarn
yarn global upgrade blarn --latest
yarn global add blarn
```

### Running Yarn commands
### Running package manager commands

Blarn will pass all commands and arguments through to Yarn. When adding packages in a TypeScript project it will execute a second `yarn add` command to add any available `@types` packages as dev dependencies. When removing packages any corresponding `@types` packages will be added to the list of packages to remove.
Blarn will pass all commands and arguments through to the package manager. When adding packages in a TypeScript project it will execute a second command to add any available `@types` packages as dev dependencies. When removing packages any corresponding `@types` packages will be added to the list of packages to remove.

### Examples

Expand Down Expand Up @@ -68,9 +81,9 @@ If you run this command in a TypeScript project and `@types/yargs` exists in `pa
### Running locally

1. Fork and clone this repo
1. Run `yarn`
1. Run `yarn build` or `yarn watch`
1. Run `yarn start` or `bin/blarn.js`
1. Run `npm install`
1. Run `npm run build` or `npm run watch`
1. Run `npm start` or `bin/blarn.js`

## Acknowledgements

Expand Down
Loading