jja 2.3.3 → 2.3.5
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/package.json +10 -9
- package/src/clearScreen.mjs +1 -1
- package/src/dog.mjs +1 -1
- package/src/git/beforeTagCommit.mjs +1 -1
- package/src/git/gitCommit.mjs +1 -1
- package/src/git/gitMerge.mjs +1 -1
- package/src/package/diff/dependencies.mjs +1 -1
- package/src/package/diff/diffVersion.mjs +1 -1
- package/src/package/diff/index.mjs +1 -1
- package/src/remove/removeFileOrDirectory.mjs +1 -1
package/package.json
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jja",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.3.
|
|
4
|
+
"version": "2.3.5",
|
|
5
5
|
"description": "一些在终端的执行动作 🥜",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@color-pen/static": "^0.0
|
|
9
|
-
"@qqi/copy-text": "^0.0
|
|
10
|
-
"@qqi/dev-log": "^0.
|
|
11
|
-
"a-command": "^2.
|
|
12
|
-
"a-js-tools": "^0.
|
|
13
|
-
"a-node-tools": "^
|
|
14
|
-
"a-type-of-js": "^0.
|
|
15
|
-
"color-pen": "^2.0.
|
|
8
|
+
"@color-pen/static": "^1.0.0",
|
|
9
|
+
"@qqi/copy-text": "^1.0.0",
|
|
10
|
+
"@qqi/dev-log": "^1.0.1",
|
|
11
|
+
"a-command": "^2.2.5",
|
|
12
|
+
"a-js-tools": "^1.0.0",
|
|
13
|
+
"a-node-tools": "^4.2.1",
|
|
14
|
+
"a-type-of-js": "^1.0.1",
|
|
15
|
+
"color-pen": "^2.0.10",
|
|
16
|
+
"colored-table": "^0.0.2"
|
|
16
17
|
},
|
|
17
18
|
"author": {
|
|
18
19
|
"name": "🥜",
|
package/src/clearScreen.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isTTY as o,runOtherCode as
|
|
1
|
+
import{isTTY as o,runOtherCode as r,isWindows as t,__p as a,cursorMoveUp as c,cursorAfterClear as n,_p as i}from"a-node-tools";import{dog as m}from"./dog.mjs";async function e(){o()?(m("执行第一遍清理"),await r({code:t?"cls":"clear",printLog:!1}),m("执行第二遍清理"),a("3J"),a("c",!1),c(1/0),n(!0)):(m.warn("当前系统不支持 TTY"),i("当前环境不支持 "))}export{e as clearScreen};
|
package/src/dog.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@qqi/dev-log";const o=new e({name:"jja",type
|
|
1
|
+
import e from"@qqi/dev-log";const o=new e({name:"jja",type:!1});export{o as dog};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{isUndefined as t}from"a-type-of-js";import{command as o}from"../command.mjs";import{tagCommit as m}from"./tagCommit.mjs";async function a(){const a=await o.question({text:"请输入待标记的信息",private:!0});t(a)||await m(a)}export{a as beforeTagCommit};
|
package/src/git/gitCommit.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{command as o}from"../command.mjs";import{getDirectoryBy as t,_p as r,runOtherCode as e}from"a-node-tools";import{hexPen as i}from"color-pen";import{tagCommit as c}from"./tagCommit.mjs";async function n(n="版本维护",s=!1){const a=t(".git","directory");if(null==a)return r(i("#ff0")("not a git repository(当前目录非 git 储存库)"));const m=await e({code:"git add .",cwd:a});if(!m.success)return null!=console.log(m.error);const l=await e({code:"git status",cwd:a});if(!/nothing to commit, working tree clean/.test(l.data||"")){const t=await e({code:"git add .",cwd:a});if(!t.success)return null!=console.log(t.error);""==n.trim()&&(n=await o.question({text:"请输入提交信息",private:!0}));const r=await e({code:`git commit -m "${n}"`,cwd:a});return r.success?(r.error&&console.log(r.error),await e({code:"git push",cwd:a}),s&&await c(n),!0):null!=console.log(r.error)}return!1}export{n as gitCommit};
|
|
1
|
+
import{command as o}from"../command.mjs";import{getDirectoryBy as t,_p as r,runOtherCode as e}from"a-node-tools";import{hexPen as i}from"color-pen";import{tagCommit as c}from"./tagCommit.mjs";async function n(n="版本维护",s=!1){const a=t(".git","directory");if(null==a)return r(i("#ff0")("not a git repository(当前目录非 git 储存库)"));const m=await e({code:"git add .",cwd:a});if(!m.success)return null!=console.log(m.error);const l=await e({code:"git status",cwd:a});if(!/nothing to commit, working tree clean/.test(l.data||"")){const t=await e({code:"git add .",cwd:a});if(!t.success)return null!=console.log(t.error);""==n.trim()&&(n=await o.question({text:"请输入提交信息",private:!0})||"");const r=await e({code:`git commit -m "${n}"`,cwd:a});return r.success?(r.error&&console.log(r.error),await e({code:"git push",cwd:a}),s&&await c(n),!0):null!=console.log(r.error)}return!1}export{n as gitCommit};
|
package/src/git/gitMerge.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{runOtherCode as a}from"a-node-tools";import{command as t}from"../command.mjs";async function o(o){if(""==o){const i=await a("git branch -a");console.log(i.data),o=await t.question({text:"请输入要合并分支的名称",private:!0})}const i=await t.selection({data:["正常快进合并","非快进合并 (--no-ff)","多提交记录合并为一条 (--squash)"],private:!0},"number");await a(`git merge ${o} ${["","--no-ff","--squash"][i]}`)}export{o as gitMerge};
|
|
1
|
+
import{runOtherCode as a}from"a-node-tools";import{command as t}from"../command.mjs";async function o(o){if(""==o){const i=await a("git branch -a");console.log(i.data),o=await t.question({text:"请输入要合并分支的名称",private:!0})||""}const i=await t.selection({data:["正常快进合并","非快进合并 (--no-ff)","多提交记录合并为一条 (--squash)"],private:!0},"number");await a(`git merge ${o} ${["","--no-ff","--squash"][i]}`)}export{o as gitMerge};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{pen666 as e}from"../../pen.mjs";import{_p as t}from"a-node-tools";import{diffVersion as n}from"./diffVersion.mjs";import{redPen as i,pen as o,
|
|
1
|
+
import{pen666 as e}from"../../pen.mjs";import{_p as t}from"a-node-tools";import{diffVersion as n}from"./diffVersion.mjs";import{redPen as i,pen as o,cyanPen as r,boldPen as a,italicPen as m,randomPen as s,greenPen as l}from"color-pen";import{diffData as p}from"./data-store.mjs";import{isNull as g}from"a-type-of-js";import{installation as c}from"./installation.mjs";import{latestPen as d}from"./latestPen.mjs";import{tagPen as f}from"./tagPen.mjs";import{printInOneLine as h}from"../../printInOneLine.mjs";import{Table as b}from"colored-table";async function y(){const{local:y,preReleaseDependence:j,latestDependence:u,dependenceList:w,timeoutDependence:v}=p;if(g(y))return;const{dependencies:D,devDependencies:R}=y;if(p.binning(D),p.binning(R,!0),await n(),0===j.length&&0===u.length&&0===v.length)return void t(e`看起来似乎没有依赖版本差异`);if(0===j.length&&0===u.length)return void t(i`看起来网络不太好讷,所有的包线上版本的请求都出错了。或者是还没有执行 npm install 呐`);t(o.brightGreen`\n版本差异的依赖为:\n`);const V=[...u,...j];new b({header:[r("包名"),{content:"发布时间",color:"#f26"},l`最新版本`],body:[...V.map((e=>{const{type:t,latestVersion:n,time:i,onlineVersion:o}=w[e];return["dependencies"===t?a(e):m(e),s(i),n||m(o)]}))]})(),t(o.brightRed(`\n目前仅关注版本号是否为最新 ${o.brightMagenta("latest")}`)),t("使用 npm install --save 命令安装更新\n"),v.length>0&&(h(i`有一些包没有返回结果,请注意:`),new b([...v.map((e=>[e]))])());const G=[...u.filter((e=>!1===j.includes(e))).map((e=>o.bold(e).concat("@latest"))),...j.map((e=>f(e,w[e].tag)))],L=u.map((e=>d(e))),M=[...u.map((e=>d(e))),...j.filter((e=>!1===u.includes(e))).map((e=>f(e,w[e].tag)))],P=G.length<j.length+u.length,x=j.length>0,I=u.length>0;x&&(P&&await c({msg:"‼️ 预发布版本优先:",list:G,type:"brightRed"}),await c({msg:"⚠️ latest 版本优先:",list:M,type:"brightMagenta",copy:!I})),I&&await c({msg:"🎉 最佳安装:",list:L,type:"brightGreen",copy:!0})}export{y as dependencies};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{command as e}from"../../command.mjs";import{pen399 as o}from"../../pen.mjs";import{cursorMoveUp as t,cursorLineClear as n,cursorAfterClear as i}from"a-node-tools";import{getInstallVersion as s}from"./getInstallVersion.mjs";import{getLatestVersion as r}from"./getLatestVersion.mjs";import{diffData as a}from"./data-store.mjs";import{strInOneLineOnTerminal as l,greenPen as m}from"color-pen";import{sleep as p}from"a-js-tools";async function c(){const{dependenceList:c,timeoutDependence:$}=a,f=Object.keys(c);let V=!1;const u=()=>{t(),n(!0),i(!0)};for(let t=0,n=f.length;t<n;t++){const n=f[t],i=c[n],d=c[n].version;V&&u(),e.CURRENT(l(`获取 ${n} 的本地安装信息`)),await p(36),u();const w=s(n);if(e.SUCCESS(l(`${n} 的本地安装版本:${i.localVersion}`)),await p(36),await r(n),u(),""===i.onlineVersion&&""===i.latestVersion){$.push(n),e.ERROR(`${n} 本地 ${i.localVersion} 请求错误`),V=!1;continue}if(w===i.onlineVersion){let o=`${n} 的本地${d} 安装版本为 ${w} 最新是 ${i.onlineVersion} `;if(""===i.latestVersion){e.INFO(l(o)),V=!0,await p(36);continue}V=!1,a.preReleaseDependence.push(n),o+=`;最新预发布版本为 ${m(i.latestVersion)}`,e.INFO(o),await p(36);continue}if(V=!1,w===i.latestVersion){e.INFO(`${n} 的本地版本${d} 安装版本为 ${w}`),await p(36);continue}let j=`${n} 的本地 ${m(d)} 安装版本为 ${m(w)} 最新是 ${o(i.onlineVersion)} `;a.latestDependence.push(n),""!==i.latestVersion?(a.preReleaseDependence.push(n),j+=`;最新预发布版本为 ${m(i.latestVersion)}`,e.INFO(j),await p(36)):(e.INFO(j),await p(36))}!0===V&&(u(),V=!1)}export{c as diffVersion};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{dog as o}from"../../dog.mjs";import{getVersion as t}from"./getVersion.mjs";import{_p as e}from"a-node-tools";import{isNull as r}from"a-type-of-js";import{dependencies as
|
|
1
|
+
import{dog as o}from"../../dog.mjs";import{getVersion as t}from"./getVersion.mjs";import{_p as e}from"a-node-tools";import{isNull as r}from"a-type-of-js";import{dependencies as m}from"./dependencies.mjs";import{diffData as s}from"./data-store.mjs";import{orangePen as n,pen399 as i}from"../../pen.mjs";import{command as a}from"../../command.mjs";import{randomPen as p}from"color-pen";async function c(){await t();const{local:c,online:f}=s,j=c?.version||"",d=f?.version||"";if(r(c))return o("未找到包 package.json 文件退出"),e(n("未找到当前包 package.json"));const l=n(`当前包本地版本为: ${j}`);if(e(l),r(f))e(i("未获取当前包的线上信息"));else{const o=" ".repeat(6);e(i(`${o}线上版本为:${d}@latest`));const t=new Date(f&&f.time.modified||"").toLocaleString();a.INFO(`最后的发布时间为: ${t.toString()}`),e([..."-".repeat(process.stdout.columns)].map((o=>p(o))).join("")),e(),e([..."-".repeat(process.stdout.columns)].map((o=>p(o))).join(""))}await m()}export{c as diffPackage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{removeData as r}from"./removeData.mjs";import{_p as
|
|
1
|
+
import{removeData as r}from"./removeData.mjs";import{_p as e,isWindows as o,runOtherCode as s}from"a-node-tools";import{removeResult as c}from"./removeResult.mjs";import{hexPen as t}from"color-pen";async function i(i,a){r.log||e(t("#aaa")(` ${i} 文件/夹存在,准备删除`));let l={error:null};return o?a.isDirectory()?(l=await s({code:`rd /q /s ${i.replace(/\//,"\\")}`,printLog:!1}),c(i,l.success)):a.isFile()&&(l=await s({code:`del ${r.subdirectories?"/s":""} /q ${i.replace(/\//,"\\")}`,printLog:!1}),c(i,l.success)):(l=await s({code:`rm -rf ${i.replace(/\\/,"/")}`,printLog:!1}),c(i,l.success)),!!l.success||(console.log(l.error),!1)}export{i as removeFileOrDirectory};
|