@scolladon/tsgit 1.1.0 → 1.2.0
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/README.md +29 -252
- package/dist/cjs/adapters/browser/index.cjs +1 -1
- package/dist/cjs/adapters/memory/index.cjs +1 -1
- package/dist/cjs/adapters/memory/index.cjs.map +1 -1
- package/dist/cjs/adapters/node/index.cjs +1 -1
- package/dist/cjs/adapters/node/index.cjs.map +1 -1
- package/dist/cjs/chunks/browser-http-transport-D4NH-8oJ.cjs +2 -0
- package/dist/cjs/chunks/browser-http-transport-D4NH-8oJ.cjs.map +1 -0
- package/dist/cjs/chunks/context-BcoAzPuU.cjs.map +1 -1
- package/dist/cjs/chunks/{error-CqLvhejR.cjs → error-CDLOBdNU.cjs} +2 -2
- package/dist/cjs/chunks/error-CDLOBdNU.cjs.map +1 -0
- package/dist/cjs/chunks/index-BVArBKuk.cjs +2 -0
- package/dist/cjs/chunks/index-BVArBKuk.cjs.map +1 -0
- package/dist/cjs/chunks/index-DE9HSiWf.cjs +2 -0
- package/dist/cjs/chunks/index-DE9HSiWf.cjs.map +1 -0
- package/dist/cjs/chunks/{logger-C8Z5BfFF.cjs → logger-CVG0zcPH.cjs} +2 -2
- package/dist/cjs/chunks/{logger-C8Z5BfFF.cjs.map → logger-CVG0zcPH.cjs.map} +1 -1
- package/dist/cjs/chunks/{memory-http-transport-Pjyme5KN.cjs → memory-http-transport-DXwDGKtR.cjs} +2 -2
- package/dist/cjs/chunks/memory-http-transport-DXwDGKtR.cjs.map +1 -0
- package/dist/cjs/chunks/node-http-transport-vrbnNEDb.cjs +2 -0
- package/dist/cjs/chunks/node-http-transport-vrbnNEDb.cjs.map +1 -0
- package/dist/cjs/chunks/{progress-CntEbiuo.cjs → progress-Bj2w-90A.cjs} +2 -2
- package/dist/cjs/chunks/{progress-CntEbiuo.cjs.map → progress-Bj2w-90A.cjs.map} +1 -1
- package/dist/cjs/chunks/repository-BJwTSiGf.cjs +2 -0
- package/dist/cjs/chunks/repository-BJwTSiGf.cjs.map +1 -0
- package/dist/cjs/commands/index.cjs +1 -1
- package/dist/cjs/index.browser.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.default.cjs +1 -1
- package/dist/cjs/index.node.cjs +1 -1
- package/dist/cjs/index.node.cjs.map +1 -1
- package/dist/cjs/primitives/index.cjs +1 -1
- package/dist/esm/adapters/browser/index.js +1 -1
- package/dist/esm/adapters/memory/index.js +1 -1
- package/dist/esm/adapters/memory/index.js.map +1 -1
- package/dist/esm/adapters/node/index.js +1 -1
- package/dist/esm/adapters/node/index.js.map +1 -1
- package/dist/esm/chunks/browser-http-transport-DL8bkNdg.js +2 -0
- package/dist/esm/chunks/browser-http-transport-DL8bkNdg.js.map +1 -0
- package/dist/esm/chunks/context-CumKOV7K.js.map +1 -1
- package/dist/esm/chunks/{error-BN9rdQ33.js → error-MOmSzp9Z.js} +2 -2
- package/dist/esm/chunks/error-MOmSzp9Z.js.map +1 -0
- package/dist/esm/chunks/index-BjmofbKE.js +2 -0
- package/dist/esm/chunks/index-BjmofbKE.js.map +1 -0
- package/dist/esm/chunks/index-Jh5R-UmU.js +2 -0
- package/dist/esm/chunks/index-Jh5R-UmU.js.map +1 -0
- package/dist/esm/chunks/{logger-BLZbLzva.js → logger-DP2cCpvL.js} +2 -2
- package/dist/esm/chunks/{logger-BLZbLzva.js.map → logger-DP2cCpvL.js.map} +1 -1
- package/dist/esm/chunks/memory-http-transport-COJU6VOL.js +2 -0
- package/dist/esm/chunks/memory-http-transport-COJU6VOL.js.map +1 -0
- package/dist/esm/chunks/node-http-transport-DYCFIJbc.js +2 -0
- package/dist/esm/chunks/node-http-transport-DYCFIJbc.js.map +1 -0
- package/dist/esm/chunks/{progress-DJU_f66N.js → progress-NePjO3Kd.js} +2 -2
- package/dist/esm/chunks/{progress-DJU_f66N.js.map → progress-NePjO3Kd.js.map} +1 -1
- package/dist/esm/chunks/repository-Cs-dbHqO.js +2 -0
- package/dist/esm/chunks/repository-Cs-dbHqO.js.map +1 -0
- package/dist/esm/commands/index.js +1 -1
- package/dist/esm/index.browser.js +1 -1
- package/dist/esm/index.default.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.node.js +1 -1
- package/dist/esm/index.node.js.map +1 -1
- package/dist/esm/primitives/index.js +1 -1
- package/dist/types/adapters/browser/index.d.cts +2 -1
- package/dist/types/adapters/browser/index.d.ts +2 -1
- package/dist/types/adapters/memory/index.d.cts +21 -2
- package/dist/types/adapters/memory/index.d.ts +21 -2
- package/dist/types/adapters/node/index.d.cts +64 -3
- package/dist/types/adapters/node/index.d.ts +64 -3
- package/dist/types/chunks/{context-o5TPfMB2.d.ts → context-BORy7yXb.d.ts} +97 -2
- package/dist/types/chunks/{context-D84z1i5F.d.cts → context-CMrHCVwK.d.cts} +97 -2
- package/dist/types/chunks/reflog-entry-BIf-zt__.d.cts +331 -0
- package/dist/types/chunks/reflog-entry-D9P2hCgv.d.ts +331 -0
- package/dist/types/chunks/{repository-23evW2h-.d.cts → repository-BqibvTOu.d.cts} +21 -3
- package/dist/types/chunks/{repository-BT7Xq1kJ.d.ts → repository-C4rN09Am.d.ts} +21 -3
- package/dist/types/chunks/write-tree-B8G6kgTy.d.cts +154 -0
- package/dist/types/chunks/write-tree-BXCDChvv.d.ts +154 -0
- package/dist/types/commands/index.d.cts +152 -6
- package/dist/types/commands/index.d.ts +152 -6
- package/dist/types/index.browser.d.cts +4 -4
- package/dist/types/index.browser.d.ts +4 -4
- package/dist/types/index.d.cts +4 -4
- package/dist/types/index.d.ts +4 -4
- package/dist/types/index.default.d.cts +4 -4
- package/dist/types/index.default.d.ts +4 -4
- package/dist/types/index.node.d.cts +4 -4
- package/dist/types/index.node.d.ts +4 -4
- package/dist/types/primitives/index.d.cts +192 -7
- package/dist/types/primitives/index.d.ts +192 -7
- package/package.json +40 -2
- package/dist/cjs/chunks/browser-http-transport-DcG05jw3.cjs +0 -2
- package/dist/cjs/chunks/browser-http-transport-DcG05jw3.cjs.map +0 -1
- package/dist/cjs/chunks/error-CqLvhejR.cjs.map +0 -1
- package/dist/cjs/chunks/index-BcxdLkNe.cjs +0 -2
- package/dist/cjs/chunks/index-BcxdLkNe.cjs.map +0 -1
- package/dist/cjs/chunks/index-D5Nd-Mks.cjs +0 -2
- package/dist/cjs/chunks/index-D5Nd-Mks.cjs.map +0 -1
- package/dist/cjs/chunks/memory-http-transport-Pjyme5KN.cjs.map +0 -1
- package/dist/cjs/chunks/node-http-transport-UkW5eEm3.cjs +0 -2
- package/dist/cjs/chunks/node-http-transport-UkW5eEm3.cjs.map +0 -1
- package/dist/cjs/chunks/repository-B_jx2AKW.cjs +0 -2
- package/dist/cjs/chunks/repository-B_jx2AKW.cjs.map +0 -1
- package/dist/esm/chunks/browser-http-transport-COFgnEyq.js +0 -2
- package/dist/esm/chunks/browser-http-transport-COFgnEyq.js.map +0 -1
- package/dist/esm/chunks/error-BN9rdQ33.js.map +0 -1
- package/dist/esm/chunks/index-BdV37p4e.js +0 -2
- package/dist/esm/chunks/index-BdV37p4e.js.map +0 -1
- package/dist/esm/chunks/index-BkRJ9-Im.js +0 -2
- package/dist/esm/chunks/index-BkRJ9-Im.js.map +0 -1
- package/dist/esm/chunks/memory-http-transport-DRYdYgiE.js +0 -2
- package/dist/esm/chunks/memory-http-transport-DRYdYgiE.js.map +0 -1
- package/dist/esm/chunks/node-http-transport-Bp5cFZCt.js +0 -2
- package/dist/esm/chunks/node-http-transport-Bp5cFZCt.js.map +0 -1
- package/dist/esm/chunks/repository-DiagDiT_.js +0 -2
- package/dist/esm/chunks/repository-DiagDiT_.js.map +0 -1
- package/dist/types/chunks/diff-change-Bm1zvVsC.d.cts +0 -59
- package/dist/types/chunks/diff-change-alGRzD_j.d.ts +0 -59
- package/dist/types/chunks/write-tree-DNjhjS3t.d.ts +0 -282
- package/dist/types/chunks/write-tree-DVp0RJ_r.d.cts +0 -282
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{deflateSync as t,inflateSync as i,createInflate as s}from"node:zlib";import{h as e,i as a,F as n,T as r,n as o,Q as c,j as h,z as l,m as d,p as m,w as u}from"./error-MOmSzp9Z.js";import*as p from"node:fs";import{c as f}from"./lru-cache-Cy7C7Lx2.js";import*as w from"node:fs/promises";import{stat as y}from"node:fs/promises";import*as O from"node:path";import{createHash as g}from"node:crypto";import{spawn as P}from"node:child_process";import*as N from"node:http";import*as k from"node:https";import{Readable as C}from"node:stream";function v(t){return t instanceof Error?t.message:String(t)}class b{maxInflatedBytes;constructor(t){this.maxInflatedBytes=t?.maxInflatedBytes??2147483648}deflate=async i=>{try{return new Uint8Array(t(i))}catch(t){throw e(v(t))}};inflate=async t=>{try{return new Uint8Array(i(t,{maxOutputLength:this.maxInflatedBytes}))}catch(t){throw a(v(t))}};streamInflate=async(t,i)=>{const e=this.maxInflatedBytes;return new Promise((n,r)=>{const o=s(),c=[];let h=0;const l=t.subarray(i);o.on("data",t=>{if(h+=t.length,h>e)return o.destroy(),void r(a("inflated output exceeds safety cap"));c.push(new Uint8Array(t))}),o.on("end",()=>{const t=o.bytesWritten,i=function(t){const i=t.reduce((t,i)=>t+i.length,0),s=new Uint8Array(i);let e=0;for(const i of t)s.set(i,e),e+=i.length;return s}(c);n({output:i,bytesConsumed:t})}),o.on("error",t=>{r(a(t.message))}),o.end(l)})};createInflateStream=()=>{const t=this.maxInflatedBytes,i=s();let e,n,r=0;return new TransformStream({start(s){e=s,i.on("data",s=>{if(r+=s.length,r>t)return e?.error(a("inflated output exceeds safety cap")),void i.destroy();e?.enqueue(new Uint8Array(s))}),n=new Promise((t,s)=>{i.on("end",()=>{e?.terminate(),t()}),i.on("error",t=>{const i=a(t.message);e?.error(i),s(i)})})},transform(t){i.write(t)},flush:()=>(i.end(),n)})}}const E=w,R=t=>{if("\\"!==t&&"/"!==t)throw new Error(`PathPolicy: unsupported separator ${JSON.stringify(t)}`);return t},D=(t,i)=>({sep:R(t.sep),caseInsensitive:i,isAbsolute:i=>t.isAbsolute(i),resolve:(...i)=>t.resolve(...i),join:(...i)=>t.join(...i),dirname:i=>t.dirname(i),basename:i=>t.basename(i),rootOf:i=>t.parse(i).root,normalizeForCompare:t=>{return i?(s=t,s.startsWith("\\\\?\\UNC\\")?"\\\\"+s.slice(8):s.startsWith("\\\\?\\")?s.slice(4):s).toLowerCase():t;var s}}),F=D(O.posix,!1),I=D(O.win32,!0),T="win32"===process.platform?I:F;function z(t,i,s=T){return s.isAbsolute(t)?t:s.join(i,t)}function S(t){return t instanceof Error&&"code"in t}function L(t,i,s=T){const e=s.normalizeForCompare(i);return e===t||e.startsWith(t+s.sep)}function x(t,i){switch(t.code){case"ENOENT":return o(i);case"EEXIST":return d(i);case"ENOTDIR":return l(i);case"ENOTEMPTY":return h(i);case"EACCES":case"EPERM":case"ELOOP":case"EISDIR":return n(i);default:return c("filesystem",t.code??"UNKNOWN")}}async function U(t,i){try{return await t()}catch(t){if(S(t))throw x(t,i);throw t}}async function j(t,i=T,s=E){const e=i.rootOf(t),a=t.slice(e.length).split(i.sep).filter(Boolean);for(let t=a.length;t>0;t--){const n=e+a.slice(0,t).join(i.sep);try{const e=await s.realpath(n),r=a.slice(t).join(i.sep);return r.length>0?i.join(e,r):e}catch(t){if(S(t)&&"ENOENT"===t.code)continue;throw t}}const n=await s.realpath(e);return a.length>0?i.join(n,a.join(i.sep)):n}function A(t){const i={ctimeMs:Number(t.ctimeMs),mtimeMs:Number(t.mtimeMs),dev:Number(t.dev),ino:Number(t.ino),mode:Number(t.mode),uid:Number(t.uid),gid:Number(t.gid),size:Number(t.size),isFile:t.isFile(),isDirectory:t.isDirectory(),isSymbolicLink:t.isSymbolicLink()};return void 0!==t.ctimeNs&&void 0!==t.mtimeNs?{...i,ctimeNs:t.ctimeNs,mtimeNs:t.mtimeNs}:i}class M{rootDir;pathPolicy;fsOps;creationParentCache=f(65536,64);canonicalRootPromise=void 0;normalizedRootDir=void 0;normalizedCanonicalRoot=void 0;constructor(t,i=T,s=E){this.rootDir=t,this.pathPolicy=i,this.fsOps=s}getNormalizedRootDir(){return void 0===this.normalizedRootDir&&(this.normalizedRootDir=this.pathPolicy.normalizeForCompare(this.rootDir)),this.normalizedRootDir}getResolvedNormalizedCanonicalRoot(){return this.normalizedCanonicalRoot}async getCanonicalRoot(){return void 0===this.canonicalRootPromise&&(this.canonicalRootPromise=this.fsOps.realpath(this.rootDir).then(t=>(this.normalizedCanonicalRoot=this.pathPolicy.normalizeForCompare(t),t)).catch(t=>{throw this.canonicalRootPromise=void 0,this.normalizedCanonicalRoot=void 0,t})),this.canonicalRootPromise}read=async t=>{const i=await this.checkContainment(t,"read");return U(async()=>new Uint8Array(await this.fsOps.readFile(i)),t)};readSlice=async(t,i,s)=>{if(i<0||s<0)throw n(t);const e=await this.checkContainment(t,"read");let a;try{return await U(async()=>{a=await this.fsOps.open(e,"r");const t=Buffer.alloc(s),{bytesRead:n}=await a.read(t,0,s,i);return Uint8Array.from(t.subarray(0,n))},t)}finally{await(a?.close())}};readUtf8=async t=>{const i=await this.checkContainment(t,"read");return U(()=>this.fsOps.readFile(i,"utf-8"),t)};write=async(t,i)=>{const s=await this.checkContainment(t,"creation");await U(async()=>{await this.fsOps.mkdir(this.pathPolicy.dirname(s),{recursive:!0}),await this.fsOps.writeFile(s,i)},t)};writeExclusive=async(t,i)=>{const s=await this.checkContainment(t,"creation");await U(async()=>{await this.fsOps.mkdir(this.pathPolicy.dirname(s),{recursive:!0}),await this.fsOps.writeFile(s,i,{flag:"wx"})},t)};writeUtf8=async(t,i)=>{const s=await this.checkContainment(t,"creation");await U(async()=>{await this.fsOps.mkdir(this.pathPolicy.dirname(s),{recursive:!0}),await this.fsOps.writeFile(s,i,"utf-8")},t)};appendUtf8=async(t,i)=>{const s=await this.checkContainment(t,"creation");await U(async()=>{await this.fsOps.mkdir(this.pathPolicy.dirname(s),{recursive:!0}),await this.fsOps.appendFile(s,i,"utf-8")},t)};exists=async t=>{const i=this.pathPolicy.resolve(z(t,this.rootDir,this.pathPolicy));await this.getCanonicalRoot();const s=this.getNormalizedRootDir(),e=this.getResolvedNormalizedCanonicalRoot();try{if(!L(e,await this.fsOps.realpath(i),this.pathPolicy))throw n(t);return!0}catch(a){if(a instanceof r)throw a;if(S(a)&&"ENOENT"===a.code){if(!L(s,i,this.pathPolicy)&&!L(e,i,this.pathPolicy))throw n(t);return!1}if(S(a))throw x(a,t);throw a}};stat=async t=>{const i=await this.checkContainment(t,"read");return U(async()=>A(await this.fsOps.stat(i,{bigint:!0})),t)};lstat=async t=>{const i=await this.checkContainment(t,"lstat");return U(async()=>A(await this.fsOps.lstat(i,{bigint:!0})),t)};readdir=async t=>{const i=await this.checkContainment(t,"read");return U(async()=>(await this.fsOps.readdir(i,{withFileTypes:!0})).map(t=>({name:t.name,isFile:t.isFile(),isDirectory:t.isDirectory(),isSymbolicLink:t.isSymbolicLink()})),t)};mkdir=async t=>{const i=await this.checkContainment(t,"creation");await U(()=>this.fsOps.mkdir(i,{recursive:!0}),t)};rm=async t=>{const i=await this.checkContainment(t,"read");await U(()=>this.fsOps.rm(i),t)};rename=async(t,i)=>{const s=await this.checkContainment(t,"read"),e=await this.checkContainment(i,"creation");await U(async()=>{await this.fsOps.mkdir(this.pathPolicy.dirname(e),{recursive:!0}),await this.fsOps.rename(s,e)},t),this.creationParentCache.clear()};readlink=async t=>{const i=await this.checkContainment(t,"lstat");return U(()=>this.fsOps.readlink(i),t)};symlink=async(t,i)=>{if(this.pathPolicy.isAbsolute(t)){const s=this.pathPolicy.resolve(t),e=await j(s,this.pathPolicy,this.fsOps);await this.getCanonicalRoot();const a=this.getNormalizedRootDir(),r=this.getResolvedNormalizedCanonicalRoot();if(!L(a,e,this.pathPolicy)&&!L(r,e,this.pathPolicy))throw n(i)}const s=await this.checkContainment(i,"creation");await U(async()=>{await this.fsOps.mkdir(this.pathPolicy.dirname(s),{recursive:!0}),await this.fsOps.symlink(t,s)},i)};chmod=async(t,i)=>{const s=await this.checkContainment(t,"read");await U(()=>this.fsOps.chmod(s,i),t)};rmRecursive=async t=>{let i;try{i=await this.checkContainment(t,"lstat"),await U(()=>this.fsOps.lstat(i),t)}catch(t){if(t instanceof r&&"FILE_NOT_FOUND"===t.data.code)return;throw t}await this.removeTree(i,t),this.creationParentCache.clear()};openWithNoFollow=async(t,i)=>{const s=await this.checkContainment(t,"lstat");if(this.pathPolicy.caseInsensitive&&await this.isSymlinkLeaf(s))throw n(t);const e="write"===i?p.constants.O_WRONLY:p.constants.O_RDONLY;return function(t){let i=!1;return{read:async(i,s,e,a)=>{const{bytesRead:n}=await t.read(i,s,e,a??null);return n},write:async i=>{await t.write(i,0,i.length)},stat:async()=>A(await t.stat({bigint:!0})),close:async()=>{i||(i=!0,await t.close())}}}(await U(()=>this.fsOps.open(s,e|p.constants.O_NOFOLLOW),t).catch(i=>{if(function(t,i=T){return!!i.caseInsensitive&&t instanceof r&&("PERMISSION_DENIED"===t.data.code||"UNSUPPORTED_OPERATION"===t.data.code)}(i,this.pathPolicy))throw n(t);throw i}))};async isSymlinkLeaf(t){try{return(await this.fsOps.lstat(t)).isSymbolicLink()}catch(t){if(S(t)&&"ENOENT"===t.code)return!1;throw t}}async removeTree(t,i){const s=await U(()=>this.fsOps.lstat(t),i);if(!s.isDirectory()||s.isSymbolicLink())return void await U(()=>this.fsOps.rm(t,{force:!0}),i);const e=await U(()=>this.fsOps.readdir(t,{withFileTypes:!0}),i);await async function(t,i,s){if(0===t.length)return;let e=0;const a=Math.min(8,t.length),n=Array.from({length:a},async()=>{for(;;){const i=e;if(e+=1,i>=t.length)return;const a=t[i];if(void 0===a)return;await s(a)}});await Promise.all(n)}(e,0,s=>this.removeTree(this.pathPolicy.join(t,s.name),i)),await U(()=>this.fsOps.rmdir(t),i)}async resolveForCreation(t,i){const s=await this.realpathForCreation(i);let e;try{e={ok:!0,isSymlink:(await this.fsOps.lstat(s)).isSymbolicLink()}}catch(t){e={ok:!1,err:t}}return function(t,i){if(t.ok){if(t.isSymlink)throw n(i);return}const{err:s}=t;if(S(s)){if("ENOENT"===s.code)return;throw x(s,i)}throw s}(e,t),s}async realpathForCreation(t){const i=this.pathPolicy.dirname(t),s=this.pathPolicy.basename(t),e=this.creationParentCache.get(i);if(void 0!==e)return this.pathPolicy.join(e,s);try{const t=await this.fsOps.realpath(i);return this.creationParentCache.set(i,t,i.length+t.length),this.pathPolicy.join(t,s)}catch(i){if(S(i)&&"ENOENT"===i.code)return j(t,this.pathPolicy,this.fsOps);throw i}}async resolveForMode(t,i,s,e){if("read"===s)return e(i),this.fsOps.realpath(i);if("lstat"===s){e(i);const t=await this.fsOps.realpath(this.pathPolicy.dirname(i));return this.pathPolicy.join(t,this.pathPolicy.basename(i))}return this.resolveForCreation(t,i)}async checkContainment(t,i){const s=this.pathPolicy.resolve(z(t,this.rootDir,this.pathPolicy));await this.getCanonicalRoot();const e=this.getNormalizedRootDir(),a=this.getResolvedNormalizedCanonicalRoot(),c=i=>{if(!L(e,i,this.pathPolicy)&&!L(a,i,this.pathPolicy))throw n(t)};try{const e=await this.resolveForMode(t,s,i,c);return c(e),e}catch(i){if(i instanceof r)throw i;if(S(i)&&"ENOENT"===i.code)throw o(t);if(S(i))throw x(i,t);throw i}}}const W={sha1:20,sha256:32};class _{algorithm;digestLength;constructor(t="sha1"){this.algorithm=t,this.digestLength=W[t]}hash=async t=>new Uint8Array(g(this.algorithm).update(t).digest());hashHex=async t=>g(this.algorithm).update(t).digest("hex");createHasher=()=>{const t=g(this.algorithm);let i=!1;return{update:s=>{if(i)throw m("cannot update after digest");t.update(s)},digest:async()=>{if(i)throw m("cannot digest after digest");return i=!0,new Uint8Array(t.digest())},digestHex:async()=>{if(i)throw m("cannot digest after digest");return i=!0,t.digest("hex")}}}}const B={stat:y,spawn:P};class H{chunks=[];size=0;append(t){const i=t.subarray(0,Math.max(0,1048576-this.size));this.chunks.push(i),this.size+=i.length}value(){return Buffer.concat(this.chunks).toString("utf8")}}class q{isWindows;ops;constructor(t=process.platform,i=B){this.isWindows="win32"===t,this.ops=i}async run(t){const i=O.join(t.hooksDir,t.name);return await this.isRunnable(i)?Y(this.ops.spawn,i,t):{kind:"skipped"}}async isRunnable(t){let i,s;try{const e=await this.ops.stat(t);i=e.mode,s=e.isFile()}catch{return!1}return!!s&&(this.isWindows||!!(73&i))}}const Y=(t,i,s)=>new Promise(e=>{const a=t(i,s.args,{cwd:s.workDir,env:{...process.env,GIT_DIR:s.gitDir,GIT_INDEX_FILE:`${s.gitDir}/index`}}),n=new H,r=new H;a.stdout.on("data",t=>{n.append(t)}),a.stderr.on("data",t=>{r.append(t)});const o=s.signal,c=()=>{a.kill()};o?.addEventListener("abort",c),!0===o?.aborted&&a.kill();const h=t=>{o?.removeEventListener("abort",c),e(t)};a.on("error",t=>{h({kind:"ran",exitCode:126,stdout:"",stderr:String(t)})}),a.on("close",t=>{h({kind:"ran",exitCode:t??128,stdout:n.value(),stderr:r.value()})}),a.stdin.on("error",()=>{}),a.stdin.end(s.stdin)});function G(t){const i={};for(const[s,e]of Object.entries(t))void 0!==e&&(i[s.toLowerCase()]=Array.isArray(e)?e.join(", "):e);return i}class X{allowInsecureHttp;constructor(t={}){this.allowInsecureHttp=t.allowInsecureHttp??!1}request=async t=>{const i=new URL(t.url);if("http:"===i.protocol&&!this.allowInsecureHttp)throw u("HTTPS required — set allowInsecureHttp to allow plaintext HTTP");const s="https:"===i.protocol?k:N;return new Promise((e,a)=>{const n={method:t.method,headers:{...t.headers}};void 0!==t.signal&&(n.signal=t.signal);const r=s.request(i,n,t=>{e({statusCode:t.statusCode,headers:G(t.headers),body:C.toWeb(t)})});r.on("error",t=>{a(u(function(t){switch(t.code){case"ENOTFOUND":return"DNS resolution failed";case"ECONNREFUSED":return"Connection refused";case"ETIMEDOUT":return"Connection timed out";default:return"network error"}}(t)))}),void 0!==t.body&&r.write(Buffer.from(t.body)),r.end()})}}export{b as N,M as a,_ as b,q as c,X as d};
|
|
2
|
+
//# sourceMappingURL=node-http-transport-DYCFIJbc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-http-transport-DYCFIJbc.js","sources":["../../../src/adapters/node/node-compressor.ts","../../../src/adapters/node/fs-operations.ts","../../../src/adapters/node/path-policy.ts","../../../src/adapters/node/node-file-system.ts","../../../src/adapters/node/node-hash-service.ts","../../../src/adapters/node/node-hook-runner.ts","../../../src/adapters/node/node-http-transport.ts"],"sourcesContent":[null,null,null,null,null,null,null],"names":["describeError","err","Error","message","String","NodeCompressor","maxInflatedBytes","constructor","options","this","deflate","async","data","Uint8Array","deflateSync","compressFailed","inflate","inflateSync","maxOutputLength","decompressFailed","streamInflate","bytes","offset","cap","Promise","resolve","reject","createInflate","chunks","total","slice","subarray","on","chunk","length","destroy","push","consumed","bytesWritten","output","reduce","s","c","out","set","concatUint8","bytesConsumed","end","createInflateStream","controller","endPromise","TransformStream","start","error","enqueue","terminate","mapped","transform","write","flush","realFsOps","fsPromises","narrowSep","sep","JSON","stringify","makePolicy","impl","caseInsensitive","isAbsolute","path","parts","join","dirname","basename","rootOf","parse","root","normalizeForCompare","p","startsWith","WIN_EXTENDED_UNC_PREFIX","WIN_EXTENDED_PREFIX","toLowerCase","posixPolicy","nodePath","posix","windowsPolicy","win32","nativePolicy","process","platform","toAbsolute","rootDir","policy","isErrnoException","pathContainsNormalized","normalizedParent","child","mapErrno","code","fileNotFound","fileExists","notADirectory","directoryNotEmpty","permissionDenied","unsupportedOperation","runFs","op","realpathNearestExisting","absolute","fsOps","segments","split","filter","Boolean","i","candidate","real","realpath","remaining","realRoot","mapStat","base","ctimeMs","Number","mtimeMs","dev","ino","mode","uid","gid","size","isFile","isDirectory","isSymbolicLink","undefined","ctimeNs","mtimeNs","NodeFileSystem","pathPolicy","creationParentCache","createLruCache","canonicalRootPromise","normalizedRootDir","normalizedCanonicalRoot","getNormalizedRootDir","getResolvedNormalizedCanonicalRoot","getCanonicalRoot","then","canonical","catch","read","checkContainment","readFile","readSlice","handle","open","buf","Buffer","alloc","bytesRead","from","close","readUtf8","mkdir","recursive","writeFile","writeExclusive","flag","writeUtf8","content","appendUtf8","appendFile","exists","resolved","normalizedRoot","normalizedCanonical","TsgitError","stat","bigint","lstat","readdir","withFileTypes","map","entry","name","rm","rename","src","dst","realSrc","realDst","clear","readlink","symlink","target","lexical","resolvedTarget","chmod","rmRecursive","removeTree","openWithNoFollow","isSymlinkLeaf","fs","constants","O_WRONLY","O_RDONLY","closed","buffer","position","wrapNodeHandle","O_NOFOLLOW","isWindowsSymlinkRefusal","originalPath","leafStat","force","entries","items","limit","fn","next","workerCount","Math","min","workers","Array","item","all","mapConcurrent","rmdir","resolveForCreation","realpathForCreation","lstatResult","ok","isSymlink","result","interpretCreationLstat","parent","cached","get","realParent","resolveForMode","check","abs","DIGEST_LENGTH","sha1","sha256","NodeHashService","algorithm","digestLength","hash","createHash","update","digest","hashHex","createHasher","inner","hashFailed","digestHex","realHookRunnerOps","spawn","BoundedBuffer","append","max","value","concat","toString","NodeHookRunner","isWindows","ops","run","request","scriptPath","hooksDir","isRunnable","spawnHook","kind","stats","spawnFn","args","cwd","workDir","env","GIT_DIR","gitDir","GIT_INDEX_FILE","stdout","stderr","signal","onAbort","kill","addEventListener","aborted","finish","removeEventListener","exitCode","stdin","normalizeHeaders","rawHeaders","headers","key","Object","isArray","NodeHttpTransport","allowInsecureHttp","req","url","URL","protocol","networkError","client","https","http","requestOptions","method","clientRequest","res","statusCode","body","Readable","toWeb","sanitizeErrorReason"],"mappings":"2hBAKM,SAAUA,EAAcC,GAC5B,OAAOA,aAAeC,MAAQD,EAAIE,QAAUC,OAAOH,EACrD,OAaaI,EACMC,iBAEjB,WAAAC,CAAYC,GACVC,KAAKH,iBAAmBE,GAASF,kBAXH,UAYhC,CAEAI,QAAUC,MAAOC,IACf,IACE,OAAO,IAAIC,WAAWC,EAAYF,GACpC,CAAE,MAAOX,GACP,MAAMc,EAAef,EAAcC,GACrC,GAGFe,QAAUL,MAAOC,IACf,IACE,OAAO,IAAIC,WAAWI,EAA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,EAhDT,SAA8BrT,GAClC,OAAQA,EAAImG,MACV,IAAK,YACH,MAAO,wBACT,IAAK,eACH,MAAO,qBACT,IAAK,YACH,MAAO,uBACT,QAGE,MAAO,gBAEb,CAmC4B8N,CAAoBjU,YAEzBuI,IAAb0K,EAAIa,MACNH,EAAclQ,MAAMqG,OAAOG,KAAKgJ,EAAIa,OAEtCH,EAAc7Q"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=progress-
|
|
1
|
+
import{L as t}from"./error-MOmSzp9Z.js";const e=Object.freeze({start:()=>{},update:()=>{},end:()=>{}}),r=/\x1b\[[0-9;]*m/g,a=/[<>&"']/g,o=e=>{let o=e.replace(r,"");return o=t(o),o=o.replace(a,t=>`&#${t.charCodeAt(0)};`),o},$=t=>{const e=e=>{try{t(e)}catch{}};return{start:(t,r)=>e(((t,e)=>`${o(t)}: start${void 0!==e?`/${e}`:""}`)(t,r)),update:(t,r,a,$)=>e(((t,e,r,a)=>{const $=`${o(t)}: ${e}${void 0!==r?`/${r}`:""}`;return void 0!==a&&""!==a?`${$} ${o(a)}`:$})(t,r,a,$)),end:t=>e((t=>`${o(t)}: done`)(t))}};export{$ as c,e as n};
|
|
2
|
+
//# sourceMappingURL=progress-NePjO3Kd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress-
|
|
1
|
+
{"version":3,"file":"progress-NePjO3Kd.js","sources":["../../../src/progress.ts"],"sourcesContent":[null],"names":["noopProgress","Object","freeze","start","update","end","ANSI_ESCAPE_RE","HTML_SPECIALS_RE","sanitizeForSink","text","out","replace","sanitize","c","charCodeAt","consoleProgress","sink","safeSink","line","op","total","undefined","formatStart","current","head","formatUpdate","formatEnd"],"mappings":"wCAMO,MAAMA,EAAiCC,OAAOC,OAAO,CAC1DC,MAAO,OACPC,OAAQ,OACRC,IAAK,SAIDC,EAAiB,kBACjBC,EAAmB,WAEnBC,EAAmBC,IAKvB,IAAIC,EAAMD,EAAKE,QAAQL,EAAgB,IAGvC,OAFAI,EAAME,EAASF,GACfA,EAAMA,EAAIC,QAAQJ,EAAmBM,GAAM,KAAKA,EAAEC,WAAW,OACtDJ,GAoBIK,EAAmBC,IAC9B,MAAMC,EAAYC,IAChB,IACEF,EAAKE,EACP,CAAE,MAEF,GASF,MAAO,CACLf,MAAO,CAACgB,EAAIC,IAAUH,EARJ,EAACE,EAAYC,IAC/B,GAAGZ,EAAgBW,iBAAuBE,IAAVD,EAAsB,IAAIA,IAAU,KAOrCE,CAAYH,EAAIC,IAC/ChB,OAAQ,CAACe,EAAII,EAASH,EAAOX,IAASQ,EAPnB,EAACE,EAAYI,EAAiBH,EAAgBX,KACjE,MAAMe,EAAO,GAAGhB,EAAgBW,OAAQI,SAAoBF,IAAVD,EAAsB,IAAIA,IAAU,KACtF,YAAgBC,IAATZ,GAA+B,KAATA,EAAc,GAAGe,KAAQhB,EAAgBC,KAAUe,GAKjCC,CAAaN,EAAII,EAASH,EAAOX,IAChFJ,IAAMc,GAAOF,EAJG,CAACE,GAAuB,GAAGX,EAAgBW,WAIrCO,CAAUP"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as s,s as e,E as a,J as r}from"./error-MOmSzp9Z.js";import{a as t,w as o}from"./logger-DP2cCpvL.js";import{n as i}from"./progress-NePjO3Kd.js";import{w as n,v as c,u as d,t as l,s as m,q as f,o as p,n as h,r as w,p as u,m as g,l as v,k as b,j as k,i as y,h as j,f as R,e as x,c as O,d as S,b as P,a as I,g as D}from"./index-Jh5R-UmU.js";import{aL as C,aK as z,aH as E,aG as N,aF as T,aE as U,aD as W,az as F,am as $,ak as A,ad as B,ac as q,a8 as G,a7 as L,a5 as M,Y as H,G as J,w as K,s as Y,n as Z}from"./index-BjmofbKE.js";const Q=["fs","transport","compressor","hash"],V=s=>{if(null!==s&&"object"==typeof s&&!Object.isFrozen(s)){Object.freeze(s);for(const e of Object.keys(s))V(s[e])}},X=/^[A-Za-z]:[/\\]/,_=(s,e)=>{const r=s=>{if(!es(s,e))throw a(s)};return{read:e=>(r(e),s.read(e)),readSlice:(e,a,t)=>(r(e),s.readSlice(e,a,t)),readUtf8:e=>(r(e),s.readUtf8(e)),write:(e,a)=>(r(e),s.write(e,a)),writeExclusive:(e,a)=>(r(e),s.writeExclusive(e,a)),writeUtf8:(e,a)=>(r(e),s.writeUtf8(e,a)),appendUtf8:(e,a)=>(r(e),s.appendUtf8(e,a)),exists:e=>(r(e),s.exists(e)),stat:e=>(r(e),s.stat(e)),lstat:e=>(r(e),s.lstat(e)),readdir:e=>(r(e),s.readdir(e)),mkdir:e=>(r(e),s.mkdir(e)),rm:e=>(r(e),s.rm(e)),rename:(e,a)=>(r(e),r(a),s.rename(e,a)),readlink:e=>(r(e),s.readlink(e)),symlink:(e,a)=>(r(e),r(a),s.symlink(e,a)),chmod:(e,a)=>(r(e),s.chmod(e,a)),rmRecursive:e=>(r(e),s.rmRecursive(e)),openWithNoFollow:(e,a)=>(r(e),s.openWithNoFollow(e,a))}},ss=s=>s.replace(/\\/g,"/"),es=(s,e)=>{const a=ss(s),r=ss(e);if(a===r)return!0;const t=r.endsWith("/")?r:`${r}/`;return a.startsWith(t)},as=(s,e)=>{const a=e?.allowInsecure??!1,r=e?.allowPrivateNetworks??!1,t=e?.dnsResolver??rs;return{request:async e=>(await n(e.url,{resolver:t,allowInsecure:a,allowPrivateNetworks:r}),s.request(e))}},rs=async()=>[],ts=async(a,n)=>{(s=>{if(void 0!==s.cwd&&!(s=>s.startsWith("/")||s.startsWith("\\\\")||X.test(s))(s.cwd))throw e("cwd","must be an absolute path");const a=s.config;void 0!==a&&((s=>{if(void 0!==s){if(!Number.isInteger(s))throw e("parallelism","must be an integer");if(s<1||s>32)throw e("parallelism",`must be in 1..32 (got ${s})`)}})(a.parallelism),(s=>{if(void 0!==s&&s<1024)throw e("maxResponseBytes",`must be >= 1024 (got ${s})`)})(a.maxResponseBytes),(s=>{if(void 0!==s&&s<0)throw e("breakStaleLockMs",`must be >= 0 (got ${s})`)})(a.breakStaleLockMs),(s=>{if(void 0!==s&&s<1)throw e("maxObjectsPerPack",`must be >= 1 (got ${s})`)})(a.maxObjectsPerPack),(s=>{if(void 0!==s&&s<1)throw e("maxDnsResults",`must be >= 1 (got ${s})`)})(a.maxDnsResults),(s=>{if(void 0!==s&&"function"!=typeof s)throw e("dnsResolver","must be a function")})(a.dnsResolver))})(a);const ss=a.cwd??(t()?globalThis.process.cwd():"/"),es=((e,a)=>{const r={fs:e.fs??a.fs,hash:e.hash??a.hash,compressor:e.compressor??a.compressor,transport:e.transport??a.transport};if(void 0===r.fs)throw s(a.runtime,"fs adapter missing");if(void 0===r.hash)throw s(a.runtime,"hash adapter missing");if(void 0===r.compressor)throw s(a.runtime,"compressor adapter missing");if(void 0===r.transport)throw s(a.runtime,"transport adapter missing");return r})(a,n),rs=!0===a.unsafeRawAdapters?es:{...es,fs:_(es.fs,n.layout.workDir),transport:as(es.transport,a.config)},ts=void 0!==a.config?(os={...a.config},V(os),os):void 0;var os;const is=new AbortController,ns=void 0!==a.signal?AbortSignal.any([is.signal,a.signal]):is.signal,cs={fs:rs.fs,hash:rs.hash,compressor:rs.compressor,transport:rs.transport,progress:a.progress??i,layout:n.layout,cwd:ss,hashConfig:n.hashConfig,deltaCache:n.deltaCache,signal:ns},ds=void 0!==a.logger?o(a.logger):void 0,ls=!1===a.hooks?void 0:a.hooks??n.hooks;let ms;const fs=Object.freeze({...cs,...void 0!==ts?{config:ts}:{},...void 0!==ds?{logger:ds}:{},...void 0!==ls?{hooks:ls}:{},promisor:{fetch:s=>D(ms).fetch(s)}});ms=fs;let ps,hs="OPEN";const ws=()=>{if(fs.signal.aborted)throw r()},us=Object.freeze({add:(s,e)=>(ws(),I(fs,s,e)),branch:s=>(ws(),P(fs,s)),checkout:s=>(ws(),S(fs,s)),catFile:s=>(ws(),O(fs,s)),clone:s=>(ws(),x(fs,s)),commit:s=>(ws(),R(fs,s)),diff:s=>(ws(),j(fs,s)),fetch:s=>(ws(),y(fs,s)),fetchMissing:s=>(ws(),k(fs,s)),init:s=>(ws(),b(fs,s)),log:s=>(ws(),v(fs,s)),merge:s=>(ws(),g(fs,s)),push:s=>(ws(),u(fs,s)),reflog:s=>(ws(),w(fs,s)),reset:s=>(ws(),h(fs,s)),revParse:s=>(ws(),p(fs,s)),rm:(s,e)=>(ws(),f(fs,s,e)),sparseCheckout:s=>(ws(),m(fs,s)),status:()=>(ws(),l(fs)),submodules:s=>(ws(),d(fs,s)),tag:s=>(ws(),c(fs,s)),primitives:Object.freeze({catFileBatch:(s,e)=>(ws(),Z(fs,s,e)),createCommit:s=>(ws(),Y(fs,s)),diffTrees:(s,e,a)=>(ws(),K(fs,s,e,a)),getRepoRoot:()=>(ws(),J(fs)),mergeBase:(s,e)=>(ws(),H(fs,s,e)),readBlob:(s,e)=>(ws(),M(fs,s,e)),readIndex:()=>(ws(),L(fs)),readObject:(s,e)=>(ws(),G(fs,s,e)),readTree:s=>(ws(),q(fs,s)),recordRefUpdate:(s,e,a,r)=>(ws(),B(fs,s,e,a,r)),resolveRef:(s,e)=>(ws(),A(fs,s,e)),runHook:(s,e)=>(ws(),$(fs,s,e)),updateRef:(s,e,a)=>(ws(),F(fs,s,e,a)),walkCommits:s=>(ws(),W(fs,s)),walkSubmodules:s=>(ws(),U(fs,s)),walkTree:(s,e)=>(ws(),T(fs,s,e)),walkWorkingTree:s=>(ws(),N(fs,s)),writeObject:s=>(ws(),E(fs,s)),writeSymbolicRef:(s,e)=>(ws(),z(fs,s,e)),writeTree:s=>(ws(),C(fs,s))}),ctx:fs,dispose:async()=>{if("DISPOSED"!==hs)return void 0!==ps||(hs="DISPOSING",is.abort(),ps=(async()=>{await new Promise(s=>{"function"==typeof setImmediate?setImmediate(s):setTimeout(s,0)}),await(async s=>{await Promise.all(Q.map(e=>(async(s,e)=>{const a=s[e];if("function"==typeof a.dispose)try{await a.dispose()}catch(a){s.logger?.warn?.("disposeAdapters: port dispose threw",{port:e,err:String(a)})}})(s,e)))})(fs),hs="DISPOSED"})()),ps}});return us};export{ts as o};
|
|
2
|
+
//# sourceMappingURL=repository-Cs-dbHqO.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repository-Cs-dbHqO.js","sources":["../../../src/dispose-adapters.ts","../../../src/repository/deep-freeze.ts","../../../src/repository/validate-options.ts","../../../src/repository/wrap-fs-validator.ts","../../../src/repository/wrap-transport-validator.ts","../../../src/repository.ts","../../../src/repository/default-cwd.ts","../../../src/repository/compose-adapters.ts"],"sourcesContent":[null,null,null,null,null,null,null,null],"names":["DISPOSABLE_PORT_KEYS","walk","value","Object","isFrozen","freeze","key","keys","ABS_WINDOWS","wrapFsValidator","fs","cwd","guard","path","isContainedIn","pathspecOutsideRepo","read","p","readSlice","o","l","readUtf8","write","d","writeExclusive","writeUtf8","c","appendUtf8","exists","stat","lstat","readdir","mkdir","rm","rename","s","readlink","symlink","target","linkPath","chmod","mode","rmRecursive","openWithNoFollow","normalizeSeparators","replace","a","b","normalizedCwd","endsWith","startsWith","wrapTransportValidator","transport","config","allowInsecure","allowPrivateNetworks","resolver","dnsResolver","defaultResolver","request","async","req","validateUrl","url","openRepository","opts","fallback","undefined","test","isAbsolutePath","invalidOption","Number","isInteger","validateParallelism","parallelism","validateMaxResponseBytes","maxResponseBytes","validateBreakStaleLockMs","breakStaleLockMs","validateMaxObjectsPerPack","maxObjectsPerPack","validateMaxDnsResults","maxDnsResults","validateDnsResolver","validateOptions","isNode","globalThis","process","detected","overrides","resolved","hash","compressor","adapterUnavailable","runtime","composeAdapters","adapters","unsafeRawAdapters","layout","workDir","controller","AbortController","signal","AbortSignal","any","baseCtx","progress","noopProgress","hashConfig","deltaCache","sanitizedLogger","logger","wrapLoggerSanitizer","hooks","promisorCtx","ctx","promisor","fetch","oids","commands.createPromisorRemote","disposePromise","state","aborted","repositoryDisposed","repo","add","paths","addOpts","commands.add","branch","action","commands.branch","checkout","checkoutOpts","commands.checkout","catFile","commands.catFile","clone","cloneOpts","commands.clone","commit","commitOpts","commands.commit","diff","diffOpts","commands.diff","fetchOpts","commands.fetch","fetchMissing","fetchMissingOpts","commands.fetchMissing","init","initOpts","commands.init","log","logOpts","commands.log","merge","mergeOpts","commands.merge","push","pushOpts","commands.push","reflog","reflogOpts","commands.reflog","reset","resetOpts","commands.reset","revParse","expression","commands.revParse","rmOpts","commands.rm","sparseCheckout","commands.sparseCheckout","status","commands.status","submodules","commands.submodules","tag","commands.tag","primitives","catFileBatch","ids","options","primitives.catFileBatch","createCommit","input","primitives.createCommit","diffTrees","primitives.diffTrees","getRepoRoot","primitives.getRepoRoot","mergeBase","primitives.mergeBase","readBlob","id","primitives.readBlob","readIndex","primitives.readIndex","readObject","primitives.readObject","readTree","ref","primitives.readTree","recordRefUpdate","name","oldId","newId","message","primitives.recordRefUpdate","resolveRef","primitives.resolveRef","runHook","primitives.runHook","updateRef","primitives.updateRef","walkCommits","primitives.walkCommits","walkSubmodules","primitives.walkSubmodules","walkTree","treeIdOrObject","primitives.walkTree","walkWorkingTree","primitives.walkWorkingTree","writeObject","object","primitives.writeObject","writeSymbolicRef","primitives.writeSymbolicRef","writeTree","entries","primitives.writeTree","dispose","abort","Promise","resolve","setImmediate","setTimeout","all","map","port","err","warn","String","disposePort","disposeAdapters"],"mappings":"shBASA,MAAMA,EAAyD,CAC7D,KACA,YACA,aACA,QCSIC,EAAQC,IACZ,GAAc,OAAVA,GAAmC,iBAAVA,IACzBC,OAAOC,SAASF,GAApB,CACAC,OAAOE,OAAOH,GACd,IAAK,MAAMI,KAAOH,OAAOI,KAAKL,GAC5BD,EAAMC,EAAkCI,GAHd,GCsBxBE,EAAc,kBC5BPC,EAAkB,CAACC,EAAgBC,KAC9C,MAAMC,EAASC,IACb,IAAKC,GAAcD,EAAMF,GACvB,MAAMI,EAAoBF,IAG9B,MAAO,CACLG,KAAOC,IACLL,EAAMK,GACCP,EAAGM,KAAKC,IAEjBC,UAAW,CAACD,EAAGE,E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
|
|
1
|
-
export{a as add,b as branch,c as
|
|
1
|
+
export{a as add,b as branch,c as catFile,d as checkout,e as clone,f as commit,g as createPromisorRemote,h as diff,i as fetch,j as fetchMissing,k as init,l as log,m as merge,p as push,r as reflog,n as reset,o as revParse,q as rm,s as sparseCheckout,t as status,u as submodules,v as tag}from"../chunks/index-Jh5R-UmU.js";import"../chunks/error-MOmSzp9Z.js";import"../chunks/index-BjmofbKE.js";import"../chunks/readable-stream-CGuf8k1J.js";import"../transport/index.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as r,a as s,B as e,c as o}from"./chunks/browser-http-transport-
|
|
1
|
+
import{b as r,a as s,B as e,c as o}from"./chunks/browser-http-transport-DL8bkNdg.js";import{S as t,c as h}from"./chunks/lru-cache-Cy7C7Lx2.js";import{o as m}from"./chunks/repository-Cs-dbHqO.js";export{d as detectRuntime,i as isBrowser,a as isNode}from"./chunks/logger-DP2cCpvL.js";export{c as consoleProgress,n as noopProgress}from"./chunks/progress-NePjO3Kd.js";import"./chunks/error-MOmSzp9Z.js";import"./chunks/index-Jh5R-UmU.js";import"./chunks/index-BjmofbKE.js";import"./chunks/readable-stream-CGuf8k1J.js";import"./transport/index.js";const p=async a=>{const n=a.gitDirName??".git",i={fs:new s(a.rootHandle),hash:new r,compressor:new e,transport:new o,runtime:"browser",layout:{workDir:"/",gitDir:`/${n}`,bare:a.bare??!1},hashConfig:t,deltaCache:h(a.deltaCacheMaxBytes??16777216,a.deltaCacheMaxEntries??65536)},{rootHandle:c,gitDirName:p,bare:d,deltaCacheMaxBytes:u,deltaCacheMaxEntries:l,...g}=a;return m({cwd:"/",...g},i)};export{p as openRepository};
|
|
2
2
|
//# sourceMappingURL=index.browser.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{M as s,b as r,a as o,c as e}from"./chunks/memory-http-transport-
|
|
1
|
+
import{M as s,b as r,a as o,c as e}from"./chunks/memory-http-transport-COJU6VOL.js";import{a as t,S as m,c as p}from"./chunks/lru-cache-Cy7C7Lx2.js";import{o as h}from"./chunks/repository-Cs-dbHqO.js";export{d as detectRuntime,i as isBrowser,a as isNode}from"./chunks/logger-DP2cCpvL.js";export{c as consoleProgress,n as noopProgress}from"./chunks/progress-NePjO3Kd.js";import"./chunks/error-MOmSzp9Z.js";import"./chunks/index-Jh5R-UmU.js";import"./chunks/index-BjmofbKE.js";import"./chunks/readable-stream-CGuf8k1J.js";import"./transport/index.js";const u="/repo",l=async(a={})=>{const i=a.algorithm??"sha1",n={fs:new o(void 0===a.files?{rootDir:u}:{rootDir:u,files:a.files}),hash:new r(i),compressor:new s,transport:new e,runtime:"memory",layout:{workDir:u,gitDir:"/repo/.git",bare:!1},hashConfig:"sha256"===i?t:m,deltaCache:p(16777216)},{files:c,algorithm:l,...f}=a;return h({cwd:u,...f},n)};export{l as openRepository};
|
|
2
2
|
//# sourceMappingURL=index.default.js.map
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{d as detectRuntime,i as isBrowser,a as isNode,n as noopLogger,w as wrapLoggerSanitizer}from"./chunks/logger-
|
|
1
|
+
export{d as detectRuntime,i as isBrowser,a as isNode,n as noopLogger,w as wrapLoggerSanitizer}from"./chunks/logger-DP2cCpvL.js";export{c as consoleProgress,n as noopProgress}from"./chunks/progress-NePjO3Kd.js";export{a as add,b as branch,c as catFile,d as checkout,e as clone,f as commit,g as createPromisorRemote,h as diff,i as fetch,j as fetchMissing,k as init,l as log,m as merge,p as push,r as reflog,n as reset,o as revParse,q as rm,s as sparseCheckout,t as status,u as submodules,v as tag}from"./chunks/index-Jh5R-UmU.js";export{c as createContext}from"./chunks/context-CumKOV7K.js";import"./chunks/error-MOmSzp9Z.js";import"./chunks/index-BjmofbKE.js";import"./chunks/readable-stream-CGuf8k1J.js";import"./transport/index.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.node.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{realpath as r,stat as o}from"node:fs/promises";import*as s from"node:path";import{a as t,b as
|
|
1
|
+
import{realpath as r,stat as o}from"node:fs/promises";import*as s from"node:path";import{c as e,a as t,b as p,N as m,d as h}from"./chunks/node-http-transport-DYCFIJbc.js";import{S as l,c as u}from"./chunks/lru-cache-Cy7C7Lx2.js";import{o as w}from"./chunks/repository-Cs-dbHqO.js";export{d as detectRuntime,i as isBrowser,a as isNode}from"./chunks/logger-DP2cCpvL.js";export{c as consoleProgress,n as noopProgress}from"./chunks/progress-NePjO3Kd.js";import"node:zlib";import"./chunks/error-MOmSzp9Z.js";import"node:fs";import"node:crypto";import"node:child_process";import"node:http";import"node:https";import"node:stream";import"./chunks/index-Jh5R-UmU.js";import"./chunks/index-BjmofbKE.js";import"./chunks/readable-stream-CGuf8k1J.js";import"./transport/index.js";const f=async(o={})=>{const a=o.cwd??process.cwd(),n=await r(s.resolve(a)).catch(()=>s.resolve(a)),i=await k(n)??{workDir:n,gitDir:s.join(n,".git"),bare:!1},c={fs:new t(i.workDir),hash:new p,compressor:new m,transport:new h({allowInsecureHttp:o.allowInsecureHttp??!1}),hooks:new e,runtime:"node",layout:i,hashConfig:l,deltaCache:u(o.deltaCacheMaxBytes??16777216,o.deltaCacheMaxEntries??65536)},{cwd:d,allowInsecureHttp:f,deltaCacheMaxBytes:j,deltaCacheMaxEntries:g,...x}=o;return w({...x,cwd:n},c)},k=async r=>{let e=r;for(;;){const r=s.join(e,".git"),t=await o(r).catch(()=>{});if(t?.isDirectory())return{workDir:e,gitDir:r,bare:!1};const a=s.dirname(e);if(a===e)return;e=a}};export{f as openRepository};
|
|
2
2
|
//# sourceMappingURL=index.node.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.node.js","sources":["../../src/index.node.ts"],"sourcesContent":[null],"names":["openRepository","async","opts","cwd","process","resolvedCwd","realpath","nodePath","resolve","catch","layout","discoverLayout","workDir","gitDir","join","bare","fallback","fs","NodeFileSystem","hash","NodeHashService","compressor","NodeCompressor","transport","NodeHttpTransport","allowInsecureHttp","runtime","hashConfig","SHA1_CONFIG","deltaCache","createLruCache","deltaCacheMaxBytes","deltaCacheMaxEntries","_cwd","_a","_b","_c","coreOpts","openRepositoryCore","start","current","candidate","result","stat","isDirectory","parent","dirname"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.node.js","sources":["../../src/index.node.ts"],"sourcesContent":[null],"names":["openRepository","async","opts","cwd","process","resolvedCwd","realpath","nodePath","resolve","catch","layout","discoverLayout","workDir","gitDir","join","bare","fallback","fs","NodeFileSystem","hash","NodeHashService","compressor","NodeCompressor","transport","NodeHttpTransport","allowInsecureHttp","hooks","NodeHookRunner","runtime","hashConfig","SHA1_CONFIG","deltaCache","createLruCache","deltaCacheMaxBytes","deltaCacheMaxEntries","_cwd","_a","_b","_c","coreOpts","openRepositoryCore","start","current","candidate","result","stat","isDirectory","parent","dirname"],"mappings":"+vBAsBA,MAeaA,EAAiBC,MAAOC,EAAkC,MACrE,MAAMC,EAAMD,EAAKC,KAAOC,QAAQD,MAQ1BE,QAAoBC,EAASC,EAASC,QAAQL,IAAMM,MAAM,IAAMF,EAASC,QAAQL,IAKjFO,QAAgBC,EAAeN,IAAiB,CACpDO,QAASP,EACTQ,OAAQN,EAASO,KAAKT,EAAa,QACnCU,MAAM,GAQFC,EAAW,CACfC,GAPS,IAAIC,EAAeR,EAAOE,SAQnCO,KAPW,IAAIC,EAQfC,WAPiB,IAAIC,EAQrBC,UAPgB,IAAIC,EAAkB,CACtCC,kBAAmBvB,EAAKuB,oBAAqB,IAO7CC,MAAO,IAAIC,EACXC,QAAS,OACTlB,SACAmB,WAAYC,EACZC,WAAYC,EACV9B,EAAK+B,oBAlDuB,SAmD5B/B,EAAKgC,sBAlDyB,SAwDhC/B,IAAKgC,EACLV,kBAAmBW,EACnBH,mBAAoBI,EACpBH,qBAAsBI,KACnBC,GACDrC,EACJ,OAAOsC,EAAmB,IAAKD,EAAUpC,IAAKE,GAAeW,IAQzDL,EAAiBV,MACrBwC,IAEA,IAAIC,EAAUD,EACd,OAAa,CACX,MAAME,EAAYpC,EAASO,KAAK4B,EAAS,QACnCE,QAAeC,EAAKF,GAAWlC,MAAM,QAC3C,GAAImC,GAAQE,cACV,MAAO,CAAElC,QAAS8B,EAAS7B,OAAQ8B,EAAW5B,MAAM,GAEtD,MAAMgC,EAASxC,EAASyC,QAAQN,GAChC,GAAIK,IAAWL,EAAS,OACxBA,EAAUK,CACZ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{d as MAX_SPARSE_PATTERN_FILE_BYTES,g as appendReflog,h as applyChangeset,k as buildIndexFromTree,l as buildPack,n as catFileBatch,q as computeChangeset,s as createCommit,v as deleteReflog,w as diffTrees,z as enumeratePushObjects,B as enumerateRefs,D as fetchPack,G as getRepoRoot,L as invalidateConfigCache,P as isWorkingTreeDirty,Q as listReflogs,T as loadSparseMatcher,X as materializeTree,Y as mergeBase,a5 as readBlob,a6 as readConfig,a7 as readIndex,a8 as readObject,a9 as readReflog,aa as readShallow,ab as readSparsePatternText,ac as readTree,ad as recordRefUpdate,ag as reflogExists,ak as resolveRef,al as resolveReflogIdentity,am as runHook,ap as setConfigEntry,aq as setCoreConfigEntry,at as sparseCheckoutPath,au as synthesizeTreeFromIndex,ax as updateConfigEntries,ay as updateCoreConfig,az as updateRef,aA as updateShallow,aD as walkCommits,aE as walkSubmodules,aF as walkTree,aG as walkWorkingTree,aH as writeObject,aI as writeReflog,aJ as writeSparsePatternText,aK as writeSymbolicRef,aL as writeTree}from"../chunks/index-BjmofbKE.js";import"../chunks/error-MOmSzp9Z.js";import"../chunks/readable-stream-CGuf8k1J.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as Context, C as Compressor, I as InflateStreamResult, f as FileSystem, e as FileStat, D as DirEntry, F as FileHandle, H as HashService, g as Hasher } from '../../chunks/context-
|
|
1
|
+
import { b as Context, C as Compressor, I as InflateStreamResult, f as FileSystem, e as FileStat, D as DirEntry, F as FileHandle, H as HashService, g as Hasher } from '../../chunks/context-CMrHCVwK.cjs';
|
|
2
2
|
import { b as HttpTransport, H as HttpRequest, a as HttpResponse } from '../../chunks/http-transport-DirKfK2S.cjs';
|
|
3
3
|
|
|
4
4
|
interface BrowserAdapterOptions {
|
|
@@ -30,6 +30,7 @@ declare class BrowserFileSystem implements FileSystem {
|
|
|
30
30
|
write(path: string, data: Uint8Array): Promise<void>;
|
|
31
31
|
writeExclusive(path: string, data: Uint8Array): Promise<void>;
|
|
32
32
|
writeUtf8(path: string, content: string): Promise<void>;
|
|
33
|
+
appendUtf8(path: string, content: string): Promise<void>;
|
|
33
34
|
exists(path: string): Promise<boolean>;
|
|
34
35
|
stat(path: string): Promise<FileStat>;
|
|
35
36
|
lstat(path: string): Promise<FileStat>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as Context, C as Compressor, I as InflateStreamResult, f as FileSystem, e as FileStat, D as DirEntry, F as FileHandle, H as HashService, g as Hasher } from '../../chunks/context-
|
|
1
|
+
import { b as Context, C as Compressor, I as InflateStreamResult, f as FileSystem, e as FileStat, D as DirEntry, F as FileHandle, H as HashService, g as Hasher } from '../../chunks/context-BORy7yXb.js';
|
|
2
2
|
import { b as HttpTransport, H as HttpRequest, a as HttpResponse } from '../../chunks/http-transport-DirKfK2S.js';
|
|
3
3
|
|
|
4
4
|
interface BrowserAdapterOptions {
|
|
@@ -30,6 +30,7 @@ declare class BrowserFileSystem implements FileSystem {
|
|
|
30
30
|
write(path: string, data: Uint8Array): Promise<void>;
|
|
31
31
|
writeExclusive(path: string, data: Uint8Array): Promise<void>;
|
|
32
32
|
writeUtf8(path: string, content: string): Promise<void>;
|
|
33
|
+
appendUtf8(path: string, content: string): Promise<void>;
|
|
33
34
|
exists(path: string): Promise<boolean>;
|
|
34
35
|
stat(path: string): Promise<FileStat>;
|
|
35
36
|
lstat(path: string): Promise<FileStat>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as Context, C as Compressor, I as InflateStreamResult, f as FileSystem, e as FileStat, D as DirEntry, F as FileHandle, H as HashService, g as Hasher } from '../../chunks/context-
|
|
1
|
+
import { k as HookRunner, b as Context, C as Compressor, I as InflateStreamResult, f as FileSystem, e as FileStat, D as DirEntry, F as FileHandle, H as HashService, g as Hasher, h as HookName, j as HookResult, i as HookRequest } from '../../chunks/context-CMrHCVwK.cjs';
|
|
2
2
|
import { b as HttpTransport, H as HttpRequest, a as HttpResponse } from '../../chunks/http-transport-DirKfK2S.cjs';
|
|
3
3
|
|
|
4
4
|
interface MemoryAdapterOptions {
|
|
@@ -9,6 +9,8 @@ interface MemoryAdapterOptions {
|
|
|
9
9
|
readonly deltaCacheMaxEntries?: number;
|
|
10
10
|
/** Optional home directory exposed via `ctx.layout.homeDir` (default: undefined). */
|
|
11
11
|
readonly homeDir?: string;
|
|
12
|
+
/** Optional hook runner exposed via `ctx.hooks` (default: undefined — hooks inert). */
|
|
13
|
+
readonly hooks?: HookRunner;
|
|
12
14
|
}
|
|
13
15
|
declare function createMemoryContext(options?: MemoryAdapterOptions): Context;
|
|
14
16
|
|
|
@@ -37,6 +39,8 @@ declare class MemoryFileSystem implements FileSystem {
|
|
|
37
39
|
write: (path: string, data: Uint8Array) => Promise<void>;
|
|
38
40
|
writeExclusive: (path: string, data: Uint8Array) => Promise<void>;
|
|
39
41
|
writeUtf8: (path: string, content: string) => Promise<void>;
|
|
42
|
+
appendUtf8: (path: string, content: string) => Promise<void>;
|
|
43
|
+
private readExistingUtf8;
|
|
40
44
|
exists: (path: string) => Promise<boolean>;
|
|
41
45
|
/** POSIX ELOOP threshold — symlink chains longer than this are cycle-detected. */
|
|
42
46
|
private static readonly SYMLINK_FOLLOW_LIMIT;
|
|
@@ -77,6 +81,21 @@ declare class MemoryHashService implements HashService {
|
|
|
77
81
|
createHasher: () => Hasher;
|
|
78
82
|
}
|
|
79
83
|
|
|
84
|
+
/**
|
|
85
|
+
* In-memory `HookRunner` test double. Constructed with a per-hook outcome map;
|
|
86
|
+
* an unmapped hook resolves `skipped`. Every invocation is recorded on `calls`
|
|
87
|
+
* so a test can assert the request a command built (name, args, stdin,
|
|
88
|
+
* hooksDir) without spawning a process.
|
|
89
|
+
*/
|
|
90
|
+
declare class MemoryHookRunner implements HookRunner {
|
|
91
|
+
private readonly outcomes;
|
|
92
|
+
private readonly recorded;
|
|
93
|
+
constructor(outcomes?: Partial<Record<HookName, HookResult>>);
|
|
94
|
+
/** Every `HookRequest` received, in invocation order. */
|
|
95
|
+
get calls(): ReadonlyArray<HookRequest>;
|
|
96
|
+
run(request: HookRequest): Promise<HookResult>;
|
|
97
|
+
}
|
|
98
|
+
|
|
80
99
|
interface MockSetup {
|
|
81
100
|
readonly method: 'GET' | 'POST';
|
|
82
101
|
readonly url: string;
|
|
@@ -93,5 +112,5 @@ declare class MemoryHttpTransport implements HttpTransport {
|
|
|
93
112
|
clearMocks(): void;
|
|
94
113
|
}
|
|
95
114
|
|
|
96
|
-
export { MemoryCompressor, MemoryFileSystem, MemoryHashService, MemoryHttpTransport, createMemoryContext };
|
|
115
|
+
export { MemoryCompressor, MemoryFileSystem, MemoryHashService, MemoryHookRunner, MemoryHttpTransport, createMemoryContext };
|
|
97
116
|
export type { MemoryAdapterOptions, MemoryFileSystemOptions, MockSetup };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as Context, C as Compressor, I as InflateStreamResult, f as FileSystem, e as FileStat, D as DirEntry, F as FileHandle, H as HashService, g as Hasher } from '../../chunks/context-
|
|
1
|
+
import { k as HookRunner, b as Context, C as Compressor, I as InflateStreamResult, f as FileSystem, e as FileStat, D as DirEntry, F as FileHandle, H as HashService, g as Hasher, h as HookName, j as HookResult, i as HookRequest } from '../../chunks/context-BORy7yXb.js';
|
|
2
2
|
import { b as HttpTransport, H as HttpRequest, a as HttpResponse } from '../../chunks/http-transport-DirKfK2S.js';
|
|
3
3
|
|
|
4
4
|
interface MemoryAdapterOptions {
|
|
@@ -9,6 +9,8 @@ interface MemoryAdapterOptions {
|
|
|
9
9
|
readonly deltaCacheMaxEntries?: number;
|
|
10
10
|
/** Optional home directory exposed via `ctx.layout.homeDir` (default: undefined). */
|
|
11
11
|
readonly homeDir?: string;
|
|
12
|
+
/** Optional hook runner exposed via `ctx.hooks` (default: undefined — hooks inert). */
|
|
13
|
+
readonly hooks?: HookRunner;
|
|
12
14
|
}
|
|
13
15
|
declare function createMemoryContext(options?: MemoryAdapterOptions): Context;
|
|
14
16
|
|
|
@@ -37,6 +39,8 @@ declare class MemoryFileSystem implements FileSystem {
|
|
|
37
39
|
write: (path: string, data: Uint8Array) => Promise<void>;
|
|
38
40
|
writeExclusive: (path: string, data: Uint8Array) => Promise<void>;
|
|
39
41
|
writeUtf8: (path: string, content: string) => Promise<void>;
|
|
42
|
+
appendUtf8: (path: string, content: string) => Promise<void>;
|
|
43
|
+
private readExistingUtf8;
|
|
40
44
|
exists: (path: string) => Promise<boolean>;
|
|
41
45
|
/** POSIX ELOOP threshold — symlink chains longer than this are cycle-detected. */
|
|
42
46
|
private static readonly SYMLINK_FOLLOW_LIMIT;
|
|
@@ -77,6 +81,21 @@ declare class MemoryHashService implements HashService {
|
|
|
77
81
|
createHasher: () => Hasher;
|
|
78
82
|
}
|
|
79
83
|
|
|
84
|
+
/**
|
|
85
|
+
* In-memory `HookRunner` test double. Constructed with a per-hook outcome map;
|
|
86
|
+
* an unmapped hook resolves `skipped`. Every invocation is recorded on `calls`
|
|
87
|
+
* so a test can assert the request a command built (name, args, stdin,
|
|
88
|
+
* hooksDir) without spawning a process.
|
|
89
|
+
*/
|
|
90
|
+
declare class MemoryHookRunner implements HookRunner {
|
|
91
|
+
private readonly outcomes;
|
|
92
|
+
private readonly recorded;
|
|
93
|
+
constructor(outcomes?: Partial<Record<HookName, HookResult>>);
|
|
94
|
+
/** Every `HookRequest` received, in invocation order. */
|
|
95
|
+
get calls(): ReadonlyArray<HookRequest>;
|
|
96
|
+
run(request: HookRequest): Promise<HookResult>;
|
|
97
|
+
}
|
|
98
|
+
|
|
80
99
|
interface MockSetup {
|
|
81
100
|
readonly method: 'GET' | 'POST';
|
|
82
101
|
readonly url: string;
|
|
@@ -93,5 +112,5 @@ declare class MemoryHttpTransport implements HttpTransport {
|
|
|
93
112
|
clearMocks(): void;
|
|
94
113
|
}
|
|
95
114
|
|
|
96
|
-
export { MemoryCompressor, MemoryFileSystem, MemoryHashService, MemoryHttpTransport, createMemoryContext };
|
|
115
|
+
export { MemoryCompressor, MemoryFileSystem, MemoryHashService, MemoryHookRunner, MemoryHttpTransport, createMemoryContext };
|
|
97
116
|
export type { MemoryAdapterOptions, MemoryFileSystemOptions, MockSetup };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as Context, C as Compressor, I as InflateStreamResult, f as FileSystem, e as FileStat, D as DirEntry, F as FileHandle, H as HashService, g as Hasher } from '../../chunks/context-
|
|
1
|
+
import { b as Context, C as Compressor, I as InflateStreamResult, f as FileSystem, e as FileStat, D as DirEntry, F as FileHandle, H as HashService, g as Hasher, k as HookRunner, i as HookRequest, j as HookResult } from '../../chunks/context-CMrHCVwK.cjs';
|
|
2
2
|
import { b as HttpTransport, H as HttpRequest, a as HttpResponse } from '../../chunks/http-transport-DirKfK2S.cjs';
|
|
3
3
|
|
|
4
4
|
interface NodeAdapterOptions {
|
|
@@ -9,6 +9,12 @@ interface NodeAdapterOptions {
|
|
|
9
9
|
readonly signal?: AbortSignal;
|
|
10
10
|
readonly deltaCacheMaxBytes?: number;
|
|
11
11
|
readonly deltaCacheMaxEntries?: number;
|
|
12
|
+
/**
|
|
13
|
+
* Wire the git-hook runner (default true). Pass `false` to disable hooks.
|
|
14
|
+
* A wired runner spawns `.git/hooks/*` scripts that inherit the full
|
|
15
|
+
* `process.env` — disable it for repositories you do not trust.
|
|
16
|
+
*/
|
|
17
|
+
readonly hooks?: boolean;
|
|
12
18
|
}
|
|
13
19
|
declare function createNodeContext(options: NodeAdapterOptions): Context;
|
|
14
20
|
|
|
@@ -42,7 +48,7 @@ declare class NodeCompressor implements Compressor {
|
|
|
42
48
|
*
|
|
43
49
|
* @internal — not re-exported from `src/adapters/node/index.ts`.
|
|
44
50
|
*/
|
|
45
|
-
type FsOperations = Pick<typeof fsPromises, 'chmod' | 'lstat' | 'mkdir' | 'open' | 'readdir' | 'readFile' | 'readlink' | 'realpath' | 'rename' | 'rm' | 'rmdir' | 'stat' | 'symlink' | 'writeFile'>;
|
|
51
|
+
type FsOperations = Pick<typeof fsPromises, 'appendFile' | 'chmod' | 'lstat' | 'mkdir' | 'open' | 'readdir' | 'readFile' | 'readlink' | 'realpath' | 'rename' | 'rm' | 'rmdir' | 'stat' | 'symlink' | 'writeFile'>;
|
|
46
52
|
|
|
47
53
|
/**
|
|
48
54
|
* Path-policy abstraction.
|
|
@@ -146,6 +152,7 @@ declare class NodeFileSystem implements FileSystem {
|
|
|
146
152
|
write: (path: string, data: Uint8Array) => Promise<void>;
|
|
147
153
|
writeExclusive: (path: string, data: Uint8Array) => Promise<void>;
|
|
148
154
|
writeUtf8: (path: string, content: string) => Promise<void>;
|
|
155
|
+
appendUtf8: (path: string, content: string) => Promise<void>;
|
|
149
156
|
exists: (path: string) => Promise<boolean>;
|
|
150
157
|
stat: (path: string) => Promise<FileStat>;
|
|
151
158
|
lstat: (path: string) => Promise<FileStat>;
|
|
@@ -176,6 +183,60 @@ declare class NodeHashService implements HashService {
|
|
|
176
183
|
createHasher: () => Hasher;
|
|
177
184
|
}
|
|
178
185
|
|
|
186
|
+
/** Minimal `stat` result `NodeHookRunner` consumes. */
|
|
187
|
+
interface HookStat {
|
|
188
|
+
readonly mode: number;
|
|
189
|
+
isFile(): boolean;
|
|
190
|
+
}
|
|
191
|
+
/** Minimal readable-stream surface — a hook's stdout / stderr. */
|
|
192
|
+
interface HookReadable {
|
|
193
|
+
on(event: 'data', listener: (chunk: Buffer) => void): void;
|
|
194
|
+
}
|
|
195
|
+
/** Minimal writable surface — a hook's stdin. */
|
|
196
|
+
interface HookWritable {
|
|
197
|
+
on(event: 'error', listener: () => void): void;
|
|
198
|
+
end(data: string): void;
|
|
199
|
+
}
|
|
200
|
+
/** Minimal child-process surface `NodeHookRunner` consumes. */
|
|
201
|
+
interface HookChild {
|
|
202
|
+
readonly stdout: HookReadable;
|
|
203
|
+
readonly stderr: HookReadable;
|
|
204
|
+
readonly stdin: HookWritable;
|
|
205
|
+
on(event: 'error', listener: (err: Error) => void): void;
|
|
206
|
+
on(event: 'close', listener: (code: number | null) => void): void;
|
|
207
|
+
kill(): void;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Injectable process / filesystem surface. Production uses the Node builtins;
|
|
211
|
+
* unit tests inject a fake so every branch is exercised deterministically
|
|
212
|
+
* without spawning a real process (mirrors `FsOperations` — ADR-047).
|
|
213
|
+
*/
|
|
214
|
+
interface HookRunnerOps {
|
|
215
|
+
readonly stat: (path: string) => Promise<HookStat>;
|
|
216
|
+
readonly spawn: (command: string, args: ReadonlyArray<string>, options: {
|
|
217
|
+
readonly cwd: string;
|
|
218
|
+
readonly env: NodeJS.ProcessEnv;
|
|
219
|
+
}) => HookChild;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Node `HookRunner`: resolves `${hooksDir}/${name}` and, when it exists and is
|
|
223
|
+
* executable, spawns it via `node:child_process`. The hook inherits the
|
|
224
|
+
* process environment plus `GIT_DIR` / `GIT_INDEX_FILE`, runs with `cwd` at the
|
|
225
|
+
* working tree, and its output is captured (bounded). Never rejects for a
|
|
226
|
+
* non-zero exit.
|
|
227
|
+
*/
|
|
228
|
+
declare class NodeHookRunner implements HookRunner {
|
|
229
|
+
private readonly isWindows;
|
|
230
|
+
private readonly ops;
|
|
231
|
+
constructor(platform?: NodeJS.Platform, ops?: HookRunnerOps);
|
|
232
|
+
run(request: HookRequest): Promise<HookResult>;
|
|
233
|
+
/**
|
|
234
|
+
* A hook is runnable when it is a regular file that is executable. Windows
|
|
235
|
+
* has no executable bit, so any regular file qualifies (see ADR-068).
|
|
236
|
+
*/
|
|
237
|
+
private isRunnable;
|
|
238
|
+
}
|
|
239
|
+
|
|
179
240
|
interface NodeHttpTransportOptions {
|
|
180
241
|
readonly allowInsecureHttp?: boolean;
|
|
181
242
|
}
|
|
@@ -185,5 +246,5 @@ declare class NodeHttpTransport implements HttpTransport {
|
|
|
185
246
|
request: (req: HttpRequest) => Promise<HttpResponse>;
|
|
186
247
|
}
|
|
187
248
|
|
|
188
|
-
export { NodeCompressor, NodeFileSystem, NodeHashService, NodeHttpTransport, createNodeContext };
|
|
249
|
+
export { NodeCompressor, NodeFileSystem, NodeHashService, NodeHookRunner, NodeHttpTransport, createNodeContext };
|
|
189
250
|
export type { NodeAdapterOptions, NodeHttpTransportOptions };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as Context, C as Compressor, I as InflateStreamResult, f as FileSystem, e as FileStat, D as DirEntry, F as FileHandle, H as HashService, g as Hasher } from '../../chunks/context-
|
|
1
|
+
import { b as Context, C as Compressor, I as InflateStreamResult, f as FileSystem, e as FileStat, D as DirEntry, F as FileHandle, H as HashService, g as Hasher, k as HookRunner, i as HookRequest, j as HookResult } from '../../chunks/context-BORy7yXb.js';
|
|
2
2
|
import { b as HttpTransport, H as HttpRequest, a as HttpResponse } from '../../chunks/http-transport-DirKfK2S.js';
|
|
3
3
|
|
|
4
4
|
interface NodeAdapterOptions {
|
|
@@ -9,6 +9,12 @@ interface NodeAdapterOptions {
|
|
|
9
9
|
readonly signal?: AbortSignal;
|
|
10
10
|
readonly deltaCacheMaxBytes?: number;
|
|
11
11
|
readonly deltaCacheMaxEntries?: number;
|
|
12
|
+
/**
|
|
13
|
+
* Wire the git-hook runner (default true). Pass `false` to disable hooks.
|
|
14
|
+
* A wired runner spawns `.git/hooks/*` scripts that inherit the full
|
|
15
|
+
* `process.env` — disable it for repositories you do not trust.
|
|
16
|
+
*/
|
|
17
|
+
readonly hooks?: boolean;
|
|
12
18
|
}
|
|
13
19
|
declare function createNodeContext(options: NodeAdapterOptions): Context;
|
|
14
20
|
|
|
@@ -42,7 +48,7 @@ declare class NodeCompressor implements Compressor {
|
|
|
42
48
|
*
|
|
43
49
|
* @internal — not re-exported from `src/adapters/node/index.ts`.
|
|
44
50
|
*/
|
|
45
|
-
type FsOperations = Pick<typeof fsPromises, 'chmod' | 'lstat' | 'mkdir' | 'open' | 'readdir' | 'readFile' | 'readlink' | 'realpath' | 'rename' | 'rm' | 'rmdir' | 'stat' | 'symlink' | 'writeFile'>;
|
|
51
|
+
type FsOperations = Pick<typeof fsPromises, 'appendFile' | 'chmod' | 'lstat' | 'mkdir' | 'open' | 'readdir' | 'readFile' | 'readlink' | 'realpath' | 'rename' | 'rm' | 'rmdir' | 'stat' | 'symlink' | 'writeFile'>;
|
|
46
52
|
|
|
47
53
|
/**
|
|
48
54
|
* Path-policy abstraction.
|
|
@@ -146,6 +152,7 @@ declare class NodeFileSystem implements FileSystem {
|
|
|
146
152
|
write: (path: string, data: Uint8Array) => Promise<void>;
|
|
147
153
|
writeExclusive: (path: string, data: Uint8Array) => Promise<void>;
|
|
148
154
|
writeUtf8: (path: string, content: string) => Promise<void>;
|
|
155
|
+
appendUtf8: (path: string, content: string) => Promise<void>;
|
|
149
156
|
exists: (path: string) => Promise<boolean>;
|
|
150
157
|
stat: (path: string) => Promise<FileStat>;
|
|
151
158
|
lstat: (path: string) => Promise<FileStat>;
|
|
@@ -176,6 +183,60 @@ declare class NodeHashService implements HashService {
|
|
|
176
183
|
createHasher: () => Hasher;
|
|
177
184
|
}
|
|
178
185
|
|
|
186
|
+
/** Minimal `stat` result `NodeHookRunner` consumes. */
|
|
187
|
+
interface HookStat {
|
|
188
|
+
readonly mode: number;
|
|
189
|
+
isFile(): boolean;
|
|
190
|
+
}
|
|
191
|
+
/** Minimal readable-stream surface — a hook's stdout / stderr. */
|
|
192
|
+
interface HookReadable {
|
|
193
|
+
on(event: 'data', listener: (chunk: Buffer) => void): void;
|
|
194
|
+
}
|
|
195
|
+
/** Minimal writable surface — a hook's stdin. */
|
|
196
|
+
interface HookWritable {
|
|
197
|
+
on(event: 'error', listener: () => void): void;
|
|
198
|
+
end(data: string): void;
|
|
199
|
+
}
|
|
200
|
+
/** Minimal child-process surface `NodeHookRunner` consumes. */
|
|
201
|
+
interface HookChild {
|
|
202
|
+
readonly stdout: HookReadable;
|
|
203
|
+
readonly stderr: HookReadable;
|
|
204
|
+
readonly stdin: HookWritable;
|
|
205
|
+
on(event: 'error', listener: (err: Error) => void): void;
|
|
206
|
+
on(event: 'close', listener: (code: number | null) => void): void;
|
|
207
|
+
kill(): void;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Injectable process / filesystem surface. Production uses the Node builtins;
|
|
211
|
+
* unit tests inject a fake so every branch is exercised deterministically
|
|
212
|
+
* without spawning a real process (mirrors `FsOperations` — ADR-047).
|
|
213
|
+
*/
|
|
214
|
+
interface HookRunnerOps {
|
|
215
|
+
readonly stat: (path: string) => Promise<HookStat>;
|
|
216
|
+
readonly spawn: (command: string, args: ReadonlyArray<string>, options: {
|
|
217
|
+
readonly cwd: string;
|
|
218
|
+
readonly env: NodeJS.ProcessEnv;
|
|
219
|
+
}) => HookChild;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Node `HookRunner`: resolves `${hooksDir}/${name}` and, when it exists and is
|
|
223
|
+
* executable, spawns it via `node:child_process`. The hook inherits the
|
|
224
|
+
* process environment plus `GIT_DIR` / `GIT_INDEX_FILE`, runs with `cwd` at the
|
|
225
|
+
* working tree, and its output is captured (bounded). Never rejects for a
|
|
226
|
+
* non-zero exit.
|
|
227
|
+
*/
|
|
228
|
+
declare class NodeHookRunner implements HookRunner {
|
|
229
|
+
private readonly isWindows;
|
|
230
|
+
private readonly ops;
|
|
231
|
+
constructor(platform?: NodeJS.Platform, ops?: HookRunnerOps);
|
|
232
|
+
run(request: HookRequest): Promise<HookResult>;
|
|
233
|
+
/**
|
|
234
|
+
* A hook is runnable when it is a regular file that is executable. Windows
|
|
235
|
+
* has no executable bit, so any regular file qualifies (see ADR-068).
|
|
236
|
+
*/
|
|
237
|
+
private isRunnable;
|
|
238
|
+
}
|
|
239
|
+
|
|
179
240
|
interface NodeHttpTransportOptions {
|
|
180
241
|
readonly allowInsecureHttp?: boolean;
|
|
181
242
|
}
|
|
@@ -185,5 +246,5 @@ declare class NodeHttpTransport implements HttpTransport {
|
|
|
185
246
|
request: (req: HttpRequest) => Promise<HttpResponse>;
|
|
186
247
|
}
|
|
187
248
|
|
|
188
|
-
export { NodeCompressor, NodeFileSystem, NodeHashService, NodeHttpTransport, createNodeContext };
|
|
249
|
+
export { NodeCompressor, NodeFileSystem, NodeHashService, NodeHookRunner, NodeHttpTransport, createNodeContext };
|
|
189
250
|
export type { NodeAdapterOptions, NodeHttpTransportOptions };
|