You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* docs: move naming plugin section to the beginning of the guide
* docs: added a link to npm
* Update docs/dev-guide/plugin-dev.md
Co-Authored-By: NataliaTepluhina <NataliaTepluhina@users.noreply.github.com>
* docs: add a warning in plugin naming section
Copy file name to clipboardExpand all lines: docs/dev-guide/plugin-dev.md
+38-35Lines changed: 38 additions & 35 deletions
Original file line number
Diff line number
Diff line change
@@ -34,6 +34,44 @@ So, typical CLI plugin folder structure looks like the following:
34
34
└── ui.js # Vue UI integration (optional)
35
35
```
36
36
37
+
## Naming and discoverability
38
+
39
+
For a CLI plugin to be usable in a Vue CLI project, it must follow the name convention `vue-cli-plugin-<name>` or `@scope/vue-cli-plugin-<name>`. It allows your plugin to be:
40
+
41
+
- Discoverable by `@vue/cli-service`;
42
+
- Discoverable by other developers via searching;
43
+
- Installable via `vue add <name>` or `vue invoke <name>`.
44
+
45
+
:::warning Warning
46
+
Make sure to name the plugin correctly, otherwise it will be impossible to install it via `vue add` command or find it with Vue UI plugins search!
47
+
:::
48
+
49
+
For better discoverability when a user searches for your plugin, put keywords describing your plugin in the `description` field of the plugin `package.json` file.
50
+
51
+
Example:
52
+
53
+
```json
54
+
{
55
+
"name": "vue-cli-plugin-apollo",
56
+
"version": "0.7.7",
57
+
"description": "vue-cli plugin to add Apollo and GraphQL"
58
+
}
59
+
```
60
+
61
+
You should add the url to the plugin website or repository in the `homepage` or `repository` field so that a 'More info' button will be displayed in your plugin description:
A Generator part of the CLI plugin is usually needed when you want to extend your package with new dependencies, create new files in your project or edit existing ones.
@@ -766,41 +804,6 @@ You can put a `logo.png` file in the root directory of the folder that will be p
766
804
767
805
The logo should be a square non-transparent image (ideally 84x84).
768
806
769
-
### Discoverability
770
-
771
-
For a CLI plugin to be usable by other developers, it must be published on npm following the name convention `vue-cli-plugin-<name>` or `@scope/vue-cli-plugin-<name>`. Following the name convention allows your plugin to be:
772
-
773
-
- Discoverable by `@vue/cli-service`;
774
-
- Discoverable by other developers via searching;
775
-
- Installable via `vue add <name>` or `vue invoke <name>`.
776
-
777
-
For better discoverability when a user searches for your plugin, put keywords describing your plugin in the `description` field of the plugin `package.json` file.
778
-
779
-
Example:
780
-
781
-
```json
782
-
{
783
-
"name": "vue-cli-plugin-apollo",
784
-
"version": "0.7.7",
785
-
"description": "vue-cli plugin to add Apollo and GraphQL"
786
-
}
787
-
```
788
-
789
-
You should add the url to the plugin website or repository in the `homepage` or `repository` field so that a 'More info' button will be displayed in your plugin description:
To publish your plugin, you need to be registered an [npmjs.com](npmjs.com) and you should have `npm` installed globally. If it's your first npm module, please run
0 commit comments