Skip to content
This repository was archived by the owner on Feb 20, 2023. It is now read-only.

Commit bf644f6

Browse files
authored
Merge pull request #24 from CodeDead/release/1.1.0
Release/1.1.0
2 parents d4bf319 + 0e56c86 commit bf644f6

File tree

7 files changed

+1427
-787
lines changed

7 files changed

+1427
-787
lines changed

.yarn/releases/yarn-2.4.2.cjs

Lines changed: 0 additions & 55 deletions
This file was deleted.

.yarn/releases/yarn-3.0.0.cjs

Lines changed: 631 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ nodeLinker: node-modules
33
plugins:
44
- ./src/index.js
55

6-
yarnPath: .yarn/releases/yarn-2.4.2.cjs
6+
yarnPath: .yarn/releases/yarn-3.0.0.cjs

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
![GitHub package.json version](https://img.shields.io/github/package-json/v/e5mode/yarn-up-all)
44
![GitHub](https://img.shields.io/github/license/e5mode/yarn-up-all)
5-
![GitHub Releases](https://img.shields.io/github/downloads/e5mode/yarn-up-all/1.0.5/total)
5+
![GitHub Releases](https://img.shields.io/github/downloads/e5mode/yarn-up-all/1.1.0/total)
66

77
## Description
88

@@ -25,7 +25,7 @@ yarn set version berry
2525
In order to install the plugin, you can run the following command in your terminal:
2626

2727
```Bash
28-
yarn plugin import https://github.com/e5mode/yarn-up-all/releases/download/1.0.5/index.js
28+
yarn plugin import https://github.com/e5mode/yarn-up-all/releases/download/1.1.0/index.js
2929
```
3030

3131
### Usage
@@ -41,7 +41,19 @@ To exclude a single dependency, run:
4141
yarn up-all --exclude package
4242
```
4343

44+
Alternatively, you can use the shorter command:
45+
```Bash
46+
yarn up-all -e package
47+
```
48+
4449
To exclude multiple dependencies:
4550
```Bash
4651
yarn up-all --exclude "package1 package2"
4752
```
53+
54+
### Options
55+
56+
| Option | Description |
57+
|-------------|--------------------------------------------------|
58+
| `--exclude` | Exclude one or more packages from being upgraded |
59+
| `-e` | Shorthand version of `--exclude` |

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "yarn-up-all",
3-
"version": "1.0.5",
3+
"version": "1.1.0",
44
"description": "Yarn 2 plugin that will upgrade all dependencies to their latest version with one simple command",
55
"main": "src/index.js",
66
"repository": "https://github.com/e5mode/yarn-up-all.git",
@@ -11,16 +11,16 @@
1111
"build": "minify src -d build"
1212
},
1313
"dependencies": {
14-
"@yarnpkg/cli": "^3.0.0-rc.3",
15-
"@yarnpkg/core": "^3.0.0-rc.3",
16-
"@yarnpkg/plugin-essentials": "^3.0.0-rc.3"
14+
"@yarnpkg/cli": "^3.0.1",
15+
"@yarnpkg/core": "^3.1.0-rc.1",
16+
"@yarnpkg/plugin-essentials": "^3.0.1-rc.1",
17+
"clipanion": "^3.0.1",
18+
"typanion": "^3.3.2"
1719
},
1820
"devDependencies": {
1921
"babel-minify": "^0.5.1",
20-
"clipanion": "^3.0.0-rc.12",
21-
"eslint": "^7.27.0",
22+
"eslint": "^7.32.0",
2223
"eslint-config-airbnb-base": "^14.2.1",
23-
"eslint-plugin-import": "^2.23.4",
24-
"yup": "^0.32.9"
24+
"eslint-plugin-import": "^2.24.0"
2525
}
2626
}

src/index.js

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@ module.exports = {
22
name: 'yarn-up-all-plugin',
33
factory: (require) => {
44
const { Configuration, Project } = require('@yarnpkg/core');
5-
// eslint-disable-next-line import/no-extraneous-dependencies
6-
const { Cli, Command } = require('clipanion');
7-
// eslint-disable-next-line import/no-extraneous-dependencies
8-
const yup = require('yup');
5+
const { Cli, Command, Option } = require('clipanion');
96
const Essentials = require('@yarnpkg/plugin-essentials');
7+
const typanion = require('typanion');
108

119
/**
1210
* Resolve the name of a package
@@ -35,6 +33,11 @@ module.exports = {
3533
};
3634

3735
class UpAllCommand extends Command {
36+
constructor() {
37+
super();
38+
this.exclude = Option.String('-e,--exclude', { validator: typanion.isString() });
39+
}
40+
3841
/**
3942
* Execute the command
4043
* @returns {Promise<void>}
@@ -53,24 +56,18 @@ module.exports = {
5356
];
5457

5558
const descriptors = getDescriptors(dependencies, this.exclude ? this.exclude.split(' ') : null);
56-
5759
const packageNames = descriptors.map((e) => resolveFullPackageName(e[1].scope, e[1].name));
5860

5961
const cli = Cli.from(Essentials.default.commands);
6062
return cli.runExit(['up', ...packageNames], this.context);
6163
}
6264
}
6365

64-
UpAllCommand.addOption('exclude', Command.String('--exclude'));
65-
UpAllCommand.addPath('up-all');
66-
67-
UpAllCommand.schema = yup.object().shape({
68-
exclude: yup.string(),
69-
});
70-
71-
UpAllCommand.usage = Command.Usage({
66+
UpAllCommand.paths = [['up-all']];
67+
UpAllCommand.usage = {
68+
category: 'Utilities',
7269
description: 'Yarn 2 plugin that will upgrade all dependencies to their latest version with one simple command',
73-
details: 'This command will upgrade all dependencies to their latest version',
70+
details: 'This command will upgrade all dependencies to their latest version. You can exclude certain dependencies from being upgraded by using the `-e,--exclude` option.',
7471
examples: [
7572
[
7673
'Upgrade all dependencies',
@@ -80,11 +77,15 @@ module.exports = {
8077
'Upgrade all dependencies but exclude a single dependency',
8178
'yarn up-all --exclude package',
8279
],
80+
[
81+
'Upgrade all dependencies but exclude a single dependency',
82+
'yarn up-all -e package',
83+
],
8384
[
8485
'Upgrade all dependencies but exclude multiple dependencies',
8586
'yarn up-all --exclude "package1 package2"',
8687
]],
87-
});
88+
};
8889

8990
return {
9091
commands: [

0 commit comments

Comments
 (0)