@clamjs/utils
Advanced tools
Comparing version 0.1.0-alpha.0 to 0.1.0-alpha.1
@@ -46,3 +46,4 @@ import { NpmPackageJson } from './npm.js'; | ||
declare const getProcessEnv: (key: string) => string; | ||
declare const getRepo: () => { | ||
/** 获取项目 git 仓库信息。依次尝试 package.json 中的 "repository.url"、git 配置的 "remote.origin.url" */ | ||
declare const getGitRepoInfo: () => { | ||
gitGroupName: string; | ||
@@ -56,2 +57,2 @@ gitRepoName: string; | ||
export { type BuilderJson, EDITH_ENV, type PackageJson, type TsconfigJson, clamjsDir, clamjsPackagesDir, dirname, edithAccessToken, edithRoot, filename, folderName, getAbcJson, getClamjsPkgJson, getPkgJson, getProcessEnv, getRepo, getTscJson, pwd, root }; | ||
export { type BuilderJson, EDITH_ENV, type PackageJson, type TsconfigJson, clamjsDir, clamjsPackagesDir, dirname, edithAccessToken, edithRoot, filename, folderName, getAbcJson, getClamjsPkgJson, getGitRepoInfo, getPkgJson, getProcessEnv, getTscJson, pwd, root }; |
@@ -1,3 +0,3 @@ | ||
export { s as EDITH_ENV, j as clamjsDir, k as clamjsPackagesDir, i as dirname, r as edithAccessToken, q as edithRoot, h as filename, l as folderName, o as getAbcJson, p as getClamjsPkgJson, n as getPkgJson, t as getProcessEnv, u as getRepo, m as getTscJson, g as pwd, f as root } from './chunk-BLGFDLHB.js'; | ||
export { G as EDITH_ENV, x as clamjsDir, y as clamjsPackagesDir, w as dirname, F as edithAccessToken, E as edithRoot, v as filename, z as folderName, C as getAbcJson, D as getClamjsPkgJson, I as getGitRepoInfo, B as getPkgJson, H as getProcessEnv, A as getTscJson, u as pwd, t as root } from './chunk-CDG5OOSI.js'; | ||
//# sourceMappingURL=out.js.map | ||
//# sourceMappingURL=codebase.js.map |
@@ -1,4 +0,4 @@ | ||
export { b as getEdithProxyApi, a as getEdithUser } from './chunk-SS5P7KSG.js'; | ||
import './chunk-BLGFDLHB.js'; | ||
export { b as getEdithProxyApi, a as getEdithUser } from './chunk-NYEYCAAH.js'; | ||
import './chunk-CDG5OOSI.js'; | ||
//# sourceMappingURL=out.js.map | ||
//# sourceMappingURL=edith.js.map |
@@ -1,2 +0,2 @@ | ||
import { b } from './chunk-BLGFDLHB.js'; | ||
import { b } from './chunk-CDG5OOSI.js'; | ||
@@ -3,0 +3,0 @@ var e=()=>({pnpmVersion:b("pnpm -v"),tnpmVersion:b("tnpm -v")?.match(/tnpm@(\d+\.\d+\.\d+)/u)?.[1]||"",npmVersion:b("npm -v"),nodeVersion:b("node -v")}),i=()=>({branch:b("git rev-parse --abbrev-ref HEAD"),userNick:b("git config user.name"),userEmail:b("git config --global user.email")}); |
@@ -45,5 +45,6 @@ interface CreateProject { | ||
declare const commit: (message: string) => void; | ||
declare const push: () => void; | ||
declare const push: (commitMessage?: string) => void; | ||
declare const getLatestGitTags: (prefix?: string, merged?: boolean) => string[]; | ||
declare const getGitOriginUrl: () => string; | ||
export { CLAM_BOT_INFO, type CreateProject, commit, createBranch, createProject, getCommitId, getCurrentBranch, getGroup, getLatestGitTags, getOriginMainBranch, getProject, needCommit, needPush, push }; | ||
export { CLAM_BOT_INFO, type CreateProject, commit, createBranch, createProject, getCommitId, getCurrentBranch, getGitOriginUrl, getGroup, getLatestGitTags, getOriginMainBranch, getProject, needCommit, needPush, push }; |
@@ -1,4 +0,3 @@ | ||
export { j as CLAM_BOT_INFO, k as commit, i as createBranch, c as createProject, e as getCommitId, d as getCurrentBranch, b as getGroup, m as getLatestGitTags, h as getOriginMainBranch, a as getProject, f as needCommit, g as needPush, l as push } from './chunk-YWGMWURF.js'; | ||
import './chunk-BLGFDLHB.js'; | ||
export { o as CLAM_BOT_INFO, p as commit, n as createBranch, h as createProject, j as getCommitId, i as getCurrentBranch, s as getGitOriginUrl, g as getGroup, r as getLatestGitTags, m as getOriginMainBranch, f as getProject, k as needCommit, l as needPush, q as push } from './chunk-CDG5OOSI.js'; | ||
//# sourceMappingURL=out.js.map | ||
//# sourceMappingURL=gitlab.js.map |
import './chunk-DTAECCOG.js'; | ||
import { a as a$3 } from './chunk-JLEIEA7D.js'; | ||
import { a as a$2, b as b$1, c } from './chunk-V7H3VPG7.js'; | ||
import { a as a$1, b } from './chunk-7LWWDFDC.js'; | ||
import { d, a, f as f$1 } from './chunk-LKBOMJT2.js'; | ||
import './chunk-Y4S4NO5Y.js'; | ||
import './chunk-SS5P7KSG.js'; | ||
import { i, l, f, g } from './chunk-YWGMWURF.js'; | ||
import { u, e as e$1 } from './chunk-BLGFDLHB.js'; | ||
import { a as a$3 } from './chunk-TATW6BVG.js'; | ||
import { b as b$1, c, d as d$1, a as a$2 } from './chunk-4FJXIIIN.js'; | ||
import { a as a$1, b } from './chunk-SASH435A.js'; | ||
import { d, a, f } from './chunk-S6AHJCJ3.js'; | ||
import './chunk-ZZUJ5A3H.js'; | ||
import './chunk-NYEYCAAH.js'; | ||
import { I, n, q, k, l, e, B } from './chunk-CDG5OOSI.js'; | ||
import N from 'fs'; | ||
import S from 'path'; | ||
import { inspect } from 'util'; | ||
import e from '@clamjs/logger'; | ||
import o from '@clamjs/logger'; | ||
import { select, Separator, input } from '@inquirer/prompts'; | ||
async function R(){let{repo:n,gitGroupName:t,gitRepoName:a$1}=u(),i=await d({repo:n});if(i?.id&&!i?.delete_time)e.info(`\u5DF2\u63A5\u5165 O2 \u5E94\u7528\uFF0C\u5E94\u7528 id: ${i.id}`);else {e.info("\u672A\u63A5\u5165 O2 \u5E94\u7528\uFF0C\u6B63\u5728\u81EA\u52A8\u63A5\u5165");let p=await a({group:t,project:a$1,type:"webapp"});e.info(`\u63A5\u5165 O2 \u5E94\u7528\u6210\u529F\uFF0C\u5E94\u7528 id: ${p.app_id}`);}}async function U(){let n=await i();l(),await R(),await a$1({branchType:"exist",description:"\u81EA\u52A8\u521B\u5EFAO2\u53D8\u66F4 - ClamBot newbranch",branch:n});}async function $(){let t=(await b())?.id;t||(e.info("\u5F53\u524D\u5206\u652F\u672A\u5EFA\u7ACB O2 \u53D8\u66F4\uFF0C\u5F00\u59CB\u521B\u5EFA..."),t=(await a$1({branchType:"exist",description:"\u81EA\u52A8\u521B\u5EFAO2\u53D8\u66F4 - ClamBot prepub"})).id);let a=await a$2(),i;if(a)i=a.id;else {e.info("\u5F53\u524D\u5206\u652F\u53D8\u66F4\u672A\u53C2\u4E0E O2 \u8FED\u4EE3\uFF0C\u5F00\u59CB\u8FDB\u8FED\u4EE3...");let{iterations:r}=await f$1({status:2,pn:0,rn:20}),p=r?.iterations?.length?r.iterations:[],s=await select({message:"\u8BF7\u9009\u62E9\u8981\u53C2\u4E0E\u7684\u8FED\u4EE3",choices:[...p.map(o=>({name:`v${o.version} - ${o.name}`,value:String(o.id)})),new Separator,{name:"\u65B0\u5EFA\u8FED\u4EE3",value:"new"},{name:"\u8F93\u5165\u5DF2\u6709\u8FED\u4EE3 id",value:"input"},new Separator]});if(s==="new"){let{id:o}=await b$1({branchType:"exist"});i=o;}else if(s==="input"){let o=await input({message:"\u8BF7\u8F93\u5165\u8FED\u4EE3 id",transformer:c=>c.trim(),validate:c=>c?/^\d+$/u.test(c)?!0:"\u8FED\u4EE3 id \u4E3A 8 \u4F4D\u6570\u5B57\uFF0C\u53EF\u5728 O2 \u8FED\u4EE3\u8BE6\u60C5 url \u4E2D\u83B7\u53D6\u54DF":"\u8FED\u4EE3 id \u4E0D\u80FD\u4E3A\u7A7A"});i=Number(o);}else i=Number(s);if(s!=="new"){let o=await c({iterationId:i,branchIds:[t]});e.info("O2 \u53D8\u66F4\u53C2\u4E0E O2 \u8FED\u4EE3\u6210\u529F, result:",inspect(o,{depth:10,colors:!0}));}}return i}async function k(){let n="";await a$3({onStart:()=>{e.info("\u5F00\u59CB O2 \u8FED\u4EE3\u53D1\u5E03...");},onMessage:t=>{n+=t;},onError:t=>{let a=e$1(t);e.error(a);}},()=>{e.info("O2 \u8FED\u4EE3\u53D1\u5E03\u5B8C\u6210");},t=>{let a=e$1(t);e.error(a),e.info(n);});}async function V(){let n=f(),t=g();if(n||t)throw Error(n?"\u5B58\u5728\u672A commit \u7684\u4EE3\u7801\uFF0C\u8BF7\u5148\u63D0\u4EA4":"\u5B58\u5728\u9886\u5148\u4E8E remote \u7684 commit\uFF0C\u8BF7\u5148\u540C\u6B65");await $(),await k();} | ||
async function j(){let{repo:t,gitGroupName:n,gitRepoName:e}=I(),i=await d({repo:t});if(i?.id&&!i?.delete_time)o.info(`\u5DF2\u63A5\u5165 O2 \u5E94\u7528\uFF0C\u5E94\u7528 id: ${i.id}`);else {o.info("\u672A\u63A5\u5165 O2 \u5E94\u7528\uFF0C\u6B63\u5728\u81EA\u52A8\u63A5\u5165");let s=await a({group:n,project:e,type:"webapp"});o.info(`\u63A5\u5165 O2 \u5E94\u7528\u6210\u529F\uFF0C\u5E94\u7528 id: ${s.app_id}`);}}async function D(){let t=await n();q(),await j(),await a$1({branchType:"exist",description:"\u81EA\u52A8\u521B\u5EFAO2\u53D8\u66F4 - ClamBot newbranch",branch:t});}async function V(){let t=await b();t?.id||(o.info("\u5F53\u524D\u5206\u652F\u672A\u5EFA\u7ACB O2 \u53D8\u66F4\uFF0C\u5F00\u59CB\u521B\u5EFA..."),t=await a$1({branchType:"exist",description:"\u81EA\u52A8\u521B\u5EFAO2\u53D8\u66F4 - ClamBot prepub"}));let n=await b$1(),e,i;if(n?.id)e=n,i=n.id;else {o.info("\u5F53\u524D\u5206\u652F\u53D8\u66F4\u672A\u53C2\u4E0E O2 \u8FED\u4EE3\uFF0C\u5F00\u59CB\u8FDB\u8FED\u4EE3...");let{iterations:a}=await f({status:2,pn:0,rn:20}),s=a?.iterations?.length?a.iterations:[],c$1=await select({message:"\u8BF7\u9009\u62E9\u8981\u53C2\u4E0E\u7684\u8FED\u4EE3",choices:[...s.map(r=>({name:`v${r.version} - ${r.name}`,value:String(r.id)})),new Separator,{name:"\u65B0\u5EFA\u8FED\u4EE3",value:"new"},{name:"\u8F93\u5165\u5DF2\u6709\u8FED\u4EE3 id",value:"input"},new Separator]});if(c$1==="new")e=await c({branchType:"exist"}),i=e.id;else if(c$1==="input"){let r=await input({message:"\u8BF7\u8F93\u5165\u8FED\u4EE3 id",transformer:p=>p.trim(),validate:p=>p?/^\d+$/u.test(p)?!0:"\u8FED\u4EE3 id \u4E3A 8 \u4F4D\u6570\u5B57\uFF0C\u53EF\u5728 O2 \u8FED\u4EE3\u8BE6\u60C5 url \u4E2D\u83B7\u53D6\u54DF":"\u8FED\u4EE3 id \u4E0D\u80FD\u4E3A\u7A7A"});i=Number(r);}else i=Number(c$1),e=s.find(r=>r.id===i);if(c$1!=="new"){let r=await d$1({iterationId:i,branchIds:[t.id]});o.info("O2 \u53D8\u66F4\u53C2\u4E0E O2 \u8FED\u4EE3\u6210\u529F, result:",inspect(r,{depth:10,colors:!0}));}}if(!e){let a=await a$2(i);if(a)e=a;else throw new Error(`\u672A\u67E5\u5230\u5BF9\u5E94\u7684 O2 \u8FED\u4EE3\uFF0C\u83B7\u53D6\u8FED\u4EE3\u7248\u672C\u53F7\u5931\u8D25\uFF0C\u8FED\u4EE3 id: ${i}`)}return {o2ChangeInfo:t,o2IterationInfo:e}}async function J(){let t="";await a$3({onStart:()=>{o.info("\u5F00\u59CB O2 \u8FED\u4EE3\u53D1\u5E03...");},onMessage:n=>{t+=n;},onError:n=>{let e$1=e(n);o.error(e$1);}},()=>{o.info("O2 \u8FED\u4EE3\u53D1\u5E03\u5B8C\u6210");},n=>{let e$1=e(n);o.error(e$1),o.info(t);});}function P(t){let n=B(),{version:e}=n;return e!==t?(n.version=t,N.writeFileSync(S.join(process.cwd(),"package.json"),JSON.stringify(n,null,2)),o.info(`\u5F53\u524D\u5206\u652Fversion: ${e} \u4E0E\u8FED\u4EE3\u4E0D\u4E00\u81F4\uFF0C\u540C\u6B65\u8FED\u4EE3\u7248\u672C\u53F7 ${t} \u5230\u4ED3\u5E93 package.json \u6210\u529F`),!0):!1}async function H(){let t=k(),n=l();if(t||n)throw Error(t?"\u5B58\u5728\u672A commit \u7684\u4EE3\u7801\uFF0C\u8BF7\u5148\u63D0\u4EA4":"\u5B58\u5728\u9886\u5148\u4E8E remote \u7684 commit\uFF0C\u8BF7\u5148\u540C\u6B65");let{o2IterationInfo:e}=await V();P(e.version)&&q("feat: sync iteration version"),await J();} | ||
export { R as initO2AppIfNeed, U as newBranch, V as prepub }; | ||
export { j as initO2AppIfNeed, D as newBranch, H as prepub }; | ||
//# sourceMappingURL=out.js.map | ||
//# sourceMappingURL=iterator.js.map |
@@ -1,6 +0,6 @@ | ||
export { a as createO2App, b as deleteO2App, d as getO2App, e as getO2AppChanges, g as getO2AppIterationVersions, f as getO2AppIterations, c as updateO2App } from '../chunk-LKBOMJT2.js'; | ||
import '../chunk-Y4S4NO5Y.js'; | ||
import '../chunk-SS5P7KSG.js'; | ||
import '../chunk-BLGFDLHB.js'; | ||
export { a as createO2App, b as deleteO2App, d as getO2App, e as getO2AppChanges, g as getO2AppIterationVersions, f as getO2AppIterations, c as updateO2App } from '../chunk-S6AHJCJ3.js'; | ||
import '../chunk-ZZUJ5A3H.js'; | ||
import '../chunk-NYEYCAAH.js'; | ||
import '../chunk-CDG5OOSI.js'; | ||
//# sourceMappingURL=out.js.map | ||
//# sourceMappingURL=application.js.map |
@@ -1,5 +0,5 @@ | ||
export { a as O2_CLIENT_TOKEN, b as getO2Api, c as getO2BucApi, d as getO2User } from '../chunk-Y4S4NO5Y.js'; | ||
import '../chunk-SS5P7KSG.js'; | ||
import '../chunk-BLGFDLHB.js'; | ||
export { a as O2_CLIENT_TOKEN, b as getO2Api, c as getO2BucApi, d as getO2User } from '../chunk-ZZUJ5A3H.js'; | ||
import '../chunk-NYEYCAAH.js'; | ||
import '../chunk-CDG5OOSI.js'; | ||
//# sourceMappingURL=out.js.map | ||
//# sourceMappingURL=base.js.map |
@@ -1,8 +0,7 @@ | ||
export { a as createO2Change, b as getO2Change } from '../chunk-7LWWDFDC.js'; | ||
import '../chunk-LKBOMJT2.js'; | ||
import '../chunk-Y4S4NO5Y.js'; | ||
import '../chunk-SS5P7KSG.js'; | ||
import '../chunk-YWGMWURF.js'; | ||
import '../chunk-BLGFDLHB.js'; | ||
export { a as createO2Change, b as getO2Change } from '../chunk-SASH435A.js'; | ||
import '../chunk-S6AHJCJ3.js'; | ||
import '../chunk-ZZUJ5A3H.js'; | ||
import '../chunk-NYEYCAAH.js'; | ||
import '../chunk-CDG5OOSI.js'; | ||
//# sourceMappingURL=out.js.map | ||
//# sourceMappingURL=change.js.map |
@@ -1,7 +0,6 @@ | ||
export { a as cloudBuild } from '../chunk-JLEIEA7D.js'; | ||
import '../chunk-Y4S4NO5Y.js'; | ||
import '../chunk-SS5P7KSG.js'; | ||
import '../chunk-YWGMWURF.js'; | ||
import '../chunk-BLGFDLHB.js'; | ||
export { a as cloudBuild } from '../chunk-TATW6BVG.js'; | ||
import '../chunk-ZZUJ5A3H.js'; | ||
import '../chunk-NYEYCAAH.js'; | ||
import '../chunk-CDG5OOSI.js'; | ||
//# sourceMappingURL=out.js.map | ||
//# sourceMappingURL=cloudBuild.js.map |
@@ -5,5 +5,5 @@ export { createO2App, deleteO2App, getO2App, getO2AppChanges, getO2AppIterationVersions, getO2AppIterations, updateO2App } from './application.js'; | ||
export { cloudBuild } from './cloudBuild.js'; | ||
export { createO2Iteration, getO2Iteration, o2IterationBindChange } from './iteration.js'; | ||
export { DefApiParamsBody, O2ChangeSchema } from './types.js'; | ||
export { createO2Iteration, getO2Iteration, getO2IterationById, o2IterationBindChange } from './iteration.js'; | ||
export { DefApiParamsBody, O2ChangeSchema, O2IterationSchema } from './types.js'; | ||
import '@ali/edith-sdk'; | ||
import '@ali/def-pub-client'; |
import '../chunk-DTAECCOG.js'; | ||
export { a as cloudBuild } from '../chunk-JLEIEA7D.js'; | ||
export { b as createO2Iteration, a as getO2Iteration, c as o2IterationBindChange } from '../chunk-V7H3VPG7.js'; | ||
export { a as createO2Change, b as getO2Change } from '../chunk-7LWWDFDC.js'; | ||
export { a as createO2App, b as deleteO2App, d as getO2App, e as getO2AppChanges, g as getO2AppIterationVersions, f as getO2AppIterations, c as updateO2App } from '../chunk-LKBOMJT2.js'; | ||
export { b as getO2Api, d as getO2User } from '../chunk-Y4S4NO5Y.js'; | ||
import '../chunk-SS5P7KSG.js'; | ||
import '../chunk-YWGMWURF.js'; | ||
import '../chunk-BLGFDLHB.js'; | ||
export { a as cloudBuild } from '../chunk-TATW6BVG.js'; | ||
export { c as createO2Iteration, b as getO2Iteration, a as getO2IterationById, d as o2IterationBindChange } from '../chunk-4FJXIIIN.js'; | ||
export { a as createO2Change, b as getO2Change } from '../chunk-SASH435A.js'; | ||
export { a as createO2App, b as deleteO2App, d as getO2App, e as getO2AppChanges, g as getO2AppIterationVersions, f as getO2AppIterations, c as updateO2App } from '../chunk-S6AHJCJ3.js'; | ||
export { b as getO2Api, d as getO2User } from '../chunk-ZZUJ5A3H.js'; | ||
import '../chunk-NYEYCAAH.js'; | ||
import '../chunk-CDG5OOSI.js'; | ||
//# sourceMappingURL=out.js.map | ||
//# sourceMappingURL=index.js.map |
import * as _ali_edith_sdk from '@ali/edith-sdk'; | ||
import { O2IterationSchema } from './types.js'; | ||
/** 根据迭代 id 获取迭代基本信息 */ | ||
declare function getO2IterationById(id: number): Promise<O2IterationSchema | undefined>; | ||
/** 根据仓库和分支获取 O2 迭代信息,https://icms.alibaba-inc.com/portal/def-work/docs/t2190764.html */ | ||
@@ -37,2 +39,2 @@ declare function getO2Iteration(params?: { | ||
export { createO2Iteration, getO2Iteration, o2IterationBindChange }; | ||
export { createO2Iteration, getO2Iteration, getO2IterationById, o2IterationBindChange }; |
@@ -1,8 +0,7 @@ | ||
export { b as createO2Iteration, a as getO2Iteration, c as o2IterationBindChange } from '../chunk-V7H3VPG7.js'; | ||
import '../chunk-LKBOMJT2.js'; | ||
import '../chunk-Y4S4NO5Y.js'; | ||
import '../chunk-SS5P7KSG.js'; | ||
import '../chunk-YWGMWURF.js'; | ||
import '../chunk-BLGFDLHB.js'; | ||
export { c as createO2Iteration, b as getO2Iteration, a as getO2IterationById, d as o2IterationBindChange } from '../chunk-4FJXIIIN.js'; | ||
import '../chunk-S6AHJCJ3.js'; | ||
import '../chunk-ZZUJ5A3H.js'; | ||
import '../chunk-NYEYCAAH.js'; | ||
import '../chunk-CDG5OOSI.js'; | ||
//# sourceMappingURL=out.js.map | ||
//# sourceMappingURL=iteration.js.map |
@@ -1,3 +0,3 @@ | ||
export { c as exists, a as getJson, e as getUnknowErrorMsg, d as isGitRepo, b as runShell } from './chunk-BLGFDLHB.js'; | ||
export { c as exists, a as getJson, e as getUnknowErrorMsg, d as isGitRepo, b as runShell } from './chunk-CDG5OOSI.js'; | ||
//# sourceMappingURL=out.js.map | ||
//# sourceMappingURL=tools.js.map |
{ | ||
"name": "@clamjs/utils", | ||
"version": "0.1.0-alpha.0", | ||
"version": "0.1.0-alpha.1", | ||
"description": "Internal tool library utilized by clamjs", | ||
@@ -81,3 +81,3 @@ "bugs": { | ||
"shelljs": "^0.8.5", | ||
"@clamjs/logger": "0.1.0-alpha.0" | ||
"@clamjs/logger": "0.1.0-alpha.1" | ||
}, | ||
@@ -84,0 +84,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
141632
0
82
909
3
+ Added@clamjs/logger@0.1.0-alpha.1(transitive)
- Removed@clamjs/logger@0.1.0-alpha.0(transitive)
Updated@clamjs/logger@0.1.0-alpha.1