ccommand 1.0.2 → 1.0.4
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 +17 -18
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,27 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
用命令选择需要执行的script, 支持直接选择子目录下的script来执行
|
|
1
|
+
<span><div align="center"></div></span>
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
兼容了yarn和npm的命令行工具
|
|
3
|
+
高效的执行命令行工具 | Efficient execution of command-line tools
|
|
6
4
|
|
|
7
|
-
##
|
|
8
|
-
|
|
5
|
+
## 介绍 | Introduction
|
|
6
|
+
支持yarn、pnpm、npm、bun
|
|
9
7
|
|
|
10
|
-
##
|
|
8
|
+
## 依赖 | Dependencies
|
|
9
|
+
- 需要安装[gum](https://github.com/charmbracelet/gum#installation)
|
|
10
|
+
# 安装 | Install
|
|
11
11
|
```bash
|
|
12
|
-
|
|
12
|
+
brew install gum # 安装gum
|
|
13
|
+
npm install -g ccommand # 安装ccommand
|
|
13
14
|
```
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
## 使用
|
|
21
|
-
- ccommand # 默认当前目录
|
|
16
|
+
# 使用 | Usage
|
|
17
|
+
- ccommand 选取当前目录下的package.json文件中的scripts中的命令
|
|
18
|
+
- ccommand playground 选取当前目录下的playground文件夹下的package.json文件中的scripts中的命令
|
|
19
|
+
- ccommand playground -silent 支持额外的参数传参
|
|
22
20
|
|
|
23
|
-

|
|
24
22
|
|
|
25
|
-
-
|
|
23
|
+
<a href="https://github.com/Simon-He95/sponsor" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" style="height: 51px !important;width: 217px !important;" ></a>
|
|
26
24
|
|
|
27
|
-
|
|
25
|
+
## License
|
|
26
|
+
[MIT](./LICENSE) License © 2022 [Simon He](https://github.com/Simon-He95)
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var g=require("child_process"),l=require("simon-js-tool");function h(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var f=h(g);async function p(){const t=process.argv.slice(2),[e,s]=v(t),i=l.getPkgTool(),{scripts:c}=await l.getPkg(`${e||"."}/package.json`),u=[],d=Object.keys(c).reduce((r,n)=>{const o=c[n];return u.push(n),r+=`"${n}: ${o}",`,r},""),a=f.default.spawnSync(`echo ${d} | sed "s/,/\\n/g" | gum filter | cut -d' ' -f1`,{shell:!0,stdio:["inherit","pipe","inherit"],encoding:"utf8"}).output[1];if(!a)return console.log("\u5DF2\u53D6\u6D88"),process.exit();f.default.spawnSync($(),{shell:!0,stdio:"inherit"});function m(r){return u.find(n=>r.startsWith(n))}function $(){let r="",n="";const o=i==="npm"||i==="pnpm";return i==="npm"?(n=s?` -- ${s}`:"",r=e?` --prefix ${e} `:" "):i==="pnpm"?(n=s?` ${s}`:"",r=e?` --filter ${e} `:" "):(n=s?` ${s}`:"",r=e?` workspace ${e} `:" "),`${i}${o?" run":" "}${r}${m(a)}${n}`}}function v(t){const e=t[0];return e?e.startsWith("--")?[".",t.join(" ")]:[e,t.slice(1).join(" ")]:["",""]}p(),exports.ccommand=p;
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import
|
|
2
|
+
import f from"child_process";import{getPkgTool as g,getPkg as d}from"simon-js-tool";async function a(){const s=process.argv.slice(2),[t,r]=h(s),i=g(),{scripts:c}=await d(`${t||"."}/package.json`),u=[],l=Object.keys(c).reduce((e,n)=>{const o=c[n];return u.push(n),e+=`"${n}: ${o}",`,e},""),p=f.spawnSync(`echo ${l} | sed "s/,/\\n/g" | gum filter | cut -d' ' -f1`,{shell:!0,stdio:["inherit","pipe","inherit"],encoding:"utf8"}).output[1];if(!p)return console.log("\u5DF2\u53D6\u6D88"),process.exit();f.spawnSync($(),{shell:!0,stdio:"inherit"});function m(e){return u.find(n=>e.startsWith(n))}function $(){let e="",n="";const o=i==="npm"||i==="pnpm";return i==="npm"?(n=r?` -- ${r}`:"",e=t?` --prefix ${t} `:" "):i==="pnpm"?(n=r?` ${r}`:"",e=t?` --filter ${t} `:" "):(n=r?` ${r}`:"",e=t?` workspace ${t} `:" "),`${i}${o?" run":" "}${e}${m(p)}${n}`}}function h(s){const t=s[0];return t?t.startsWith("--")?[".",s.join(" ")]:[t,s.slice(1).join(" ")]:["",""]}a();export{a as ccommand};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ccommand",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"packageManager": "pnpm@6.32.3",
|
|
5
5
|
"description": "ccommand",
|
|
6
6
|
"author": "Simon He",
|
|
@@ -49,12 +49,12 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@vueuse/core": "^8.1.1",
|
|
52
|
-
"simon-js-tool": "^4.
|
|
52
|
+
"simon-js-tool": "^4.1.12",
|
|
53
53
|
"vue": "^3.2.36"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@antfu/eslint-config": "^0.26.1",
|
|
57
|
-
"@types/node": "^17.0.
|
|
57
|
+
"@types/node": "^17.0.45",
|
|
58
58
|
"@vitejs/plugin-vue": "^3.0.1",
|
|
59
59
|
"bumpp": "^7.1.1",
|
|
60
60
|
"eslint": "^8.16.0",
|
|
@@ -67,4 +67,4 @@
|
|
|
67
67
|
"eslintConfig": {
|
|
68
68
|
"extends": "@antfu"
|
|
69
69
|
}
|
|
70
|
-
}
|
|
70
|
+
}
|