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 CHANGED
@@ -1,18 +1,19 @@
1
1
  {
2
2
  "name": "jja",
3
3
  "type": "module",
4
- "version": "2.3.3",
4
+ "version": "2.3.5",
5
5
  "description": "一些在终端的执行动作 🥜",
6
6
  "license": "MIT",
7
7
  "dependencies": {
8
- "@color-pen/static": "^0.0.2",
9
- "@qqi/copy-text": "^0.0.2",
10
- "@qqi/dev-log": "^0.3.3",
11
- "a-command": "^2.1.9",
12
- "a-js-tools": "^0.6.2",
13
- "a-node-tools": "^3.1.5",
14
- "a-type-of-js": "^0.3.0",
15
- "color-pen": "^2.0.3"
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": "🥜",
@@ -1 +1 @@
1
- import{isTTY as o,runOtherCode as t,isWindows as r,cursorMoveUp as a,cursorAfterClear as c,_p as i}from"a-node-tools";import{dog as n}from"./dog.mjs";import{csi as p}from"@color-pen/static";async function m(){o()?(n("执行第一遍清理"),await t({code:r?"cls":"clear",printLog:!1}),n("执行第二遍清理"),await t({code:r?"cls":`printf '${["2J","3J","H"].map((o=>p.concat(o))).join()}'`,printLog:!1}),a(1/0),c(!0)):(n.warn("当前系统不支持 TTY"),i("当前环境不支持 "))}export{m as clearScreen};
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:"error"});export{o as dog};
1
+ import e from"@qqi/dev-log";const o=new e({name:"jja",type:!1});export{o as dog};
@@ -1 +1 @@
1
- import{command as t}from"../command.mjs";import{tagCommit as m}from"./tagCommit.mjs";async function o(){await m(await t.question({text:"请输入待标记的信息",private:!0}))}export{o as beforeTagCommit};
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};
@@ -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};
@@ -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,italicPen as r,strInOneLineOnTerminal as a}from"color-pen";import{diffData as m}from"./data-store.mjs";import{isNull as s}from"a-type-of-js";import{installation as l}from"./installation.mjs";import{latestPen as p}from"./latestPen.mjs";import{tagPen as g}from"./tagPen.mjs";import{printInOneLine as c}from"../../printInOneLine.mjs";async function d(){const{local:d,preReleaseDependence:f,latestDependence:h,dependenceList:b,timeoutDependence:j}=m;if(s(d))return;const{dependencies:u,devDependencies:y}=d;if(m.binning(u),m.binning(y,!0),await n(),0===f.length&&0===h.length&&0===j.length)return void t(e`看起来似乎没有依赖版本差异`);if(0===f.length&&0===h.length)return void t(i`看起来网络不太好讷,所有的包线上版本的请求都出错了。或者是还没有执行 npm install 呐`);t(o.brightGreen`\n版本差异的依赖为:\n`),t([...h,...f].map((e=>{const t=b[e],n=o.random`- `.concat(`${"dependencies"===t.type?o.bold(e):o.italic(e)}:于${o.color("#066")(t.time)} 发布 ${t.latestVersion||r(t.onlineVersion)}`);return a(n)})).join("\n")),t(o.brightRed(`\n目前仅关注版本号是否为最新 ${o.brightMagenta("latest")}`)),t("使用 npm install --save 命令安装更新\n"),j.length>0&&(c(i`有一些包没有返回结果,请注意:`),c(j.map((e=>`${o.random`-`} ${e}`)).join("\n")));const $=[...h.filter((e=>!1===f.includes(e))).map((e=>o.bold(e).concat("@latest"))),...f.map((e=>g(e,b[e].tag)))],v=h.map((e=>p(e))),w=[...h.map((e=>p(e))),...f.filter((e=>!1===h.includes(e))).map((e=>g(e,b[e].tag)))],D=$.length<f.length+h.length,R=f.length>0,V=h.length>0;R&&(D&&await l({msg:"‼️ 预发布版本优先:",list:$,type:"brightRed"}),await l({msg:"⚠️ latest 版本优先:",list:w,type:"brightMagenta",copy:!V})),V&&await l({msg:"🎉 最佳安装:",list:v,type:"brightGreen",copy:!0})}export{d as dependencies};
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{pen399 as e}from"../../pen.mjs";import{cursorMoveUp as n,cursorLineClear as o,cursorAfterClear as t}from"a-node-tools";import{getInstallVersion as s}from"./getInstallVersion.mjs";import{getLatestVersion as i}from"./getLatestVersion.mjs";import{diffData as r}from"./data-store.mjs";import{printInOneLine as l}from"../../printInOneLine.mjs";import{greenPen as p}from"color-pen";async function m(){const{dependenceList:m,timeoutDependence:a}=r,c=Object.keys(m);let f=!1;for(let V=0,$=c.length;V<$;V++){const $=c[V],u=m[$],d=m[$].version;await i($);const j=s($);if(f&&(n(),o(),t(!0)),""===u.onlineVersion&&""===u.latestVersion){a.push($),l(`${$} 本地 ${u.localVersion} 请求 ❌`),f=!1;continue}if(j===u.onlineVersion){let e=`${$} 的本地${d} 安装版本为 ${j} 最新是 ${u.onlineVersion} `;if(""===u.latestVersion){l(e),f=!0;continue}f=!1,r.preReleaseDependence.push($),e+=`;最新预发布版本为 ${p(u.latestVersion)}`,l(e);continue}if(f=!1,j===u.latestVersion)continue;let h=`${$} 的本地 ${p(d)} 安装版本为 ${p(j)} 最新是 ${e(u.onlineVersion)} `;r.latestDependence.push($),""!==u.latestVersion?(r.preReleaseDependence.push($),h+=`;最新预发布版本为 ${p(u.latestVersion)}`,l(h)):l(h)}!0===f&&(n(),o(),t(!0),f=!1)}export{m as diffVersion};
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 i}from"./dependencies.mjs";import{diffData as n}from"./data-store.mjs";import{orangePen as m,pen399 as s}from"../../pen.mjs";async function a(){await t();const{local:a,online:p}=n,f=a?.version||"",c=p?.version||"";if(r(a))return o("未找到包 package.json 文件退出"),e(m("未找到当前包 package.json"));const j=m(`当前包本地版本为: ${f}`);if(e(j),r(p))e(s("未获取当前包的线上信息"));else{const o=" ".repeat(6);e(s(`${o}线上版本为:${c}@latest`));const t=new Date(p&&p.time.modified||"").toLocaleString();e(t.toString())}await i()}export{a as diffPackage};
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 o,isWindows as e,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||o(t("#aaa")(` ${i} 文件/夹存在,准备删除`));let l={error:null};return e?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||void 0!==console.log(l.error)}export{i as removeFileOrDirectory};
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};