@clerc/plugin-version 0.32.1 → 0.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +10 -2
- package/dist/index.js +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import * as _clerc_core from '@clerc/core';
|
|
2
2
|
|
|
3
3
|
interface VersionPluginOptions {
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Whether to register the help command.
|
|
6
|
+
* @default true
|
|
7
|
+
*/
|
|
5
8
|
command?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Whether to register the global help flag.
|
|
11
|
+
* @default true
|
|
12
|
+
*/
|
|
13
|
+
flag?: boolean;
|
|
6
14
|
}
|
|
7
|
-
declare const versionPlugin: ({
|
|
15
|
+
declare const versionPlugin: ({ command, flag, }?: VersionPluginOptions) => _clerc_core.Plugin<_clerc_core.Clerc<{}, {}>, _clerc_core.Clerc<{}, {}>>;
|
|
8
16
|
|
|
9
17
|
export { versionPlugin };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{definePlugin as
|
|
1
|
+
import{definePlugin as v}from"@clerc/core";const a=s=>s.length===0?"":s.startsWith("v")?s:`v${s}`,f={en:{"version.description":"Show CLI version","version.notes.1":'The version string begins with a "v".'},"zh-CN":{"version.description":"\u5C55\u793A CLI \u7248\u672C","version.notes.1":'\u7248\u672C\u53F7\u5F00\u5934\u5E26\u6709 "v"\u3002'}},p=({command:s=!0,flag:r=!0}={})=>v({setup:e=>{const{add:t,t:n}=e.i18n;t(f);const o=a(e._version);return s&&(e=e.command("version",n("version.description"),{notes:[n("version.notes.1")]}).on("version",()=>{process.stdout.write(o)})),r&&(e=e.flag("version",n("version.description"),{alias:"V",type:Boolean,default:!1}),e.inspector({enforce:"pre",fn:(i,u)=>{i.flags.version?process.stdout.write(o):u()}})),e}});export{p as versionPlugin};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clerc/plugin-version",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.34.0",
|
|
4
4
|
"author": "Ray <i@mk1.io> (https://github.com/so1ve)",
|
|
5
5
|
"description": "Clerc plugin version",
|
|
6
6
|
"keywords": [
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"@clerc/core": "*"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@clerc/
|
|
47
|
-
"@clerc/
|
|
46
|
+
"@clerc/utils": "0.34.0",
|
|
47
|
+
"@clerc/core": "0.34.0"
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
50
|
"build": "puild --minify",
|