@code-partner/codepipe 0.1.134-dev.41.ge12ea81 → 0.1.134
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/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var ae="0.1.134
|
|
2
|
+
var ae="0.1.134",de="https://hub.codepipe.dev";var fe=2,Yc=1;function hr(t){return typeof t!="number"||!Number.isFinite(t)?!1:t>=Yc&&t<=fe}var ve=".devpipe-context.yaml",Tn=[{version:1,summary:"ADR section: adr/ scaffold (README, template, derived INDEX) + the format-version stamp itself",addedPaths:["adr/README.md","adr/0000-template.md","adr/INDEX.md",ve]}];function yr(t=1){return`# CodePipe Context Repo format version.
|
|
3
3
|
# Bumped by the scaffold / the format-migration PR \u2014 do not edit by hand.
|
|
4
4
|
template_version: ${t}
|
|
5
5
|
`}function Rn(t){if(!t)return 0;let e=/^\s*template_version:\s*(\d+)\s*$/m.exec(t),r=e?parseInt(e[1]??"",10):NaN;return Number.isFinite(r)&&r>=0?r:0}function In(t,e=Tn){let r=[];for(let o of e)if(!(o.version<=t))for(let n of o.addedPaths)r.includes(n)||r.push(n);return r}function Pn(t,e=Tn){return e.filter(r=>r.version>t)}function wr(){return{inputTokens:0,outputTokens:0,cacheReadInputTokens:0,cacheCreationInputTokens:0,totalCostUsd:0,model:"",numTurns:0,durationMs:0}}function jn(t){return!(!t||t.length>250||!/^[A-Za-z0-9._/-]+$/.test(t)||/^[-/.]/.test(t)||/[/.]$/.test(t)||t.endsWith(".lock")||t.includes("..")||t.includes("//")||t.includes("/."))}var ze=/^[a-z][a-z0-9-]{1,30}$/,Vc="-codepipe-ctx";function Se(t){return`${t}${Vc}`}var Ft={github:"github.com",gitlab:"gitlab.com",bitbucket:"bitbucket.org"};function dt(t){let e=t.match(/^git@([^:/]+):/);if(e)return e[1]??null;let r=t.match(/^ssh:\/\/(?:[^@/]+@)?([^/:]+)/);if(r)return r[1]??null;let o=t.match(/^https?:\/\/(?:[^@/]+@)?([^/:]+)/);return o?o[1]??null:null}var Je="x-bitbucket-api-token-auth";function br(t){switch(t){case Ft.gitlab:return"oauth2";case Ft.bitbucket:return"x-token-auth";default:return"x-access-token"}}var En=20;function N(t){return process.env[`CODEPIPE_${t}`]??process.env[`DEVPIPE_${t}`]}import{Command as hm}from"commander";import{homedir as Un}from"node:os";import{mkdirSync as nl,readFileSync as il,writeFileSync as sl,existsSync as ko}from"node:fs";import{dirname as Bn,join as xr,resolve as al}from"node:path";import{fileURLToPath as cl}from"node:url";import{existsSync as kr,readFileSync as _n,readdirSync as Jc,writeFileSync as Xc}from"node:fs";import{dirname as Qc,join as Ee}from"node:path";import{parse as Zc}from"yaml";import{existsSync as An,renameSync as zc}from"node:fs";function Xe(t,e,r=o=>console.error(o)){if(An(e)||!An(t))return!1;try{return zc(t,e),r(`migrated ${t} \u2192 ${e} (DevPipe \u2192 CodePipe)`),!0}catch(o){return r(`failed to migrate ${t} \u2192 ${e}: ${o instanceof Error?o.message:String(o)} \u2014 continuing with the legacy path untouched`),!1}}var me=".codepipe",bo=".devpipe";function el(t=process.cwd()){let e=t;for(;;){if(kr(Ee(e,me,"project.yaml")))return e;if(kr(Ee(e,bo,"project.yaml")))return Xe(Ee(e,bo),Ee(e,me))&&rl(e),e;let r=Qc(e);if(r===e)return null;e=r}}function tl(t){let e=Ee(t,me);return kr(e)?e:Ee(t,bo)}function rl(t){let e=Ee(t,".gitignore");if(!kr(e))return;let r=_n(e,"utf-8"),o=r.split(/\r?\n/).map(n=>{let i=n.trim();return i===".devpipe"||i===".devpipe/"||i==="/.devpipe"||i==="/.devpipe/"?n.replace(".devpipe",".codepipe"):n}).join(`
|