@simon_he/pi 0.0.11 → 0.0.13
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/README.md +19 -0
- package/dist/index.cjs +8 -3
- package/dist/index.d.ts +3 -2
- package/dist/index.mjs +8 -4
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -36,6 +36,25 @@ https://user-images.githubusercontent.com/57086651/203143603-9e78f686-399e-4c3d-
|
|
|
36
36
|
pbuild
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
+
## Power
|
|
40
|
+
The current environment is npm | yarn | pnpm, and it supports passing some args --silent
|
|
41
|
+
|
|
42
|
+
- prun dev The dev command in the current package.json
|
|
43
|
+
- prun If no command is specified, provide all scripts command options under the current package
|
|
44
|
+
- prun playground, provide all scripts command options under the current package
|
|
45
|
+
|
|
46
|
+
The current environment is go
|
|
47
|
+
|
|
48
|
+
- prun message, it will find message.go first, if not found, it will find message/main.go to execute
|
|
49
|
+
|
|
50
|
+
The current environment is rust
|
|
51
|
+
|
|
52
|
+
- prun executable cargo run
|
|
53
|
+
|
|
54
|
+
workspace of pnpm | yarn
|
|
55
|
+
|
|
56
|
+
- pfind Select the package under the current workspace, and then select the corresponding command
|
|
57
|
+
|
|
39
58
|
## :monocle_face: Feature
|
|
40
59
|
```
|
|
41
60
|
<-- Go -->
|
package/dist/index.cjs
CHANGED
|
@@ -16,7 +16,7 @@ const process__default = /*#__PURE__*/_interopDefaultLegacy(process);
|
|
|
16
16
|
const ora__default = /*#__PURE__*/_interopDefaultLegacy(ora);
|
|
17
17
|
const fg__default = /*#__PURE__*/_interopDefaultLegacy(fg);
|
|
18
18
|
|
|
19
|
-
const version = "0.0.
|
|
19
|
+
const version = "0.0.13";
|
|
20
20
|
|
|
21
21
|
const rootPath = process__default.cwd();
|
|
22
22
|
const __filename$1 = url$1.fileURLToPath((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('index.cjs', document.baseURI).href)));
|
|
@@ -55,6 +55,9 @@ async function pui(params, pkg) {
|
|
|
55
55
|
function prun(params) {
|
|
56
56
|
simonJsTool.jsShell(`ccommand ${params}`);
|
|
57
57
|
}
|
|
58
|
+
function pfind(params) {
|
|
59
|
+
simonJsTool.jsShell(`ccommand find ${params}`);
|
|
60
|
+
}
|
|
58
61
|
function pinit() {
|
|
59
62
|
console.log("Initializing project...");
|
|
60
63
|
switch (simonJsTool.getPkgTool()) {
|
|
@@ -95,7 +98,7 @@ function returnVersion(argv) {
|
|
|
95
98
|
simonJsTool.jsShell(`gum style --foreground 212 --border-foreground 212 --border double --align center --width 50 --margin "1 2" --padding "2 4" 'pi version:${version}' 'Please give me a \u{1F31F} for my efforts'`);
|
|
96
99
|
process__default.exit(0);
|
|
97
100
|
} else if (arg === "-h" || arg === "--help") {
|
|
98
|
-
simonJsTool.jsShell(`gum style --foreground 212 --border-foreground 212 --border double --align center --width 50 --margin "1 2" --padding "1 1" 'PI Commands:' 'pi: install package' 'pui: uninstall package' 'prun: run package script' 'pinit: package init' 'pbuild: go build | cargo build'`);
|
|
101
|
+
simonJsTool.jsShell(`gum style --foreground 212 --border-foreground 212 --border double --align center --width 50 --margin "1 2" --padding "1 1" 'PI Commands:' 'pi: install package' 'pui: uninstall package' 'prun: run package script' 'pinit: package init' 'pbuild: go build | cargo build' 'pfind: find monorepo of yarn or pnpm'`);
|
|
99
102
|
process__default.exit(0);
|
|
100
103
|
}
|
|
101
104
|
}
|
|
@@ -103,7 +106,8 @@ const runMap = {
|
|
|
103
106
|
pi,
|
|
104
107
|
pui,
|
|
105
108
|
prun,
|
|
106
|
-
pinit
|
|
109
|
+
pinit,
|
|
110
|
+
pfind
|
|
107
111
|
};
|
|
108
112
|
function isGo() {
|
|
109
113
|
const url2 = path__default.resolve(rootPath, "go.mod");
|
|
@@ -203,6 +207,7 @@ async function runner() {
|
|
|
203
207
|
}
|
|
204
208
|
runner();
|
|
205
209
|
|
|
210
|
+
exports.pfind = pfind;
|
|
206
211
|
exports.pi = pi;
|
|
207
212
|
exports.pinit = pinit;
|
|
208
213
|
exports.prun = prun;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
declare function pi(params: string[], pkg: string): Promise<void>;
|
|
2
2
|
declare function pui(params: string[], pkg: string): Promise<void>;
|
|
3
|
-
declare function prun(params: string
|
|
3
|
+
declare function prun(params: string): void;
|
|
4
|
+
declare function pfind(params: string): void;
|
|
4
5
|
declare function pinit(): void;
|
|
5
6
|
declare function runner(): Promise<void>;
|
|
6
7
|
|
|
7
|
-
export { pi, pinit, prun, pui, runner };
|
|
8
|
+
export { pfind, pi, pinit, prun, pui, runner };
|
package/dist/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { useNodeWorker, jsShell, getPkgTool } from 'simon-js-tool';
|
|
|
5
5
|
import ora from 'ora';
|
|
6
6
|
import fg from 'fast-glob';
|
|
7
7
|
|
|
8
|
-
const version = "0.0.
|
|
8
|
+
const version = "0.0.13";
|
|
9
9
|
|
|
10
10
|
const rootPath = process.cwd();
|
|
11
11
|
const __filename = fileURLToPath(import.meta.url);
|
|
@@ -44,6 +44,9 @@ async function pui(params, pkg) {
|
|
|
44
44
|
function prun(params) {
|
|
45
45
|
jsShell(`ccommand ${params}`);
|
|
46
46
|
}
|
|
47
|
+
function pfind(params) {
|
|
48
|
+
jsShell(`ccommand find ${params}`);
|
|
49
|
+
}
|
|
47
50
|
function pinit() {
|
|
48
51
|
console.log("Initializing project...");
|
|
49
52
|
switch (getPkgTool()) {
|
|
@@ -84,7 +87,7 @@ function returnVersion(argv) {
|
|
|
84
87
|
jsShell(`gum style --foreground 212 --border-foreground 212 --border double --align center --width 50 --margin "1 2" --padding "2 4" 'pi version:${version}' 'Please give me a \u{1F31F} for my efforts'`);
|
|
85
88
|
process.exit(0);
|
|
86
89
|
} else if (arg === "-h" || arg === "--help") {
|
|
87
|
-
jsShell(`gum style --foreground 212 --border-foreground 212 --border double --align center --width 50 --margin "1 2" --padding "1 1" 'PI Commands:' 'pi: install package' 'pui: uninstall package' 'prun: run package script' 'pinit: package init' 'pbuild: go build | cargo build'`);
|
|
90
|
+
jsShell(`gum style --foreground 212 --border-foreground 212 --border double --align center --width 50 --margin "1 2" --padding "1 1" 'PI Commands:' 'pi: install package' 'pui: uninstall package' 'prun: run package script' 'pinit: package init' 'pbuild: go build | cargo build' 'pfind: find monorepo of yarn or pnpm'`);
|
|
88
91
|
process.exit(0);
|
|
89
92
|
}
|
|
90
93
|
}
|
|
@@ -92,7 +95,8 @@ const runMap = {
|
|
|
92
95
|
pi,
|
|
93
96
|
pui,
|
|
94
97
|
prun,
|
|
95
|
-
pinit
|
|
98
|
+
pinit,
|
|
99
|
+
pfind
|
|
96
100
|
};
|
|
97
101
|
function isGo() {
|
|
98
102
|
const url2 = path.resolve(rootPath, "go.mod");
|
|
@@ -192,4 +196,4 @@ async function runner() {
|
|
|
192
196
|
}
|
|
193
197
|
runner();
|
|
194
198
|
|
|
195
|
-
export { pi, pinit, prun, pui, runner };
|
|
199
|
+
export { pfind, pi, pinit, prun, pui, runner };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simon_he/pi",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.13",
|
|
5
5
|
"packageManager": "pnpm@7.2.1",
|
|
6
6
|
"description": "",
|
|
7
7
|
"author": "Simon He",
|
|
@@ -38,7 +38,8 @@
|
|
|
38
38
|
"pui": "./cli.mjs",
|
|
39
39
|
"prun": "./cli.mjs",
|
|
40
40
|
"pinit": "./cli.mjs",
|
|
41
|
-
"pbuild": "./cli.mjs"
|
|
41
|
+
"pbuild": "./cli.mjs",
|
|
42
|
+
"pfind": "./cli.mjs"
|
|
42
43
|
},
|
|
43
44
|
"files": [
|
|
44
45
|
"dist"
|