@seed-design/codemod 0.0.13 → 0.0.15
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/bin/index.mjs +7 -7
- package/bin/transforms/{replace-vars-color → replace-color-design-token}/index.mjs +11 -10
- package/bin/transforms/replace-color-prop/index.mjs +9 -8
- package/bin/transforms/replace-css-color-variable/index.mjs +50 -0
- package/bin/transforms/replace-css-typography-variable/index.mjs +50 -0
- package/bin/transforms/replace-tailwind-color/index.mjs +11 -10
- package/bin/transforms/replace-tailwind-typography/index.mjs +17 -0
- package/bin/transforms/replace-text-component/index.mjs +17 -0
- package/bin/transforms/replace-typography-design-token/index.mjs +17 -0
- package/package.json +5 -3
package/bin/index.mjs
CHANGED
@@ -56,18 +56,18 @@ Instead, \`yield\` should either be called with a value, or not be called at all
|
|
56
56
|
`){return e.split(r).reduce((n,s)=>{let o=t?s.trim():s;return o&&n.push(o),n},[])}function Ha(e,t){return un(e,!0).map(r=>t(r))}function Ya(e){return(0,oo.exists)(e,oo.FOLDER)}function F(e,t){return Array.isArray(e)?e.includes(t)||e.push(t):e.add(t),t}function jg(e,t){return Array.isArray(e)&&!e.includes(t)&&e.push(t),e}function io(e,t){if(Array.isArray(e)){let r=e.indexOf(t);r>=0&&e.splice(r,1)}else e.delete(t);return t}function Ze(e){return Array.isArray(e)?e:[e]}function Bg(e){return e.replace(/[\s-]+(.)/g,(t,r)=>r.toUpperCase())}function Ug(e){return Ze(e).map(String)}function B(e,t=0){if(e==null)return t;let r=parseInt(e,10);return isNaN(r)?t:r}function nn(e,t){let r=[];for(let n=0,s=e.length;n<s;n++)r.push(t,e[n]);return r}function sn(e){return(Array.isArray(e)?Buffer.concat(e):e).toString("utf-8")}function Gg(e,t){return Object.assign({},...t.map(r=>r in e?{[r]:e[r]}:{}))}function La(e=0){return new Promise(t=>setTimeout(t,e))}function Na(e){if(e!==!1)return e}var vr,zt,ln,ao=g({"src/lib/utils/util.ts"(){"use strict";vr="\0",zt=()=>{},ln=Object.prototype.toString.call.bind(Object.prototype.toString)}});function He(e,t,r){return t(e)?e:arguments.length>2?r:void 0}function Xa(e,t){let r=Qs(e)?"string":typeof e;return/number|string|boolean/.test(r)&&(!t||!t.includes(r))}function Ka(e){return!!e&&ln(e)==="[object Object]"}function qg(e){return typeof e=="function"}var fn,te,Vg,eo,Ja,zg=g({"src/lib/utils/argument-filters.ts"(){"use strict";ao(),an(),fn=e=>Array.isArray(e),te=e=>typeof e=="string",Vg=e=>Array.isArray(e)&&e.every(te),eo=e=>te(e)||Array.isArray(e)&&e.every(te),Ja=e=>e==null||"number|boolean|function".includes(typeof e)?!1:Array.isArray(e)||typeof e=="string"||typeof e.length=="number"}}),Pa,PA=g({"src/lib/utils/exit-codes.ts"(){"use strict";Pa=(e=>(e[e.SUCCESS=0]="SUCCESS",e[e.ERROR=1]="ERROR",e[e.NOT_FOUND=-2]="NOT_FOUND",e[e.UNCLEAN=128]="UNCLEAN",e))(Pa||{})}}),on,MA=g({"src/lib/utils/git-output-streams.ts"(){"use strict";on=class{constructor(e,t){this.stdOut=e,this.stdErr=t}asStrings(){return new on(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}}),I,pt,FA=g({"src/lib/utils/line-parser.ts"(){"use strict";I=class{constructor(e,t){this.matches=[],this.parse=(r,n)=>(this.resetMatches(),this._regExp.every((s,o)=>this.addMatch(s,o,r(o)))?this.useMatches(n,this.prepareMatches())!==!1:!1),this._regExp=Array.isArray(e)?e:[e],t&&(this.useMatches=t)}useMatches(e,t){throw new Error("LineParser:useMatches not implemented")}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(e,t,r){let n=r&&e.exec(r);return n&&this.pushMatch(t,n),!!n}pushMatch(e,t){this.matches.push(...t.slice(1))}},pt=class extends I{addMatch(e,t,r){return/^remote:\s/.test(String(r))&&super.addMatch(e,t,r)}pushMatch(e,t){(e>0||t.length>1)&&super.pushMatch(e,t)}}}});function Wg(...e){let t=process.cwd(),r=Object.assign(Ce({baseDir:t},Zg),...e.filter(n=>typeof n=="object"&&n));return r.baseDir=r.baseDir||t,r.trimmed=r.trimmed===!0,r}var Zg,jA=g({"src/lib/utils/simple-git-options.ts"(){"use strict";Zg={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function Qa(e,t=[]){return Ka(e)?Object.keys(e).reduce((r,n)=>{let s=e[n];return Qs(s)?r.push(s):Xa(s,["boolean"])?r.push(n+"="+s):r.push(n),r},t):t}function le(e,t=0,r=!1){let n=[];for(let s=0,o=t<0?e.length:t;s<o;s++)"string|number".includes(typeof e[s])&&n.push(String(e[s]));return Qa(ec(e),n),r||n.push(...BA(e)),n}function BA(e){let t=typeof Vt(e)=="function";return He(Vt(e,t?1:0),fn,[])}function ec(e){let t=qg(Vt(e));return He(Vt(e,t?1:0),Ka)}function V(e,t=!0){let r=Lg(Vt(e));return t||Ng(r)?r:void 0}var UA=g({"src/lib/utils/task-options.ts"(){"use strict";zg(),ao(),an()}});function Ma(e,t){return e(t.stdOut,t.stdErr)}function de(e,t,r,n=!0){return Ze(r).forEach(s=>{for(let o=un(s,n),i=0,a=o.length;i<a;i++){let c=(u=0)=>{if(!(i+u>=a))return o[i+u]};t.some(({parse:u})=>u(c,e))}}),e}var GA=g({"src/lib/utils/task-parser.ts"(){"use strict";ao()}}),Hg={};Z(Hg,{ExitCodes:()=>Pa,GitOutputStreams:()=>on,LineParser:()=>I,NOOP:()=>zt,NULL:()=>vr,RemoteLineParser:()=>pt,append:()=>F,appendTaskOptions:()=>Qa,asArray:()=>Ze,asCamelCase:()=>Bg,asFunction:()=>Lg,asNumber:()=>B,asStringArray:()=>Ug,bufferToString:()=>sn,callTaskParser:()=>Ma,createInstanceConfig:()=>Wg,delay:()=>La,filterArray:()=>fn,filterFunction:()=>qg,filterHasLength:()=>Ja,filterPlainObject:()=>Ka,filterPrimitives:()=>Xa,filterString:()=>te,filterStringArray:()=>Vg,filterStringOrStringArray:()=>eo,filterType:()=>He,first:()=>Mg,folderExists:()=>Ya,forEachLineWithContent:()=>Ha,getTrailingOptions:()=>le,including:()=>jg,isUserFunction:()=>Ng,last:()=>Vt,objectToString:()=>ln,orVoid:()=>Na,parseStringResponse:()=>de,pick:()=>Gg,prefixedArray:()=>nn,remove:()=>io,splitOn:()=>Pg,toLinesWithContent:()=>un,trailingFunctionArgument:()=>V,trailingOptionsArgument:()=>ec});var C=g({"src/lib/utils/index.ts"(){"use strict";zg(),PA(),MA(),FA(),jA(),UA(),GA(),ao()}}),Yg={};Z(Yg,{CheckRepoActions:()=>Fa,checkIsBareRepoTask:()=>Kg,checkIsRepoRootTask:()=>Xg,checkIsRepoTask:()=>qA});function qA(e){switch(e){case"bare":return Kg();case"root":return Xg()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:co,parser:tc}}function Xg(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:co,parser(t){return/^\.(git)?$/.test(t.trim())}}}function Kg(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:co,parser:tc}}function VA(e){return/(Not a git repository|Kein Git-Repository)/i.test(String(e))}var Fa,co,tc,Jg=g({"src/lib/tasks/check-is-repo.ts"(){"use strict";C(),Fa=(e=>(e.BARE="bare",e.IN_TREE="tree",e.IS_REPO_ROOT="root",e))(Fa||{}),co=({exitCode:e},t,r,n)=>{if(e===128&&VA(t))return r(Buffer.from("false"));n(t)},tc=e=>e.trim()==="true"}});function zA(e,t){let r=new Qg(e),n=e?ty:ey;return un(t).forEach(s=>{let o=s.replace(n,"");r.paths.push(o),(ry.test(o)?r.folders:r.files).push(o)}),r}var Qg,ey,ty,ry,WA=g({"src/lib/responses/CleanSummary.ts"(){"use strict";C(),Qg=class{constructor(e){this.dryRun=e,this.paths=[],this.files=[],this.folders=[]}},ey=/^[a-z]+\s*/i,ty=/^[a-z]+\s+[a-z]+\s*/i,ry=/\/$/}}),ja={};Z(ja,{EMPTY_COMMANDS:()=>uo,adhocExecTask:()=>ny,configurationErrorTask:()=>fe,isBufferTask:()=>oy,isEmptyTask:()=>iy,straightThroughBufferTask:()=>sy,straightThroughStringTask:()=>ie});function ny(e){return{commands:uo,format:"empty",parser:e}}function fe(e){return{commands:uo,format:"empty",parser(){throw typeof e=="string"?new $g(e):e}}}function ie(e,t=!1){return{commands:e,format:"utf-8",parser(r){return t?String(r).trim():r}}}function sy(e){return{commands:e,format:"buffer",parser(t){return t}}}function oy(e){return e.format==="buffer"}function iy(e){return e.format==="empty"||!e.commands.length}var uo,W=g({"src/lib/tasks/task.ts"(){"use strict";Dg(),uo=[]}}),ay={};Z(ay,{CONFIG_ERROR_INTERACTIVE_MODE:()=>rc,CONFIG_ERROR_MODE_REQUIRED:()=>nc,CONFIG_ERROR_UNKNOWN_OPTION:()=>sc,CleanOptions:()=>Ys,cleanTask:()=>cy,cleanWithOptionsTask:()=>ZA,isCleanOptionsArray:()=>HA});function ZA(e,t){let{cleanMode:r,options:n,valid:s}=YA(e);return r?s.options?(n.push(...t),n.some(JA)?fe(rc):cy(r,n)):fe(sc+JSON.stringify(e)):fe(nc)}function cy(e,t){return{commands:["clean",`-${e}`,...t],format:"utf-8",parser(n){return zA(e==="n",n)}}}function HA(e){return Array.isArray(e)&&e.every(t=>oc.has(t))}function YA(e){let t,r=[],n={cleanMode:!1,options:!0};return e.replace(/[^a-z]i/g,"").split("").forEach(s=>{XA(s)?(t=s,n.cleanMode=!0):n.options=n.options&&KA(r[r.length]=`-${s}`)}),{cleanMode:t,options:r,valid:n}}function XA(e){return e==="f"||e==="n"}function KA(e){return/^-[a-z]$/i.test(e)&&oc.has(e.charAt(1))}function JA(e){return/^-[^\-]/.test(e)?e.indexOf("i")>0:e==="--interactive"}var rc,nc,sc,Ys,oc,uy=g({"src/lib/tasks/clean.ts"(){"use strict";WA(),C(),W(),rc="Git clean interactive mode is not supported",nc='Git clean mode parameter ("n" or "f") is required',sc="Git clean unknown option found in: ",Ys=(e=>(e.DRY_RUN="n",e.FORCE="f",e.IGNORED_INCLUDED="x",e.IGNORED_ONLY="X",e.EXCLUDING="e",e.QUIET="q",e.RECURSIVE="d",e))(Ys||{}),oc=new Set(["i",...Ug(Object.values(Ys))])}});function QA(e){let t=new fy;for(let r of ly(e))t.addValue(r.file,String(r.key),r.value);return t}function eI(e,t){let r=null,n=[],s=new Map;for(let o of ly(e,t))o.key===t&&(n.push(r=o.value),s.has(o.file)||s.set(o.file,[]),s.get(o.file).push(r));return{key:t,paths:Array.from(s.keys()),scopes:s,value:r,values:n}}function tI(e){return e.replace(/^(file):/,"")}function*ly(e,t=null){let r=e.split("\0");for(let n=0,s=r.length-1;n<s;){let o=tI(r[n++]),i=r[n++],a=t;if(i.includes(`
|
57
57
|
`)){let c=Pg(i,`
|
58
58
|
`);a=c[0],i=c[1]}yield{file:o,key:a,value:i}}}var fy,rI=g({"src/lib/responses/ConfigList.ts"(){"use strict";C(),fy=class{constructor(){this.files=[],this.values=Object.create(null)}get all(){return this._all||(this._all=this.files.reduce((e,t)=>Object.assign(e,this.values[t]),{})),this._all}addFile(e){if(!(e in this.values)){let t=Vt(this.files);this.values[e]=t?Object.create(this.values[t]):{},this.files.push(e)}return this.values[e]}addValue(e,t,r){let n=this.addFile(e);n.hasOwnProperty(t)?Array.isArray(n[t])?n[t].push(r):n[t]=[n[t],r]:n[t]=r,this._all=void 0}}}});function ka(e,t){return typeof e=="string"&&Ba.hasOwnProperty(e)?e:t}function nI(e,t,r,n){let s=["config",`--${n}`];return r&&s.push("--add"),s.push(e,t),{commands:s,format:"utf-8",parser(o){return o}}}function sI(e,t){let r=["config","--null","--show-origin","--get-all",e];return t&&r.splice(1,0,`--${t}`),{commands:r,format:"utf-8",parser(n){return eI(n,e)}}}function oI(e){let t=["config","--list","--show-origin","--null"];return e&&t.push(`--${e}`),{commands:t,format:"utf-8",parser(r){return QA(r)}}}function iI(){return{addConfig(e,t,...r){return this._runTask(nI(e,t,r[0]===!0,ka(r[1],"local")),V(arguments))},getConfig(e,t){return this._runTask(sI(e,ka(t,void 0)),V(arguments))},listConfig(...e){return this._runTask(oI(ka(e[0],void 0)),V(arguments))}}}var Ba,dy=g({"src/lib/tasks/config.ts"(){"use strict";rI(),C(),Ba=(e=>(e.system="system",e.global="global",e.local="local",e.worktree="worktree",e))(Ba||{})}});function aI(e){return py.has(e)}var Ca,py,my=g({"src/lib/tasks/diff-name-status.ts"(){"use strict";Ca=(e=>(e.ADDED="A",e.COPIED="C",e.DELETED="D",e.MODIFIED="M",e.RENAMED="R",e.CHANGED="T",e.UNMERGED="U",e.UNKNOWN="X",e.BROKEN="B",e))(Ca||{}),py=new Set(Object.values(Ca))}});function cI(...e){return new gy().param(...e)}function uI(e){let t=new Set,r={};return Ha(e,n=>{let[s,o,i]=n.split(vr);t.add(s),(r[s]=r[s]||[]).push({line:B(o),path:s,preview:i})}),{paths:t,results:r}}function lI(){return{grep(e){let t=V(arguments),r=le(arguments);for(let s of hy)if(r.includes(s))return this._runTask(fe(`git.grep: use of "${s}" is not supported.`),t);typeof e=="string"&&(e=cI().param(e));let n=["grep","--null","-n","--full-name",...r,...e];return this._runTask({commands:n,format:"utf-8",parser(s){return uI(s)}},t)}}}var hy,en,tg,gy,yy=g({"src/lib/tasks/grep.ts"(){"use strict";C(),W(),hy=["-h"],en=Symbol("grepQuery"),gy=class{constructor(){this[tg]=[]}*[(tg=en,Symbol.iterator)](){for(let e of this[en])yield e}and(...e){return e.length&&this[en].push("--and","(",...nn(e,"-e"),")"),this}param(...e){return this[en].push(...nn(e,"-e")),this}}}}),by={};Z(by,{ResetMode:()=>Xs,getResetMode:()=>dI,resetTask:()=>fI});function fI(e,t){let r=["reset"];return wy(e)&&r.push(`--${e}`),r.push(...t),ie(r)}function dI(e){if(wy(e))return e;switch(typeof e){case"string":case"undefined":return"soft"}}function wy(e){return Sy.includes(e)}var Xs,Sy,xy=g({"src/lib/tasks/reset.ts"(){"use strict";W(),Xs=(e=>(e.MIXED="mixed",e.SOFT="soft",e.HARD="hard",e.MERGE="merge",e.KEEP="keep",e))(Xs||{}),Sy=Array.from(Object.values(Xs))}});function pI(){return(0,to.default)("simple-git")}function rg(e,t,r){return!t||!String(t).replace(/\s*/,"")?r?(n,...s)=>{e(n,...s),r(n,...s)}:e:(n,...s)=>{e(`%s ${n}`,t,...s),r&&r(n,...s)}}function mI(e,t,{namespace:r}){if(typeof e=="string")return e;let n=t&&t.namespace||"";return n.startsWith(r)?n.substr(r.length+1):n||r}function ic(e,t,r,n=pI()){let s=e&&`[${e}]`||"",o=[],i=typeof t=="string"?n.extend(t):t,a=mI(He(t,te),i,n);return u(r);function c(l,f){return F(o,ic(e,a.replace(/^[^:]+/,l),f,n))}function u(l){let f=l&&`[${l}]`||"",p=i&&rg(i,f)||zt,d=rg(n,`${s} ${f}`,p);return Object.assign(i?p:d,{label:e,sibling:c,info:d,step:u})}}var vy=g({"src/lib/git-logger.ts"(){"use strict";C(),to.default.formatters.L=e=>String(Ja(e)?e.length:"-"),to.default.formatters.B=e=>Buffer.isBuffer(e)?e.toString("utf8"):ln(e)}}),Zs,Ua,hI=g({"src/lib/runners/tasks-pending-queue.ts"(){"use strict";mt(),vy(),Zs=class{constructor(e="GitExecutor"){this.logLabel=e,this._queue=new Map}withProgress(e){return this._queue.get(e)}createProgress(e){let t=Zs.getName(e.commands[0]),r=ic(this.logLabel,t);return{task:e,logger:r,name:t}}push(e){let t=this.createProgress(e);return t.logger("Adding task to the queue, commands = %o",e.commands),this._queue.set(e,t),t}fatal(e){for(let[t,{logger:r}]of Array.from(this._queue.entries()))t===e.task?(r.info("Failed %o",e),r("Fatal exception, any as-yet un-started tasks run through this executor will not be attempted")):r.info("A fatal exception occurred in a previous task, the queue has been purged: %o",e.message),this.complete(t);if(this._queue.size!==0)throw new Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(e){this.withProgress(e)&&this._queue.delete(e)}attempt(e){let t=this.withProgress(e);if(!t)throw new ot(void 0,"TasksPendingQueue: attempt called for an unknown task");return t.logger("Starting task"),t}static getName(e="empty"){return`task:${e}:${++Zs.counter}`}},Ua=Zs,Ua.counter=0}});function qt(e,t){return{method:Mg(e.commands)||"",commands:t}}function yI(e,t){return r=>{t("[ERROR] child process exception %o",r),e.push(Buffer.from(String(r.stack),"ascii"))}}function ng(e,t,r,n){return s=>{r("%s received %L bytes",t,s),n("%B",s),e.push(s)}}var Ga,bI=g({"src/lib/runners/git-executor-chain.ts"(){"use strict";mt(),W(),C(),hI(),Ga=class{constructor(e,t,r){this._executor=e,this._scheduler=t,this._plugins=r,this._chain=Promise.resolve(),this._queue=new Ua}get cwd(){return this._cwd||this._executor.cwd}set cwd(e){this._cwd=e}get env(){return this._executor.env}get outputHandler(){return this._executor.outputHandler}chain(){return this}push(e){return this._queue.push(e),this._chain=this._chain.then(()=>this.attemptTask(e))}attemptTask(e){return tn(this,null,function*(){let t=yield this._scheduler.next(),r=()=>this._queue.complete(e);try{let{logger:n}=this._queue.attempt(e);return yield iy(e)?this.attemptEmptyTask(e,n):this.attemptRemoteTask(e,n)}catch(n){throw this.onFatalException(e,n)}finally{r(),t()}})}onFatalException(e,t){let r=t instanceof ot?Object.assign(t,{task:e}):new ot(e,t&&String(t));return this._chain=Promise.resolve(),this._queue.fatal(r),r}attemptRemoteTask(e,t){return tn(this,null,function*(){let r=this._plugins.exec("spawn.binary","",qt(e,e.commands)),n=this._plugins.exec("spawn.args",[...e.commands],qt(e,e.commands)),s=yield this.gitResponse(e,r,n,this.outputHandler,t.step("SPAWN")),o=yield this.handleTaskData(e,n,s,t.step("HANDLE"));return t("passing response to task's parser as a %s",e.format),oy(e)?Ma(e.parser,o):Ma(e.parser,o.asStrings())})}attemptEmptyTask(e,t){return tn(this,null,function*(){return t("empty task bypassing child process to call to task's parser"),e.parser(this)})}handleTaskData(e,t,r,n){let{exitCode:s,rejection:o,stdOut:i,stdErr:a}=r;return new Promise((c,u)=>{n("Preparing to handle process response exitCode=%d stdOut=",s);let{error:l}=this._plugins.exec("task.error",{error:o},Ce(Ce({},qt(e,t)),r));if(l&&e.onError)return n.info("exitCode=%s handling with custom error handler"),e.onError(r,l,f=>{n.info("custom error handler treated as success"),n("custom error returned a %s",ln(f)),c(new on(Array.isArray(f)?Buffer.concat(f):f,Buffer.concat(a)))},u);if(l)return n.info("handling as error: exitCode=%s stdErr=%s rejection=%o",s,a.length,o),u(l);n.info("retrieving task output complete"),c(new on(Buffer.concat(i),Buffer.concat(a)))})}gitResponse(e,t,r,n,s){return tn(this,null,function*(){let o=s.sibling("output"),i=this._plugins.exec("spawn.options",{cwd:this.cwd,env:this.env,windowsHide:!0},qt(e,e.commands));return new Promise(a=>{let c=[],u=[];s.info("%s %o",t,r),s("%O",i);let l=this._beforeSpawn(e,r);if(l)return a({stdOut:c,stdErr:u,exitCode:9901,rejection:l});this._plugins.exec("spawn.before",void 0,rn(Ce({},qt(e,r)),{kill(p){l=p||l}}));let f=gI(t,r,i);f.stdout.on("data",ng(c,"stdOut",s,o.step("stdOut"))),f.stderr.on("data",ng(u,"stdErr",s,o.step("stdErr"))),f.on("error",yI(u,s)),n&&(s("Passing child process stdOut/stdErr to custom outputHandler"),n(t,f.stdout,f.stderr,[...r])),this._plugins.exec("spawn.after",void 0,rn(Ce({},qt(e,r)),{spawned:f,close(p,d){a({stdOut:c,stdErr:u,exitCode:p,rejection:l||d})},kill(p){f.killed||(l=p,f.kill("SIGINT"))}}))})})}_beforeSpawn(e,t){let r;return this._plugins.exec("spawn.before",void 0,rn(Ce({},qt(e,t)),{kill(n){r=n||r}})),r}}}}),_y={};Z(_y,{GitExecutor:()=>Ey});var Ey,wI=g({"src/lib/runners/git-executor.ts"(){"use strict";bI(),Ey=class{constructor(e,t,r){this.cwd=e,this._scheduler=t,this._plugins=r,this._chain=new Ga(this,this._scheduler,this._plugins)}chain(){return new Ga(this,this._scheduler,this._plugins)}push(e){return this._chain.push(e)}}}});function SI(e,t,r=zt){let n=o=>{r(null,o)},s=o=>{o?.task===e&&r(o instanceof cn?xI(o):o,void 0)};t.then(n,s)}function xI(e){let t=n=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${n} should be GitResponseError.git.${n}, this will no longer be available in version 3`),t=zt};return Object.create(e,Object.getOwnPropertyNames(e.git).reduce(r,{}));function r(n,s){return s in e||(n[s]={enumerable:!1,configurable:!1,get(){return t(s),e.git[s]}}),n}}var vI=g({"src/lib/task-callback.ts"(){"use strict";_r(),C()}});function sg(e,t){return ny(r=>{if(!Ya(e))throw new Error(`Git.cwd: cannot change to non-directory "${e}"`);return(t||r).cwd=e})}var _I=g({"src/lib/tasks/change-working-directory.ts"(){"use strict";C(),W()}});function Aa(e){let t=["checkout",...e];return t[1]==="-b"&&t.includes("-B")&&(t[1]=io(t,"-B")),ie(t)}function EI(){return{checkout(){return this._runTask(Aa(le(arguments,1)),V(arguments))},checkoutBranch(e,t){return this._runTask(Aa(["-b",e,t,...le(arguments)]),V(arguments))},checkoutLocalBranch(e){return this._runTask(Aa(["-b",e,...le(arguments)]),V(arguments))}}}var TI=g({"src/lib/tasks/checkout.ts"(){"use strict";C(),W()}});function OI(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}function RI(){return{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser(e){return de(OI(),[Ty],e)}})}}}var Ty,kI=g({"src/lib/tasks/count-objects.ts"(){"use strict";C(),Ty=new I(/([a-z-]+): (\d+)$/,(e,[t,r])=>{let n=Bg(t);e.hasOwnProperty(n)&&(e[n]=B(r))})}});function CI(e){return de({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},Oy,e)}var Oy,AI=g({"src/lib/parsers/parse-commit.ts"(){"use strict";C(),Oy=[new I(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(e,[t,r,n])=>{e.branch=t,e.commit=n,e.root=!!r}),new I(/\s*Author:\s(.+)/i,(e,[t])=>{let r=t.split("<"),n=r.pop();!n||!n.includes("@")||(e.author={email:n.substr(0,n.length-1),name:r.join("<").trim()})}),new I(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,(e,[t,r,n])=>{e.summary.changes=parseInt(t,10)||0,e.summary.insertions=parseInt(r,10)||0,e.summary.deletions=parseInt(n,10)||0}),new I(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,(e,[t,r,n])=>{e.summary.changes=parseInt(t,10)||0;let s=parseInt(r,10)||0;n==="-"?e.summary.deletions=s:n==="+"&&(e.summary.insertions=s)})]}});function II(e,t,r){return{commands:["-c","core.abbrev=40","commit",...nn(e,"-m"),...t,...r],format:"utf-8",parser:CI}}function $I(){return{commit(t,...r){let n=V(arguments),s=e(t)||II(Ze(t),Ze(He(r[0],eo,[])),[...He(r[1],fn,[]),...le(arguments,0,!0)]);return this._runTask(s,n)}};function e(t){return!eo(t)&&fe("git.commit: requires the commit message to be supplied as a string/string[]")}}var DI=g({"src/lib/tasks/commit.ts"(){"use strict";AI(),C(),W()}});function LI(){return{firstCommit(){return this._runTask(ie(["rev-list","--max-parents=0","HEAD"],!0),V(arguments))}}}var NI=g({"src/lib/tasks/first-commit.ts"(){"use strict";C(),W()}});function PI(e,t){let r=["hash-object",e];return t&&r.push("-w"),ie(r,!0)}var MI=g({"src/lib/tasks/hash-object.ts"(){"use strict";W()}});function FI(e,t,r){let n=String(r).trim(),s;if(s=Ry.exec(n))return new Ks(e,t,!1,s[1]);if(s=ky.exec(n))return new Ks(e,t,!0,s[1]);let o="",i=n.split(" ");for(;i.length;)if(i.shift()==="in"){o=i.join(" ");break}return new Ks(e,t,/^re/i.test(n),o)}var Ks,Ry,ky,jI=g({"src/lib/responses/InitSummary.ts"(){"use strict";Ks=class{constructor(e,t,r,n){this.bare=e,this.path=t,this.existing=r,this.gitDir=n}},Ry=/^Init.+ repository in (.+)$/,ky=/^Rein.+ in (.+)$/}});function BI(e){return e.includes(ac)}function UI(e=!1,t,r){let n=["init",...r];return e&&!BI(n)&&n.splice(1,0,ac),{commands:n,format:"utf-8",parser(s){return FI(n.includes("--bare"),t,s)}}}var ac,GI=g({"src/lib/tasks/init.ts"(){"use strict";jI(),ac="--bare"}});function cc(e){for(let t=0;t<e.length;t++){let r=uc.exec(e[t]);if(r)return`--${r[1]}`}return""}function qI(e){return uc.test(e)}var uc,dn=g({"src/lib/args/log-format.ts"(){"use strict";uc=/^--(stat|numstat|name-only|name-status)(=|$)/}}),Cy,VI=g({"src/lib/responses/DiffSummary.ts"(){"use strict";Cy=class{constructor(){this.changed=0,this.deletions=0,this.insertions=0,this.files=[]}}}});function Ay(e=""){let t=Iy[e];return r=>de(new Cy,t,r,!1)}var Ia,og,ig,ag,Iy,$y=g({"src/lib/parsers/parse-diff-summary.ts"(){"use strict";dn(),VI(),my(),C(),Ia=[new I(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(e,[t,r,n=""])=>{e.files.push({file:t.trim(),changes:B(r),insertions:n.replace(/[^+]/g,"").length,deletions:n.replace(/[^-]/g,"").length,binary:!1})}),new I(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(e,[t,r,n])=>{e.files.push({file:t.trim(),before:B(r),after:B(n),binary:!0})}),new I(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(e,[t,r])=>{let n=/(\d+) i/.exec(r),s=/(\d+) d/.exec(r);e.changed=B(t),e.insertions=B(n?.[1]),e.deletions=B(s?.[1])})],og=[new I(/(\d+)\t(\d+)\t(.+)$/,(e,[t,r,n])=>{let s=B(t),o=B(r);e.changed++,e.insertions+=s,e.deletions+=o,e.files.push({file:n,changes:s+o,insertions:s,deletions:o,binary:!1})}),new I(/-\t-\t(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,after:0,before:0,binary:!0})})],ig=[new I(/(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,changes:0,insertions:0,deletions:0,binary:!1})})],ag=[new I(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,(e,[t,r,n,s,o])=>{e.changed++,e.files.push({file:o??n,changes:0,insertions:0,deletions:0,binary:!1,status:Na(aI(t)&&t),from:Na(!!o&&n!==o&&n),similarity:B(r)})})],Iy={"":Ia,"--stat":Ia,"--numstat":og,"--name-status":ag,"--name-only":ig}}});function zI(e,t){return t.reduce((r,n,s)=>(r[n]=e[s]||"",r),Object.create({diff:null}))}function Dy(e=dc,t=Ly,r=""){let n=Ay(r);return function(s){let o=un(s.trim(),!1,lc).map(function(i){let a=i.split(fc),c=zI(a[0].split(e),t);return a.length>1&&a[1].trim()&&(c.diff=n(a[1])),c});return{all:o,latest:o.length&&o[0]||null,total:o.length}}}var lc,fc,dc,Ly,Ny=g({"src/lib/parsers/parse-list-log-summary.ts"(){"use strict";C(),$y(),dn(),lc="\xF2\xF2\xF2\xF2\xF2\xF2 ",fc=" \xF2\xF2",dc=" \xF2 ",Ly=["hash","date","message","refs","author_name","author_email"]}}),Py={};Z(Py,{diffSummaryTask:()=>WI,validateLogFormatConfig:()=>lo});function WI(e){let t=cc(e),r=["diff"];return t===""&&(t="--stat",r.push("--stat=4096")),r.push(...e),lo(r)||{commands:r,format:"utf-8",parser:Ay(t)}}function lo(e){let t=e.filter(qI);if(t.length>1)return fe(`Summary flags are mutually exclusive - pick one of ${t.join(",")}`);if(t.length&&e.includes("-z"))return fe(`Summary flag ${t} parsing is not compatible with null termination option '-z'`)}var pc=g({"src/lib/tasks/diff.ts"(){"use strict";dn(),$y(),W()}});function ZI(e,t){let r=[],n=[];return Object.keys(e).forEach(s=>{r.push(s),n.push(String(e[s]))}),[r,n.join(t)]}function HI(e){return Object.keys(e).reduce((t,r)=>(r in qa||(t[r]=e[r]),t),{})}function My(e={},t=[]){let r=He(e.splitter,te,dc),n=!Xa(e.format)&&e.format?e.format:{hash:"%H",date:e.strictDate===!1?"%ai":"%aI",message:"%s",refs:"%D",body:e.multiLine?"%B":"%b",author_name:e.mailMap!==!1?"%aN":"%an",author_email:e.mailMap!==!1?"%aE":"%ae"},[s,o]=ZI(n,r),i=[],a=[`--pretty=format:${lc}${o}${fc}`,...t],c=e.n||e["max-count"]||e.maxCount;if(c&&a.push(`--max-count=${c}`),e.from||e.to){let u=e.symmetric!==!1?"...":"..";i.push(`${e.from||""}${u}${e.to||""}`)}return te(e.file)&&a.push("--follow",NA(e.file)),Qa(HI(e),a),{fields:s,splitter:r,commands:[...a,...i]}}function YI(e,t,r){let n=Dy(e,t,cc(r));return{commands:["log",...r],format:"utf-8",parser:n}}function XI(){return{log(...r){let n=V(arguments),s=My(ec(arguments),He(arguments[0],fn)),o=t(...r)||lo(s.commands)||e(s);return this._runTask(o,n)}};function e(r){return YI(r.splitter,r.fields,r.commands)}function t(r,n){return te(r)&&te(n)&&fe("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}}var qa,Fy=g({"src/lib/tasks/log.ts"(){"use strict";dn(),an(),Ny(),C(),W(),pc(),qa=(e=>(e[e["--pretty"]=0]="--pretty",e[e["max-count"]=1]="max-count",e[e.maxCount=2]="maxCount",e[e.n=3]="n",e[e.file=4]="file",e[e.format=5]="format",e[e.from=6]="from",e[e.to=7]="to",e[e.splitter=8]="splitter",e[e.symmetric=9]="symmetric",e[e.mailMap=10]="mailMap",e[e.multiLine=11]="multiLine",e[e.strictDate=12]="strictDate",e))(qa||{})}}),Js,jy,KI=g({"src/lib/responses/MergeSummary.ts"(){"use strict";Js=class{constructor(e,t=null,r){this.reason=e,this.file=t,this.meta=r}toString(){return`${this.file}:${this.reason}`}},jy=class{constructor(){this.conflicts=[],this.merges=[],this.result="success"}get failed(){return this.conflicts.length>0}get reason(){return this.result}toString(){return this.conflicts.length?`CONFLICTS: ${this.conflicts.join(", ")}`:"OK"}}}}),Va,By,JI=g({"src/lib/responses/PullSummary.ts"(){"use strict";Va=class{constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},By=class{constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}});function $a(e){return e.objects=e.objects||{compressing:0,counting:0,enumerating:0,packReused:0,reused:{count:0,delta:0},total:{count:0,delta:0}}}function cg(e){let t=/^\s*(\d+)/.exec(e),r=/delta (\d+)/i.exec(e);return{count:B(t&&t[1]||"0"),delta:B(r&&r[1]||"0")}}var Uy,QI=g({"src/lib/parsers/parse-remote-objects.ts"(){"use strict";C(),Uy=[new pt(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(e,[t,r])=>{let n=t.toLowerCase(),s=$a(e.remoteMessages);Object.assign(s,{[n]:B(r)})}),new pt(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(e,[t,r])=>{let n=t.toLowerCase(),s=$a(e.remoteMessages);Object.assign(s,{[n]:B(r)})}),new pt(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(e,[t,r,n])=>{let s=$a(e.remoteMessages);s.total=cg(t),s.reused=cg(r),s.packReused=B(n)})]}});function Gy(e,t){return de({remoteMessages:new Vy},qy,t)}var qy,Vy,zy=g({"src/lib/parsers/parse-remote-messages.ts"(){"use strict";C(),QI(),qy=[new pt(/^remote:\s*(.+)$/,(e,[t])=>(e.remoteMessages.all.push(t.trim()),!1)),...Uy,new pt([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(e,[t])=>{e.remoteMessages.pullRequestUrl=t}),new pt([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(e,[t,r,n])=>{e.remoteMessages.vulnerabilities={count:B(t),summary:r,url:n}})],Vy=class{constructor(){this.all=[]}}}});function e1(e,t){let r=de(new By,Wy,[e,t]);return r.message&&r}var ug,lg,fg,dg,Wy,pg,mc,Zy=g({"src/lib/parsers/parse-pull.ts"(){"use strict";JI(),C(),zy(),ug=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,lg=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,fg=/^(create|delete) mode \d+ (.+)/,dg=[new I(ug,(e,[t,r,n])=>{e.files.push(t),r&&(e.insertions[t]=r.length),n&&(e.deletions[t]=n.length)}),new I(lg,(e,[t,,r,,n])=>r!==void 0||n!==void 0?(e.summary.changes=+t||0,e.summary.insertions=+r||0,e.summary.deletions=+n||0,!0):!1),new I(fg,(e,[t,r])=>{F(e.files,r),F(t==="create"?e.created:e.deleted,r)})],Wy=[new I(/^from\s(.+)$/i,(e,[t])=>void(e.remote=t)),new I(/^fatal:\s(.+)$/,(e,[t])=>void(e.message=t)),new I(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,(e,[t,r,n,s])=>{e.branch.local=n,e.hash.local=t,e.branch.remote=s,e.hash.remote=r})],pg=(e,t)=>de(new Va,dg,[e,t]),mc=(e,t)=>Object.assign(new Va,pg(e,t),Gy(e,t))}}),mg,Hy,hg,t1=g({"src/lib/parsers/parse-merge.ts"(){"use strict";KI(),C(),Zy(),mg=[new I(/^Auto-merging\s+(.+)$/,(e,[t])=>{e.merges.push(t)}),new I(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(e,[t,r])=>{e.conflicts.push(new Js(t,r))}),new I(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(e,[t,r,n])=>{e.conflicts.push(new Js(t,r,{deleteRef:n}))}),new I(/^CONFLICT\s+\((.+)\):/,(e,[t])=>{e.conflicts.push(new Js(t,null))}),new I(/^Automatic merge failed;\s+(.+)$/,(e,[t])=>{e.result=t})],Hy=(e,t)=>Object.assign(hg(e,t),mc(e,t)),hg=e=>de(new jy,mg,e)}});function gg(e){return e.length?{commands:["merge",...e],format:"utf-8",parser(t,r){let n=Hy(t,r);if(n.failed)throw new cn(n);return n}}:fe("Git.merge requires at least one option")}var r1=g({"src/lib/tasks/merge.ts"(){"use strict";_r(),t1(),W()}});function n1(e,t,r){let n=r.includes("deleted"),s=r.includes("tag")||/^refs\/tags/.test(e),o=!r.includes("new");return{deleted:n,tag:s,branch:!s,new:!o,alreadyUpdated:o,local:e,remote:t}}var yg,Yy,bg,s1=g({"src/lib/parsers/parse-push.ts"(){"use strict";C(),zy(),yg=[new I(/^Pushing to (.+)$/,(e,[t])=>{e.repo=t}),new I(/^updating local tracking ref '(.+)'/,(e,[t])=>{e.ref=rn(Ce({},e.ref||{}),{local:t})}),new I(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(e,[t,r,n])=>{e.pushed.push(n1(t,r,n))}),new I(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(e,[t,r,n])=>{e.branch=rn(Ce({},e.branch||{}),{local:t,remote:r,remoteName:n})}),new I(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,(e,[t,r,n,s])=>{e.update={head:{local:t,remote:r},hash:{from:n,to:s}}})],Yy=(e,t)=>{let r=bg(e,t),n=Gy(e,t);return Ce(Ce({},r),n)},bg=(e,t)=>de({pushed:[]},yg,[e,t])}}),Xy={};Z(Xy,{pushTagsTask:()=>o1,pushTask:()=>hc});function o1(e={},t){return F(t,"--tags"),hc(e,t)}function hc(e={},t){let r=["push",...t];return e.branch&&r.splice(1,0,e.branch),e.remote&&r.splice(1,0,e.remote),io(r,"-v"),F(r,"--verbose"),F(r,"--porcelain"),{commands:r,format:"utf-8",parser:Yy}}var Ky=g({"src/lib/tasks/push.ts"(){"use strict";s1(),C()}});function i1(){return{showBuffer(){let e=["show",...le(arguments,1)];return e.includes("--binary")||e.splice(1,0,"--binary"),this._runTask(sy(e),V(arguments))},show(){let e=["show",...le(arguments,1)];return this._runTask(ie(e),V(arguments))}}}var a1=g({"src/lib/tasks/show.ts"(){"use strict";C(),W()}}),wg,Jy,c1=g({"src/lib/responses/FileStatusSummary.ts"(){"use strict";wg=/^(.+)\0(.+)$/,Jy=class{constructor(e,t,r){if(this.path=e,this.index=t,this.working_dir=r,t==="R"||r==="R"){let n=wg.exec(e)||[null,e,e];this.from=n[2]||"",this.path=n[1]||""}}}}});function Sg(e){let[t,r]=e.split(vr);return{from:r||t,to:t}}function we(e,t,r){return[`${e}${t}`,r]}function Da(e,...t){return t.map(r=>we(e,r,(n,s)=>F(n.conflicted,s)))}function u1(e,t){let r=t.trim();switch(" "){case r.charAt(2):return n(r.charAt(0),r.charAt(1),r.substr(3));case r.charAt(1):return n(" ",r.charAt(0),r.substr(2));default:return}function n(s,o,i){let a=`${s}${o}`,c=Qy.get(a);c&&c(e,i),a!=="##"&&a!=="!!"&&e.files.push(new Jy(i,s,o))}}var xg,Qy,eb,l1=g({"src/lib/responses/StatusSummary.ts"(){"use strict";C(),c1(),xg=class{constructor(){this.not_added=[],this.conflicted=[],this.created=[],this.deleted=[],this.ignored=void 0,this.modified=[],this.renamed=[],this.files=[],this.staged=[],this.ahead=0,this.behind=0,this.current=null,this.tracking=null,this.detached=!1,this.isClean=()=>!this.files.length}},Qy=new Map([we(" ","A",(e,t)=>F(e.created,t)),we(" ","D",(e,t)=>F(e.deleted,t)),we(" ","M",(e,t)=>F(e.modified,t)),we("A"," ",(e,t)=>F(e.created,t)&&F(e.staged,t)),we("A","M",(e,t)=>F(e.created,t)&&F(e.staged,t)&&F(e.modified,t)),we("D"," ",(e,t)=>F(e.deleted,t)&&F(e.staged,t)),we("M"," ",(e,t)=>F(e.modified,t)&&F(e.staged,t)),we("M","M",(e,t)=>F(e.modified,t)&&F(e.staged,t)),we("R"," ",(e,t)=>{F(e.renamed,Sg(t))}),we("R","M",(e,t)=>{let r=Sg(t);F(e.renamed,r),F(e.modified,r.to)}),we("!","!",(e,t)=>{F(e.ignored=e.ignored||[],t)}),we("?","?",(e,t)=>F(e.not_added,t)),...Da("A","A","U"),...Da("D","D","U"),...Da("U","A","D","U"),["##",(e,t)=>{let r=/ahead (\d+)/,n=/behind (\d+)/,s=/^(.+?(?=(?:\.{3}|\s|$)))/,o=/\.{3}(\S*)/,i=/\son\s([\S]+)$/,a;a=r.exec(t),e.ahead=a&&+a[1]||0,a=n.exec(t),e.behind=a&&+a[1]||0,a=s.exec(t),e.current=a&&a[1],a=o.exec(t),e.tracking=a&&a[1],a=i.exec(t),e.current=a&&a[1]||e.current,e.detached=/\(no branch\)/.test(t)}]]),eb=function(e){let t=e.split(vr),r=new xg;for(let n=0,s=t.length;n<s;){let o=t[n++].trim();o&&(o.charAt(0)==="R"&&(o+=vr+(t[n++]||"")),u1(r,o))}return r}}});function f1(e){return{format:"utf-8",commands:["status","--porcelain","-b","-u","--null",...e.filter(r=>!tb.includes(r))],parser(r){return eb(r)}}}var tb,d1=g({"src/lib/tasks/status.ts"(){"use strict";l1(),tb=["--null","-z"]}});function ro(e=0,t=0,r=0,n="",s=!0){return Object.defineProperty({major:e,minor:t,patch:r,agent:n,installed:s},"toString",{value(){return`${this.major}.${this.minor}.${this.patch}`},configurable:!1,enumerable:!1})}function p1(){return ro(0,0,0,"",!1)}function m1(){return{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:h1,onError(e,t,r,n){if(e.exitCode===-2)return r(Buffer.from(gc));n(t)}})}}}function h1(e){return e===gc?p1():de(ro(0,0,0,e),rb,e)}var gc,rb,g1=g({"src/lib/tasks/version.ts"(){"use strict";C(),gc="installed=false",rb=[new I(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(e,[t,r,n,s=""])=>{Object.assign(e,ro(B(t),B(r),B(n),s))}),new I(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(e,[t,r,n,s=""])=>{Object.assign(e,ro(B(t),B(r),n,s))})]}}),nb={};Z(nb,{SimpleGitApi:()=>za});var za,y1=g({"src/lib/simple-git-api.ts"(){"use strict";vI(),_I(),TI(),kI(),DI(),dy(),NI(),yy(),MI(),GI(),Fy(),r1(),Ky(),a1(),d1(),W(),g1(),C(),za=class{constructor(e){this._executor=e}_runTask(e,t){let r=this._executor.chain(),n=r.push(e);return t&&SI(e,n,t),Object.create(this,{then:{value:n.then.bind(n)},catch:{value:n.catch.bind(n)},_executor:{value:r}})}add(e){return this._runTask(ie(["add",...Ze(e)]),V(arguments))}cwd(e){let t=V(arguments);return typeof e=="string"?this._runTask(sg(e,this._executor),t):typeof e?.path=="string"?this._runTask(sg(e.path,e.root&&this._executor||void 0),t):this._runTask(fe("Git.cwd: workingDirectory must be supplied as a string"),t)}hashObject(e,t){return this._runTask(PI(e,t===!0),V(arguments))}init(e){return this._runTask(UI(e===!0,this._executor.cwd,le(arguments)),V(arguments))}merge(){return this._runTask(gg(le(arguments)),V(arguments))}mergeFromTo(e,t){return te(e)&&te(t)?this._runTask(gg([e,t,...le(arguments)]),V(arguments,!1)):this._runTask(fe("Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings"))}outputHandler(e){return this._executor.outputHandler=e,this}push(){let e=hc({remote:He(arguments[0],te),branch:He(arguments[1],te)},le(arguments));return this._runTask(e,V(arguments))}stash(){return this._runTask(ie(["stash",...le(arguments)]),V(arguments))}status(){return this._runTask(f1(le(arguments)),V(arguments))}},Object.assign(za.prototype,EI(),$I(),iI(),RI(),LI(),lI(),XI(),i1(),m1())}}),sb={};Z(sb,{Scheduler:()=>ib});var vg,ib,b1=g({"src/lib/runners/scheduler.ts"(){"use strict";C(),vy(),vg=(()=>{let e=0;return()=>{e++;let{promise:t,done:r}=(0,ob.createDeferred)();return{promise:t,done:r,id:e}}})(),ib=class{constructor(e=2){this.concurrency=e,this.logger=ic("","scheduler"),this.pending=[],this.running=[],this.logger("Constructed, concurrency=%s",e)}schedule(){if(!this.pending.length||this.running.length>=this.concurrency){this.logger("Schedule attempt ignored, pending=%s running=%s concurrency=%s",this.pending.length,this.running.length,this.concurrency);return}let e=F(this.running,this.pending.shift());this.logger("Attempting id=%s",e.id),e.done(()=>{this.logger("Completing id=",e.id),io(this.running,e),this.schedule()})}next(){let{promise:e,id:t}=F(this.pending,vg());return this.logger("Scheduling id=%s",t),this.schedule(),e}}}}),ab={};Z(ab,{applyPatchTask:()=>w1});function w1(e,t){return ie(["apply",...t,...e])}var S1=g({"src/lib/tasks/apply-patch.ts"(){"use strict";W()}});function x1(e,t){return{branch:e,hash:t,success:!0}}function v1(e){return{branch:e,hash:null,success:!1}}var cb,_1=g({"src/lib/responses/BranchDeleteSummary.ts"(){"use strict";cb=class{constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function ub(e,t){return t===1&&Wa.test(e)}var _g,Wa,Eg,fo,E1=g({"src/lib/parsers/parse-branch-delete.ts"(){"use strict";_1(),C(),_g=/(\S+)\s+\(\S+\s([^)]+)\)/,Wa=/^error[^']+'([^']+)'/m,Eg=[new I(_g,(e,[t,r])=>{let n=x1(t,r);e.all.push(n),e.branches[t]=n}),new I(Wa,(e,[t])=>{let r=v1(t);e.errors.push(r),e.all.push(r),e.branches[t]=r})],fo=(e,t)=>de(new cb,Eg,[e,t])}}),lb,T1=g({"src/lib/responses/BranchSummary.ts"(){"use strict";lb=class{constructor(){this.all=[],this.branches={},this.current="",this.detached=!1}push(e,t,r,n,s){e==="*"&&(this.detached=t,this.current=r),this.all.push(r),this.branches[r]={current:e==="*",linkedWorkTree:e==="+",name:r,commit:n,label:s}}}}});function Tg(e){return e?e.charAt(0):""}function fb(e){return de(new lb,db,e)}var db,O1=g({"src/lib/parsers/parse-branch.ts"(){"use strict";T1(),C(),db=[new I(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(e,[t,r,n,s])=>{e.push(Tg(t),!0,r,n,s)}),new I(new RegExp("^([*+]\\s)?(\\S+)\\s+([a-z0-9]+)\\s?(.*)$","s"),(e,[t,r,n,s])=>{e.push(Tg(t),!1,r,n,s)})]}}),pb={};Z(pb,{branchLocalTask:()=>k1,branchTask:()=>R1,containsDeleteBranchCommand:()=>mb,deleteBranchTask:()=>A1,deleteBranchesTask:()=>C1});function mb(e){let t=["-d","-D","--delete"];return e.some(r=>t.includes(r))}function R1(e){let t=mb(e),r=["branch",...e];return r.length===1&&r.push("-a"),r.includes("-v")||r.splice(1,0,"-v"),{format:"utf-8",commands:r,parser(n,s){return t?fo(n,s).all[0]:fb(n)}}}function k1(){return{format:"utf-8",commands:["branch","-v"],parser:fb}}function C1(e,t=!1){return{format:"utf-8",commands:["branch","-v",t?"-D":"-d",...e],parser(r,n){return fo(r,n)},onError({exitCode:r,stdOut:n},s,o,i){if(!ub(String(s),r))return i(s);o(n)}}}function A1(e,t=!1){let r={format:"utf-8",commands:["branch","-v",t?"-D":"-d",e],parser(n,s){return fo(n,s).branches[e]},onError({exitCode:n,stdErr:s,stdOut:o},i,a,c){if(!ub(String(i),n))return c(i);throw new cn(r.parser(sn(o),sn(s)),String(i))}};return r}var I1=g({"src/lib/tasks/branch.ts"(){"use strict";_r(),E1(),O1(),C()}}),hb,$1=g({"src/lib/responses/CheckIgnore.ts"(){"use strict";hb=e=>e.split(/\n/g).map(t=>t.trim()).filter(t=>!!t)}}),gb={};Z(gb,{checkIgnoreTask:()=>D1});function D1(e){return{commands:["check-ignore",...e],format:"utf-8",parser:hb}}var L1=g({"src/lib/tasks/check-ignore.ts"(){"use strict";$1()}}),yb={};Z(yb,{cloneMirrorTask:()=>P1,cloneTask:()=>bb});function N1(e){return/^--upload-pack(=|$)/.test(e)}function bb(e,t,r){let n=["clone",...r];return te(e)&&n.push(e),te(t)&&n.push(t),n.find(N1)?fe("git.fetch: potential exploit argument blocked."):ie(n)}function P1(e,t,r){return F(r,"--mirror"),bb(e,t,r)}var M1=g({"src/lib/tasks/clone.ts"(){"use strict";W(),C()}});function F1(e,t){return de({raw:e,remote:null,branches:[],tags:[],updated:[],deleted:[]},wb,[e,t])}var wb,j1=g({"src/lib/parsers/parse-fetch.ts"(){"use strict";C(),wb=[new I(/From (.+)$/,(e,[t])=>{e.remote=t}),new I(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(e,[t,r])=>{e.branches.push({name:t,tracking:r})}),new I(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(e,[t,r])=>{e.tags.push({name:t,tracking:r})}),new I(/- \[deleted]\s+\S+\s*-> (.+)$/,(e,[t])=>{e.deleted.push({tracking:t})}),new I(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(e,[t,r,n,s])=>{e.updated.push({name:n,tracking:s,to:r,from:t})})]}}),Sb={};Z(Sb,{fetchTask:()=>U1});function B1(e){return/^--upload-pack(=|$)/.test(e)}function U1(e,t,r){let n=["fetch",...r];return e&&t&&n.push(e,t),n.find(B1)?fe("git.fetch: potential exploit argument blocked."):{commands:n,format:"utf-8",parser:F1}}var G1=g({"src/lib/tasks/fetch.ts"(){"use strict";j1(),W()}});function q1(e){return de({moves:[]},xb,e)}var xb,V1=g({"src/lib/parsers/parse-move.ts"(){"use strict";C(),xb=[new I(/^Renaming (.+) to (.+)$/,(e,[t,r])=>{e.moves.push({from:t,to:r})})]}}),vb={};Z(vb,{moveTask:()=>z1});function z1(e,t){return{commands:["mv","-v",...Ze(e),t],format:"utf-8",parser:q1}}var W1=g({"src/lib/tasks/move.ts"(){"use strict";V1(),C()}}),_b={};Z(_b,{pullTask:()=>Z1});function Z1(e,t,r){let n=["pull",...r];return e&&t&&n.splice(1,0,e,t),{commands:n,format:"utf-8",parser(s,o){return mc(s,o)},onError(s,o,i,a){let c=e1(sn(s.stdOut),sn(s.stdErr));if(c)return a(new cn(c));a(o)}}}var H1=g({"src/lib/tasks/pull.ts"(){"use strict";_r(),Zy(),C()}});function Y1(e){let t={};return Eb(e,([r])=>t[r]={name:r}),Object.values(t)}function X1(e){let t={};return Eb(e,([r,n,s])=>{t.hasOwnProperty(r)||(t[r]={name:r,refs:{fetch:"",push:""}}),s&&n&&(t[r].refs[s.replace(/[^a-z]/g,"")]=n)}),Object.values(t)}function Eb(e,t){Ha(e,r=>t(r.split(/\s+/)))}var K1=g({"src/lib/responses/GetRemoteSummary.ts"(){"use strict";C()}}),Tb={};Z(Tb,{addRemoteTask:()=>J1,getRemotesTask:()=>Q1,listRemotesTask:()=>e$,remoteTask:()=>t$,removeRemoteTask:()=>r$});function J1(e,t,r){return ie(["remote","add",...r,e,t])}function Q1(e){let t=["remote"];return e&&t.push("-v"),{commands:t,format:"utf-8",parser:e?X1:Y1}}function e$(e){let t=[...e];return t[0]!=="ls-remote"&&t.unshift("ls-remote"),ie(t)}function t$(e){let t=[...e];return t[0]!=="remote"&&t.unshift("remote"),ie(t)}function r$(e){return ie(["remote","remove",e])}var n$=g({"src/lib/tasks/remote.ts"(){"use strict";K1(),W()}}),Ob={};Z(Ob,{stashListTask:()=>s$});function s$(e={},t){let r=My(e),n=["stash","list",...r.commands,...t],s=Dy(r.splitter,r.fields,cc(n));return lo(n)||{commands:n,format:"utf-8",parser:s}}var o$=g({"src/lib/tasks/stash-list.ts"(){"use strict";dn(),Ny(),pc(),Fy()}}),Rb={};Z(Rb,{addSubModuleTask:()=>i$,initSubModuleTask:()=>a$,subModuleTask:()=>po,updateSubModuleTask:()=>c$});function i$(e,t){return po(["add",e,t])}function a$(e){return po(["init",...e])}function po(e){let t=[...e];return t[0]!=="submodule"&&t.unshift("submodule"),ie(t)}function c$(e){return po(["update",...e])}var u$=g({"src/lib/tasks/sub-module.ts"(){"use strict";W()}});function l$(e,t){let r=isNaN(e),n=isNaN(t);return r!==n?r?1:-1:r?kb(e,t):0}function kb(e,t){return e===t?0:e>t?1:-1}function f$(e){return e.trim()}function Hs(e){return typeof e=="string"&&parseInt(e.replace(/^\D+/g,""),10)||0}var Og,Cb,d$=g({"src/lib/responses/TagList.ts"(){"use strict";Og=class{constructor(e,t){this.all=e,this.latest=t}},Cb=function(e,t=!1){let r=e.split(`
|
59
|
-
`).map(f$).filter(Boolean);t||r.sort(function(s,o){let i=s.split("."),a=o.split(".");if(i.length===1||a.length===1)return l$(Hs(i[0]),Hs(a[0]));for(let c=0,u=Math.max(i.length,a.length);c<u;c++){let l=kb(Hs(i[c]),Hs(a[c]));if(l)return l}return 0});let n=t?r[0]:[...r].reverse().find(s=>s.indexOf(".")>=0);return new Og(r,n)}}}),Ab={};Z(Ab,{addAnnotatedTagTask:()=>h$,addTagTask:()=>m$,tagListTask:()=>p$});function p$(e=[]){let t=e.some(r=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...e],parser(r){return Cb(r,t)}}}function m$(e){return{format:"utf-8",commands:["tag",e],parser(){return{name:e}}}}function h$(e,t){return{format:"utf-8",commands:["tag","-a","-m",t,e],parser(){return{name:e}}}}var g$=g({"src/lib/tasks/tag.ts"(){"use strict";d$()}}),y$=DA({"src/git.js"(e,t){"use strict";var{GitExecutor:r}=(wI(),q(_y)),{SimpleGitApi:n}=(y1(),q(nb)),{Scheduler:s}=(b1(),q(sb)),{configurationErrorTask:o}=(W(),q(ja)),{asArray:i,filterArray:a,filterPrimitives:c,filterString:u,filterStringOrStringArray:l,filterType:f,getTrailingOptions:p,trailingFunctionArgument:d,trailingOptionsArgument:b}=(C(),q(Hg)),{applyPatchTask:T}=(S1(),q(ab)),{branchTask:N,branchLocalTask:P,deleteBranchesTask:U,deleteBranchTask:H}=(I1(),q(pb)),{checkIgnoreTask:Y}=(L1(),q(gb)),{checkIsRepoTask:Se}=(Jg(),q(Yg)),{cloneTask:ae,cloneMirrorTask:Ae}=(M1(),q(yb)),{cleanWithOptionsTask:Ie,isCleanOptionsArray:xe}=(uy(),q(ay)),{diffSummaryTask:Er}=(pc(),q(Py)),{fetchTask:ht}=(G1(),q(Sb)),{moveTask:qb}=(W1(),q(vb)),{pullTask:Vb}=(H1(),q(_b)),{pushTagsTask:zb}=(Ky(),q(Xy)),{addRemoteTask:Wb,getRemotesTask:Zb,listRemotesTask:Hb,remoteTask:Yb,removeRemoteTask:Xb}=(n$(),q(Tb)),{getResetMode:Kb,resetTask:Jb}=(xy(),q(by)),{stashListTask:Qb}=(o$(),q(Ob)),{addSubModuleTask:ew,initSubModuleTask:tw,subModuleTask:rw,updateSubModuleTask:nw}=(u$(),q(Rb)),{addAnnotatedTagTask:sw,addTagTask:ow,tagListTask:iw}=(g$(),q(Ab)),{straightThroughBufferTask:aw,straightThroughStringTask:Fe}=(W(),q(ja));function O(h,E){this._plugins=E,this._executor=new r(h.baseDir,new s(h.maxConcurrentProcesses),E),this._trimmed=h.trimmed}(O.prototype=Object.create(n.prototype)).constructor=O,O.prototype.customBinary=function(h){return this._plugins.reconfigure("binary",h),this},O.prototype.env=function(h,E){return arguments.length===1&&typeof h=="object"?this._executor.env=h:(this._executor.env=this._executor.env||{})[h]=E,this},O.prototype.stashList=function(h){return this._runTask(Qb(b(arguments)||{},a(h)&&h||[]),d(arguments))};function xc(h,E,j,re){return typeof j!="string"?o(`git.${h}() requires a string 'repoPath'`):E(j,f(re,u),p(arguments))}O.prototype.clone=function(){return this._runTask(xc("clone",ae,...arguments),d(arguments))},O.prototype.mirror=function(){return this._runTask(xc("mirror",Ae,...arguments),d(arguments))},O.prototype.mv=function(h,E){return this._runTask(qb(h,E),d(arguments))},O.prototype.checkoutLatestTag=function(h){var E=this;return this.pull(function(){E.tags(function(j,re){E.checkout(re.latest,h)})})},O.prototype.pull=function(h,E,j,re){return this._runTask(Vb(f(h,u),f(E,u),p(arguments)),d(arguments))},O.prototype.fetch=function(h,E){return this._runTask(ht(f(h,u),f(E,u),p(arguments)),d(arguments))},O.prototype.silent=function(h){return console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this will be an error in version 3"),this},O.prototype.tags=function(h,E){return this._runTask(iw(p(arguments)),d(arguments))},O.prototype.rebase=function(){return this._runTask(Fe(["rebase",...p(arguments)]),d(arguments))},O.prototype.reset=function(h){return this._runTask(Jb(Kb(h),p(arguments)),d(arguments))},O.prototype.revert=function(h){let E=d(arguments);return typeof h!="string"?this._runTask(o("Commit must be a string"),E):this._runTask(Fe(["revert",...p(arguments,0,!0),h]),E)},O.prototype.addTag=function(h){let E=typeof h=="string"?ow(h):o("Git.addTag requires a tag name");return this._runTask(E,d(arguments))},O.prototype.addAnnotatedTag=function(h,E){return this._runTask(sw(h,E),d(arguments))},O.prototype.deleteLocalBranch=function(h,E,j){return this._runTask(H(h,typeof E=="boolean"?E:!1),d(arguments))},O.prototype.deleteLocalBranches=function(h,E,j){return this._runTask(U(h,typeof E=="boolean"?E:!1),d(arguments))},O.prototype.branch=function(h,E){return this._runTask(N(p(arguments)),d(arguments))},O.prototype.branchLocal=function(h){return this._runTask(P(),d(arguments))},O.prototype.raw=function(h){let E=!Array.isArray(h),j=[].slice.call(E?arguments:h,0);for(let $e=0;$e<j.length&&E;$e++)if(!c(j[$e])){j.splice($e,j.length-$e);break}j.push(...p(arguments,0,!0));var re=d(arguments);return j.length?this._runTask(Fe(j,this._trimmed),re):this._runTask(o("Raw: must supply one or more command to execute"),re)},O.prototype.submoduleAdd=function(h,E,j){return this._runTask(ew(h,E),d(arguments))},O.prototype.submoduleUpdate=function(h,E){return this._runTask(nw(p(arguments,!0)),d(arguments))},O.prototype.submoduleInit=function(h,E){return this._runTask(tw(p(arguments,!0)),d(arguments))},O.prototype.subModule=function(h,E){return this._runTask(rw(p(arguments)),d(arguments))},O.prototype.listRemote=function(){return this._runTask(Hb(p(arguments)),d(arguments))},O.prototype.addRemote=function(h,E,j){return this._runTask(Wb(h,E,p(arguments)),d(arguments))},O.prototype.removeRemote=function(h,E){return this._runTask(Xb(h),d(arguments))},O.prototype.getRemotes=function(h,E){return this._runTask(Zb(h===!0),d(arguments))},O.prototype.remote=function(h,E){return this._runTask(Yb(p(arguments)),d(arguments))},O.prototype.tag=function(h,E){let j=p(arguments);return j[0]!=="tag"&&j.unshift("tag"),this._runTask(Fe(j),d(arguments))},O.prototype.updateServerInfo=function(h){return this._runTask(Fe(["update-server-info"]),d(arguments))},O.prototype.pushTags=function(h,E){let j=zb({remote:f(h,u)},p(arguments));return this._runTask(j,d(arguments))},O.prototype.rm=function(h){return this._runTask(Fe(["rm","-f",...i(h)]),d(arguments))},O.prototype.rmKeepLocal=function(h){return this._runTask(Fe(["rm","--cached",...i(h)]),d(arguments))},O.prototype.catFile=function(h,E){return this._catFile("utf-8",arguments)},O.prototype.binaryCatFile=function(){return this._catFile("buffer",arguments)},O.prototype._catFile=function(h,E){var j=d(E),re=["cat-file"],$e=E[0];if(typeof $e=="string")return this._runTask(o("Git.catFile: options must be supplied as an array of strings"),j);Array.isArray($e)&&re.push.apply(re,$e);let bo=h==="buffer"?aw(re):Fe(re);return this._runTask(bo,j)},O.prototype.diff=function(h,E){let j=u(h)?o("git.diff: supplying options as a single string is no longer supported, switch to an array of strings"):Fe(["diff",...p(arguments)]);return this._runTask(j,d(arguments))},O.prototype.diffSummary=function(){return this._runTask(Er(p(arguments,1)),d(arguments))},O.prototype.applyPatch=function(h){let E=l(h)?T(i(h),p([].slice.call(arguments,1))):o("git.applyPatch requires one or more string patches as the first argument");return this._runTask(E,d(arguments))},O.prototype.revparse=function(){let h=["rev-parse",...p(arguments,!0)];return this._runTask(Fe(h,!0),d(arguments))},O.prototype.clean=function(h,E,j){let re=xe(h),$e=re&&h.join("")||f(h,u)||"",bo=p([].slice.call(arguments,re?1:0));return this._runTask(Ie($e,bo),d(arguments))},O.prototype.exec=function(h){let E={commands:[],format:"utf-8",parser(){typeof h=="function"&&h()}};return this._runTask(E)},O.prototype.clearQueue=function(){return this},O.prototype.checkIgnore=function(h,E){return this._runTask(Y(i(f(h,l,[]))),d(arguments))},O.prototype.checkIsRepo=function(h,E){return this._runTask(Se(f(h,u)),d(arguments))},t.exports=O}});an();mt();var b$=class extends ot{constructor(e,t){super(void 0,t),this.config=e}};mt();mt();var st=class extends ot{constructor(e,t,r){super(e,r),this.task=e,this.plugin=t,Object.setPrototypeOf(this,new.target.prototype)}};_r();Dg();Jg();uy();dy();my();yy();xy();function w$(e){return e?[{type:"spawn.before",action(n,s){e.aborted&&s.kill(new st(void 0,"abort","Abort already signaled"))}},{type:"spawn.after",action(n,s){function o(){s.kill(new st(void 0,"abort","Abort signal received"))}e.addEventListener("abort",o),s.spawned.on("close",()=>e.removeEventListener("abort",o))}}]:void 0}function S$(e){return typeof e=="string"&&e.trim().toLowerCase()==="-c"}function x$(e,t){if(S$(e)&&/^\s*protocol(.[a-z]+)?.allow/.test(t))throw new st(void 0,"unsafe","Configuring protocol.allow is not permitted without enabling allowUnsafeExtProtocol")}function v$(e,t){if(/^\s*--(upload|receive)-pack/.test(e))throw new st(void 0,"unsafe","Use of --upload-pack or --receive-pack is not permitted without enabling allowUnsafePack");if(t==="clone"&&/^\s*-u\b/.test(e))throw new st(void 0,"unsafe","Use of clone with option -u is not permitted without enabling allowUnsafePack");if(t==="push"&&/^\s*--exec\b/.test(e))throw new st(void 0,"unsafe","Use of push with option --exec is not permitted without enabling allowUnsafePack")}function _$({allowUnsafeProtocolOverride:e=!1,allowUnsafePack:t=!1}={}){return{type:"spawn.args",action(r,n){return r.forEach((s,o)=>{let i=o<r.length?r[o+1]:"";e||x$(s,i),t||v$(s,n.method)}),r}}}C();function E$(e){let t=nn(e,"-c");return{type:"spawn.args",action(r){return[...t,...r]}}}C();var Rg=(0,xr.deferred)().promise;function T$({onClose:e=!0,onExit:t=50}={}){function r(){let s=-1,o={close:(0,xr.deferred)(),closeTimeout:(0,xr.deferred)(),exit:(0,xr.deferred)(),exitTimeout:(0,xr.deferred)()},i=Promise.race([e===!1?Rg:o.closeTimeout.promise,t===!1?Rg:o.exitTimeout.promise]);return n(e,o.close,o.closeTimeout),n(t,o.exit,o.exitTimeout),{close(a){s=a,o.close.done()},exit(a){s=a,o.exit.done()},get exitCode(){return s},result:i}}function n(s,o,i){s!==!1&&(s===!0?o.promise:o.promise.then(()=>La(s))).then(i.done)}return{type:"spawn.after",action(s,o){return tn(this,arguments,function*(i,{spawned:a,close:c}){var u,l;let f=r(),p=!0,d=()=>void(p=!1);(u=a.stdout)==null||u.on("data",d),(l=a.stderr)==null||l.on("data",d),a.on("error",d),a.on("close",b=>f.close(b)),a.on("exit",b=>f.exit(b));try{yield f.result,p&&(yield La(50)),c(f.exitCode)}catch(b){c(f.exitCode,b)}})}}}C();var O$="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",kg="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function R$(e){return!e||!/^([a-z]:)?([a-z0-9/.\\_-]+)$/i.test(e)}function Cg(e,t){if(e.length<1||e.length>2)throw new st(void 0,"binary",O$);if(e.some(R$))if(t)console.warn(kg);else throw new st(void 0,"binary",kg);let[n,s]=e;return{binary:n,prefix:s}}function k$(e,t=["git"],r=!1){let n=Cg(Ze(t),r);e.on("binary",s=>{n=Cg(Ze(s),r)}),e.append("spawn.binary",()=>n.binary),e.append("spawn.args",s=>n.prefix?[n.prefix,...s]:s)}mt();function C$(e){return!!(e.exitCode&&e.stdErr.length)}function A$(e){return Buffer.concat([...e.stdOut,...e.stdErr])}function I$(e=!1,t=C$,r=A$){return(n,s)=>!e&&n||!t(s)?n:r(s)}function Ag(e){return{type:"task.error",action(t,r){let n=e(t.error,{stdErr:r.stdErr,stdOut:r.stdOut,exitCode:r.exitCode});return Buffer.isBuffer(n)?{error:new ot(void 0,n.toString("utf-8"))}:{error:n}}}}C();var D$=class{constructor(){this.plugins=new Set,this.events=new $$}on(e,t){this.events.on(e,t)}reconfigure(e,t){this.events.emit(e,t)}append(e,t){let r=F(this.plugins,{type:e,action:t});return()=>this.plugins.delete(r)}add(e){let t=[];return Ze(e).forEach(r=>r&&this.plugins.add(F(t,r))),()=>{t.forEach(r=>this.plugins.delete(r))}}exec(e,t,r){let n=t,s=Object.freeze(Object.create(r));for(let o of this.plugins)o.type===e&&(n=o.action(n,s));return n}};C();function L$(e){let t="--progress",r=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(o,i){return r.includes(i.method)?jg(o,t):o}},{type:"spawn.after",action(o,i){var a;i.commands.includes(t)&&((a=i.spawned.stderr)==null||a.on("data",c=>{let u=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(c.toString("utf8"));u&&e({method:i.method,stage:N$(u[1]),progress:B(u[2]),processed:B(u[3]),total:B(u[4])})}))}}]}function N$(e){return String(e.toLowerCase().split(" ",1))||"unknown"}C();function P$(e){let t=Gg(e,["uid","gid"]);return{type:"spawn.options",action(r){return Ce(Ce({},t),r)}}}function M$({block:e,stdErr:t=!0,stdOut:r=!0}){if(e>0)return{type:"spawn.after",action(n,s){var o,i;let a;function c(){a&&clearTimeout(a),a=setTimeout(l,e)}function u(){var f,p;(f=s.spawned.stdout)==null||f.off("data",c),(p=s.spawned.stderr)==null||p.off("data",c),s.spawned.off("exit",u),s.spawned.off("close",u),a&&clearTimeout(a)}function l(){u(),s.kill(new st(void 0,"timeout","block timeout reached"))}r&&((o=s.spawned.stdout)==null||o.on("data",c)),t&&((i=s.spawned.stderr)==null||i.on("data",c)),s.spawned.on("exit",u),s.spawned.on("close",u),c()}}}an();function F$(){return{type:"spawn.args",action(e){let t=[],r;function n(s){(r=r||[]).push(...s)}for(let s=0;s<e.length;s++){let o=e[s];if(Qs(o)){n(eg(o));continue}if(o==="--"){n(e.slice(s+1).flatMap(i=>Qs(i)&&eg(i)||i));break}t.push(o)}return r?[...t,"--",...r.map(String)]:t}}}C();var j$=y$();function B$(e,t){var r;let n=new D$,s=Wg(e&&(typeof e=="string"?{baseDir:e}:e)||{},t);if(!Ya(s.baseDir))throw new b$(s,"Cannot use simple-git on a directory that does not exist");return Array.isArray(s.config)&&n.add(E$(s.config)),n.add(_$(s.unsafe)),n.add(F$()),n.add(T$(s.completion)),s.abort&&n.add(w$(s.abort)),s.progress&&n.add(L$(s.progress)),s.timeout&&n.add(M$(s.timeout)),s.spawnOptions&&n.add(P$(s.spawnOptions)),n.add(Ag(I$(!0))),s.errors&&n.add(Ag(s.errors)),k$(n,s.binary,(r=s.unsafe)==null?void 0:r.allowUnsafeCustomBinary),new j$(s,n)}_r();var Ib=B$;async function $b(){let e=Ib();try{let{current:t}=await e.branchLocal(),r=(await e.getRemotes(!0)).map(({name:o,refs:{fetch:i}})=>({name:o,url:i})),n=r.find(({name:o})=>o==="origin")??r[0];return{possibleRepositoryName:n?n.url.split("/").slice(-2).join("/").replace(/\.git$/,""):(await e.revparse(["--show-toplevel"])).split("/").pop(),branch:t,remotes:r}}catch{return null}}var Pb=gt(Nb(),1),bc=Pb.default.bold("@seed-design/codemod"),Mb=e=>({event:t,properties:r})=>console.log(bc,t,r,e);var Fb=Sc(W$(import.meta.filename),"transforms"),jb=Rc(),Bb=z$(import.meta.url),go=Bb("../package.json"),Ub=await $b(),Gb=Mb({...Ub});Z$();jb.version(go.version).help().command("[transformName] [...paths]","\uCF54\uB4DC \uBCC0\uD658 (codemod)").option("-l, --list","\uC0AC\uC6A9 \uAC00\uB2A5\uD55C transform \uBAA9\uB85D\uC744 \uBCF4\uC5EC\uC918\uC694").option("--log","\uB85C\uADF8\uB97C \uD30C\uC77C\uB85C \uC800\uC7A5\uD574\uC694").option("--no-track","\uC0AC\uC6A9 \uD1B5\uACC4\uB97C \uC218\uC9D1\uD558\uC9C0 \uC54A\uC544\uC694").option("-p, --parser <parser>","jscodeshift\uAC00 \uC0AC\uC6A9\uD560 \uD30C\uC11C\uB97C \uC9C0\uC815\uD574\uC694 (babel|babylon|flow|ts|tsx)",{default:"tsx"}).option("--reporter","\uBCC0\uD658 \uACB0\uACFC\uB97C \uD30C\uC77C\uB85C \uC800\uC7A5\uD574\uC694").option("--extensions <extensions>","\uBCC0\uD658\uD560 \uD30C\uC77C \uD655\uC7A5\uC790").option("--ignore-config <ignoreConfig>","Ignore config").example(" $ npx @seed-design/codemod migrate-icons src/ui").action(async(e,t,r)=>{let n=Fh.parse(r);n.track&&Gb?.({event:"\uC2E4\uD589",properties:{transformName:e,paths:t}});let s=Y$();n.list&&(wc(s),process.exit(0)),e||(console.error("transform \uC774\uB984\uC744 \uC785\uB825\uD574\uC8FC\uC138\uC694"),wc(s),process.exit(1)),s.includes(e)||(console.error(`\uC774\uB984\uC774 ${e}\uC778 transform\uC774 \uC5C6\uC5B4\uC694`),wc(s),process.exit(1)),t.length===0&&(console.error("\uD30C\uC77C \uACBD\uB85C\uB97C \uC785\uB825\uD574\uC8FC\uC138\uC694"),process.exit(1));let o=Sc(Fb,e,"index.mjs");console.log(bc,`${t.join(", ")}\uC5D0 ${e} transform\uC744 \uC2E4\uD589\uD574\uC694.`),await H$(o,t,n)});jb.parse();function Z$(){(0,yo.satisfies)(process.versions.node,go.engines.node)===!1&&(console.error(`Node.js \uBC84\uC804 \uC694\uAD6C\uC0AC\uD56D\uC744 \uB9CC\uC871\uC2DC\uD0A4\uC9C0 \uC54A\uC544\uC694: "${go.engines.node}"
|
59
|
+
`).map(f$).filter(Boolean);t||r.sort(function(s,o){let i=s.split("."),a=o.split(".");if(i.length===1||a.length===1)return l$(Hs(i[0]),Hs(a[0]));for(let c=0,u=Math.max(i.length,a.length);c<u;c++){let l=kb(Hs(i[c]),Hs(a[c]));if(l)return l}return 0});let n=t?r[0]:[...r].reverse().find(s=>s.indexOf(".")>=0);return new Og(r,n)}}}),Ab={};Z(Ab,{addAnnotatedTagTask:()=>h$,addTagTask:()=>m$,tagListTask:()=>p$});function p$(e=[]){let t=e.some(r=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...e],parser(r){return Cb(r,t)}}}function m$(e){return{format:"utf-8",commands:["tag",e],parser(){return{name:e}}}}function h$(e,t){return{format:"utf-8",commands:["tag","-a","-m",t,e],parser(){return{name:e}}}}var g$=g({"src/lib/tasks/tag.ts"(){"use strict";d$()}}),y$=DA({"src/git.js"(e,t){"use strict";var{GitExecutor:r}=(wI(),q(_y)),{SimpleGitApi:n}=(y1(),q(nb)),{Scheduler:s}=(b1(),q(sb)),{configurationErrorTask:o}=(W(),q(ja)),{asArray:i,filterArray:a,filterPrimitives:c,filterString:u,filterStringOrStringArray:l,filterType:f,getTrailingOptions:p,trailingFunctionArgument:d,trailingOptionsArgument:b}=(C(),q(Hg)),{applyPatchTask:T}=(S1(),q(ab)),{branchTask:N,branchLocalTask:P,deleteBranchesTask:U,deleteBranchTask:H}=(I1(),q(pb)),{checkIgnoreTask:Y}=(L1(),q(gb)),{checkIsRepoTask:Se}=(Jg(),q(Yg)),{cloneTask:ae,cloneMirrorTask:Ae}=(M1(),q(yb)),{cleanWithOptionsTask:Ie,isCleanOptionsArray:xe}=(uy(),q(ay)),{diffSummaryTask:Er}=(pc(),q(Py)),{fetchTask:ht}=(G1(),q(Sb)),{moveTask:qb}=(W1(),q(vb)),{pullTask:Vb}=(H1(),q(_b)),{pushTagsTask:zb}=(Ky(),q(Xy)),{addRemoteTask:Wb,getRemotesTask:Zb,listRemotesTask:Hb,remoteTask:Yb,removeRemoteTask:Xb}=(n$(),q(Tb)),{getResetMode:Kb,resetTask:Jb}=(xy(),q(by)),{stashListTask:Qb}=(o$(),q(Ob)),{addSubModuleTask:ew,initSubModuleTask:tw,subModuleTask:rw,updateSubModuleTask:nw}=(u$(),q(Rb)),{addAnnotatedTagTask:sw,addTagTask:ow,tagListTask:iw}=(g$(),q(Ab)),{straightThroughBufferTask:aw,straightThroughStringTask:Fe}=(W(),q(ja));function O(h,E){this._plugins=E,this._executor=new r(h.baseDir,new s(h.maxConcurrentProcesses),E),this._trimmed=h.trimmed}(O.prototype=Object.create(n.prototype)).constructor=O,O.prototype.customBinary=function(h){return this._plugins.reconfigure("binary",h),this},O.prototype.env=function(h,E){return arguments.length===1&&typeof h=="object"?this._executor.env=h:(this._executor.env=this._executor.env||{})[h]=E,this},O.prototype.stashList=function(h){return this._runTask(Qb(b(arguments)||{},a(h)&&h||[]),d(arguments))};function xc(h,E,j,re){return typeof j!="string"?o(`git.${h}() requires a string 'repoPath'`):E(j,f(re,u),p(arguments))}O.prototype.clone=function(){return this._runTask(xc("clone",ae,...arguments),d(arguments))},O.prototype.mirror=function(){return this._runTask(xc("mirror",Ae,...arguments),d(arguments))},O.prototype.mv=function(h,E){return this._runTask(qb(h,E),d(arguments))},O.prototype.checkoutLatestTag=function(h){var E=this;return this.pull(function(){E.tags(function(j,re){E.checkout(re.latest,h)})})},O.prototype.pull=function(h,E,j,re){return this._runTask(Vb(f(h,u),f(E,u),p(arguments)),d(arguments))},O.prototype.fetch=function(h,E){return this._runTask(ht(f(h,u),f(E,u),p(arguments)),d(arguments))},O.prototype.silent=function(h){return console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this will be an error in version 3"),this},O.prototype.tags=function(h,E){return this._runTask(iw(p(arguments)),d(arguments))},O.prototype.rebase=function(){return this._runTask(Fe(["rebase",...p(arguments)]),d(arguments))},O.prototype.reset=function(h){return this._runTask(Jb(Kb(h),p(arguments)),d(arguments))},O.prototype.revert=function(h){let E=d(arguments);return typeof h!="string"?this._runTask(o("Commit must be a string"),E):this._runTask(Fe(["revert",...p(arguments,0,!0),h]),E)},O.prototype.addTag=function(h){let E=typeof h=="string"?ow(h):o("Git.addTag requires a tag name");return this._runTask(E,d(arguments))},O.prototype.addAnnotatedTag=function(h,E){return this._runTask(sw(h,E),d(arguments))},O.prototype.deleteLocalBranch=function(h,E,j){return this._runTask(H(h,typeof E=="boolean"?E:!1),d(arguments))},O.prototype.deleteLocalBranches=function(h,E,j){return this._runTask(U(h,typeof E=="boolean"?E:!1),d(arguments))},O.prototype.branch=function(h,E){return this._runTask(N(p(arguments)),d(arguments))},O.prototype.branchLocal=function(h){return this._runTask(P(),d(arguments))},O.prototype.raw=function(h){let E=!Array.isArray(h),j=[].slice.call(E?arguments:h,0);for(let $e=0;$e<j.length&&E;$e++)if(!c(j[$e])){j.splice($e,j.length-$e);break}j.push(...p(arguments,0,!0));var re=d(arguments);return j.length?this._runTask(Fe(j,this._trimmed),re):this._runTask(o("Raw: must supply one or more command to execute"),re)},O.prototype.submoduleAdd=function(h,E,j){return this._runTask(ew(h,E),d(arguments))},O.prototype.submoduleUpdate=function(h,E){return this._runTask(nw(p(arguments,!0)),d(arguments))},O.prototype.submoduleInit=function(h,E){return this._runTask(tw(p(arguments,!0)),d(arguments))},O.prototype.subModule=function(h,E){return this._runTask(rw(p(arguments)),d(arguments))},O.prototype.listRemote=function(){return this._runTask(Hb(p(arguments)),d(arguments))},O.prototype.addRemote=function(h,E,j){return this._runTask(Wb(h,E,p(arguments)),d(arguments))},O.prototype.removeRemote=function(h,E){return this._runTask(Xb(h),d(arguments))},O.prototype.getRemotes=function(h,E){return this._runTask(Zb(h===!0),d(arguments))},O.prototype.remote=function(h,E){return this._runTask(Yb(p(arguments)),d(arguments))},O.prototype.tag=function(h,E){let j=p(arguments);return j[0]!=="tag"&&j.unshift("tag"),this._runTask(Fe(j),d(arguments))},O.prototype.updateServerInfo=function(h){return this._runTask(Fe(["update-server-info"]),d(arguments))},O.prototype.pushTags=function(h,E){let j=zb({remote:f(h,u)},p(arguments));return this._runTask(j,d(arguments))},O.prototype.rm=function(h){return this._runTask(Fe(["rm","-f",...i(h)]),d(arguments))},O.prototype.rmKeepLocal=function(h){return this._runTask(Fe(["rm","--cached",...i(h)]),d(arguments))},O.prototype.catFile=function(h,E){return this._catFile("utf-8",arguments)},O.prototype.binaryCatFile=function(){return this._catFile("buffer",arguments)},O.prototype._catFile=function(h,E){var j=d(E),re=["cat-file"],$e=E[0];if(typeof $e=="string")return this._runTask(o("Git.catFile: options must be supplied as an array of strings"),j);Array.isArray($e)&&re.push.apply(re,$e);let bo=h==="buffer"?aw(re):Fe(re);return this._runTask(bo,j)},O.prototype.diff=function(h,E){let j=u(h)?o("git.diff: supplying options as a single string is no longer supported, switch to an array of strings"):Fe(["diff",...p(arguments)]);return this._runTask(j,d(arguments))},O.prototype.diffSummary=function(){return this._runTask(Er(p(arguments,1)),d(arguments))},O.prototype.applyPatch=function(h){let E=l(h)?T(i(h),p([].slice.call(arguments,1))):o("git.applyPatch requires one or more string patches as the first argument");return this._runTask(E,d(arguments))},O.prototype.revparse=function(){let h=["rev-parse",...p(arguments,!0)];return this._runTask(Fe(h,!0),d(arguments))},O.prototype.clean=function(h,E,j){let re=xe(h),$e=re&&h.join("")||f(h,u)||"",bo=p([].slice.call(arguments,re?1:0));return this._runTask(Ie($e,bo),d(arguments))},O.prototype.exec=function(h){let E={commands:[],format:"utf-8",parser(){typeof h=="function"&&h()}};return this._runTask(E)},O.prototype.clearQueue=function(){return this},O.prototype.checkIgnore=function(h,E){return this._runTask(Y(i(f(h,l,[]))),d(arguments))},O.prototype.checkIsRepo=function(h,E){return this._runTask(Se(f(h,u)),d(arguments))},t.exports=O}});an();mt();var b$=class extends ot{constructor(e,t){super(void 0,t),this.config=e}};mt();mt();var st=class extends ot{constructor(e,t,r){super(e,r),this.task=e,this.plugin=t,Object.setPrototypeOf(this,new.target.prototype)}};_r();Dg();Jg();uy();dy();my();yy();xy();function w$(e){return e?[{type:"spawn.before",action(n,s){e.aborted&&s.kill(new st(void 0,"abort","Abort already signaled"))}},{type:"spawn.after",action(n,s){function o(){s.kill(new st(void 0,"abort","Abort signal received"))}e.addEventListener("abort",o),s.spawned.on("close",()=>e.removeEventListener("abort",o))}}]:void 0}function S$(e){return typeof e=="string"&&e.trim().toLowerCase()==="-c"}function x$(e,t){if(S$(e)&&/^\s*protocol(.[a-z]+)?.allow/.test(t))throw new st(void 0,"unsafe","Configuring protocol.allow is not permitted without enabling allowUnsafeExtProtocol")}function v$(e,t){if(/^\s*--(upload|receive)-pack/.test(e))throw new st(void 0,"unsafe","Use of --upload-pack or --receive-pack is not permitted without enabling allowUnsafePack");if(t==="clone"&&/^\s*-u\b/.test(e))throw new st(void 0,"unsafe","Use of clone with option -u is not permitted without enabling allowUnsafePack");if(t==="push"&&/^\s*--exec\b/.test(e))throw new st(void 0,"unsafe","Use of push with option --exec is not permitted without enabling allowUnsafePack")}function _$({allowUnsafeProtocolOverride:e=!1,allowUnsafePack:t=!1}={}){return{type:"spawn.args",action(r,n){return r.forEach((s,o)=>{let i=o<r.length?r[o+1]:"";e||x$(s,i),t||v$(s,n.method)}),r}}}C();function E$(e){let t=nn(e,"-c");return{type:"spawn.args",action(r){return[...t,...r]}}}C();var Rg=(0,xr.deferred)().promise;function T$({onClose:e=!0,onExit:t=50}={}){function r(){let s=-1,o={close:(0,xr.deferred)(),closeTimeout:(0,xr.deferred)(),exit:(0,xr.deferred)(),exitTimeout:(0,xr.deferred)()},i=Promise.race([e===!1?Rg:o.closeTimeout.promise,t===!1?Rg:o.exitTimeout.promise]);return n(e,o.close,o.closeTimeout),n(t,o.exit,o.exitTimeout),{close(a){s=a,o.close.done()},exit(a){s=a,o.exit.done()},get exitCode(){return s},result:i}}function n(s,o,i){s!==!1&&(s===!0?o.promise:o.promise.then(()=>La(s))).then(i.done)}return{type:"spawn.after",action(s,o){return tn(this,arguments,function*(i,{spawned:a,close:c}){var u,l;let f=r(),p=!0,d=()=>void(p=!1);(u=a.stdout)==null||u.on("data",d),(l=a.stderr)==null||l.on("data",d),a.on("error",d),a.on("close",b=>f.close(b)),a.on("exit",b=>f.exit(b));try{yield f.result,p&&(yield La(50)),c(f.exitCode)}catch(b){c(f.exitCode,b)}})}}}C();var O$="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",kg="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function R$(e){return!e||!/^([a-z]:)?([a-z0-9/.\\_-]+)$/i.test(e)}function Cg(e,t){if(e.length<1||e.length>2)throw new st(void 0,"binary",O$);if(e.some(R$))if(t)console.warn(kg);else throw new st(void 0,"binary",kg);let[n,s]=e;return{binary:n,prefix:s}}function k$(e,t=["git"],r=!1){let n=Cg(Ze(t),r);e.on("binary",s=>{n=Cg(Ze(s),r)}),e.append("spawn.binary",()=>n.binary),e.append("spawn.args",s=>n.prefix?[n.prefix,...s]:s)}mt();function C$(e){return!!(e.exitCode&&e.stdErr.length)}function A$(e){return Buffer.concat([...e.stdOut,...e.stdErr])}function I$(e=!1,t=C$,r=A$){return(n,s)=>!e&&n||!t(s)?n:r(s)}function Ag(e){return{type:"task.error",action(t,r){let n=e(t.error,{stdErr:r.stdErr,stdOut:r.stdOut,exitCode:r.exitCode});return Buffer.isBuffer(n)?{error:new ot(void 0,n.toString("utf-8"))}:{error:n}}}}C();var D$=class{constructor(){this.plugins=new Set,this.events=new $$}on(e,t){this.events.on(e,t)}reconfigure(e,t){this.events.emit(e,t)}append(e,t){let r=F(this.plugins,{type:e,action:t});return()=>this.plugins.delete(r)}add(e){let t=[];return Ze(e).forEach(r=>r&&this.plugins.add(F(t,r))),()=>{t.forEach(r=>this.plugins.delete(r))}}exec(e,t,r){let n=t,s=Object.freeze(Object.create(r));for(let o of this.plugins)o.type===e&&(n=o.action(n,s));return n}};C();function L$(e){let t="--progress",r=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(o,i){return r.includes(i.method)?jg(o,t):o}},{type:"spawn.after",action(o,i){var a;i.commands.includes(t)&&((a=i.spawned.stderr)==null||a.on("data",c=>{let u=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(c.toString("utf8"));u&&e({method:i.method,stage:N$(u[1]),progress:B(u[2]),processed:B(u[3]),total:B(u[4])})}))}}]}function N$(e){return String(e.toLowerCase().split(" ",1))||"unknown"}C();function P$(e){let t=Gg(e,["uid","gid"]);return{type:"spawn.options",action(r){return Ce(Ce({},t),r)}}}function M$({block:e,stdErr:t=!0,stdOut:r=!0}){if(e>0)return{type:"spawn.after",action(n,s){var o,i;let a;function c(){a&&clearTimeout(a),a=setTimeout(l,e)}function u(){var f,p;(f=s.spawned.stdout)==null||f.off("data",c),(p=s.spawned.stderr)==null||p.off("data",c),s.spawned.off("exit",u),s.spawned.off("close",u),a&&clearTimeout(a)}function l(){u(),s.kill(new st(void 0,"timeout","block timeout reached"))}r&&((o=s.spawned.stdout)==null||o.on("data",c)),t&&((i=s.spawned.stderr)==null||i.on("data",c)),s.spawned.on("exit",u),s.spawned.on("close",u),c()}}}an();function F$(){return{type:"spawn.args",action(e){let t=[],r;function n(s){(r=r||[]).push(...s)}for(let s=0;s<e.length;s++){let o=e[s];if(Qs(o)){n(eg(o));continue}if(o==="--"){n(e.slice(s+1).flatMap(i=>Qs(i)&&eg(i)||i));break}t.push(o)}return r?[...t,"--",...r.map(String)]:t}}}C();var j$=y$();function B$(e,t){var r;let n=new D$,s=Wg(e&&(typeof e=="string"?{baseDir:e}:e)||{},t);if(!Ya(s.baseDir))throw new b$(s,"Cannot use simple-git on a directory that does not exist");return Array.isArray(s.config)&&n.add(E$(s.config)),n.add(_$(s.unsafe)),n.add(F$()),n.add(T$(s.completion)),s.abort&&n.add(w$(s.abort)),s.progress&&n.add(L$(s.progress)),s.timeout&&n.add(M$(s.timeout)),s.spawnOptions&&n.add(P$(s.spawnOptions)),n.add(Ag(I$(!0))),s.errors&&n.add(Ag(s.errors)),k$(n,s.binary,(r=s.unsafe)==null?void 0:r.allowUnsafeCustomBinary),new j$(s,n)}_r();var Ib=B$;async function $b(){let e=Ib();try{let{current:t}=await e.branchLocal(),r=(await e.getRemotes(!0)).map(({name:o,refs:{fetch:i}})=>({name:o,url:i})),n=r.find(({name:o})=>o==="origin")??r[0];return{possibleRepositoryName:n?n.url.split("/").slice(-2).join("/").replace(/\.git$/,""):(await e.revparse(["--show-toplevel"])).split("/").pop(),branch:t,remotes:r}}catch{return null}}var Pb=gt(Nb(),1),bc=Pb.default.bold("@seed-design/codemod"),Mb=e=>({event:t,properties:r})=>console.log(bc,t,r,e);var Fb=Sc(W$(import.meta.filename),"transforms"),jb=Rc(),Bb=z$(import.meta.url),go=Bb("../package.json"),Ub=await $b(),Gb=Mb({...Ub});Z$();jb.version(go.version).help().command("[transformName] [...paths]","\uCF54\uB4DC \uBCC0\uD658 (codemod)").option("-l, --list","\uC0AC\uC6A9 \uAC00\uB2A5\uD55C transform \uBAA9\uB85D\uC744 \uBCF4\uC5EC\uC918\uC694").option("--log","\uB85C\uADF8\uB97C \uD30C\uC77C\uB85C \uC800\uC7A5\uD574\uC694").option("--no-track","\uC0AC\uC6A9 \uD1B5\uACC4\uB97C \uC218\uC9D1\uD558\uC9C0 \uC54A\uC544\uC694").option("-p, --parser <parser>","jscodeshift\uAC00 \uC0AC\uC6A9\uD560 \uD30C\uC11C\uB97C \uC9C0\uC815\uD574\uC694 (babel|babylon|flow|ts|tsx)",{default:"tsx"}).option("--reporter","\uBCC0\uD658 \uACB0\uACFC\uB97C \uD30C\uC77C\uB85C \uC800\uC7A5\uD574\uC694").option("--extensions <extensions>","\uBCC0\uD658\uD560 \uD30C\uC77C \uD655\uC7A5\uC790").option("--ignore-config <ignoreConfig>","Ignore config").example(" $ npx @seed-design/codemod migrate-icons src/ui").action(async(e,t,r)=>{let n=Fh.parse(r);n.track&&Gb?.({event:"\uC2E4\uD589",properties:{transformName:e,paths:t}});let s=Y$();n.list&&(wc(s),process.exit(0)),e||(console.error("transform \uC774\uB984\uC744 \uC785\uB825\uD574\uC8FC\uC138\uC694"),wc(s),process.exit(1)),s.includes(e)||(console.error(`\uC774\uB984\uC774 ${e}\uC778 transform\uC774 \uC5C6\uC5B4\uC694`),wc(s),process.exit(1)),t.length===0&&(console.error("\uD30C\uC77C \uACBD\uB85C\uB97C \uC785\uB825\uD574\uC8FC\uC138\uC694"),process.exit(1));let o=Sc(Fb,e,"index.mjs");console.log(bc,`${t.join(", ")}\uC5D0 ${e} transform\uC744 \uC2E4\uD589\uD574\uC694.`),await H$(o,e,t,n)});jb.parse();function Z$(){(0,yo.satisfies)(process.versions.node,go.engines.node)===!1&&(console.error(`Node.js \uBC84\uC804 \uC694\uAD6C\uC0AC\uD56D\uC744 \uB9CC\uC871\uC2DC\uD0A4\uC9C0 \uC54A\uC544\uC694: "${go.engines.node}"
|
60
60
|
Node.js \uBC84\uC804\uC744 \uC5C5\uADF8\uB808\uC774\uB4DC\uD574\uC8FC\uC138\uC694.
|
61
61
|
\uD604\uC7AC \uBC84\uC804: ${process.versions.node}
|
62
62
|
|
63
|
-
$ nvm install ${(0,yo.minVersion)(go.engines.node)}`),process.exit(1))}async function H$(e,t,r){let{log:
|
64
|
-
${
|
63
|
+
$ nvm install ${(0,yo.minVersion)(go.engines.node)}`),process.exit(1))}async function H$(e,t,r,n){let{log:s,parser:o,extensions:i,ignoreConfig:a,reporter:c,track:u}=n,l=Bb.resolve("jscodeshift/bin/jscodeshift"),p=r.map(d=>Sc(process.cwd(),d)).join(" ");if(t==="replace-css-color-variable"){(await import(e)).processCssFiles(r,n);return}u&&Gb?.({event:"transform \uC2E4\uD589",properties:{transformPath:e,fixedPathsCombined:p,options:n}}),await Dp({stdout:"inherit",env:{LOG:`${s}`,TRACK:`${u}`,GIT_INFO:JSON.stringify(Ub)}})`
|
64
|
+
${l} ${p}
|
65
65
|
-t ${e}
|
66
|
-
--parser=${
|
66
|
+
--parser=${o}
|
67
67
|
--ignore-pattern=**/*.d.ts
|
68
|
-
${
|
69
|
-
${
|
70
|
-
${
|
68
|
+
${c?`--reporter=${c}`:""}
|
69
|
+
${i?`--extensions=${i}`:""}
|
70
|
+
${a?`--ignore-config=${a}`:""}`}function Y$(){return V$(Fb)}function wc(e){console.log(`
|
71
71
|
\uC0AC\uC6A9 \uAC00\uB2A5\uD55C transform \uBAA9\uB85D:
|
72
72
|
`,e.join(`
|
73
73
|
`))}
|
@@ -1,16 +1,17 @@
|
|
1
|
-
var R=[{previous:"$semantic.color.on-primary",next:["$color.palette.static-white"]},{previous:"$semantic.color.primary",next:["$color.bg.brand-solid","$color.fg.brand"],alternative:["$color.palette.carrot-600"]},{previous:"$semantic.color.primary-low",next:["$color.palette.carrot-100"]},{previous:"$semantic.color.secondary",next:["$color.palette.gray-900"]},{previous:"$semantic.color.secondary-low",next:["$color.bg.neutral-weak"],alternative:["$color.palette.gray-200"]},{previous:"$semantic.color.success",next:["$color.bg.positive-solid","$color.fg.positive"],alternative:["$color.fg.positive-contrast","$color.palette.green-700"]},{previous:"$semantic.color.success-low",next:["$color.bg.positive-weak"],alternative:["$color.palette.green-100"]},{previous:"$semantic.color.warning",next:["$color.bg.warning-solid"],alternative:["$color.fg.warning-contrast","$color.palette.yellow-500"]},{previous:"$semantic.color.warning-low",next:["$color.bg.warning-weak"],alternative:["$color.palette.yellow-100"]},{previous:"$semantic.color.danger",next:["$color.bg.critical-solid","$color.fg.critical"],alternative:["$color.fg.critical-contrast","$color.palette.red-700"]},{previous:"$semantic.color.danger-low",next:["$color.bg.critical-weak"],alternative:["$color.palette.red-100"]},{previous:"$semantic.color.overlay-dim",next:["$color.bg.overlay"],alternative:["$color.palette.static-black-alpha-500"]},{previous:"$semantic.color.overlay-low",next:["$color.bg.overlay-muted"],alternative:["$color.palette.static-black-alpha-200"]},{previous:"$semantic.color.paper-sheet",next:["$color.bg.layer-floating"],alternative:["$color.palette.gray-00"]},{previous:"$semantic.color.paper-dialog",next:["$color.bg.layer-floating"],alternative:["$color.palette.gray-00"]},{previous:"$semantic.color.paper-floating",next:["$color.bg.layer-floating"],alternative:["$color.palette.gray-00"]},{previous:"$semantic.color.paper-contents",next:["$color.bg.layer-fill"],alternative:["$color.palette.gray-100"]},{previous:"$semantic.color.paper-default",next:["$color.bg.layer-default"],alternative:["$color.palette.gray-00"]},{previous:"$semantic.color.paper-background",next:["$color.bg.layer-basement"],alternative:["$color.palette.gray-200"]},{previous:"$semantic.color.paper-accent",next:["$color.palette.carrot-100"]},{previous:"$semantic.color.primary-hover",next:["$color.bg.brand-solid-pressed"],alternative:["$color.palette.carrot-700"]},{previous:"$semantic.color.primary-pressed",next:["$color.bg.brand-solid-pressed"],alternative:["$color.palette.carrot-700"]},{previous:"$semantic.color.primary-low-hover",next:["$color.palette.carrot-200"]},{previous:"$semantic.color.primary-low-active",next:["$color.palette.carrot-100"]},{previous:"$semantic.color.primary-low-pressed",next:["$color.palette.carrot-200"]},{previous:"$semantic.color.gray-hover",next:["$color.bg.neutral-weak-pressed"],alternative:["$color.palette.gray-300"]},{previous:"$semantic.color.gray-pressed",next:["$color.bg.neutral-weak-pressed"],alternative:["$color.palette.gray-300"]},{previous:"$semantic.color.on-primary-overlay-50",next:[],description:"TBD"},{previous:"$semantic.color.on-primary-overlay-200",next:[],description:"TBD"},{previous:"$semantic.color.on-primary-low-overlay-50",next:[],description:"TBD"},{previous:"$semantic.color.on-primary-low-overlay-100",next:[],description:"TBD"},{previous:"$semantic.color.on-primary-low-overlay-200",next:[],description:"TBD"},{previous:"$semantic.color.on-gray-overlay-50",next:[],description:"TBD"},{previous:"$semantic.color.on-gray-overlay-100",next:[],description:"TBD"},{previous:"$semantic.color.divider-1",next:["$color.stroke.on-image"],alternative:["$color.palette.static-black-alpha-50"]},{previous:"$semantic.color.divider-2",next:["$color.stroke.neutral"],alternative:["$color.palette.gray-300"]},{previous:"$semantic.color.divider-3",next:["$color.palette.gray-400"]},{previous:"$semantic.color.accent",next:["$color.bg.informative-solid","$color.fg.informative"],alternative:["$color.fg.informative-contrast","$color.palette.blue-700"]},{previous:"$semantic.color.ink-text",next:["$color.fg.neutral"],alternative:["$color.palette.gray-1000"]},{previous:"$semantic.color.ink-text-low",next:["$color.fg.neutral-subtle"],alternative:["$color.palette.gray-700"]},{previous:"$semantic.color.gray-active",next:["$color.fg.neutral-muted"],alternative:["$color.palette.gray-800"]}],F=[{previous:"$scale.color.gray-00",next:["$color.palette.gray-00"]},{previous:"$scale.color.gray-50",next:["$color.palette.gray-100"]},{previous:"$scale.color.gray-100",next:["$color.palette.gray-200"]},{previous:"$scale.color.gray-200",next:["$color.palette.gray-300"]},{previous:"$scale.color.gray-300",next:["$color.palette.gray-400"]},{previous:"$scale.color.gray-400",next:["$color.palette.gray-500"]},{previous:"$scale.color.gray-500",next:["$color.palette.gray-600"]},{previous:"$scale.color.gray-600",next:["$color.palette.gray-700"]},{previous:"$scale.color.gray-700",next:["$color.palette.gray-800"]},{previous:"$scale.color.gray-800",next:["$color.palette.gray-900"]},{previous:"$scale.color.gray-900",next:["$color.palette.gray-1000"]},{previous:"$scale.color.gray-alpha-50",next:["$color.palette.gray-200","$color.stroke.on-image"]},{previous:"$scale.color.gray-alpha-100",next:["$color.palette.gray-300"]},{previous:"$scale.color.gray-alpha-200",next:["$color.palette.gray-500"]},{previous:"$scale.color.gray-alpha-500",next:["$color.palette.gray-700"]},{previous:"$scale.color.carrot-50",next:["$color.palette.carrot-100"]},{previous:"$scale.color.carrot-100",next:["$color.palette.carrot-200"]},{previous:"$scale.color.carrot-200",next:["$color.palette.carrot-300"]},{previous:"$scale.color.carrot-300",next:["$color.palette.carrot-400"]},{previous:"$scale.color.carrot-400",next:["$color.palette.carrot-500"]},{previous:"$scale.color.carrot-500",next:["$color.palette.carrot-600"]},{previous:"$scale.color.carrot-600",next:["$color.palette.carrot-600"]},{previous:"$scale.color.carrot-700",next:["$color.palette.carrot-700"]},{previous:"$scale.color.carrot-800",next:["$color.palette.carrot-700"]},{previous:"$scale.color.carrot-900",next:["$color.palette.carrot-800"]},{previous:"$scale.color.carrot-950",next:["$color.palette.carrot-800"]},{previous:"$scale.color.carrot-alpha-50",next:["$color.palette.carrot-100"]},{previous:"$scale.color.carrot-alpha-100",next:["$color.palette.carrot-200"]},{previous:"$scale.color.carrot-alpha-200",next:["$color.palette.carrot-200"]},{previous:"$scale.color.blue-50",next:["$color.palette.blue-100"]},{previous:"$scale.color.blue-100",next:["$color.palette.blue-200"]},{previous:"$scale.color.blue-200",next:["$color.palette.blue-300"]},{previous:"$scale.color.blue-300",next:["$color.palette.blue-400"]},{previous:"$scale.color.blue-400",next:["$color.palette.blue-400"]},{previous:"$scale.color.blue-500",next:["$color.palette.blue-600"]},{previous:"$scale.color.blue-600",next:["$color.palette.blue-600"]},{previous:"$scale.color.blue-700",next:["$color.palette.blue-800"]},{previous:"$scale.color.blue-800",next:["$color.palette.blue-900"]},{previous:"$scale.color.blue-900",next:["$color.palette.blue-900"]},{previous:"$scale.color.blue-950",next:["$color.palette.blue-1000"]},{previous:"$scale.color.blue-alpha-50",next:["$color.palette.blue-100"]},{previous:"$scale.color.blue-alpha-100",next:["$color.palette.blue-100"]},{previous:"$scale.color.blue-alpha-200",next:["$color.palette.blue-200"]},{previous:"$scale.color.red-50",next:["$color.palette.red-100"]},{previous:"$scale.color.red-100",next:["$color.palette.red-200"]},{previous:"$scale.color.red-200",next:["$color.palette.red-300"]},{previous:"$scale.color.red-300",next:["$color.palette.red-400"]},{previous:"$scale.color.red-400",next:["$color.palette.red-600"]},{previous:"$scale.color.red-500",next:["$color.palette.red-700"]},{previous:"$scale.color.red-600",next:["$color.palette.red-700"]},{previous:"$scale.color.red-700",next:["$color.palette.red-800"]},{previous:"$scale.color.red-800",next:["$color.palette.red-900"]},{previous:"$scale.color.red-900",next:["$color.palette.red-900"]},{previous:"$scale.color.red-950",next:["$color.palette.red-900"]},{previous:"$scale.color.red-alpha-50",next:["$color.palette.red-100"]},{previous:"$scale.color.red-alpha-100",next:["$color.palette.red-200"]},{previous:"$scale.color.red-alpha-200",next:["$color.palette.red-300"]},{previous:"$scale.color.green-50",next:["$color.palette.green-100"]},{previous:"$scale.color.green-100",next:["$color.palette.green-200"]},{previous:"$scale.color.green-200",next:["$color.palette.green-300"]},{previous:"$scale.color.green-300",next:["$color.palette.green-400"]},{previous:"$scale.color.green-400",next:["$color.palette.green-500"]},{previous:"$scale.color.green-500",next:["$color.palette.green-600"]},{previous:"$scale.color.green-600",next:["$color.palette.green-700"]},{previous:"$scale.color.green-700",next:["$color.palette.green-800"]},{previous:"$scale.color.green-800",next:["$color.palette.green-900"]},{previous:"$scale.color.green-900",next:["$color.palette.green-900"]},{previous:"$scale.color.green-950",next:["$color.palette.green-900"]},{previous:"$scale.color.green-alpha-50",next:["$color.palette.green-100"]},{previous:"$scale.color.green-alpha-100",next:["$color.palette.green-200"]},{previous:"$scale.color.green-alpha-200",next:["$color.palette.green-200"]},{previous:"$scale.color.yellow-50",next:["$color.palette.yellow-100"]},{previous:"$scale.color.yellow-100",next:["$color.palette.yellow-200"]},{previous:"$scale.color.yellow-200",next:["$color.palette.yellow-300"]},{previous:"$scale.color.yellow-300",next:["$color.palette.yellow-400"]},{previous:"$scale.color.yellow-400",next:["$color.palette.yellow-500"]},{previous:"$scale.color.yellow-500",next:["$color.palette.yellow-700"]},{previous:"$scale.color.yellow-600",next:["$color.palette.yellow-700"]},{previous:"$scale.color.yellow-700",next:["$color.palette.yellow-800"]},{previous:"$scale.color.yellow-800",next:["$color.palette.yellow-800"]},{previous:"$scale.color.yellow-900",next:["$color.palette.yellow-900"]},{previous:"$scale.color.yellow-950",next:["$color.palette.yellow-900"]},{previous:"$scale.color.yellow-alpha-50",next:["$color.palette.yellow-100"]},{previous:"$scale.color.yellow-alpha-100",next:["$color.palette.yellow-100"]},{previous:"$scale.color.yellow-alpha-200",next:["$color.palette.yellow-100"]},{previous:"$scale.color.purple-50",next:["$color.palette.purple-100"]},{previous:"$scale.color.purple-100",next:["$color.palette.purple-300"]},{previous:"$scale.color.purple-200",next:["$color.palette.purple-400"]},{previous:"$scale.color.purple-300",next:["$color.palette.purple-400"]},{previous:"$scale.color.purple-400",next:["$color.palette.purple-500"]},{previous:"$scale.color.purple-500",next:["$color.palette.purple-600"]},{previous:"$scale.color.purple-600",next:["$color.palette.purple-700"]},{previous:"$scale.color.purple-700",next:["$color.palette.purple-800"]},{previous:"$scale.color.purple-800",next:["$color.palette.purple-900"]},{previous:"$scale.color.purple-900",next:["$color.palette.purple-900"]},{previous:"$scale.color.purple-950",next:["$color.palette.purple-1000"]}],j=[{previous:"$static.color.static-black",next:["$color.palette.static-black"]},{previous:"$static.color.static-white",next:["$color.palette.static-white"]},{previous:"$static.color.static-gray-900",next:["$color.palette.gray-1000"]},{previous:"$static.color.static-carrot-50",next:["$color.palette.carrot-100"]},{previous:"$static.color.static-carrot-800",next:["$color.palette.carrot-700"]},{previous:"$static.color.static-green-50",next:["$color.palette.green-100"]},{previous:"$static.color.static-green-800",next:["$color.palette.green-700"]},{previous:"$static.color.static-yellow-50",next:["$color.palette.yellow-100"]},{previous:"$static.color.static-yellow-800",next:["$color.palette.yellow-800"]},{previous:"$static.color.static-red-50",next:["$color.palette.red-100"]},{previous:"$static.color.static-red-800",next:["$color.palette.red-700"]},{previous:"$static.color.static-blue-50",next:["$color.palette.blue-100"]},{previous:"$static.color.static-blue-800",next:["$color.palette.blue-700"]},{previous:"$static.color.static-black-alpha-200",next:["$color.palette.static-black-alpha-200"]},{previous:"$static.color.static-black-alpha-500",next:["$color.palette.static-black-alpha-500"]},{previous:"$static.color.static-white-alpha-50",next:[],description:"deleted"},{previous:"$static.color.static-white-alpha-200",next:["$color.palette.static-white-alpha-200"]}],k=[...R,...F,...j];import*as p from"fs";import*as $ from"path";var f=class{timestamp;fileMigrations=[];currentFile=null;reportDir=$.join(process.cwd(),".report");transformName;constructor(e){this.transformName=e,this.timestamp=this.generateTimestamp()}generateTimestamp(){return new Date(new Date().getTime()+324e5).toISOString()}getReportPath(){return $.join(this.reportDir,`${this.transformName}.md`)}getRelativePath(e){if(!e)return"unknown";try{let r=$.resolve(e);return $.relative(this.reportDir,r)}catch{return"unknown"}}startNewFile(e){this.currentFile={filePath:this.getRelativePath(e),results:[]}}addResult(e){this.currentFile&&this.currentFile.results.push(e)}finishFile(){this.currentFile&&this.currentFile.results.length>0&&this.fileMigrations.push(this.currentFile),this.currentFile=null}hasResults(){return this.fileMigrations.length>0}writeReport(){if(!this.hasResults())return;p.existsSync(this.reportDir)||p.mkdirSync(this.reportDir,{recursive:!0});let e=this.getReportPath(),r=p.existsSync(e)?p.readFileSync(e,"utf8"):"",s=this.fileMigrations.map(l=>{let g=$.basename(l.filePath),i=l.results.map(t=>{let a=t.line?` (line: ${t.line})`:"",n=t.status==="success"?"\u2705":"\u274C",x=t.failureReason?`
|
2
|
-
- reason: ${
|
3
|
-
- as-is: \`${
|
4
|
-
- to-be: ${
|
5
|
-
`);return`### [${
|
1
|
+
var R=[{previous:"$semantic.color.on-primary",next:["$color.palette.static-white"]},{previous:"$semantic.color.primary",next:["$color.bg.brand-solid","$color.fg.brand"],alternative:["$color.palette.carrot-600"]},{previous:"$semantic.color.primary-low",next:["$color.palette.carrot-100"]},{previous:"$semantic.color.secondary",next:["$color.palette.gray-900"]},{previous:"$semantic.color.secondary-low",next:["$color.bg.neutral-weak"],alternative:["$color.palette.gray-200"]},{previous:"$semantic.color.success",next:["$color.bg.positive-solid","$color.fg.positive"],alternative:["$color.fg.positive-contrast","$color.palette.green-700"]},{previous:"$semantic.color.success-low",next:["$color.bg.positive-weak"],alternative:["$color.palette.green-100"]},{previous:"$semantic.color.warning",next:["$color.bg.warning-solid"],alternative:["$color.fg.warning-contrast","$color.palette.yellow-500"]},{previous:"$semantic.color.warning-low",next:["$color.bg.warning-weak"],alternative:["$color.palette.yellow-100"]},{previous:"$semantic.color.danger",next:["$color.bg.critical-solid","$color.fg.critical"],alternative:["$color.fg.critical-contrast","$color.palette.red-700"]},{previous:"$semantic.color.danger-low",next:["$color.bg.critical-weak"],alternative:["$color.palette.red-100"]},{previous:"$semantic.color.overlay-dim",next:["$color.bg.overlay"],alternative:["$color.palette.static-black-alpha-500"]},{previous:"$semantic.color.overlay-low",next:["$color.bg.overlay-muted"],alternative:["$color.palette.static-black-alpha-200"]},{previous:"$semantic.color.paper-sheet",next:["$color.bg.layer-floating"],alternative:["$color.palette.gray-00"]},{previous:"$semantic.color.paper-dialog",next:["$color.bg.layer-floating"],alternative:["$color.palette.gray-00"]},{previous:"$semantic.color.paper-floating",next:["$color.bg.layer-floating"],alternative:["$color.palette.gray-00"]},{previous:"$semantic.color.paper-contents",next:["$color.bg.layer-fill"],alternative:["$color.palette.gray-100"]},{previous:"$semantic.color.paper-default",next:["$color.bg.layer-default"],alternative:["$color.palette.gray-00"]},{previous:"$semantic.color.paper-background",next:["$color.bg.layer-basement"],alternative:["$color.palette.gray-200"]},{previous:"$semantic.color.paper-accent",next:["$color.palette.carrot-100"]},{previous:"$semantic.color.primary-hover",next:["$color.bg.brand-solid-pressed"],alternative:["$color.palette.carrot-700"]},{previous:"$semantic.color.primary-pressed",next:["$color.bg.brand-solid-pressed"],alternative:["$color.palette.carrot-700"]},{previous:"$semantic.color.primary-low-hover",next:["$color.palette.carrot-200"]},{previous:"$semantic.color.primary-low-active",next:["$color.palette.carrot-100"]},{previous:"$semantic.color.primary-low-pressed",next:["$color.palette.carrot-200"]},{previous:"$semantic.color.gray-hover",next:["$color.bg.neutral-weak-pressed"],alternative:["$color.palette.gray-300"]},{previous:"$semantic.color.gray-pressed",next:["$color.bg.neutral-weak-pressed"],alternative:["$color.palette.gray-300"]},{previous:"$semantic.color.on-primary-overlay-50",next:[],description:"TBD"},{previous:"$semantic.color.on-primary-overlay-200",next:[],description:"TBD"},{previous:"$semantic.color.on-primary-low-overlay-50",next:[],description:"TBD"},{previous:"$semantic.color.on-primary-low-overlay-100",next:[],description:"TBD"},{previous:"$semantic.color.on-primary-low-overlay-200",next:[],description:"TBD"},{previous:"$semantic.color.on-gray-overlay-50",next:[],description:"TBD"},{previous:"$semantic.color.on-gray-overlay-100",next:[],description:"TBD"},{previous:"$semantic.color.divider-1",next:["$color.stroke.on-image"],alternative:["$color.palette.static-black-alpha-50"]},{previous:"$semantic.color.divider-2",next:["$color.stroke.neutral"],alternative:["$color.palette.gray-300"]},{previous:"$semantic.color.divider-3",next:["$color.palette.gray-400"]},{previous:"$semantic.color.accent",next:["$color.bg.informative-solid","$color.fg.informative"],alternative:["$color.fg.informative-contrast","$color.palette.blue-700"]},{previous:"$semantic.color.ink-text",next:["$color.fg.neutral"],alternative:["$color.palette.gray-1000"]},{previous:"$semantic.color.ink-text-low",next:["$color.fg.neutral-subtle"],alternative:["$color.palette.gray-700"]},{previous:"$semantic.color.gray-active",next:["$color.fg.neutral-muted"],alternative:["$color.palette.gray-800"]}],F=[{previous:"$scale.color.gray-00",next:["$color.palette.gray-00"]},{previous:"$scale.color.gray-50",next:["$color.palette.gray-100"]},{previous:"$scale.color.gray-100",next:["$color.palette.gray-200"]},{previous:"$scale.color.gray-200",next:["$color.palette.gray-300"]},{previous:"$scale.color.gray-300",next:["$color.palette.gray-400"]},{previous:"$scale.color.gray-400",next:["$color.palette.gray-500"]},{previous:"$scale.color.gray-500",next:["$color.palette.gray-600"]},{previous:"$scale.color.gray-600",next:["$color.palette.gray-700"]},{previous:"$scale.color.gray-700",next:["$color.palette.gray-800"]},{previous:"$scale.color.gray-800",next:["$color.palette.gray-900"]},{previous:"$scale.color.gray-900",next:["$color.palette.gray-1000"]},{previous:"$scale.color.gray-alpha-50",next:["$color.palette.gray-200","$color.stroke.on-image"]},{previous:"$scale.color.gray-alpha-100",next:["$color.palette.gray-300"]},{previous:"$scale.color.gray-alpha-200",next:["$color.palette.gray-500"]},{previous:"$scale.color.gray-alpha-500",next:["$color.palette.gray-700"]},{previous:"$scale.color.carrot-50",next:["$color.palette.carrot-100"]},{previous:"$scale.color.carrot-100",next:["$color.palette.carrot-200"]},{previous:"$scale.color.carrot-200",next:["$color.palette.carrot-300"]},{previous:"$scale.color.carrot-300",next:["$color.palette.carrot-400"]},{previous:"$scale.color.carrot-400",next:["$color.palette.carrot-500"]},{previous:"$scale.color.carrot-500",next:["$color.palette.carrot-600"]},{previous:"$scale.color.carrot-600",next:["$color.palette.carrot-600"]},{previous:"$scale.color.carrot-700",next:["$color.palette.carrot-700"]},{previous:"$scale.color.carrot-800",next:["$color.palette.carrot-700"]},{previous:"$scale.color.carrot-900",next:["$color.palette.carrot-800"]},{previous:"$scale.color.carrot-950",next:["$color.palette.carrot-800"]},{previous:"$scale.color.carrot-alpha-50",next:["$color.palette.carrot-100"]},{previous:"$scale.color.carrot-alpha-100",next:["$color.palette.carrot-200"]},{previous:"$scale.color.carrot-alpha-200",next:["$color.palette.carrot-200"]},{previous:"$scale.color.blue-50",next:["$color.palette.blue-100"]},{previous:"$scale.color.blue-100",next:["$color.palette.blue-200"]},{previous:"$scale.color.blue-200",next:["$color.palette.blue-300"]},{previous:"$scale.color.blue-300",next:["$color.palette.blue-400"]},{previous:"$scale.color.blue-400",next:["$color.palette.blue-400"]},{previous:"$scale.color.blue-500",next:["$color.palette.blue-600"]},{previous:"$scale.color.blue-600",next:["$color.palette.blue-600"]},{previous:"$scale.color.blue-700",next:["$color.palette.blue-800"]},{previous:"$scale.color.blue-800",next:["$color.palette.blue-900"]},{previous:"$scale.color.blue-900",next:["$color.palette.blue-900"]},{previous:"$scale.color.blue-950",next:["$color.palette.blue-1000"]},{previous:"$scale.color.blue-alpha-50",next:["$color.palette.blue-100"]},{previous:"$scale.color.blue-alpha-100",next:["$color.palette.blue-100"]},{previous:"$scale.color.blue-alpha-200",next:["$color.palette.blue-200"]},{previous:"$scale.color.red-50",next:["$color.palette.red-100"]},{previous:"$scale.color.red-100",next:["$color.palette.red-200"]},{previous:"$scale.color.red-200",next:["$color.palette.red-300"]},{previous:"$scale.color.red-300",next:["$color.palette.red-400"]},{previous:"$scale.color.red-400",next:["$color.palette.red-600"]},{previous:"$scale.color.red-500",next:["$color.palette.red-700"]},{previous:"$scale.color.red-600",next:["$color.palette.red-700"]},{previous:"$scale.color.red-700",next:["$color.palette.red-800"]},{previous:"$scale.color.red-800",next:["$color.palette.red-900"]},{previous:"$scale.color.red-900",next:["$color.palette.red-900"]},{previous:"$scale.color.red-950",next:["$color.palette.red-900"]},{previous:"$scale.color.red-alpha-50",next:["$color.palette.red-100"]},{previous:"$scale.color.red-alpha-100",next:["$color.palette.red-200"]},{previous:"$scale.color.red-alpha-200",next:["$color.palette.red-300"]},{previous:"$scale.color.green-50",next:["$color.palette.green-100"]},{previous:"$scale.color.green-100",next:["$color.palette.green-200"]},{previous:"$scale.color.green-200",next:["$color.palette.green-300"]},{previous:"$scale.color.green-300",next:["$color.palette.green-400"]},{previous:"$scale.color.green-400",next:["$color.palette.green-500"]},{previous:"$scale.color.green-500",next:["$color.palette.green-600"]},{previous:"$scale.color.green-600",next:["$color.palette.green-700"]},{previous:"$scale.color.green-700",next:["$color.palette.green-800"]},{previous:"$scale.color.green-800",next:["$color.palette.green-900"]},{previous:"$scale.color.green-900",next:["$color.palette.green-900"]},{previous:"$scale.color.green-950",next:["$color.palette.green-900"]},{previous:"$scale.color.green-alpha-50",next:["$color.palette.green-100"]},{previous:"$scale.color.green-alpha-100",next:["$color.palette.green-200"]},{previous:"$scale.color.green-alpha-200",next:["$color.palette.green-200"]},{previous:"$scale.color.yellow-50",next:["$color.palette.yellow-100"]},{previous:"$scale.color.yellow-100",next:["$color.palette.yellow-200"]},{previous:"$scale.color.yellow-200",next:["$color.palette.yellow-300"]},{previous:"$scale.color.yellow-300",next:["$color.palette.yellow-400"]},{previous:"$scale.color.yellow-400",next:["$color.palette.yellow-500"]},{previous:"$scale.color.yellow-500",next:["$color.palette.yellow-700"]},{previous:"$scale.color.yellow-600",next:["$color.palette.yellow-700"]},{previous:"$scale.color.yellow-700",next:["$color.palette.yellow-800"]},{previous:"$scale.color.yellow-800",next:["$color.palette.yellow-800"]},{previous:"$scale.color.yellow-900",next:["$color.palette.yellow-900"]},{previous:"$scale.color.yellow-950",next:["$color.palette.yellow-900"]},{previous:"$scale.color.yellow-alpha-50",next:["$color.palette.yellow-100"]},{previous:"$scale.color.yellow-alpha-100",next:["$color.palette.yellow-100"]},{previous:"$scale.color.yellow-alpha-200",next:["$color.palette.yellow-100"]},{previous:"$scale.color.purple-50",next:["$color.palette.purple-100"]},{previous:"$scale.color.purple-100",next:["$color.palette.purple-300"]},{previous:"$scale.color.purple-200",next:["$color.palette.purple-400"]},{previous:"$scale.color.purple-300",next:["$color.palette.purple-400"]},{previous:"$scale.color.purple-400",next:["$color.palette.purple-500"]},{previous:"$scale.color.purple-500",next:["$color.palette.purple-600"]},{previous:"$scale.color.purple-600",next:["$color.palette.purple-700"]},{previous:"$scale.color.purple-700",next:["$color.palette.purple-800"]},{previous:"$scale.color.purple-800",next:["$color.palette.purple-900"]},{previous:"$scale.color.purple-900",next:["$color.palette.purple-900"]},{previous:"$scale.color.purple-950",next:["$color.palette.purple-1000"]}],j=[{previous:"$static.color.static-black",next:["$color.palette.static-black"]},{previous:"$static.color.static-white",next:["$color.palette.static-white"]},{previous:"$static.color.static-gray-900",next:[],description:"static \uC0C9\uC0C1 \uC0AC\uC6A9 \uD655\uC778\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."},{previous:"$static.color.static-carrot-50",next:[],description:"static \uC0C9\uC0C1 \uC0AC\uC6A9 \uD655\uC778\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."},{previous:"$static.color.static-carrot-800",next:[],description:"static \uC0C9\uC0C1 \uC0AC\uC6A9 \uD655\uC778\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."},{previous:"$static.color.static-green-50",next:[],description:"static \uC0C9\uC0C1 \uC0AC\uC6A9 \uD655\uC778\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."},{previous:"$static.color.static-green-800",next:[],description:"static \uC0C9\uC0C1 \uC0AC\uC6A9 \uD655\uC778\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."},{previous:"$static.color.static-yellow-50",next:[],description:"static \uC0C9\uC0C1 \uC0AC\uC6A9 \uD655\uC778\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."},{previous:"$static.color.static-yellow-800",next:[],description:"static \uC0C9\uC0C1 \uC0AC\uC6A9 \uD655\uC778\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."},{previous:"$static.color.static-red-50",next:[],description:"static \uC0C9\uC0C1 \uC0AC\uC6A9 \uD655\uC778\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."},{previous:"$static.color.static-red-800",next:[],description:"static \uC0C9\uC0C1 \uC0AC\uC6A9 \uD655\uC778\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."},{previous:"$static.color.static-blue-50",next:[],description:"static \uC0C9\uC0C1 \uC0AC\uC6A9 \uD655\uC778\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."},{previous:"$static.color.static-blue-800",next:[],description:"static \uC0C9\uC0C1 \uC0AC\uC6A9 \uD655\uC778\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."},{previous:"$static.color.static-black-alpha-200",next:["$color.palette.static-black-alpha-200"]},{previous:"$static.color.static-black-alpha-500",next:["$color.palette.static-black-alpha-500"]},{previous:"$static.color.static-white-alpha-50",next:[],description:"static \uC0C9\uC0C1 \uC0AC\uC6A9 \uD655\uC778\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."},{previous:"$static.color.static-white-alpha-200",next:["$color.palette.static-white-alpha-200"]}],I=[...R,...F,...j];import*as v from"fs";import*as m from"path";var b=class{timestamp;fileMigrations=[];currentFile=null;reportDir=m.join(process.cwd(),".report");transformName;constructor(e){this.transformName=e,this.timestamp=this.generateTimestamp()}generateTimestamp(){return new Date(new Date().getTime()+324e5).toISOString()}getReportPath(){return m.join(this.reportDir,`${this.transformName}.md`)}getRelativePath(e){if(!e)return"unknown";try{let t=m.resolve(e);return m.relative(this.reportDir,t)}catch{return"unknown"}}startNewFile(e){this.currentFile={filePath:this.getRelativePath(e),results:[]}}addResult(e){this.currentFile&&this.currentFile.results.push(e)}finishFile(){this.currentFile&&this.currentFile.results.length>0&&this.fileMigrations.push(this.currentFile),this.currentFile=null}hasResults(){return this.fileMigrations.length>0}writeReport(){if(!this.hasResults())return;v.existsSync(this.reportDir)||v.mkdirSync(this.reportDir,{recursive:!0});let e=this.getReportPath(),t=v.existsSync(e)?v.readFileSync(e,"utf8"):"",$=this.fileMigrations.map(l=>{let n=m.basename(l.filePath),c=l.results.map(o=>{let u=o.line?` (line: ${o.line})`:"",f=o.status==="success"?"\u2705 success":o.status==="warning"?"\u26A0\uFE0F warning":"\u274C failure",y=o.failureReason?`
|
2
|
+
- reason: ${o.failureReason}`:"";return` - ${f} ${u}
|
3
|
+
- as-is: \`${o.previousToken}\`
|
4
|
+
- to-be: ${o.nextToken?`\`${o.nextToken}\``:"undefined"}${y}`}).join(`
|
5
|
+
`);return`### [${n}](${l.filePath})
|
6
6
|
- timestamp: ${this.timestamp}
|
7
7
|
- summary:
|
8
8
|
- total: ${l.results.length}
|
9
|
-
- success: ${l.results.filter(
|
10
|
-
-
|
9
|
+
- success: ${l.results.filter(o=>o.status==="success").length}
|
10
|
+
- warning: ${l.results.filter(o=>o.status==="warning").length}
|
11
|
+
- failure: ${l.results.filter(o=>o.status==="failure").length}
|
11
12
|
- lines
|
12
|
-
${
|
13
|
+
${c}`}).join(`
|
13
14
|
|
14
|
-
`);
|
15
|
+
`);v.writeFileSync(e,t+(t?`
|
15
16
|
|
16
|
-
`:"")
|
17
|
+
`:"")+$)}};function N(r,e,t,$,g){if(!$)return;let l=e.find(r.ImportDeclaration,{source:{value:"@seed-design/design-token"}});if(l.length===0)return;let n=e.get().node.comments||[];if(g||t){if(l.forEach(o=>{let u=o.node.comments||[],f=o.node.specifiers?.filter(a=>a.type==="ImportSpecifier"&&a.imported.name==="vars"),y=o.node.specifiers?.filter(a=>!(a.type==="ImportSpecifier"&&a.imported.name==="vars"))||[];o.node.specifiers=[...y,...f?.length?[r.importSpecifier(r.identifier("vars"),r.identifier("legacyVars"))]:[]],o.node.comments=u}),e.find(r.ImportDeclaration,{source:{value:"@seed-design/css/vars"}}).length===0){let o=r.importDeclaration([r.importSpecifier(r.identifier("vars"),r.identifier("vars"))],r.literal("@seed-design/css/vars")),u=e.find(r.ImportDeclaration).at(0);u.size()>0?u.insertAfter(o):e.get().node.program.body.unshift(o)}}else l.forEach(c=>{let o=c.node.comments||[];c.node.source.value="@seed-design/css/vars",c.node.comments=o});n.length>0&&(e.get().node.comments=n)}function x(r){let e=[],t=r.node;for(;t.type==="MemberExpression";)t.property.type==="Identifier"&&e.unshift(t.property.name),t=t.object;return t.type==="Identifier"&&e.unshift(t.name),e.join(".")}function w(r,e){let t=e.split("."),$=r.identifier(t[0]);for(let g=1;g<t.length;g++)$=r.memberExpression($,r.identifier(t[g]));return $}function E(r){return r.replace(/^vars\./,"").replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`).replace(/(\d+)/g,"-$1")}function D(r){return`vars.${r.replace(/-(\d+)/g,"$1").replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}`}var P=(r,e,t)=>{let $=t,{reporter:g}=$,l=e.jscodeshift,n=l(r.source),c=null;g&&(c=new b("replace-color-design-token"),c.startNewFile(r.path));let o=new Set,u=!1,f=new Set;if(n.find(l.MemberExpression).filter(a=>x(a).startsWith("vars.")).forEach(a=>{let i=x(a);if(i.startsWith("vars.")&&!i.includes("color")){let p=i.split(".");p.length>=2&&f.add(p[1])}}),n.find(l.MemberExpression).filter(a=>x(a).startsWith("vars.")).forEach(a=>{let i=x(a),p=E(i),s=I.find(d=>d.previous===p),k=a.node.loc?.start.line;if(s){let d=null;if(s.next.length===1)d=s.next[0];else if(s.next.length>1){let M=s.next.filter(h=>h.includes("$color.palette"));if(M.length>0)d=M[0];else if("alternative"in s&&Array.isArray(s.alternative)&&s.alternative.length>0){let h=s.alternative.filter(C=>C.includes("$color.palette"));h.length>0&&(d=h[0])}}if(!d){c&&c.addResult({previousToken:i,nextToken:null,line:k,status:"failure",failureReason:s.next.length===0?"No mapping available":"No palette mapping found"}),o.add(i);return}let T=D(d),S=w(l,T);a.replace(S),u=!0,c&&c.addResult({previousToken:i,nextToken:T,line:k,status:"success"})}}),N(l,n,o.size>0,u,f.size>0),o.size>0&&n.find(l.MemberExpression).filter(a=>{let i=x(a);return o.has(i)}).forEach(a=>{let p=x(a).replace(/^vars\./,"legacyVars."),s=w(l,p);a.replace(s)}),n.find(l.Identifier,{name:"legacyVars"}).length===1){let a=n.get().node.comments||[],i=n.find(l.ImportDeclaration,{source:{value:"@seed-design/design-token"}}),p=[];if(i.forEach(s=>{s.node.comments&&s.node.comments.length>0&&(p=[...p,...s.node.comments])}),i.remove(),p.length>0){let s=n.find(l.ImportDeclaration).at(0);s.size()>0?s.get().node.comments=[...s.get().node.comments||[],...p]:n.get().node.comments=[...a,...p]}}return c&&(c.finishFile(),c.writeReport()),n.toSource({})},Z=P;export{Z as default};
|
@@ -1,16 +1,17 @@
|
|
1
|
-
var b=[{previous:"$semantic.color.on-primary",next:["$color.palette.static-white"]},{previous:"$semantic.color.primary",next:["$color.bg.brand-solid","$color.fg.brand"],alternative:["$color.palette.carrot-600"]},{previous:"$semantic.color.primary-low",next:["$color.palette.carrot-100"]},{previous:"$semantic.color.secondary",next:["$color.palette.gray-900"]},{previous:"$semantic.color.secondary-low",next:["$color.bg.neutral-weak"],alternative:["$color.palette.gray-200"]},{previous:"$semantic.color.success",next:["$color.bg.positive-solid","$color.fg.positive"],alternative:["$color.fg.positive-contrast","$color.palette.green-700"]},{previous:"$semantic.color.success-low",next:["$color.bg.positive-weak"],alternative:["$color.palette.green-100"]},{previous:"$semantic.color.warning",next:["$color.bg.warning-solid"],alternative:["$color.fg.warning-contrast","$color.palette.yellow-500"]},{previous:"$semantic.color.warning-low",next:["$color.bg.warning-weak"],alternative:["$color.palette.yellow-100"]},{previous:"$semantic.color.danger",next:["$color.bg.critical-solid","$color.fg.critical"],alternative:["$color.fg.critical-contrast","$color.palette.red-700"]},{previous:"$semantic.color.danger-low",next:["$color.bg.critical-weak"],alternative:["$color.palette.red-100"]},{previous:"$semantic.color.overlay-dim",next:["$color.bg.overlay"],alternative:["$color.palette.static-black-alpha-500"]},{previous:"$semantic.color.overlay-low",next:["$color.bg.overlay-muted"],alternative:["$color.palette.static-black-alpha-200"]},{previous:"$semantic.color.paper-sheet",next:["$color.bg.layer-floating"],alternative:["$color.palette.gray-00"]},{previous:"$semantic.color.paper-dialog",next:["$color.bg.layer-floating"],alternative:["$color.palette.gray-00"]},{previous:"$semantic.color.paper-floating",next:["$color.bg.layer-floating"],alternative:["$color.palette.gray-00"]},{previous:"$semantic.color.paper-contents",next:["$color.bg.layer-fill"],alternative:["$color.palette.gray-100"]},{previous:"$semantic.color.paper-default",next:["$color.bg.layer-default"],alternative:["$color.palette.gray-00"]},{previous:"$semantic.color.paper-background",next:["$color.bg.layer-basement"],alternative:["$color.palette.gray-200"]},{previous:"$semantic.color.paper-accent",next:["$color.palette.carrot-100"]},{previous:"$semantic.color.primary-hover",next:["$color.bg.brand-solid-pressed"],alternative:["$color.palette.carrot-700"]},{previous:"$semantic.color.primary-pressed",next:["$color.bg.brand-solid-pressed"],alternative:["$color.palette.carrot-700"]},{previous:"$semantic.color.primary-low-hover",next:["$color.palette.carrot-200"]},{previous:"$semantic.color.primary-low-active",next:["$color.palette.carrot-100"]},{previous:"$semantic.color.primary-low-pressed",next:["$color.palette.carrot-200"]},{previous:"$semantic.color.gray-hover",next:["$color.bg.neutral-weak-pressed"],alternative:["$color.palette.gray-300"]},{previous:"$semantic.color.gray-pressed",next:["$color.bg.neutral-weak-pressed"],alternative:["$color.palette.gray-300"]},{previous:"$semantic.color.on-primary-overlay-50",next:[],description:"TBD"},{previous:"$semantic.color.on-primary-overlay-200",next:[],description:"TBD"},{previous:"$semantic.color.on-primary-low-overlay-50",next:[],description:"TBD"},{previous:"$semantic.color.on-primary-low-overlay-100",next:[],description:"TBD"},{previous:"$semantic.color.on-primary-low-overlay-200",next:[],description:"TBD"},{previous:"$semantic.color.on-gray-overlay-50",next:[],description:"TBD"},{previous:"$semantic.color.on-gray-overlay-100",next:[],description:"TBD"},{previous:"$semantic.color.divider-1",next:["$color.stroke.on-image"],alternative:["$color.palette.static-black-alpha-50"]},{previous:"$semantic.color.divider-2",next:["$color.stroke.neutral"],alternative:["$color.palette.gray-300"]},{previous:"$semantic.color.divider-3",next:["$color.palette.gray-400"]},{previous:"$semantic.color.accent",next:["$color.bg.informative-solid","$color.fg.informative"],alternative:["$color.fg.informative-contrast","$color.palette.blue-700"]},{previous:"$semantic.color.ink-text",next:["$color.fg.neutral"],alternative:["$color.palette.gray-1000"]},{previous:"$semantic.color.ink-text-low",next:["$color.fg.neutral-subtle"],alternative:["$color.palette.gray-700"]},{previous:"$semantic.color.gray-active",next:["$color.fg.neutral-muted"],alternative:["$color.palette.gray-800"]}],k=[{previous:"$scale.color.gray-00",next:["$color.palette.gray-00"]},{previous:"$scale.color.gray-50",next:["$color.palette.gray-100"]},{previous:"$scale.color.gray-100",next:["$color.palette.gray-200"]},{previous:"$scale.color.gray-200",next:["$color.palette.gray-300"]},{previous:"$scale.color.gray-300",next:["$color.palette.gray-400"]},{previous:"$scale.color.gray-400",next:["$color.palette.gray-500"]},{previous:"$scale.color.gray-500",next:["$color.palette.gray-600"]},{previous:"$scale.color.gray-600",next:["$color.palette.gray-700"]},{previous:"$scale.color.gray-700",next:["$color.palette.gray-800"]},{previous:"$scale.color.gray-800",next:["$color.palette.gray-900"]},{previous:"$scale.color.gray-900",next:["$color.palette.gray-1000"]},{previous:"$scale.color.gray-alpha-50",next:["$color.palette.gray-200","$color.stroke.on-image"]},{previous:"$scale.color.gray-alpha-100",next:["$color.palette.gray-300"]},{previous:"$scale.color.gray-alpha-200",next:["$color.palette.gray-500"]},{previous:"$scale.color.gray-alpha-500",next:["$color.palette.gray-700"]},{previous:"$scale.color.carrot-50",next:["$color.palette.carrot-100"]},{previous:"$scale.color.carrot-100",next:["$color.palette.carrot-200"]},{previous:"$scale.color.carrot-200",next:["$color.palette.carrot-300"]},{previous:"$scale.color.carrot-300",next:["$color.palette.carrot-400"]},{previous:"$scale.color.carrot-400",next:["$color.palette.carrot-500"]},{previous:"$scale.color.carrot-500",next:["$color.palette.carrot-600"]},{previous:"$scale.color.carrot-600",next:["$color.palette.carrot-600"]},{previous:"$scale.color.carrot-700",next:["$color.palette.carrot-700"]},{previous:"$scale.color.carrot-800",next:["$color.palette.carrot-700"]},{previous:"$scale.color.carrot-900",next:["$color.palette.carrot-800"]},{previous:"$scale.color.carrot-950",next:["$color.palette.carrot-800"]},{previous:"$scale.color.carrot-alpha-50",next:["$color.palette.carrot-100"]},{previous:"$scale.color.carrot-alpha-100",next:["$color.palette.carrot-200"]},{previous:"$scale.color.carrot-alpha-200",next:["$color.palette.carrot-200"]},{previous:"$scale.color.blue-50",next:["$color.palette.blue-100"]},{previous:"$scale.color.blue-100",next:["$color.palette.blue-200"]},{previous:"$scale.color.blue-200",next:["$color.palette.blue-300"]},{previous:"$scale.color.blue-300",next:["$color.palette.blue-400"]},{previous:"$scale.color.blue-400",next:["$color.palette.blue-400"]},{previous:"$scale.color.blue-500",next:["$color.palette.blue-600"]},{previous:"$scale.color.blue-600",next:["$color.palette.blue-600"]},{previous:"$scale.color.blue-700",next:["$color.palette.blue-800"]},{previous:"$scale.color.blue-800",next:["$color.palette.blue-900"]},{previous:"$scale.color.blue-900",next:["$color.palette.blue-900"]},{previous:"$scale.color.blue-950",next:["$color.palette.blue-1000"]},{previous:"$scale.color.blue-alpha-50",next:["$color.palette.blue-100"]},{previous:"$scale.color.blue-alpha-100",next:["$color.palette.blue-100"]},{previous:"$scale.color.blue-alpha-200",next:["$color.palette.blue-200"]},{previous:"$scale.color.red-50",next:["$color.palette.red-100"]},{previous:"$scale.color.red-100",next:["$color.palette.red-200"]},{previous:"$scale.color.red-200",next:["$color.palette.red-300"]},{previous:"$scale.color.red-300",next:["$color.palette.red-400"]},{previous:"$scale.color.red-400",next:["$color.palette.red-600"]},{previous:"$scale.color.red-500",next:["$color.palette.red-700"]},{previous:"$scale.color.red-600",next:["$color.palette.red-700"]},{previous:"$scale.color.red-700",next:["$color.palette.red-800"]},{previous:"$scale.color.red-800",next:["$color.palette.red-900"]},{previous:"$scale.color.red-900",next:["$color.palette.red-900"]},{previous:"$scale.color.red-950",next:["$color.palette.red-900"]},{previous:"$scale.color.red-alpha-50",next:["$color.palette.red-100"]},{previous:"$scale.color.red-alpha-100",next:["$color.palette.red-200"]},{previous:"$scale.color.red-alpha-200",next:["$color.palette.red-300"]},{previous:"$scale.color.green-50",next:["$color.palette.green-100"]},{previous:"$scale.color.green-100",next:["$color.palette.green-200"]},{previous:"$scale.color.green-200",next:["$color.palette.green-300"]},{previous:"$scale.color.green-300",next:["$color.palette.green-400"]},{previous:"$scale.color.green-400",next:["$color.palette.green-500"]},{previous:"$scale.color.green-500",next:["$color.palette.green-600"]},{previous:"$scale.color.green-600",next:["$color.palette.green-700"]},{previous:"$scale.color.green-700",next:["$color.palette.green-800"]},{previous:"$scale.color.green-800",next:["$color.palette.green-900"]},{previous:"$scale.color.green-900",next:["$color.palette.green-900"]},{previous:"$scale.color.green-950",next:["$color.palette.green-900"]},{previous:"$scale.color.green-alpha-50",next:["$color.palette.green-100"]},{previous:"$scale.color.green-alpha-100",next:["$color.palette.green-200"]},{previous:"$scale.color.green-alpha-200",next:["$color.palette.green-200"]},{previous:"$scale.color.yellow-50",next:["$color.palette.yellow-100"]},{previous:"$scale.color.yellow-100",next:["$color.palette.yellow-200"]},{previous:"$scale.color.yellow-200",next:["$color.palette.yellow-300"]},{previous:"$scale.color.yellow-300",next:["$color.palette.yellow-400"]},{previous:"$scale.color.yellow-400",next:["$color.palette.yellow-500"]},{previous:"$scale.color.yellow-500",next:["$color.palette.yellow-700"]},{previous:"$scale.color.yellow-600",next:["$color.palette.yellow-700"]},{previous:"$scale.color.yellow-700",next:["$color.palette.yellow-800"]},{previous:"$scale.color.yellow-800",next:["$color.palette.yellow-800"]},{previous:"$scale.color.yellow-900",next:["$color.palette.yellow-900"]},{previous:"$scale.color.yellow-950",next:["$color.palette.yellow-900"]},{previous:"$scale.color.yellow-alpha-50",next:["$color.palette.yellow-100"]},{previous:"$scale.color.yellow-alpha-100",next:["$color.palette.yellow-100"]},{previous:"$scale.color.yellow-alpha-200",next:["$color.palette.yellow-100"]},{previous:"$scale.color.purple-50",next:["$color.palette.purple-100"]},{previous:"$scale.color.purple-100",next:["$color.palette.purple-300"]},{previous:"$scale.color.purple-200",next:["$color.palette.purple-400"]},{previous:"$scale.color.purple-300",next:["$color.palette.purple-400"]},{previous:"$scale.color.purple-400",next:["$color.palette.purple-500"]},{previous:"$scale.color.purple-500",next:["$color.palette.purple-600"]},{previous:"$scale.color.purple-600",next:["$color.palette.purple-700"]},{previous:"$scale.color.purple-700",next:["$color.palette.purple-800"]},{previous:"$scale.color.purple-800",next:["$color.palette.purple-900"]},{previous:"$scale.color.purple-900",next:["$color.palette.purple-900"]},{previous:"$scale.color.purple-950",next:["$color.palette.purple-1000"]}],T=[{previous:"$static.color.static-black",next:["$color.palette.static-black"]},{previous:"$static.color.static-white",next:["$color.palette.static-white"]},{previous:"$static.color.static-gray-900",next:["$color.palette.gray-1000"]},{previous:"$static.color.static-carrot-50",next:["$color.palette.carrot-100"]},{previous:"$static.color.static-carrot-800",next:["$color.palette.carrot-700"]},{previous:"$static.color.static-green-50",next:["$color.palette.green-100"]},{previous:"$static.color.static-green-800",next:["$color.palette.green-700"]},{previous:"$static.color.static-yellow-50",next:["$color.palette.yellow-100"]},{previous:"$static.color.static-yellow-800",next:["$color.palette.yellow-800"]},{previous:"$static.color.static-red-50",next:["$color.palette.red-100"]},{previous:"$static.color.static-red-800",next:["$color.palette.red-700"]},{previous:"$static.color.static-blue-50",next:["$color.palette.blue-100"]},{previous:"$static.color.static-blue-800",next:["$color.palette.blue-700"]},{previous:"$static.color.static-black-alpha-200",next:["$color.palette.static-black-alpha-200"]},{previous:"$static.color.static-black-alpha-500",next:["$color.palette.static-black-alpha-500"]},{previous:"$static.color.static-white-alpha-50",next:[],description:"deleted"},{previous:"$static.color.static-white-alpha-200",next:["$color.palette.static-white-alpha-200"]}],d=[...b,...k,...T];import*as u from"fs";import*as $ from"path";var x=class{timestamp;fileMigrations=[];currentFile=null;reportDir=$.join(process.cwd(),".report");transformName;constructor(e){this.transformName=e,this.timestamp=this.generateTimestamp()}generateTimestamp(){return new Date(new Date().getTime()+324e5).toISOString()}getReportPath(){return $.join(this.reportDir,`${this.transformName}.md`)}getRelativePath(e){if(!e)return"unknown";try{let o=$.resolve(e);return $.relative(this.reportDir,o)}catch{return"unknown"}}startNewFile(e){this.currentFile={filePath:this.getRelativePath(e),results:[]}}addResult(e){this.currentFile&&this.currentFile.results.push(e)}finishFile(){this.currentFile&&this.currentFile.results.length>0&&this.fileMigrations.push(this.currentFile),this.currentFile=null}hasResults(){return this.fileMigrations.length>0}writeReport(){if(!this.hasResults())return;u.existsSync(this.reportDir)||u.mkdirSync(this.reportDir,{recursive:!0});let e=this.getReportPath(),o=u.existsSync(e)?u.readFileSync(e,"utf8"):"",t=this.fileMigrations.map(l=>{let i=$.basename(l.filePath),s=l.results.map(c=>{let v=c.line?` (line: ${c.line})`:"",p=c.status==="success"?"\u2705":"\u274C",n=c.failureReason?`
|
2
|
-
- reason: ${
|
3
|
-
- as-is: \`${
|
4
|
-
- to-be: ${
|
5
|
-
`);return`### [${
|
1
|
+
var b=[{previous:"$semantic.color.on-primary",next:["$color.palette.static-white"]},{previous:"$semantic.color.primary",next:["$color.bg.brand-solid","$color.fg.brand"],alternative:["$color.palette.carrot-600"]},{previous:"$semantic.color.primary-low",next:["$color.palette.carrot-100"]},{previous:"$semantic.color.secondary",next:["$color.palette.gray-900"]},{previous:"$semantic.color.secondary-low",next:["$color.bg.neutral-weak"],alternative:["$color.palette.gray-200"]},{previous:"$semantic.color.success",next:["$color.bg.positive-solid","$color.fg.positive"],alternative:["$color.fg.positive-contrast","$color.palette.green-700"]},{previous:"$semantic.color.success-low",next:["$color.bg.positive-weak"],alternative:["$color.palette.green-100"]},{previous:"$semantic.color.warning",next:["$color.bg.warning-solid"],alternative:["$color.fg.warning-contrast","$color.palette.yellow-500"]},{previous:"$semantic.color.warning-low",next:["$color.bg.warning-weak"],alternative:["$color.palette.yellow-100"]},{previous:"$semantic.color.danger",next:["$color.bg.critical-solid","$color.fg.critical"],alternative:["$color.fg.critical-contrast","$color.palette.red-700"]},{previous:"$semantic.color.danger-low",next:["$color.bg.critical-weak"],alternative:["$color.palette.red-100"]},{previous:"$semantic.color.overlay-dim",next:["$color.bg.overlay"],alternative:["$color.palette.static-black-alpha-500"]},{previous:"$semantic.color.overlay-low",next:["$color.bg.overlay-muted"],alternative:["$color.palette.static-black-alpha-200"]},{previous:"$semantic.color.paper-sheet",next:["$color.bg.layer-floating"],alternative:["$color.palette.gray-00"]},{previous:"$semantic.color.paper-dialog",next:["$color.bg.layer-floating"],alternative:["$color.palette.gray-00"]},{previous:"$semantic.color.paper-floating",next:["$color.bg.layer-floating"],alternative:["$color.palette.gray-00"]},{previous:"$semantic.color.paper-contents",next:["$color.bg.layer-fill"],alternative:["$color.palette.gray-100"]},{previous:"$semantic.color.paper-default",next:["$color.bg.layer-default"],alternative:["$color.palette.gray-00"]},{previous:"$semantic.color.paper-background",next:["$color.bg.layer-basement"],alternative:["$color.palette.gray-200"]},{previous:"$semantic.color.paper-accent",next:["$color.palette.carrot-100"]},{previous:"$semantic.color.primary-hover",next:["$color.bg.brand-solid-pressed"],alternative:["$color.palette.carrot-700"]},{previous:"$semantic.color.primary-pressed",next:["$color.bg.brand-solid-pressed"],alternative:["$color.palette.carrot-700"]},{previous:"$semantic.color.primary-low-hover",next:["$color.palette.carrot-200"]},{previous:"$semantic.color.primary-low-active",next:["$color.palette.carrot-100"]},{previous:"$semantic.color.primary-low-pressed",next:["$color.palette.carrot-200"]},{previous:"$semantic.color.gray-hover",next:["$color.bg.neutral-weak-pressed"],alternative:["$color.palette.gray-300"]},{previous:"$semantic.color.gray-pressed",next:["$color.bg.neutral-weak-pressed"],alternative:["$color.palette.gray-300"]},{previous:"$semantic.color.on-primary-overlay-50",next:[],description:"TBD"},{previous:"$semantic.color.on-primary-overlay-200",next:[],description:"TBD"},{previous:"$semantic.color.on-primary-low-overlay-50",next:[],description:"TBD"},{previous:"$semantic.color.on-primary-low-overlay-100",next:[],description:"TBD"},{previous:"$semantic.color.on-primary-low-overlay-200",next:[],description:"TBD"},{previous:"$semantic.color.on-gray-overlay-50",next:[],description:"TBD"},{previous:"$semantic.color.on-gray-overlay-100",next:[],description:"TBD"},{previous:"$semantic.color.divider-1",next:["$color.stroke.on-image"],alternative:["$color.palette.static-black-alpha-50"]},{previous:"$semantic.color.divider-2",next:["$color.stroke.neutral"],alternative:["$color.palette.gray-300"]},{previous:"$semantic.color.divider-3",next:["$color.palette.gray-400"]},{previous:"$semantic.color.accent",next:["$color.bg.informative-solid","$color.fg.informative"],alternative:["$color.fg.informative-contrast","$color.palette.blue-700"]},{previous:"$semantic.color.ink-text",next:["$color.fg.neutral"],alternative:["$color.palette.gray-1000"]},{previous:"$semantic.color.ink-text-low",next:["$color.fg.neutral-subtle"],alternative:["$color.palette.gray-700"]},{previous:"$semantic.color.gray-active",next:["$color.fg.neutral-muted"],alternative:["$color.palette.gray-800"]}],k=[{previous:"$scale.color.gray-00",next:["$color.palette.gray-00"]},{previous:"$scale.color.gray-50",next:["$color.palette.gray-100"]},{previous:"$scale.color.gray-100",next:["$color.palette.gray-200"]},{previous:"$scale.color.gray-200",next:["$color.palette.gray-300"]},{previous:"$scale.color.gray-300",next:["$color.palette.gray-400"]},{previous:"$scale.color.gray-400",next:["$color.palette.gray-500"]},{previous:"$scale.color.gray-500",next:["$color.palette.gray-600"]},{previous:"$scale.color.gray-600",next:["$color.palette.gray-700"]},{previous:"$scale.color.gray-700",next:["$color.palette.gray-800"]},{previous:"$scale.color.gray-800",next:["$color.palette.gray-900"]},{previous:"$scale.color.gray-900",next:["$color.palette.gray-1000"]},{previous:"$scale.color.gray-alpha-50",next:["$color.palette.gray-200","$color.stroke.on-image"]},{previous:"$scale.color.gray-alpha-100",next:["$color.palette.gray-300"]},{previous:"$scale.color.gray-alpha-200",next:["$color.palette.gray-500"]},{previous:"$scale.color.gray-alpha-500",next:["$color.palette.gray-700"]},{previous:"$scale.color.carrot-50",next:["$color.palette.carrot-100"]},{previous:"$scale.color.carrot-100",next:["$color.palette.carrot-200"]},{previous:"$scale.color.carrot-200",next:["$color.palette.carrot-300"]},{previous:"$scale.color.carrot-300",next:["$color.palette.carrot-400"]},{previous:"$scale.color.carrot-400",next:["$color.palette.carrot-500"]},{previous:"$scale.color.carrot-500",next:["$color.palette.carrot-600"]},{previous:"$scale.color.carrot-600",next:["$color.palette.carrot-600"]},{previous:"$scale.color.carrot-700",next:["$color.palette.carrot-700"]},{previous:"$scale.color.carrot-800",next:["$color.palette.carrot-700"]},{previous:"$scale.color.carrot-900",next:["$color.palette.carrot-800"]},{previous:"$scale.color.carrot-950",next:["$color.palette.carrot-800"]},{previous:"$scale.color.carrot-alpha-50",next:["$color.palette.carrot-100"]},{previous:"$scale.color.carrot-alpha-100",next:["$color.palette.carrot-200"]},{previous:"$scale.color.carrot-alpha-200",next:["$color.palette.carrot-200"]},{previous:"$scale.color.blue-50",next:["$color.palette.blue-100"]},{previous:"$scale.color.blue-100",next:["$color.palette.blue-200"]},{previous:"$scale.color.blue-200",next:["$color.palette.blue-300"]},{previous:"$scale.color.blue-300",next:["$color.palette.blue-400"]},{previous:"$scale.color.blue-400",next:["$color.palette.blue-400"]},{previous:"$scale.color.blue-500",next:["$color.palette.blue-600"]},{previous:"$scale.color.blue-600",next:["$color.palette.blue-600"]},{previous:"$scale.color.blue-700",next:["$color.palette.blue-800"]},{previous:"$scale.color.blue-800",next:["$color.palette.blue-900"]},{previous:"$scale.color.blue-900",next:["$color.palette.blue-900"]},{previous:"$scale.color.blue-950",next:["$color.palette.blue-1000"]},{previous:"$scale.color.blue-alpha-50",next:["$color.palette.blue-100"]},{previous:"$scale.color.blue-alpha-100",next:["$color.palette.blue-100"]},{previous:"$scale.color.blue-alpha-200",next:["$color.palette.blue-200"]},{previous:"$scale.color.red-50",next:["$color.palette.red-100"]},{previous:"$scale.color.red-100",next:["$color.palette.red-200"]},{previous:"$scale.color.red-200",next:["$color.palette.red-300"]},{previous:"$scale.color.red-300",next:["$color.palette.red-400"]},{previous:"$scale.color.red-400",next:["$color.palette.red-600"]},{previous:"$scale.color.red-500",next:["$color.palette.red-700"]},{previous:"$scale.color.red-600",next:["$color.palette.red-700"]},{previous:"$scale.color.red-700",next:["$color.palette.red-800"]},{previous:"$scale.color.red-800",next:["$color.palette.red-900"]},{previous:"$scale.color.red-900",next:["$color.palette.red-900"]},{previous:"$scale.color.red-950",next:["$color.palette.red-900"]},{previous:"$scale.color.red-alpha-50",next:["$color.palette.red-100"]},{previous:"$scale.color.red-alpha-100",next:["$color.palette.red-200"]},{previous:"$scale.color.red-alpha-200",next:["$color.palette.red-300"]},{previous:"$scale.color.green-50",next:["$color.palette.green-100"]},{previous:"$scale.color.green-100",next:["$color.palette.green-200"]},{previous:"$scale.color.green-200",next:["$color.palette.green-300"]},{previous:"$scale.color.green-300",next:["$color.palette.green-400"]},{previous:"$scale.color.green-400",next:["$color.palette.green-500"]},{previous:"$scale.color.green-500",next:["$color.palette.green-600"]},{previous:"$scale.color.green-600",next:["$color.palette.green-700"]},{previous:"$scale.color.green-700",next:["$color.palette.green-800"]},{previous:"$scale.color.green-800",next:["$color.palette.green-900"]},{previous:"$scale.color.green-900",next:["$color.palette.green-900"]},{previous:"$scale.color.green-950",next:["$color.palette.green-900"]},{previous:"$scale.color.green-alpha-50",next:["$color.palette.green-100"]},{previous:"$scale.color.green-alpha-100",next:["$color.palette.green-200"]},{previous:"$scale.color.green-alpha-200",next:["$color.palette.green-200"]},{previous:"$scale.color.yellow-50",next:["$color.palette.yellow-100"]},{previous:"$scale.color.yellow-100",next:["$color.palette.yellow-200"]},{previous:"$scale.color.yellow-200",next:["$color.palette.yellow-300"]},{previous:"$scale.color.yellow-300",next:["$color.palette.yellow-400"]},{previous:"$scale.color.yellow-400",next:["$color.palette.yellow-500"]},{previous:"$scale.color.yellow-500",next:["$color.palette.yellow-700"]},{previous:"$scale.color.yellow-600",next:["$color.palette.yellow-700"]},{previous:"$scale.color.yellow-700",next:["$color.palette.yellow-800"]},{previous:"$scale.color.yellow-800",next:["$color.palette.yellow-800"]},{previous:"$scale.color.yellow-900",next:["$color.palette.yellow-900"]},{previous:"$scale.color.yellow-950",next:["$color.palette.yellow-900"]},{previous:"$scale.color.yellow-alpha-50",next:["$color.palette.yellow-100"]},{previous:"$scale.color.yellow-alpha-100",next:["$color.palette.yellow-100"]},{previous:"$scale.color.yellow-alpha-200",next:["$color.palette.yellow-100"]},{previous:"$scale.color.purple-50",next:["$color.palette.purple-100"]},{previous:"$scale.color.purple-100",next:["$color.palette.purple-300"]},{previous:"$scale.color.purple-200",next:["$color.palette.purple-400"]},{previous:"$scale.color.purple-300",next:["$color.palette.purple-400"]},{previous:"$scale.color.purple-400",next:["$color.palette.purple-500"]},{previous:"$scale.color.purple-500",next:["$color.palette.purple-600"]},{previous:"$scale.color.purple-600",next:["$color.palette.purple-700"]},{previous:"$scale.color.purple-700",next:["$color.palette.purple-800"]},{previous:"$scale.color.purple-800",next:["$color.palette.purple-900"]},{previous:"$scale.color.purple-900",next:["$color.palette.purple-900"]},{previous:"$scale.color.purple-950",next:["$color.palette.purple-1000"]}],T=[{previous:"$static.color.static-black",next:["$color.palette.static-black"]},{previous:"$static.color.static-white",next:["$color.palette.static-white"]},{previous:"$static.color.static-gray-900",next:[],description:"static \uC0C9\uC0C1 \uC0AC\uC6A9 \uD655\uC778\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."},{previous:"$static.color.static-carrot-50",next:[],description:"static \uC0C9\uC0C1 \uC0AC\uC6A9 \uD655\uC778\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."},{previous:"$static.color.static-carrot-800",next:[],description:"static \uC0C9\uC0C1 \uC0AC\uC6A9 \uD655\uC778\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."},{previous:"$static.color.static-green-50",next:[],description:"static \uC0C9\uC0C1 \uC0AC\uC6A9 \uD655\uC778\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."},{previous:"$static.color.static-green-800",next:[],description:"static \uC0C9\uC0C1 \uC0AC\uC6A9 \uD655\uC778\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."},{previous:"$static.color.static-yellow-50",next:[],description:"static \uC0C9\uC0C1 \uC0AC\uC6A9 \uD655\uC778\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."},{previous:"$static.color.static-yellow-800",next:[],description:"static \uC0C9\uC0C1 \uC0AC\uC6A9 \uD655\uC778\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."},{previous:"$static.color.static-red-50",next:[],description:"static \uC0C9\uC0C1 \uC0AC\uC6A9 \uD655\uC778\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."},{previous:"$static.color.static-red-800",next:[],description:"static \uC0C9\uC0C1 \uC0AC\uC6A9 \uD655\uC778\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."},{previous:"$static.color.static-blue-50",next:[],description:"static \uC0C9\uC0C1 \uC0AC\uC6A9 \uD655\uC778\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."},{previous:"$static.color.static-blue-800",next:[],description:"static \uC0C9\uC0C1 \uC0AC\uC6A9 \uD655\uC778\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."},{previous:"$static.color.static-black-alpha-200",next:["$color.palette.static-black-alpha-200"]},{previous:"$static.color.static-black-alpha-500",next:["$color.palette.static-black-alpha-500"]},{previous:"$static.color.static-white-alpha-50",next:[],description:"static \uC0C9\uC0C1 \uC0AC\uC6A9 \uD655\uC778\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."},{previous:"$static.color.static-white-alpha-200",next:["$color.palette.static-white-alpha-200"]}],d=[...b,...k,...T];import*as u from"fs";import*as $ from"path";var x=class{timestamp;fileMigrations=[];currentFile=null;reportDir=$.join(process.cwd(),".report");transformName;constructor(e){this.transformName=e,this.timestamp=this.generateTimestamp()}generateTimestamp(){return new Date(new Date().getTime()+324e5).toISOString()}getReportPath(){return $.join(this.reportDir,`${this.transformName}.md`)}getRelativePath(e){if(!e)return"unknown";try{let o=$.resolve(e);return $.relative(this.reportDir,o)}catch{return"unknown"}}startNewFile(e){this.currentFile={filePath:this.getRelativePath(e),results:[]}}addResult(e){this.currentFile&&this.currentFile.results.push(e)}finishFile(){this.currentFile&&this.currentFile.results.length>0&&this.fileMigrations.push(this.currentFile),this.currentFile=null}hasResults(){return this.fileMigrations.length>0}writeReport(){if(!this.hasResults())return;u.existsSync(this.reportDir)||u.mkdirSync(this.reportDir,{recursive:!0});let e=this.getReportPath(),o=u.existsSync(e)?u.readFileSync(e,"utf8"):"",t=this.fileMigrations.map(l=>{let n=$.basename(l.filePath),s=l.results.map(a=>{let v=a.line?` (line: ${a.line})`:"",p=a.status==="success"?"\u2705 success":a.status==="warning"?"\u26A0\uFE0F warning":"\u274C failure",i=a.failureReason?`
|
2
|
+
- reason: ${a.failureReason}`:"";return` - ${p} ${v}
|
3
|
+
- as-is: \`${a.previousToken}\`
|
4
|
+
- to-be: ${a.nextToken?`\`${a.nextToken}\``:"undefined"}${i}`}).join(`
|
5
|
+
`);return`### [${n}](${l.filePath})
|
6
6
|
- timestamp: ${this.timestamp}
|
7
7
|
- summary:
|
8
8
|
- total: ${l.results.length}
|
9
|
-
- success: ${l.results.filter(
|
10
|
-
-
|
9
|
+
- success: ${l.results.filter(a=>a.status==="success").length}
|
10
|
+
- warning: ${l.results.filter(a=>a.status==="warning").length}
|
11
|
+
- failure: ${l.results.filter(a=>a.status==="failure").length}
|
11
12
|
- lines
|
12
13
|
${s}`}).join(`
|
13
14
|
|
14
15
|
`);u.writeFileSync(e,o+(o?`
|
15
16
|
|
16
|
-
`:"")+t)}};var C=/([\p{Ll}\d])(\p{Lu})/gu,R=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,S=/(\d)\p{Ll}|(\p{L})\d/u,F=/[^\p{L}\d]+/giu,y="$1\0$2",h="";function w(r){let e=r.trim();e=e.replace(C,y).replace(R,y),e=e.replace(F,"\0");let o=0,t=e.length;for(;e.charAt(o)==="\0";)o++;if(o===t)return[];for(;e.charAt(t-1)==="\0";)t--;return e.slice(o,t).split(/\0/g)}function P(r){let e=w(r);for(let o=0;o<e.length;o++){let t=e[o],
|
17
|
+
`:"")+t)}};var C=/([\p{Ll}\d])(\p{Lu})/gu,R=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,S=/(\d)\p{Ll}|(\p{L})\d/u,F=/[^\p{L}\d]+/giu,y="$1\0$2",h="";function w(r){let e=r.trim();e=e.replace(C,y).replace(R,y),e=e.replace(F,"\0");let o=0,t=e.length;for(;e.charAt(o)==="\0";)o++;if(o===t)return[];for(;e.charAt(t-1)==="\0";)t--;return e.slice(o,t).split(/\0/g)}function P(r){let e=w(r);for(let o=0;o<e.length;o++){let t=e[o],c=S.exec(t);if(c){let l=c.index+(c[1]??c[2]).length;e.splice(o,1,t.slice(0,l),t.slice(l))}}return e}function f(r,e){let[o,t,c]=D(r,e),l=E(e?.locale),n=L(e?.locale),s=e?.mergeAmbiguousCharacters?A(l,n):_(l,n);return o+t.map((a,v)=>v===0?l(a):s(a,v)).join(e?.delimiter??"")+c}function E(r){return r===!1?e=>e.toLowerCase():e=>e.toLocaleLowerCase(r)}function L(r){return r===!1?e=>e.toUpperCase():e=>e.toLocaleUpperCase(r)}function A(r,e){return o=>`${e(o[0])}${r(o.slice(1))}`}function _(r,e){return(o,t)=>{let c=o[0];return(t>0&&c>="0"&&c<="9"?"_"+c:e(c))+r(o.slice(1))}}function D(r,e={}){let o=e.split??(e.separateNumbers?P:w),t=e.prefixCharacters??h,c=e.suffixCharacters??h,l=0,n=r.length;for(;l<r.length;){let s=r.charAt(l);if(!t.includes(s))break;l++}for(;n>l;){let s=n-1,a=r.charAt(s);if(!c.includes(a))break;n=s}return[r.slice(0,l),o(r.slice(l,n)),r.slice(n)]}function M(r){let e=r.replace(/^\$(semantic|static|scale)\.color\./,"").split(".").join("-");return f(e,{mergeAmbiguousCharacters:!0})}function I(r){let e=r.next.find(t=>t.startsWith("$color.fg"));if(e)return e;let o=r.next.find(t=>t.startsWith("$color.palette"));if(o)return o;if(r.alternative&&r.alternative.length>0){let t=r.alternative.find(c=>c.startsWith("$color.palette"));if(t)return t}return null}function m(r){if(r.includes("."))return r;for(let e of d)if(M(e.previous)===r){let t=I(e);if(t)return t.replace("$color.","").split(".").map((c,l)=>l===0?c:f(c,{mergeAmbiguousCharacters:!0})).join(".")}return`palette.${r}`}var j=(r,e,o)=>{let t=o,{reporter:c}=t,l=e.jscodeshift,n=l(r.source),s=null;return c&&(s=new x("replace-color-prop"),s.startNewFile(r.path)),n.find(l.JSXElement).filter(a=>{let v=a.node.openingElement.name;return v.type==="JSXIdentifier"&&v.name==="Text"}).forEach(a=>{let p=a.node.openingElement.attributes.find(i=>i.type==="JSXAttribute"&&i.name.name==="color");if(!(!p||p.type!=="JSXAttribute")){if(p.value?.type==="StringLiteral"){let i=p.value.value,g=m(i);i!==g&&(p.value.value=g,s&&s.addResult({previousToken:i,nextToken:g,status:"success",line:p.loc?.start.line}))}else if(p.value?.type==="JSXExpressionContainer"){let i=p.value.expression;i.type==="ConditionalExpression"&&(i.consequent.type==="StringLiteral"&&(i.consequent.value=m(i.consequent.value)),i.alternate.type==="StringLiteral"&&(i.alternate.value=m(i.alternate.value)),s&&s.addResult({previousToken:"conditional expression",nextToken:"transformed conditional expression",status:"success",line:p.loc?.start.line}))}}}),s&&(s.finishFile(),s.writeReport()),n.toSource()},O=j;export{O as default};
|