eggjs / eggjs/egg

[RFC] egg-bin plugin

Open
#808 12 comments 3 reactions 1 assignee Assigned to @atian25 View on GitHub
type: proposals
Dominant language
TypeScript
Stars
19k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

A tool for managing plugins.

egg-bin plugin [action]

## Action

Check the plugin.js

```
$ egg-bin plugin check
missing: a
>> Plugin [a] is disabled or missed, but is required by [b]
```

List all enabled plugins

```
$ egg-bin plugin list
a: [ 'b', 'c' ]
b: [ 'c' ]
c: []
```

List all plugins

```
$ egg-bin plugin list-all
a: [ 'b', 'c' ]
b: [ 'c' ]
c: []
```

Enable a plugin, give a name or choose from all disabled plugins

```
$ egg-bin plugin enable b
enable b: [ 'c' ]
enable c: []
```

Disable a plugin, give a name or choose from all enabled plugins

```
$ egg-bin plugin disable b
disable a: [ 'b', 'c' ]
disable b: [ 'c' ]
```

Find a plugin and it's dependencies

```
$ egg-bin plugin find a
a: [ 'b', 'c' ]
b: [ 'c' ]
c: []
```

## Options

Give a cwd

```
$ egg-bin plugin --cwd test/fixtures/apps/testapp list
```

Find all fixtures and run

```
$ egg-bin plugin --fixtures list
```

Dump a plugin file

```
$ egg-bin plugin list --dump
generate to run/plugin.js
```

Generate plantuml

```
$ egg-bin plugin list --puml
generate to run/plugin.puml
```

Show detail infomation

```
$ egg-bin plugin list --detail
a: from /path/to/plugin.js enabled
- b from /path/to/plugin.js enabled
- c from /path/to/plugin.js enabled
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.