@initx-plugin/cp 0.0.16 → 0.0.17
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.mts +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.mjs +8 -2
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { InitxPlugin, InitxContext } from '@initx-plugin/core';
|
|
2
2
|
|
|
3
3
|
declare enum CpType {
|
|
4
|
-
SSH = "ssh"
|
|
4
|
+
SSH = "ssh",
|
|
5
|
+
CWD = "cwd"
|
|
5
6
|
}
|
|
6
7
|
|
|
7
|
-
declare class
|
|
8
|
+
declare class CpPlugin extends InitxPlugin {
|
|
8
9
|
matchers: {
|
|
9
10
|
matching: string;
|
|
10
11
|
description: string;
|
|
11
12
|
}[];
|
|
12
13
|
handle(_ctx: InitxContext, cpType: CpType, ...others: string[]): Promise<void>;
|
|
13
14
|
[CpType.SSH](): Promise<void>;
|
|
15
|
+
[CpType.CWD](): Promise<void>;
|
|
14
16
|
private copy;
|
|
15
17
|
}
|
|
16
18
|
|
|
17
|
-
export {
|
|
19
|
+
export { CpPlugin as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { InitxPlugin, InitxContext } from '@initx-plugin/core';
|
|
2
2
|
|
|
3
3
|
declare enum CpType {
|
|
4
|
-
SSH = "ssh"
|
|
4
|
+
SSH = "ssh",
|
|
5
|
+
CWD = "cwd"
|
|
5
6
|
}
|
|
6
7
|
|
|
7
|
-
declare class
|
|
8
|
+
declare class CpPlugin extends InitxPlugin {
|
|
8
9
|
matchers: {
|
|
9
10
|
matching: string;
|
|
10
11
|
description: string;
|
|
11
12
|
}[];
|
|
12
13
|
handle(_ctx: InitxContext, cpType: CpType, ...others: string[]): Promise<void>;
|
|
13
14
|
[CpType.SSH](): Promise<void>;
|
|
15
|
+
[CpType.CWD](): Promise<void>;
|
|
14
16
|
private copy;
|
|
15
17
|
}
|
|
16
18
|
|
|
17
|
-
export {
|
|
19
|
+
export { CpPlugin as default };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import os from 'node:os';
|
|
2
|
+
import { cwd } from 'node:process';
|
|
2
3
|
import { existsSync, readdirSync, readFileSync } from 'node:fs';
|
|
3
4
|
import { resolve } from 'node:path';
|
|
4
5
|
import clipboard from 'clipboardy';
|
|
@@ -7,6 +8,7 @@ import { log, inquirer } from '@initx-plugin/utils';
|
|
|
7
8
|
|
|
8
9
|
var CpType = /* @__PURE__ */ ((CpType2) => {
|
|
9
10
|
CpType2["SSH"] = "ssh";
|
|
11
|
+
CpType2["CWD"] = "cwd";
|
|
10
12
|
return CpType2;
|
|
11
13
|
})(CpType || {});
|
|
12
14
|
|
|
@@ -16,7 +18,7 @@ var __publicField = (obj, key, value) => {
|
|
|
16
18
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
17
19
|
return value;
|
|
18
20
|
};
|
|
19
|
-
class
|
|
21
|
+
class CpPlugin extends InitxPlugin {
|
|
20
22
|
constructor() {
|
|
21
23
|
super(...arguments);
|
|
22
24
|
__publicField(this, "matchers", [
|
|
@@ -58,9 +60,13 @@ class CpHandler extends InitxPlugin {
|
|
|
58
60
|
this.copy(publicKey);
|
|
59
61
|
log.success("Key copied to clipboard");
|
|
60
62
|
}
|
|
63
|
+
async [CpType.CWD]() {
|
|
64
|
+
this.copy(cwd());
|
|
65
|
+
log.success("Current working directory copied to clipboard");
|
|
66
|
+
}
|
|
61
67
|
copy(content) {
|
|
62
68
|
clipboard.writeSync(content);
|
|
63
69
|
}
|
|
64
70
|
}
|
|
65
71
|
|
|
66
|
-
export {
|
|
72
|
+
export { CpPlugin as default };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@initx-plugin/cp",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.17",
|
|
5
5
|
"description": "initx plugin, copy some text to clipboard",
|
|
6
6
|
"author": "imba97",
|
|
7
7
|
"license": "MIT",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"dist"
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@initx-plugin/core": "
|
|
28
|
-
"@initx-plugin/utils": "
|
|
27
|
+
"@initx-plugin/core": "^0.0.22",
|
|
28
|
+
"@initx-plugin/utils": "^0.0.22",
|
|
29
29
|
"clipboardy": "^4.0.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|