mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-04-27 07:09:16 -05:00
feat: implement version-related APIs for GeneratorAPI (#4000)
closes #2336
(cherry picked from commit 77092b2223)
This commit is contained in:
@@ -1,5 +1,44 @@
|
||||
# Generator API
|
||||
|
||||
## cliVersion
|
||||
|
||||
Type: `string`
|
||||
|
||||
The version string for the **global** `@vue/cli` version that is invoking the plugin.
|
||||
|
||||
|
||||
## assertCliVersion
|
||||
|
||||
- **Arguments**
|
||||
- `{integer | string} range` - a semver range that `@vue/cli` needs to satisfy
|
||||
|
||||
- **Usage**
|
||||
|
||||
While api.version can be useful in general, it's sometimes nice to just declare your version.
|
||||
This API exposes a simple way to do that.
|
||||
|
||||
Nothing happens if the provided version is satified. Otherwise, an error will be thrown.
|
||||
|
||||
|
||||
## cliServiceVersion
|
||||
|
||||
Type: `string`
|
||||
|
||||
The version string for the **project local** `@vue/cli-service` version that is invoking the plugin.
|
||||
|
||||
|
||||
## assertCliServiceVersion
|
||||
|
||||
- **Arguments**
|
||||
- `{integer | string} range` - a semver range that `@vue/cli-service` needs to satisfy
|
||||
|
||||
- **Usage**
|
||||
|
||||
This API exposes a simple way to declare the required project local `@vue/cli-service` version.
|
||||
|
||||
Nothing happens if the provided version is satified. Otherwise, an error will be thrown.
|
||||
|
||||
|
||||
## resolve
|
||||
|
||||
- **Arguments**
|
||||
|
||||
@@ -7,7 +7,7 @@ Type: `string`
|
||||
The version string for the `@vue/cli-service` version that is loading the plugin.
|
||||
|
||||
|
||||
## assertVersion(range)
|
||||
## assertVersion
|
||||
|
||||
- **Arguments**
|
||||
- `{integer | string} range` - a semver range that `@vue/cli-service` needs to satisfy
|
||||
|
||||
Reference in New Issue
Block a user