@clerc/plugin-version 1.1.0 → 1.1.1
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.mjs +1 -23
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -1,23 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { formatVersion } from "@clerc/utils";
|
|
3
|
-
|
|
4
|
-
//#region src/index.ts
|
|
5
|
-
const versionPlugin = ({ command = true, flag = true } = {}) => definePlugin({ setup: (cli) => {
|
|
6
|
-
if (command) cli.command("version", "Prints current version", {}).on("version", () => {
|
|
7
|
-
console.log(formatVersion(cli._version));
|
|
8
|
-
});
|
|
9
|
-
if (flag) cli.globalFlag("version", "Prints current version", {
|
|
10
|
-
short: "V",
|
|
11
|
-
type: Boolean,
|
|
12
|
-
default: false
|
|
13
|
-
}).interceptor({
|
|
14
|
-
enforce: "pre",
|
|
15
|
-
handler: async (ctx, next) => {
|
|
16
|
-
if (ctx.flags.version) console.log(formatVersion(cli._version));
|
|
17
|
-
else await next();
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
} });
|
|
21
|
-
|
|
22
|
-
//#endregion
|
|
23
|
-
export { versionPlugin };
|
|
1
|
+
import{definePlugin as e}from"@clerc/core";import{formatVersion as t}from"@clerc/utils";const n=({command:n=!0,flag:r=!0}={})=>e({setup:e=>{n&&e.command(`version`,`Prints current version`,{}).on(`version`,()=>{console.log(t(e._version))}),r&&e.globalFlag(`version`,`Prints current version`,{short:`V`,type:Boolean,default:!1}).interceptor({enforce:`pre`,handler:async(n,r)=>{n.flags.version?console.log(t(e._version)):await r()}})}});export{n as versionPlugin};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clerc/plugin-version",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"author": "Ray <i@mk1.io> (https://github.com/so1ve)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Clerc plugin version",
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@clerc/utils": "1.1.
|
|
41
|
+
"@clerc/utils": "1.1.1"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@clerc/core": "1.1.
|
|
44
|
+
"@clerc/core": "1.1.1"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"@clerc/core": "*"
|